40 createEventAgentFunc_{},
41 destroyEventAgentFunc_{}
43 if((pLibHandle_ = dlopen(sLibraryName.c_str(), RTLD_NOW)) == 0)
48 if((createEventAgentFunc_ = reinterpret_cast<CreateEventAgentFunc>((
void (*)())(dlsym(pLibHandle_,
"create")))) == 0)
52 throw makeException<Utils::FactoryException>(
"%s missing create symbol. (Missing DECLARE_EVENT_AGENT()?)",
53 sLibraryName.c_str());
56 if((destroyEventAgentFunc_ = reinterpret_cast<DestroyEventAgentFunc>((
void (*)())dlsym(pLibHandle_,
"destroy"))) == 0)
60 throw makeException<Utils::FactoryException>(
"%s missing destroy symbol. (Missing DECLARE_EVENT_AGENT()?)",
61 sLibraryName.c_str());
72 return createEventAgentFunc_(nemId, pPlatformService);
77 destroyEventAgentFunc_(pAgent);
void destoryEventAgent(EventAgent *pAgent) const
EventAgent * createEventAgent(NEMId nemId, PlatformServiceProvider *pPlatformService) const
Exception thrown during the creation of a layer factory.
EventAgentFactory(const std::string &sLibraryName)
Base class for all event agents.