NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.0: NDN, CCN, CCNx, content centric networks
API Documentation
dummy-client-face.hpp
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
22 #ifndef NDN_UTIL_DUMMY_CLIENT_FACE_HPP
23 #define NDN_UTIL_DUMMY_CLIENT_FACE_HPP
24 
25 #include "../face.hpp"
26 #include "signal.hpp"
27 #include "../lp/packet.hpp"
28 
29 #define NDN_UTIL_DUMMY_FACE_KEEP_DEPRECATED
30 
31 namespace ndn {
32 namespace util {
33 
36 class DummyClientFace : public ndn::Face
37 {
38 public:
41  struct Options
42  {
46 
51  };
52 
57 
61  DummyClientFace(boost::asio::io_service& ioService, const Options& options = DummyClientFace::DEFAULT_OPTIONS);
62 
66  template<typename Packet>
67  void
68  receive(const Packet& packet);
69 
70 private: // constructors
71  class Transport;
72 
73  void
74  construct(const Options& options);
75 
76 private:
77  void
79 
80  void
82 
83 public:
89  static const Options DEFAULT_OPTIONS;
90 
97  std::vector<Interest> sentInterests;
98 
105  std::vector<Data> sentData;
106 
107 #ifdef NDN_UTIL_DUMMY_FACE_KEEP_DEPRECATED
108  std::vector<Data>& sentDatas;
109 #endif // NDN_UTIL_DUMMY_FACE_KEEP_DEPRECATED
110 
117  std::vector<lp::Nack> sentNacks;
118 
124 
130 
136 };
137 
138 template<>
139 void
141 
142 #ifdef NDN_UTIL_DUMMY_FACE_KEEP_DEPRECATED
143 
147 shared_ptr<DummyClientFace>
149 
154 shared_ptr<DummyClientFace>
155 makeDummyClientFace(boost::asio::io_service& ioService,
157 #endif // NDN_UTIL_DUMMY_FACE_KEEP_DEPRECATED
158 
159 } // namespace util
160 } // namespace ndn
161 
162 #endif // NDN_UTIL_DUMMY_CLIENT_FACE_HPP
std::vector< lp::Nack > sentNacks
NACKs sent out of this DummyClientFace.
Copyright (c) 2011-2015 Regents of the University of California.
Signal< DummyClientFace, Interest > onSendInterest
emits whenever an Interest is sent
std::vector< Interest > sentInterests
Interests sent out of this DummyClientFace.
std::vector< Data > & sentDatas
deprecated alias to sentData
bool enablePacketLogging
if true, packets sent out of DummyClientFace will be appended to a container
std::vector< Data > sentData
Data sent out of this DummyClientFace.
provides a lightweight signal / event system
represents a Network Nack
Definition: nack.hpp:40
Signal< DummyClientFace, lp::Nack > onSendNack
emits whenever a NACK is sent
options for DummyClientFace
Abstraction to communicate with local or remote NDN forwarder.
Definition: face.hpp:119
shared_ptr< DummyClientFace > makeDummyClientFace(const DummyClientFace::Options &options)
Create a dummy face with internal IO service.
Signal< DummyClientFace, Data > onSendData
emits whenever a Data packet is sent
DummyClientFace(const Options &options=DummyClientFace::DEFAULT_OPTIONS)
Create a dummy face with internal IO service.
a client-side face for unit testing
static const Options DEFAULT_OPTIONS
default options
void receive(const Packet &packet)
cause the Face to receive a packet
bool enableRegistrationReply
if true, prefix registration command will be automatically replied with a successful response ...