OLD | NEW |
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) 2008 INRIA | 3 * Copyright (c) 2008 INRIA |
4 * Copyright (c) 2010 Network Security Lab, University of Washington, Seattle. | 4 * Copyright (c) 2010 Network Security Lab, University of Washington, Seattle. |
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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 m_sources.push_back (source); | 111 m_sources.push_back (source); |
112 } | 112 } |
113 | 113 |
114 /* | 114 /* |
115 * Private functions start here. | 115 * Private functions start here. |
116 */ | 116 */ |
117 | 117 |
118 void | 118 void |
119 EnergySourceContainer::DoDispose (void) | 119 EnergySourceContainer::DoDispose (void) |
120 { | 120 { |
| 121 // call Object::Dispose for all EnergySource objects |
| 122 for (std::vector< Ptr<EnergySource> >::iterator i = m_sources.begin (); |
| 123 i != m_sources.end (); i++) |
| 124 { |
| 125 (*i)->DisposeDeviceModels (); |
| 126 (*i)->Dispose (); |
| 127 } |
121 m_sources.clear (); | 128 m_sources.clear (); |
122 } | 129 } |
123 | 130 |
124 void | 131 void |
125 EnergySourceContainer::DoStart (void) | 132 EnergySourceContainer::DoStart (void) |
126 { | 133 { |
127 // call Object::Start for all EnergySource objects | 134 // call Object::Start for all EnergySource objects |
128 for (std::vector< Ptr<EnergySource> >::iterator i = m_sources.begin (); | 135 for (std::vector< Ptr<EnergySource> >::iterator i = m_sources.begin (); |
129 i != m_sources.end (); i++) | 136 i != m_sources.end (); i++) |
130 { | 137 { |
131 (*i)->Start (); | 138 (*i)->Start (); |
| 139 (*i)->StartDeviceModels (); |
132 } | 140 } |
133 } | 141 } |
134 | 142 |
135 } // namespace ns3 | 143 } // namespace ns3 |
OLD | NEW |