A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
energy-harvester-container.h
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2014 Wireless Communications and Networking Group (WCNG),
4
* University of Rochester, Rochester, NY, USA.
5
*
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License version 2 as
8
* published by the Free Software Foundation;
9
*
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
14
*
15
* You should have received a copy of the GNU General Public License
16
* along with this program; if not, write to the Free Software
17
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18
*
19
* Author: Cristiano Tapparello <cristiano.tapparello@rochester.edu>
20
*/
21
22
#ifndef ENERGY_HARVESTER_CONTAINER_H
23
#define ENERGY_HARVESTER_CONTAINER_H
24
25
#include "ns3/energy-harvester.h"
26
#include "ns3/object.h"
27
#include <vector>
28
#include <stdint.h>
29
30
namespace
ns3
{
31
32
class
EnergyHarvester;
33
45
class
EnergyHarvesterContainer
:
public
Object
46
{
47
public
:
48
typedef
std::vector< Ptr<EnergyHarvester> >::const_iterator
Iterator
;
49
50
public
:
51
static
TypeId
GetTypeId
(
void
);
55
EnergyHarvesterContainer
();
56
~EnergyHarvesterContainer
();
57
64
EnergyHarvesterContainer
(
Ptr<EnergyHarvester>
harvester);
65
73
EnergyHarvesterContainer
(std::string harvesterName);
74
86
EnergyHarvesterContainer
(
const
EnergyHarvesterContainer
&a,
87
const
EnergyHarvesterContainer
&b);
88
108
Iterator
Begin
(
void
)
const
;
109
129
Iterator
End
(
void
)
const
;
130
136
uint32_t
GetN
(
void
)
const
;
137
144
Ptr<EnergyHarvester>
Get
(uint32_t i)
const
;
145
152
void
Add
(
EnergyHarvesterContainer
container);
153
159
void
Add
(
Ptr<EnergyHarvester>
harvester);
160
167
void
Add
(std::string harvesterName);
168
172
void
Clear
(
void
);
173
174
private
:
175
virtual
void
DoDispose
(
void
);
176
180
virtual
void
DoInitialize
(
void
);
181
182
private
:
183
std::vector< Ptr<EnergyHarvester> >
m_harvesters
;
184
185
};
186
187
}
// namespace ns3
188
189
190
#endif
/* defined(ENERGY_HARVESTER_CONTAINER_H) */
ns3::EnergyHarvesterContainer
Holds a vector of ns3::EnergyHarvester pointers.
Definition:
energy-harvester-container.h:46
ns3::EnergyHarvesterContainer::Begin
Iterator Begin(void) const
Get an iterator which refers to the first EnergyHarvester pointer in the container.
Definition:
energy-harvester-container.cc:78
ns3::EnergyHarvesterContainer::Iterator
std::vector< Ptr< EnergyHarvester > >::const_iterator Iterator
Definition:
energy-harvester-container.h:48
ns3::EnergyHarvesterContainer::GetN
uint32_t GetN(void) const
Get the number of Ptr<EnergyHarvester> stored in this container.
Definition:
energy-harvester-container.cc:92
ns3::EnergyHarvesterContainer::m_harvesters
std::vector< Ptr< EnergyHarvester > > m_harvesters
Definition:
energy-harvester-container.h:183
ns3::EnergyHarvesterContainer::End
Iterator End(void) const
Get an iterator which refers to the last EnergyHarvester pointer in the container.
Definition:
energy-harvester-container.cc:85
ns3::EnergyHarvesterContainer::GetTypeId
static TypeId GetTypeId(void)
Definition:
energy-harvester-container.cc:34
ns3::EnergyHarvesterContainer::DoInitialize
virtual void DoInitialize(void)
Calls Object::Initialize () for all EnergySource objects.
Definition:
energy-harvester-container.cc:157
ns3::EnergyHarvesterContainer::Clear
void Clear(void)
Removes all elements in the container.
Definition:
energy-harvester-container.cc:133
ns3::EnergyHarvesterContainer::~EnergyHarvesterContainer
~EnergyHarvesterContainer()
Definition:
energy-harvester-container.cc:49
ns3::EnergyHarvesterContainer::DoDispose
virtual void DoDispose(void)
Destructor implementation.
Definition:
energy-harvester-container.cc:145
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:99
ns3::EnergyHarvesterContainer::Add
void Add(EnergyHarvesterContainer container)
Definition:
energy-harvester-container.cc:106
ns3::EnergyHarvesterContainer::EnergyHarvesterContainer
EnergyHarvesterContainer()
Creates an empty EnergyHarvesterContainer.
Definition:
energy-harvester-container.cc:44
ns3::Object
A base class which provides memory management and object aggregation.
Definition:
object.h:88
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition:
ptr.h:74
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.
src
energy
helper
energy-harvester-container.h
Generated on Mon Sep 27 2021 10:49:46 for ns-3 by
1.9.1