class ADMIN {
public:
- virtual ADMIN & operator=(const ADMIN &) = 0;
- virtual ADMIN & operator=(const ADMIN_CONF &) = 0;
- virtual bool operator==(const ADMIN & rhs) const = 0;
- virtual bool operator!=(const ADMIN & rhs) const = 0;
- virtual bool operator<(const ADMIN & rhs) const = 0;
- virtual bool operator<=(const ADMIN & rhs) const = 0;
-
virtual const std::string & GetPassword() const = 0;
virtual const std::string & GetLogin() const = 0;
virtual PRIV const * GetPriv() const = 0;
virtual int64_t GetTraffByType(uint64_t up, uint64_t down) const = 0;
virtual int GetThreshold(int dir) const = 0;
virtual const TARIFF_DATA & GetTariffData() const = 0;
-
- virtual TARIFF & operator=(const TARIFF_DATA & td) = 0;
- virtual TARIFF & operator=(const TARIFF & t) = 0;
- virtual bool operator==(const TARIFF & rhs) const = 0;
- virtual bool operator!=(const TARIFF & rhs) const = 0;
};
#endif
{
}
//-----------------------------------------------------------------------------
-ADMIN & ADMIN_IMPL::operator=(const ADMIN & adm)
+ADMIN_IMPL & ADMIN_IMPL::operator=(const ADMIN_IMPL & adm)
{
if (&adm == this)
return *this;
-conf = adm.GetConf();
-ip = adm.GetIP();
+conf = adm.conf;
+ip = adm.ip;
return *this;
}
//-----------------------------------------------------------------------------
-ADMIN & ADMIN_IMPL::operator=(const ADMIN_CONF & ac)
+ADMIN_IMPL & ADMIN_IMPL::operator=(const ADMIN_CONF & ac)
{
conf = ac;
return *this;
}
//-----------------------------------------------------------------------------
-bool ADMIN_IMPL::operator==(const ADMIN & rhs) const
+bool ADMIN_IMPL::operator==(const ADMIN_IMPL & rhs) const
{
-return conf.login == rhs.GetLogin();
+return conf.login == rhs.conf.login;
}
//-----------------------------------------------------------------------------
-bool ADMIN_IMPL::operator!=(const ADMIN & rhs) const
+bool ADMIN_IMPL::operator!=(const ADMIN_IMPL & rhs) const
{
-return conf.login != rhs.GetLogin();
+return conf.login != rhs.conf.login;
}
//-----------------------------------------------------------------------------
-bool ADMIN_IMPL::operator<(const ADMIN & rhs) const
+bool ADMIN_IMPL::operator<(const ADMIN_IMPL & rhs) const
{
-return conf.login < rhs.GetLogin();
+return conf.login < rhs.conf.login;
}
//-----------------------------------------------------------------------------
-bool ADMIN_IMPL::operator<=(const ADMIN & rhs) const
+bool ADMIN_IMPL::operator<=(const ADMIN_IMPL & rhs) const
{
-return conf.login <= rhs.GetLogin();
+return conf.login <= rhs.conf.login;
}
//-----------------------------------------------------------------------------
std::string ADMIN_IMPL::GetIPStr() const
const std::string & password);
virtual ~ADMIN_IMPL() {};
- ADMIN & operator=(const ADMIN &);
- ADMIN & operator=(const ADMIN_CONF &);
- bool operator==(const ADMIN & rhs) const;
- bool operator!=(const ADMIN & rhs) const;
- bool operator<(const ADMIN & rhs) const;
- bool operator<=(const ADMIN & rhs) const;
+ ADMIN_IMPL & operator=(const ADMIN_IMPL &);
+ ADMIN_IMPL & operator=(const ADMIN_CONF &);
+ bool operator==(const ADMIN_IMPL & rhs) const;
+ bool operator!=(const ADMIN_IMPL & rhs) const;
+ bool operator<(const ADMIN_IMPL & rhs) const;
+ bool operator<=(const ADMIN_IMPL & rhs) const;
const std::string & GetPassword() const { return conf.password; };
const std::string & GetLogin() const { return conf.login; };
#include "stg_timer.h"
//-----------------------------------------------------------------------------
-TARIFF & TARIFF_IMPL::operator=(const TARIFF_DATA & td)
+TARIFF_IMPL & TARIFF_IMPL::operator=(const TARIFF_DATA & td)
{
tariffData = td;
return *this;
}
//-----------------------------------------------------------------------------
-TARIFF & TARIFF_IMPL::operator=(const TARIFF & t)
+TARIFF_IMPL & TARIFF_IMPL::operator=(const TARIFF_IMPL & t)
{
-tariffData = t.GetTariffData();
+tariffData = t.tariffData;
return *this;
}
//-----------------------------------------------------------------------------
int GetThreshold(int dir) const;
const TARIFF_DATA & GetTariffData() const { return tariffData; }
- TARIFF & operator=(const TARIFF_DATA & td);
- TARIFF & operator=(const TARIFF & t);
- bool operator==(const TARIFF & rhs) const { return GetName() == rhs.GetName(); }
- bool operator!=(const TARIFF & rhs) const { return GetName() != rhs.GetName(); }
+ TARIFF_IMPL & operator=(const TARIFF_DATA & td);
+ TARIFF_IMPL & operator=(const TARIFF_IMPL & t);
+ bool operator==(const TARIFF_IMPL & rhs) const { return GetName() == rhs.GetName(); }
+ bool operator!=(const TARIFF_IMPL & rhs) const { return GetName() != rhs.GetName(); }
private:
TARIFF_DATA tariffData;