forked from sPHENIX-Collaboration/coresoftware
/
PHCompositeNode.h
49 lines (37 loc) · 1021 Bytes
/
PHCompositeNode.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#ifndef PHOOL_PHCOMPOSITENODE_H
#define PHOOL_PHCOMPOSITENODE_H
// Declaration of class PHCompositeNode
// Purpose: a node which can hold other nodes
#include "PHNode.h"
#include "PHPointerList.h"
#include <string>
class PHIOManager;
class PHCompositeNode : public PHNode
{
friend class PHNodeIterator;
public:
explicit PHCompositeNode(const std::string &);
~PHCompositeNode() override;
//
// The user is only allowed to add new nodes, not to delete existing ones.
//
bool addNode(PHNode *);
//
// This recursively calls the prune function of all the subnodes.
// If a subnode is found to be marked as transient (non persistent)
// the entire sub-tree is deleted.
//
void prune() override;
//
// I/O functions
//
void print(const std::string & = "") override;
bool write(PHIOManager *, const std::string & = "") override;
protected:
void forgetMe(PHNode *) override;
PHPointerList<PHNode> subNodes;
int deleteMe;
private:
PHCompositeNode() = delete;
};
#endif