Base class that all NDN applications should be derived from. More...
#include <ndn-app.hpp>
Public Types | |
typedef void(* | InterestTraceCallback) (shared_ptr< const Interest >, Ptr< App >, shared_ptr< Face >) |
typedef void(* | DataTraceCallback) (shared_ptr< const Data >, Ptr< App >, shared_ptr< Face >) |
typedef void(* | NackTraceCallback) (shared_ptr< const lp::Nack >, Ptr< App >, shared_ptr< Face >) |
Public Member Functions | |
App () | |
Default constructor. More... | |
virtual | ~App () |
uint32_t | GetId () const |
Get application ID (ID of applications face) More... | |
virtual void | OnInterest (shared_ptr< const Interest > interest) |
Method that will be called every time new Interest arrives. More... | |
virtual void | OnData (shared_ptr< const Data > data) |
Method that will be called every time new Data arrives. More... | |
virtual void | OnNack (shared_ptr< const lp::Nack > nack) |
Method that will be called every time new Nack arrives. More... | |
Static Public Member Functions | |
static TypeId | GetTypeId () |
Protected Member Functions | |
virtual void | DoInitialize () |
virtual void | DoDispose () |
virtual void | StartApplication () |
Called at time specified by Start. More... | |
virtual void | StopApplication () |
Called at time specified by Stop. More... | |
Protected Attributes | |
bool | m_active |
Flag to indicate that application is active (set by StartApplication and StopApplication) More... | |
shared_ptr< Face > | m_face |
AppLinkService * | m_appLink |
uint32_t | m_appId |
TracedCallback< shared_ptr< const Interest >, Ptr< App >, shared_ptr< Face > > | m_receivedInterests |
App-level trace of received Interests. More... | |
TracedCallback< shared_ptr< const Data >, Ptr< App >, shared_ptr< Face > > | m_receivedDatas |
App-level trace of received Data. More... | |
TracedCallback< shared_ptr< const lp::Nack >, Ptr< App >, shared_ptr< Face > > | m_receivedNacks |
App-level trace of received Nacks. More... | |
TracedCallback< shared_ptr< const Interest >, Ptr< App >, shared_ptr< Face > > | m_transmittedInterests |
App-level trace of transmitted Interests. More... | |
TracedCallback< shared_ptr< const Data >, Ptr< App >, shared_ptr< Face > > | m_transmittedDatas |
App-level trace of transmitted Data. More... | |
TracedCallback< shared_ptr< const lp::Nack >, Ptr< App >, shared_ptr< Face > > | m_transmittedNacks |
App-level trace of transmitted Nacks. More... | |
Base class that all NDN applications should be derived from.
The class implements virtual calls onInterest, onNack, and onData
ns3::ndn::App is accessible through the following paths with Config::Set and Config::Connect:
No Attributes are defined for this type.
Size of this type is 288 bytes (on a 64-bit architecture).
Definition at line 48 of file ndn-app.hpp.
typedef void(* ns3::ndn::App::InterestTraceCallback) (shared_ptr< const Interest >, Ptr< App >, shared_ptr< Face >) |
Definition at line 84 of file ndn-app.hpp.
typedef void(* ns3::ndn::App::DataTraceCallback) (shared_ptr< const Data >, Ptr< App >, shared_ptr< Face >) |
Definition at line 85 of file ndn-app.hpp.
typedef void(* ns3::ndn::App::NackTraceCallback) (shared_ptr< const lp::Nack >, Ptr< App >, shared_ptr< Face >) |
Definition at line 86 of file ndn-app.hpp.
ns3::ndn::App::App | ( | ) |
Default constructor.
Definition at line 70 of file ndn-app.cpp.
|
virtual |
Definition at line 77 of file ndn-app.cpp.
|
static |
Definition at line 37 of file ndn-app.cpp.
References m_receivedDatas, m_receivedInterests, m_receivedNacks, m_transmittedDatas, m_transmittedInterests, and m_transmittedNacks.
uint32_t ns3::ndn::App::GetId | ( | ) | const |
Get application ID (ID of applications face)
Definition at line 108 of file ndn-app.cpp.
References m_appId.
Referenced by ns3::ndn::ConsumerBatches::ConsumerBatches(), and ns3::ndn::Producer::OnInterest().
|
virtual |
Method that will be called every time new Interest arrives.
Reimplemented in ns3::ndn::Producer.
Definition at line 114 of file ndn-app.cpp.
References m_face, and m_receivedInterests.
Referenced by ns3::ndn::Producer::OnInterest(), and ns3::ndn::AppLinkService::~AppLinkService().
|
virtual |
Method that will be called every time new Data arrives.
Reimplemented in ns3::ndn::Consumer, ns3::ndn::ConsumerPcon, and ns3::ndn::ConsumerWindow.
Definition at line 121 of file ndn-app.cpp.
References m_face, and m_receivedDatas.
Referenced by ns3::ndn::Consumer::OnData(), and ns3::ndn::AppLinkService::~AppLinkService().
|
virtual |
Method that will be called every time new Nack arrives.
Reimplemented in ns3::ndn::Consumer.
Definition at line 128 of file ndn-app.cpp.
References m_face, and m_receivedNacks.
Referenced by ns3::ndn::Consumer::OnNack(), and ns3::ndn::AppLinkService::~AppLinkService().
|
protectedvirtual |
Definition at line 82 of file ndn-app.cpp.
References m_appId.
|
protectedvirtual |
Definition at line 97 of file ndn-app.cpp.
|
protectedvirtual |
Called at time specified by Start.
Reimplemented in ns3::ndn::Consumer, and ns3::ndn::Producer.
Definition at line 138 of file ndn-app.cpp.
References ndn::nfd::FACE_SCOPE_LOCAL, m_active, m_appLink, m_face, and nonstd::optional_lite::std11::move().
Referenced by ns3::ndn::Producer::StartApplication(), and ns3::ndn::Consumer::StartApplication().
|
protectedvirtual |
Called at time specified by Stop.
Reimplemented in ns3::ndn::Consumer, and ns3::ndn::Producer.
Definition at line 162 of file ndn-app.cpp.
References m_active, and m_face.
Referenced by ns3::ndn::Producer::StopApplication(), and ns3::ndn::Consumer::StopApplication().
|
protected |
Flag to indicate that application is active (set by StartApplication and StopApplication)
Definition at line 103 of file ndn-app.hpp.
Referenced by ns3::ndn::Consumer::OnData(), ns3::ndn::Producer::OnInterest(), ns3::ndn::ConsumerZipfMandelbrot::SendPacket(), ns3::ndn::Consumer::SendPacket(), StartApplication(), and StopApplication().
|
protected |
Definition at line 104 of file ndn-app.hpp.
Referenced by OnData(), ns3::ndn::Producer::OnInterest(), OnInterest(), OnNack(), ns3::ndn::ConsumerZipfMandelbrot::SendPacket(), ns3::ndn::Consumer::SendPacket(), ns3::ndn::Producer::StartApplication(), StartApplication(), and StopApplication().
|
protected |
Definition at line 105 of file ndn-app.hpp.
Referenced by ns3::ndn::Producer::OnInterest(), ns3::ndn::ConsumerZipfMandelbrot::SendPacket(), ns3::ndn::Consumer::SendPacket(), and StartApplication().
|
protected |
Definition at line 107 of file ndn-app.hpp.
Referenced by DoInitialize(), and GetId().
|
protected |
App-level trace of received Interests.
Definition at line 110 of file ndn-app.hpp.
Referenced by GetTypeId(), and OnInterest().
|
protected |
App-level trace of received Data.
Definition at line 113 of file ndn-app.hpp.
Referenced by GetTypeId(), and OnData().
|
protected |
App-level trace of received Nacks.
Definition at line 116 of file ndn-app.hpp.
Referenced by GetTypeId(), and OnNack().
|
protected |
App-level trace of transmitted Interests.
Definition at line 119 of file ndn-app.hpp.
Referenced by GetTypeId(), ns3::ndn::ConsumerZipfMandelbrot::SendPacket(), and ns3::ndn::Consumer::SendPacket().
|
protected |
App-level trace of transmitted Data.
Definition at line 122 of file ndn-app.hpp.
Referenced by GetTypeId(), and ns3::ndn::Producer::OnInterest().
|
protected |
App-level trace of transmitted Nacks.
Definition at line 125 of file ndn-app.hpp.
Referenced by GetTypeId().