From: Maxim Mamontov Date: Thu, 15 Sep 2011 20:05:10 +0000 (+0300) Subject: Hide or add proper copy ctor and assignement operator, initialize X-Git-Tag: 2.408-rc1~41 X-Git-Url: https://git.stg.codes/stg.git/commitdiff_plain/6b0c81934f762b8804d137375e21e7957446cefd Hide or add proper copy ctor and assignement operator, initialize members via initialization lists in rpcconfig code --- diff --git a/projects/stargazer/plugins/configuration/rpcconfig/admins_methods.h b/projects/stargazer/plugins/configuration/rpcconfig/admins_methods.h index d353c96d..e9775718 100644 --- a/projects/stargazer/plugins/configuration/rpcconfig/admins_methods.h +++ b/projects/stargazer/plugins/configuration/rpcconfig/admins_methods.h @@ -20,7 +20,11 @@ public: void execute(xmlrpc_c::paramList const & paramList, xmlrpc_c::value * const retvalPtr); + private: + METHOD_ADMIN_GET(const METHOD_ADMIN_GET & rvalue); + METHOD_ADMIN_GET & operator=(const METHOD_ADMIN_GET & rvalue); + RPC_CONFIG * config; ADMINS * admins; }; @@ -36,7 +40,11 @@ public: void execute(xmlrpc_c::paramList const & paramList, xmlrpc_c::value * const retvalPtr); + private: + METHOD_ADMIN_ADD(const METHOD_ADMIN_ADD & rvalue); + METHOD_ADMIN_ADD & operator=(const METHOD_ADMIN_ADD & rvalue); + RPC_CONFIG * config; ADMINS * admins; }; @@ -52,7 +60,11 @@ public: void execute(xmlrpc_c::paramList const & paramList, xmlrpc_c::value * const retvalPtr); + private: + METHOD_ADMIN_DEL(const METHOD_ADMIN_DEL & rvalue); + METHOD_ADMIN_DEL & operator=(const METHOD_ADMIN_DEL & rvalue); + RPC_CONFIG * config; ADMINS * admins; }; @@ -68,7 +80,11 @@ public: void execute(xmlrpc_c::paramList const & paramList, xmlrpc_c::value * const retvalPtr); + private: + METHOD_ADMIN_CHG(const METHOD_ADMIN_CHG & rvalue); + METHOD_ADMIN_CHG & operator=(const METHOD_ADMIN_CHG & rvalue); + RPC_CONFIG * config; ADMINS * admins; }; @@ -84,7 +100,11 @@ public: void execute(xmlrpc_c::paramList const & paramList, xmlrpc_c::value * const retvalPtr); + private: + METHOD_ADMINS_GET(const METHOD_ADMINS_GET & rvalue); + METHOD_ADMINS_GET & operator=(const METHOD_ADMINS_GET & rvalue); + RPC_CONFIG * config; ADMINS * admins; }; diff --git a/projects/stargazer/plugins/configuration/rpcconfig/info_methods.h b/projects/stargazer/plugins/configuration/rpcconfig/info_methods.h index 60a2b319..cb72bbf7 100644 --- a/projects/stargazer/plugins/configuration/rpcconfig/info_methods.h +++ b/projects/stargazer/plugins/configuration/rpcconfig/info_methods.h @@ -30,7 +30,11 @@ public: void execute(xmlrpc_c::paramList const & paramList, xmlrpc_c::value * const retvalP); + private: + METHOD_INFO(const METHOD_INFO & rvalue); + METHOD_INFO & operator=(const METHOD_INFO & rvalue); + TARIFFS * tariffs; USERS * users; size_t dayFee; @@ -47,7 +51,11 @@ public: void execute(xmlrpc_c::paramList const & paramList, xmlrpc_c::value * const retvalP); + private: + METHOD_LOGIN(const METHOD_LOGIN & rvalue); + METHOD_LOGIN & operator=(const METHOD_LOGIN & rvalue); + RPC_CONFIG * config; }; @@ -61,7 +69,11 @@ public: void execute(xmlrpc_c::paramList const & paramList, xmlrpc_c::value * const retvalP); + private: + METHOD_LOGOUT(const METHOD_LOGOUT & rvalue); + METHOD_LOGOUT & operator=(const METHOD_LOGOUT & rvalue); + RPC_CONFIG * config; }; diff --git a/projects/stargazer/plugins/configuration/rpcconfig/messages_methods.h b/projects/stargazer/plugins/configuration/rpcconfig/messages_methods.h index 2e5a2fdc..7188d0bf 100644 --- a/projects/stargazer/plugins/configuration/rpcconfig/messages_methods.h +++ b/projects/stargazer/plugins/configuration/rpcconfig/messages_methods.h @@ -19,7 +19,11 @@ public: void execute(xmlrpc_c::paramList const & paramList, xmlrpc_c::value * const retvalPtr); + private: + METHOD_MESSAGE_SEND(const METHOD_MESSAGE_SEND & rvalue); + METHOD_MESSAGE_SEND & operator=(const METHOD_MESSAGE_SEND & rvalue); + RPC_CONFIG * config; USERS * users; }; diff --git a/projects/stargazer/plugins/configuration/rpcconfig/rpcconfig.cpp b/projects/stargazer/plugins/configuration/rpcconfig/rpcconfig.cpp index 1f2b8e18..b82293d4 100644 --- a/projects/stargazer/plugins/configuration/rpcconfig/rpcconfig.cpp +++ b/projects/stargazer/plugins/configuration/rpcconfig/rpcconfig.cpp @@ -75,14 +75,21 @@ return rpcc.GetPlugin(); } RPC_CONFIG::RPC_CONFIG() - : users(NULL), + : errorStr(), + rpcConfigSettings(), + users(NULL), admins(NULL), tariffs(NULL), store(NULL), + settings(), + rpcRegistry(), rpcServer(NULL), running(false), stopped(true), - dayFee(0) + tid(), + cookies(), + dayFee(0), + dirNames() { } diff --git a/projects/stargazer/plugins/configuration/rpcconfig/rpcconfig.h b/projects/stargazer/plugins/configuration/rpcconfig/rpcconfig.h index 1095dd73..4e6d9f1f 100644 --- a/projects/stargazer/plugins/configuration/rpcconfig/rpcconfig.h +++ b/projects/stargazer/plugins/configuration/rpcconfig/rpcconfig.h @@ -30,11 +30,12 @@ class RPC_CONFIG_SETTINGS { public: RPC_CONFIG_SETTINGS(); - virtual ~RPC_CONFIG_SETTINGS() {}; - const std::string & GetStrError() const { return errorStr; }; + virtual ~RPC_CONFIG_SETTINGS() {} + const std::string & GetStrError() const { return errorStr; } int ParseSettings(const MODULE_SETTINGS & s); - uint16_t GetPort() const { return port; }; - double GetCookieTimeout() const { return cookieTimeout; }; + uint16_t GetPort() const { return port; } + double GetCookieTimeout() const { return cookieTimeout; } + private: std::string errorStr; int port; @@ -43,6 +44,12 @@ private: struct ADMIN_INFO { + ADMIN_INFO() + : admin(), + accessTime(0), + priviledges() + {} + std::string admin; time_t accessTime; PRIV priviledges; @@ -80,6 +87,9 @@ public: bool LogoutAdmin(const std::string & cookie); private: + RPC_CONFIG(const RPC_CONFIG & rvalue); + RPC_CONFIG & operator=(const RPC_CONFIG & rvalue); + static void * Run(void *); std::string GetCookie() const; void InitiateRegistry(); diff --git a/projects/stargazer/plugins/configuration/rpcconfig/tariffs_methods.h b/projects/stargazer/plugins/configuration/rpcconfig/tariffs_methods.h index 3f99b349..d43840d0 100644 --- a/projects/stargazer/plugins/configuration/rpcconfig/tariffs_methods.h +++ b/projects/stargazer/plugins/configuration/rpcconfig/tariffs_methods.h @@ -20,7 +20,11 @@ public: void execute(xmlrpc_c::paramList const & paramList, xmlrpc_c::value * const retvalPtr); + private: + METHOD_TARIFF_GET(const METHOD_TARIFF_GET & rvalue); + METHOD_TARIFF_GET & operator=(const METHOD_TARIFF_GET & rvalue); + RPC_CONFIG * config; TARIFFS * tariffs; }; @@ -38,7 +42,11 @@ public: void execute(xmlrpc_c::paramList const & paramList, xmlrpc_c::value * const retvalPtr); + private: + METHOD_TARIFF_CHG(const METHOD_TARIFF_CHG & rvalue); + METHOD_TARIFF_CHG & operator=(const METHOD_TARIFF_CHG & rvalue); + RPC_CONFIG * config; ADMINS * admins; TARIFFS * tariffs; @@ -55,7 +63,11 @@ public: void execute(xmlrpc_c::paramList const & paramList, xmlrpc_c::value * const retvalPtr); + private: + METHOD_TARIFFS_GET(const METHOD_TARIFFS_GET & rvalue); + METHOD_TARIFFS_GET & operator=(const METHOD_TARIFFS_GET & rvalue); + RPC_CONFIG * config; TARIFFS * tariffs; }; @@ -73,7 +85,11 @@ public: void execute(xmlrpc_c::paramList const & paramList, xmlrpc_c::value * const retvalP); + private: + METHOD_TARIFF_ADD(const METHOD_TARIFF_ADD & rvalue); + METHOD_TARIFF_ADD & operator=(const METHOD_TARIFF_ADD & rvalue); + RPC_CONFIG * config; ADMINS * admins; TARIFFS * tariffs; @@ -94,7 +110,11 @@ public: void execute(xmlrpc_c::paramList const & paramList, xmlrpc_c::value * const retvalP); + private: + METHOD_TARIFF_DEL(const METHOD_TARIFF_DEL & rvalue); + METHOD_TARIFF_DEL & operator=(const METHOD_TARIFF_DEL & rvalue); + RPC_CONFIG * config; ADMINS * admins; TARIFFS * tariffs; diff --git a/projects/stargazer/plugins/configuration/rpcconfig/users_methods.h b/projects/stargazer/plugins/configuration/rpcconfig/users_methods.h index 04725804..413e9aaf 100644 --- a/projects/stargazer/plugins/configuration/rpcconfig/users_methods.h +++ b/projects/stargazer/plugins/configuration/rpcconfig/users_methods.h @@ -22,7 +22,11 @@ public: void execute(xmlrpc_c::paramList const & paramList, xmlrpc_c::value * const retvalP); + private: + METHOD_USER_GET(const METHOD_USER_GET & rvalue); + METHOD_USER_GET & operator=(const METHOD_USER_GET & rvalue); + RPC_CONFIG * config; USERS * users; }; @@ -40,7 +44,11 @@ public: void execute(xmlrpc_c::paramList const & paramList, xmlrpc_c::value * const retvalP); + private: + METHOD_USER_ADD(const METHOD_USER_ADD & rvalue); + METHOD_USER_ADD & operator=(const METHOD_USER_ADD & rvalue); + RPC_CONFIG * config; ADMINS * admins; USERS * users; @@ -59,7 +67,11 @@ public: void execute(xmlrpc_c::paramList const & paramList, xmlrpc_c::value * const retvalP); + private: + METHOD_USER_DEL(const METHOD_USER_DEL & rvalue); + METHOD_USER_DEL & operator=(const METHOD_USER_DEL & rvalue); + RPC_CONFIG * config; ADMINS * admins; USERS * users; @@ -76,7 +88,11 @@ public: void execute(xmlrpc_c::paramList const & paramList, xmlrpc_c::value * const retvalP); + private: + METHOD_USERS_GET(const METHOD_USERS_GET & rvalue); + METHOD_USERS_GET & operator=(const METHOD_USERS_GET & rvalue); + RPC_CONFIG * config; USERS * users; }; @@ -98,7 +114,11 @@ public: void execute(xmlrpc_c::paramList const & paramList, xmlrpc_c::value * const retvalP); + private: + METHOD_USER_CHG(const METHOD_USER_CHG & rvalue); + METHOD_USER_CHG & operator=(const METHOD_USER_CHG & rvalue); + RPC_CONFIG * config; ADMINS * admins; TARIFFS * tariffs; @@ -121,7 +141,11 @@ public: void execute(xmlrpc_c::paramList const & paramList, xmlrpc_c::value * const retvalP); + private: + METHOD_USER_CASH_ADD(const METHOD_USER_CASH_ADD & rvalue); + METHOD_USER_CASH_ADD & operator=(const METHOD_USER_CASH_ADD & rvalue); + RPC_CONFIG * config; ADMINS * admins; STORE * store; @@ -143,7 +167,11 @@ public: void execute(xmlrpc_c::paramList const & paramList, xmlrpc_c::value * const retvalP); + private: + METHOD_USER_CASH_SET(const METHOD_USER_CASH_SET & rvalue); + METHOD_USER_CASH_SET & operator=(const METHOD_USER_CASH_SET & rvalue); + RPC_CONFIG * config; ADMINS * admins; STORE * store; @@ -167,7 +195,11 @@ public: void execute(xmlrpc_c::paramList const & paramList, xmlrpc_c::value * const retvalP); + private: + METHOD_USER_TARIFF_CHANGE(const METHOD_USER_TARIFF_CHANGE & rvalue); + METHOD_USER_TARIFF_CHANGE & operator=(const METHOD_USER_TARIFF_CHANGE & rvalue); + RPC_CONFIG * config; ADMINS * admins; TARIFFS * tariffs; @@ -186,7 +218,11 @@ public: void execute(xmlrpc_c::paramList const & paramList, xmlrpc_c::value * const retvalP); + private: + METHOD_GET_ONLINE_IPS(const METHOD_GET_ONLINE_IPS & rvalue); + METHOD_GET_ONLINE_IPS & operator=(const METHOD_GET_ONLINE_IPS & rvalue); + RPC_CONFIG * config; USERS * users;