NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.3: NDN, CCN, CCNx, content centric networks
API Documentation
unix-stream-factory.hpp
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
26 #ifndef NFD_DAEMON_FACE_UNIX_STREAM_FACTORY_HPP
27 #define NFD_DAEMON_FACE_UNIX_STREAM_FACTORY_HPP
28 
29 #include "protocol-factory.hpp"
30 #include "unix-stream-channel.hpp"
31 
32 namespace nfd {
33 
35 {
36 public:
47  shared_ptr<UnixStreamChannel>
48  createChannel(const std::string& unixSocketPath);
49 
50 public: // from ProtocolFactory
51  virtual void
52  createFace(const FaceUri& uri,
53  ndn::nfd::FacePersistency persistency,
54  bool wantLocalFieldsEnabled,
55  const FaceCreatedCallback& onCreated,
56  const FaceCreationFailedCallback& onFailure) override;
57 
58  virtual std::vector<shared_ptr<const Channel>>
59  getChannels() const override;
60 
61 private:
68  shared_ptr<UnixStreamChannel>
69  findChannel(const unix_stream::Endpoint& endpoint) const;
70 
71 private:
72  std::map<unix_stream::Endpoint, shared_ptr<UnixStreamChannel>> m_channels;
73 };
74 
75 } // namespace nfd
76 
77 #endif // NFD_DAEMON_FACE_UNIX_STREAM_FACTORY_HPP
virtual void createFace(const FaceUri &uri, ndn::nfd::FacePersistency persistency, bool wantLocalFieldsEnabled, const FaceCreatedCallback &onCreated, const FaceCreationFailedCallback &onFailure) override
Try to create Face using the supplied FaceUri.
represents the underlying protocol and address used by a Face
Definition: face-uri.hpp:44
virtual std::vector< shared_ptr< const Channel > > getChannels() const override
Copyright (c) 2011-2015 Regents of the University of California.
Definition: ndn-common.hpp:40
shared_ptr< UnixStreamChannel > createChannel(const std::string &unixSocketPath)
Create stream-oriented Unix channel using specified socket path.
Abstract base class for all protocol factories.
function< void(uint32_t status, const std::string &reason)> FaceCreationFailedCallback
Prototype for the callback that is invoked when the face fails to be created.
Definition: channel.hpp:44
function< void(const shared_ptr< Face > &newFace)> FaceCreatedCallback
Prototype for the callback that is invoked when the face is created (as a response to incoming connec...
Definition: channel.hpp:38
boost::asio::local::stream_protocol::endpoint Endpoint