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) 2005,2006 INRIA | 3 * Copyright (c) 2005,2006 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 |
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 * GNU General Public License for more details. | 12 * GNU General Public License for more details. |
13 * | 13 * |
14 * You should have received a copy of the GNU General Public License | 14 * You should have received a copy of the GNU General Public License |
15 * along with this program; if not, write to the Free Software | 15 * along with this program; if not, write to the Free Software |
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
17 * | 17 * |
18 * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr> | 18 * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr> |
19 */ | 19 */ |
20 #include "ns3/core-config.h" | 20 #include "ns3/core-config.h" |
21 #include "simulator.h" | 21 #include "simulator.h" |
22 #include "simulator-impl.h" | 22 #include "simulator-impl.h" |
23 #include "scheduler.h" | 23 #include "scheduler.h" |
24 #include "map-scheduler.h" | 24 #include "map-scheduler.h" |
25 #include "event-impl.h" | 25 #include "event-impl.h" |
| 26 #include "des-metrics.h" |
26 | 27 |
27 #include "ptr.h" | 28 #include "ptr.h" |
28 #include "string.h" | 29 #include "string.h" |
29 #include "object-factory.h" | 30 #include "object-factory.h" |
30 #include "global-value.h" | 31 #include "global-value.h" |
31 #include "assert.h" | 32 #include "assert.h" |
32 #include "log.h" | 33 #include "log.h" |
33 | 34 |
34 #include <cmath> | 35 #include <cmath> |
35 #include <fstream> | 36 #include <fstream> |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 } | 243 } |
243 | 244 |
244 EventId | 245 EventId |
245 Simulator::ScheduleNow (const Ptr<EventImpl> &ev) | 246 Simulator::ScheduleNow (const Ptr<EventImpl> &ev) |
246 { | 247 { |
247 return DoScheduleNow (GetPointer (ev)); | 248 return DoScheduleNow (GetPointer (ev)); |
248 } | 249 } |
249 void | 250 void |
250 Simulator::ScheduleWithContext (uint32_t context, const Time &delay, EventImpl *
impl) | 251 Simulator::ScheduleWithContext (uint32_t context, const Time &delay, EventImpl *
impl) |
251 { | 252 { |
| 253 #ifdef ENABLE_DES_METRICS |
| 254 DesMetrics::Get ()->TraceWithContext (context, Now (), delay); |
| 255 #endif |
252 return GetImpl ()->ScheduleWithContext (context, delay, impl); | 256 return GetImpl ()->ScheduleWithContext (context, delay, impl); |
253 } | 257 } |
254 EventId | 258 EventId |
255 Simulator::ScheduleDestroy (const Ptr<EventImpl> &ev) | 259 Simulator::ScheduleDestroy (const Ptr<EventImpl> &ev) |
256 { | 260 { |
257 return DoScheduleDestroy (GetPointer (ev)); | 261 return DoScheduleDestroy (GetPointer (ev)); |
258 } | 262 } |
259 EventId· | 263 EventId· |
260 Simulator::DoSchedule (Time const &time, EventImpl *impl) | 264 Simulator::DoSchedule (Time const &time, EventImpl *impl) |
261 { | 265 { |
| 266 #ifdef ENABLE_DES_METRICS |
| 267 DesMetrics::Get ()->Trace (Now (), time); |
| 268 #endif |
262 return GetImpl ()->Schedule (time, impl); | 269 return GetImpl ()->Schedule (time, impl); |
263 } | 270 } |
264 EventId· | 271 EventId· |
265 Simulator::DoScheduleNow (EventImpl *impl) | 272 Simulator::DoScheduleNow (EventImpl *impl) |
266 { | 273 { |
| 274 #ifdef ENABLE_DES_METRICS |
| 275 DesMetrics::Get ()->Trace (Now (), Time (0)); |
| 276 #endif |
267 return GetImpl ()->ScheduleNow (impl); | 277 return GetImpl ()->ScheduleNow (impl); |
268 } | 278 } |
269 EventId· | 279 EventId· |
270 Simulator::DoScheduleDestroy (EventImpl *impl) | 280 Simulator::DoScheduleDestroy (EventImpl *impl) |
271 { | 281 { |
272 return GetImpl ()->ScheduleDestroy (impl); | 282 return GetImpl ()->ScheduleDestroy (impl); |
273 } | 283 } |
274 | 284 |
275 | 285 |
276 EventId | 286 EventId |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
390 Simulator::GetImplementation (void) | 400 Simulator::GetImplementation (void) |
391 { | 401 { |
392 NS_LOG_FUNCTION_NOARGS (); | 402 NS_LOG_FUNCTION_NOARGS (); |
393 return GetImpl (); | 403 return GetImpl (); |
394 } | 404 } |
395 | 405 |
396 | 406 |
397 | 407 |
398 } // namespace ns3 | 408 } // namespace ns3 |
399 | 409 |
LEFT | RIGHT |