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

Constructor & Destructor Documentation

◆ ObjectNode()

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

Definition at line 219 of file treenode.cpp.

220 :
221 treenode ( ParentNode ),
222 configdata ( obj )
223{
224 Data.append ( QVariant ( QString::fromStdString ( configdata.UID() ) ) );
225 if ( not acopy )
226 {
229 false );
230 std::vector<dunedaq::conffwk::attribute_t> Attributes = ClassInfo.p_attributes;
231 std::vector<dunedaq::conffwk::relationship_t> Relationships = ClassInfo.p_relationships;
232
233 if ( ( Relationships.size() > 0 ) )
234 {
235 SetHasStructure ( true );
236 }
237
238 for ( dunedaq::conffwk::attribute_t & Attribute : Attributes )
239 {
240 new AttributeNode ( Attribute, static_cast<treenode *> ( this ) );
241 }
242
243 for ( dunedaq::conffwk::relationship_t & Relationship : Relationships )
244 {
245 new RelationshipNode ( Relationship, static_cast<treenode *> ( this ) );
246 }
247 }
248
249 SetWasFetched ( true );
250}
static dunedaq::conffwk::class_t definition(std::string const &cn, bool direct_only)
void SetHasStructure(bool Structure)
Definition treenode.cpp:126
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
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 254 of file treenode.cpp.

255{
256 switch ( role )
257 {
258
259 case Qt::DisplayRole:
260 return Data.value ( Column );
261
262 case Qt::DecorationRole:
263
264 if ( Column == 0 )
265 {
266 return QIcon ( ":/Images/TextGeneric.png" );
267 }
268 break;
269 }
270
271 return QVariant();
272}

◆ GetObject()

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

Reimplemented from dbe::treenode.

Definition at line 274 of file treenode.cpp.

275{
276 return configdata.ref();
277}
inner::configobject::tref ref() const

Member Data Documentation

◆ configdata

dref dbe::ObjectNode::configdata
private

Definition at line 86 of file treenode.hpp.


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