22 #ifndef CONFIGURATION_HPP 23 #define CONFIGURATION_HPP 28 #include <boost/program_options/variables_map.hpp> 29 #include <boost/program_options/options_description.hpp> 30 #include <boost/program_options/positional_options.hpp> 31 #include <boost/filesystem.hpp> 36 static const char*
help =
"help";
39 static const char*
config =
"config";
56 static const char*
min_lat =
"importer.min-lat";
59 static const char*
min_lon =
"importer.min-lon";
62 static const char*
max_lat =
"importer.max-lat";
65 static const char*
max_lon =
"importer.max-lon";
132 Configuration( boost::program_options::options_description& cmd_desc,
133 boost::program_options::options_description& config_desc,
134 boost::program_options::positional_options_description& pos_desc,
135 int argc,
char** argv);
137 bool has(
const string& key);
146 T
get(
const string& key)
148 return boost::any_cast<
const T&>(getValueByKey(key));
159 T
get(
const string& key,
const T& defaultValue)
161 return has(key)? get<T>(key) : defaultValue;
164 void printConfigToLog();
171 bool usedConfigFile()
const;
178 const std::vector<string>& getSearchDirectories()
const;
180 TESTABLE const boost::any& getValueByKey(
const string& key)
const;
183 boost::program_options::variables_map
options;
static const char * server_address
Address of the server (type: string)
static const char * path_to_geodata
Option to get the filename to save geodata (type: string)
static const char * check_xml_entities
Check all xml entities.
static const char * path_to_default_style
Path to the default stylesheet (type: string)
static const char * max_lat
maximum node latitude to include into imported data
static const char * cache_size
Option to get the cache size (type: int)
static const char * min_lat
minimum node latitude to include into imported data
static const char * path_to_osmdata
Option to get the path to osm xml file (type: string)
static const char * cache_keep_tile
Option to get the zoomlevel until tiles are kept on harddrive (type: int)
static const char * performance_log
Filepath to the performance log (type: string)
static const char * style_source
Path to be observed for stylesheets (type: string)
static const char * access_log
Filepath to the access log (type: string)
boost::program_options::variables_map options
Internal map holding the options.
static const char * max_queue_size
Maximum size for the queue (type: int)
static const char * min_lon
minimum node longitude to include into imported data
static const char * path_to_default_tile
Path to the default tile (type: string)
static const char * config
Option to get the configuration filename (type: string)
static const char * max_lon
maximum node longitude to include into imported data
Represents a set of options accessible via strings.
static const char * parse_timeout
Option to get the timeout for stylesheet-parsing (type: int)
static const char * log_mute_component
Option to get the muted Components.
static const char * cache_path
Option to get the cache path (type: string)
static const char * num_threads
Option to get number of worker threads (type: int)
static const char * help
Use Configuration::has to check weather the user wanted help.
static const char * prerender_level
Option to get the timeout for request-processing (type: int)
std::vector< string > searchDirectories
static const char * server_port
Port the server should listen at (type: int)
static const char * logfile
Option to get the filename of the log (type: string)