NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.0: NDN, CCN, CCNx, content centric networks
API Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
internal-face.hpp
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
26 #ifndef NFD_DAEMON_MGMT_INTERNAL_FACE_HPP
27 #define NFD_DAEMON_MGMT_INTERNAL_FACE_HPP
28 
29 #include "face/face.hpp"
30 #include "app-face.hpp"
31 
32 #include "command-validator.hpp"
33 
34 namespace nfd {
35 
36 class InternalFace : public Face, public AppFace
37 {
38 public:
42  class Error : public Face::Error
43  {
44  public:
45  explicit
46  Error(const std::string& what)
47  : Face::Error(what)
48  {
49  }
50  };
51 
52  InternalFace();
53 
55  getValidator();
56 
57  virtual
58  ~InternalFace();
59 
60  // Overridden Face methods for forwarder
61 
62  virtual void
63  sendInterest(const Interest& interest);
64 
65  virtual void
66  sendData(const Data& data);
67 
68  virtual void
69  close();
70 
71  // Methods implementing AppFace interface. Do not invoke from forwarder.
72 
73  virtual void
74  setInterestFilter(const Name& filter,
75  OnInterest onInterest);
76 
77  virtual void
78  put(const Data& data);
79 
80 private:
81  void
82  processInterest(const shared_ptr<const Interest>& interest);
83 
84 private:
85  std::map<Name, OnInterest> m_interestFilters;
86  CommandValidator m_validator;
87 };
88 
89 inline CommandValidator&
91 {
92  return m_validator;
93 }
94 
95 
96 } // namespace nfd
97 
98 #endif // NFD_DAEMON_MGMT_INTERNAL_FACE_HPP
Face-related error.
Definition: face.hpp:65
Error(const std::string &what)
InternalFace-related error.
virtual void sendData(const Data &data)
send a Data
virtual void put(const Data &data)
represents a face
Definition: face.hpp:59
virtual void setInterestFilter(const Name &filter, OnInterest onInterest)
CommandValidator & getValidator()
virtual void sendInterest(const Interest &interest)
send an Interest
function< void(const Name &, const Interest &)> OnInterest
Definition: app-face.hpp:35
virtual void close()
Close the face.