represents a face More...
#include <face.hpp>
Classes | |
class | Error |
Face-related error. More... | |
Public Member Functions | |
Face (const FaceUri &remoteUri, const FaceUri &localUri, bool isLocal=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 |
virtual void | setDescription (const std::string &description) |
Set the description. More... | |
virtual const std::string & | getDescription () const |
Get the description. More... | |
void | setMetric (uint64_t metric) |
uint64_t | getMetric () const |
bool | isLocal () const |
Get whether face is connected to a local app. More... | |
virtual bool | isMultiAccess () const |
Get whether packets sent this Face may reach multiple peers. More... | |
virtual bool | isUp () const |
Get whether underlying communication is up. More... | |
bool | isOnDemand () const |
Get whether face is created on demand or explicitly via FaceManagement protocol. More... | |
const FaceCounters & | getCounters () const |
const FaceUri & | getRemoteUri () const |
const FaceUri & | getLocalUri () const |
template<typename FaceTraits > | |
void | copyStatusTo (FaceTraits &traits) const |
virtual ndn::nfd::FaceStatus | getFaceStatus () const |
Public Attributes | |
EventEmitter< Interest > | onReceiveInterest |
fires when an Interest is received More... | |
EventEmitter< Data > | onReceiveData |
fires when a Data is received More... | |
EventEmitter< Interest > | onSendInterest |
fires when an Interest is sent out More... | |
EventEmitter< Data > | onSendData |
fires when a Data is sent out More... | |
EventEmitter< std::string > | onFail |
fires when face disconnects or fails to perform properly More... | |
Protected Member Functions | |
bool | decodeAndDispatchInput (const Block &element) |
FaceCounters & | getMutableCounters () |
void | setOnDemand (bool isOnDemand) |
void | fail (const std::string &reason) |
fail the face and raise onFail event if it's UP; otherwise do nothing More... | |
Friends | |
class | FaceTable |
nfd::Face::Face | ( | const FaceUri & | remoteUri, |
const FaceUri & | localUri, | ||
bool | isLocal = false |
||
) |
Definition at line 31 of file face.cpp.
References nfd::NetworkLayerCounters::getNInDatas(), nfd::NetworkLayerCounters::getNInInterests(), nfd::NetworkLayerCounters::getNOutDatas(), nfd::NetworkLayerCounters::getNOutInterests(), onReceiveData, onReceiveInterest, onSendData, and onSendInterest.
|
pure virtual |
Close the face.
This terminates all communication on the face and cause onFail() method event to be invoked
Implemented in ns3::ndn::AppFace, nfd::InternalFace, ns3::ndn::NetDeviceFace, and nfd::NullFace.
void nfd::Face::copyStatusTo | ( | FaceTraits & | traits | ) | const |
Definition at line 130 of file face.cpp.
References getId(), getLocalUri(), getRemoteUri(), isLocal(), and isOnDemand().
Referenced by getFaceStatus().
|
protected |
Definition at line 88 of file face.cpp.
References onReceiveData, and onReceiveInterest.
|
protected |
fail the face and raise onFail event if it's UP; otherwise do nothing
Definition at line 116 of file face.cpp.
References onFail.
Referenced by nfd::NullFace::close(), ns3::ndn::NetDeviceFace::close(), and ns3::ndn::AppFace::close().
|
inline |
Definition at line 222 of file face.hpp.
Referenced by getFaceStatus().
|
virtual |
|
virtual |
Definition at line 158 of file face.cpp.
References copyStatusTo(), nfd::FaceCounters::copyTo(), and getCounters().
FaceId nfd::Face::getId | ( | ) | const |
Definition at line 51 of file face.cpp.
Referenced by nfd::fw::BestRouteStrategy2::afterReceiveInterest(), nfd::fw::Strategy::beforeSatisfyInterest(), and copyStatusTo().
|
inline |
Definition at line 240 of file face.hpp.
Referenced by copyStatusTo(), and nfd::operator<<().
|
inlineprotected |
|
inline |
Definition at line 234 of file face.hpp.
Referenced by copyStatusTo().
|
inline |
Get whether face is connected to a local app.
Definition at line 216 of file face.hpp.
Referenced by copyStatusTo(), and nfd::pit::Entry::violatesScope().
|
virtual |
|
inline |
Get whether face is created on demand or explicitly via FaceManagement protocol.
Definition at line 252 of file face.hpp.
Referenced by copyStatusTo(), and setOnDemand().
|
virtual |
|
pure virtual |
send a Data
Implemented in nfd::InternalFace, and nfd::NullFace.
|
pure virtual |
send an Interest
Implemented in nfd::InternalFace, and nfd::NullFace.
|
virtual |
|
inline |
Definition at line 258 of file face.hpp.
Referenced by ns3::ndn::NetDeviceFace::NetDeviceFace().
|
inlineprotected |
Definition at line 246 of file face.hpp.
References isOnDemand().
EventEmitter<std::string> nfd::Face::onFail |
EventEmitter<Data> nfd::Face::onReceiveData |
fires when a Data is received
Definition at line 84 of file face.hpp.
Referenced by nfd::LocalFace::decodeAndDispatchInput(), decodeAndDispatchInput(), Face(), and nfd::InternalFace::put().
EventEmitter<Interest> nfd::Face::onReceiveInterest |
fires when an Interest is received
Definition at line 81 of file face.hpp.
Referenced by nfd::LocalFace::decodeAndDispatchInput(), decodeAndDispatchInput(), and Face().
EventEmitter<Data> nfd::Face::onSendData |
fires when a Data is sent out
Definition at line 90 of file face.hpp.
Referenced by Face(), ns3::ndn::NetDeviceFace::sendData(), nfd::InternalFace::sendData(), and ns3::ndn::AppFace::sendData().
EventEmitter<Interest> nfd::Face::onSendInterest |
fires when an Interest is sent out
Definition at line 87 of file face.hpp.
Referenced by Face(), ns3::ndn::NetDeviceFace::sendInterest(), ns3::ndn::AppFace::sendInterest(), and nfd::InternalFace::sendInterest().