A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
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
:
49
typedef
std::vector< Ptr<EnergyHarvester> >::const_iterator
Iterator
;
50
51
public
:
56
static
TypeId
GetTypeId
(
void
);
60
EnergyHarvesterContainer
();
61
~EnergyHarvesterContainer
();
62
69
EnergyHarvesterContainer
(
Ptr<EnergyHarvester>
harvester);
70
78
EnergyHarvesterContainer
(std::string harvesterName);
79
91
EnergyHarvesterContainer
(
const
EnergyHarvesterContainer
&a,
92
const
EnergyHarvesterContainer
&b);
93
113
Iterator
Begin
(
void
)
const
;
114
134
Iterator
End
(
void
)
const
;
135
141
uint32_t
GetN
(
void
)
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
(
void
);
178
179
private
:
180
virtual
void
DoDispose
(
void
);
181
185
virtual
void
DoInitialize
(
void
);
186
187
private
:
188
std::vector< Ptr<EnergyHarvester> >
m_harvesters
;
189
190
};
191
192
}
// namespace ns3
193
194
195
#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
Const iterator for EnergyHarvester container.
Definition:
energy-harvester-container.h:49
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
Harvester container.
Definition:
energy-harvester-container.h:188
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)
Get the type ID.
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 Tue Feb 6 2024 19:21:18 for ns-3 by
1.9.1