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;