![]() |
Creates an operating system Service. More...
#include <Service.h>
Public Member Functions | |
Service (string pName, ServiceThreadFactory &pServiceThreadFactory) | |
Creates a service named "pName", and uses the provided ThreadFactory to create the internal working thread. | |
virtual | ~Service () |
int | body () |
The body will be executed until a signal is received by the operating system. | |
void | finish () |
Indicate to the Service that must be finished. | |
Protected Member Functions | |
bool | _continue () |
Protected Attributes | |
int | aPid |
Process ID. | |
int | aSid |
Session ID. | |
string | aName |
Friends | |
void | TerminateHandler (int pSignal) |
Creates an operating system Service.
In the case of POSIX implementation, the process is declared orphan and automatically adopted by the main operating system structures.
All internal processing is controlled automatically by this class.
The service will declare two threads: (1) the main one that will receive signals from the operating system, and (2) the service one, that will provide useful functionality.
HSEP::Service::Service | ( | string | pName, |
ServiceThreadFactory & | pServiceThreadFactory | ||
) |
Creates a service named "pName", and uses the provided ThreadFactory to create the internal working thread.
pName | |
pServiceThreadFactory |
Definition at line 88 of file Service.cpp.
References aName, aPid, aSid, HSEP::ServiceThreadFactory::createPtr(), HSEP::Thread::dispatch(), HSEP::LT_SYSTEMERROR, HSEP::LT_SYSTEMINFO, and HSEP::LoggerTool::send().
|
virtual |
Definition at line 149 of file Service.cpp.
References aName, HSEP::LT_SYSTEMINFO, and HSEP::LoggerTool::send().
|
protected |
Definition at line 177 of file Service.cpp.
Referenced by body().
int HSEP::Service::body | ( | ) |
The body will be executed until a signal is received by the operating system.
Definition at line 182 of file Service.cpp.
References _continue(), aName, HSEP::LT_SYSTEMERROR, HSEP::LoggerTool::send(), and TerminateHandler.
void HSEP::Service::finish | ( | ) |
Indicate to the Service that must be finished.
Definition at line 214 of file Service.cpp.
|
friend |
Definition at line 156 of file Service.cpp.
Referenced by body().
|
protected |
Definition at line 98 of file Service.h.
Referenced by body(), Service(), and ~Service().
|
protected |
|
protected |