A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
energy-harvester-container.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2014 Wireless Communications and Networking Group (WCNG),
3
* University of Rochester, Rochester, NY, USA.
4
*
5
* This program is free software; you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License version 2 as
7
* published by the Free Software Foundation;
8
*
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
13
*
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software
16
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
*
18
* Author: Cristiano Tapparello <cristiano.tapparello@rochester.edu>
19
*/
20
21
#ifndef ENERGY_HARVESTER_CONTAINER_H
22
#define ENERGY_HARVESTER_CONTAINER_H
23
24
#include "ns3/energy-harvester.h"
25
#include "ns3/object.h"
26
27
#include <stdint.h>
28
#include <vector>
29
30
namespace
ns3
31
{
32
33
class
EnergyHarvester;
34
46
class
EnergyHarvesterContainer
:
public
Object
47
{
48
public
:
50
typedef
std::vector<Ptr<EnergyHarvester>>::const_iterator
Iterator
;
51
52
public
:
57
static
TypeId
GetTypeId
();
61
EnergyHarvesterContainer
();
62
~EnergyHarvesterContainer
()
override
;
63
70
EnergyHarvesterContainer
(
Ptr<EnergyHarvester>
harvester);
71
79
EnergyHarvesterContainer
(std::string harvesterName);
80
92
EnergyHarvesterContainer
(
const
EnergyHarvesterContainer
& a,
const
EnergyHarvesterContainer
& b);
93
113
Iterator
Begin
()
const
;
114
134
Iterator
End
()
const
;
135
141
uint32_t
GetN
()
const
;
142
149
Ptr<EnergyHarvester>
Get
(uint32_t i)
const
;
150
157
void
Add
(
EnergyHarvesterContainer
container
);
158
164
void
Add
(
Ptr<EnergyHarvester>
harvester);
165
172
void
Add
(std::string harvesterName);
173
177
void
Clear
();
178
179
private
:
180
void
DoDispose
()
override
;
181
185
void
DoInitialize
()
override
;
186
187
private
:
188
std::vector<Ptr<EnergyHarvester>>
m_harvesters
;
189
};
190
191
}
// namespace ns3
192
193
#endif
/* defined(ENERGY_HARVESTER_CONTAINER_H) */
ns3::EnergyHarvesterContainer
Holds a vector of ns3::EnergyHarvester pointers.
Definition:
energy-harvester-container.h:47
ns3::EnergyHarvesterContainer::Clear
void Clear()
Removes all elements in the container.
Definition:
energy-harvester-container.cc:132
ns3::EnergyHarvesterContainer::Iterator
std::vector< Ptr< EnergyHarvester > >::const_iterator Iterator
Const iterator for EnergyHarvester container.
Definition:
energy-harvester-container.h:50
ns3::EnergyHarvesterContainer::~EnergyHarvesterContainer
~EnergyHarvesterContainer() override
Definition:
energy-harvester-container.cc:48
ns3::EnergyHarvesterContainer::End
Iterator End() const
Get an iterator which refers to the last EnergyHarvester pointer in the container.
Definition:
energy-harvester-container.cc:84
ns3::EnergyHarvesterContainer::DoDispose
void DoDispose() override
Destructor implementation.
Definition:
energy-harvester-container.cc:143
ns3::EnergyHarvesterContainer::Begin
Iterator Begin() const
Get an iterator which refers to the first EnergyHarvester pointer in the container.
Definition:
energy-harvester-container.cc:77
ns3::EnergyHarvesterContainer::DoInitialize
void DoInitialize() override
Calls Object::Initialize () for all EnergySource objects.
Definition:
energy-harvester-container.cc:154
ns3::EnergyHarvesterContainer::Get
Ptr< EnergyHarvester > Get(uint32_t i) const
Get the i-th Ptr<EnergyHarvester> stored in this container.
Definition:
energy-harvester-container.cc:98
ns3::EnergyHarvesterContainer::Add
void Add(EnergyHarvesterContainer container)
Definition:
energy-harvester-container.cc:105
ns3::EnergyHarvesterContainer::EnergyHarvesterContainer
EnergyHarvesterContainer()
Creates an empty EnergyHarvesterContainer.
Definition:
energy-harvester-container.cc:43
ns3::EnergyHarvesterContainer::GetN
uint32_t GetN() const
Get the number of Ptr<EnergyHarvester> stored in this container.
Definition:
energy-harvester-container.cc:91
ns3::EnergyHarvesterContainer::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition:
energy-harvester-container.cc:34
ns3::EnergyHarvesterContainer::m_harvesters
std::vector< Ptr< EnergyHarvester > > m_harvesters
Harvester container.
Definition:
energy-harvester-container.h:188
ns3::Object
A base class which provides memory management and object aggregation.
Definition:
object.h:89
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition:
ptr.h:77
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:59
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
openflow-switch.container
container
Definition:
openflow-switch.py:46
src
energy
helper
energy-harvester-container.h
Generated on Sun Mar 3 2024 17:10:57 for ns-3 by
1.9.1