29 #ifndef __CLAY_H_INCLUDED__
30 #define __CLAY_H_INCLUDED__
32 #define CLAY_SVC_FUNC(func) (clay::core::CLAY_SVC_CLASS_FUNC)(&func)
44 class ClayServiceProvider;
46 typedef int (*CLAY_SVC_STATIC_FUNC)(
void*);
48 typedef int (ClayServiceProvider::*CLAY_SVC_CLASS_FUNC)(
void*);
50 typedef std::map<int, CLAY_SVC_CLASS_FUNC> ClayServiceIntMap;
51 typedef std::map<std::string, CLAY_SVC_CLASS_FUNC> ClayServiceStrMap;
53 typedef std::map<int, ClayServiceProvider*> ClayServiceProviderIntMap;
54 typedef std::map<std::string, ClayServiceProvider*> ClayServiceProviderStrMap;
88 int RegisterService(
const std::string& sSvcName, CLAY_SVC_CLASS_FUNC pSvcFunc);
150 CLAY_SVC_CLASS_FUNC
GetService(
const std::string& sSvcName);
157 virtual int DoService(
int iSvcCode,
void* pParam);
164 virtual int DoService(
const std::string& sSvcName,
void* pParam);
193 ClayServiceProviderIntMap m_spintmap;
194 ClayServiceProviderStrMap m_spstrmap;
219 int UnregSp(
const std::string& sSpName);
244 int CallService(
int iSpCode,
int iSvcCode,
void* pParam);
252 int CallService(
int iSpCode,
const std::string& sSvcName,
void* pParam);
260 int CallService(
const std::string& sSpName,
int iSvcCode,
void* pParam);
268 int CallService(
const std::string& sSpName,
const std::string& sSvcName,
void* pParam);
280 bool SpExists(
const std::string& sSpName);
287 bool SvcExists(
int iSpCode,
int iSvcCode);
294 bool SvcExists(
int iSpCode,
const std::string& sSvcName);
301 bool SvcExists(
const std::string& sSpName,
int iSvcCode);
308 bool SvcExists(
const std::string& sSpName,
const std::string& sSvcName);
328 if(pAgent != NULL)
return pAgent;
329 else return &instance;
354 void Log(
const char* sMsg);
413 bool ServiceExists(
int iSpCode,
const std::string& sSvcName);
420 bool ServiceExists(
const std::string& sSpName,
int iSvcCode);
427 bool ServiceExists(
const std::string& sSpName,
const std::string& sSvcName);
435 int CallService(
int iSpCode,
int iSvcCode,
void* pParam = NULL);
443 int CallService(
int iSpCode,
const std::string& sSvcName,
void* pParam = NULL);
451 int CallService(
const std::string& sSpName,
int iSvcCode,
void* pParam = NULL);
459 int CallService(
const std::string& sSpName,
const std::string& sSvcName,
void* pParam = NULL);
471 #endif // __CLAY_H_INCLUDED__