ATLAS Offline Software
CBTree.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef IOVSVC_CBTREE_H
6 #define IOVSVC_CBTREE_H
7 
8 /*****************************************************************************
9  *
10  * CBTree.h
11  * IOVSvc
12  *
13  * Author: Charles Leggett
14  *
15  * Callback function trigger tree
16  *
17  *****************************************************************************/
18 
19 #include "CBNode.h"
20 
22 
23 #include <set>
24 #include <string>
25 
26 namespace SG {
27  class DataProxy;
28 }
29 
30 class CBTree {
31 public:
32 
33  typedef std::set<CBNode*, CBNode::nodeOrder> nodeSet;
35 
36  CBTree();
37  ~CBTree();
38 
39  CBTree (const CBTree&) = delete;
40  CBTree& operator= (const CBTree&) = delete;
41 
42  CBNode* addNode(const std::string& name, CBNode* parent);
43  CBNode* addNode(const SG::DataProxy* proxy, const std::string& name);
44  CBNode* addNode(BFCN* fcn, const CallBackID& cb,
45  const SG::DataProxy* parent_proxy);
46  CBNode* addNode(BFCN* fcn, const CallBackID& cb, BFCN* parent_fcn);
47 
48  CBNode* replaceProxy(const SG::DataProxy* pOld, const SG::DataProxy* pNew);
49 
51  void connectNode(const std::string& name, CBNode* parent);
52 
53  CBNode* findNode(const std::string& name);
54  CBNode* findNode(const std::string& name, CBNode* start);
55 
58 
59  CBNode* findNode(BFCN* fcn);
60  CBNode* findNode(BFCN* fcn, CBNode* start);
61 
62  bool delNode(const SG::DataProxy* prx);
63 
64  void printTree() const;
65  void printTree( const CBNode* start ) const;
66 
67  int maxLevel() const;
68  void adjustLevels( CBNode* start );
69 
70  void listNodes() const;
71  void listNodes( const int& level,
72  nodeSet::const_iterator& start,
73  nodeSet::const_iterator& end ) const;
74 
75  void cascadeTrigger(const bool b, CBNode* start);
76  void cascadeTrigger(const bool b, BFCN* fcn);
77  void cascadeTrigger(const bool b, const SG::DataProxy* proxy);
78 
79  void clearTrigger() const;
80 
81  void cascadeFlag(const bool b, CBNode* node) const;
82  void clearFlag() const;
83 
84  void traverse( void (*pF) (const CBNode*) ) const;
85  void traverse( const CBNode*, void (*pF) (const CBNode*) ) const;
86  void traverseR( const CBNode*, void (*pF) (const CBNode*) ) const;
87 
88  const CBNode* traverse( const CBNode* (*pF) (const CBNode*) ) const;
89  const CBNode* traverse( const CBNode*, const CBNode* (*pF) (const CBNode*) ) const;
90  const CBNode* traverseR( const CBNode*, const CBNode* (*pF) (const CBNode*) ) const;
91 
92  void traverse( void (*pF) (const CBNode*, const CBNode*) ) const;
93  void traverse( const CBNode*, const CBNode*, void (*pF) (const CBNode*, const CBNode*) ) const;
94  void traverseR( const CBNode*, const CBNode*, void (*pF) (const CBNode*, const CBNode*) ) const;
95 
96 private:
97 
98  static void _printTree( const CBNode*, const CBNode* );
99 
102 
103 };
104 
105 #endif
CBTree::addNode
CBNode * addNode(const std::string &name, CBNode *parent)
Definition: CBTree.cxx:65
CBTree::delNode
bool delNode(const SG::DataProxy *prx)
Definition: CBTree.cxx:114
CallBackID
Definition: CallBackID.h:24
CBTree::m_root
CBNode * m_root
Definition: CBTree.h:100
StateLessPT_NewConfig.proxy
proxy
Definition: StateLessPT_NewConfig.py:392
SG
Forward declaration.
Definition: CaloCellPacker_400_500.h:32
CBNode.h
mergePhysValFiles.start
start
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:14
CBTree::traverseR
void traverseR(const CBNode *, void(*pF)(const CBNode *)) const
Definition: CBTree.cxx:489
CBTree::connectNode
void connectNode(CBNode *node, CBNode *parent)
Definition: CBTree.cxx:144
CBTree::cascadeTrigger
void cascadeTrigger(const bool b, CBNode *start)
Definition: CBTree.cxx:374
CBTree::clearTrigger
void clearTrigger() const
Definition: CBTree.cxx:417
CBTree::findNode
CBNode * findNode(const std::string &name)
Definition: CBTree.cxx:238
CBTree::CBTree
CBTree(const CBTree &)=delete
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
python.iconfTool.models.loaders.level
level
Definition: loaders.py:20
CBNode
Definition: CBNode.h:30
CBTree::adjustLevels
void adjustLevels(CBNode *start)
Definition: CBTree.cxx:452
CBTree::BFCN
IOVSvcCallBackFcn BFCN
Definition: CBTree.h:34
CBTree::replaceProxy
CBNode * replaceProxy(const SG::DataProxy *pOld, const SG::DataProxy *pNew)
Definition: CBTree.cxx:55
CBTree::maxLevel
int maxLevel() const
Definition: CBTree.cxx:329
DataProxy
DataProxy provides the registry services for StoreGate.
Definition: DataProxy.h:32
CBTree::clearFlag
void clearFlag() const
Definition: CBTree.cxx:442
test_pyathena.parent
parent
Definition: test_pyathena.py:15
IOVSvcCallBackFcn
boost::function< StatusCode(IOVSVC_CALLBACK_ARGS) > IOVSvcCallBackFcn
the type of an IOVSvc call back: it wraps both the method and the object the method is called on
Definition: IOVSvcDefs.h:58
CBTree::listNodes
void listNodes() const
Definition: CBTree.cxx:337
CBTree::printTree
void printTree() const
Definition: CBTree.cxx:265
CBTree::operator=
CBTree & operator=(const CBTree &)=delete
CBTree
Definition: CBTree.h:30
CBTree::CBTree
CBTree()
Definition: CBTree.cxx:28
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
CBTree::traverse
void traverse(void(*pF)(const CBNode *)) const
Definition: CBTree.cxx:469
CBTree::_printTree
static void _printTree(const CBNode *, const CBNode *)
Definition: CBTree.cxx:294
CBTree::cascadeFlag
void cascadeFlag(const bool b, CBNode *node) const
Definition: CBTree.cxx:428
CBTree::~CBTree
~CBTree()
Definition: CBTree.cxx:35
CBTree::m_allNodes
nodeSet m_allNodes
Definition: CBTree.h:101
IOVSvcDefs.h
defines and typedefs for IOVSvc
CBTree::nodeSet
std::set< CBNode *, CBNode::nodeOrder > nodeSet
Definition: CBTree.h:33
SG::DataProxy
Definition: DataProxy.h:45
node
Definition: memory_hooks-stdcmalloc.h:74