From: Maxim Mamontov Date: Wed, 14 Sep 2011 13:13:17 +0000 (+0300) Subject: Virtual destructor added to interface classes X-Git-Tag: 2.408-rc1~66 X-Git-Url: https://git.stg.codes/stg.git/commitdiff_plain/4ee4759a51cf944de103eb73a654ec00ccb3664d Virtual destructor added to interface classes --- diff --git a/include/stg/admin.h b/include/stg/admin.h index c5baf519..7552a1a1 100644 --- a/include/stg/admin.h +++ b/include/stg/admin.h @@ -28,15 +28,16 @@ class ADMIN { public: - virtual const std::string & GetPassword() const = 0; - virtual const std::string & GetLogin() const = 0; - virtual PRIV const * GetPriv() const = 0; - virtual uint16_t GetPrivAsInt() const = 0; - virtual const ADMIN_CONF & GetConf() const = 0; - virtual uint32_t GetIP() const = 0; - virtual std::string GetIPStr() const = 0; - virtual void SetIP(uint32_t ip) = 0; - virtual const std::string GetLogStr() const = 0; + virtual ~ADMIN() {} + virtual const std::string & GetPassword() const = 0; + virtual const std::string & GetLogin() const = 0; + virtual PRIV const * GetPriv() const = 0; + virtual uint16_t GetPrivAsInt() const = 0; + virtual const ADMIN_CONF & GetConf() const = 0; + virtual uint32_t GetIP() const = 0; + virtual std::string GetIPStr() const = 0; + virtual void SetIP(uint32_t ip) = 0; + virtual const std::string GetLogStr() const = 0; }; #endif diff --git a/include/stg/admins.h b/include/stg/admins.h index 7536a4a5..54ea1056 100644 --- a/include/stg/admins.h +++ b/include/stg/admins.h @@ -28,6 +28,7 @@ class ADMINS { public: + virtual ~ADMINS() {} virtual int Add(const std::string & login, const ADMIN * admin) = 0; virtual int Del(const std::string & login, const ADMIN * admin) = 0; virtual int Change(const ADMIN_CONF & ac, const ADMIN * admin) = 0; diff --git a/include/stg/corporations.h b/include/stg/corporations.h index 88c1e8bd..2d07c6c6 100644 --- a/include/stg/corporations.h +++ b/include/stg/corporations.h @@ -29,6 +29,7 @@ class ADMIN; class CORPORATIONS { public: + virtual ~CORPORATIONS() {} virtual int Add(const CORP_CONF & corp, const ADMIN * admin) = 0; virtual int Del(const std::string & name, const ADMIN * admin) = 0; virtual int Change(const CORP_CONF & corp, const ADMIN * admin) = 0; diff --git a/include/stg/message.h b/include/stg/message.h index 16fe566f..5a0e918e 100644 --- a/include/stg/message.h +++ b/include/stg/message.h @@ -27,7 +27,7 @@ STG_MSG_HDR() showTime(0), repeat(0), repeatPeriod(0) -{}; +{} uint64_t id; unsigned ver; @@ -41,12 +41,12 @@ unsigned repeatPeriod; //----------------------------------------------------------------------------- struct STG_MSG { -STG_MSG() {}; +STG_MSG() : header(), text() {} time_t GetNextSendTime() const { return header.lastSendTime + header.repeat * 60; -}; +} STG_MSG_HDR header; std::string text; diff --git a/include/stg/plugin.h b/include/stg/plugin.h index 845a3d15..2ecf7af0 100644 --- a/include/stg/plugin.h +++ b/include/stg/plugin.h @@ -45,6 +45,7 @@ struct MODULE_SETTINGS; class PLUGIN : private NONCOPYABLE { public: + virtual ~PLUGIN() {} virtual void SetUsers(USERS *) {} virtual void SetTariffs(TARIFFS *) {} virtual void SetAdmins(ADMINS *) {} diff --git a/include/stg/services.h b/include/stg/services.h index 5ff7a1a8..ddec31be 100644 --- a/include/stg/services.h +++ b/include/stg/services.h @@ -29,6 +29,7 @@ class ADMIN; class SERVICES { public: + virtual ~SERVICES() {} virtual int Add(const SERVICE_CONF & service, const ADMIN * admin) = 0; virtual int Del(const std::string & name, const ADMIN * admin) = 0; virtual int Change(const SERVICE_CONF & service, const ADMIN * admin) = 0; diff --git a/include/stg/store.h b/include/stg/store.h index 0eaf6c3e..e966076f 100644 --- a/include/stg/store.h +++ b/include/stg/store.h @@ -43,6 +43,7 @@ //----------------------------------------------------------------------------- class STORE { public: + virtual ~STORE() {} virtual int GetUsersList(std::vector * usersList) const = 0; virtual int AddUser(const std::string & login) const = 0; virtual int DelUser(const std::string & login) const = 0; diff --git a/include/stg/tariff.h b/include/stg/tariff.h index 189dde59..a5b1d2e9 100644 --- a/include/stg/tariff.h +++ b/include/stg/tariff.h @@ -30,6 +30,7 @@ class TARIFF { public: + virtual ~TARIFF() {} virtual double GetPriceWithTraffType(uint64_t up, uint64_t down, int dir, diff --git a/include/stg/tariffs.h b/include/stg/tariffs.h index 515e7608..9a35f645 100644 --- a/include/stg/tariffs.h +++ b/include/stg/tariffs.h @@ -32,6 +32,7 @@ struct TARIFF_DATA; class TARIFFS { public: + virtual ~TARIFFS() {} virtual int ReadTariffs () = 0; virtual const TARIFF * FindByName(const std::string & name) const = 0; virtual const TARIFF * GetNoTariff() const = 0; diff --git a/include/stg/user.h b/include/stg/user.h index 9cc44df8..204899ac 100644 --- a/include/stg/user.h +++ b/include/stg/user.h @@ -35,6 +35,7 @@ class AUTH; class USER { public: + virtual ~USER() {} virtual int WriteConf() = 0; virtual int WriteStat() = 0; diff --git a/include/stg/users.h b/include/stg/users.h index 80ee8478..2ba23833 100644 --- a/include/stg/users.h +++ b/include/stg/users.h @@ -30,6 +30,7 @@ class ADMIN; class USERS { public: + virtual ~USERS() {} virtual int FindByName(const std::string & login, USER_PTR * user) = 0; virtual bool TariffInUse(const std::string & tariffName) const = 0;