Clay Library  1.0.1
 All Classes Functions Variables Groups
Functions
Clay

Functions

std::string clay::lib::GetTimeStr ()
 
void clay::lib::Log (const char *sMsg)
 
clay::core::ClayServiceAgentclay::lib::GetAgent ()
 
void clay::lib::SetAgent (void *pAgent)
 
int clay::lib::RegisterSp (clay::core::ClayServiceProvider *pServiceProvider)
 
int clay::lib::GetSpCount ()
 
clay::core::ClayServiceProviderclay::lib::GetProvider (int iSpCode)
 
clay::core::ClayServiceProviderclay::lib::GetProvider (const std::string &sSpName)
 
bool clay::lib::ProviderExists (int iSpCode)
 
bool clay::lib::ProviderExists (const std::string &sSpName)
 
bool clay::lib::ServiceExists (int iSpCode, int iSvcCode)
 
bool clay::lib::ServiceExists (int iSpCode, const std::string &sSvcName)
 
bool clay::lib::ServiceExists (const std::string &sSpName, int iSvcCode)
 
bool clay::lib::ServiceExists (const std::string &sSpName, const std::string &sSvcName)
 
int clay::lib::CallService (int iSpCode, int iSvcCode, void *pParam=NULL)
 
int clay::lib::CallService (int iSpCode, const std::string &sSvcName, void *pParam=NULL)
 
int clay::lib::CallService (const std::string &sSpName, int iSvcCode, void *pParam=NULL)
 
int clay::lib::CallService (const std::string &sSpName, const std::string &sSvcName, void *pParam=NULL)
 
void clay::lib::Clear ()
 Remove all service providers.
 

Detailed Description

Function Documentation

int clay::lib::CallService ( int  iSpCode,
int  iSvcCode,
void *  pParam = NULL 
)

Execute the service function by the provider code and the service code

Parameters
iSpCodeThe provider code
iSvcCodeThe service code
pParamThe parameter passed to the service function
Returns
The return code of the service function
int clay::lib::CallService ( int  iSpCode,
const std::string &  sSvcName,
void *  pParam = NULL 
)

Execute the service function by the provider code and the service name

Parameters
iSpCodeThe provider code
sSvcNameThe service name
pParamThe parameter passed to the service function
Returns
The return code of the service function
int clay::lib::CallService ( const std::string &  sSpName,
int  iSvcCode,
void *  pParam = NULL 
)

Execute the service function by the provider name and the service code

Parameters
sSpNameThe provider name
iSvcCodeThe service code
pParamThe parameter passed to the service function
Returns
The return code of the service function
int clay::lib::CallService ( const std::string &  sSpName,
const std::string &  sSvcName,
void *  pParam = NULL 
)

Execute the service function by the provider name and the service name

Parameters
sSpNameThe provider name
sSvcNameThe service name
pParamThe parameter passed to the service function
Returns
The return code of the service function
clay::core::ClayServiceAgent* clay::lib::GetAgent ( )

Get current active service agent

Returns
The pointer of current active service agent
clay::core::ClayServiceProvider* clay::lib::GetProvider ( int  iSpCode)

Get the service provider by its code

Parameters
iSpCodeThe code of the service provider
Returns
The pointer of the service provider
clay::core::ClayServiceProvider* clay::lib::GetProvider ( const std::string &  sSpName)

Get the service provider by its name

Parameters
sSpNameThe name of the service provider
Returns
The pointer of the service provider
int clay::lib::GetSpCount ( )

Get the count of the registered service providers

Returns
The total count of the service providers
std::string clay::lib::GetTimeStr ( )

Get system time as a simple string

Returns
Return date time in string format
void clay::lib::Log ( const char *  sMsg)

Write a message to log file

Parameters
sMsgThe message
bool clay::lib::ProviderExists ( int  iSpCode)

Check the existence of the service provider by its code

Parameters
iSpCodeThe code of the service provider
Returns
Return true if the service provider with the code exists
bool clay::lib::ProviderExists ( const std::string &  sSpName)

Check the existence of the service provider by its name

Parameters
sSpNameThe name of the service provider
Returns
Return true if the service provider with the name exists
int clay::lib::RegisterSp ( clay::core::ClayServiceProvider pServiceProvider)

Register a service provider

Parameters
pServiceProviderThe pointer of the service provider
Returns
Return -1 if fail
bool clay::lib::ServiceExists ( int  iSpCode,
int  iSvcCode 
)

Check the existence of the service by provider code and service code

Parameters
iSpCodeThe provider code
iSvcCodeThe service code
Returns
Return true if the service exists
bool clay::lib::ServiceExists ( int  iSpCode,
const std::string &  sSvcName 
)

Check the existence of the service by provider code and service name

Parameters
iSpCodeThe provider code
sSvcNameThe service name
Returns
Return true if the service exists
bool clay::lib::ServiceExists ( const std::string &  sSpName,
int  iSvcCode 
)

Check the existence of the service by provider name and service code

Parameters
sSpNameThe provider name
iSvcCodeThe service code
Returns
Return true if the service exists
bool clay::lib::ServiceExists ( const std::string &  sSpName,
const std::string &  sSvcName 
)

Check the existence of the service by provider name and service name

Parameters
sSpNameThe provider name
sSvcNameThe service name
Returns
Return true if the service exists
void clay::lib::SetAgent ( void *  pAgent)

Set current active service agent

Parameters
pAgentThe pointer of a service agent