File indexing completed on 2025-08-05 08:16:19
0001 #ifndef PHOOL_PHNODE_H
0002 #define PHOOL_PHNODE_H
0003
0004
0005
0006
0007 #include <iosfwd>
0008 #include <string>
0009
0010 class PHIOManager;
0011
0012 class PHNode
0013 {
0014 public:
0015
0016 PHNode(const std::string &);
0017 PHNode(const std::string &, const std::string &);
0018 virtual ~PHNode();
0019
0020 virtual void prune() = 0;
0021 virtual void print(const std::string &) = 0;
0022 virtual void forgetMe(PHNode *) = 0;
0023 virtual bool write(PHIOManager *, const std::string & = "") = 0;
0024
0025 virtual void setResetFlag(const bool b) { reset_able = b; }
0026 virtual bool getResetFlag() const { return reset_able; }
0027 PHNode *getParent() const { return parent; }
0028 bool isPersistent() const { return persistent; }
0029 void makePersistent() { persistent = true; }
0030 const std::string &getObjectType() const { return objecttype; }
0031 const std::string &getType() const { return type; }
0032 const std::string &getName() const { return name; }
0033 const std::string &getClass() const { return objectclass; }
0034 void setParent(PHNode *p) { parent = p; }
0035 void setName(const std::string &n) { name = n; }
0036 void setObjectType(const std::string &n) { objecttype = n; }
0037 void makeTransient() { persistent = false; }
0038
0039 protected:
0040 PHNode *parent{nullptr};
0041 bool persistent{true};
0042 bool reset_able{true};
0043 std::string type{"PHNode"};
0044 std::string objecttype;
0045 std::string name;
0046 std::string objectclass;
0047
0048 private:
0049 PHNode() = delete;
0050 PHNode(const PHNode &) = delete;
0051 PHNode &operator=(const PHNode &) = delete;
0052 };
0053
0054 std::ostream &operator<<(std::ostream &, const PHNode &);
0055
0056 #endif