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

#include <treenode.hpp>

Inheritance diagram for dbe::RelationshipNode:
[legend]
Collaboration diagram for dbe::RelationshipNode:
[legend]

Public Member Functions

 RelationshipNode (const dunedaq::conffwk::relationship_t &RelationshipData, treenode *ParentNode)
 
 ~RelationshipNode ()
 
virtual QVariant GetData (const int Column, int role=Qt::DisplayRole) const
 
dunedaq::conffwk::relationship_t relation_t () const
 
- Public Member Functions inherited from dbe::treenode
 treenode (treenode *ParentNode=nullptr)
 Including QT Headers.
 
 treenode (QString const &Datum, treenode *ParentNode=nullptr)
 
 treenode (QStringList const &DataList, treenode *ParentNode=nullptr)
 
virtual ~treenode ()
 
virtual tref GetObject () const
 
int GetRow () const
 
virtual void AddChild (treenode *Child)
 
virtual void RemoveChild (treenode *Child)
 
treenodeGetChild (const int Row) const
 
QList< treenode * > GetChildren () const
 
treenodeGetParent () const
 
int ChildCount () const
 
int ColumnCount () const
 
void SetHasStructure (bool Structure)
 
bool GetHasStructure () const
 
void SetWasFetched (bool Fetched)
 
bool GetWasFetched () const
 
void rename (QString const &)
 

Private Attributes

dunedaq::conffwk::relationship_t relation_t_definition
 

Additional Inherited Members

- Protected Attributes inherited from dbe::treenode
treenodeParent
 
QList< treenode * > Children
 
QList< QVariant > Data
 
bool HasStructure
 
bool WasFetched
 

Detailed Description

Definition at line 100 of file treenode.hpp.

Constructor & Destructor Documentation

◆ RelationshipNode()

dbe::RelationshipNode::RelationshipNode ( const dunedaq::conffwk::relationship_t & RelationshipData,
treenode * ParentNode )

Definition at line 335 of file treenode.cpp.

337 :
338 treenode ( ParentNode ),
339 relation_t_definition ( relation )
340{
341 Data.append ( QVariant ( QString::fromStdString ( relation.p_name ) ) );
342
343 std::vector<tref> DataList;
344 tref ObjectParent = GetParent()->GetObject();
345
350 {
351 try
352 {
353 tref Data =
355 ObjectParent,
356 relation );
357 DataList.push_back ( Data );
358 }
359 catch ( daq::dbe::config_object_retrieval_result_is_null const & e )
360 {
361 //nothing needs be done to handle the case that a relationship is not set
362 }
363 }
364 else
365 {
366 DataList =
368 ObjectParent,
369 relation );
370 }
371
372 for ( tref const & Object : DataList )
373 {
374 new ObjectNode ( Object, true, static_cast<treenode *> ( this ) );
375 }
376
377 if ( DataList.size() > 0 )
378 {
379 SetHasStructure ( true );
380 }
381
382 SetWasFetched ( true );
383}
dunedaq::conffwk::relationship_t relation_t_definition
Definition treenode.hpp:109
treenode * GetParent() const
Definition treenode.cpp:111
void SetHasStructure(bool Structure)
Definition treenode.cpp:126
virtual tref GetObject() const
Definition treenode.cpp:76
treenode(treenode *ParentNode=nullptr)
Including QT Headers.
Definition treenode.cpp:24
void SetWasFetched(bool Fetched)
Definition treenode.cpp:136
QList< QVariant > Data
Definition treenode.hpp:52
tref relation< tref >(tref object, dunedaq::conffwk::relationship_t const &r)
T relation(tref item, dunedaq::conffwk::relationship_t const &relation)
inner::configobject::tref tref
Definition tref.hpp:30

◆ ~RelationshipNode()

dbe::RelationshipNode::~RelationshipNode ( )
default

Member Function Documentation

◆ GetData()

QVariant dbe::RelationshipNode::GetData ( const int Column,
int role = Qt::DisplayRole ) const
virtual

Reimplemented from dbe::treenode.

Definition at line 387 of file treenode.cpp.

388{
389 switch ( role )
390 {
391
392 case Qt::DisplayRole:
393 return Data.value ( Column );
394
395 case Qt::DecorationRole:
396
397 if ( Column == 0 )
398 {
399 return QIcon ( ":/Images/SLink.png" );
400 }
401 }
402
403 return QVariant();
404}

◆ relation_t()

dunedaq::conffwk::relationship_t dbe::RelationshipNode::relation_t ( ) const

Definition at line 406 of file treenode.cpp.

407{
409}

Member Data Documentation

◆ relation_t_definition

dunedaq::conffwk::relationship_t dbe::RelationshipNode::relation_t_definition
private

Definition at line 109 of file treenode.hpp.


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