22 #ifndef NDN_THREADSAFE_FACE_HPP
23 #define NDN_THREADSAFE_FACE_HPP
27 namespace boost {
namespace asio {
class io_service; }}
52 (boost::asio::io_service& ioService,
53 const ptr_lib::shared_ptr<Transport>& transport,
54 const ptr_lib::shared_ptr<const Transport::ConnectionInfo>& connectionInfo);
66 (boost::asio::io_service& ioService,
const char *host,
67 unsigned short port = 6363);
146 (prefix, onInterest, onRegisterFailed, flags, wireFormat);
171 (prefix, onInterest, onRegisterFailed, flags, wireFormat);
212 send(
const uint8_t *encoding,
size_t encodingLength);
225 static ptr_lib::shared_ptr<Transport>
226 getDefaultTransport(boost::asio::io_service& ioService);
228 static ptr_lib::shared_ptr<Transport::ConnectionInfo>
229 getDefaultConnectionInfo();
231 boost::asio::io_service& ioService_;
func_lib::function< void(const ptr_lib::shared_ptr< const Interest > &)> OnTimeout
An OnTimeout function object is used to pass a callback to expressInterest.
Definition: face.hpp:46
double Milliseconds
A time interval represented as the number of milliseconds.
Definition: common.hpp:111
Copyright (C) 2013-2016 Regents of the University of California.
Definition: common.hpp:35
func_lib::function< void(const ptr_lib::shared_ptr< const Name > &, const ptr_lib::shared_ptr< const Interest > &, Transport &, uint64_t)> OnInterest
Definition: face.hpp:58
Copyright (C) 2015-2016 Regents of the University of California.
Definition: threadsafe-face.hpp:27
The Face class provides the main methods for NDN communication.
Definition: face.hpp:86
A ForwardingFlags object holds the flags which specify how the forwarding daemon should forward an in...
Definition: forwarding-flags.hpp:35
virtual void removePendingInterest(uint64_t pendingInterestId)
Override to use the ioService given to the constructor to dispatch removePendingInterest to be called...
func_lib::function< void(const ptr_lib::shared_ptr< const Name > &, uint64_t)> OnRegisterSuccess
An OnRegisterSuccess function object is used to report when registerPrefix succeeds.
Definition: face.hpp:78
virtual uint64_t expressInterest(const Interest &interest, const OnData &onData, const OnTimeout &onTimeout, const OnNetworkNack &onNetworkNack, WireFormat &wireFormat=*WireFormat::getDefaultWireFormat())
Send the Interest through the transport, read the entire response and call onData, onTimeout or onNetworkNack as described below.
Definition: face.cpp:101
virtual void unsetInterestFilter(uint64_t interestFilterId)
Override to use the ioService given to the constructor to dispatch unsetInterestFilter to be called i...
ThreadsafeFace(boost::asio::io_service &ioService, const ptr_lib::shared_ptr< Transport > &transport, const ptr_lib::shared_ptr< const Transport::ConnectionInfo > &connectionInfo)
Create a new Face for communication with an NDN hub with the given Transport object and connectionInf...
A Name holds an array of Name::Component and represents an NDN name.
Definition: name.hpp:40
An Interest holds a Name and other fields for an interest.
Definition: interest.hpp:41
virtual uint64_t setInterestFilter(const InterestFilter &filter, const OnInterestCallback &onInterest)
Override to use the ioService given to the constructor to dispatch setInterestFilter to be called in ...
func_lib::function< void()> Callback
Face::Callback is used internally in callLater.
Definition: face.hpp:674
virtual void callLater(Milliseconds delayMilliseconds, const Callback &callback)
Override to call callback() after the given delay, using a basic_deadline_timer with the ioService gi...
virtual uint64_t registerPrefix(const Name &prefix, const OnInterestCallback &onInterest, const OnRegisterFailed &onRegisterFailed, const OnRegisterSuccess &onRegisterSuccess, const ForwardingFlags &flags=ForwardingFlags(), WireFormat &wireFormat=*WireFormat::getDefaultWireFormat())
Override to use the ioService given to the constructor to dispatch registerPrefix to be called in a t...
func_lib::function< void(const ptr_lib::shared_ptr< const Name > &, const ptr_lib::shared_ptr< const Interest > &, Face &, uint64_t, const ptr_lib::shared_ptr< const InterestFilter > &)> OnInterestCallback
An OnInterestCallback function object is used to pass a callback to setInterestFilter and optionally ...
Definition: face.hpp:67
virtual void removeRegisteredPrefix(uint64_t registeredPrefixId)
Override to use the ioService given to the constructor to dispatch removeRegisteredPrefix to be calle...
func_lib::function< void(const ptr_lib::shared_ptr< const Name > &)> OnRegisterFailed
An OnRegisterFailed function object is used to report when registerPrefix fails.
Definition: face.hpp:72
An InterestFilter holds a Name prefix and optional regex match expression for use in Face::setInteres...
Definition: interest-filter.hpp:33
virtual uint64_t registerPrefix(const Name &prefix, const OnInterestCallback &onInterest, const OnRegisterFailed &onRegisterFailed, const OnRegisterSuccess &onRegisterSuccess, const ForwardingFlags &flags=ForwardingFlags(), WireFormat &wireFormat=*WireFormat::getDefaultWireFormat())
Register prefix with the connected NDN hub and call onInterest when a matching interest is received...
Definition: face.cpp:145
virtual uint64_t expressInterest(const Interest &interest, const OnData &onData, const OnTimeout &onTimeout, const OnNetworkNack &onNetworkNack, WireFormat &wireFormat=*WireFormat::getDefaultWireFormat())
Override to use the ioService given to the constructor to dispatch expressInterest to be called in a ...
func_lib::function< void(const ptr_lib::shared_ptr< const Interest > &, const ptr_lib::shared_ptr< Data > &)> OnData
An OnData function object is used to pass a callback to expressInterest.
Definition: face.hpp:35
A ThreadsafeFace extends Face to use a Boost asio io_service to process events and schedule communica...
Definition: threadsafe-face.hpp:37
virtual void send(const uint8_t *encoding, size_t encodingLength)
Override to use the ioService given to the constructor to dispatch send to be called in a thread-safe...
func_lib::function< void(const ptr_lib::shared_ptr< const Interest > &, const ptr_lib::shared_ptr< NetworkNack > &)> OnNetworkNack
An OnNetworkNack function object is used to pass a callback to expressInterest.
Definition: face.hpp:52