A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
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
10
#include "
zigbee-stack-container.h
"
11
12
#include "ns3/names.h"
13
14
namespace
ns3
15
{
16
namespace
zigbee
17
{
18
19
ZigbeeStackContainer::ZigbeeStackContainer
()
20
{
21
}
22
23
ZigbeeStackContainer::ZigbeeStackContainer
(
Ptr<ZigbeeStack>
stack)
24
{
25
m_stacks
.emplace_back(stack);
26
}
27
28
ZigbeeStackContainer::ZigbeeStackContainer
(std::string stackName)
29
{
30
Ptr<ZigbeeStack>
stack =
Names::Find<ZigbeeStack>
(stackName);
31
m_stacks
.emplace_back(stack);
32
}
33
34
ZigbeeStackContainer::Iterator
35
ZigbeeStackContainer::Begin
()
const
36
{
37
return
m_stacks
.begin();
38
}
39
40
ZigbeeStackContainer::Iterator
41
ZigbeeStackContainer::End
()
const
42
{
43
return
m_stacks
.end();
44
}
45
46
uint32_t
47
ZigbeeStackContainer::GetN
()
const
48
{
49
return
m_stacks
.size();
50
}
51
52
Ptr<ZigbeeStack>
53
ZigbeeStackContainer::Get
(
uint32_t
i)
const
54
{
55
return
m_stacks
[i];
56
}
57
58
void
59
ZigbeeStackContainer::Add
(
ZigbeeStackContainer
other)
60
{
61
for
(
auto
i = other.
Begin
(); i != other.
End
(); i++)
62
{
63
m_stacks
.emplace_back(*i);
64
}
65
}
66
67
void
68
ZigbeeStackContainer::Add
(
Ptr<ZigbeeStack>
stack)
69
{
70
m_stacks
.emplace_back(stack);
71
}
72
73
void
74
ZigbeeStackContainer::Add
(std::string stackName)
75
{
76
Ptr<ZigbeeStack>
stack =
Names::Find<ZigbeeStack>
(stackName);
77
m_stacks
.emplace_back(stack);
78
}
79
80
}
// namespace zigbee
81
}
// namespace ns3
ns3::Names::Find
static Ptr< T > Find(std::string path)
Given a name path string, look to see if there's an object in the system with that associated to it.
Definition
names.h:443
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition
mpi-test-fixtures.h:37
ns3::zigbee::ZigbeeStackContainer
Holds a vector of ns3::ZigbeeStack pointers.
Definition
zigbee-stack-container.h:37
ns3::zigbee::ZigbeeStackContainer::m_stacks
std::vector< Ptr< ZigbeeStack > > m_stacks
ZigbeeStack smart pointers.
Definition
zigbee-stack-container.h:106
ns3::zigbee::ZigbeeStackContainer::GetN
uint32_t GetN() const
Get the number of stacks present in the stack container.
Definition
zigbee-stack-container.cc:47
ns3::zigbee::ZigbeeStackContainer::End
Iterator End() const
Get an iterator which indicates past the last ZigbeeStack in the container.
Definition
zigbee-stack-container.cc:41
ns3::zigbee::ZigbeeStackContainer::Begin
Iterator Begin() const
Get and iterator which refers to the first ZigbeeStack in the container.
Definition
zigbee-stack-container.cc:35
ns3::zigbee::ZigbeeStackContainer::Get
Ptr< ZigbeeStack > Get(uint32_t i) const
Get a stack element from the container.
Definition
zigbee-stack-container.cc:53
ns3::zigbee::ZigbeeStackContainer::Add
void Add(ZigbeeStackContainer other)
Append the contents of another ZigbeeStackContainer to the end of this container.
Definition
zigbee-stack-container.cc:59
ns3::zigbee::ZigbeeStackContainer::Iterator
std::vector< Ptr< ZigbeeStack > >::const_iterator Iterator
The iterator used in this Container.
Definition
zigbee-stack-container.h:40
ns3::zigbee::ZigbeeStackContainer::ZigbeeStackContainer
ZigbeeStackContainer()
The default constructor, create an empty ZigbeeStackContainer.
Definition
zigbee-stack-container.cc:19
uint32_t
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
zigbee-stack-container.h
src
zigbee
helper
zigbee-stack-container.cc
Generated on Wed Feb 12 2025 18:50:05 for ns-3 by
1.11.0