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