A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
energy-source-container.h
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2008 INRIA
4
* Copyright (c) 2010 Network Security Lab, University of Washington, Seattle.
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
* Authors: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
20
* Sidharth Nabar <snabar@uw.edu>, He Wu <mdzz@u.washington.edu>
21
*/
22
23
#ifndef ENERGY_SOURCE_CONTAINER_H
24
#define ENERGY_SOURCE_CONTAINER_H
25
26
#include "ns3/energy-source.h"
27
#include "ns3/object.h"
28
#include <vector>
29
#include <stdint.h>
30
31
namespace
ns3
{
32
44
class
EnergySourceContainer
:
public
Object
45
{
46
public
:
48
typedef
std::vector< Ptr<EnergySource> >::const_iterator
Iterator
;
49
50
public
:
55
static
TypeId
GetTypeId
(
void
);
59
EnergySourceContainer
();
60
~EnergySourceContainer
();
61
68
EnergySourceContainer
(
Ptr<EnergySource>
source);
69
77
EnergySourceContainer
(std::string sourceName);
78
89
EnergySourceContainer
(
const
EnergySourceContainer
&a,
90
const
EnergySourceContainer
&b);
91
111
Iterator
Begin
(
void
)
const
;
112
132
Iterator
End
(
void
)
const
;
133
139
uint32_t
GetN
(
void
)
const
;
140
147
Ptr<EnergySource>
Get
(uint32_t i)
const
;
148
155
void
Add
(
EnergySourceContainer
container);
156
162
void
Add
(
Ptr<EnergySource>
source);
163
170
void
Add
(std::string sourceName);
171
172
private
:
173
virtual
void
DoDispose
(
void
);
174
178
virtual
void
DoInitialize
(
void
);
179
180
private
:
181
std::vector< Ptr<EnergySource> >
m_sources
;
182
183
};
184
185
}
// namespace ns3
186
187
#endif
/* ENERGY_SOURCE_CONTAINER_H */
ns3::EnergySourceContainer
Holds a vector of ns3::EnergySource pointers.
Definition:
energy-source-container.h:45
ns3::EnergySourceContainer::Get
Ptr< EnergySource > Get(uint32_t i) const
Get the i-th Ptr<EnergySource> stored in this container.
Definition:
energy-source-container.cc:88
ns3::EnergySourceContainer::EnergySourceContainer
EnergySourceContainer()
Creates an empty EnergySourceContainer.
Definition:
energy-source-container.cc:41
ns3::EnergySourceContainer::Iterator
std::vector< Ptr< EnergySource > >::const_iterator Iterator
Const iterator for EnergySource container.
Definition:
energy-source-container.h:48
ns3::EnergySourceContainer::GetTypeId
static TypeId GetTypeId(void)
Get the type ID.
Definition:
energy-source-container.cc:31
ns3::EnergySourceContainer::~EnergySourceContainer
~EnergySourceContainer()
Definition:
energy-source-container.cc:45
ns3::EnergySourceContainer::Begin
Iterator Begin(void) const
Get an iterator which refers to the first EnergySource pointer in the container.
Definition:
energy-source-container.cc:70
ns3::EnergySourceContainer::m_sources
std::vector< Ptr< EnergySource > > m_sources
Energy source container.
Definition:
energy-source-container.h:181
ns3::EnergySourceContainer::DoInitialize
virtual void DoInitialize(void)
Calls Object::Start () for all EnergySource objects.
Definition:
energy-source-container.cc:135
ns3::EnergySourceContainer::Add
void Add(EnergySourceContainer container)
Definition:
energy-source-container.cc:94
ns3::EnergySourceContainer::GetN
uint32_t GetN(void) const
Get the number of Ptr<EnergySource> stored in this container.
Definition:
energy-source-container.cc:82
ns3::EnergySourceContainer::End
Iterator End(void) const
Get an iterator which refers to the last EnergySource pointer in the container.
Definition:
energy-source-container.cc:76
ns3::EnergySourceContainer::DoDispose
virtual void DoDispose(void)
Destructor implementation.
Definition:
energy-source-container.cc:122
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-source-container.h
Generated on Tue Feb 6 2024 19:21:18 for ns-3 by
1.9.1