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::OksClass * SchemaClass
bool SchemaDerived

Additional Inherited Members

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

Detailed Description

Definition at line 19 of file SchemaCustomMethodModel.hpp.

Constructor & Destructor Documentation

◆ CustomMethodModel()

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

Definition at line 11 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 20 of file SchemaCustomMethodModel.cpp.

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

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: