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

#include <Application.hpp>

Inheritance diagram for Application:
Collaboration diagram for Application:

Public Member Functions

 Application ()
virtual ~Application () throw ()
- Public Member Functions inherited from HCE::ServerApplication
 ServerApplication ()
virtual ~ServerApplication () throw ()

Protected Member Functions

void factoriesRegister ()
void componentsInitialize ()
void addWCache (unsigned long long &resCrc, std::string &wCacheBase64)
void extractWCache (msgpack::sbuffer &msgPackBuf, Poco::SharedPtr< OutDataStruct > outDataStructPtr)
void highlightComponentExecutor (Poco::SharedPtr< InDataStruct > inDataStructPtr, Poco::SharedPtr< OutDataStruct > outDataStructPtr)
virtual int main (const std::vector< std::string > &args)
void readData (std::string &incomeString)
bool checkNeededConfigParams ()
virtual void handleHelp (const std::string &name, const std::string &value)
virtual void handleVersion (const std::string &name, const std::string &value)
- Protected Member Functions inherited from HCE::ServerApplication
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)

Protected Attributes

bool exitFlag
HCE::component::ComponentsFactory componentsFactory
Poco::SharedPtr
< HCE::component::ComponentManagerPoolIf
componentManagerPool
Poco::SharedPtr< CrossThreadBufcrossThreadBufPtr
Poco::SharedPtr
< ContentsStorageBase
contentsStoragePtr
std::string outDataString
- Protected Attributes inherited from HCE::ServerApplication
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

Definition at line 36 of file Application.hpp.

Constructor & Destructor Documentation

Application::Application ( )

Definition at line 44 of file Application.cpp.

Application::~Application ( ) throw ()
virtual

Definition at line 48 of file Application.cpp.

Member Function Documentation

void Application::addWCache ( unsigned long long &  resCrc,
std::string &  wCacheBase64 
)
protected

Application::addWCache method. Method perform next steps base64 decode incoming string. if decoding successful - trys to unpack serialize cache data if unpacking successful - compares crc, from incoming message, with crc of deserialize cache data

Definition at line 95 of file Application.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

bool Application::checkNeededConfigParams ( )
protected

Application::checkNeededConfigParams method. Checks accessibility of mandatory initialize variables. If they are absent, writes to log and return false.

Definition at line 326 of file Application.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void Application::componentsInitialize ( )
protected

Application::componentsInitialize method. Method perform next steps a) Creates componentManagerPool and localComponentManager elements b) Creates "COMPONENTS_COUNT" HighlightComponent-s with componentsFactory using. c) Initializes HighlightComponent-s, filled it concrete HighlightingAlgorithms. d) Inserts initialized component instance into the localComponentManager element. e) Adds localComponentManager element to the componentManagerPool and starts its execution.

Definition at line 66 of file Application.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void Application::extractWCache ( msgpack::sbuffer &  msgPackBuf,
Poco::SharedPtr< OutDataStruct outDataStructPtr 
)
protected

Definition at line 125 of file Application.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void Application::factoriesRegister ( )
protected

Definition at line 52 of file Application.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

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

Application::handleHelp method. Overloaded method, that is called if highlighter was started with –help or -h keys

Reimplemented from HCE::ServerApplication.

Definition at line 347 of file Application.cpp.

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

Application::handleVersion method. Overloaded method, that is called if highlighter was started with –version or -v keys

Reimplemented from HCE::ServerApplication.

Definition at line 362 of file Application.cpp.

void Application::highlightComponentExecutor ( Poco::SharedPtr< InDataStruct inDataStructPtr,
Poco::SharedPtr< OutDataStruct outDataStructPtr 
)
protected

Application::highlightComponentExecutor method. Method performs main higlight functionality. Gets input data as inDataStructPtr param, and returns result data through outDataStructPtr param. Method performs through next steeps: a) Prepears and fills crossThreadBufPtr struct. b) Prepears and fills inDataHighlight struct. c) Starts Higlight tasks in the Higlight Components (may perform in the separate threads) and waits their's finish (or timeout). d) Extracts results from crossThreadBufPtr and fills outDataStructPtr structure.

Definition at line 141 of file Application.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

int Application::main ( const std::vector< std::string > &  args)
protectedvirtual

Application::main method. Main "highlight application" method, incoming and outgoing point. Method performs through next steeps: a) Checks needed config params, if they are absent we exits from application. b) Reads incoming data (in JSON format) from cout, parses it. c) Calls processing method Application::highlightComponentExecutor, gets processing data (return from second param in the Application::highlightComponentExecutor call). d) Prepares outPut data with highlightJsonWrapper::jsonStringFromOutData method call.

Definition at line 253 of file Application.cpp.

Here is the call graph for this function:

void Application::readData ( std::string &  incomeString)
protected

Definition at line 314 of file Application.cpp.

Here is the caller graph for this function:

Member Data Documentation

Poco::SharedPtr<HCE::component::ComponentManagerPoolIf> Application::componentManagerPool
protected

Definition at line 41 of file Application.hpp.

HCE::component::ComponentsFactory Application::componentsFactory
protected

Definition at line 40 of file Application.hpp.

Poco::SharedPtr<ContentsStorageBase> Application::contentsStoragePtr
protected

Definition at line 43 of file Application.hpp.

Poco::SharedPtr<CrossThreadBuf> Application::crossThreadBufPtr
protected

Definition at line 42 of file Application.hpp.

bool Application::exitFlag
protected

Definition at line 39 of file Application.hpp.

std::string Application::outDataString
protected

Definition at line 44 of file Application.hpp.


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