Line data Source code
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 :
7 : #include "dbe/SchemaCustomAttributeModel.hpp"
8 :
9 : using namespace dunedaq::oks;
10 :
11 0 : dbse::CustomAttributeModel::CustomAttributeModel(OksClass* ClassInfo, QStringList Headers, bool Derived)
12 : : CustomModelInterface(Headers)
13 0 : , SchemaClass(ClassInfo)
14 0 : , SchemaDerived(Derived)
15 : {
16 0 : setupModel();
17 0 : }
18 :
19 : void
20 0 : dbse::CustomAttributeModel::setupModel()
21 : {
22 0 : Data.clear();
23 0 : const std::list<OksAttribute*>* AttributeList;
24 :
25 0 : if (SchemaDerived) {
26 0 : AttributeList = SchemaClass->all_attributes();
27 : } else {
28 0 : AttributeList = SchemaClass->direct_attributes();
29 : }
30 :
31 0 : if (AttributeList) {
32 0 : for (OksAttribute* Attribute : *AttributeList) {
33 0 : QStringList Row;
34 0 : Row.append(QString::fromStdString(Attribute->get_name()));
35 0 : Row.append(QString::fromStdString(Attribute->get_type()));
36 0 : Data.append(Row);
37 0 : }
38 : }
39 0 : }
40 :
41 0 : dbse::CustomAttributeModel::~CustomAttributeModel() = default;
|