NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.5: 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  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

◆ Face()

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

◆ ~Face()

nfd::Face::~Face ( )
virtual

Definition at line 48 of file face.cpp.

Member Function Documentation

◆ sendInterest()

◆ sendData()

◆ close()

◆ getId()

◆ getDescription()

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

Get the description.

Definition at line 233 of file face.hpp.

◆ setDescription()

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.

◆ isLocal()

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 copyStatusTo(), and nfd::pit::Entry::violatesScope().

◆ getPersistency()

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

◆ isMultiAccess()

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().

◆ isUp()

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.

◆ getCounters()

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

Definition at line 269 of file face.hpp.

Referenced by getFaceStatus().

◆ getRemoteUri()

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().

◆ getLocalUri()

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::face::operator<<().

◆ copyStatusTo()

template<typename FaceTraits >
void nfd::Face::copyStatusTo ( FaceTraits &  traits) const

◆ getFaceStatus()

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().

◆ setPersistency()

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().

◆ decodeAndDispatchInput()

bool nfd::Face::decodeAndDispatchInput ( const Block element)
protected

◆ fail()

void nfd::Face::fail ( const std::string &  reason)
protected

◆ getMutableCounters()

Friends And Related Function Documentation

◆ FaceTable

friend class FaceTable
friend

Definition at line 217 of file face.hpp.

Member Data Documentation

◆ onReceiveInterest

signal::Signal<Face, Interest> nfd::Face::onReceiveInterest

fires when an Interest is received

Definition at line 80 of file face.hpp.

Referenced by nfd::LocalFace::decodeAndDispatchInput(), decodeAndDispatchInput(), and Face().

◆ onReceiveData

signal::Signal<Face, Data> nfd::Face::onReceiveData

fires when a Data is received

Definition at line 83 of file face.hpp.

Referenced by nfd::LocalFace::decodeAndDispatchInput(), decodeAndDispatchInput(), Face(), and nfd::InternalFace::put().

◆ onSendInterest

◆ onSendData

◆ onFail

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: