highlighter application  1.1
HCE project utils : highlighter
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
HCE::ServerApplication Class Reference

#include <ServerApplication.hpp>

Inheritance diagram for HCE::ServerApplication:

Public Member Functions

 ServerApplication ()
virtual ~ServerApplication () throw ()

Protected Member Functions

void initialize (Poco::Util::Application &self)
void reinitialize (Poco::Util::Application &self)
void uninitialize ()
void defineOptions (Poco::Util::OptionSet &options)
 this function initializes global variable HCE::_config by filename which sets as value in pair –config-file='filename'
void initializeConfigurationFile ()
 this function return true if in configuration file exist section for database connection
bool isDataBaseSectionExists ()
 return database connection type (by default it's MySQL)
std::string getDBType () const
std::string initializeMySQLConnectionString () const
std::string initializeSQLiteConnectionString () const
 this functions must be caused both and if in configure file exists section for database connection
void initializeDataBaseSession ()
void uninitializeDataBaseSession ()
void initializeLoggers ()
virtual void handleConfigFile (const std::string &, const std::string &value)
 this function shows us help information (all options and so on)
virtual void handleHelp (const std::string &name, const std::string &value)
 this function shows us version information (all options and so on)
virtual void handleVersion (const std::string &name, const std::string &value)

Protected Attributes

bool _configFileRequest
 < if we use default configuration file this variable is setted as false
std::string _configFile
 program would not be started if we use key –help or -h .
bool _showHelpInfo
bool _initializedHCEServerApplication
std::string dataBaseType
const std::string APPLICATION_NOT_INITIALIZED_EXCEPTION = "Class HCE::ServerApplication incorrectly initialized. Maybe problem with configuration,logger or database initializing."
const std::string MESSAGE_ALREADY_INITIALIZED_EXCEPTION = "Object already initialized."
const std::string NOT_SET_DB_TYPE_ERROR = "Not set database type in configuration type."
const std::string ADDITION_INFORM_STRING_NOT_FOUND = "config param or Not found config file"

Detailed Description

< base class for application's class. method main (const std::vectro<string>& argv) should be overridden in inherited class if you allows that exception can leave from method main , that function uninitialized never be called life cycle : constructor -> initialize -> main -> uninitialize -> destructor

Definition at line 54 of file ServerApplication.hpp.

Constructor & Destructor Documentation

HCE::ServerApplication::ServerApplication ( )

Definition at line 15 of file ServerApplication.cpp.

HCE::ServerApplication::~ServerApplication ( ) throw ()
virtual

Definition at line 18 of file ServerApplication.cpp.

Member Function Documentation

void HCE::ServerApplication::defineOptions ( Poco::Util::OptionSet &  options)
protected

this function initializes global variable HCE::_config by filename which sets as value in pair –config-file='filename'

Definition at line 172 of file ServerApplication.cpp.

Here is the call graph for this function:

std::string HCE::ServerApplication::getDBType ( ) const
protected

host=*;user=*;password=*;db=*;compress=*;auto-reconnect=* - mysql db=* - sqlite

Definition at line 161 of file ServerApplication.cpp.

void HCE::ServerApplication::handleConfigFile ( const std::string &  ,
const std::string &  value 
)
protectedvirtual

this function shows us help information (all options and so on)

Definition at line 199 of file ServerApplication.cpp.

Here is the caller graph for this function:

void HCE::ServerApplication::handleHelp ( const std::string &  name,
const std::string &  value 
)
protectedvirtual

this function shows us version information (all options and so on)

Reimplemented in Application.

Definition at line 204 of file ServerApplication.cpp.

Here is the caller graph for this function:

void HCE::ServerApplication::handleVersion ( const std::string &  name,
const std::string &  value 
)
protectedvirtual

Reimplemented in Application.

Definition at line 213 of file ServerApplication.cpp.

Here is the caller graph for this function:

void HCE::ServerApplication::initialize ( Poco::Util::Application &  self)
protected

< if application already initialized throw exception

Definition at line 24 of file ServerApplication.cpp.

Here is the call graph for this function:

void HCE::ServerApplication::initializeConfigurationFile ( )
protected

this function return true if in configuration file exist section for database connection

< load default configuration file

< load configuration file which determined as argument

Definition at line 71 of file ServerApplication.cpp.

void HCE::ServerApplication::initializeDataBaseSession ( )
protected

Definition at line 94 of file ServerApplication.cpp.

void HCE::ServerApplication::initializeLoggers ( )
protected

this function allows us to understand that we will not use default configuration file first parameter not set because we are not using option name

Options must be added handler for help option

Definition at line 166 of file ServerApplication.cpp.

Here is the call graph for this function:

std::string HCE::ServerApplication::initializeMySQLConnectionString ( ) const
protected

Definition at line 135 of file ServerApplication.cpp.

Here is the call graph for this function:

std::string HCE::ServerApplication::initializeSQLiteConnectionString ( ) const
protected

this functions must be caused both and if in configure file exists section for database connection

Definition at line 151 of file ServerApplication.cpp.

Here is the call graph for this function:

bool HCE::ServerApplication::isDataBaseSectionExists ( )
protected

return database connection type (by default it's MySQL)

Definition at line 124 of file ServerApplication.cpp.

void HCE::ServerApplication::reinitialize ( Poco::Util::Application &  self)
protected

Definition at line 60 of file ServerApplication.cpp.

void HCE::ServerApplication::uninitialize ( )
protected

Definition at line 65 of file ServerApplication.cpp.

Here is the caller graph for this function:

void HCE::ServerApplication::uninitializeDataBaseSession ( )
protected

Definition at line 113 of file ServerApplication.cpp.

Member Data Documentation

std::string HCE::ServerApplication::_configFile
protected

program would not be started if we use key –help or -h .

Definition at line 96 of file ServerApplication.hpp.

bool HCE::ServerApplication::_configFileRequest
protected

< if we use default configuration file this variable is setted as false

Definition at line 94 of file ServerApplication.hpp.

bool HCE::ServerApplication::_initializedHCEServerApplication
protected

Definition at line 100 of file ServerApplication.hpp.

bool HCE::ServerApplication::_showHelpInfo
protected

this variable does not allow initialize application twise and verifies that our part of application (config,logger,database) correctly installed

Definition at line 98 of file ServerApplication.hpp.

const std::string HCE::ServerApplication::ADDITION_INFORM_STRING_NOT_FOUND = "config param or Not found config file"
protected

Definition at line 107 of file ServerApplication.hpp.

const std::string HCE::ServerApplication::APPLICATION_NOT_INITIALIZED_EXCEPTION = "Class HCE::ServerApplication incorrectly initialized. Maybe problem with configuration,logger or database initializing."
protected

Definition at line 104 of file ServerApplication.hpp.

std::string HCE::ServerApplication::dataBaseType
protected

Definition at line 101 of file ServerApplication.hpp.

const std::string HCE::ServerApplication::MESSAGE_ALREADY_INITIALIZED_EXCEPTION = "Object already initialized."
protected

Definition at line 105 of file ServerApplication.hpp.

const std::string HCE::ServerApplication::NOT_SET_DB_TYPE_ERROR = "Not set database type in configuration type."
protected

Definition at line 106 of file ServerApplication.hpp.


The documentation for this class was generated from the following files: