QuasarAppLib
|
The Service class is a template class for creating a singleton services objects. This is manual control wrapper. You should be manually initializing your service object and manually deinitializing. If you don't destroy your service, then service object will be automatically destroyed when application will be closed. More...
#include <qaservice.h>
Public Member Functions | |
Service () | |
Static Public Member Functions | |
static std::unique_ptr< Base > & | initService () |
initService This method initialize the Base object as a service. | |
static bool | initService (std::unique_ptr< Base > obj) |
initService This is overrided static method of initialization cross libraryes object. | |
static Base * | instance () |
instance This method return pointerer to current service object. | |
static Base * | autoInstance () |
autoInstance This method return pointerer to current service object and if it is not inited try to initialize it use default constructor. | |
static void | deinitService () |
deinitService This is distructor method for the service. | |
The Service class is a template class for creating a singleton services objects. This is manual control wrapper. You should be manually initializing your service object and manually deinitializing. If you don't destroy your service, then service object will be automatically destroyed when application will be closed.
Examples
Create a service class
Initialise a service object
Or you can use the autoInstance method for initialize instance object if not exists.
Definition at line 67 of file qaservice.h.
|
inline |
Definition at line 71 of file qaservice.h.
autoInstance This method return pointerer to current service object and if it is not inited try to initialize it use default constructor.
Definition at line 124 of file qaservice.h.
deinitService This is distructor method for the service.
Definition at line 141 of file qaservice.h.
|
inlinestatic |
initService This method initialize the Base object as a service.
args | This is argumets of a constructo of the Base class. |
Definition at line 81 of file qaservice.h.
|
inlinestatic |
initService This is overrided static method of initialization cross libraryes object.
obj | This is inited settings object. |
Definition at line 98 of file qaservice.h.
instance This method return pointerer to current service object.
Definition at line 115 of file qaservice.h.