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 12 of file SchemaCustomAttributeModel.hpp.

Constructor & Destructor Documentation

◆ CustomAttributeModel()

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

Definition at line 5 of file SchemaCustomAttributeModel.cpp.

8 : CustomModelInterface ( Headers ),
9 SchemaClass ( ClassInfo ),
10 SchemaDerived ( Derived )
11{
12 setupModel();
13}
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 15 of file SchemaCustomAttributeModel.cpp.

16{
17 Data.clear();
18 const std::list<OksAttribute *> * AttributeList;
19
20 if ( SchemaDerived )
21 {
22 AttributeList = SchemaClass->all_attributes();
23 }
24 else
25 {
26 AttributeList = SchemaClass->direct_attributes();
27 }
28
29 if ( AttributeList )
30 {
31 for ( OksAttribute * Attribute : *AttributeList )
32 {
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}
OKS attribute class.
const std::list< OksAttribute * > * all_attributes() const noexcept
Definition class.hpp:475
const std::list< OksAttribute * > * direct_attributes() const noexcept
Definition class.hpp:480

Member Data Documentation

◆ SchemaClass

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

Definition at line 19 of file SchemaCustomAttributeModel.hpp.

◆ SchemaDerived

bool dbse::CustomAttributeModel::SchemaDerived
private

Definition at line 20 of file SchemaCustomAttributeModel.hpp.


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