A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
zigbee-stack-container.cc
Go to the documentation of this file.
1/*
2 * Copyright (c) 2024 Tokushima University, Japan
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author:
7 * Alberto Gallegos Ramonet <alramonet@is.tokushima-u.ac.jp>
8 */
9
11
12#include "ns3/names.h"
13
14namespace ns3
15{
16namespace zigbee
17{
18
22
27
29{
30 Ptr<ZigbeeStack> stack = Names::Find<ZigbeeStack>(stackName);
31 m_stacks.emplace_back(stack);
32}
33
36{
37 return m_stacks.begin();
38}
39
42{
43 return m_stacks.end();
44}
45
48{
49 return m_stacks.size();
50}
51
54{
55 return m_stacks[i];
56}
57
58void
60{
61 for (auto i = other.Begin(); i != other.End(); i++)
62 {
63 m_stacks.emplace_back(*i);
64 }
65}
66
67void
69{
70 m_stacks.emplace_back(stack);
71}
72
73void
75{
76 Ptr<ZigbeeStack> stack = Names::Find<ZigbeeStack>(stackName);
77 m_stacks.emplace_back(stack);
78}
79
80} // namespace zigbee
81} // namespace ns3
Smart pointer class similar to boost::intrusive_ptr.
Definition ptr.h:66
Holds a vector of ns3::ZigbeeStack pointers.
std::vector< Ptr< ZigbeeStack > > m_stacks
ZigbeeStack smart pointers.
uint32_t GetN() const
Get the number of stacks present in the stack container.
Iterator End() const
Get an iterator which indicates past the last ZigbeeStack in the container.
Iterator Begin() const
Get and iterator which refers to the first ZigbeeStack in the container.
Ptr< ZigbeeStack > Get(uint32_t i) const
Get a stack element from the container.
void Add(ZigbeeStackContainer other)
Append the contents of another ZigbeeStackContainer to the end of this container.
std::vector< Ptr< ZigbeeStack > >::const_iterator Iterator
The iterator used in this Container.
ZigbeeStackContainer()
The default constructor, create an empty ZigbeeStackContainer.
Ptr< T > Create(Ts &&... args)
Create class instances by constructors with varying numbers of arguments and return them by Ptr.
Definition ptr.h:436
Every class exported by the ns3 library is enclosed in the ns3 namespace.