]> git.stg.codes - stg.git/blobdiff - projects/stargazer/admin_impl.cpp
Reduction in code in method GetParamValue, correcting methods USER_IMPL::Disconnect...
[stg.git] / projects / stargazer / admin_impl.cpp
index 867717aa83d31bb3430eb37a99f7885cb4d353a3..3d2c4895bf52ef84b64d50f9e40eb437a452fe3f 100644 (file)
  $Author: faust $
  */
 
-#include "admin.h"
-#include "common.h"
+#include "admin_impl.h"
+#include "stg/common.h"
 
 //-----------------------------------------------------------------------------
-ADMIN::ADMIN()
-    : conf(),
+ADMIN_IMPL::ADMIN_IMPL()
+    : ADMIN(),
+      conf(),
       ip(0),
       WriteServLog(GetStgLogger())
 {
 }
 //-----------------------------------------------------------------------------
-ADMIN::ADMIN(const ADMIN_CONF & ac)
-    : conf(ac),
+ADMIN_IMPL::ADMIN_IMPL(const ADMIN_CONF & ac)
+    : ADMIN(),
+      conf(ac),
       ip(0),
       WriteServLog(GetStgLogger())
 {
 }
 //-----------------------------------------------------------------------------
-ADMIN::ADMIN(const PRIV & priv, const std::string & login, const std::string & password)
-    : conf(priv, login, password),
+ADMIN_IMPL::ADMIN_IMPL(const PRIV & priv,
+                       const std::string & login,
+                       const std::string & password)
+    : ADMIN(),
+      conf(priv, login, password),
       ip(0),
       WriteServLog(GetStgLogger())
 {
 }
 //-----------------------------------------------------------------------------
-ADMIN & ADMIN::operator=(const ADMIN & adm)
+ADMIN_IMPL & ADMIN_IMPL::operator=(const ADMIN_IMPL & adm)
 {
 if (&adm == this)
     return *this;
@@ -63,38 +68,38 @@ ip = adm.ip;
 return *this;
 }
 //-----------------------------------------------------------------------------
-ADMIN & ADMIN::operator=(const ADMIN_CONF & ac)
+ADMIN_IMPL & ADMIN_IMPL::operator=(const ADMIN_CONF & ac)
 {
 conf = ac;
 return *this;
 }
 //-----------------------------------------------------------------------------
-bool ADMIN::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::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::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::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;
 }
 //-----------------------------------------------------------------------------
-string ADMIN::GetAdminIPStr() const
+std::string ADMIN_IMPL::GetIPStr() const
 {
 return inet_ntostring(ip);
 }
 //-----------------------------------------------------------------------------
-void ADMIN::PrintAdmin() const
+void ADMIN_IMPL::Print() const
 {
 printfd(__FILE__, "=======================================\n");
 printfd(__FILE__, "login %s\n",     conf.login.c_str());
@@ -108,8 +113,8 @@ printfd(__FILE__, "ChgTariff %d\n", conf.priv.tariffChg);
 printfd(__FILE__, "=======================================\n");
 }
 //-----------------------------------------------------------------------------
-const string ADMIN::GetLogStr() const
+const std::string ADMIN_IMPL::GetLogStr() const
 {
-return "Admin \'" + conf.login + "\', " + GetAdminIPStr() + ":";
+return "Admin \'" + conf.login + "\', " + GetIPStr() + ":";
 }
 //-----------------------------------------------------------------------------