39 class PendingInterestId;
40 class PendingInterestHandle;
41 class RegisteredPrefixId;
42 class RegisteredPrefixHandle;
43 class InterestFilterId;
44 class InterestFilterHandle;
96 class Error :
public std::runtime_error
99 using std::runtime_error::runtime_error;
135 Face(shared_ptr<Transport> transport =
nullptr);
180 Face(shared_ptr<Transport> transport,
KeyChain& keyChain);
415 bool keepThread =
false)
449 shared_ptr<Transport>
460 shared_ptr<Transport>
461 makeDefaultTransport();
468 construct(shared_ptr<Transport> transport,
KeyChain& keyChain);
471 onReceiveElement(
const Block& blockFromDaemon);
477 shared_ptr<Transport> m_transport;
479 unique_ptr<nfd::Controller> m_nfdController;
482 shared_ptr<Impl> m_impl;
504 operator const PendingInterestId*()
const noexcept
510 const PendingInterestId* m_id =
nullptr;
545 operator const RegisteredPrefixId*()
const noexcept
562 Face* m_face =
nullptr;
563 const RegisteredPrefixId* m_id =
nullptr;
606 operator const InterestFilterId*()
const noexcept
612 const InterestFilterId* m_id =
nullptr;
636 #endif // NDN_FACE_HPP
Copyright (c) 2011-2015 Regents of the University of California.
virtual void doProcessEvents(time::milliseconds timeout, bool keepThread)
The interface of signing key management.
function< void(const std::string &)> UnregisterPrefixFailureCallback
Callback invoked when unregisterPrefix or unsetInterestFilter command fails.
void unregister(const UnregisterPrefixSuccessCallback &onSuccess=nullptr, const UnregisterPrefixFailureCallback &onFailure=nullptr)
Unregister the prefix.
implementation detail of Face
declares the set of Interests a producer can serve, which starts with a name prefix,...
DummyIoService & getIoService()
Represents a TLV element of NDN packet format.
Represents an Interest packet.
Signing parameters passed to KeyChain.
void unregisterPrefix(const RegisteredPrefixId *registeredPrefixId, const UnregisterPrefixSuccessCallback &onSuccess, const UnregisterPrefixFailureCallback &onFailure)
Unregister prefix from RIB.
#define NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PROTECTED
represents a Network Nack
void removeAllPendingInterests()
Cancel all previously expressed Interests.
RegisteredPrefixHandle registerPrefix(const Name &prefix, const RegisterPrefixSuccessCallback &onSuccess, const RegisterPrefixFailureCallback &onFailure, const security::SigningInfo &signingInfo=security::SigningInfo(), uint64_t flags=nfd::ROUTE_FLAG_CHILD_INHERIT)
Register prefix with the connected NDN forwarder.
Copyright (c) 2011-2015 Regents of the University of California.
A handle of pending Interest.
size_t getNPendingInterests() const
Get number of pending Interests.
void shutdown()
Shutdown face operations.
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.
void unsetInterestFilter(const RegisteredPrefixId *registeredPrefixId)
Remove the registered prefix entry with the registeredPrefixId.
PendingInterestHandle expressInterest(const Interest &interest, const DataCallback &afterSatisfied, const NackCallback &afterNacked, const TimeoutCallback &afterTimeout)
Express Interest.
function< void(const InterestFilter &, const Interest &)> InterestCallback
Callback invoked when incoming Interest matches the specified InterestFilter.
RegisteredPrefixHandle() noexcept
InterestFilterHandle() noexcept=default
Handle to cancel an operation.
function< void()> UnregisterPrefixSuccessCallback
Callback invoked when unregisterPrefix or unsetInterestFilter command succeeds.
void put(Data data)
Publish data packet.
OversizedPacketError(char pktType, const Name &name, size_t wireSize)
Constructor.
A handle of registered Interest filter.
PendingInterestHandle() noexcept=default
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.
RegisteredPrefixHandle setInterestFilter(const InterestFilter &interestFilter, const InterestCallback &onInterest, const RegisterPrefixFailureCallback &onFailure, const security::SigningInfo &signingInfo=security::SigningInfo(), uint64_t flags=nfd::ROUTE_FLAG_CHILD_INHERIT)
Set InterestFilter to dispatch incoming matching interest to onInterest callback and register the fil...
Face(shared_ptr< Transport > transport=nullptr)
Create Face using given transport (or default transport if omitted)
A handle of registered prefix.
function< void(const Interest &, const Data &)> DataCallback
Callback invoked when expressed Interest gets satisfied with a Data packet.
void removePendingInterest(const PendingInterestId *pendingInterestId)
Cancel previously expressed Interest.
Cancels an operation automatically upon destruction.
Exception thrown when attempting to send a packet over size limit.