18#ifndef BIMHOMEAPP_APP_IDELEGATE_MANAGER_H
19#define BIMHOMEAPP_APP_IDELEGATE_MANAGER_H
26 typedef void* (*CREATE_DELEGATE_FUNC)();
48 virtual void registerDelegate(
const std::string& sDelegateName, CREATE_DELEGATE_FUNC pFunc) = 0;
70#define BIMHOME_DELEGATE_DECLARE(className) \
72 std::string delegateName()override;\
73 static void* create();
75#define BIMHOME_DELEGATE_DEFINE(className) \
76 std::string className##::delegateName(){\
79 void* className##::create(){\
80 return new className(); \
82 static App::DelegateRegister oRegister(#className, &className##::create);
virtual void registerDelegate(const std::string &sDelegateName, CREATE_DELEGATE_FUNC pFunc)=0
注册委托
static IDelegateManager & instance()
获取委托管理器的单例实例
委托管理器接口
Definition IDelegateManager.h:33
void *(* CREATE_DELEGATE_FUNC)()
Definition IDelegateManager.h:26
Definition BaseFigureFactory.h:28
DelegateRegister(const std::string &sClassName, void *pFunc)
构造函数
Definition IDelegateManager.h:65
委托注册结构体
Definition IDelegateManager.h:56