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
#ifndef STDBCONFIGNODE_HH
00086
#define STDBCONFIGNODE_HH
00087
00088
#include "StDbNode.hh"
00089
#include "StDbTableIter.hh"
00090
00091
class dbEnvList;
00092
class StDbElementIndex;
00093
class StDbTable;
00094
00095
#ifdef __ROOT_
00096
#include "TROOT.h"
00097
#endif
00098
00099 class StDbConfigNode :
public StDbNode {
00100
00101
protected:
00102
00103 StDbConfigNode*
mfirstChildNode;
00104 StDbConfigNode*
mnextNode;
00105 StDbConfigNode*
mparentNode;
00106
00107 bool mhasData;
00108 int mbranchID;
00109 bool misDbNode;
00110
void zeroNodes();
00111
00112
public:
00113
00114
StDbConfigNode(
StDbConfigNode* parent,
00115
const char* nodeName,
const char* configName);
00116
StDbConfigNode(
StDbConfigNode* parent,
StDbNode& node);
00117
StDbConfigNode( StDbType type, StDbDomain domain,
00118
const char* nodeName,
const char* configName=
"none");
00119
virtual ~StDbConfigNode();
00120
00121
00122
void setNextNode(
StDbConfigNode* node);
00123
void setParentNode(
StDbConfigNode* node);
00124
void setFirstChildNode(
StDbConfigNode* node);
00125
virtual void setChildNode(
StDbConfigNode* node);
00126
void appendNode(
StDbConfigNode* node);
00127
StDbConfigNode*
getNextNode();
00128
StDbConfigNode*
getParentNode();
00129
StDbConfigNode*
getFirstChildNode();
00130
void deleteTree();
00131
virtual void addChildren(
dbEnvList* elist) = 0;
00132
void deleteChildren();
00133
00134
00135
bool hasChildren();
00136
bool hasData();
00137
int getBranchID();
00138
void setBranchID(
int branchID);
00139
void setIsDbNode(
bool isDbNode);
00140
bool isDbNode();
00141
void printTree(
int depth);
00142
00143
00144
virtual void resetConfig(
const char* config,
int opt=0) =0;
00145
virtual int buildTree(
int opt=0) =0;
00146
virtual StDbElementIndex*
getElementIndex() =0;
00147
virtual void setElementIndexInfo(
const char* indexName,
int indexID) =0;
00148
virtual void getElementIndexInfo(
char*& indexname,
int& indexID) =0;
00149
virtual int getNumIndeces() const =0;
00150
00151
00152 virtual
StDbTable* addDbTable(const
char* tableName,
00153 const
char* version="default") =0;
00154 virtual
StDbTable* addTable (const
char* tableName,
00155 const
char* version="default") =0;
00156 virtual
StDbTable* addTable(
StDbNode* node) =0;
00157 virtual
StDbTable* findTable(const
char* name, const
char* sPath="/")=0;
00158 virtual
StDbTable* findLocalTable(const
char* name) =0;
00159 virtual
void removeTable(
StDbTable* table) =0;
00160 virtual
StDbTableIter* getStDbTableIter() =0;
00161 virtual
bool compareTables(
StDbTable* tab1,
StDbTable* tab2) =0;
00162 virtual
void printTables(
int depth) =0;
00163 virtual
void printNumberStats() =0;
00164 virtual
void getNumberStats(
unsigned int& nNodes,
00165
unsigned int& ntables,
00166
unsigned int& numBytes) =0;
00167
00168
00169 virtual
void setTablesFlavor(const
char* flavor) =0;
00170 virtual
void setTablesProdTime(
unsigned int ptime) =0;
00171
void setFlavor(const
char* flavor);
00172
void setProdTime(
unsigned int ptime);
00173
00174
00175
StDbConfigNode* findConfigNode(StDbType t, StDbDomain d, const
char* sPath);
00176
StDbConfigNode* findConfigNode(StDbType t, StDbDomain d);
00177
StDbConfigNode* findConfigNode(const
char* sPath);
00178
StDbConfigNode* findChildConfigNode(const
char* nodeName);
00179 #ifdef __ROOT__
00180 ClassDef(
StDbConfigNode,0)
00181 #endif
00182
00183 };
00184
00185 inline
void StDbConfigNode::setNextNode(StDbConfigNode* node){
mnextNode=node;}
00186 inline StDbConfigNode*
StDbConfigNode::getNextNode() {
return mnextNode; };
00187 inline StDbConfigNode*
StDbConfigNode::getParentNode() {
return mparentNode; };
00188 inline StDbConfigNode*
StDbConfigNode::getFirstChildNode(){
return mfirstChildNode; };
00189 inline bool StDbConfigNode::hasData(){
return mhasData;};
00190 inline int StDbConfigNode::getBranchID() {
return mbranchID; };
00191 inline void StDbConfigNode::setBranchID(
int branchID) {
mbranchID=branchID; };
00192 inline void StDbConfigNode::setIsDbNode(
bool isDbNode){
misDbNode=isDbNode; };
00193 inline bool StDbConfigNode::isDbNode() {
return misDbNode; };
00194 inline bool StDbConfigNode::hasChildren(){
return (
mfirstChildNode) ?
true :
false; };
00195
00196
#endif
00197
00198
00199
00200
00201