40 #ifndef STDATABASEI_HH
41 #define STDATABASEI_HH
48 #include "StDbDefs.hh"
71 StDbStoreType mdbStore;
77 StDataBaseI(
const char* typeName,
const char* domainName);
81 virtual void setDataBase(StDbType type, StDbDomain domain);
82 virtual void setDataBase(
const char* typeName,
const char* domainName);
83 virtual void setDataBase(
const char* dbName);
85 virtual void setDbType(StDbType type);
86 virtual void setDbDomain(StDbDomain domain);
87 virtual StDbType getDbType()
const ;
88 virtual StDbDomain getDbDomain()
const ;
90 virtual void setDbName(
const char* dbName);
91 virtual void setTypeName(
const char* typeName);
92 virtual void setDomainName(
const char* domainName);
93 virtual char* getDbName()
const ;
94 virtual char* getTypeName()
const ;
95 virtual char* getDomainName()
const ;
96 virtual char* printDbName();
97 virtual char* printTypeName();
98 virtual char* printDomainName();
99 virtual bool checkDbName(
const char* name);
100 virtual bool checkDbType(
const char* type);
101 virtual bool checkDbDomain(
const char* domain);
103 virtual StDbStoreType getDbStoreType()
const;
104 virtual void setDbStoreType(StDbStoreType type);
107 virtual void use() = 0;
108 virtual void close() = 0;
110 virtual int QueryDb(
StDbNode* node) = 0;
111 virtual int QueryDb(
StDbTable* table,
unsigned int reqTime) = 0;
112 virtual int QueryDb(
StDbTable* table,
const char* whereClause) = 0;
113 virtual unsigned int* QueryDbTimes(
StDbTable* table,
114 const char* whereClause,
int opt=0) = 0;
115 virtual int QueryDbFunction(
StDbTable* table,
116 const char* whereClause,
char* funcName) = 0;
117 virtual int QueryDescriptor(
StDbTable* table) = 0;
118 virtual int WriteDb(
StDbTable* table,
unsigned int storeTime) = 0;
119 virtual int WriteDb(
StDbConfigNode* node,
int parentID,
int& configID) = 0;
122 virtual int storeTableNode(
StDbTable* table) = 0;
123 virtual bool insertNodeRelation(
int configID,
int parent,
int child) = 0;
124 virtual bool rollBack(
StDbNode* node) = 0;
125 virtual bool rollBack(
StDbTable* table) = 0;
127 virtual unsigned int getUnixTime(
const char* time) = 0;
128 virtual char* getDateTime(
unsigned int time) = 0;
129 virtual int* selectElements(
const char* elementName,
131 int& numElements) = 0;
138 inline void StDataBaseI::setDbType(StDbType type) {mdbType = type; };
139 inline void StDataBaseI::setDbDomain(StDbDomain domain) {mdbDomain = domain; }
140 inline StDbType StDataBaseI::getDbType()
const {
return mdbType; };
141 inline StDbDomain StDataBaseI::getDbDomain()
const {
return mdbDomain; };
142 inline StDbStoreType StDataBaseI::getDbStoreType()
const {
return mdbStore;};
143 inline void StDataBaseI::setDbStoreType(StDbStoreType type) {mdbStore=type; };