holds a vector of ns3::Application pointers. More...
#include "application-container.h"
Public Types | |
typedef std::vector< Ptr< Application > >::const_iterator | Iterator |
Application container iterator. More... | |
Public Member Functions | |
ApplicationContainer () | |
Create an empty ApplicationContainer. More... | |
ApplicationContainer (Ptr< Application > application) | |
Create an ApplicationContainer with exactly one application which has been previously instantiated. More... | |
ApplicationContainer (std::string name) | |
Create an ApplicationContainer with exactly one application which has been previously instantiated and assigned a name using the Object Name Service. More... | |
void | Add (ApplicationContainer other) |
Append the contents of another ApplicationContainer to the end of this container. More... | |
void | Add (Ptr< Application > application) |
Append a single Ptr<Application> to this container. More... | |
void | Add (std::string name) |
Append to this container the single Ptr<Application> referred to via its object name service registered name. More... | |
Iterator | Begin () const |
Get an iterator which refers to the first Application in the container. More... | |
Iterator | End () const |
Get an iterator which indicates past-the-last Application in the container. More... | |
Ptr< Application > | Get (uint32_t i) const |
Get the Ptr<Application> stored in this container at a given index. More... | |
uint32_t | GetN () const |
Get the number of Ptr<Application> stored in this container. More... | |
void | Start (Time start) const |
Start all of the Applications in this container at the start time given as a parameter. More... | |
void | StartWithJitter (Time start, Ptr< RandomVariableStream > rv) const |
Start all of the Applications in this container at the start time given as a parameter, plus some jitter. More... | |
void | Stop (Time stop) const |
Arrange for all of the Applications in this container to Stop() at the Time given as a parameter. More... | |
Private Attributes | |
std::vector< Ptr< Application > > | m_applications |
Applications smart pointers. More... | |
holds a vector of ns3::Application pointers.
Typically ns-3 Applications are installed on nodes using an Application helper. The helper Install method takes a NodeContainer which holds some number of Ptr<Node>. For each of the Nodes in the NodeContainer the helper will instantiate an application, install it in a node and add a Ptr<Application> to that application into a Container for use by the caller. This is that container used to hold the Ptr<Application> which are instantiated by the Application helper.
Definition at line 43 of file application-container.h.
typedef std::vector<Ptr<Application> >::const_iterator ns3::ApplicationContainer::Iterator |
Application container iterator.
Definition at line 70 of file application-container.h.
ns3::ApplicationContainer::ApplicationContainer | ( | ) |
Create an empty ApplicationContainer.
Definition at line 30 of file application-container.cc.
ns3::ApplicationContainer::ApplicationContainer | ( | Ptr< Application > | application | ) |
Create an ApplicationContainer with exactly one application which has been previously instantiated.
The single application is specified by a smart pointer.
application | The Ptr<Application> to add to the container. |
Definition at line 34 of file application-container.cc.
References openflow-switch::app, and m_applications.
ns3::ApplicationContainer::ApplicationContainer | ( | std::string | name | ) |
Create an ApplicationContainer with exactly one application which has been previously instantiated and assigned a name using the Object Name Service.
This Application is then specified by its assigned name.
name | The name of the Application Object to add to the container. |
Definition at line 39 of file application-container.cc.
References openflow-switch::app, and m_applications.
void ns3::ApplicationContainer::Add | ( | ApplicationContainer | other | ) |
Append the contents of another ApplicationContainer to the end of this container.
other | The ApplicationContainer to append. |
Definition at line 70 of file application-container.cc.
References Begin(), End(), and m_applications.
Referenced by BuildAppsTest(), EpcS1uUlTestCase::DoRun(), LteRadioLinkFailureTestCase::DoRun(), CsmaStarTestCase::DoRun(), experiment(), LteAggregationThroughputScaleTestCase::GetThroughput(), ns3::UdpServerHelper::Install(), ns3::UdpClientHelper::Install(), ns3::UdpTraceClientHelper::Install(), ns3::BulkSendHelper::Install(), ns3::OnOffHelper::Install(), ns3::PacketSinkHelper::Install(), ns3::ThreeGppHttpClientHelper::Install(), ns3::ThreeGppHttpServerHelper::Install(), ns3::UdpEchoServerHelper::Install(), ns3::UdpEchoClientHelper::Install(), ns3::PingHelper::Install(), ns3::V4TraceRouteHelper::Install(), ns3::RadvdHelper::Install(), ns3::DhcpHelper::InstallDhcpClient(), ns3::QKDAppHelper::InstallPostProcessing(), and ns3::QKDAppHelper::InstallQKDApp().
void ns3::ApplicationContainer::Add | ( | Ptr< Application > | application | ) |
Append a single Ptr<Application> to this container.
application | The Ptr<Application> to append. |
Definition at line 79 of file application-container.cc.
References m_applications.
void ns3::ApplicationContainer::Add | ( | std::string | name | ) |
Append to this container the single Ptr<Application> referred to via its object name service registered name.
name | The name of the Application Object to add to the container. |
Definition at line 85 of file application-container.cc.
References m_applications.
ApplicationContainer::Iterator ns3::ApplicationContainer::Begin | ( | ) | const |
Get an iterator which refers to the first Application in the container.
Applications can be retrieved from the container in two ways. First, directly by an index into the container, and second, using an iterator. This method is used in the iterator method and is typically used in a for-loop to run through the Applications
Definition at line 46 of file application-container.cc.
References m_applications.
Referenced by Add(), Start(), StartWithJitter(), and Stop().
ApplicationContainer::Iterator ns3::ApplicationContainer::End | ( | ) | const |
Get an iterator which indicates past-the-last Application in the container.
Applications can be retrieved from the container in two ways. First, directly by an index into the container, and second, using an iterator. This method is used in the iterator method and is typically used in a for-loop to run through the Applications
Definition at line 52 of file application-container.cc.
References m_applications.
Referenced by Add(), Start(), StartWithJitter(), and Stop().
Ptr< Application > ns3::ApplicationContainer::Get | ( | uint32_t | i | ) | const |
Get the Ptr<Application> stored in this container at a given index.
Applications can be retrieved from the container in two ways. First, directly by an index into the container, and second, using an iterator. This method is used in the direct method and is used to retrieve the indexed Ptr<Application>.
i | the index of the requested application pointer. |
Definition at line 64 of file application-container.cc.
References m_applications.
Referenced by BulkSendBasicTestCase::DoRun(), BulkSendSeqTsSizeTestCase::DoRun(), ThreeGppHttpObjectTestCase::DoRun(), BriteTopologyFunctionTestCase::DoRun(), DhcpTestCase::DoRun(), EpcS1uDlTestCase::DoRun(), EpcS1uUlTestCase::DoRun(), LteEpcE2eDataTestCase::DoRun(), LteX2HandoverMeasuresTestCase::DoRun(), LteX2HandoverTestCase::DoRun(), WifiAcMappingTest::DoRun(), Issue211Test::DoRun(), WifiMsduAggregatorThroughputTest::DoRun(), GetRxBytes(), NeighborCacheExample::Run(), and Experiment::Run().
uint32_t ns3::ApplicationContainer::GetN | ( | ) | const |
Get the number of Ptr<Application> stored in this container.
Applications can be retrieved from the container in two ways. First, directly by an index into the container, and second, using an iterator. This method is used in the direct method and is typically used to define an ending condition in a for-loop that runs through the stored Applications
Definition at line 58 of file application-container.cc.
References m_applications.
Referenced by ThreeGppHttpObjectTestCase::DoRun(), and GetRxBytes().
void ns3::ApplicationContainer::Start | ( | Time | start | ) | const |
Start all of the Applications in this container at the start time given as a parameter.
All Applications need to be provided with a starting simulation time and a stopping simulation time. The ApplicationContainer is a convenient place for allowing all of the contained Applications to be told to wake up and start doing their thing (Start) at a common time.
This method simply iterates through the contained Applications and calls their Application::SetStartTime() methods with the provided Time.
start | The Time at which each of the applications should start. |
Definition at line 92 of file application-container.cc.
References openflow-switch::app, Begin(), End(), and two-ray-to-three-gpp-ch-calibration::start.
Referenced by Experiment::ApplicationSetup(), BuildAppsTest(), CreateBulkFlow(), CreateOnOffFlow(), BulkSendBasicTestCase::DoRun(), BulkSendSeqTsSizeTestCase::DoRun(), UdpClientServerTestCase::DoRun(), UdpTraceClientServerTestCase::DoRun(), BriteTopologyFunctionTestCase::DoRun(), DhcpTestCase::DoRun(), RadvdTestCase::DoRun(), EpcS1uDlTestCase::DoRun(), EpcS1uUlTestCase::DoRun(), LteIpv6RoutingTestCase::DoRun(), LteRadioLinkFailureTestCase::DoRun(), LteEpcE2eDataTestCase::DoRun(), CsmaMulticastTestCase::DoRun(), CsmaPacketSocketTestCase::DoRun(), CsmaPingTestCase::DoRun(), CsmaRawIpSocketTestCase::DoRun(), CsmaStarTestCase::DoRun(), Ns3TcpCubicTestCase::DoRun(), Ns3TcpLossTestCase::DoRun(), Ns3TcpNoDelayTestCase::DoRun(), Ns3TcpSocketTestCaseP2P::DoRun(), Ns3TcpSocketTestCaseCsma::DoRun(), Ns3TcpStateTestCase::DoRun(), WifiAcMappingTest::DoRun(), Issue211Test::DoRun(), WifiMsduAggregatorThroughputTest::DoRun(), experiment(), LteAggregationThroughputScaleTestCase::GetThroughput(), AodvExample::InstallApplications(), DsdvManetExample::InstallApplications(), TracerouteExample::InstallApplications(), InstallBulkSend(), InstallPacketSink(), RoutingExperiment::Run(), NeighborCacheExample::Run(), Experiment::Run(), and NetAnimExperiment::Run().
void ns3::ApplicationContainer::StartWithJitter | ( | Time | start, |
Ptr< RandomVariableStream > | rv | ||
) | const |
Start all of the Applications in this container at the start time given as a parameter, plus some jitter.
This method iterates through the contained Applications and calls their Application::SetStartTime() methods with the provided start Time, plus a jitter value drawn from the provided random variable.
start | The Time at which each of the applications should start. |
rv | The random variable that adds jitter (units of seconds) |
Definition at line 102 of file application-container.cc.
References openflow-switch::app, Begin(), End(), ns3::RandomVariableStream::GetValue(), NS_LOG_DEBUG, ns3::Seconds(), and two-ray-to-three-gpp-ch-calibration::start.
void ns3::ApplicationContainer::Stop | ( | Time | stop | ) | const |
Arrange for all of the Applications in this container to Stop() at the Time given as a parameter.
All Applications need to be provided with a starting simulation time and a stopping simulation time. The ApplicationContainer is a convenient place for allowing all of the contained Applications to be told to shut down and stop doing their thing (Stop) at a common time.
This method simply iterates through the contained Applications and calls their Application::SetStopTime() methods with the provided Time.
stop | The Time at which each of the applications should stop. |
Definition at line 114 of file application-container.cc.
References openflow-switch::app, Begin(), End(), and two-ray-to-three-gpp-ch-calibration::stop.
Referenced by Experiment::ApplicationSetup(), BuildAppsTest(), CreateBulkFlow(), CreateOnOffFlow(), BulkSendBasicTestCase::DoRun(), BulkSendSeqTsSizeTestCase::DoRun(), UdpClientServerTestCase::DoRun(), UdpTraceClientServerTestCase::DoRun(), BriteTopologyFunctionTestCase::DoRun(), DhcpTestCase::DoRun(), RadvdTestCase::DoRun(), EpcS1uDlTestCase::DoRun(), EpcS1uUlTestCase::DoRun(), LteIpv6RoutingTestCase::DoRun(), CsmaMulticastTestCase::DoRun(), CsmaPacketSocketTestCase::DoRun(), CsmaPingTestCase::DoRun(), CsmaRawIpSocketTestCase::DoRun(), CsmaStarTestCase::DoRun(), Ns3TcpCubicTestCase::DoRun(), Ns3TcpLossTestCase::DoRun(), Ns3TcpNoDelayTestCase::DoRun(), Ns3TcpSocketTestCaseP2P::DoRun(), Ns3TcpSocketTestCaseCsma::DoRun(), Ns3TcpStateTestCase::DoRun(), WifiAcMappingTest::DoRun(), Issue211Test::DoRun(), WifiMsduAggregatorThroughputTest::DoRun(), experiment(), AodvExample::InstallApplications(), DsdvManetExample::InstallApplications(), TracerouteExample::InstallApplications(), InstallBulkSend(), InstallPacketSink(), RoutingExperiment::Run(), Experiment::Run(), and NetAnimExperiment::Run().
|
private |
Applications smart pointers.
Definition at line 228 of file application-container.h.
Referenced by ApplicationContainer(), Add(), Begin(), End(), Get(), and GetN().