NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.0: NDN, CCN, CCNx, content centric networks
API Documentation
nfd::Face Class Referenceabstract

represents a face More...

#include <face.hpp>

Inheritance diagram for nfd::Face:
Collaboration diagram for nfd::Face:

Classes

class  Impl
 
class  Error
 Face-related error. More...
 

Public Member Functions

 Face (const FaceUri &remoteUri, const FaceUri &localUri, bool isLocal=false, bool isMultiAccess=false)
 
virtual ~Face ()
 
virtual void sendInterest (const Interest &interest)=0
 send an Interest More...
 
virtual void sendData (const Data &data)=0
 send a Data More...
 
virtual void close ()=0
 Close the face. More...
 
FaceId getId () const
 
const std::string & getDescription () const
 Get the description. More...
 
void setDescription (const std::string &description)
 Set the face description. More...
 
void setMetric (uint64_t metric)
 
uint64_t getMetric () const
 
bool isLocal () const
 Get whether face is connected to a local app. More...
 
ndn::nfd::FacePersistency getPersistency () const
 Get the persistency setting. More...
 
bool isMultiAccess () const
 Get whether packets sent by this face may reach multiple peers. More...
 
virtual bool isUp () const
 Get whether underlying communication is up. More...
 
const FaceCountersgetCounters () const
 
const FaceUrigetRemoteUri () const
 
const FaceUrigetLocalUri () const
 
template<typename FaceTraits >
void copyStatusTo (FaceTraits &traits) const
 
virtual ndn::nfd::FaceStatus getFaceStatus () const
 

Public Attributes

signal::Signal< Face, InterestonReceiveInterest
 fires when an Interest is received More...
 
signal::Signal< Face, DataonReceiveData
 fires when a Data is received More...
 
signal::Signal< Face, InterestonSendInterest
 fires when an Interest is sent out More...
 
signal::Signal< Face, DataonSendData
 fires when a Data is sent out More...
 
signal::Signal< Face, std::string > onFail
 fires when face disconnects or fails to perform properly More...
 

Protected Member Functions

void setPersistency (ndn::nfd::FacePersistency persistency)
 
bool decodeAndDispatchInput (const Block &element)
 
void fail (const std::string &reason)
 fail the face and raise onFail event if it's UP; otherwise do nothing More...
 
FaceCountersgetMutableCounters ()
 

Friends

class FaceTable
 

Detailed Description

represents a face

Definition at line 57 of file face.hpp.

Constructor & Destructor Documentation

nfd::Face::Face ( const FaceUri remoteUri,
const FaceUri localUri,
bool  isLocal = false,
bool  isMultiAccess = false 
)
nfd::Face::~Face ( )
virtual

Definition at line 48 of file face.cpp.

Referenced by nfd::Face::Error::Error().

Member Function Documentation

const std::string & nfd::Face::getDescription ( ) const
inline

Get the description.

Definition at line 233 of file face.hpp.

void nfd::Face::setDescription ( const std::string &  description)
inline

Set the face description.

This is typically invoked by management on set description command

Definition at line 239 of file face.hpp.

bool nfd::Face::isLocal ( ) const
inline

Get whether face is connected to a local app.

Definition at line 245 of file face.hpp.

Referenced by nfd::compare_pickInterest(), copyStatusTo(), nfd::Face::Error::Error(), nfd::pit::Entry::violatesScope(), and nfd::Forwarder::~Forwarder().

ndn::nfd::FacePersistency nfd::Face::getPersistency ( ) const
inline

Get the persistency setting.

Definition at line 251 of file face.hpp.

Referenced by copyStatusTo(), nfd::UdpFace::getFaceStatus(), and nfd::UdpFace::UdpFace().

bool nfd::Face::isMultiAccess ( ) const
inline

Get whether packets sent by this face may reach multiple peers.

Definition at line 263 of file face.hpp.

Referenced by copyStatusTo(), and nfd::Face::Error::Error().

bool nfd::Face::isUp ( ) const
virtual

Get whether underlying communication is up.

In this base class this property is always true.

Definition at line 53 of file face.cpp.

const FaceCounters & nfd::Face::getCounters ( ) const
inline

Definition at line 269 of file face.hpp.

Referenced by getFaceStatus().

const FaceUri & nfd::Face::getRemoteUri ( ) const
inline
Returns
a FaceUri that represents the remote endpoint

Definition at line 281 of file face.hpp.

Referenced by copyStatusTo().

const FaceUri & nfd::Face::getLocalUri ( ) const
inline
Returns
a FaceUri that represents the local endpoint (NFD side)

Definition at line 287 of file face.hpp.

Referenced by copyStatusTo(), and nfd::operator<<().

template<typename FaceTraits >
void nfd::Face::copyStatusTo ( FaceTraits &  traits) const
ndn::nfd::FaceStatus nfd::Face::getFaceStatus ( ) const
virtual
Returns
FaceStatus data structure filled with the current Face status

Reimplemented in nfd::UdpFace.

Definition at line 118 of file face.cpp.

References copyStatusTo(), nfd::FaceCounters::copyTo(), and getCounters().

Referenced by nfd::UdpFace::getFaceStatus().

void nfd::Face::setPersistency ( ndn::nfd::FacePersistency  persistency)
inlineprotected

Definition at line 257 of file face.hpp.

Referenced by nfd::UdpFace::UdpFace(), and nfd::WebSocketFace::WebSocketFace().

bool nfd::Face::decodeAndDispatchInput ( const Block element)
protected
void nfd::Face::fail ( const std::string &  reason)
protected

fail the face and raise onFail event if it's UP; otherwise do nothing

Definition at line 87 of file face.cpp.

References onFail.

Referenced by nfd::NullFace::close(), nfd::WebSocketFace::close(), ns3::ndn::NetDeviceFace::close(), nfd::EthernetFace::close(), ns3::ndn::AppFace::close(), and nfd::Face::Impl::NfdFace::close().

FaceCounters & nfd::Face::getMutableCounters ( )
inlineprotected

Friends And Related Function Documentation

friend class FaceTable
friend

Definition at line 217 of file face.hpp.

Member Data Documentation

signal::Signal<Face, Interest> nfd::Face::onReceiveInterest
signal::Signal<Face, std::string> nfd::Face::onFail

fires when face disconnects or fails to perform properly

Definition at line 92 of file face.hpp.

Referenced by fail().


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