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

Constructor & Destructor Documentation

◆ ObjectNode()

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

Definition at line 224 of file treenode.cpp.

225 :
226 treenode ( ParentNode ),
227 configdata ( obj )
228{
229 Data.append ( QVariant ( QString::fromStdString ( configdata.UID() ) ) );
230 if ( not acopy )
231 {
232 dunedaq::conffwk::class_t ClassInfo = dbe::config::api::info::onclass::definition (
233 configdata.class_name(),
234 false );
235 std::vector<dunedaq::conffwk::attribute_t> Attributes = ClassInfo.p_attributes;
236 std::vector<dunedaq::conffwk::relationship_t> Relationships = ClassInfo.p_relationships;
237
238 if ( ( Relationships.size() > 0 ) )
239 {
240 SetHasStructure ( true );
241 }
242
243 for ( dunedaq::conffwk::attribute_t & Attribute : Attributes )
244 {
245 new AttributeNode ( Attribute, static_cast<treenode *> ( this ) );
246 }
247
248 for ( dunedaq::conffwk::relationship_t & Relationship : Relationships )
249 {
250 new RelationshipNode ( Relationship, static_cast<treenode *> ( this ) );
251 }
252 }
253
254 SetWasFetched ( true );
255}
static dunedaq::conffwk::class_t definition(std::string const &cn, bool direct_only)
void SetHasStructure(bool Structure)
Definition treenode.cpp:131
treenode(treenode *ParentNode=nullptr)
Including QT Headers.
Definition treenode.cpp:29
void SetWasFetched(bool Fetched)
Definition treenode.cpp:141
QList< QVariant > Data
Definition treenode.hpp:57
const std::vector< attribute_t > p_attributes
Definition Schema.hpp:170
const std::vector< relationship_t > p_relationships
Definition Schema.hpp:171

◆ ~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 259 of file treenode.cpp.

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

◆ GetObject()

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

Reimplemented from dbe::treenode.

Definition at line 279 of file treenode.cpp.

280{
281 return configdata.ref();
282}

Member Data Documentation

◆ configdata

dref dbe::ObjectNode::configdata
private

Definition at line 91 of file treenode.hpp.


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