PHNode.h
//-----------------------------------------------------------------------------
// $Header: /afs/rhic/phenix/cvsroot/offline/framework/phool/PHNode.h,v 1.10 2001/03/12 14:42:05 pinkenbu Exp $
//
// The PHOOL s Software
// Copyright (C) PHENIX collaboration, 1999
//
// Declaration of class PHNode
//
// Purpose: abstract base class for all node classes
//
//-----------------------------------------------------------------------------
#ifndef PHNODE_H
#define PHNODE_H
#include "phool.h"
#include "PHString.h"
class PHIOManager;
class PHNode {
public:
PHNode(const PHString&);
PHNode(const PHString&, const PHString&);
virtual ~PHNode();
public:
PHNode* getParent() const { return parent; }
//
// Note that the constructor makes a node transient by default.
//
PHBoolean isPersistent() const { return persistent; }
void makePersistent() { persistent = True;}
const PHString& getObjectType() const { return objecttype; }
const PHString& getType() const { return type; }
const PHString& getName() const { return name; }
void setParent(PHNode *p) { parent = p; }
void setObjectType(const PHString& type) {objecttype = type;}
virtual void prune() = 0;
virtual void print(const PHString&) = 0;
virtual void forgetMe(PHNode*) = 0;
virtual PHBoolean write(PHIOManager *, const PHString& = "") = 0;
protected:
PHNode();
void makeTransient() { persistent = False;}
protected:
PHNode* parent;
PHBoolean persistent;
PHString type;
PHString objecttype;
PHString name;
};
ostream & operator << (ostream &, const PHNode &);
#endif /* PHNODE_H */