From 71ac37ecfaf5dff76c8880b62228c30bd207054b Mon Sep 17 00:00:00 2001 From: deva Date: Wed, 30 Jul 2008 11:33:15 +0000 Subject: Added global Conf namepsace with configuration values. These are to be filled with config file values later. --- server/src/configuration.h | 61 +++++++++------------------------------------- 1 file changed, 12 insertions(+), 49 deletions(-) (limited to 'server/src/configuration.h') diff --git a/server/src/configuration.h b/server/src/configuration.h index 1b851f3..2272a83 100644 --- a/server/src/configuration.h +++ b/server/src/configuration.h @@ -27,60 +27,23 @@ #ifndef __ARTEFACT_CONFIGURATION_H__ #define __ARTEFACT_CONFIGURATION_H__ -#include #include +#include +typedef uint16_t port_t; -#include "exception.h" +namespace Conf { + extern port_t server_port; + extern std::string server_user; + extern std::string server_group; -/** - * This exception is thrown by Configuration when reload fails. - */ -class ConfigurationException: public Exception { -public: - ConfigurationException(std::string reason) : - Exception(reason) {} -}; + extern std::string journal_commit_addr; + extern port_t journal_commit_port; -/** - * This is the pentominos configuration class.\n - * It simply wraps the libconfig c++ interface. It can be found at - * http://www.hyperrealm.com/libconfig/libconfig.html\n - * To find out how the interface works, see - * http://www.hyperrealm.com/libconfig/libconfig_manual.html#The-C_002b_002b-API - */ -class Configuration : public libconfig::Config { -public: - /** - * Constructor.\n - * @param filename The filename to be loaded. - */ - Configuration(std::string filename); + extern unsigned int db_max_ttl; + extern unsigned int pentominos_max_ttl; - /** - * reload, simply reloads the configuration file attached to the configuration - * object. - */ - void reload() throw(ConfigurationException); - -private: - std::string filename; + extern std::string pentominos_addr; + extern port_t pentominos_port; }; -/** - * Initialize the global configuration.\n - * This function sets the Configuration global pointer, that can be reaced through - * the config variable. - * @param config The value of the Configuration pointer. - */ -void initConfig(Configuration *config); - -/** - * This function returns the global configuration object pointer.\n - * Use initConfig to set it.\n - * @return The pointer to the global configuration. - */ -Configuration *config() - throw(ConfigurationException); - - #endif/*__ARTEFACT_CONFIGURATION_H__*/ -- cgit v1.2.3