A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Portuguese
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
src
energy
model
energy-harvester.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_H
23
#define ENERGY_HARVESTER_H
24
25
#include <iostream>
26
27
// include from ns-3
28
#include "ns3/object.h"
29
#include "ns3/ptr.h"
30
#include "ns3/type-id.h"
31
#include "ns3/node.h"
32
#include "ns3/energy-source-container.h"
33
34
namespace
ns3
{
35
36
class
EnergySource;
37
51
class
EnergyHarvester
:
public
Object
52
{
53
public
:
54
static
TypeId
GetTypeId
(
void
);
55
56
EnergyHarvester
();
57
58
virtual
~EnergyHarvester
();
59
65
void
SetNode
(
Ptr<Node>
node);
66
73
Ptr<Node>
GetNode
(
void
)
const
;
74
82
void
SetEnergySource
(
Ptr<EnergySource>
source);
83
90
Ptr<EnergySource>
GetEnergySource
(
void
)
const
;
91
98
double
GetPower
(
void
)
const
;
99
100
private
:
105
virtual
void
DoDispose
(
void
);
106
115
virtual
double
DoGetPower
(
void
)
const
;
116
117
private
:
122
Ptr<Node>
m_node
;
123
129
Ptr<EnergySource>
m_energySource
;
130
131
protected
:
132
133
};
134
135
}
// namespace ns3
136
137
#endif
/* defined(ENERGY_HARVESTER_H) */
ns3::Ptr< Node >
ns3::EnergyHarvester::m_node
Ptr< Node > m_node
Pointer to node containing this EnergyHarvester.
Definition:
energy-harvester.h:122
ns3::EnergyHarvester::GetNode
Ptr< Node > GetNode(void) const
Definition:
energy-harvester.cc:60
ns3::EnergyHarvester::SetEnergySource
void SetEnergySource(Ptr< EnergySource > source)
Definition:
energy-harvester.cc:67
ns3::EnergyHarvester::GetTypeId
static TypeId GetTypeId(void)
Definition:
energy-harvester.cc:32
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::EnergyHarvester::~EnergyHarvester
virtual ~EnergyHarvester()
Definition:
energy-harvester.cc:46
ns3::EnergyHarvester::DoDispose
virtual void DoDispose(void)
Defined in ns3::Object.
Definition:
energy-harvester.cc:94
ns3::EnergyHarvester
Energy harvester base class.
Definition:
energy-harvester.h:51
ns3::EnergyHarvester::GetEnergySource
Ptr< EnergySource > GetEnergySource(void) const
Definition:
energy-harvester.cc:75
ns3::EnergyHarvester::DoGetPower
virtual double DoGetPower(void) const
This method is called by the GetPower method and it needs to be implemented by the subclasses of the ...
Definition:
energy-harvester.cc:100
ns3::EnergyHarvester::EnergyHarvester
EnergyHarvester()
Definition:
energy-harvester.cc:41
ns3::EnergyHarvester::m_energySource
Ptr< EnergySource > m_energySource
Pointer to the Energy Source to which this EnergyHarvester is connected.
Definition:
energy-harvester.h:129
ns3::Object
A base class which provides memory management and object aggregation.
Definition:
object.h:87
ns3::EnergyHarvester::GetPower
double GetPower(void) const
Definition:
energy-harvester.cc:83
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:58
ns3::EnergyHarvester::SetNode
void SetNode(Ptr< Node > node)
Sets pointer to node containing this EnergyHarvester.
Definition:
energy-harvester.cc:52
Generated on Wed Nov 7 2018 10:01:52 for ns-3 by
1.8.14