ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PHCompositeNode.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file PHCompositeNode.h
1 #ifndef PHOOL_PHCOMPOSITENODE_H
2 #define PHOOL_PHCOMPOSITENODE_H
3 
4 // Declaration of class PHCompositeNode
5 // Purpose: a node which can hold other nodes
6 
7 #include "PHNode.h"
8 #include "PHPointerList.h"
9 
10 #include <string>
11 
12 class PHIOManager;
13 
14 class PHCompositeNode : public PHNode
15 {
16  friend class PHNodeIterator;
17 
18  public:
19  explicit PHCompositeNode(const std::string &);
20  ~PHCompositeNode() override;
21 
22  //
23  // The user is only allowed to add new nodes, not to delete existing ones.
24  //
25  bool addNode(PHNode *);
26 
27  //
28  // This recursively calls the prune function of all the subnodes.
29  // If a subnode is found to be marked as transient (non persistent)
30  // the entire sub-tree is deleted.
31  //
32  void prune() override;
33 
34  //
35  // I/O functions
36  //
37  void print(const std::string & = "") override;
38  bool write(PHIOManager *, const std::string & = "") override;
39 
40  protected:
41  void forgetMe(PHNode *) override;
43  int deleteMe;
44 
45  private:
46  PHCompositeNode() = delete;
47 };
48 
49 #endif