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 >) |
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... | |
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< AppFace > | m_face |
automatically created application face through which application communicates More... | |
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 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... | |
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 232 bytes (on a 64-bit architecture).
Definition at line 47 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.
ns3::ndn::App::App | ( | ) |
Default constructor.
Definition at line 61 of file ndn-app.cpp.
|
virtual |
Definition at line 68 of file ndn-app.cpp.
|
static |
Definition at line 36 of file ndn-app.cpp.
References m_receivedDatas, m_receivedInterests, m_transmittedDatas, and m_transmittedInterests.
uint32_t ns3::ndn::App::GetId | ( | ) | const |
Get application ID (ID of applications face)
Definition at line 99 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.
interest | Interest header |
packet | "Payload" of the interests packet. The actual payload should be zero, but packet itself may be useful to get packet tags |
Reimplemented in ns3::ndn::Producer.
Definition at line 105 of file ndn-app.cpp.
References m_face, and m_receivedInterests.
Referenced by ns3::ndn::Producer::OnInterest(), and ns3::ndn::AppFace::sendInterest().
|
virtual |
Method that will be called every time new Data arrives.
contentObject | Data header |
payload | payload (potentially virtual) of the Data packet (may include packet tags of original packet) |
Reimplemented in ns3::ndn::Consumer, and ns3::ndn::ConsumerWindow.
Definition at line 112 of file ndn-app.cpp.
References m_face, and m_receivedDatas.
Referenced by ns3::ndn::Consumer::OnData(), and ns3::ndn::AppFace::sendData().
|
protectedvirtual |
Definition at line 73 of file ndn-app.cpp.
References m_appId.
|
protectedvirtual |
Definition at line 88 of file ndn-app.cpp.
|
protectedvirtual |
Called at time specified by Start.
Reimplemented in ns3::ndn::Consumer, and ns3::ndn::Producer.
Definition at line 120 of file ndn-app.cpp.
References m_active, and m_face.
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 138 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 102 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 |
automatically created application face through which application communicates
Definition at line 103 of file ndn-app.hpp.
Referenced by OnData(), ns3::ndn::Producer::OnInterest(), OnInterest(), ns3::ndn::ConsumerZipfMandelbrot::SendPacket(), ns3::ndn::Consumer::SendPacket(), ns3::ndn::Producer::StartApplication(), StartApplication(), and StopApplication().
|
protected |
Definition at line 104 of file ndn-app.hpp.
Referenced by DoInitialize(), and GetId().
|
protected |
App-level trace of received Interests.
Definition at line 107 of file ndn-app.hpp.
Referenced by GetTypeId(), and OnInterest().
|
protected |
App-level trace of received Data.
Definition at line 110 of file ndn-app.hpp.
Referenced by GetTypeId(), and OnData().
|
protected |
App-level trace of transmitted Interests.
Definition at line 113 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 116 of file ndn-app.hpp.
Referenced by GetTypeId(), and ns3::ndn::Producer::OnInterest().