The base class for all ns3 applications. More...
#include <application.h>
Public Member Functions | |
Application () | |
virtual | ~Application () |
Ptr< Node > | GetNode () const |
void | SetNode (Ptr< Node > node) |
void | SetStartTime (Time start) |
Specify application start time. | |
void | SetStopTime (Time stop) |
Specify application stop time. | |
![]() | |
Object () | |
virtual | ~Object () |
void | AggregateObject (Ptr< Object > other) |
void | Dispose (void) |
AggregateIterator | GetAggregateIterator (void) const |
virtual TypeId | GetInstanceTypeId (void) const |
template<typename T > | |
Ptr< T > | GetObject (void) const |
template<typename T > | |
Ptr< T > | GetObject (TypeId tid) const |
void | Start (void) |
![]() | |
SimpleRefCount () | |
SimpleRefCount (const SimpleRefCount &o) | |
uint32_t | GetReferenceCount (void) const |
SimpleRefCount & | operator= (const SimpleRefCount &o) |
void | Ref (void) const |
void | Unref (void) const |
![]() | |
virtual | ~ObjectBase () |
void | GetAttribute (std::string name, AttributeValue &value) const |
bool | GetAttributeFailSafe (std::string name, AttributeValue &attribute) const |
void | SetAttribute (std::string name, const AttributeValue &value) |
bool | SetAttributeFailSafe (std::string name, const AttributeValue &value) |
bool | TraceConnect (std::string name, std::string context, const CallbackBase &cb) |
bool | TraceConnectWithoutContext (std::string name, const CallbackBase &cb) |
bool | TraceDisconnect (std::string name, std::string context, const CallbackBase &cb) |
bool | TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb) |
Static Public Member Functions | |
static TypeId | GetTypeId (void) |
This method returns the TypeId associated to ns3::Application. |
Protected Member Functions | |
virtual void | DoDispose (void) |
virtual void | DoStart (void) |
![]() | |
Object (const Object &o) | |
virtual void | NotifyNewAggregate (void) |
Protected Attributes | |
Ptr< Node > | m_node |
EventId | m_startEvent |
Time | m_startTime |
EventId | m_stopEvent |
Time | m_stopTime |
Private Member Functions | |
virtual void | StartApplication (void) |
Application specific startup code. | |
virtual void | StopApplication (void) |
Application specific shutdown code. |
The base class for all ns3 applications.
Definition at line 61 of file application.h.
ns3::Application::Application | ( | ) |
Definition at line 55 of file application.cc.
|
virtual |
Definition at line 60 of file application.cc.
|
protectedvirtual |
This method is called by Object::Dispose or by the object's destructor, whichever comes first.
Subclasses are expected to implement their real destruction code in an overriden version of this method and chain up to their parent's implementation once they are done. i.e., for simplicity, the destructor of every subclass should be empty and its content should be moved to the associated DoDispose method.
It is safe to call GetObject from within this method.
Reimplemented from ns3::Object.
Reimplemented in ns3::UdpEchoClient, ns3::OnOffApplication, ns3::UdpTraceClient, ns3::Ping6, ns3::PacketSink, ns3::Radvd, ns3::LteRadioBearerTagUdpClient, ns3::BulkSendApplication, ns3::UdpServer, ns3::UdpClient, ns3::EpcSgwPgwApplication, and ns3::UdpEchoServer.
Definition at line 77 of file application.cc.
|
protectedvirtual |
This method is called only once by Object::Start. If the user calls Object::Start multiple times, DoStart is called only the first time.
Subclasses are expected to override this method and chain up to their parent's implementation once they are done. It is safe to call GetObject and AggregateObject from within this method.
Reimplemented from ns3::Object.
Definition at line 86 of file application.cc.
References ns3::TimeStep().
Definition at line 96 of file application.cc.
Referenced by ns3::V4Ping::GetApplicationId(), ns3::V4Ping::Receive(), ns3::V4Ping::Send(), ns3::Ping6::Send(), ns3::Radvd::Send(), ns3::V4Ping::StartApplication(), ns3::UdpEchoServer::StartApplication(), ns3::UdpClient::StartApplication(), ns3::UdpServer::StartApplication(), ns3::BulkSendApplication::StartApplication(), ns3::LteRadioBearerTagUdpClient::StartApplication(), ns3::Ping6::StartApplication(), ns3::Radvd::StartApplication(), ns3::UdpTraceClient::StartApplication(), and ns3::UdpEchoClient::StartApplication().
|
static |
This method returns the TypeId associated to ns3::Application.
This object is accessible through the following paths with Config::Set and Config::Connect:
Attributes defined for this type:
No TraceSources defined for this type.
Reimplemented from ns3::Object.
Reimplemented in ns3::OnOffApplication, ns3::PacketSink, ns3::LteRadioBearerTagUdpClient, ns3::UdpTraceClient, ns3::Radvd, ns3::BulkSendApplication, ns3::Ping6, ns3::EpcSgwPgwApplication, ns3::EpcEnbApplication, ns3::UdpServer, ns3::UdpClient, ns3::UdpEchoServer, ns3::UdpEchoClient, and ns3::V4Ping.
Definition at line 38 of file application.cc.
References ns3::Seconds(), ns3::TypeId::SetParent(), and ns3::TimeStep().
node | the node to which this Application object is attached. |
Definition at line 102 of file application.cc.
Referenced by ns3::Node::AddApplication().
void ns3::Application::SetStartTime | ( | Time | start | ) |
Specify application start time.
start | Start time for this application, relative to the current simulation time. |
Applications start at various times in the simulation scenario. The Start method specifies when the application should be started. The application subclasses should override the private "StartApplication" method defined below, which is called at the time specified, to cause the application to begin.
Definition at line 65 of file application.cc.
References visualizer.core::start().
Referenced by Ns3TcpNoDelayTestCase::DoRun(), Ns3TcpSocketTestCase1::DoRun(), NscTcpLossTestCase1::DoRun(), Ns3TcpSocketTestCase2::DoRun(), NscTcpLossTestCase2::DoRun(), Ns3TcpCwndTestCase1::DoRun(), Ns3TcpCwndTestCase2::DoRun(), main(), and ns3::ApplicationContainer::Start().
void ns3::Application::SetStopTime | ( | Time | stop | ) |
Specify application stop time.
stop | Stop time for this application, relative to the current simulation time. |
Once an application has started, it is sometimes useful to stop the application. The Stop method specifies when an application is to stop. The application subclasses should override the private StopApplication method, to be notified when that time has come.
Definition at line 70 of file application.cc.
Referenced by Ns3TcpNoDelayTestCase::DoRun(), Ns3TcpSocketTestCase1::DoRun(), NscTcpLossTestCase1::DoRun(), Ns3TcpSocketTestCase2::DoRun(), NscTcpLossTestCase2::DoRun(), Ns3TcpCwndTestCase1::DoRun(), Ns3TcpCwndTestCase2::DoRun(), main(), and ns3::ApplicationContainer::Stop().
|
privatevirtual |
Application specific startup code.
The StartApplication method is called at the start time specified by Start This method should be overridden by all or most application subclasses.
Definition at line 109 of file application.cc.
|
privatevirtual |
Application specific shutdown code.
The StopApplication method is called at the stop time specified by Stop This method should be overridden by all or most application subclasses.
Definition at line 113 of file application.cc.
Definition at line 126 of file application.h.
|
protected |
Definition at line 129 of file application.h.
|
protected |
Definition at line 127 of file application.h.
|
protected |
Definition at line 130 of file application.h.
|
protected |
Definition at line 128 of file application.h.