85 #include "StDbDefs.hh"
86 #include "StDataBaseI.hh"
92 char* mserverName = 0;
94 char* munixSocket = 0;
98 bool misDefault =
false;
100 char* mstringDup(
const char * str)
const;
106 StDbServer(
const char* name,
const char* host,
const char* sock,
int port);
110 virtual void setHostName(
const char* name);
111 virtual void setUnixSocket(
const char* name);
112 virtual void setPortNumber(
int port);
113 virtual void setServerName(
const char* name);
114 virtual void setUser(
const char* name,
const char* pword=0);
117 virtual char* getServerName()
const;
118 virtual char* getHostName()
const;
119 virtual char* getUnixSocket()
const;
120 virtual int getPortNumber()
const;
121 virtual char* printServerName();
122 virtual char* printHostName();
123 virtual char* printUnixSocket();
124 virtual char* printUser();
125 virtual char* printPword();
127 virtual void setIsDefaultServer();
128 virtual bool isDefault()
const ;
131 virtual void addDataBase(StDbType type, StDbDomain domain) =0;
132 virtual void addDataBase(
const char* typeName,
const char* domName) =0;
133 virtual StDataBaseI* useDb(StDbType type, StDbDomain domain) =0;
134 virtual StDataBaseI* useDb(
const char* typeName,
const char* domName) =0;
137 virtual bool isConnected() =0;
138 virtual void closeConnection() =0;
139 virtual void setTimeLogging(
bool isTimeLogged) =0;
140 virtual double getQueryTimes() =0;
141 virtual double getSocketTimes() =0;
142 virtual double getConnectTimes() =0;
146 inline void StDbServer::setPortNumber(
int port){ mportNumber = port;}
147 inline int StDbServer::getPortNumber()
const {
return mportNumber; }
148 inline char* StDbServer::printServerName() {
return mserverName; }
149 inline char* StDbServer::printHostName() {
return mhostName; }
150 inline char* StDbServer::printUnixSocket() {
return munixSocket; }
151 inline char* StDbServer::printUser() {
return muserName; }
152 inline char* StDbServer::printPword() {
return mpword; }
153 inline void StDbServer::setIsDefaultServer() { misDefault=
true; }
154 inline bool StDbServer::isDefault()
const {
return misDefault; }