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::OksClassSchemaClass
bool SchemaDerived

Additional Inherited Members

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

Detailed Description

Definition at line 17 of file SchemaCustomAttributeModel.hpp.

Constructor & Destructor Documentation

◆ CustomAttributeModel()

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

Definition at line 10 of file SchemaCustomAttributeModel.cpp.

13 : CustomModelInterface ( Headers ),
14 SchemaClass ( ClassInfo ),
15 SchemaDerived ( Derived )
16{
17 setupModel();
18}
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 {
27 AttributeList = SchemaClass->all_attributes();
28 }
29 else
30 {
31 AttributeList = SchemaClass->direct_attributes();
32 }
33
34 if ( AttributeList )
35 {
36 for ( OksAttribute * Attribute : *AttributeList )
37 {
38 QStringList Row;
39 Row.append ( QString::fromStdString ( Attribute->get_name() ) );
40 Row.append ( QString::fromStdString ( Attribute->get_type() ) );
41 Data.append ( Row );
42 }
43 }
44}

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: