67 #include "StDbDefs.hh"
81 StDbType mdbType = dbStDb;
82 StDbDomain mdbDomain = dbDomainUnknown;
93 StDbNode() : mname(0), mversion(0), mdbName(0), mnodeID(0), mnodeType(0), misConfigured(
false), mcanRollBack(
false) {};
94 StDbNode(
const char* name,
const char* versionKey);
104 char* printVersion() ;
107 StDbType getDbType()
const;
108 StDbDomain getDbDomain()
const;
109 int getNodeID()
const;
110 char* getNodeType() ;
111 char* printNodeType();
113 void setName(
const char* nodeName);
114 void setVersion(
const char* nodeVersion);
115 void setDbName(
const char* nodeDbName);
116 void setDbType(StDbType type);
117 void setDbDomain(StDbDomain domain);
118 void setNodeID(
int id);
119 void setNodeType(
const char* nodeType);
122 bool canRollBack()
const;
123 void addWrittenNode(
int dataID);
127 bool checkName(
const char* nodeName)
const;
128 bool checkVersion(
const char* nodeVersion)
const;
129 bool checkNode(
const char* nodeName,
const char* nodeVersion)
const;
130 bool IsConfigured()
const;
131 void setConfigured(
bool isConfigured);
132 bool isNode(StDbType type, StDbDomain domain);
133 virtual bool IsTable()
const;
136 char* mstrDup(
const char* s2) ;
137 int* decodeElementID(
const char* elementID,
int& numRows) ;
138 char* getNextID(
char*& currentElement)
const;
144 inline char* StDbNode::printName() {
return mname; };
145 inline char* StDbNode::printDbName() {
return mdbName; };
146 inline char* StDbNode::printNodeType() {
return mnodeType; };
147 inline char* StDbNode::printVersion() {
return mversion; };
148 inline char* StDbNode::getMyName() {
return printName(); }
149 inline StDbType StDbNode::getDbType()
const {
return mdbType;}
150 inline StDbDomain StDbNode::getDbDomain()
const {
return mdbDomain; }
151 inline void StDbNode::setDbType(StDbType type) { mdbType=type;}
152 inline void StDbNode::setDbDomain(StDbDomain domain) { mdbDomain=domain; }
153 inline int StDbNode::getNodeID()
const {
return mnodeID; }
154 inline void StDbNode::setNodeID(
int id ) {mnodeID = id; }
155 inline void StDbNode::setConfigured(
bool isC){ misConfigured=isC; }
156 inline bool StDbNode::IsConfigured()
const {
return misConfigured; }
157 inline bool StDbNode::isNode(StDbType type, StDbDomain domain){
158 return ( (type==mdbType) && (domain==mdbDomain) ) ?
true :
false;
160 inline bool StDbNode::canRollBack()
const {
return mcanRollBack; }
161 inline void StDbNode::addWrittenNode(
int dataID){
165 inline void StDbNode::commit() { mcanRollBack =
false; }
166 inline bool StDbNode::checkName(
const char* nodeName)
const {
167 return (mname && (strcmp(mname,nodeName)==0)) ?
true :
false;
169 inline bool StDbNode::checkVersion(
const char* nodeVersion)
const {
170 return (mversion && (strcmp(mversion,nodeVersion)==0)) ?
true :
false;
172 inline bool StDbNode::checkNode(
const char* name,
const char* version)
const {
173 return (checkName(name) && checkVersion(version)) ?
true :
false;
175 inline bool StDbNode::IsTable()
const {
return false; }