00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088 #ifndef STDBCONFIGNODE_HH
00089 #define STDBCONFIGNODE_HH
00090
00091 #include "StDbNode.hh"
00092 #include "StDbTableIter.hh"
00093
00094 class dbEnvList;
00095 class StDbElementIndex;
00096 class StDbTable;
00097
00098 #ifdef __ROOT_
00099 #include "TROOT.h"
00100 #endif
00101
00102 class StDbConfigNode : public StDbNode {
00103
00104 protected:
00105
00106 StDbConfigNode* mfirstChildNode;
00107 StDbConfigNode* mnextNode;
00108 StDbConfigNode* mparentNode;
00109
00110 bool mhasData;
00111 int mbranchID;
00112 bool misDbNode;
00113 void zeroNodes();
00114
00115 public:
00116
00117 StDbConfigNode( StDbConfigNode* parent,
00118 const char* nodeName, const char* configName);
00119 StDbConfigNode( StDbConfigNode* parent, StDbNode& node);
00120 StDbConfigNode( StDbType type, StDbDomain domain,
00121 const char* nodeName, const char* configName="none");
00122 virtual ~StDbConfigNode();
00123
00124
00125 void setNextNode(StDbConfigNode* node);
00126 void setParentNode(StDbConfigNode* node);
00127 void setFirstChildNode(StDbConfigNode* node);
00128 virtual void setChildNode(StDbConfigNode* node);
00129 void appendNode(StDbConfigNode* node);
00130 StDbConfigNode* getNextNode();
00131 StDbConfigNode* getParentNode();
00132 StDbConfigNode* getFirstChildNode();
00133 void deleteTree();
00134 virtual void addChildren(dbEnvList* elist) = 0;
00135 void deleteChildren();
00136
00137
00138 bool hasChildren();
00139 bool hasData();
00140 int getBranchID();
00141 void setBranchID(int branchID);
00142 void setIsDbNode(bool isDbNode);
00143 bool isDbNode();
00144 void printTree(int depth);
00145
00146
00147 virtual void resetConfig(const char* config, int opt=0) =0;
00148 virtual int buildTree(int opt=0) =0;
00149 virtual StDbElementIndex* getElementIndex() =0;
00150 virtual void setElementIndexInfo(const char* indexName, int indexID) =0;
00151 virtual void getElementIndexInfo(char*& indexname, int& indexID) =0;
00152 virtual int getNumIndeces() const =0;
00153
00154
00155 virtual StDbTable* addDbTable(const char* tableName,
00156 const char* version="default") =0;
00157 virtual StDbTable* addTable (const char* tableName,
00158 const char* version="default") =0;
00159 virtual StDbTable* addTable(StDbNode* node) =0;
00160 virtual StDbTable* findTable(const char* name, const char* sPath="/")=0;
00161 virtual StDbTable* findLocalTable(const char* name) =0;
00162 virtual void removeTable(StDbTable* table) =0;
00163 virtual StDbTableIter* getStDbTableIter() =0;
00164 virtual bool compareTables(StDbTable* tab1, StDbTable* tab2) =0;
00165 virtual void printTables(int depth) =0;
00166 virtual void printNumberStats() =0;
00167 virtual void getNumberStats(unsigned int& nNodes,
00168 unsigned int& ntables,
00169 unsigned int& numBytes) =0;
00170
00171
00172 virtual void setTablesFlavor(const char* flavor) =0;
00173 virtual void setTablesProdTime(unsigned int ptime) =0;
00174 virtual void setTablesProdTimeOverride(unsigned int ptime, char* dbType = 0, char* dbDomain = 0) =0;
00175 void setFlavor(const char* flavor);
00176 void setProdTime(unsigned int ptime);
00177 void setProdTimeOverride(unsigned int ptime, char* dbType = 0, char* dbDomain = 0);
00178
00179
00180 StDbConfigNode* findConfigNode(StDbType t, StDbDomain d, const char* sPath);
00181 StDbConfigNode* findConfigNode(StDbType t, StDbDomain d);
00182 StDbConfigNode* findConfigNode(const char* sPath);
00183 StDbConfigNode* findChildConfigNode(const char* nodeName);
00184 #ifdef __ROOT__
00185 ClassDef(StDbConfigNode,0)
00186 #endif
00187
00188 };
00189
00190 inline void StDbConfigNode::setNextNode(StDbConfigNode* node){ mnextNode=node;}
00191 inline StDbConfigNode* StDbConfigNode::getNextNode() { return mnextNode; };
00192 inline StDbConfigNode* StDbConfigNode::getParentNode() { return mparentNode; };
00193 inline StDbConfigNode* StDbConfigNode::getFirstChildNode(){ return mfirstChildNode; };
00194 inline bool StDbConfigNode::hasData(){ return mhasData;};
00195 inline int StDbConfigNode::getBranchID() { return mbranchID; };
00196 inline void StDbConfigNode::setBranchID(int branchID) { mbranchID=branchID; };
00197 inline void StDbConfigNode::setIsDbNode(bool isDbNode){misDbNode=isDbNode; };
00198 inline bool StDbConfigNode::isDbNode() { return misDbNode; };
00199 inline bool StDbConfigNode::hasChildren(){return (mfirstChildNode) ? true : false; };
00200
00201 #endif
00202
00203
00204
00205
00206