9 #ifndef LWH_TreeFactory_H 10 #define LWH_TreeFactory_H 15 #include "AITreeFactory.h" 54 return new Tree(storeName);
68 ITree *
create(
const std::string & storeName,
69 const std::string & storeType =
"",
70 bool readOnly =
false,
bool createNew =
false,
71 const std::string & =
"") {
72 if ( storeType !=
"xml" && storeType !=
"" && storeType !=
"flat" )
73 throw std::runtime_error(
"Can only store trees in xml or flat format.");
74 if ( readOnly || !createNew )
75 throw std::runtime_error(
"Cannot read in trees.");
76 return new Tree(storeName, storeType !=
"flat");
83 for ( std::set<Tree *>::iterator it = trees.begin();
84 it != trees.end(); ++it )
delete *it;
ITree * create()
Creates a new tree that is not associated with a store.
ITree * create(const std::string &storeName, const std::string &storeType="", bool readOnly=false, bool createNew=false, const std::string &="")
Creates a new Tree and associates it with a store.
Tree * createTree(const std::string &storeName)
Creates a new Tree and associates it with a store.
virtual ~TreeFactory()
Destructor.
std::set< Tree * > trees
The created trees.
The LWH namespace contains a Light-Weight Histogram package which implements the most rudimentary his...
bool insert(std::string str, IManagedObject *o)
Insert the ManagedObject o in the tree with the path str.
The Tree class is a simple implementation of the AIDA::ITree interface.
void clear()
Delete all trees.