]> git.stg.codes - stg.git/commitdiff
Explicit constructor initialization for the base class added
authorMaxim Mamontov <faust.madf@gmail.com>
Thu, 16 Jun 2011 09:53:48 +0000 (12:53 +0300)
committerMaxim Mamontov <faust.madf@gmail.com>
Thu, 16 Jun 2011 09:53:48 +0000 (12:53 +0300)
projects/stargazer/admin_impl.cpp
projects/stargazer/admins_impl.cpp
projects/stargazer/settings_impl.cpp
projects/stargazer/tariff_impl.h
projects/stargazer/tariffs_impl.cpp
projects/stargazer/traffcounter_impl.cpp
projects/stargazer/user_impl.cpp
projects/stargazer/users_impl.cpp

index 3d5574c742cf9dbc59e0b1ade6f35a26adb9c55b..7f1b301fc3ee920d75c9b13677323db2bc77a3fb 100644 (file)
 
 //-----------------------------------------------------------------------------
 ADMIN_IMPL::ADMIN_IMPL()
-    : conf(),
+    : ADMIN(),
+      conf(),
       ip(0),
       WriteServLog(GetStgLogger())
 {
 }
 //-----------------------------------------------------------------------------
 ADMIN_IMPL::ADMIN_IMPL(const ADMIN_CONF & ac)
-    : conf(ac),
+    : ADMIN(),
+      conf(ac),
       ip(0),
       WriteServLog(GetStgLogger())
 {
@@ -49,7 +51,8 @@ ADMIN_IMPL::ADMIN_IMPL(const ADMIN_CONF & ac)
 ADMIN_IMPL::ADMIN_IMPL(const PRIV & priv,
                        const std::string & login,
                        const std::string & password)
-    : conf(priv, login, password),
+    : ADMIN(),
+      conf(priv, login, password),
       ip(0),
       WriteServLog(GetStgLogger())
 {
index 4980234acc302a5734fa5afa478ab16445478bcc..3fe2c10b6c6c423629ee25ea2bd416a921449fb9 100644 (file)
@@ -42,7 +42,8 @@ using namespace std;
 
 //-----------------------------------------------------------------------------
 ADMINS_IMPL::ADMINS_IMPL(STORE * st)
-    : stg(0xFFFF, "@stargazer", ""),
+    : ADMINS(),
+      stg(0xFFFF, "@stargazer", ""),
       noAdmin(0xFFFF, "NO-ADMIN", ""),
       data(),
       store(st),
index f9135a1ae8f959b1a362ca85e22bc8b524406083..d197efc40c32877bf1852982b2f34a8df7a15d93 100644 (file)
@@ -40,7 +40,8 @@ using namespace std;
 
 //-----------------------------------------------------------------------------
 SETTINGS_IMPL::SETTINGS_IMPL()
-    : strError(),
+    : SETTINGS(),
+      strError(),
       modulesPath("/usr/lib/stg"),
       dirName(DIR_NUM),
       confDir("/etc/stargazer"),
@@ -72,7 +73,8 @@ SETTINGS_IMPL::SETTINGS_IMPL()
 }
 //-----------------------------------------------------------------------------
 SETTINGS_IMPL::SETTINGS_IMPL(const std::string & cd)
-    : strError(),
+    : SETTINGS(),
+      strError(),
       modulesPath("/usr/lib/stg"),
       dirName(DIR_NUM),
       confDir(cd),
@@ -104,7 +106,8 @@ SETTINGS_IMPL::SETTINGS_IMPL(const std::string & cd)
 }
 //-----------------------------------------------------------------------------
 SETTINGS_IMPL::SETTINGS_IMPL(const SETTINGS_IMPL & rval)
-    : strError(),
+    : SETTINGS(),
+      strError(),
       modulesPath(rval.modulesPath),
       dirName(rval.dirName),
       confDir(rval.confDir),
index b8d0a776d729407a206cebe5d5110b1ab99933a6..cdfd711243f8d8d5fbe34588384f71287384a8d7 100644 (file)
 class TARIFF_IMPL : public TARIFF {
 public:
     TARIFF_IMPL()
-        : tariffData()
+        : TARIFF(),
+          tariffData()
     {};
     TARIFF_IMPL(const std::string & name)
-        : tariffData(name)
+        : TARIFF(),
+          tariffData(name)
     {};
     TARIFF_IMPL(const TARIFF_DATA & td)
-        : tariffData(td)
+        : TARIFF(),
+          tariffData(td)
     {};
     TARIFF_IMPL(const TARIFF_IMPL & t)
-        : tariffData(t.tariffData)
+        : TARIFF(),
+          tariffData(t.tariffData)
     {};
     virtual ~TARIFF_IMPL() {};
 
index d6d6b36ae66a5ee97976194fd9cbb0894cee22f1..d2ea7c9a049ae9c2d606deed6b26c2aa9621db8c 100644 (file)
@@ -42,7 +42,8 @@ using namespace std;
 
 //-----------------------------------------------------------------------------
 TARIFFS_IMPL::TARIFFS_IMPL(STORE * st)
-    : tariffs(),
+    : TARIFFS(),
+      tariffs(),
       store(st),
       WriteServLog(GetStgLogger()),
       strError(),
index 424cc09468f949b5ed5c13b87a8a2c1b4eea2b1b..237799f5e22a56fc083419ff2aadb9726dd0508c 100644 (file)
@@ -37,6 +37,7 @@
 #include <csignal>
 #include <cassert>
 #include <cstdio> // fopen and similar
+#include <cstdlib> // strtol
 
 #include "stg/common.h"
 #include "stg/locker.h"
@@ -57,7 +58,8 @@ tcp = 0, udp, icmp, tcp_udp, all
 
 //-----------------------------------------------------------------------------
 TRAFFCOUNTER_IMPL::TRAFFCOUNTER_IMPL(USERS_IMPL * u, const std::string & fn)
-    : WriteServLog(GetStgLogger()),
+    : TRAFFCOUNTER(),
+      WriteServLog(GetStgLogger()),
       rulesFileName(fn),
       monitoring(false),
       users(u),
index e8d326d2c3d72586bc6293007ca584df1c8b09dc..ec271442bd428f7ebae398e195daad9d098ed99c 100644 (file)
@@ -54,7 +54,8 @@ USER_IMPL::USER_IMPL(const SETTINGS * s,
            const TARIFFS * t,
            const ADMIN * a,
            const USERS * u)
-    : users(u),
+    : USER(),
+      users(u),
       property(s->GetScriptsDir()),
       WriteServLog(GetStgLogger()),
       login(),
@@ -137,7 +138,8 @@ USER_IMPL::USER_IMPL(const SETTINGS_IMPL * s,
            const TARIFFS * t,
            const ADMIN * a,
            const USERS * u)
-    : users(u),
+    : USER(),
+      users(u),
       property(s->GetScriptsDir()),
       WriteServLog(GetStgLogger()),
       login(),
@@ -217,7 +219,8 @@ pthread_mutex_init(&mutex, &attr);
 #endif
 //-----------------------------------------------------------------------------
 USER_IMPL::USER_IMPL(const USER_IMPL & u)
-    : users(u.users),
+    : USER(),
+      users(u.users),
       property(u.settings->GetScriptsDir()),
       WriteServLog(GetStgLogger()),
       login(u.login),
index d0e5364463ea12d0a1aae688d5cf24209833eb01..febd90f5575d2ba2f4a9f829cea12d2a180e2604 100644 (file)
@@ -53,7 +53,8 @@ extern const volatile time_t stgTime;
 
 //-----------------------------------------------------------------------------
 USERS_IMPL::USERS_IMPL(SETTINGS_IMPL * s, STORE * st, TARIFFS * t, const ADMIN * sa)
-    : users(),
+    : USERS(),
+      users(),
       usersToDelete(),
       userIPNotifiersBefore(),
       userIPNotifiersAfter(),
@@ -274,7 +275,7 @@ usersList.clear();
 if (store->GetUsersList(&usersList) < 0)
     {
     WriteServLog(store->GetStrError().c_str());
-    exit(1);
+    return -1;
     }
 
 user_iter ui;