22 #ifndef APPLICATION_HPP 23 #define APPLICATION_HPP 25 #include <boost/program_options.hpp> 26 #include <boost/exception/enable_error_info.hpp> 27 #include <boost/exception/error_info.hpp> 29 #include <boost/log/sinks/sync_frontend.hpp> 30 #include <boost/log/sinks/text_file_backend.hpp> 31 #include <boost/log/sinks/text_ostream_backend.hpp> 43 int start(
int argc,
char** argv);
47 virtual void onRun(
const shared_ptr<Configuration>&
config) = 0;
51 boost::program_options::options_description
cmd_desc;
53 boost::program_options::positional_options_description
pos_desc;
57 shared_ptr< logging::sinks::synchronous_sink< logging::sinks::text_file_backend > >
fileLogger;
58 shared_ptr< logging::sinks::synchronous_sink< logging::sinks::basic_text_ostream_backend< char > >>
consoleLogger;
61 void appRun(
int argc,
char** argv);
63 void initLog(
const shared_ptr<Configuration>& config);
boost::program_options::positional_options_description pos_desc
virtual bool startupDiagnostic(const shared_ptr< Configuration > &config)=0
virtual void onRun(const shared_ptr< Configuration > &config)=0
shared_ptr< logging::sinks::synchronous_sink< logging::sinks::basic_text_ostream_backend< char > > > consoleLogger
Application()
Inits the new Application.
shared_ptr< logging::sinks::synchronous_sink< logging::sinks::text_file_backend > > fileLogger
virtual void customInitLog(const shared_ptr< Configuration > &config)
bool diagnosticCheckFile(const shared_ptr< Configuration > &config, const string &key)
boost::program_options::options_description config_desc
void appRun(int argc, char **argv)
Creates the Configuration and runs the application.
boost::program_options::options_description cmd_desc
static const char * config
Option to get the configuration filename (type: string)
Represents a set of options accessible via strings.
int start(int argc, char **argv)
Starts the aplication with or without Exceptionhandling.
void initLog(const shared_ptr< Configuration > &config)
Inits the logfile.