43 if((pLibHandle_ = dlopen(sLibraryName.c_str(), RTLD_NOW)) == 0)
48 if((createLayerFunc_ = reinterpret_cast<CreateLayerFunc>((
void (*)())(dlsym(pLibHandle_,
"create")))) == 0)
51 throw makeException<Utils::FactoryException>(
"%s missing create symbol. (Missing DECLARE_PHY_LAYER()?)",
52 sLibraryName.c_str());
55 if((destroyLayerFunc_ = reinterpret_cast<DestroyLayerFunc>((
void (*)())dlsym(pLibHandle_,
"destroy"))) == 0)
58 throw makeException<Utils::FactoryException>(
"%s missing destroy symbol. (Missing DECLARE_PHY_LAYER()?)",
59 sLibraryName.c_str());
70 return createLayerFunc_(
id, pPlatformServiceProvider);
75 destroyLayerFunc_(pLayer);
PHYLayerFactory(const std::string &sLibraryName)
Interface used to create a PHY layer plugin implementation.
void destoryLayer(PHYLayerImplementor *layer) const
PHYLayerImplementor * createLayer(NEMId nemId, PlatformServiceProvider *pPlatformServiceProvider) const
Exception thrown during the creation of a layer factory.