summaryrefslogtreecommitdiff
path: root/server/src/configuration.h
diff options
context:
space:
mode:
authordeva <deva>2008-07-30 11:33:15 +0000
committerdeva <deva>2008-07-30 11:33:15 +0000
commit71ac37ecfaf5dff76c8880b62228c30bd207054b (patch)
tree3d0074544ae1141bb9154884de69ece62e8a3519 /server/src/configuration.h
parentb3b694c8dd17955aec463f50c6f526f570d8b97f (diff)
Added global Conf namepsace with configuration values. These are to be filled with config file values later.
Diffstat (limited to 'server/src/configuration.h')
-rw-r--r--server/src/configuration.h61
1 files changed, 12 insertions, 49 deletions
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 <libconfig.h++>
#include <string>
+#include <sys/types.h>
+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__*/