A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
Loading...
Searching...
No Matches
energy-harvester-helper.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2014 Wireless Communications and Networking Group (WCNG),
3
* University of Rochester, Rochester, NY, USA.
4
*
5
* SPDX-License-Identifier: GPL-2.0-only
6
*
7
* Author: Cristiano Tapparello <cristiano.tapparello@rochester.edu>
8
*/
9
10
#ifndef ENERGY_HARVESTER_HELPER_H
11
#define ENERGY_HARVESTER_HELPER_H
12
13
#include "
energy-harvester-container.h
"
14
#include "
energy-source-container.h
"
15
16
#include "ns3/attribute.h"
17
#include "ns3/energy-harvester.h"
18
#include "ns3/energy-source.h"
19
#include "ns3/node-container.h"
20
#include "ns3/object-factory.h"
21
#include "ns3/ptr.h"
22
23
namespace
ns3
24
{
25
26
/**
27
* \ingroup energy
28
* \brief Creates EnergyHarvester objects.
29
*
30
* This class creates and installs energy harvesters onto network nodes.
31
*
32
*/
33
class
EnergyHarvesterHelper
34
{
35
public
:
36
virtual
~EnergyHarvesterHelper
();
37
38
/**
39
* \param name Name of attribute to set.
40
* \param v Value of the attribute.
41
*
42
* Sets one of the attributes of underlying EnergyHarvester.
43
*/
44
virtual
void
Set
(std::string name,
const
AttributeValue
& v) = 0;
45
46
/**
47
* \param source Pointer to the energy source where EnergyHarvester will be installed.
48
* \returns An EnergyHarvesterContainer which contains all the EnergyHarvesters.
49
*
50
* This function installs an EnergyHarvester onto an energy source.
51
*/
52
energy::EnergyHarvesterContainer
Install
(
Ptr<energy::EnergySource>
source)
const
;
53
54
/**
55
* \param sourceContainer List of nodes where EnergyHarvester will be installed.
56
* \returns An EnergyHarvesterContainer which contains all the EnergyHarvester.
57
*
58
* This function installs an EnergyHarvester onto a list of energy sources.
59
*/
60
energy::EnergyHarvesterContainer
Install
(
energy::EnergySourceContainer
sourceContainer)
const
;
61
62
/**
63
* \param sourceName Name of node where EnergyHarvester will be installed.
64
* \returns An EnergyHarvesterContainer which contains all the EnergyHarvesters.
65
*
66
* This function installs an EnergyHarvester onto a node.
67
*/
68
energy::EnergyHarvesterContainer
Install
(std::string sourceName)
const
;
69
70
private
:
71
/**
72
* \param source Pointer to node where the energy harvester is to be installed.
73
* \returns Pointer to the created EnergyHarvester.
74
*
75
* Child classes of EnergyHarvesterHelper only have to implement this function,
76
* to create and aggregate an EnergyHarvester object onto a single node. Rest of
77
* the installation process (eg. installing EnergyHarvester on set of nodes) is
78
* implemented in the EnergyHarvesterHelper base class.
79
*/
80
virtual
Ptr<energy::EnergyHarvester>
DoInstall
(
Ptr<energy::EnergySource>
source)
const
= 0;
81
};
82
83
}
// namespace ns3
84
85
#endif
/* defined(ENERGY_HARVESTER_HELPER_H) */
ns3::AttributeValue
Hold a value for an Attribute.
Definition
attribute.h:59
ns3::EnergyHarvesterHelper
Creates EnergyHarvester objects.
Definition
energy-harvester-helper.h:34
ns3::EnergyHarvesterHelper::~EnergyHarvesterHelper
virtual ~EnergyHarvesterHelper()
Definition
energy-harvester-helper.cc:21
ns3::EnergyHarvesterHelper::DoInstall
virtual Ptr< energy::EnergyHarvester > DoInstall(Ptr< energy::EnergySource > source) const =0
ns3::EnergyHarvesterHelper::Set
virtual void Set(std::string name, const AttributeValue &v)=0
ns3::EnergyHarvesterHelper::Install
energy::EnergyHarvesterContainer Install(Ptr< energy::EnergySource > source) const
Definition
energy-harvester-helper.cc:26
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition
mpi-test-fixtures.h:37
ns3::energy::EnergyHarvesterContainer
Holds a vector of ns3::EnergyHarvester pointers.
Definition
energy-harvester-container.h:38
ns3::energy::EnergySourceContainer
Holds a vector of ns3::EnergySource pointers.
Definition
energy-source-container.h:37
energy-harvester-container.h
energy-source-container.h
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
energy
helper
energy-harvester-helper.h
Generated on Fri Nov 8 2024 13:59:00 for ns-3 by
1.11.0