35 #define NDN_FACE_KEEP_DEPRECATED_REGISTRATION_SIGNING 37 #ifdef NDN_FACE_KEEP_DEPRECATED_REGISTRATION_SIGNING 39 #endif // NDN_FACE_KEEP_DEPRECATED_REGISTRATION_SIGNING 51 class PendingInterestId;
52 class RegisteredPrefixId;
53 class InterestFilterId;
58 using security::KeyChain;
72 typedef function<void(const Interest&, const lp::Nack&)>
NackCallback;
83 typedef function<void(const Interest&, Data&)>
OnData;
94 typedef function<void (const InterestFilter&, const Interest&)>
OnInterest;
122 class Error :
public std::runtime_error
127 :
std::runtime_error(what)
168 Face(boost::asio::io_service& ioService);
178 Face(shared_ptr<Transport> transport);
190 Face(shared_ptr<Transport> transport,
191 boost::asio::io_service& ioService);
202 Face(shared_ptr<Transport> transport,
203 boost::asio::io_service& ioService,
218 const PendingInterestId*
219 expressInterest(
const Interest& interest,
220 const DataCallback& afterSatisfied,
221 const NackCallback& afterNacked,
222 const TimeoutCallback& afterTimeout);
237 const PendingInterestId*
238 expressInterest(
const Interest& interest,
239 const OnData& onData,
240 const OnTimeout& onTimeout =
nullptr);
256 const PendingInterestId*
259 const OnData& onData,
260 const OnTimeout& onTimeout =
nullptr);
268 removePendingInterest(
const PendingInterestId* pendingInterestId);
274 removeAllPendingInterests();
280 getNPendingInterests()
const;
303 const RegisteredPrefixId*
305 const OnInterest& onInterest,
306 const RegisterPrefixFailureCallback& onFailure,
331 const RegisteredPrefixId*
333 const OnInterest& onInterest,
334 const RegisterPrefixSuccessCallback& onSuccess,
335 const RegisterPrefixFailureCallback& onFailure,
351 const InterestFilterId*
353 const OnInterest& onInterest);
355 #ifdef NDN_FACE_KEEP_DEPRECATED_REGISTRATION_SIGNING 380 const RegisteredPrefixId*
382 const OnInterest& onInterest,
383 const RegisterPrefixSuccessCallback& onSuccess,
384 const RegisterPrefixFailureCallback& onFailure,
411 const RegisteredPrefixId*
413 const OnInterest& onInterest,
414 const RegisterPrefixFailureCallback& onFailure,
440 const RegisteredPrefixId*
442 const OnInterest& onInterest,
443 const RegisterPrefixSuccessCallback& onSuccess,
444 const RegisterPrefixFailureCallback& onFailure,
445 const Name& identity,
469 const RegisteredPrefixId*
471 const OnInterest& onInterest,
472 const RegisterPrefixFailureCallback& onFailure,
473 const Name& identity,
475 #endif // NDN_FACE_KEEP_DEPRECATED_REGISTRATION_SIGNING 494 const RegisteredPrefixId*
495 registerPrefix(
const Name& prefix,
496 const RegisterPrefixSuccessCallback& onSuccess,
497 const RegisterPrefixFailureCallback& onFailure,
501 #ifdef NDN_FACE_KEEP_DEPRECATED_REGISTRATION_SIGNING 521 const RegisteredPrefixId*
522 registerPrefix(
const Name& prefix,
523 const RegisterPrefixSuccessCallback& onSuccess,
524 const RegisterPrefixFailureCallback& onFailure,
547 const RegisteredPrefixId*
548 registerPrefix(
const Name& prefix,
549 const RegisterPrefixSuccessCallback& onSuccess,
550 const RegisterPrefixFailureCallback& onFailure,
551 const Name& identity,
553 #endif // NDN_FACE_KEEP_DEPRECATED_REGISTRATION_SIGNING 568 unsetInterestFilter(
const RegisteredPrefixId* registeredPrefixId);
579 unsetInterestFilter(
const InterestFilterId* interestFilterId);
595 unregisterPrefix(
const RegisteredPrefixId* registeredPrefixId,
596 const UnregisterPrefixSuccessCallback& onSuccess,
597 const UnregisterPrefixFailureCallback& onFailure);
613 put(
const Data& data);
646 processEvents(
const time::milliseconds& timeout = time::milliseconds::zero(),
647 bool keepThread =
false);
663 boost::asio::io_service&
666 return *
static_cast<boost::asio::io_service*
>(
nullptr);
673 shared_ptr<Transport>
681 shared_ptr<Transport>
682 makeDefaultTransport();
689 construct(shared_ptr<Transport> transport,
KeyChain& keyChain);
692 onReceiveElement(
const Block& blockFromDaemon);
698 shared_ptr<Transport> m_transport;
700 unique_ptr<nfd::Controller> m_nfdController;
703 unique_ptr<Impl> m_impl;
708 #endif // NDN_FACE_HPP Copyright (c) 2011-2015 Regents of the University of California.
Error(const std::string &what)
function< void(const std::string &)> UnregisterPrefixFailureCallback
Callback called when unregisterPrefix or unsetInterestFilter command fails.
Copyright (c) 2013-2015 Regents of the University of California.
The packet signing interface.
Class representing a wire element of NDN-TLV packet format.
represents an Interest packet
function< void(const Interest &)> OnTimeout
Callback called when expressed Interest times out.
function< void(const InterestFilter &, const Interest &)> OnInterest
Callback called when incoming Interest matches the specified InterestFilter.
Copyright (c) 2013-2015 Regents of the University of California.
Signing parameters passed to KeyChain.
represents a Network Nack
Copyright (c) 2011-2015 Regents of the University of California.
Abstraction to communicate with local or remote NDN forwarder.
function< void(const Name &, const std::string &)> RegisterPrefixFailureCallback
Callback called when registerPrefix or setInterestFilter command fails.
function< void(const Name &)> RegisterPrefixSuccessCallback
Callback called when registerPrefix or setInterestFilter command succeeds.
Name abstraction to represent an absolute name.
boost::asio::io_service & getIoService()
Return nullptr (cannot use IoService in simulations), preserved for API compatibility.
function< void(const Interest &, Data &)> OnData
Callback called when expressed Interest gets satisfied with Data packet.
function< void()> UnregisterPrefixSuccessCallback
Callback called when unregisterPrefix or unsetInterestFilter command succeeds.
#define NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PROTECTED
function< void(const Interest &)> TimeoutCallback
Callback called when expressed Interest times out.
function< void(const Interest &, const lp::Nack &)> NackCallback
Callback called when Nack is sent in response to expressed Interest.
function< void(const Interest &, const Data &)> DataCallback
Callback called when expressed Interest gets satisfied with a Data packet.