DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
dbse::CustomAttributeModel Class Reference

#include <SchemaCustomAttributeModel.hpp>

Inheritance diagram for dbse::CustomAttributeModel:
[legend]
Collaboration diagram for dbse::CustomAttributeModel:
[legend]

Public Member Functions

 CustomAttributeModel (dunedaq::oks::OksClass *ClassInfo, QStringList Headers, bool Derived=false)
 ~CustomAttributeModel ()
void setupModel ()
Public Member Functions inherited from dbse::CustomModelInterface
 CustomModelInterface (QStringList Headers, QObject *parent=nullptr)
 Including Schema Editor.
 ~CustomModelInterface ()
int rowCount (const QModelIndex &parent) const
int columnCount (const QModelIndex &parent) const
Qt::ItemFlags flags (const QModelIndex &index) const
QVariant headerData (int section, Qt::Orientation orientation, int role) const
QVariant data (const QModelIndex &index, int role) const
QStringList getRowFromIndex (QModelIndex &index)

Private Attributes

dunedaq::oks::OksClass * SchemaClass
bool SchemaDerived

Additional Inherited Members

Protected Attributes inherited from dbse::CustomModelInterface
QStringList HeaderList
QList< QStringList > Data

Detailed Description

Definition at line 16 of file SchemaCustomAttributeModel.hpp.

Constructor & Destructor Documentation

◆ CustomAttributeModel()

dbse::CustomAttributeModel::CustomAttributeModel ( dunedaq::oks::OksClass * ClassInfo,
QStringList Headers,
bool Derived = false )

Definition at line 11 of file SchemaCustomAttributeModel.cpp.

12 : CustomModelInterface(Headers)
13 , SchemaClass(ClassInfo)
14 , SchemaDerived(Derived)
15{
16 setupModel();
17}
CustomModelInterface(QStringList Headers, QObject *parent=nullptr)
Including Schema Editor.

◆ ~CustomAttributeModel()

dbse::CustomAttributeModel::~CustomAttributeModel ( )
default

Member Function Documentation

◆ setupModel()

void dbse::CustomAttributeModel::setupModel ( )
virtual

Implements dbse::CustomModelInterface.

Definition at line 20 of file SchemaCustomAttributeModel.cpp.

21{
22 Data.clear();
23 const std::list<OksAttribute*>* AttributeList;
24
25 if (SchemaDerived) {
26 AttributeList = SchemaClass->all_attributes();
27 } else {
28 AttributeList = SchemaClass->direct_attributes();
29 }
30
31 if (AttributeList) {
32 for (OksAttribute* Attribute : *AttributeList) {
33 QStringList Row;
34 Row.append(QString::fromStdString(Attribute->get_name()));
35 Row.append(QString::fromStdString(Attribute->get_type()));
36 Data.append(Row);
37 }
38 }
39}
const std::list< OksAttribute * > * all_attributes() const noexcept
Definition class.hpp:470
const std::list< OksAttribute * > * direct_attributes() const noexcept
Definition class.hpp:474

Member Data Documentation

◆ SchemaClass

dunedaq::oks::OksClass* dbse::CustomAttributeModel::SchemaClass
private

Definition at line 24 of file SchemaCustomAttributeModel.hpp.

◆ SchemaDerived

bool dbse::CustomAttributeModel::SchemaDerived
private

Definition at line 25 of file SchemaCustomAttributeModel.hpp.


The documentation for this class was generated from the following files: