DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
SchemaCustomRelationshipModel.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/SchemaCustomRelationshipModel.cpp to
5// apps/SchemaEditor/SchemaCustomRelationshipModel.cpp).
6
8
9using namespace dunedaq::oks;
10
11dbse::CustomRelationshipModel::CustomRelationshipModel(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<OksRelationship*>* RelationshipList;
24
25 if (SchemaDerived) {
26 RelationshipList = SchemaClass->all_relationships();
27 } else {
28 RelationshipList = SchemaClass->direct_relationships();
29 }
30
31 if (RelationshipList) {
32 for (OksRelationship* Relationship : *RelationshipList) {
33 QStringList Row;
34 Row.append(QString::fromStdString(Relationship->get_name()));
35 Row.append(QString::fromStdString(Relationship->get_type()));
36 Row.append(QString(Relationship->card2str(Relationship->get_low_cardinality_constraint())));
37 Row.append(QString(Relationship->card2str(Relationship->get_high_cardinality_constraint())));
38 Data.append(Row);
39 }
40 }
41}
42
CustomModelInterface(QStringList Headers, QObject *parent=nullptr)
Including Schema Editor.
CustomRelationshipModel(dunedaq::oks::OksClass *ClassInfo, QStringList Headers, bool Derived=false)
The OKS class.
Definition class.hpp:223