22 #ifndef NDN_CXX_FACE_HPP 23 #define NDN_CXX_FACE_HPP 39 class PendingInterestHandle;
40 class RegisteredPrefixHandle;
41 class InterestFilterHandle;
55 typedef function<void(const Interest&, const lp::Nack&)>
NackCallback;
93 class Error :
public std::runtime_error
96 using std::runtime_error::runtime_error;
132 Face(shared_ptr<Transport> transport =
nullptr);
177 Face(shared_ptr<Transport> transport,
KeyChain& keyChain);
195 expressInterest(
const Interest& interest,
196 const DataCallback& afterSatisfied,
197 const NackCallback& afterNacked,
198 const TimeoutCallback& afterTimeout);
204 removeAllPendingInterests();
210 getNPendingInterests()
const;
233 setInterestFilter(
const InterestFilter& filter,
const InterestCallback& onInterest,
234 const RegisterPrefixFailureCallback& onFailure,
259 setInterestFilter(
const InterestFilter& filter,
const InterestCallback& onInterest,
260 const RegisterPrefixSuccessCallback& onSuccess,
261 const RegisterPrefixFailureCallback& onFailure,
278 setInterestFilter(
const InterestFilter& filter,
const InterestCallback& onInterest);
298 registerPrefix(
const Name& prefix,
299 const RegisterPrefixSuccessCallback& onSuccess,
300 const RegisterPrefixFailureCallback& onFailure,
358 bool keepThread =
false)
360 this->doProcessEvents(
timeout, keepThread);
393 shared_ptr<Transport>
407 shared_ptr<Transport>
408 makeDefaultTransport();
414 construct(shared_ptr<Transport> transport,
KeyChain& keyChain);
417 onReceiveElement(
const Block& blockFromDaemon);
420 shared_ptr<Transport> m_transport;
423 shared_ptr<Impl> m_impl;
472 unregister(
const UnregisterPrefixSuccessCallback& onSuccess =
nullptr,
473 const UnregisterPrefixFailureCallback& onFailure =
nullptr);
480 const UnregisterPrefixSuccessCallback& onSuccess,
481 const UnregisterPrefixFailureCallback& onFailure);
484 weak_ptr<Face::Impl> m_weakImpl;
539 #endif // NDN_CXX_FACE_HPP
Copyright (c) 2011-2015 Regents of the University of California.
function< void(const std::string &)> UnregisterPrefixFailureCallback
Callback invoked when unregistering a prefix fails.
implementation detail of Face
declares the set of Interests a producer can serve, which starts with a name prefix, plus an optional regular expression
DummyIoService & getIoService()
Represents a TLV element of the NDN packet format.
Represents an Interest packet.
Signing parameters passed to KeyChain.
#define NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PROTECTED
represents a Network Nack
Handle for a pending Interest.
Provide a communication channel with local or remote NDN forwarder.
function< void(const Name &, const std::string &)> RegisterPrefixFailureCallback
Callback invoked when registerPrefix or setInterestFilter command fails.
void processEvents(time::milliseconds timeout=time::milliseconds::zero(), bool keepThread=false)
Process any data to receive or call timeout callbacks.
function< void(const Name &)> RegisterPrefixSuccessCallback
Callback invoked when registerPrefix or setInterestFilter command succeeds.
Represents an absolute name.
function< void(const InterestFilter &, const Interest &)> InterestCallback
Callback invoked when an incoming Interest matches the specified InterestFilter.
Handle to cancel an operation.
function< void()> UnregisterPrefixSuccessCallback
Callback invoked when unregistering a prefix succeeds.
Handle for a registered Interest filter.
function< void(const Interest &)> TimeoutCallback
Callback invoked when an expressed Interest times out.
function< void(const Interest &, const lp::Nack &)> NackCallback
Callback invoked when a Nack is received in response to an expressed Interest.
Represents a Data packet.
Handle for a registered prefix.
function< void(const Interest &, const Data &)> DataCallback
Callback invoked when an expressed Interest is satisfied by a Data packet.
Exception thrown when attempting to send a packet over size limit.
boost::chrono::milliseconds milliseconds