DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
SchemaCustomAttributeModel.cpp
Go to the documentation of this file.
1// DUNE DAQ modification notice:
2// This file has been modified from the original ATLAS dbe source for the DUNE DAQ project.
3// Fork baseline commit: dbe-02-12-17 (2022-05-12).
4// Renamed since fork: yes (from src/SchemaEditor/SchemaCustomAttributeModel.cpp to apps/SchemaEditor/SchemaCustomAttributeModel.cpp).
5
7
8using namespace dunedaq::oks;
9
11 QStringList Headers,
12 bool Derived )
13 : CustomModelInterface ( Headers ),
14 SchemaClass ( ClassInfo ),
15 SchemaDerived ( Derived )
16{
17 setupModel();
18}
19
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}
45
CustomAttributeModel(dunedaq::oks::OksClass *ClassInfo, QStringList Headers, bool Derived=false)
CustomModelInterface(QStringList Headers, QObject *parent=nullptr)
Including Schema Editor.
OKS attribute class.
The OKS class.
Definition class.hpp:205