ATLAS Offline Software
Loading...
Searching...
No Matches
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
26namespace SG {
27 class DataProxy;
28}
29
30class CBTree {
31public:
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
50 void connectNode(CBNode* node, CBNode* parent);
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
56 CBNode* findNode(const SG::DataProxy* proxy);
57 CBNode* findNode(const SG::DataProxy* proxy, CBNode* start);
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
96private:
97
98 static void _printTree( const CBNode*, const CBNode* );
99
102
103};
104
105#endif
defines and typedefs for IOVSvc
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
CBNode * addNode(const std::string &name, CBNode *parent)
Definition CBTree.cxx:65
CBNode * replaceProxy(const SG::DataProxy *pOld, const SG::DataProxy *pNew)
Definition CBTree.cxx:55
CBTree & operator=(const CBTree &)=delete
void cascadeTrigger(const bool b, CBNode *start)
Definition CBTree.cxx:374
void connectNode(CBNode *node, CBNode *parent)
Definition CBTree.cxx:144
std::set< CBNode *, CBNode::nodeOrder > nodeSet
Definition CBTree.h:33
void adjustLevels(CBNode *start)
Definition CBTree.cxx:452
IOVSvcCallBackFcn BFCN
Definition CBTree.h:34
void traverseR(const CBNode *, void(*pF)(const CBNode *)) const
Definition CBTree.cxx:489
void clearTrigger() const
Definition CBTree.cxx:417
~CBTree()
Definition CBTree.cxx:35
nodeSet m_allNodes
Definition CBTree.h:101
int maxLevel() const
Definition CBTree.cxx:329
void listNodes() const
Definition CBTree.cxx:337
void cascadeFlag(const bool b, CBNode *node) const
Definition CBTree.cxx:428
CBTree(const CBTree &)=delete
void traverse(void(*pF)(const CBNode *)) const
Definition CBTree.cxx:469
void clearFlag() const
Definition CBTree.cxx:442
static void _printTree(const CBNode *, const CBNode *)
Definition CBTree.cxx:294
void printTree() const
Definition CBTree.cxx:265
CBTree()
Definition CBTree.cxx:28
CBNode * m_root
Definition CBTree.h:100
CBNode * findNode(const std::string &name)
Definition CBTree.cxx:238
bool delNode(const SG::DataProxy *prx)
Definition CBTree.cxx:114
Definition node.h:24
Forward declaration.