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);
198 send(
const uint8_t *encoding,
size_t encodingLength);
218 static ptr_lib::shared_ptr<Transport>
219 getDefaultTransport(boost::asio::io_service& ioService);
221 static ptr_lib::shared_ptr<Transport::ConnectionInfo>
222 getDefaultConnectionInfo();
224 boost::asio::io_service& ioService_;
double Milliseconds
A time interval represented as the number of milliseconds.
Definition: common.hpp:112
Copyright (C) 2013-2016 Regents of the University of California.
Definition: common.hpp:36
Copyright (C) 2015-2016 Regents of the University of California.
Definition: threadsafe-face.hpp:27
func_lib::function< void(const ptr_lib::shared_ptr< const Name > &prefix, const ptr_lib::shared_ptr< const Interest > &interest, Face &face, uint64_t interestFilterId, const ptr_lib::shared_ptr< const InterestFilter > &filter)> OnInterestCallback
An OnInterestCallback function object is used to pass a callback to setInterestFilter and optionally ...
Definition: face.hpp:65
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 > &prefix, uint64_t registeredPrefixId)> 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
func_lib::function< void(const ptr_lib::shared_ptr< const Interest > &interest, const ptr_lib::shared_ptr< NetworkNack > &networkNack)> OnNetworkNack
An OnNetworkNack function object is used to pass a callback to expressInterest.
Definition: face.hpp:55
virtual void unsetInterestFilter(uint64_t interestFilterId)
Override to use the ioService given to the constructor to dispatch unsetInterestFilter to be called i...
virtual void shutdown()
Override to use the ioService given to the constructor to dispatch shutdown to be called in a thread-...
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
func_lib::function< void(const ptr_lib::shared_ptr< const Interest > &interest)> OnTimeout
An OnTimeout function object is used to pass a callback to expressInterest.
Definition: face.hpp:48
An Interest holds a Name and other fields for an interest.
Definition: interest.hpp:42
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:662
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 Interest > &interest, const ptr_lib::shared_ptr< Data > &data)> OnData
An OnData function object is used to pass a callback to expressInterest.
Definition: face.hpp:35
func_lib::function< void(const ptr_lib::shared_ptr< const Name > &prefix)> OnRegisterFailed
An OnRegisterFailed function object is used to report when registerPrefix fails.
Definition: face.hpp:71
virtual void removeRegisteredPrefix(uint64_t registeredPrefixId)
Override to use the ioService given to the constructor to dispatch removeRegisteredPrefix to be calle...
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 ...
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...