39 class PendingInterestId;
40 class PendingInterestHandle;
41 class RegisteredPrefixId;
42 class RegisteredPrefixHandle;
43 class InterestFilterId;
44 class InterestFilterHandle;
58 typedef function<void(const Interest&, const lp::Nack&)>
NackCallback;
96 class Error :
public std::runtime_error
99 using std::runtime_error::runtime_error;
135 Face(shared_ptr<Transport> transport =
nullptr);
166 Face(boost::asio::io_service& ioService);
175 Face(
const std::string& host,
const std::string& port =
"6363");
189 Face(shared_ptr<Transport> transport, KeyChain& keyChain);
204 Face(shared_ptr<Transport> transport, boost::asio::io_service& ioService);
220 Face(shared_ptr<Transport> transport, boost::asio::io_service& ioService, KeyChain& keyChain);
238 expressInterest(
const Interest& interest,
239 const DataCallback& afterSatisfied,
240 const NackCallback& afterNacked,
241 const TimeoutCallback& afterTimeout);
248 removePendingInterest(
const PendingInterestId* pendingInterestId);
254 removeAllPendingInterests();
260 getNPendingInterests()
const;
284 const InterestCallback& onInterest,
285 const RegisterPrefixFailureCallback& onFailure,
311 const InterestCallback& onInterest,
312 const RegisterPrefixSuccessCallback& onSuccess,
313 const RegisterPrefixFailureCallback& onFailure,
331 const InterestCallback& onInterest);
351 registerPrefix(
const Name& prefix,
352 const RegisterPrefixSuccessCallback& onSuccess,
353 const RegisterPrefixFailureCallback& onFailure,
370 unsetInterestFilter(
const RegisteredPrefixId* registeredPrefixId);
381 unsetInterestFilter(
const InterestFilterId* interestFilterId);
397 unregisterPrefix(
const RegisteredPrefixId* registeredPrefixId,
398 const UnregisterPrefixSuccessCallback& onSuccess,
399 const UnregisterPrefixFailureCallback& onFailure);
455 bool keepThread =
false)
457 this->doProcessEvents(timeout, keepThread);
478 boost::asio::io_service&
488 shared_ptr<Transport>
493 doProcessEvents(time::milliseconds timeout,
bool keepThread);
499 shared_ptr<Transport>
500 makeDefaultTransport();
507 construct(shared_ptr<Transport> transport, KeyChain& keyChain);
510 onReceiveElement(
const Block& blockFromDaemon);
517 unique_ptr<boost::asio::io_service> m_internalIoService;
519 boost::asio::io_service& m_ioService;
521 shared_ptr<Transport> m_transport;
530 unique_ptr<KeyChain> m_internalKeyChain;
532 unique_ptr<nfd::Controller> m_nfdController;
535 shared_ptr<Impl> m_impl;
557 operator const PendingInterestId*()
const noexcept
563 const PendingInterestId* m_id =
nullptr;
598 operator const RegisteredPrefixId*()
const noexcept
611 unregister(
const UnregisterPrefixSuccessCallback& onSuccess =
nullptr,
612 const UnregisterPrefixFailureCallback& onFailure =
nullptr);
615 Face* m_face =
nullptr;
616 const RegisteredPrefixId* m_id =
nullptr;
659 operator const InterestFilterId*()
const noexcept
665 const InterestFilterId* m_id =
nullptr;
689 #endif // NDN_FACE_HPP
function< void(const std::string &)> UnregisterPrefixFailureCallback
Callback invoked when unregisterPrefix or unsetInterestFilter command fails.
declares the set of Interests a producer can serve, which starts with a name prefix, plus an optional regular expression
Represents a TLV element of NDN packet format.
Represents an Interest packet.
Signing parameters passed to KeyChain.
represents a Network Nack
A handle of pending Interest.
Provide a communication channel with local or remote NDN forwarder.
#define NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PROTECTED
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.
boost::asio::io_service & getIoService()
function< void(const InterestFilter &, const Interest &)> InterestCallback
Callback invoked when incoming Interest matches the specified InterestFilter.
RegisteredPrefixHandle() noexcept
Handle to cancel an operation.
function< void()> UnregisterPrefixSuccessCallback
Callback invoked when unregisterPrefix or unsetInterestFilter command succeeds.
A handle of registered Interest filter.
function< void(const Interest &)> TimeoutCallback
Callback invoked when expressed Interest times out.
function< void(const Interest &, const lp::Nack &)> NackCallback
Callback invoked when Nack is sent in response to expressed Interest.
Represents a Data packet.
A handle of registered prefix.
function< void(const Interest &, const Data &)> DataCallback
Callback invoked when expressed Interest gets satisfied with a Data packet.
Cancels an operation automatically upon destruction.
Exception thrown when attempting to send a packet over size limit.