LEFT | RIGHT |
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ | 1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
2 /* | 2 /* |
3 * Copyright (c) 2014 Wireless Communications and Networking Group (WCNG), | 3 * Copyright (c) 2014 Wireless Communications and Networking Group (WCNG), |
4 * University of Rochester, Rochester, NY, USA. | 4 * University of Rochester, Rochester, NY, USA. |
5 * | 5 * |
6 * This program is free software; you can redistribute it and/or modify | 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 | 7 * it under the terms of the GNU General Public License version 2 as |
8 * published by the Free Software Foundation; | 8 * published by the Free Software Foundation; |
9 * | 9 * |
10 * This program is distributed in the hope that it will be useful, | 10 * This program is distributed in the hope that it will be useful, |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 * \ingroup energy | 44 * \ingroup energy |
45 * | 45 * |
46 * \brief Energy harvester base class. | 46 * \brief Energy harvester base class. |
47 * | 47 * |
48 * | 48 * |
49 */ | 49 */ |
50 | 50 |
51 class EnergyHarvester : public Object | 51 class EnergyHarvester : public Object |
52 { | 52 { |
53 public: | 53 public: |
54 » static TypeId GetTypeId (void); | 54 static TypeId GetTypeId (void); |
55 | 55 |
56 » EnergyHarvester (); | 56 EnergyHarvester (); |
57 | 57 |
58 » virtual ~EnergyHarvester (); | 58 virtual ~EnergyHarvester (); |
59 | 59 |
60 » /** | 60 /** |
61 » * \brief Sets pointer to node containing this EnergyHarvester. | 61 * \brief Sets pointer to node containing this EnergyHarvester. |
62 » * | 62 * |
63 » * \param node Pointer to node containing this EnergyHarvester. | 63 * \param node Pointer to node containing this EnergyHarvester. |
64 » */ | 64 */ |
65 » void SetNode (Ptr<Node> node); | 65 void SetNode (Ptr<Node> node); |
66 | 66 |
67 » /** | 67 /** |
68 » * \returns Pointer to node containing this EnergyHarvester. | 68 * \returns Pointer to node containing this EnergyHarvester. |
69 » * | 69 * |
70 » * When a subclass needs to get access to the underlying node base class
to | 70 * When a subclass needs to get access to the underlying node base class to |
71 » * print the nodeId for example, it can invoke this method. | 71 * print the nodeId for example, it can invoke this method. |
72 » */ | 72 */ |
73 » Ptr<Node> GetNode (void) const; | 73 Ptr<Node> GetNode (void) const; |
74 | 74 |
75 » /** | 75 /** |
76 » * \param source Pointer to energy source to which this EnergyHarvester
is | 76 * \param source Pointer to energy source to which this EnergyHarvester is |
77 » * installed. | 77 * installed. |
78 » * | 78 * |
79 » * This function sets the pointer to the energy source connected to the
energy | 79 * This function sets the pointer to the energy source connected to the energy |
80 » * harvester. | 80 * harvester. |
81 » */ | 81 */ |
82 » void SetEnergySource (Ptr<EnergySource> source); | 82 void SetEnergySource (Ptr<EnergySource> source); |
83 | 83 |
84 » /** | 84 /** |
85 » * \returns source Pointer to energy source connected to the harvester. | 85 * \returns source Pointer to energy source connected to the harvester. |
86 » * | 86 * |
87 » * When a subclass needs to get access to the connected energy source, | 87 * When a subclass needs to get access to the connected energy source, |
88 » * it can invoke this method. | 88 * it can invoke this method. |
89 » */ | 89 */ |
90 » Ptr<EnergySource> GetEnergySource (void) const; | 90 Ptr<EnergySource> GetEnergySource (void) const; |
91 | 91 |
92 » /** | 92 /** |
93 » * \returns power Amount of power currently provided by the harvester. | 93 * \returns power Amount of power currently provided by the harvester. |
94 » * | 94 * |
95 » * This method is called by the energy source connected to the harvester
in order | 95 * This method is called by the energy source connected to the harvester in or
der |
96 » * to determine the amount of energy that the harvester provided since l
ast update. | 96 * to determine the amount of energy that the harvester provided since last up
date. |
97 » */ | 97 */ |
98 » double GetPower (void) const; | 98 double GetPower (void) const; |
99 | 99 |
100 private: | 100 private: |
101 » /** | 101 /** |
102 » * | 102 * |
103 » * Defined in ns3::Object | 103 * Defined in ns3::Object |
104 » */ | 104 */ |
105 » virtual void DoDispose (void); | 105 virtual void DoDispose (void); |
106 | 106 |
107 » /** | 107 /** |
108 » * This method is called by the GetPower method and it needs to be imple
mented by the | 108 * This method is called by the GetPower method and it needs to be implemented
by the |
109 » * subclasses of the energy harvester. It returns the actual amount of p
ower that is | 109 * subclasses of the energy harvester. It returns the actual amount of power t
hat is |
110 » * currently provided by the energy harvester. | 110 * currently provided by the energy harvester. |
111 » * | 111 * |
112 » * This method should be used to connect the logic behind the particular
implementation | 112 * This method should be used to connect the logic behind the particular imple
mentation |
113 » * of the energy harvester with the energy source. | 113 * of the energy harvester with the energy source. |
114 » */ | 114 */ |
115 » virtual double DoGetPower (void) const; | 115 virtual double DoGetPower (void) const; |
116 | 116 |
117 private: | 117 private: |
118 » /** | 118 /** |
119 » * Pointer to node containing this EnergyHarvester. Used by helper class
to make | 119 * Pointer to node containing this EnergyHarvester. Used by helper class to ma
ke |
120 » * sure energy harvesters are installed onto the corresponding node. | 120 * sure energy harvesters are installed onto the corresponding node. |
121 » */ | 121 */ |
122 » Ptr<Node> m_node; | 122 Ptr<Node> m_node; |
123 | 123 |
124 » /** | 124 /** |
125 » * Pointer to the Energy Source to which this EnergyHarvester is connect
ed. Used | 125 * Pointer to the Energy Source to which this EnergyHarvester is connected. Us
ed |
126 » * by helper class to make sure energy harvesters are installed onto the | 126 * by helper class to make sure energy harvesters are installed onto the |
127 » * corresponding energy source. | 127 * corresponding energy source. |
128 » */ | 128 */ |
129 » Ptr<EnergySource> m_energySource; | 129 Ptr<EnergySource> m_energySource; |
130 | 130 |
131 protected: | 131 protected: |
132 | |
133 | 132 |
134 }; | 133 }; |
135 ···· | 134 ···· |
136 } // namespace ns3 | 135 } // namespace ns3 |
137 | 136 |
138 | |
139 #endif /* defined(ENERGY_HARVESTER_H) */ | 137 #endif /* defined(ENERGY_HARVESTER_H) */ |
LEFT | RIGHT |