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);
163 Face(boost::asio::io_service& ioService);
172 Face(
const std::string& host,
const std::string& port =
"6363");
186 Face(shared_ptr<Transport> transport,
KeyChain& keyChain);
201 Face(shared_ptr<Transport> transport, boost::asio::io_service& ioService);
217 Face(shared_ptr<Transport> transport, boost::asio::io_service& ioService,
KeyChain& keyChain);
235 expressInterest(
const Interest& interest,
236 const DataCallback& afterSatisfied,
237 const NackCallback& afterNacked,
238 const TimeoutCallback& afterTimeout);
244 removeAllPendingInterests();
250 getNPendingInterests()
const;
273 setInterestFilter(
const InterestFilter& filter,
const InterestCallback& onInterest,
274 const RegisterPrefixFailureCallback& onFailure,
299 setInterestFilter(
const InterestFilter& filter,
const InterestCallback& onInterest,
300 const RegisterPrefixSuccessCallback& onSuccess,
301 const RegisterPrefixFailureCallback& onFailure,
318 setInterestFilter(
const InterestFilter& filter,
const InterestCallback& onInterest);
338 registerPrefix(
const Name& prefix,
339 const RegisterPrefixSuccessCallback& onSuccess,
340 const RegisterPrefixFailureCallback& onFailure,
398 bool keepThread =
false)
400 this->doProcessEvents(timeout, keepThread);
422 boost::asio::io_service&
432 shared_ptr<Transport>
440 doProcessEvents(time::milliseconds timeout,
bool keepThread);
446 shared_ptr<Transport>
447 makeDefaultTransport();
453 construct(shared_ptr<Transport> transport,
KeyChain& keyChain);
456 onReceiveElement(
const Block& blockFromDaemon);
460 unique_ptr<boost::asio::io_service> m_internalIoService;
462 boost::asio::io_service& m_ioService;
464 shared_ptr<Transport> m_transport;
473 unique_ptr<KeyChain> m_internalKeyChain;
476 shared_ptr<Impl> m_impl;
529 unregister(
const UnregisterPrefixSuccessCallback& onSuccess =
nullptr,
530 const UnregisterPrefixFailureCallback& onFailure =
nullptr);
537 const UnregisterPrefixSuccessCallback& onSuccess,
538 const UnregisterPrefixFailureCallback& onFailure);
541 weak_ptr<Face::Impl> m_weakImpl;
596 #endif // NDN_FACE_HPP
The interface of signing key management.
function< void(const std::string &)> UnregisterPrefixFailureCallback
Callback invoked when unregistering a prefix fails.
declares the set of Interests a producer can serve, which starts with a name prefix, plus an optional regular expression
shared_ptr< Transport > getTransport() const
Returns the underlying transport.
Represents a TLV element of the NDN packet format.
Represents an Interest packet.
Signing parameters passed to KeyChain.
represents a Network Nack
Handle for a 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()
Returns a reference to the io_service used by this face.
function< void(const InterestFilter &, const Interest &)> InterestCallback
Callback invoked when an incoming Interest matches the specified InterestFilter.
RegisteredPrefixHandle() noexcept
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.