39 createTransportFunc_{},
40 destroyTransportFunc_{}
42 if((pLibHandle_ = dlopen(sLibraryName.c_str(), RTLD_NOW)) == 0)
47 if((createTransportFunc_ =
48 reinterpret_cast<CreateTransportFunc>((
void (*)())(dlsym(pLibHandle_,
"create")))) == 0)
51 throw makeException<Utils::FactoryException>(
"%s missing create symbol. (Missing DECLARE_TRANSPORT()?)",
52 sLibraryName.c_str());
55 if((destroyTransportFunc_ =
56 reinterpret_cast<DestroyTransportFunc>((
void (*)())dlsym(pLibHandle_,
"destroy"))) == 0)
59 throw makeException<Utils::FactoryException>(
"%s missing destroy symbol. (Missing DECLARE_TRANSPORT()?)",
60 sLibraryName.c_str());
71 return createTransportFunc_(
id, pPlatformService);
76 destroyTransportFunc_(pTransport);
Base class for all transports.
Exception thrown during the creation of a layer factory.
Transport * createTransport(NEMId nemId, PlatformServiceProvider *pPlatformService) const
void destoryTransport(Transport *pTransport) const
TransportFactory(const std::string &sLibraryName)