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

#include <treenode.hpp>

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

Public Member Functions

 ObjectNode (dref ObjectData, bool IsCopy, treenode *ParentNode)
 
 ~ObjectNode ()
 
virtual QVariant GetData (const int Column, int role=Qt::DisplayRole) const
 
tref GetObject () 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 ()
 
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

dref configdata
 

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

Constructor & Destructor Documentation

◆ ObjectNode()

dbe::ObjectNode::ObjectNode ( dref ObjectData,
bool IsCopy,
treenode * ParentNode )

Definition at line 212 of file treenode.cpp.

213 :
214 treenode ( ParentNode ),
215 configdata ( obj )
216{
217 Data.append ( QVariant ( QString::fromStdString ( configdata.UID() ) ) );
218
219 if ( not acopy )
220 {
223 false );
224 std::vector<dunedaq::conffwk::attribute_t> Attributes = ClassInfo.p_attributes;
225 std::vector<dunedaq::conffwk::relationship_t> Relationships = ClassInfo.p_relationships;
226
227 if ( ( Relationships.size() > 0 ) )
228 {
229 SetHasStructure ( true );
230 }
231
232 for ( dunedaq::conffwk::attribute_t & Attribute : Attributes )
233 {
234 new AttributeNode ( Attribute, static_cast<treenode *> ( this ) );
235 }
236
237 for ( dunedaq::conffwk::relationship_t & Relationship : Relationships )
238 {
239 new RelationshipNode ( Relationship, static_cast<treenode *> ( this ) );
240 }
241 }
242
243 SetWasFetched ( true );
244}
static dunedaq::conffwk::class_t definition(std::string const &cn, bool direct_only)
void SetHasStructure(bool Structure)
Definition treenode.cpp:125
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
const std::vector< attribute_t > p_attributes
Definition Schema.hpp:163
const std::vector< relationship_t > p_relationships
Definition Schema.hpp:164

◆ ~ObjectNode()

dbe::ObjectNode::~ObjectNode ( )
default

Member Function Documentation

◆ GetData()

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

Reimplemented from dbe::treenode.

Definition at line 248 of file treenode.cpp.

249{
250 switch ( role )
251 {
252
253 case Qt::DisplayRole:
254 return Data.value ( Column );
255
256 case Qt::DecorationRole:
257
258 if ( Column == 0 )
259 {
260 return QIcon ( ":/Images/TextGeneric.png" );
261 }
262 }
263
264 return QVariant();
265}

◆ GetObject()

dbe::tref dbe::ObjectNode::GetObject ( ) const
virtual

Reimplemented from dbe::treenode.

Definition at line 267 of file treenode.cpp.

268{
269 return configdata.ref();
270}
inner::configobject::tref ref() const

Member Data Documentation

◆ configdata

dref dbe::ObjectNode::configdata
private

Definition at line 83 of file treenode.hpp.


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