Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-03 08:16:54

0001 #ifndef PHOOL_PHCOMPOSITENODE_H
0002 #define PHOOL_PHCOMPOSITENODE_H
0003 
0004 //  Declaration of class PHCompositeNode
0005 //  Purpose: a node which can hold other nodes
0006 
0007 #include "PHNode.h"
0008 #include "PHPointerList.h"
0009 
0010 #include <string>
0011 
0012 class PHIOManager;
0013 
0014 class PHCompositeNode : public PHNode
0015 {
0016   friend class PHNodeIterator;
0017 
0018  public:
0019   explicit PHCompositeNode(const std::string &);
0020   ~PHCompositeNode() override;
0021 
0022   //
0023   // The user is only allowed to add new nodes, not to delete existing ones.
0024   //
0025   bool addNode(PHNode *);
0026 
0027   //
0028   // This recursively calls the prune function of all the subnodes.
0029   // If a subnode is found to be marked as transient (non persistent)
0030   // the entire sub-tree is deleted.
0031   //
0032   void prune() override;
0033 
0034   //
0035   // I/O functions
0036   //
0037   void print(const std::string & = "") override;
0038   bool write(PHIOManager *, const std::string & = "") override;
0039 
0040  protected:
0041   void forgetMe(PHNode *) override;
0042   PHPointerList<PHNode> subNodes;
0043   int deleteMe = 0;
0044 
0045  private:
0046   PHCompositeNode() = delete;
0047 };
0048 
0049 #endif