Added doxygen comments and renamed members.
authorBjoern Sikora <bjoern.sikora@intra2net.com>
Mon, 27 Jul 2009 12:31:11 +0000 (14:31 +0200)
committerBjoern Sikora <bjoern.sikora@intra2net.com>
Mon, 27 Jul 2009 12:31:11 +0000 (14:31 +0200)
src/config.cpp
src/dhs.cpp
src/dhs.h
src/main.cpp
src/ods.cpp
src/ods.h
src/service.cpp
src/service.h
src/updater.cpp
src/updater.h

index 597abdd..a16db64 100644 (file)
@@ -123,7 +123,7 @@ int Config::parse_cmd_line(int argc, char *argv[])
  */
 int Config::load_config_from_files(string config_path)
 {
-    fs::path full_config_path = fs::system_complete(fs::path(config_path));
+/*    fs::path full_config_path = fs::system_complete(fs::path(config_path));
 
     if( fs::exists(full_config_path) && fs::is_directory(full_config_path))
     {
@@ -147,7 +147,7 @@ int Config::load_config_from_files(string config_path)
         return 4;
     }
 
-
+*/
 
 
 
@@ -194,7 +194,7 @@ int Config::load_config_from_files(string config_path)
     // then load all service definition files in config path
 
     // TODO: code to load service definition files in config path
-    return -1;
+    return 0;
 }
 
 
index f7fb417..82d94e9 100644 (file)
@@ -1,32 +1,53 @@
-//
-// C++ Implementation: dhs
-//
-// Description: 
-//
-//
-// Author: Bjoern Sikora <bjoern.sikora@intra2net.com>, (C) 2009
-//
-// Copyright: See COPYING file that comes with this distribution
-//
-//
+/** @file
+ * @brief DHS Service class implementation. This class represents the DHS service.
+ *
+ *
+ *
+ * @copyright Intra2net AG
+ * @license GPLv2
+*/
+
 #include "dhs.h"
 
-DHS::DHS(string _hostname, string login, string password)
+
+/**
+ * Default constructor.
+ */
+DHS::DHS()
+{
+}
+
+
+/**
+ * Constructor.
+ * @param _hostname The hostname to update
+ * @param _login The login name.
+ * @param _password The corresponding password.
+ */
+DHS::DHS(string _hostname, string _login, string _password)
 {
-    // Vielleicht: Hostname = _hostname;
-    this->hostname = _hostname;
-    this->login = login;
-    this->password = password;
+    Hostname = _hostname;
+    Login = _login;
+    Password = _password;
 }
 
+
+/**
+ * Default destructor
+ */
 DHS::~DHS()
 {
 }
 
-void DHS::update(string)
+
+/**
+ * Service update method which should implement the corresponding service protocol.
+ * @param ip The new ip to set for the hostname.
+ */
+void DHS::update(string ip)
 {
     cout << "Running Update for Service DHS" << endl;
-    cout << "Hostname: " << this->hostname << endl;
-    cout << "Login: " << this->login << endl;
-    cout << "Password: " << this->password << endl;
+    cout << "Hostname: " << Hostname << endl;
+    cout << "Login: " << Login << endl;
+    cout << "Password: " << Password << endl;
 }
index 2552902..41f5639 100644 (file)
--- a/src/dhs.h
+++ b/src/dhs.h
@@ -1,14 +1,12 @@
-//
-// C++ Interface: dhs
-//
-// Description: 
-//
-//
-// Author: Bjoern Sikora <bjoern.sikora@intra2net.com>, (C) 2009
-//
-// Copyright: See COPYING file that comes with this distribution
-//
-//
+/** @file
+ * @brief DHS Service class header. This class represents the DHS service.
+ *
+ *
+ *
+ * @copyright Intra2net AG
+ * @license GPLv2
+*/
+
 #ifndef DHS_H
 #define DHS_H
 
 
 using namespace std;
 
-/**
-       @author Bjoern Sikora <bjoern.sikora@intra2net.com>
-*/
-class DHS : public Service {
+class DHS : public Service
+{
 private:
-    string hostname;
-    string login;
-    string password;
+    string Hostname;
+    string Login;
+    string Password;
 
 public:
+    DHS();
+
     DHS(string,string,string);
 
     ~DHS();
index 21c17c1..462ffc4 100644 (file)
@@ -1,3 +1,11 @@
+/** @file
+ * @brief The main function.
+ *
+ *
+ *
+ * @copyright Intra2net AG
+ * @license GPLv2
+*/
 
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 using namespace std;
 
 /**
- * @brief the main part.
- * @param argc number of arguments
- * @param argv command line arguments
- * @return exit code for the process.
+ * @brief The main part.
+ * @param argc Number of arguments
+ * @param argv Command line arguments
+ * @return 0 if all is fine.
  */
 int main(int argc, char *argv[])
 {
index 44590c5..7a83309 100644 (file)
@@ -1,33 +1,52 @@
-//
-// C++ Implementation: ods
-//
-// Description: 
-//
-//
-// Author: Bjoern Sikora <bjoern.sikora@intra2net.com>, (C) 2009
-//
-// Copyright: See COPYING file that comes with this distribution
-//
-//
+/** @file
+ * @brief ODS Service class implementation. This class represents the ODS service.
+ *
+ *
+ *
+ * @copyright Intra2net AG
+ * @license GPLv2
+*/
+
 #include "ods.h"
 
-ODS::ODS(string hostname, string login, string password)
+/**
+ * Default constructor.
+ */
+ODS::ODS()
 {
-    this->hostname = hostname;
-    this->login = login;
-    this->password = password;
 }
 
-ODS::~ODS()
+
+/**
+ * Constructor.
+ * @param _hostname The hostname to update
+ * @param _login The login name.
+ * @param _password The corresponding password.
+ */
+ODS::ODS(string _hostname, string _login, string _password)
 {
+    Hostname = _hostname;
+    Login = _login;
+    Password = _password;
 }
 
-void ODS::update(string)
+
+/**
+ * Default destructor.
+ */
+ODS::~ODS()
 {
-    // Service protocol definition should start here
+}
 
+
+/**
+ * Service update method which should implement the corresponding service protocol.
+ * @param ip The new ip to set for the hostname.
+ */
+void ODS::update(string ip)
+{
     cout << "Running Update for Service ODS" << endl;
-    cout << "Hostname: " << this->hostname << endl;
-    cout << "Login: " << this->login << endl;
-    cout << "Password: " << this->password << endl;
+    cout << "Hostname: " << Hostname << endl;
+    cout << "Login: " << Login << endl;
+    cout << "Password: " << Password << endl;
 }
index 70e8607..d9a3324 100644 (file)
--- a/src/ods.h
+++ b/src/ods.h
@@ -1,14 +1,12 @@
-//
-// C++ Interface: ods
-//
-// Description: 
-//
-//
-// Author: Bjoern Sikora <bjoern.sikora@intra2net.com>, (C) 2009
-//
-// Copyright: See COPYING file that comes with this distribution
-//
-//
+/** @file
+ * @brief ODS Service class header. This class represents the ODS service.
+ *
+ *
+ *
+ * @copyright Intra2net AG
+ * @license GPLv2
+*/
+
 #ifndef ODS_H
 #define ODS_H
 
 
 using namespace std;
 
-/**
-    @author Bjoern Sikora <bjoern.sikora@intra2net.com>
-*/
 class ODS : public Service
 {
 private:
-    string hostname;
-    string login;
-    string password;
+    string Hostname;
+    string Login;
+    string Password;
 
 public:
+    ODS();
+
     ODS(string,string,string);
 
     ~ODS();
index fe4bba1..b290006 100644 (file)
@@ -1,14 +1,12 @@
-//
-// C++ Implementation: service
-//
-// Description: 
-//
-//
-// Author: Bjoern Sikora <bjoern.sikora@intra2net.com>, (C) 2009
-//
-// Copyright: See COPYING file that comes with this distribution
-//
-//
+/** @file
+ * @brief The abstract service interface. This class represents all services.
+ *
+ *
+ *
+ * @copyright Intra2net AG
+ * @license GPLv2
+*/
+
 #include "service.h"
 
 Service::Service()
index b000c1b..07ba931 100644 (file)
@@ -1,14 +1,12 @@
-//
-// C++ Interface: service
-//
-// Description: 
-//
-//
-// Author: Bjoern Sikora <bjoern.sikora@intra2net.com>, (C) 2009
-//
-// Copyright: See COPYING file that comes with this distribution
-//
-//
+/** @file
+ * @brief The abstract service interface. This class represents all services.
+ *
+ *
+ *
+ * @copyright Intra2net AG
+ * @license GPLv2
+*/
+
 #ifndef SERVICE_H
 #define SERVICE_H
 
@@ -16,9 +14,6 @@
 
 using namespace std;
 
-/**
-    @author Bjoern Sikora <bjoern.sikora@intra2net.com>
-*/
 class Service
 {
 public:
index d3d0c81..67baa1a 100644 (file)
@@ -1,49 +1,68 @@
-//
-// C++ Implementation: updater
-//
-// Description: 
-//
-//
-// Author: Bjoern Sikora <bjoern.sikora@intra2net.com>, (C) 2009
-//
-// Copyright: See COPYING file that comes with this distribution
-//
-//
+/** @file
+ * @brief The updater class implementation. This class implements the updater logic.
+ *
+ *
+ *
+ * @copyright Intra2net AG
+ * @license GPLv2
+*/
+
 #include "updater.h"
 
 #include <boost/foreach.hpp>
 
 
+/**
+ * Default constructor which initializes the member Conf.
+ */
 Updater::Updater()
-    : conf(NULL)
+    : Conf(NULL)
 {
 }
 
 
-Updater::Updater(Config* conf)
+/**
+ * Constructor.
+ * @param _conf A pointer to a Config object.
+ */
+Updater::Updater(Config* _conf)
 {
-    this->conf = conf;
+    Conf = _conf;
 }
 
 
+/**
+ * Default destructor.
+ */
 Updater::~Updater()
 {
     conf = NULL;
 }
 
 
-void Updater::set_config(Config* conf)
+/**
+ * Setter for member Conf.
+ * @param _conf
+ */
+void Updater::set_config(Config* _conf)
 {
-    this->conf = conf;
+    Conf = _conf;
 }
 
 
+/**
+ * Getter for member Conf.
+ * @return Conf.
+ */
 Config* Updater::get_config()
 {
-    return this->conf;
+    return Conf;
 }
 
 
+/**
+ * Update all configured services.
+ */
 void Updater::update_services()
 {
     list<Service*> services = this->conf->get_services();
@@ -54,4 +73,4 @@ void Updater::update_services()
     {
         service->update(ip);
     }
-}
\ No newline at end of file
+}
index 550cf35..dd8c154 100644 (file)
@@ -1,14 +1,12 @@
-//
-// C++ Interface: updater
-//
-// Description: 
-//
-//
-// Author: Bjoern Sikora <bjoern.sikora@intra2net.com>, (C) 2009
-//
-// Copyright: See COPYING file that comes with this distribution
-//
-//
+/** @file
+ * @brief The updater class header. This class represents the updater logic.
+ *
+ *
+ *
+ * @copyright Intra2net AG
+ * @license GPLv2
+*/
+
 #ifndef UPDATER_H
 #define UPDATER_H
 
@@ -17,7 +15,7 @@
 class Updater
 {
 private:
-    Config* conf;
+    Config* Conf;
 
 public:
     Updater();