00001
00002 #ifndef SERVERCONFIG_V1_04_01_H_
00003 #define SERVERCONFIG_V1_04_01_H_
00004
00005 #if defined(_MSC_VER) && (_MSC_VER >= 1020)
00006 # pragma once
00007 #endif
00008
00009 #include <boost/cstdint.hpp>
00010 #include <string>
00011 #include <ostream>
00012
00013 namespace tecgraf { namespace ftc { namespace v1_04_01 {
00014
00023 class ServerConfig {
00024 public:
00025
00033 enum ServerLogLevel {
00034 LOG_OFF,
00035 LOG_FATAL,
00036 LOG_ERROR,
00037 LOG_WARN,
00038 LOG_INFO,
00039 LOG_DEBUG,
00040 LOG_TRACE,
00041 LOG_ALL = LOG_TRACE
00042 };
00043
00047 ServerConfig(){}
00048
00052 virtual ~ServerConfig(){}
00053
00058 virtual const std::string& hostname() const = 0;
00059
00064 virtual void hostname(const std::string& value) = 0;
00065
00070 virtual uint16_t port() const = 0;
00071
00081 virtual void port(uint16_t value) = 0;
00082
00092 virtual uint32_t channel_request_timeout() const = 0;
00093
00104 virtual void channel_request_timeout(const uint32_t value) = 0;
00105
00113 virtual uint32_t client_timeout() const = 0;
00114
00122 virtual void client_timeout(const uint32_t value) = 0;
00123
00132 virtual std::size_t max_clients() const = 0;
00133
00142 virtual void max_clients(std::size_t value) = 0;
00143
00151 virtual std::size_t max_channel_requests() const = 0;
00152
00160 virtual void max_channel_requests(std::size_t value) = 0;
00161
00170 virtual std::size_t client_buffer_size() const = 0;
00171
00180 virtual void client_buffer_size(std::size_t value) = 0;
00181
00190 virtual bool is_test_mode() const = 0;
00191
00200 virtual void is_test_mode(bool value) = 0;
00201
00206 virtual ServerLogLevel log_level() const = 0;
00207
00212 virtual void log_level(ServerLogLevel value) = 0;
00213
00218 virtual const std::string& log_filename() const = 0;
00219
00224 virtual void log_filename(const std::string& value) = 0;
00225
00230 virtual bool log_date_time() const = 0;
00231
00236 virtual void log_date_time(bool value) = 0;
00237
00252 virtual std::size_t thread_pool_size() const = 0;
00253
00268 virtual void thread_pool_size(const std::size_t value) = 0;
00269
00274 virtual void print(std::ostream& out) const;
00275
00281 friend std::ostream& operator<<(std::ostream& out, const ServerConfig& config)
00282 {
00283 config.print(out);
00284 return out;
00285 }
00286 };
00287
00288 }}}
00289
00290 #endif
00291