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) 2006 Georgia Tech Research Corporation, INRIA | 3 * Copyright (c) 2006 Georgia Tech Research Corporation, INRIA |
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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 Node::GetSystemId (void) const | 121 Node::GetSystemId (void) const |
122 { | 122 { |
123 NS_LOG_FUNCTION (this); | 123 NS_LOG_FUNCTION (this); |
124 return m_sid; | 124 return m_sid; |
125 } | 125 } |
126 | 126 |
127 uint32_t | 127 uint32_t |
128 Node::AddDevice (Ptr<NetDevice> device) | 128 Node::AddDevice (Ptr<NetDevice> device) |
129 { | 129 { |
130 NS_LOG_FUNCTION (this << device); | 130 NS_LOG_FUNCTION (this << device); |
131 uint32_t index = m_devices.size (); | 131 uint32_t index = static_cast<uint32_t> (m_devices.size ()); |
132 m_devices.push_back (device); | 132 m_devices.push_back (device); |
133 device->SetNode (this); | 133 device->SetNode (this); |
134 device->SetIfIndex (index); | 134 device->SetIfIndex (index); |
135 device->SetReceiveCallback (MakeCallback (&Node::NonPromiscReceiveFromDevice,
this)); | 135 device->SetReceiveCallback (MakeCallback (&Node::NonPromiscReceiveFromDevice,
this)); |
136 Simulator::ScheduleWithContext (GetId (), Seconds (0.0),· | 136 Simulator::ScheduleWithContext (GetId (), Seconds (0.0),· |
137 &NetDevice::Initialize, device); | 137 &NetDevice::Initialize, device); |
138 NotifyDeviceAdded (device); | 138 NotifyDeviceAdded (device); |
139 return index; | 139 return index; |
140 } | 140 } |
141 Ptr<NetDevice> | 141 Ptr<NetDevice> |
142 Node::GetDevice (uint32_t index) const | 142 Node::GetDevice (uint32_t index) const |
143 { | 143 { |
144 NS_LOG_FUNCTION (this << index); | 144 NS_LOG_FUNCTION (this << index); |
145 NS_ASSERT_MSG (index < m_devices.size (), "Device index " << index << | 145 NS_ASSERT_MSG (index < m_devices.size (), "Device index " << index << |
146 " is out of range (only have " << m_devices.size () << " device
s)."); | 146 " is out of range (only have " << m_devices.size () << " device
s)."); |
147 return m_devices[index]; | 147 return m_devices[index]; |
148 } | 148 } |
149 uint32_t· | 149 uint32_t· |
150 Node::GetNDevices (void) const | 150 Node::GetNDevices (void) const |
151 { | 151 { |
152 NS_LOG_FUNCTION (this); | 152 NS_LOG_FUNCTION (this); |
153 return m_devices.size (); | 153 return static_cast<uint32_t> (m_devices.size ()); |
154 } | 154 } |
155 | 155 |
156 uint32_t· | 156 uint32_t· |
157 Node::AddApplication (Ptr<Application> application) | 157 Node::AddApplication (Ptr<Application> application) |
158 { | 158 { |
159 NS_LOG_FUNCTION (this << application); | 159 NS_LOG_FUNCTION (this << application); |
160 uint32_t index = m_applications.size (); | 160 uint32_t index = static_cast<uint32_t> (m_applications.size ()); |
161 m_applications.push_back (application); | 161 m_applications.push_back (application); |
162 application->SetNode (this); | 162 application->SetNode (this); |
163 Simulator::ScheduleWithContext (GetId (), Seconds (0.0),· | 163 Simulator::ScheduleWithContext (GetId (), Seconds (0.0),· |
164 &Application::Initialize, application); | 164 &Application::Initialize, application); |
165 return index; | 165 return index; |
166 } | 166 } |
167 Ptr<Application>· | 167 Ptr<Application>· |
168 Node::GetApplication (uint32_t index) const | 168 Node::GetApplication (uint32_t index) const |
169 { | 169 { |
170 NS_LOG_FUNCTION (this << index); | 170 NS_LOG_FUNCTION (this << index); |
171 NS_ASSERT_MSG (index < m_applications.size (), "Application index " << index <
< | 171 NS_ASSERT_MSG (index < m_applications.size (), "Application index " << index <
< |
172 " is out of range (only have " << m_applications.size () << " a
pplications)."); | 172 " is out of range (only have " << m_applications.size () << " a
pplications)."); |
173 return m_applications[index]; | 173 return m_applications[index]; |
174 } | 174 } |
175 uint32_t· | 175 uint32_t· |
176 Node::GetNApplications (void) const | 176 Node::GetNApplications (void) const |
177 { | 177 { |
178 NS_LOG_FUNCTION (this); | 178 NS_LOG_FUNCTION (this); |
179 return m_applications.size (); | 179 return static_cast<uint32_t> (m_applications.size ()); |
180 } | 180 } |
181 | 181 |
182 void· | 182 void· |
183 Node::DoDispose () | 183 Node::DoDispose () |
184 { | 184 { |
185 NS_LOG_FUNCTION (this); | 185 NS_LOG_FUNCTION (this); |
186 m_deviceAdditionListeners.clear (); | 186 m_deviceAdditionListeners.clear (); |
187 m_handlers.clear (); | 187 m_handlers.clear (); |
188 for (std::vector<Ptr<NetDevice> >::iterator i = m_devices.begin (); | 188 for (std::vector<Ptr<NetDevice> >::iterator i = m_devices.begin (); |
189 i != m_devices.end (); i++) | 189 i != m_devices.end (); i++) |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
362 NS_LOG_FUNCTION (this << device); | 362 NS_LOG_FUNCTION (this << device); |
363 for (DeviceAdditionListenerList::iterator i = m_deviceAdditionListeners.begin
(); | 363 for (DeviceAdditionListenerList::iterator i = m_deviceAdditionListeners.begin
(); |
364 i != m_deviceAdditionListeners.end (); i++) | 364 i != m_deviceAdditionListeners.end (); i++) |
365 { | 365 { |
366 (*i) (device); | 366 (*i) (device); |
367 }·· | 367 }·· |
368 } | 368 } |
369 · | 369 · |
370 | 370 |
371 } // namespace ns3 | 371 } // namespace ns3 |
LEFT | RIGHT |