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

#include <SchemaCustomMethodModel.hpp>

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

Public Member Functions

 CustomMethodModel (dunedaq::oks::OksClass *ClassInfo, QStringList Headers, bool Derived=false)
 ~CustomMethodModel ()
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 20 of file SchemaCustomMethodModel.hpp.

Constructor & Destructor Documentation

◆ CustomMethodModel()

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

Definition at line 10 of file SchemaCustomMethodModel.cpp.

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

◆ ~CustomMethodModel()

dbse::CustomMethodModel::~CustomMethodModel ( )
default

Member Function Documentation

◆ setupModel()

void dbse::CustomMethodModel::setupModel ( )
virtual

Implements dbse::CustomModelInterface.

Definition at line 19 of file SchemaCustomMethodModel.cpp.

20{
21 Data.clear();
22 const std::list<OksMethod *> * MethodList;
23 std::set<std::string> direct_methods;
24 auto methods = SchemaClass->direct_methods();
25 if (methods != nullptr) {
26 for (auto method : *methods) {
27 direct_methods.insert(method->get_name());
28 }
29 }
30
31 if ( SchemaDerived )
32 {
33 MethodList = SchemaClass->all_methods();
34 }
35 else
36 {
37 MethodList = SchemaClass->direct_methods();
38 }
39
40 if ( MethodList != nullptr )
41 {
42 for ( OksMethod * Method : *MethodList )
43 {
44 QStringList row;
45 auto name = Method->get_name();
46 row.append ( QString::fromStdString ( name ) );
47 if (direct_methods.contains(name)) {
48 row.append("D");
49 }
50 else {
51 row.append("I");
52 }
53 Data.append ( row );
54 }
55 }
56}

Member Data Documentation

◆ SchemaClass

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

Definition at line 27 of file SchemaCustomMethodModel.hpp.

◆ SchemaDerived

bool dbse::CustomMethodModel::SchemaDerived
private

Definition at line 28 of file SchemaCustomMethodModel.hpp.


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