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 97 of file treenode.hpp.

Constructor & Destructor Documentation

◆ RelationshipNode()

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

Definition at line 328 of file treenode.cpp.

330 :
331 treenode ( ParentNode ),
332 relation_t_definition ( relation )
333{
334 Data.append ( QVariant ( QString::fromStdString ( relation.p_name ) ) );
335
336 std::vector<tref> DataList;
337 tref ObjectParent = GetParent()->GetObject();
338
343 {
344 try
345 {
346 tref Data =
348 ObjectParent,
349 relation );
350 DataList.push_back ( Data );
351 }
352 catch ( daq::dbe::config_object_retrieval_result_is_null const & e )
353 {
354 //nothing needs be done to handle the case that a relationship is not set
355 }
356 }
357 else
358 {
359 DataList =
361 ObjectParent,
362 relation );
363 }
364
365 for ( tref const & Object : DataList )
366 {
367 new ObjectNode ( Object, true, static_cast<treenode *> ( this ) );
368 }
369
370 if ( DataList.size() > 0 )
371 {
372 SetHasStructure ( true );
373 }
374
375 SetWasFetched ( true );
376}
dunedaq::conffwk::relationship_t relation_t_definition
Definition treenode.hpp:106
treenode * GetParent() const
Definition treenode.cpp:110
void SetHasStructure(bool Structure)
Definition treenode.cpp:125
virtual tref GetObject() const
Definition treenode.cpp:75
treenode(treenode *ParentNode=nullptr)
Including QT Headers.
Definition treenode.cpp:23
void SetWasFetched(bool Fetched)
Definition treenode.cpp:135
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 380 of file treenode.cpp.

381{
382 switch ( role )
383 {
384
385 case Qt::DisplayRole:
386 return Data.value ( Column );
387
388 case Qt::DecorationRole:
389
390 if ( Column == 0 )
391 {
392 return QIcon ( ":/Images/SLink.png" );
393 }
394 }
395
396 return QVariant();
397}

◆ relation_t()

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

Definition at line 399 of file treenode.cpp.

400{
402}

Member Data Documentation

◆ relation_t_definition

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

Definition at line 106 of file treenode.hpp.


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