Service Agent Class.
More...
#include <clay.h>
|
int | RegSp (ClayServiceProvider *pServiceProvider) |
|
int | UnregSp (int iSpCode) |
|
int | UnregSp (const std::string &sSpName) |
|
ClayServiceProvider * | GetSp (int iSpCode) |
|
ClayServiceProvider * | GetSp (const std::string &sSpName) |
|
int | GetSpCount () |
|
int | CallService (int iSpCode, int iSvcCode, void *pParam) |
|
int | CallService (int iSpCode, const std::string &sSvcName, void *pParam) |
|
int | CallService (const std::string &sSpName, int iSvcCode, void *pParam) |
|
int | CallService (const std::string &sSpName, const std::string &sSvcName, void *pParam) |
|
bool | SpExists (int iSpCode) |
|
bool | SpExists (const std::string &sSpName) |
|
bool | SvcExists (int iSpCode, int iSvcCode) |
|
bool | SvcExists (int iSpCode, const std::string &sSvcName) |
|
bool | SvcExists (const std::string &sSpName, int iSvcCode) |
|
bool | SvcExists (const std::string &sSpName, const std::string &sSvcName) |
|
void | Clear () |
| Remove all service providers.
|
|
void | SetExternalAgent (ClayServiceAgent *pAgent) |
|
int clay::core::ClayServiceAgent::CallService |
( |
int |
iSpCode, |
|
|
int |
iSvcCode, |
|
|
void * |
pParam |
|
) |
| |
Execute the service function by the provider code and the service code
- Parameters
-
iSpCode | The provider code |
iSvcCode | The service code |
pParam | The parameter passed to the service function |
- Returns
- The return code of the service function
int clay::core::ClayServiceAgent::CallService |
( |
int |
iSpCode, |
|
|
const std::string & |
sSvcName, |
|
|
void * |
pParam |
|
) |
| |
Execute the service function by the provider code and the service name
- Parameters
-
iSpCode | The provider code |
sSvcName | The service name |
pParam | The parameter passed to the service function |
- Returns
- The return code of the service function
int clay::core::ClayServiceAgent::CallService |
( |
const std::string & |
sSpName, |
|
|
int |
iSvcCode, |
|
|
void * |
pParam |
|
) |
| |
Execute the service function by the provider name and the service code
- Parameters
-
sSpName | The provider name |
iSvcCode | The service code |
pParam | The parameter passed to the service function |
- Returns
- The return code of the service function
int clay::core::ClayServiceAgent::CallService |
( |
const std::string & |
sSpName, |
|
|
const std::string & |
sSvcName, |
|
|
void * |
pParam |
|
) |
| |
Execute the service function by the provider name and the service name
- Parameters
-
sSpName | The provider name |
sSvcName | The service name |
pParam | The parameter passed to the service function |
- Returns
- The return code of the service function
Get current active service agent
- Returns
- The pointer of current active agent
Get the service provider by its code
- Parameters
-
iSpCode | The code of the service provider |
- Returns
- The pointer of the service provider
Get the service provider by its name
- Parameters
-
sSpName | The name of the service provider |
- Returns
- The pointer of the service provider
int clay::core::ClayServiceAgent::GetSpCount |
( |
) | |
|
Get the count of the registered service providers
- Returns
- The total count of the service providers
Register a service provider
- Parameters
-
pServiceProvider | The pointer of the service provider |
- Returns
- Return -1 if fail
void clay::core::ClayServiceAgent::SetExternalAgent |
( |
ClayServiceAgent * |
pAgent) | |
|
Set external agent (normally it will be called only when integrating with external DLL file)
- Parameters
-
pAgent | The pointer of another service agent object |
bool clay::core::ClayServiceAgent::SpExists |
( |
int |
iSpCode) | |
|
Check the existence of the service provider by its code
- Parameters
-
iSpCode | The code of the service provider |
- Returns
- Return true if the service provider with the code exists
bool clay::core::ClayServiceAgent::SpExists |
( |
const std::string & |
sSpName) | |
|
Check the existence of the service provider by its name
- Parameters
-
sSpName | The name of the service provider |
- Returns
- Return true if the service provider with the name exists
bool clay::core::ClayServiceAgent::SvcExists |
( |
int |
iSpCode, |
|
|
int |
iSvcCode |
|
) |
| |
Check the existence of the service by provider code and service code
- Parameters
-
iSpCode | The provider code |
iSvcCode | The service code |
- Returns
- Return true if the service exists
bool clay::core::ClayServiceAgent::SvcExists |
( |
int |
iSpCode, |
|
|
const std::string & |
sSvcName |
|
) |
| |
Check the existence of the service by provider code and service name
- Parameters
-
iSpCode | The provider code |
sSvcName | The service name |
- Returns
- Return true if the service exists
bool clay::core::ClayServiceAgent::SvcExists |
( |
const std::string & |
sSpName, |
|
|
int |
iSvcCode |
|
) |
| |
Check the existence of the service by provider name and service code
- Parameters
-
sSpName | The provider name |
iSvcCode | The service code |
- Returns
- Return true if the service exists
bool clay::core::ClayServiceAgent::SvcExists |
( |
const std::string & |
sSpName, |
|
|
const std::string & |
sSvcName |
|
) |
| |
Check the existence of the service by provider name and service name
- Parameters
-
sSpName | The provider name |
sSvcName | The service name |
- Returns
- Return true if the service exists
int clay::core::ClayServiceAgent::UnregSp |
( |
int |
iSpCode) | |
|
Unregister a service provider by its code
- Parameters
-
iSpCode | The code of the service provider |
- Returns
- If the service provider is not found then return 0
int clay::core::ClayServiceAgent::UnregSp |
( |
const std::string & |
sSpName) | |
|
Unregister a service provider by its name
- Parameters
-
sSpName | The name of the service provider |
- Returns
- If the service provider 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