A Discrete-Event Network Simulator
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
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
23namespace 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 */
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 */
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 */
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 */
81};
82
83} // namespace ns3
84
85#endif /* defined(ENERGY_HARVESTER_HELPER_H) */
Hold a value for an Attribute.
Definition attribute.h:59
Creates EnergyHarvester objects.
virtual Ptr< energy::EnergyHarvester > DoInstall(Ptr< energy::EnergySource > source) const =0
virtual void Set(std::string name, const AttributeValue &v)=0
energy::EnergyHarvesterContainer Install(Ptr< energy::EnergySource > source) const
Smart pointer class similar to boost::intrusive_ptr.
Holds a vector of ns3::EnergyHarvester pointers.
Holds a vector of ns3::EnergySource pointers.
Every class exported by the ns3 library is enclosed in the ns3 namespace.