ATLAS Offline Software
Loading...
Searching...
No Matches
MiniConfigTreeNode.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef dqiMiniConfigTreeNode_h
6#define dqiMiniConfigTreeNode_h
7
8#include <map>
9#include <set>
10#include <string>
11#include <string_view>
12
13#include <TObject.h>
14
15
16namespace dqi {
17
25
26class MiniConfigTreeNode : public TObject {
27public:
28
29 class Visitor {
30 public:
31 virtual ~Visitor() { }
32 virtual void Visit( const MiniConfigTreeNode* node ) = 0;
33 };
34
35 class Writer {
36 public:
37 virtual ~Writer() { }
38 virtual void Write(MiniConfigTreeNode* node ) = 0;
39 };
40
41 MiniConfigTreeNode( std::string name_, MiniConfigTreeNode* parent_ );
42
43 virtual ~MiniConfigTreeNode();
44
45 virtual const char* GetName() const;
46
47 virtual std::string GetPathName() const;
48
49
54
55 virtual MiniConfigTreeNode* GetNewDaughter( std::string name_ );
56
57 virtual MiniConfigTreeNode* GetDaughter( std::string name_ ) const;
58
59 virtual const MiniConfigTreeNode* GetParent() const { return m_parent; }
60 virtual MiniConfigTreeNode* GetParent() { return m_parent; }
61
62 virtual std::map<std::string,dqi::MiniConfigTreeNode*> GetDaughters() const;
63
70
71 virtual const MiniConfigTreeNode* GetNode( const std::string & name_ ) const;
72
73
74 virtual void SetAttribute( const std::string & attName, const std::string & attValue, bool isAttribKeyword = false );
75
76 virtual std::string GetAttribute( std::string_view attName, bool calledFromDaughter = false ) const;
77
78 virtual std::string GetAttributeLocal( const std::string & attName ) const;
79
80 virtual void GetAttributeNames( std::set<std::string>& attSet, bool calledFromDaughter = false ) const;
81
82 virtual void GetAttributeNamesLocal( std::set<std::string>& attSet ) const;
83
84
85 virtual void Accept( Visitor& visitor ) const;
86
87 virtual void Accept(Writer& writer );
88
89 virtual void SetAttribKeywordPropagateDown( bool propagateDown );
90
91 virtual bool GetAttribKeywordPropagateDown() const;
92
93protected:
94
95 typedef std::map<std::string,MiniConfigTreeNode*> NodeMap_t;
96 typedef NodeMap_t::const_iterator NodeIter_t;
97
98 typedef std::map<std::string,std::pair<std::string,bool>, std::less<> > AttMap_t;
99 typedef AttMap_t::const_iterator AttIter_t;
100
101 const std::string m_name;
103
106
108
109private:
110
111//Get rid of Root macros that confuse Doxygen
113 ClassDef( MiniConfigTreeNode, 0 ) // A node in a configuration tree
115};
116
117} // namespace dqi
118
119#endif
std::shared_ptr< HepMC3::Writer > writer
virtual void Visit(const MiniConfigTreeNode *node)=0
virtual void Write(MiniConfigTreeNode *node)=0
A node of a tree structure holding a configuration, where each node may be given attributes,...
MiniConfigTreeNode * m_parent
virtual std::string GetAttributeLocal(const std::string &attName) const
virtual const MiniConfigTreeNode * GetParent() const
std::map< std::string, std::pair< std::string, bool >, std::less<> > AttMap_t
MiniConfigTreeNode(std::string name_, MiniConfigTreeNode *parent_)
virtual const MiniConfigTreeNode * GetNode(const std::string &name_) const
This function takes the full path name of a subnode (in UNIX directory style) and returns the corresp...
virtual bool GetAttribKeywordPropagateDown() const
virtual MiniConfigTreeNode * GetDaughter(std::string name_) const
virtual MiniConfigTreeNode * GetParent()
virtual const char * GetName() const
virtual std::map< std::string, dqi::MiniConfigTreeNode * > GetDaughters() const
virtual void Accept(Visitor &visitor) const
virtual MiniConfigTreeNode * GetNewDaughter(std::string name_)
Returns a daughter of this node, creating one if necessary.
std::map< std::string, MiniConfigTreeNode * > NodeMap_t
AttMap_t::const_iterator AttIter_t
virtual void GetAttributeNames(std::set< std::string > &attSet, bool calledFromDaughter=false) const
virtual void SetAttribute(const std::string &attName, const std::string &attValue, bool isAttribKeyword=false)
virtual void SetAttribKeywordPropagateDown(bool propagateDown)
virtual std::string GetPathName() const
virtual void GetAttributeNamesLocal(std::set< std::string > &attSet) const
NodeMap_t::const_iterator NodeIter_t
virtual std::string GetAttribute(std::string_view attName, bool calledFromDaughter=false) const
Definition node.h:24