Provides support for an underlying protocol. More...
#include <daemon/face/protocol-factory.hpp>
Inheritance diagram for nfd::face::ProtocolFactory:
Collaboration diagram for nfd::face::ProtocolFactory:Classes | |
| struct | CreateFaceRequest |
| Encapsulates a face creation request and all its parameters. More... | |
| class | Error |
| Base class for all exceptions thrown by ProtocolFactory subclasses. More... | |
Public Types | |
| using | CtorParams = ProtocolFactoryCtorParams |
Public Member Functions | |
| virtual | ~ProtocolFactory ()=default |
| virtual void | createFace (const CreateFaceRequest &req, const FaceCreatedCallback &onCreated, const FaceCreationFailedCallback &onFailure)=0 |
| Try to create a unicast face using the supplied parameters. More... | |
| virtual std::vector< shared_ptr< const Channel > > | getChannels () const =0 |
| const std::set< std::string > & | getProvidedSchemes () |
| Get FaceUri schemes accepted by this ProtocolFactory. More... | |
| virtual void | processConfig (OptionalConfigSection configSection, FaceSystem::ConfigContext &context)=0 |
| Process face_system subsection that corresponds to this ProtocolFactory type. More... | |
Static Public Member Functions | |
| static unique_ptr< ProtocolFactory > | create (const std::string &id, const CtorParams ¶ms) |
| Create a protocol factory instance. More... | |
| static const std::string & | getId () |
| Get id for this ProtocolFactory. More... | |
| static std::set< std::string > | listRegistered () |
| Get registered protocol factory ids. More... | |
| template<typename PF > | |
| static void | registerType (const std::string &id=PF::getId()) |
| Register a protocol factory type. More... | |
Protected Member Functions | |
| ProtocolFactory (const CtorParams ¶ms) | |
Static Protected Member Functions | |
| template<typename ChannelMap > | |
| static std::vector< shared_ptr< const Channel > > | getChannelsFromMap (const ChannelMap &channelMap) |
Protected Attributes | |
| FaceCreatedCallback | addFace |
| callback when a new face is created More... | |
| shared_ptr< ndn::net::NetworkMonitor > | netmon |
| NetworkMonitor for listing available network interfaces and monitoring their changes. More... | |
| std::set< std::string > | providedSchemes |
| FaceUri schemes provided by this ProtocolFactory. More... | |
Provides support for an underlying protocol.
A protocol factory provides support for an underlying protocol and owns Channel objects. It can process a subsection of face_system config section and create channels and multicast faces accordingly.
Definition at line 59 of file protocol-factory.hpp.
Definition at line 62 of file protocol-factory.hpp.
|
virtualdefault |
|
explicitprotected |
Definition at line 61 of file protocol-factory.cpp.
|
static |
Create a protocol factory instance.
| nullptr | if factory with id is not registered |
Definition at line 41 of file protocol-factory.cpp.
|
pure virtual |
Try to create a unicast face using the supplied parameters.
| req | request object containing the face creation parameters |
| onCreated | callback if face creation succeeds or face already exists; the settings of an existing face are not updated if they differ from the request |
| onFailure | callback if face creation fails |
Implemented in nfd::face::UdpFactory, nfd::face::WebSocketFactory, nfd::face::EthernetFactory, nfd::face::TcpFactory, and nfd::face::UnixStreamFactory.
|
pure virtual |
|
inlinestaticprotected |
Definition at line 165 of file protocol-factory.hpp.
|
static |
Get id for this ProtocolFactory.
face_system.factory-id config section is processed by the protocol factory.
|
inline |
Get FaceUri schemes accepted by this ProtocolFactory.
Definition at line 127 of file protocol-factory.hpp.
|
static |
Get registered protocol factory ids.
Definition at line 53 of file protocol-factory.cpp.
|
pure virtual |
Process face_system subsection that corresponds to this ProtocolFactory type.
| configSection | the configuration section or boost::null to indicate it is omitted |
| context | provides access to data structures and contextual information |
| ConfigFile::Error | invalid configuration |
This function updates providedSchemes
Implemented in nfd::face::UdpFactory, nfd::face::EthernetFactory, nfd::face::TcpFactory, nfd::face::UnixStreamFactory, and nfd::face::WebSocketFactory.
|
inlinestatic |
Register a protocol factory type.
| S | subclass of ProtocolFactory |
| id | factory identifier |
Definition at line 70 of file protocol-factory.hpp.
|
protected |
callback when a new face is created
Definition at line 181 of file protocol-factory.hpp.
|
protected |
NetworkMonitor for listing available network interfaces and monitoring their changes.
ProtocolFactory subclass should check the NetworkMonitor has sufficient capabilities prior to usage.
Definition at line 188 of file protocol-factory.hpp.
|
protected |
FaceUri schemes provided by this ProtocolFactory.
Definition at line 180 of file protocol-factory.hpp.