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) 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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 { | 100 { |
101 NS_LOG_FUNCTION (this << i); | 101 NS_LOG_FUNCTION (this << i); |
102 return m_harvesters[i]; | 102 return m_harvesters[i]; |
103 } | 103 } |
104 | 104 |
105 void | 105 void |
106 EnergyHarvesterContainer::Add (EnergyHarvesterContainer container) | 106 EnergyHarvesterContainer::Add (EnergyHarvesterContainer container) |
107 { | 107 { |
108 NS_LOG_FUNCTION (this << &container); | 108 NS_LOG_FUNCTION (this << &container); |
109 for (Iterator i = container.Begin (); i != container.End (); i++) | 109 for (Iterator i = container.Begin (); i != container.End (); i++) |
110 { | 110 { |
111 m_harvesters.push_back (*i); | 111 m_harvesters.push_back (*i); |
112 } | 112 } |
113 } | 113 } |
114 | 114 |
115 void | 115 void |
116 EnergyHarvesterContainer::Add (Ptr<EnergyHarvester> harvester) | 116 EnergyHarvesterContainer::Add (Ptr<EnergyHarvester> harvester) |
117 { | 117 { |
118 NS_LOG_FUNCTION (this << harvester); | 118 NS_LOG_FUNCTION (this << harvester); |
119 NS_ASSERT (harvester != 0); | 119 NS_ASSERT (harvester != 0); |
120 m_harvesters.push_back (harvester); | 120 m_harvesters.push_back (harvester); |
121 } | 121 } |
122 | 122 |
(...skipping 17 matching lines...) Expand all Loading... |
140 /* | 140 /* |
141 * Private functions start here. | 141 * Private functions start here. |
142 */ | 142 */ |
143 | 143 |
144 void | 144 void |
145 EnergyHarvesterContainer::DoDispose (void) | 145 EnergyHarvesterContainer::DoDispose (void) |
146 { | 146 { |
147 // call Object::Dispose for all EnergyHarvester objects | 147 // call Object::Dispose for all EnergyHarvester objects |
148 for (std::vector< Ptr<EnergyHarvester> >::iterator i = m_harvesters.begin (); | 148 for (std::vector< Ptr<EnergyHarvester> >::iterator i = m_harvesters.begin (); |
149 i != m_harvesters.end (); i++) | 149 i != m_harvesters.end (); i++) |
150 { | 150 { |
151 (*i)->Dispose (); | 151 (*i)->Dispose (); |
152 } | 152 } |
153 m_harvesters.clear (); | 153 m_harvesters.clear (); |
154 } | 154 } |
155 | 155 |
156 void | 156 void |
157 EnergyHarvesterContainer::DoInitialize (void) | 157 EnergyHarvesterContainer::DoInitialize (void) |
158 { | 158 { |
159 // call Object::Initialize for all EnergyHarvester objects | 159 // call Object::Initialize for all EnergyHarvester objects |
160 for (std::vector< Ptr<EnergyHarvester> >::iterator i = m_harvesters.begin (); | 160 for (std::vector< Ptr<EnergyHarvester> >::iterator i = m_harvesters.begin (); |
161 i != m_harvesters.end (); i++) | 161 i != m_harvesters.end (); i++) |
162 { | 162 { |
163 (*i)->Initialize (); | 163 (*i)->Initialize (); |
164 } | 164 } |
165 } | 165 } |
166 | 166 |
167 } // namespace ns3 | 167 } // namespace ns3 |
LEFT | RIGHT |