Service Provider Class.
More...
#include <clay.h>
|
|
int | m_code |
| | The code of the service provider(default value is 0)
|
| |
|
std::string | m_name |
| | The name of the service provider(default value is empty string)
|
| |
|
ClayServiceIntMap | m_svcintmap |
| | The code map of the services.
|
| |
|
ClayServiceStrMap | m_svcstrmap |
| | The name map of the services.
|
| |
| clay::core::ClayServiceProvider::ClayServiceProvider |
( |
int |
iCode) | |
|
|
explicit |
Constructor function
- Parameters
-
| clay::core::ClayServiceProvider::ClayServiceProvider |
( |
const std::string & |
sName) | |
|
|
explicit |
Constructor function
- Parameters
-
| clay::core::ClayServiceProvider::ClayServiceProvider |
( |
int |
iCode, |
|
|
const std::string & |
sName |
|
) |
| |
Constructor function
- Parameters
-
| iCode | The service code |
| sName | The service name |
| virtual int clay::core::ClayServiceProvider::DoService |
( |
int |
iSvcCode, |
|
|
void * |
pParam |
|
) |
| |
|
virtual |
Execute the service function by the service code
- Parameters
-
| iSvcCode | The service code |
| pParam | The parameter passed to the service function |
- Returns
- The return code of the service function
| virtual int clay::core::ClayServiceProvider::DoService |
( |
const std::string & |
sSvcName, |
|
|
void * |
pParam |
|
) |
| |
|
virtual |
Execute the service function by the service name
- Parameters
-
| sSvcName | The service name |
| pParam | The parameter passed to the service function |
- Returns
- The return code of the service function
| int clay::core::ClayServiceProvider::GetCode |
( |
) | |
|
Get the code of the service provider
- Returns
- Return the code of the service provider
| std::string clay::core::ClayServiceProvider::GetName |
( |
) | |
|
Get the name of the service provider
- Returns
- Return the name of the service provider
| CLAY_SVC_CLASS_FUNC clay::core::ClayServiceProvider::GetService |
( |
int |
iSvcCode) | |
|
Get the pointer of the service function by the service code
- Parameters
-
- Returns
- Return the pointer of the service function(or return NULL for none found)
| CLAY_SVC_CLASS_FUNC clay::core::ClayServiceProvider::GetService |
( |
const std::string & |
sSvcName) | |
|
Get the pointer of the service function by the service name
- Parameters
-
- Returns
- Return the pointer of the service function(or return NULL for none found)
| int clay::core::ClayServiceProvider::GetServiceCount |
( |
) | |
|
|
protected |
Get the count of the registered services
- Returns
- The total count of the services
| int clay::core::ClayServiceProvider::GetVersion |
( |
void * |
pParam) | |
|
|
protected |
Get the version of the service provider
- Parameters
-
| pParam | The parameter(normally it should always be NULL) |
- Returns
- Return the version code of the service provider
| int clay::core::ClayServiceProvider::RegisterService |
( |
int |
iSvcCode, |
|
|
CLAY_SVC_CLASS_FUNC |
pSvcFunc |
|
) |
| |
|
protected |
Register a service by its code
- Parameters
-
| iSvcCode | The code of the service |
| pSvcFunc | The service function pointer |
- Returns
- Return -1 for fail
| int clay::core::ClayServiceProvider::RegisterService |
( |
const std::string & |
sSvcName, |
|
|
CLAY_SVC_CLASS_FUNC |
pSvcFunc |
|
) |
| |
|
protected |
Register a service by its name
- Parameters
-
| sSvcName | The name of the service |
| pSvcFunc | The service function pointer |
- Returns
- Return -1 for fail
| bool clay::core::ClayServiceProvider::ServiceExists |
( |
int |
iSvcCode) | |
|
Check the existence of the service by its code
- Parameters
-
| iSvcCode | The code of the service |
- Returns
- Return true if the service with the code exists
| bool clay::core::ClayServiceProvider::ServiceExists |
( |
const std::string & |
sSvcName) | |
|
Check the existence of the service by its name
- Parameters
-
| sSvcName | The name of the service |
- Returns
- Return true if the service with the name exists
| int clay::core::ClayServiceProvider::UnregisterService |
( |
int |
iSvcCode) | |
|
|
protected |
Unregister a service by its code
- Parameters
-
| iSvcCode | The code of the service |
- Returns
- If the service is not found then return 0
| int clay::core::ClayServiceProvider::UnregisterService |
( |
const std::string & |
sSvcName) | |
|
|
protected |
Unregister a service by its name
- Parameters
-
| sSvcName | The name of the service |
- Returns
- If the service is not found then return 0
The documentation for this class was generated from the following file:
- D:/CppProj/clay/doc/gen/src/clay.h