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 apps/SchemaEditor/SchemaCustomRelationshipModel.cpp).
5
7
8using namespace dunedaq::oks;
9
11 QStringList Headers, bool Derived )
12 : CustomModelInterface ( Headers ),
13 SchemaClass ( ClassInfo ),
14 SchemaDerived ( Derived )
15{
16 setupModel();
17}
18
20{
21 Data.clear();
22 const std::list<OksRelationship *> * RelationshipList;
23
24 if ( SchemaDerived )
25 {
26 RelationshipList = SchemaClass->all_relationships();
27 }
28 else
29 {
30 RelationshipList = SchemaClass->direct_relationships();
31 }
32
33 if ( RelationshipList )
34 {
35 for ( OksRelationship * Relationship : *RelationshipList )
36 {
37 QStringList Row;
38 Row.append ( QString::fromStdString ( Relationship->get_name() ) );
39 Row.append ( QString::fromStdString ( Relationship->get_type() ) );
40 Row.append (
41 QString ( Relationship->card2str ( Relationship->get_low_cardinality_constraint() ) ) );
42 Row.append (
43 QString ( Relationship->card2str ( Relationship->get_high_cardinality_constraint() ) ) );
44 Data.append ( Row );
45 }
46 }
47}
48
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:205