NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.0: 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:
40  struct Error : public ProtocolFactory::Error
41  {
42  Error(const std::string& what) : ProtocolFactory::Error(what) {}
43  };
44 
57  shared_ptr<UnixStreamChannel>
58  createChannel(const std::string& unixSocketPath);
59 
60  // from Factory
61 
62  virtual void
63  createFace(const FaceUri& uri,
64  ndn::nfd::FacePersistency persistency,
65  const FaceCreatedCallback& onCreated,
66  const FaceConnectFailedCallback& onConnectFailed) DECL_OVERRIDE;
67 
68  virtual std::list<shared_ptr<const Channel> >
69  getChannels() const;
70 
71 private:
80  shared_ptr<UnixStreamChannel>
81  findChannel(const unix_stream::Endpoint& endpoint);
82 
83 private:
84  typedef std::map< unix_stream::Endpoint, shared_ptr<UnixStreamChannel> > ChannelMap;
85  ChannelMap m_channels;
86 };
87 
88 } // namespace nfd
89 
90 #endif // NFD_DAEMON_FACE_UNIX_STREAM_FACTORY_HPP
function< void(const std::string &reason)> FaceConnectFailedCallback
Prototype for the callback that is called when face is failed to get created.
Error(const std::string &what)
virtual std::list< shared_ptr< const Channel > > getChannels() const
represents the underlying protocol and address used by a Face
Definition: face-uri.hpp:44
Exception of UnixStreamFactory.
#define DECL_OVERRIDE
expands to &#39;override&#39; if compiler supports this feature, otherwise expands to nothing ...
Definition: common.hpp:49
Copyright (c) 2011-2015 Regents of the University of California.
Definition: ndn-common.hpp:38
shared_ptr< UnixStreamChannel > createChannel(const std::string &unixSocketPath)
Create stream-oriented Unix channel using specified socket path.
Base class for all exceptions thrown by channel factories.
function< void(const shared_ptr< Face > &newFace)> FaceCreatedCallback
Prototype for the callback called when face is created (as a response to incoming connection or after...
boost::asio::local::stream_protocol::endpoint Endpoint
virtual void createFace(const FaceUri &uri, ndn::nfd::FacePersistency persistency, const FaceCreatedCallback &onCreated, const FaceConnectFailedCallback &onConnectFailed) 1
Try to create Face using the supplied FaceUri.