Patronum
|
The Service class it is class for create a services from daemons. More...
#include <PService.h>
Public Member Functions | |
Service (int argc, char *argv[]) | |
Service This is main constructor of the service object. | |
~Service () override | |
![]() | |
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 | createApplication () override |
createApplication default implementation create a Application object. | |
![]() | |
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. | |
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 Service class it is class for create a services from daemons.
Definition at line 87 of file PService.h.
|
inline |
Service This is main constructor of the service object.
argc | This is count of input arguments. |
argv | This is raw C array with input arguments. |
name | This is name of your service. |
Definition at line 97 of file PService.h.
|
inlineoverride |
Definition at line 105 of file PService.h.
|
inlineoverrideprotectedvirtual |
createApplication default implementation create a Application object.
Implements Patronum::ServiceBase.
Definition at line 113 of file PService.h.