All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
Public Types | Public Member Functions | Public Attributes | List of all members
ValidatorFixture::TestFace Class Reference

TestFace extends Face to instantly simulate a call to expressInterest. More...

#include <validator-fixture.hpp>

Inheritance diagram for ValidatorFixture::TestFace:
ndn::Face

Public Types

typedef
ndn::func_lib::function< void(const
ndn::Interest &interest, const
ndn::OnData &onData, const
ndn::OnTimeout &onTimeout,
const ndn::OnNetworkNack
&onNetworkNack)> 
ProcessInterest
 
- Public Types inherited from ndn::Face
typedef func_lib::function< void()> Callback
 Face::Callback is used internally in callLater.
 

Public Member Functions

virtual uint64_t expressInterest (const ndn::Interest &interest, const ndn::OnData &onData, const ndn::OnTimeout &onTimeout, const ndn::OnNetworkNack &onNetworkNack, ndn::WireFormat &wireFormat=*ndn::WireFormat::getDefaultWireFormat())
 If processInterest_ is not null, call processInterest_(interest, onData, onTimeout, onNetworkNack) which must call one of the callbacks to simulate the response. More...
 
- Public Member Functions inherited from ndn::Face
 Face (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 connectionInfo. More...
 
 Face (const char *host, unsigned short port=6363)
 Create a new Face for communication with an NDN hub at host:port using the default TcpTransport. More...
 
 Face ()
 Create a new Face for communication with an NDN hub using a default connection as follows. More...
 
virtual uint64_t expressInterest (const Name &name, const Interest *interestTemplate, const OnData &onData, const OnTimeout &onTimeout, const OnNetworkNack &onNetworkNack, WireFormat &wireFormat=*WireFormat::getDefaultWireFormat())
 Encode name as an Interest. More...
 
uint64_t expressInterest (const Name &name, const OnData &onData, const OnTimeout &onTimeout, const OnNetworkNack &onNetworkNack, WireFormat &wireFormat=*WireFormat::getDefaultWireFormat())
 Encode name as an Interest, using a default interest lifetime. More...
 
uint64_t expressInterest (const Interest &interest, const OnData &onData, const OnTimeout &onTimeout=OnTimeout(), WireFormat &wireFormat=*WireFormat::getDefaultWireFormat())
 Send the Interest through the transport, read the entire response and call onData or onTimeout as described below. More...
 
uint64_t expressInterest (const Name &name, const Interest *interestTemplate, const OnData &onData, const OnTimeout &onTimeout=OnTimeout(), WireFormat &wireFormat=*WireFormat::getDefaultWireFormat())
 Encode name as an Interest. More...
 
uint64_t expressInterest (const Name &name, const OnData &onData, const OnTimeout &onTimeout=OnTimeout(), WireFormat &wireFormat=*WireFormat::getDefaultWireFormat())
 Encode name as an Interest, using a default interest lifetime. More...
 
virtual void removePendingInterest (uint64_t pendingInterestId)
 Remove the pending interest entry with the pendingInterestId from the pending interest table. More...
 
void setCommandSigningInfo (KeyChain &keyChain, const Name &certificateName)
 Set the KeyChain and certificate name used to sign command interests (e.g. More...
 
void setCommandCertificateName (const Name &certificateName)
 Set the certificate name used to sign command interest (e.g. More...
 
KeyChaingetCommandKeyChain ()
 
const NamegetCommandCertificateName ()
 
virtual void makeCommandInterest (Interest &interest, WireFormat &wireFormat=*WireFormat::getDefaultWireFormat())
 Append a timestamp component and a random value component to interest's name. More...
 
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. More...
 
uint64_t registerPrefix (const Name &prefix, const OnInterestCallback &onInterest, const OnRegisterFailed &onRegisterFailed, const ForwardingFlags &flags, WireFormat &wireFormat=*WireFormat::getDefaultWireFormat())
 Register prefix with the connected NDN hub and call onInterest when a matching interest is received. More...
 
uint64_t registerPrefix (const Name &prefix, const OnInterestCallback &onInterest, const OnRegisterFailed &onRegisterFailed)
 Register prefix with the connected NDN hub and call onInterest when a matching interest is received. More...
 
virtual void removeRegisteredPrefix (uint64_t registeredPrefixId)
 Remove the registered prefix entry with the registeredPrefixId from the registered prefix table. More...
 
virtual uint64_t setInterestFilter (const InterestFilter &filter, const OnInterestCallback &onInterest)
 Add an entry to the local interest filter table to call the onInterest callback for a matching incoming Interest. More...
 
virtual uint64_t setInterestFilter (const Name &prefix, const OnInterestCallback &onInterest)
 Add an entry to the local interest filter table to call the onInterest callback for a matching incoming Interest. More...
 
virtual void unsetInterestFilter (uint64_t interestFilterId)
 Remove the interest filter entry which has the interestFilterId from the interest filter table. More...
 
virtual void putData (const Data &data, WireFormat &wireFormat=*WireFormat::getDefaultWireFormat())
 The OnInterestCallback calls this to put a Data packet which satisfies an Interest. More...
 
void send (const Blob &encoding)
 Send the encoded packet out through the face. More...
 
virtual void send (const uint8_t *encoding, size_t encodingLength)
 Send the encoded packet out through the face. More...
 
void processEvents ()
 Process any packets to receive and call callbacks such as onData, onInterest or onTimeout. More...
 
virtual bool isLocal ()
 Check if the face is local based on the current connection through the Transport; some Transport may cause network I/O (e.g. More...
 
virtual void shutdown ()
 Shut down and disconnect this Face.
 
virtual void callLater (Milliseconds delayMilliseconds, const Callback &callback)
 Call callback() after the given delay. More...
 

Public Attributes

ProcessInterest processInterest_
 
std::vector< ndn::InterestsentInterests_
 

Additional Inherited Members

- Static Public Member Functions inherited from ndn::Face
static size_t getMaxNdnPacketSize ()
 Get the practical limit of the size of a network-layer packet. More...
 
- Static Protected Member Functions inherited from ndn::Face
static std::string getUnixSocketFilePathForLocalhost ()
 If the forwarder's Unix socket file path exists, then return the file path. More...
 
static ptr_lib::shared_ptr
< const Interest
getInterestCopy (const Name &name, const Interest *interestTemplate)
 Do the work of expressInterest to make an Interest based on name and interestTemplate. More...
 
- Protected Attributes inherited from ndn::Face
Nodenode_
 
KeyChaincommandKeyChain_
 
Name commandCertificateName_
 

Detailed Description

TestFace extends Face to instantly simulate a call to expressInterest.

See expressInterest for details.

Member Function Documentation

uint64_t ValidatorFixture::TestFace::expressInterest ( const ndn::Interest interest,
const ndn::OnData onData,
const ndn::OnTimeout onTimeout,
const ndn::OnNetworkNack onNetworkNack,
ndn::WireFormat wireFormat = *ndn::WireFormat::getDefaultWireFormat() 
)
virtual

If processInterest_ is not null, call processInterest_(interest, onData, onTimeout, onNetworkNack) which must call one of the callbacks to simulate the response.

Otherwise, just call onTimeout(interest) to simulate a timeout. This adds the interest to sentInterests_ .

Reimplemented from ndn::Face.


The documentation for this class was generated from the following files: