From: Bjoern Sikora Date: Mon, 27 Jul 2009 12:31:11 +0000 (+0200) Subject: Added doxygen comments and renamed members. X-Git-Tag: v1.1~273 X-Git-Url: http://developer.intra2net.com/git/?a=commitdiff_plain;h=b1be615b09d70dd60be2c2d9bd64afa626650063;p=bpdyndnsd Added doxygen comments and renamed members. --- diff --git a/src/config.cpp b/src/config.cpp index 597abdd..a16db64 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -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; } diff --git a/src/dhs.cpp b/src/dhs.cpp index f7fb417..82d94e9 100644 --- a/src/dhs.cpp +++ b/src/dhs.cpp @@ -1,32 +1,53 @@ -// -// C++ Implementation: dhs -// -// Description: -// -// -// Author: Bjoern Sikora , (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; } diff --git a/src/dhs.h b/src/dhs.h index 2552902..41f5639 100644 --- a/src/dhs.h +++ b/src/dhs.h @@ -1,14 +1,12 @@ -// -// C++ Interface: dhs -// -// Description: -// -// -// Author: Bjoern Sikora , (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 @@ -17,16 +15,16 @@ using namespace std; -/** - @author Bjoern Sikora -*/ -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(); diff --git a/src/main.cpp b/src/main.cpp index 21c17c1..462ffc4 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,3 +1,11 @@ +/** @file + * @brief The main function. + * + * + * + * @copyright Intra2net AG + * @license GPLv2 +*/ #ifdef HAVE_CONFIG_H #include @@ -24,10 +32,10 @@ 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[]) { diff --git a/src/ods.cpp b/src/ods.cpp index 44590c5..7a83309 100644 --- a/src/ods.cpp +++ b/src/ods.cpp @@ -1,33 +1,52 @@ -// -// C++ Implementation: ods -// -// Description: -// -// -// Author: Bjoern Sikora , (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; } diff --git a/src/ods.h b/src/ods.h index 70e8607..d9a3324 100644 --- a/src/ods.h +++ b/src/ods.h @@ -1,14 +1,12 @@ -// -// C++ Interface: ods -// -// Description: -// -// -// Author: Bjoern Sikora , (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 @@ -17,17 +15,16 @@ using namespace std; -/** - @author Bjoern Sikora -*/ class ODS : public Service { private: - string hostname; - string login; - string password; + string Hostname; + string Login; + string Password; public: + ODS(); + ODS(string,string,string); ~ODS(); diff --git a/src/service.cpp b/src/service.cpp index fe4bba1..b290006 100644 --- a/src/service.cpp +++ b/src/service.cpp @@ -1,14 +1,12 @@ -// -// C++ Implementation: service -// -// Description: -// -// -// Author: Bjoern Sikora , (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() diff --git a/src/service.h b/src/service.h index b000c1b..07ba931 100644 --- a/src/service.h +++ b/src/service.h @@ -1,14 +1,12 @@ -// -// C++ Interface: service -// -// Description: -// -// -// Author: Bjoern Sikora , (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 -*/ class Service { public: diff --git a/src/updater.cpp b/src/updater.cpp index d3d0c81..67baa1a 100644 --- a/src/updater.cpp +++ b/src/updater.cpp @@ -1,49 +1,68 @@ -// -// C++ Implementation: updater -// -// Description: -// -// -// Author: Bjoern Sikora , (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 +/** + * 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 services = this->conf->get_services(); @@ -54,4 +73,4 @@ void Updater::update_services() { service->update(ip); } -} \ No newline at end of file +} diff --git a/src/updater.h b/src/updater.h index 550cf35..dd8c154 100644 --- a/src/updater.h +++ b/src/updater.h @@ -1,14 +1,12 @@ -// -// C++ Interface: updater -// -// Description: -// -// -// Author: Bjoern Sikora , (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();