LEFT | RIGHT |
(no file at all) | |
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) 2010 Network Security Lab, University of Washington, Seattle. | 3 * Copyright (c) 2010 Network Security Lab, University of Washington, Seattle. |
4 * | 4 * |
5 * This program is free software; you can redistribute it and/or modify | 5 * This program is free software; you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 2 as | 6 * it under the terms of the GNU General Public License version 2 as |
7 * published by the Free Software Foundation; | 7 * published by the Free Software Foundation; |
8 * | 8 * |
9 * This program is distributed in the hope that it will be useful, | 9 * This program is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 NS_LOG_FUNCTION (this); | 194 NS_LOG_FUNCTION (this); |
195 // notify all device energy models installed on node | 195 // notify all device energy models installed on node |
196 DeviceEnergyModelContainer::Iterator i; | 196 DeviceEnergyModelContainer::Iterator i; |
197 for (i = m_models.Begin (); i != m_models.End (); i++) | 197 for (i = m_models.Begin (); i != m_models.End (); i++) |
198 { | 198 { |
199 (*i)->HandleEnergyDepletion (); | 199 (*i)->HandleEnergyDepletion (); |
200 } | 200 } |
201 } | 201 } |
202 | 202 |
203 void | 203 void |
| 204 EnergySource::NotifyEnergyRecharged (void) |
| 205 { |
| 206 NS_LOG_FUNCTION (this); |
| 207 // notify all device energy models installed on node |
| 208 DeviceEnergyModelContainer::Iterator i; |
| 209 for (i = m_models.Begin (); i != m_models.End (); i++) |
| 210 { |
| 211 (*i)->HandleEnergyRecharged (); |
| 212 } |
| 213 } |
| 214 |
| 215 void |
204 EnergySource::BreakDeviceEnergyModelRefCycle (void) | 216 EnergySource::BreakDeviceEnergyModelRefCycle (void) |
205 { | 217 { |
206 NS_LOG_FUNCTION (this); | 218 NS_LOG_FUNCTION (this); |
207 m_models.Clear (); | 219 m_models.Clear (); |
208 m_harvesters.clear (); | 220 m_harvesters.clear (); |
209 m_node = NULL; | 221 m_node = NULL; |
210 } | 222 } |
211 | 223 |
212 } // namespace ns3 | 224 } // namespace ns3 |
LEFT | RIGHT |