ns3::Application Class Reference

The base class for all ns3 applications. More...

#include <application.h>

Inheritance diagram for ns3::Application:
Inheritance graph
[legend]
Collaboration diagram for ns3::Application:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 Application ()
virtual ~Application ()
void Start (const Time &startTime)
 Specify application start time.
void Start (const RandomVariable &startVariable)
 Specify application start time.
void Stop (const Time &stopTime)
 Specify application stop time.
void Stop (const RandomVariable &stopVariable)
 Specify application stop time.
Ptr< NodeGetNode () const
void SetNode (Ptr< Node > node)

Static Public Member Functions

static TypeId GetTypeId (void)
 This method returns the TypeId associated to ns3::Application.

Protected Member Functions

virtual void DoDispose (void)

Private Member Functions

virtual void StartApplication (void)
 Application specific startup code.
virtual void StopApplication (void)
 Application specific shutdown code.
void ScheduleStart (const Time &time)
void ScheduleStop (const Time &time)

Private Attributes

EventId m_startEvent
EventId m_stopEvent
Ptr< Nodem_node

Detailed Description

The base class for all ns3 applications.

Definition at line 61 of file application.h.


Constructor & Destructor Documentation

ns3::Application::Application (  ) 

Definition at line 48 of file application.cc.

ns3::Application::~Application (  )  [virtual]

Definition at line 52 of file application.cc.


Member Function Documentation

void ns3::Application::DoDispose ( void   )  [protected, virtual]

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.

Reimplemented from ns3::Object.

Reimplemented in ns3::OnOffApplication, ns3::PacketSink, ns3::UdpEchoClient, ns3::UdpEchoServer, and ns3::V4Ping.

Definition at line 56 of file application.cc.

References ns3::Simulator::Cancel(), m_node, m_startEvent, and m_stopEvent.

Ptr< Node > ns3::Application::GetNode ( void   )  const
TypeId ns3::Application::GetTypeId ( void   )  [static]

This method returns the TypeId associated to ns3::Application.

This object is accessible through the following paths with Config::Set and Config::Connect:

  • /NodeList/[i]/ApplicationList/[i]

No Attributes defined for this type.
No TraceSources defined for this type.

Reimplemented from ns3::Object.

Reimplemented in ns3::OnOffApplication, ns3::PacketSink, ns3::UdpEchoClient, ns3::UdpEchoServer, and ns3::V4Ping.

Definition at line 39 of file application.cc.

References ns3::TypeId::SetParent().

void ns3::Application::ScheduleStart ( const Time time  )  [private]

Definition at line 110 of file application.cc.

References m_startEvent, ns3::Simulator::Schedule(), and StartApplication().

Referenced by Start().

void ns3::Application::ScheduleStop ( const Time time  )  [private]

Definition at line 116 of file application.cc.

References m_stopEvent, ns3::Simulator::Schedule(), and StopApplication().

Referenced by Stop().

void ns3::Application::SetNode ( Ptr< Node node  ) 
Parameters:
node the node to which this Application object is attached.

Definition at line 93 of file application.cc.

References m_node.

void ns3::Application::Start ( const RandomVariable startVariable  ) 

Specify application start time.

Parameters:
startVariable the random variable to use to pick the real start time as a relative time, in units of seconds, relative to the current simulation time.

Definition at line 69 of file application.cc.

References ns3::RandomVariable::GetValue(), ScheduleStart(), and ns3::Seconds().

void ns3::Application::Start ( const Time startTime  ) 

Specify application start time.

Parameters:
startTime 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 64 of file application.cc.

References ScheduleStart().

void ns3::Application::StartApplication ( void   )  [private, virtual]

Application specific startup code.

The StartApplication method is called at the start time specifed by Start This method should be overridden by all or most application subclasses.

Reimplemented in ns3::OnOffApplication, ns3::PacketSink, ns3::UdpEchoClient, ns3::UdpEchoServer, and ns3::V4Ping.

Definition at line 100 of file application.cc.

Referenced by ScheduleStart().

void ns3::Application::Stop ( const RandomVariable stopVariable  ) 

Specify application stop time.

Parameters:
stopVariable the random variable to use to pick the real stop time, in units of seconds, relative to the current simulation time.

Definition at line 81 of file application.cc.

References ns3::RandomVariable::GetValue(), ScheduleStop(), and ns3::Seconds().

void ns3::Application::Stop ( const Time stopTime  ) 

Specify application stop time.

Parameters:
stopTime 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 76 of file application.cc.

References ScheduleStop().

void ns3::Application::StopApplication ( void   )  [private, virtual]

Application specific shutdown code.

The StopApplication method is called at the stop time specifed by Stop This method should be overridden by all or most application subclasses.

Reimplemented in ns3::OnOffApplication, ns3::PacketSink, ns3::UdpEchoClient, ns3::UdpEchoServer, and ns3::V4Ping.

Definition at line 104 of file application.cc.

Referenced by ScheduleStop().


Member Data Documentation

Definition at line 146 of file application.h.

Referenced by DoDispose(), GetNode(), and SetNode().

Definition at line 144 of file application.h.

Referenced by DoDispose(), and ScheduleStart().

Definition at line 145 of file application.h.

Referenced by DoDispose(), and ScheduleStop().


The documentation for this class was generated from the following files:
Generated on Thu Dec 3 14:11:59 2009 for NS-3 by  doxygen 1.6.3