DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
SchemaCustomSuperClassModel.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/SchemaCustomSuperClassModel.cpp to
5// apps/SchemaEditor/SchemaCustomSuperClassModel.cpp).
6
8
9using namespace dunedaq::oks;
10
11dbse::CustomSuperClassModel::CustomSuperClassModel(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
24 std::set<std::string> direct_classes;
25 const auto& directClasses = SchemaClass->direct_super_classes();
26 if (directClasses != nullptr) {
27 for (const std::string* cl : *directClasses) {
28 direct_classes.insert(*cl);
29 }
30 }
31
32 std::list<std::string> SuperClassList;
33 if (SchemaDerived) {
34 const OksClass::FList* allClasses = SchemaClass->all_super_classes();
35 if (allClasses != nullptr) {
36 for (const OksClass* cl : *allClasses) {
37 SuperClassList.push_back(cl->get_name());
38 }
39 }
40 } else {
41 for (auto cls : direct_classes) {
42 SuperClassList.push_back(cls);
43 }
44 }
45
46 for (std::string cls : SuperClassList) {
47 QStringList row;
48 row.append(QString::fromStdString(cls));
49 if (direct_classes.contains(cls)) {
50 row.append("D");
51 } else {
52 row.append("I");
53 }
54 Data.append(row);
55 }
56}
57
CustomModelInterface(QStringList Headers, QObject *parent=nullptr)
Including Schema Editor.
CustomSuperClassModel(dunedaq::oks::OksClass *ClassInfo, QStringList Headers, bool Derived=false)
The OKS class.
Definition class.hpp:223
std::list< OksClass *, boost::fast_pool_allocator< OksClass * > > FList
Definition class.hpp:254