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;
100 typedef function<void (const InterestFilter&, const Interest&)>
OnInterest;
128 class Error :
public std::runtime_error
133 :
std::runtime_error(what)
151 Face(shared_ptr<Transport> transport =
nullptr);
182 Face(boost::asio::io_service& ioService);
196 Face(shared_ptr<Transport> transport,
KeyChain& keyChain);
211 Face(shared_ptr<Transport> transport, boost::asio::io_service& ioService);
227 Face(shared_ptr<Transport> transport, boost::asio::io_service& ioService,
KeyChain& keyChain);
241 const PendingInterestId*
242 expressInterest(
const Interest& interest,
243 const DataCallback& afterSatisfied,
244 const NackCallback& afterNacked,
245 const TimeoutCallback& afterTimeout);
260 const PendingInterestId*
261 expressInterest(
const Interest& interest,
262 const OnData& onData,
263 const OnTimeout& onTimeout =
nullptr);
279 const PendingInterestId*
282 const OnData& onData,
283 const OnTimeout& onTimeout =
nullptr);
291 removePendingInterest(
const PendingInterestId* pendingInterestId);
297 removeAllPendingInterests();
303 getNPendingInterests()
const;
326 const RegisteredPrefixId*
328 const InterestCallback& onInterest,
329 const RegisterPrefixFailureCallback& onFailure,
354 const RegisteredPrefixId*
356 const InterestCallback& onInterest,
357 const RegisterPrefixSuccessCallback& onSuccess,
358 const RegisterPrefixFailureCallback& onFailure,
374 const InterestFilterId*
376 const InterestCallback& onInterest);
378 #ifdef NDN_FACE_KEEP_DEPRECATED_REGISTRATION_SIGNING 403 const RegisteredPrefixId*
405 const OnInterest& onInterest,
406 const RegisterPrefixSuccessCallback& onSuccess,
407 const RegisterPrefixFailureCallback& onFailure,
434 const RegisteredPrefixId*
436 const OnInterest& onInterest,
437 const RegisterPrefixFailureCallback& onFailure,
463 const RegisteredPrefixId*
465 const OnInterest& onInterest,
466 const RegisterPrefixSuccessCallback& onSuccess,
467 const RegisterPrefixFailureCallback& onFailure,
468 const Name& identity,
492 const RegisteredPrefixId*
494 const OnInterest& onInterest,
495 const RegisterPrefixFailureCallback& onFailure,
496 const Name& identity,
498 #endif // NDN_FACE_KEEP_DEPRECATED_REGISTRATION_SIGNING 517 const RegisteredPrefixId*
518 registerPrefix(
const Name& prefix,
519 const RegisterPrefixSuccessCallback& onSuccess,
520 const RegisterPrefixFailureCallback& onFailure,
524 #ifdef NDN_FACE_KEEP_DEPRECATED_REGISTRATION_SIGNING 544 const RegisteredPrefixId*
545 registerPrefix(
const Name& prefix,
546 const RegisterPrefixSuccessCallback& onSuccess,
547 const RegisterPrefixFailureCallback& onFailure,
570 const RegisteredPrefixId*
571 registerPrefix(
const Name& prefix,
572 const RegisterPrefixSuccessCallback& onSuccess,
573 const RegisterPrefixFailureCallback& onFailure,
574 const Name& identity,
576 #endif // NDN_FACE_KEEP_DEPRECATED_REGISTRATION_SIGNING 591 unsetInterestFilter(
const RegisteredPrefixId* registeredPrefixId);
602 unsetInterestFilter(
const InterestFilterId* interestFilterId);
618 unregisterPrefix(
const RegisteredPrefixId* registeredPrefixId,
619 const UnregisterPrefixSuccessCallback& onSuccess,
620 const UnregisterPrefixFailureCallback& onFailure);
636 put(
const Data& data);
669 processEvents(
const time::milliseconds& timeout = time::milliseconds::zero(),
670 bool keepThread =
false)
672 this->doProcessEvents(timeout, keepThread);
689 boost::asio::io_service&
692 return *
static_cast<boost::asio::io_service*
>(
nullptr);
699 shared_ptr<Transport>
704 doProcessEvents(
const time::milliseconds& timeout,
bool keepThread);
710 shared_ptr<Transport>
711 makeDefaultTransport();
718 construct(shared_ptr<Transport> transport,
KeyChain& keyChain);
721 onReceiveElement(
const Block& blockFromDaemon);
727 shared_ptr<Transport> m_transport;
729 unique_ptr<nfd::Controller> m_nfdController;
732 shared_ptr<Impl> m_impl;
737 #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 invoked when unregisterPrefix or unsetInterestFilter command fails.
Copyright (c) 2013-2016 Regents of the University of California.
declares the set of Interests a producer can serve, which starts with a name prefix, plus an optional regular expression
The packet signing interface.
Class representing a wire element of NDN-TLV packet format.
represents an Interest packet
function< void(const Interest &)> OnTimeout
Callback invoked when expressed Interest times out.
function< void(const InterestFilter &, const Interest &)> OnInterest
Callback invoked when incoming Interest matches the specified InterestFilter.
Copyright (c) 2013-2016 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.
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.
function< void(const Name &)> RegisterPrefixSuccessCallback
Callback invoked 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 InterestFilter &, const Interest &)> InterestCallback
Callback invoked when incoming Interest matches the specified InterestFilter.
function< void(const Interest &, Data &)> OnData
Callback invoked when expressed Interest gets satisfied with Data packet.
function< void()> UnregisterPrefixSuccessCallback
Callback invoked when unregisterPrefix or unsetInterestFilter command succeeds.
#define NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PROTECTED
void processEvents(const time::milliseconds &timeout=time::milliseconds::zero(), bool keepThread=false)
Process any data to receive or call timeout callbacks.
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.
function< void(const Interest &, const Data &)> DataCallback
Callback invoked when expressed Interest gets satisfied with a Data packet.