22 #ifndef NDN_CXX_UTIL_DUMMY_CLIENT_FACE_HPP
23 #define NDN_CXX_UTIL_DUMMY_CLIENT_FACE_HPP
102 DummyClientFace(boost::asio::io_service& ioService, KeyChain& keyChain,
136 construct(
const Options& options);
139 enableBroadcastLink();
142 enablePacketLogging();
145 enableRegistrationReply(uint64_t faceId);
194 struct BroadcastLink;
195 shared_ptr<BroadcastLink> m_bcastLink;
196 std::unique_ptr<KeyChain> m_internalKeyChain;
197 KeyChain& m_keyChain;
Represents a Data packet.
Provide a communication channel with local or remote NDN forwarder.
Represents an Interest packet.
Represents a Network Nack.
Options for DummyClientFace.
Options(bool enablePacketLogging, bool enableRegistrationReply)
std::function< void(time::milliseconds)> processEventsOverride
If not empty, face.processEvents() will be overridden by this function.
uint64_t registrationReplyFaceId
FaceId used in prefix registration replies.
Options(bool enablePacketLogging, bool enableRegistrationReply, const std::function< void(time::milliseconds)> &processEventsOverride)
bool enablePacketLogging
If true, packets sent out of DummyClientFace will be appended to a container.
bool enableRegistrationReply
If true, prefix registration command will be automatically replied with a successful response.
A client-side face for unit testing.
std::vector< Interest > sentInterests
Interests sent out of this DummyClientFace.
void receive(const Interest &interest)
Cause the Face to receive an Interest packet.
Signal< DummyClientFace, Interest > onSendInterest
Emits whenever an Interest is sent.
void linkTo(DummyClientFace &other)
Link another DummyClientFace through a broadcast media.
Signal< DummyClientFace, lp::Nack > onSendNack
Emits whenever a Nack is sent.
void unlink()
Unlink the broadcast media if previously linked.
Signal< DummyClientFace, Data > onSendData
Emits whenever a Data packet is sent.
std::vector< Data > sentData
Data sent out of this DummyClientFace.
std::vector< lp::Nack > sentNacks
Nacks sent out of this DummyClientFace.
~DummyClientFace() override
DummyClientFace(const Options &options=Options())
Create a dummy face with internal IO service.
Provides a lightweight signal / event system.
#define NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE
boost::chrono::milliseconds milliseconds