A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
ns3::ApplicationHelper Class Reference

A helper to make it easier to instantiate an application on a set of nodes. More...

#include "application-helper.h"

+ Inheritance diagram for ns3::ApplicationHelper:
+ Collaboration diagram for ns3::ApplicationHelper:

Public Member Functions

 ApplicationHelper (const std::string &typeId)
 Create an application of a given type ID.
 
 ApplicationHelper (TypeId typeId)
 Create an application of a given type ID.
 
int64_t AssignStreams (NodeContainer c, int64_t stream)
 Assigns a unique (monotonically increasing) stream number to all applications that match the configured type of this application helper instance.
 
ApplicationContainer Install (const std::string &nodeName)
 Install an application on the node configured with all the attributes set with SetAttribute.
 
ApplicationContainer Install (NodeContainer c)
 Install an application on each node of the input container configured with all the attributes set with SetAttribute.
 
ApplicationContainer Install (Ptr< Node > node)
 Install an application on the node configured with all the attributes set with SetAttribute.
 
void SetAttribute (const std::string &name, const AttributeValue &value)
 Helper function used to set the underlying application attributes.
 
void SetTypeId (const std::string &typeId)
 Allow the helper to be repurposed for another application type.
 
void SetTypeId (TypeId typeId)
 Allow the helper to be repurposed for another application type.
 

Static Public Member Functions

static int64_t AssignStreamsToAllApps (NodeContainer c, int64_t stream)
 Assign a fixed random variable stream number to the random variables used by all the applications.
 

Protected Member Functions

virtual Ptr< ApplicationDoInstall (Ptr< Node > node)
 Install an application on the node configured with all the attributes set with SetAttribute.
 

Protected Attributes

ObjectFactory m_factory
 Object factory.
 

Detailed Description

A helper to make it easier to instantiate an application on a set of nodes.

Definition at line 27 of file application-helper.h.

Constructor & Destructor Documentation

◆ ApplicationHelper() [1/2]

ns3::ApplicationHelper::ApplicationHelper ( TypeId typeId)
explicit

Create an application of a given type ID.

Parameters
typeIdthe type ID.

Definition at line 18 of file application-helper.cc.

References SetTypeId().

+ Here is the call graph for this function:

◆ ApplicationHelper() [2/2]

ns3::ApplicationHelper::ApplicationHelper ( const std::string & typeId)
explicit

Create an application of a given type ID.

Parameters
typeIdthe type ID expressed as a string.

Definition at line 23 of file application-helper.cc.

References SetTypeId().

+ Here is the call graph for this function:

Member Function Documentation

◆ AssignStreams()

int64_t ns3::ApplicationHelper::AssignStreams ( NodeContainer c,
int64_t stream )

Assigns a unique (monotonically increasing) stream number to all applications that match the configured type of this application helper instance.

Return the number of streams (possibly zero) that have been assigned. The Install() method should have previously been called by the user.

Parameters
streamfirst stream index to use
cNodeContainer of the set of nodes for which the application should be modified to use a fixed stream
Returns
the number of stream indices assigned by this helper

Definition at line 81 of file application-helper.cc.

References ns3::NodeContainer::Begin(), ns3::NodeContainer::End(), ns3::ObjectFactory::GetTypeId(), ns3::ObjectFactory::IsTypeIdSet(), m_factory, and NS_ABORT_MSG_IF.

+ Here is the call graph for this function:

◆ AssignStreamsToAllApps()

int64_t ns3::ApplicationHelper::AssignStreamsToAllApps ( NodeContainer c,
int64_t stream )
static

Assign a fixed random variable stream number to the random variables used by all the applications.

Return the number of streams (possibly zero) that have been assigned. The Install() method should have previously been called by the user.

Parameters
streamfirst stream index to use
cNodeContainer of the set of nodes for which their applications should be modified to use a fixed stream
Returns
the number of stream indices assigned by this helper

Definition at line 101 of file application-helper.cc.

References ns3::NodeContainer::Begin(), and ns3::NodeContainer::End().

+ Here is the call graph for this function:

◆ DoInstall()

Ptr< Application > ns3::ApplicationHelper::DoInstall ( Ptr< Node > node)
protectedvirtual

Install an application on the node configured with all the attributes set with SetAttribute.

Parameters
nodeThe node on which an application will be installed.
Returns
Ptr to the application installed.

Reimplemented in ns3::RadvdHelper.

Definition at line 72 of file application-helper.cc.

References ns3::ObjectFactory::Create(), m_factory, and NS_ABORT_MSG_IF.

Referenced by Install(), Install(), and Install().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Install() [1/3]

ApplicationContainer ns3::ApplicationHelper::Install ( const std::string & nodeName)

Install an application on the node configured with all the attributes set with SetAttribute.

Parameters
nodeNameThe node on which an application will be installed.
Returns
Container of Ptr to the applications installed.

Definition at line 53 of file application-helper.cc.

References DoInstall(), ns3::Names::Find(), and NS_ABORT_MSG_IF.

+ Here is the call graph for this function:

◆ Install() [2/3]

ApplicationContainer ns3::ApplicationHelper::Install ( NodeContainer c)

Install an application on each node of the input container configured with all the attributes set with SetAttribute.

Parameters
cNodeContainer of the set of nodes on which an application will be installed.
Returns
Container of Ptr to the applications installed.

Definition at line 61 of file application-helper.cc.

References ns3::ApplicationContainer::Add(), ns3::NodeContainer::Begin(), DoInstall(), and ns3::NodeContainer::End().

Referenced by BuildAppsTest(), BuildAppsTest(), CreateBulkFlow(), CreateOnOffFlow(), BriteTopologyFunctionTestCase::DoRun(), BulkSendBasicTestCase::DoRun(), BulkSendSeqTsSizeTestCase::DoRun(), CsmaPingTestCase::DoRun(), LenaCqaFfMacSchedulerTestCase1::DoRun(), LenaCqaFfMacSchedulerTestCase2::DoRun(), LenaFdTbfqFfMacSchedulerTestCase1::DoRun(), LenaFdTbfqFfMacSchedulerTestCase2::DoRun(), LenaPssFfMacSchedulerTestCase1::DoRun(), LenaPssFfMacSchedulerTestCase2::DoRun(), LenaTdTbfqFfMacSchedulerTestCase1::DoRun(), LenaTdTbfqFfMacSchedulerTestCase2::DoRun(), LteDistributedFfrAreaTestCase::DoRun(), LteIpv6RoutingTestCase::DoRun(), LteRadioLinkFailureTestCase::DoRun(), LteX2HandoverMeasuresTestCase::DoRun(), LteX2HandoverTestCase::DoRun(), ns3::LenaDeactivateBearerTestCase::DoRun(), Ns3TcpCubicTestCase::DoRun(), RadvdTestCase::DoRun(), ThreeGppHttpObjectTestCase::DoRun(), UdpClientServerTestCase::DoRun(), UdpTraceClientServerTestCase::DoRun(), WifiAcMappingTest::DoRun(), WifiMsduAggregatorThroughputTest::DoRun(), experiment(), experiment(), AodvExample::InstallApplications(), DsdvManetExample::InstallApplications(), TracerouteExample::InstallApplications(), InstallBulkSend(), and RoutingExperiment::Run().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Install() [3/3]

ApplicationContainer ns3::ApplicationHelper::Install ( Ptr< Node > node)

Install an application on the node configured with all the attributes set with SetAttribute.

Parameters
nodeThe node on which an application will be installed.
Returns
Container of Ptr to the applications installed.

Definition at line 47 of file application-helper.cc.

References DoInstall().

+ Here is the call graph for this function:

◆ SetAttribute()

void ns3::ApplicationHelper::SetAttribute ( const std::string & name,
const AttributeValue & value )

Helper function used to set the underlying application attributes.

Parameters
namethe name of the application attribute to set
valuethe value of the application attribute to set

Definition at line 41 of file application-helper.cc.

References m_factory, and ns3::ObjectFactory::Set().

Referenced by ns3::UdpClientHelper::UdpClientHelper(), ns3::UdpEchoClientHelper::UdpEchoClientHelper(), ns3::UdpEchoServerHelper::UdpEchoServerHelper(), ns3::UdpEchoServerHelper::UdpEchoServerHelper(), ns3::UdpServerHelper::UdpServerHelper(), ns3::UdpServerHelper::UdpServerHelper(), ns3::UdpTraceClientHelper::UdpTraceClientHelper(), BuildAppsTest(), BuildAppsTest(), CreateBulkFlow(), CreateOnOffFlow(), BriteTopologyFunctionTestCase::DoRun(), BulkSendBasicTestCase::DoRun(), BulkSendSeqTsSizeTestCase::DoRun(), LenaCqaFfMacSchedulerTestCase1::DoRun(), LenaCqaFfMacSchedulerTestCase2::DoRun(), LenaFdTbfqFfMacSchedulerTestCase1::DoRun(), LenaFdTbfqFfMacSchedulerTestCase2::DoRun(), LenaPssFfMacSchedulerTestCase1::DoRun(), LenaPssFfMacSchedulerTestCase2::DoRun(), LenaTdTbfqFfMacSchedulerTestCase1::DoRun(), LenaTdTbfqFfMacSchedulerTestCase2::DoRun(), LteDistributedFfrAreaTestCase::DoRun(), LteIpv6RoutingTestCase::DoRun(), LteRadioLinkFailureTestCase::DoRun(), LteX2HandoverMeasuresTestCase::DoRun(), ns3::LenaDeactivateBearerTestCase::DoRun(), Ns3TcpCubicTestCase::DoRun(), UdpClientServerTestCase::DoRun(), UdpTraceClientServerTestCase::DoRun(), experiment(), experiment(), AodvExample::InstallApplications(), DsdvManetExample::InstallApplications(), TracerouteExample::InstallApplications(), InstallBulkSend(), and RoutingExperiment::Run().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetTypeId() [1/2]

void ns3::ApplicationHelper::SetTypeId ( const std::string & typeId)

Allow the helper to be repurposed for another application type.

Parameters
typeIdthe type ID expressed as a string.

Definition at line 35 of file application-helper.cc.

References m_factory, and ns3::ObjectFactory::SetTypeId().

+ Here is the call graph for this function:

◆ SetTypeId() [2/2]

void ns3::ApplicationHelper::SetTypeId ( TypeId typeId)

Allow the helper to be repurposed for another application type.

Parameters
typeIdthe type ID.

Definition at line 29 of file application-helper.cc.

References m_factory, and ns3::ObjectFactory::SetTypeId().

Referenced by ApplicationHelper(), and ApplicationHelper().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_factory


The documentation for this class was generated from the following files: