Patronum
|
The ServiceBase class This is Base service class. Please for create your own services use the Patronum::Service class. More...
#include <PServiceBase.h>
Public Member Functions | |
ServiceBase (int argc, char *argv[]) | |
ServiceBase This is main constructor of the service. | |
~ServiceBase () override | |
virtual int | exec () |
exec This is main method of the service. Use this like a QCoreApplication::exec. | |
Protected Member Functions | |
void | handleReceiveData (const QHash< QString, Feature > &data) override |
handleReceiveData - This method invoice when service receive new command from terminal of controller of this service. | |
QSet< Feature > | supportedFeatures () override |
supportedFeatures | |
bool | sendResuylt (const QVariantMap &result) |
sendResuylt - Call this method for send responce from service to tour controller. | |
bool | sendResuylt (const QString &result) |
sendResuylt This method send text responce to controller. | |
bool | sendRawResuylt (const QByteArray &result) |
sendRawResuylt This method send raw text responce to controller. | |
virtual void | createApplication ()=0 |
createApplication Default implementation create a Application object and parse arguments. | |
bool | onStart () override=0 |
onStart Called when get start command from terminal. Override this method work correctly work of service. | |
void | onStop () override |
onStop Called when get stop command from terminal. The default implementation of this method invoke a quit method of QCoreApplication. | |
void | onResume () override |
onResume Called when get resume command from terminal. The Default implementation do nothing. | |
void | onPause () override |
onPause Called when get pause command from terminal. The Default implementation do nothing. | |
Controller * | controller () |
controller This method return the local controller object. If the controller object is not inited the this methd create a new object. | |
QCoreApplication * | core () |
core This method return a pointer to instance of the core application. | |
void | setCore (QCoreApplication *core) |
setCore This method sets new object of the core application. | |
![]() | |
IService () | |
virtual | ~IService ()=default |
virtual bool | handleReceive (const Feature &data)=0 |
handleReceive This method invoked when service receive a request from terminal. Override this method for work your service. | |
The ServiceBase class This is Base service class. Please for create your own services use the Patronum::Service class.
Definition at line 23 of file PServiceBase.h.
Patronum::ServiceBase::ServiceBase | ( | int | argc, |
char * | argv[] | ||
) |
ServiceBase This is main constructor of the service.
argc | This is count of input arguments. |
argv | This is raw C array of the input arguments. |
Definition at line 24 of file PServiceBase.cpp.
|
override |
Definition at line 32 of file PServiceBase.cpp.
|
protected |
controller This method return the local controller object. If the controller object is not inited the this methd create a new object.
Definition at line 114 of file PServiceBase.cpp.
|
protected |
core This method return a pointer to instance of the core application.
Definition at line 146 of file PServiceBase.cpp.
|
protectedpure virtual |
createApplication Default implementation create a Application object and parse arguments.
Implemented in Patronum::Service< Application >.
|
virtual |
exec This is main method of the service. Use this like a QCoreApplication::exec.
Definition at line 157 of file PServiceBase.cpp.
|
overrideprotectedvirtual |
handleReceiveData - This method invoice when service receive new command from terminal of controller of this service.
data | - Is list of commands from controller. Default implementation send message about error, and invoke the. |
Implements Patronum::IService.
Definition at line 50 of file PServiceBase.cpp.
|
overrideprotectedvirtual |
onPause Called when get pause command from terminal. The Default implementation do nothing.
Implements Patronum::IService.
Definition at line 110 of file PServiceBase.cpp.
|
overrideprotectedvirtual |
onResume Called when get resume command from terminal. The Default implementation do nothing.
Implements Patronum::IService.
Definition at line 106 of file PServiceBase.cpp.
|
overrideprotectedpure virtual |
onStart Called when get start command from terminal. Override this method work correctly work of service.
Implements Patronum::IService.
|
overrideprotectedvirtual |
onStop Called when get stop command from terminal. The default implementation of this method invoke a quit method of QCoreApplication.
Implements Patronum::IService.
Definition at line 98 of file PServiceBase.cpp.
|
protected |
sendRawResuylt This method send raw text responce to controller.
result | - Message. |
Definition at line 94 of file PServiceBase.cpp.
|
protected |
sendResuylt This method send text responce to controller.
result | - Message. |
Definition at line 90 of file PServiceBase.cpp.
|
protected |
sendResuylt - Call this method for send responce from service to tour controller.
result | Message. |
Definition at line 86 of file PServiceBase.cpp.
|
protected |
setCore This method sets new object of the core application.
core | This is new core application object. |
Definition at line 150 of file PServiceBase.cpp.
|
overrideprotectedvirtual |
supportedFeatures
Implements Patronum::IService.
Definition at line 82 of file PServiceBase.cpp.