NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.3: NDN, CCN, CCNx, content centric networks
API Documentation
protocol-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_PROTOCOL_FACTORY_HPP
27 #define NFD_DAEMON_FACE_PROTOCOL_FACTORY_HPP
28 
29 #include "channel.hpp"
30 #include <ndn-cxx/encoding/nfd-constants.hpp>
31 
32 namespace nfd {
33 
38 {
39 public:
43  class Error : public std::runtime_error
44  {
45  public:
46  explicit
47  Error(const std::string& what)
48  : std::runtime_error(what)
49  {
50  }
51  };
52 
66  virtual void
67  createFace(const FaceUri& uri,
68  ndn::nfd::FacePersistency persistency,
69  bool wantLocalFieldsEnabled,
70  const FaceCreatedCallback& onCreated,
71  const FaceCreationFailedCallback& onFailure) = 0;
72 
73  virtual std::vector<shared_ptr<const Channel>>
74  getChannels() const = 0;
75 };
76 
77 } // namespace nfd
78 
79 #endif // NFD_DAEMON_FACE_PROTOCOL_FACTORY_HPP
Base class for all exceptions thrown by protocol factories.
represents the underlying protocol and address used by a Face
Definition: face-uri.hpp:44
virtual std::vector< shared_ptr< const Channel > > getChannels() const =0
STL namespace.
Copyright (c) 2011-2015 Regents of the University of California.
Definition: ndn-common.hpp:40
Abstract base class for all protocol factories.
Error(const std::string &what)
virtual void createFace(const FaceUri &uri, ndn::nfd::FacePersistency persistency, bool wantLocalFieldsEnabled, const FaceCreatedCallback &onCreated, const FaceCreationFailedCallback &onFailure)=0
Try to create Face using the supplied FaceUri.
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