Class Reference for E1039 Core & Analysis Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
PHNode.h
Go to the documentation of this file.
1 #ifndef PHNODE_H__
2 #define PHNODE_H__
3 
4 // Declaration of class PHNode
5 // Purpose: abstract base class for all node classes
6 
7 #include "phool.h"
8 
9 #include <iosfwd>
10 #include <string>
11 
12 class PHIOManager;
13 
14 class PHNode
15 {
16 public:
17 
18  // Note that the constructor makes a node transient by default.
19  PHNode(const std::string &);
20  PHNode(const std::string &, const std::string&);
21  virtual ~PHNode();
22 
23 public:
24 
25  PHNode* getParent() const { return parent; }
26 
27  PHBoolean isPersistent() const { return persistent; }
29 
30  const std::string getObjectType() const { return objecttype; }
31  const std::string getType() const { return type; }
32  const std::string getName() const { return name; }
33  const std::string getClass() const {return objectclass;}
34 
35  void setParent(PHNode *p) { parent = p; }
36  void setName(const std::string &n) {name = n;}
37  void setObjectType(const std::string &type) {objecttype = type;}
38  virtual void prune() = 0;
39  virtual void print(const std::string &) = 0;
40  virtual void forgetMe(PHNode*) = 0;
41  virtual bool write(PHIOManager *, const std::string& = "") = 0;
42 
43  virtual void setResetFlag(const int val);
44  virtual PHBoolean getResetFlag() const;
46 
47 protected:
48 
49  PHNode();
50  PHNode(const PHNode&); // implement invalid copy ctor
51  PHNode & operator=(const PHNode&);
52 
54  bool persistent;
55  std::string type;
56  std::string objecttype;
57  std::string name;
58  std::string objectclass;
59  bool reset_able;
60 };
61 
62 std::ostream & operator << (std::ostream &, const PHNode &);
63 
64 #endif /* __PHNODE_H__ */
std::string name
Definition: PHNode.h:57
virtual bool write(PHIOManager *, const std::string &="")=0
void setName(const std::string &n)
Definition: PHNode.h:36
virtual void forgetMe(PHNode *)=0
PHNode * getParent() const
Definition: PHNode.h:25
virtual ~PHNode()
Definition: PHNode.cc:52
void makePersistent()
Definition: PHNode.h:28
std::string objectclass
Definition: PHNode.h:58
const std::string getName() const
Definition: PHNode.h:32
void setParent(PHNode *p)
Definition: PHNode.h:35
PHNode & operator=(const PHNode &)
Definition: PHNode.cc:75
static const int True
Definition: phool.h:10
virtual void print(const std::string &)=0
std::basic_ostream< E, T > & operator<<(std::basic_ostream< E, T > &os, shared_ptr< Y > const &p)
Definition: shared_ptr.hpp:573
std::string type
Definition: PHNode.h:55
std::string objecttype
Definition: PHNode.h:56
PHNode()
Definition: PHNode.cc:10
int PHBoolean
Definition: phool.h:13
bool persistent
Definition: PHNode.h:54
virtual void prune()=0
const std::string getType() const
Definition: PHNode.h:31
const std::string getClass() const
Definition: PHNode.h:33
PHNode * parent
Definition: PHNode.h:53
virtual void setResetFlag(const int val)
Definition: PHNode.cc:83
Definition: PHNode.h:14
static const int False
Definition: phool.h:9
void setObjectType(const std::string &type)
Definition: PHNode.h:37
PHBoolean isPersistent() const
Definition: PHNode.h:27
bool reset_able
Definition: PHNode.h:59
void makeTransient()
Definition: PHNode.h:45
virtual PHBoolean getResetFlag() const
Definition: PHNode.cc:89
const std::string getObjectType() const
Definition: PHNode.h:30