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::OksClass * SchemaClass
bool SchemaDerived

Additional Inherited Members

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

Detailed Description

Definition at line 17 of file SchemaCustomRelationshipModel.hpp.

Constructor & Destructor Documentation

◆ CustomRelationshipModel()

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

Definition at line 11 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 20 of file SchemaCustomRelationshipModel.cpp.

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}
const std::list< OksRelationship * > * direct_relationships() const noexcept
Definition class.hpp:572
const std::list< OksRelationship * > * all_relationships() const noexcept
Definition class.hpp:568

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: