Application.h 1.03 KB
#ifndef APPLICATION_H
#define APPLICATION_H

#include "../Common/Singleton.h"
#include "ApplicationConfig.h"
#include "ApplicationLogger.h"

using namespace TREPS::Common;

namespace TREPS
{
	namespace Application
	{
		class ApplicationClass : public SingletonClass<ApplicationClass>
		{
			friend class SingletonClass<ApplicationClass>;

			public:
				ApplicationClass(void);
			
				~ApplicationClass(void);
	
				//Init application
				//(load configuration file and create logger)
				bool init(const char *confFile);
				
				//Run a request
				bool run(int argc, char *argv[]);

				//Get a pointer to the application logger
				ApplicationLoggerClass *getLog(void);
	
				//current application path
				string getApplicationPath(void);

				//get application conf loader
				ApplicationConfigClass *getConf(void);

			private:
				//pointer to the conf loader instance
				ApplicationConfigClass *conf;
	
				//pointer to the logger instance
				ApplicationLoggerClass *log;
		};
	}
}

#endif