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 
28 namespace ndn {
29 namespace util {
30 
33 class DummyClientFace : public ndn::Face
34 {
35 public:
38  struct Options
39  {
43 
48  };
49 
53  template<typename Packet>
54  void
55  receive(const Packet& packet);
56 
57 private: // constructors
58  class Transport;
59 
60  // constructors are private; use makeDummyClientFace to create DummyClientFace
61 
62  DummyClientFace(const Options& options, shared_ptr<Transport> transport);
63 
64  DummyClientFace(const Options& options, shared_ptr<Transport> transport,
65  boost::asio::io_service& ioService);
66 
67  void
68  construct(const Options& options);
69 
70  friend shared_ptr<DummyClientFace>
72 
73  friend shared_ptr<DummyClientFace>
74  makeDummyClientFace(boost::asio::io_service& ioService, const DummyClientFace::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> sentDatas;
106 
111  Signal<DummyClientFace, Interest> onSendInterest;
112 
117  Signal<DummyClientFace, Data> onSendData;
118 
119 private:
120  shared_ptr<Transport> m_transport;
121 };
122 
123 shared_ptr<DummyClientFace>
125 
126 shared_ptr<DummyClientFace>
127 makeDummyClientFace(boost::asio::io_service& ioService,
129 
130 } // namespace util
131 } // namespace ndn
132 
133 #endif // NDN_UTIL_DUMMY_CLIENT_FACE_HPP
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.
bool enablePacketLogging
if true, packets sent out of DummyClientFace will be appended to a container
friend shared_ptr< DummyClientFace > makeDummyClientFace(const DummyClientFace::Options &options)
options for DummyClientFace
Abstraction to communicate with local or remote NDN forwarder.
Definition: face.hpp:100
std::vector< Data > sentDatas
Data sent out of this DummyClientFace.
Signal< DummyClientFace, Data > onSendData
emits whenever a Data packet is sent
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 ...