A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
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
44
class
EnergyHarvester
:
public
Object
45
{
46
public
:
51
static
TypeId
GetTypeId
(
void
);
52
53
EnergyHarvester
();
54
55
virtual
~EnergyHarvester
();
56
62
void
SetNode
(
Ptr<Node>
node);
63
70
Ptr<Node>
GetNode
(
void
)
const
;
71
79
void
SetEnergySource
(
Ptr<EnergySource>
source);
80
87
Ptr<EnergySource>
GetEnergySource
(
void
)
const
;
88
95
double
GetPower
(
void
)
const
;
96
97
private
:
102
virtual
void
DoDispose
(
void
);
103
114
virtual
double
DoGetPower
(
void
)
const
;
115
116
private
:
121
Ptr<Node>
m_node
;
122
128
Ptr<EnergySource>
m_energySource
;
129
130
protected
:
131
132
};
133
134
}
// namespace ns3
135
136
#endif
/* defined(ENERGY_HARVESTER_H) */
ns3::EnergyHarvester
Energy harvester base class.
Definition:
energy-harvester.h:45
ns3::EnergyHarvester::GetNode
Ptr< Node > GetNode(void) const
Definition:
energy-harvester.cc:60
ns3::EnergyHarvester::m_energySource
Ptr< EnergySource > m_energySource
Pointer to the Energy Source to which this EnergyHarvester is connected.
Definition:
energy-harvester.h:128
ns3::EnergyHarvester::DoDispose
virtual void DoDispose(void)
Defined in ns3::Object.
Definition:
energy-harvester.cc:94
ns3::EnergyHarvester::GetTypeId
static TypeId GetTypeId(void)
Get the type ID.
Definition:
energy-harvester.cc:32
ns3::EnergyHarvester::~EnergyHarvester
virtual ~EnergyHarvester()
Definition:
energy-harvester.cc:46
ns3::EnergyHarvester::m_node
Ptr< Node > m_node
Pointer to node containing this EnergyHarvester.
Definition:
energy-harvester.h:121
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::SetNode
void SetNode(Ptr< Node > node)
Sets pointer to node containing this EnergyHarvester.
Definition:
energy-harvester.cc:52
ns3::EnergyHarvester::SetEnergySource
void SetEnergySource(Ptr< EnergySource > source)
Definition:
energy-harvester.cc:67
ns3::EnergyHarvester::GetPower
double GetPower(void) const
Definition:
energy-harvester.cc:83
ns3::EnergyHarvester::GetEnergySource
Ptr< EnergySource > GetEnergySource(void) const
Definition:
energy-harvester.cc:75
ns3::Object
A base class which provides memory management and object aggregation.
Definition:
object.h:88
ns3::Ptr< Node >
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
model
energy-harvester.h
Generated on Tue Feb 6 2024 19:21:18 for ns-3 by
1.9.1