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

Holds a vector of ns3::ZigbeeStack pointers. More...

#include "zigbee-stack-container.h"

+ Collaboration diagram for ns3::zigbee::ZigbeeStackContainer:

Public Types

typedef std::vector< Ptr< ZigbeeStack > >::const_iterator Iterator
 The iterator used in this Container.
 

Public Member Functions

 ZigbeeStackContainer ()
 The default constructor, create an empty ZigbeeStackContainer.
 
 ZigbeeStackContainer (Ptr< ZigbeeStack > stack)
 Create a ZigbeeStackContainer with exactly one ZigbeeStack that has previously been instantiated.
 
 ZigbeeStackContainer (std::string stackName)
 Create a ZigbeeStackContainer with exactly one device which has been previously instantiated and assigned a name using the Object name service.
 
void Add (Ptr< ZigbeeStack > stack)
 Append a single Ptr<ZigbeeStack> to this container.
 
void Add (std::string stackName)
 Append to this container the single Ptr<ZigbeeStack> referred to via its object name service registered name.
 
void Add (ZigbeeStackContainer other)
 Append the contents of another ZigbeeStackContainer to the end of this container.
 
Iterator Begin () const
 Get and iterator which refers to the first ZigbeeStack in the container.
 
Iterator End () const
 Get an iterator which indicates past the last ZigbeeStack in the container.
 
Ptr< ZigbeeStackGet (uint32_t i) const
 Get a stack element from the container.
 
uint32_t GetN () const
 Get the number of stacks present in the stack container.
 

Private Attributes

std::vector< Ptr< ZigbeeStack > > m_stacks
 ZigbeeStack smart pointers.
 

Detailed Description

Holds a vector of ns3::ZigbeeStack pointers.

Typically ZigbeeStacks are installed on top of a pre-existing NetDevice (an LrWpanNetDevice) which on itself has already being aggregated to a node. A ZigbeeHelper Install method takes a LrWpanNetDeviceContainer. For each of the LrWpanNetDevice in the LrWpanNetDeviceContainer the helper will instantiate a ZigbeeStack, connect the necessary hooks between the MAC (LrWpanMac) and the NWK (ZigbeeNwk) and install it to the node. For each of these ZigbeeStacks, the helper also adds the ZigbeeStack into a Container for later use by the caller. This is that container used to hold the Ptr<ZigbeeStack> which are instantiated by the ZigbeeHelper.

Definition at line 36 of file zigbee-stack-container.h.

Member Typedef Documentation

◆ Iterator

typedef std::vector<Ptr<ZigbeeStack>>::const_iterator ns3::zigbee::ZigbeeStackContainer::Iterator

The iterator used in this Container.

Definition at line 40 of file zigbee-stack-container.h.

Constructor & Destructor Documentation

◆ ZigbeeStackContainer() [1/3]

ns3::zigbee::ZigbeeStackContainer::ZigbeeStackContainer ( )

The default constructor, create an empty ZigbeeStackContainer.

Definition at line 19 of file zigbee-stack-container.cc.

◆ ZigbeeStackContainer() [2/3]

ns3::zigbee::ZigbeeStackContainer::ZigbeeStackContainer ( Ptr< ZigbeeStack > stack)

Create a ZigbeeStackContainer with exactly one ZigbeeStack that has previously been instantiated.

Parameters
stackA ZigbeeStack to add to the container

Definition at line 23 of file zigbee-stack-container.cc.

References m_stacks.

◆ ZigbeeStackContainer() [3/3]

ns3::zigbee::ZigbeeStackContainer::ZigbeeStackContainer ( std::string stackName)

Create a ZigbeeStackContainer with exactly one device which has been previously instantiated and assigned a name using the Object name service.

This ZigbeeStack is specified by its assigned name.

Parameters
stackNameThe name of the ZigbeeStack to add to the container

Create a ZigbeeStackContainer with exactly one device

Definition at line 28 of file zigbee-stack-container.cc.

References ns3::Names::Find(), and m_stacks.

+ Here is the call graph for this function:

Member Function Documentation

◆ Add() [1/3]

void ns3::zigbee::ZigbeeStackContainer::Add ( Ptr< ZigbeeStack > stack)

Append a single Ptr<ZigbeeStack> to this container.

Parameters
stackThe Ptr<ZigbeeStack> to append.

Definition at line 68 of file zigbee-stack-container.cc.

References m_stacks.

◆ Add() [2/3]

void ns3::zigbee::ZigbeeStackContainer::Add ( std::string stackName)

Append to this container the single Ptr<ZigbeeStack> referred to via its object name service registered name.

Parameters
stackNameThe name of the ZigbeeStack object to add to the container.

Definition at line 74 of file zigbee-stack-container.cc.

References ns3::Names::Find(), and m_stacks.

+ Here is the call graph for this function:

◆ Add() [3/3]

void ns3::zigbee::ZigbeeStackContainer::Add ( ZigbeeStackContainer other)

Append the contents of another ZigbeeStackContainer to the end of this container.

Parameters
otherThe ZigbeeStackContainer to append.

Definition at line 59 of file zigbee-stack-container.cc.

References Begin(), End(), and m_stacks.

Referenced by ns3::ZigbeeHelper::Install().

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

◆ Begin()

ZigbeeStackContainer::Iterator ns3::zigbee::ZigbeeStackContainer::Begin ( ) const

Get and iterator which refers to the first ZigbeeStack in the container.

Returns
An iterator referring to the first ZigbeeStack in the container.

Definition at line 35 of file zigbee-stack-container.cc.

References m_stacks.

Referenced by Add().

+ Here is the caller graph for this function:

◆ End()

ZigbeeStackContainer::Iterator ns3::zigbee::ZigbeeStackContainer::End ( ) const

Get an iterator which indicates past the last ZigbeeStack in the container.

Returns
An iterator referring to the past the last ZigbeeStack in the container.

Definition at line 41 of file zigbee-stack-container.cc.

References m_stacks.

Referenced by Add().

+ Here is the caller graph for this function:

◆ Get()

Ptr< ZigbeeStack > ns3::zigbee::ZigbeeStackContainer::Get ( uint32_t i) const

Get a stack element from the container.

Parameters
iThe element number in the container
Returns
The zigbee stack element matching the i index in the container.

Definition at line 53 of file zigbee-stack-container.cc.

References m_stacks.

Referenced by ZigbeeRreqRetryTestCase::DoRun().

+ Here is the caller graph for this function:

◆ GetN()

uint32_t ns3::zigbee::ZigbeeStackContainer::GetN ( ) const

Get the number of stacks present in the stack container.

Returns
The number of stacks in the container.

Definition at line 47 of file zigbee-stack-container.cc.

References m_stacks.

Member Data Documentation

◆ m_stacks

std::vector<Ptr<ZigbeeStack> > ns3::zigbee::ZigbeeStackContainer::m_stacks
private

ZigbeeStack smart pointers.

Definition at line 106 of file zigbee-stack-container.h.

Referenced by ZigbeeStackContainer(), ZigbeeStackContainer(), Add(), Add(), Add(), Begin(), End(), Get(), and GetN().


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