27 #include <boost/range/adaptor/map.hpp> 28 #include <boost/range/algorithm/copy.hpp> 33 ProtocolFactory::Registry&
34 ProtocolFactory::getRegistry()
36 static Registry registry;
40 unique_ptr<ProtocolFactory>
43 Registry& registry = getRegistry();
44 auto found = registry.find(
id);
45 if (found == registry.end()) {
49 return found->second(params);
55 std::set<std::string> factoryIds;
56 boost::copy(getRegistry() | boost::adaptors::map_keys,
57 std::inserter(factoryIds, factoryIds.end()));
65 BOOST_ASSERT(
addFace !=
nullptr);
66 BOOST_ASSERT(
netmon !=
nullptr);
FaceCreatedCallback addFace
callback when a new face is created
static std::set< std::string > listRegistered()
Get registered protocol factory ids.
ProtocolFactory(const CtorParams ¶ms)
shared_ptr< ndn::net::NetworkMonitor > netmon
NetworkMonitor for listing available network interfaces and monitoring their changes.
Copyright (c) 2014-2015, Regents of the University of California, Arizona Board of Regents...
Parameters to ProtocolFactory constructor.
static unique_ptr< ProtocolFactory > create(const std::string &id, const CtorParams ¶ms)
Create a protocol factory instance.