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
5// apps/SchemaEditor/SchemaCustomAttributeModel.cpp).
6
8
9using namespace dunedaq::oks;
10
11dbse::CustomAttributeModel::CustomAttributeModel(OksClass* ClassInfo, QStringList Headers, bool Derived)
12 : CustomModelInterface(Headers)
13 , SchemaClass(ClassInfo)
14 , SchemaDerived(Derived)
15{
16 setupModel();
17}
18
19void
21{
22 Data.clear();
23 const std::list<OksAttribute*>* AttributeList;
24
25 if (SchemaDerived) {
26 AttributeList = SchemaClass->all_attributes();
27 } else {
28 AttributeList = SchemaClass->direct_attributes();
29 }
30
31 if (AttributeList) {
32 for (OksAttribute* Attribute : *AttributeList) {
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}
40
CustomAttributeModel(dunedaq::oks::OksClass *ClassInfo, QStringList Headers, bool Derived=false)
CustomModelInterface(QStringList Headers, QObject *parent=nullptr)
Including Schema Editor.
OKS attribute class.
Definition attribute.hpp:94
The OKS class.
Definition class.hpp:223