//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
FIREBIRD_STORE::FIREBIRD_STORE()
+ : version("firebird_store v.1.4"),
+ strError(),
+ db_server("localhost"),
+ db_database("/var/stg/stargazer.fdb"),
+ db_user("stg"),
+ db_password("123456"),
+ settings(),
+ db(),
+ mutex(),
+ til(IBPP::ilConcurrency),
+ tlr(IBPP::lrWait)
{
-db_server = "localhost";
-db_database = "/var/stg/stargazer.fdb";
-db_user = "stg";
-db_password = "123456";
-version = "firebird_store v.1.4";
pthread_mutex_init(&mutex, NULL);
-
-// Advanced settings defaults
-
-til = IBPP::ilConcurrency;
-tlr = IBPP::lrWait;
}
//-----------------------------------------------------------------------------
FIREBIRD_STORE::~FIREBIRD_STORE()
int RestoreService(SERVICE_CONF * sc, const std::string & name) const;
int AddService(const std::string & name) const;
int DelService(const std::string & name) const;
+
private:
+ FIREBIRD_STORE(const FIREBIRD_STORE & rvalue);
+ FIREBIRD_STORE & operator=(const FIREBIRD_STORE & rvalue);
+
std::string version;
mutable std::string strError;
mutable std::string db_server, db_database, db_user, db_password;
}
//-----------------------------------------------------------------------------
MYSQL_STORE_SETTINGS::MYSQL_STORE_SETTINGS()
- : settings(NULL)
+ : settings(NULL),
+ errorStr(),
+ dbUser(),
+ dbPass(),
+ dbName(),
+ dbHost()
{
-}
-//-----------------------------------------------------------------------------
-MYSQL_STORE_SETTINGS::~MYSQL_STORE_SETTINGS()
-{
-
}
//-----------------------------------------------------------------------------
int MYSQL_STORE_SETTINGS::ParseParam(const vector<PARAM_VALUE> & moduleParams,
return 0;
}
//-----------------------------------------------------------------------------
-const string & MYSQL_STORE_SETTINGS::GetStrError() const
-{
-return errorStr;
-}
-//-----------------------------------------------------------------------------
-string MYSQL_STORE_SETTINGS::GetDBUser() const
-{
-return dbUser;
-}
-//-----------------------------------------------------------------------------
-string MYSQL_STORE_SETTINGS::GetDBPassword() const
-{
-return dbPass;
-}
-//-----------------------------------------------------------------------------
-string MYSQL_STORE_SETTINGS::GetDBHost() const
-{
-return dbHost;
-}
-//-----------------------------------------------------------------------------
-string MYSQL_STORE_SETTINGS::GetDBName() const
-{
-return dbName;
-}
-//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
MYSQL_STORE::MYSQL_STORE()
+ : errorStr(),
+ version("mysql_store v.0.67"),
+ storeSettings(),
+ settings()
{
-version = "mysql_store v.0.67";
};
//-----------------------------------------------------------------------------
-MYSQL_STORE::~MYSQL_STORE()
-{
-};
-//-----------------------------------------------------------------------------
-void MYSQL_STORE::SetSettings(const MODULE_SETTINGS & s)
-{
-settings = s;
-}
-//-----------------------------------------------------------------------------
int MYSQL_STORE::MysqlQuery(const char* sQuery,MYSQL * sock) const
{
int ret,i;
return ret;
}
//-----------------------------------------------------------------------------
-const string & MYSQL_STORE::GetStrError() const
-{
-return errorStr;
-}
-//-----------------------------------------------------------------------------
-const string & MYSQL_STORE::GetVersion() const
-{
-return version;
-}
-//-----------------------------------------------------------------------------
bool MYSQL_STORE::IsTablePresent(const string & str,MYSQL * sock)
{
MYSQL_RES* result;
{
public:
MYSQL_STORE_SETTINGS();
- virtual ~MYSQL_STORE_SETTINGS();
+ virtual ~MYSQL_STORE_SETTINGS() {}
virtual int ParseSettings(const MODULE_SETTINGS & s);
- virtual const string & GetStrError() const;
+ virtual const string & GetStrError() const { return errorStr; }
- string GetDBUser() const;
- string GetDBPassword() const;
- string GetDBHost() const;
- string GetDBName() const;
+ const string & GetDBUser() const { return dbUser; }
+ const string & GetDBPassword() const { return dbPass; }
+ const string & GetDBHost() const { return dbHost; }
+ const string & GetDBName() const { return dbName; }
private:
+ MYSQL_STORE_SETTINGS(const MYSQL_STORE_SETTINGS & rvalue);
+ MYSQL_STORE_SETTINGS & operator=(const MYSQL_STORE_SETTINGS & rvalue);
+
const MODULE_SETTINGS * settings;
int ParseParam(const vector<PARAM_VALUE> & moduleParams,
{
public:
MYSQL_STORE();
- virtual ~MYSQL_STORE();
- virtual const string & GetStrError() const;
+ virtual ~MYSQL_STORE() {}
+ virtual const string & GetStrError() const { return errorStr; }
//User
virtual int GetUsersList(vector<string> * usersList) const;
virtual int AddService(const string &) const {return 0;};
virtual int DelService(const string &) const {return 0;};
- //virtual BASE_SETTINGS * GetStoreSettings();
- virtual void SetSettings(const MODULE_SETTINGS & s);
+ virtual void SetSettings(const MODULE_SETTINGS & s) { settings = s; }
virtual int ParseSettings();
- virtual const string & GetVersion() const;
+ virtual const string & GetVersion() const { return version; }
private:
+ MYSQL_STORE(const MYSQL_STORE & rvalue);
+ MYSQL_STORE & operator=(const MYSQL_STORE & rvalue);
+
virtual int WriteLogString(const string & str, const string & login) const;
int GetAllParams(vector<string> * ParamList, const string & table, const string & name) const;
int CheckAllTables(MYSQL * sock);
bool IsTablePresent(const string & str,MYSQL * sock);
mutable string errorStr;
-// int Reconnect();
int MysqlQuery(const char* sQuery,MYSQL * sock) const;
int MysqlGetQuery(const char * Query,MYSQL * & sock) const;
int MysqlSetQuery(const char * Query) const;
string version;
MYSQL_STORE_SETTINGS storeSettings;
MODULE_SETTINGS settings;
- //mutable MYSQL mysql;
- //mutable MYSQL* sock;
};
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
POSTGRESQL_STORE::POSTGRESQL_STORE()
: versionString("postgresql_store v.1.3"),
+ strError(),
server("localhost"),
database("stargazer"),
user("stg"),
password("123456"),
+ clientEncoding("KOI8"),
+ settings(),
+ mutex(),
version(0),
retries(3),
connection(NULL)
inline const string & GetStrError() const { return strError; };
inline const string & GetVersion() const { return versionString; };
private:
+ POSTGRESQL_STORE(const POSTGRESQL_STORE & rvalue);
+ POSTGRESQL_STORE & operator=(const POSTGRESQL_STORE & rvalue);
+
int StartTransaction() const;
int CommitTransaction() const;
int RollbackTransaction() const;