DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
dbse::CustomRelationshipModel Class Reference

#include <SchemaCustomRelationshipModel.hpp>

Inheritance diagram for dbse::CustomRelationshipModel:
[legend]
Collaboration diagram for dbse::CustomRelationshipModel:
[legend]

Public Member Functions

 CustomRelationshipModel (dunedaq::oks::OksClass *ClassInfo, QStringList Headers, bool Derived=false)
 
 ~CustomRelationshipModel ()
 
void setupModel ()
 
- Public Member Functions inherited from dbse::CustomModelInterface
 CustomModelInterface (QStringList Headers, QObject *parent=nullptr)
 Including Schema Editor.
 
 ~CustomModelInterface ()
 
int rowCount (const QModelIndex &parent) const
 
int columnCount (const QModelIndex &parent) const
 
Qt::ItemFlags flags (const QModelIndex &index) const
 
QVariant headerData (int section, Qt::Orientation orientation, int role) const
 
QVariant data (const QModelIndex &index, int role) const
 
QStringList getRowFromIndex (QModelIndex &index)
 

Private Attributes

dunedaq::oks::OksClassSchemaClass
 
bool SchemaDerived
 

Additional Inherited Members

- Protected Attributes inherited from dbse::CustomModelInterface
QStringList HeaderList
 
QList< QStringList > Data
 

Detailed Description

Definition at line 13 of file SchemaCustomRelationshipModel.hpp.

Constructor & Destructor Documentation

◆ CustomRelationshipModel()

dbse::CustomRelationshipModel::CustomRelationshipModel ( dunedaq::oks::OksClass * ClassInfo,
QStringList Headers,
bool Derived = false )

Definition at line 5 of file SchemaCustomRelationshipModel.cpp.

7 : CustomModelInterface ( Headers ),
8 SchemaClass ( ClassInfo ),
9 SchemaDerived ( Derived )
10{
11 setupModel();
12}
CustomModelInterface(QStringList Headers, QObject *parent=nullptr)
Including Schema Editor.

◆ ~CustomRelationshipModel()

dbse::CustomRelationshipModel::~CustomRelationshipModel ( )
default

Member Function Documentation

◆ setupModel()

void dbse::CustomRelationshipModel::setupModel ( )
virtual

Implements dbse::CustomModelInterface.

Definition at line 14 of file SchemaCustomRelationshipModel.cpp.

15{
16 Data.clear();
17 const std::list<OksRelationship *> * RelationshipList;
18
19 if ( SchemaDerived )
20 {
21 RelationshipList = SchemaClass->all_relationships();
22 }
23 else
24 {
25 RelationshipList = SchemaClass->direct_relationships();
26 }
27
28 if ( RelationshipList )
29 {
30 for ( OksRelationship * Relationship : *RelationshipList )
31 {
32 QStringList Row;
33 Row.append ( QString::fromStdString ( Relationship->get_name() ) );
34 Row.append ( QString::fromStdString ( Relationship->get_type() ) );
35 Row.append (
36 QString ( Relationship->card2str ( Relationship->get_low_cardinality_constraint() ) ) );
37 Row.append (
38 QString ( Relationship->card2str ( Relationship->get_high_cardinality_constraint() ) ) );
39 Data.append ( Row );
40 }
41 }
42}
const std::list< OksRelationship * > * direct_relationships() const noexcept
Definition class.hpp:590
const std::list< OksRelationship * > * all_relationships() const noexcept
Definition class.hpp:585

Member Data Documentation

◆ SchemaClass

dunedaq::oks::OksClass* dbse::CustomRelationshipModel::SchemaClass
private

Definition at line 20 of file SchemaCustomRelationshipModel.hpp.

◆ SchemaDerived

bool dbse::CustomRelationshipModel::SchemaDerived
private

Definition at line 21 of file SchemaCustomRelationshipModel.hpp.


The documentation for this class was generated from the following files: