#ifndef _SERVER_CONFIG_INCLUDE
#define _SERVER_CONFIG_INCLUDE
#include <string>
#include <Poco/Util/Application.h>
#include "Poco/Util/ServerApplication.h"


using Poco::Util::ServerApplication;
//using namespace Poco::Net;
using namespace Poco::Util;
using namespace std;

struct LocalSettings
{
	int _max_thread;
	int _max_queue;
	int _thread_idle_time;
	string _log_path;
	string _redisServerIp;
	string _redisAuth;
	int _redisNeedAuth;
	int _redisServerPort;
	int _redisConTimeOut;
	int _port;
	int _connRetryTimes;
	int _iMaxThreadNum;
	int _iDefThreadNum;
	int _iServerFlag;

	inline int getMaxTrd()
	{
		return _max_thread;
	}
	inline int getMaxQue()
	{
		return _max_queue;
	}
	inline int getIdleTime()
	{
		return _thread_idle_time;
	}
	inline string getLogPath()
	{
		return _log_path;
	}
};
class ServerConfig
{
public:
	ServerConfig();
	~ServerConfig();
	void LoadConfig(AbstractConfiguration &config);
	LocalSettings getLocalSettings();
	static ServerConfig* getInstance();
private:
	static ServerConfig *_conf;
	LocalSettings _settings;
	bool _bIsLoad;
};
#endif
