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 18 of file SchemaCustomRelationshipModel.hpp.

Constructor & Destructor Documentation

◆ CustomRelationshipModel()

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

Definition at line 10 of file SchemaCustomRelationshipModel.cpp.

12 : CustomModelInterface ( Headers ),
13 SchemaClass ( ClassInfo ),
14 SchemaDerived ( Derived )
15{
16 setupModel();
17}
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 19 of file SchemaCustomRelationshipModel.cpp.

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}

Member Data Documentation

◆ SchemaClass

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

Definition at line 25 of file SchemaCustomRelationshipModel.hpp.

◆ SchemaDerived

bool dbse::CustomRelationshipModel::SchemaDerived
private

Definition at line 26 of file SchemaCustomRelationshipModel.hpp.


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