39 class PendingInterestId;
40 class RegisteredPrefixId;
41 class InterestFilterId;
55 typedef function<void(const Interest&, const lp::Nack&)>
NackCallback;
93 class Error :
public std::runtime_error
98 :
std::runtime_error(what)
136 Face(shared_ptr<Transport> transport =
nullptr);
167 Face(boost::asio::io_service& ioService);
176 Face(
const std::string& host,
const std::string& port =
"6363");
190 Face(shared_ptr<Transport> transport, KeyChain& keyChain);
205 Face(shared_ptr<Transport> transport, boost::asio::io_service& ioService);
221 Face(shared_ptr<Transport> transport, boost::asio::io_service& ioService, KeyChain& keyChain);
237 const PendingInterestId*
238 expressInterest(
const Interest& interest,
239 const DataCallback& afterSatisfied,
240 const NackCallback& afterNacked,
241 const TimeoutCallback& afterTimeout);
249 removePendingInterest(
const PendingInterestId* pendingInterestId);
255 removeAllPendingInterests();
261 getNPendingInterests()
const;
284 const RegisteredPrefixId*
286 const InterestCallback& onInterest,
287 const RegisterPrefixFailureCallback& onFailure,
312 const RegisteredPrefixId*
314 const InterestCallback& onInterest,
315 const RegisterPrefixSuccessCallback& onSuccess,
316 const RegisterPrefixFailureCallback& onFailure,
332 const InterestFilterId*
334 const InterestCallback& onInterest);
353 const RegisteredPrefixId*
354 registerPrefix(
const Name& prefix,
355 const RegisterPrefixSuccessCallback& onSuccess,
356 const RegisterPrefixFailureCallback& onFailure,
373 unsetInterestFilter(
const RegisteredPrefixId* registeredPrefixId);
384 unsetInterestFilter(
const InterestFilterId* interestFilterId);
400 unregisterPrefix(
const RegisteredPrefixId* registeredPrefixId,
401 const UnregisterPrefixSuccessCallback& onSuccess,
402 const UnregisterPrefixFailureCallback& onFailure);
452 bool keepThread =
false)
454 this->doProcessEvents(timeout, keepThread);
471 boost::asio::io_service&
481 shared_ptr<Transport>
486 doProcessEvents(time::milliseconds timeout,
bool keepThread);
492 shared_ptr<Transport>
493 makeDefaultTransport();
500 construct(shared_ptr<Transport> transport, KeyChain& keyChain);
503 onReceiveElement(
const Block& blockFromDaemon);
510 unique_ptr<boost::asio::io_service> m_internalIoService;
512 boost::asio::io_service& m_ioService;
514 shared_ptr<Transport> m_transport;
523 unique_ptr<KeyChain> m_internalKeyChain;
525 unique_ptr<nfd::Controller> m_nfdController;
528 shared_ptr<Impl> m_impl;
533 #endif // NDN_FACE_HPP
Copyright (c) 2013-2017 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.
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
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.
boost::asio::io_service & getIoService()
function< void(const InterestFilter &, const Interest &)> InterestCallback
Callback invoked when incoming Interest matches the specified InterestFilter.
function< void()> UnregisterPrefixSuccessCallback
Callback invoked when unregisterPrefix or unsetInterestFilter command succeeds.
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.
#define NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PROTECTED
function< void(const Interest &, const Data &)> DataCallback
Callback invoked when expressed Interest gets satisfied with a Data packet.
Exception thrown when attempting to send a packet over size limit.