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) 2005 INRIA | 3 * Copyright (c) 2005 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 13 matching lines...) Expand all Loading... |
24 #include "event-id.h" | 24 #include "event-id.h" |
25 #include "event-impl.h" | 25 #include "event-impl.h" |
26 #include "make-event.h" | 26 #include "make-event.h" |
27 #include "nstime.h" | 27 #include "nstime.h" |
28 | 28 |
29 #include "object-factory.h" | 29 #include "object-factory.h" |
30 | 30 |
31 #include <stdint.h> | 31 #include <stdint.h> |
32 #include <string> | 32 #include <string> |
33 | 33 |
| 34 #include "ns3/ns3-module.h" |
| 35 #define NS3_MODULE NS3_CORE_MODULE |
| 36 #include "ns3/ns3-export.h" |
| 37 |
34 /** | 38 /** |
35 * @file | 39 * @file |
36 * @ingroup simulator | 40 * @ingroup simulator |
37 * ns3::Simulator declaration. | 41 * ns3::Simulator declaration. |
38 */ | 42 */ |
39 | 43 |
40 namespace ns3 { | 44 namespace ns3 { |
41 | 45 |
42 class SimulatorImpl; | 46 class SimulatorImpl; |
43 class Scheduler; | 47 class Scheduler; |
(...skipping 14 matching lines...) Expand all Loading... |
58 * not possible to specify event expiration times with anything better | 62 * not possible to specify event expiration times with anything better |
59 * than this user-specified accuracy. Events whose expiration time is | 63 * than this user-specified accuracy. Events whose expiration time is |
60 * the same modulo this accuracy are scheduled in FIFO order: the· | 64 * the same modulo this accuracy are scheduled in FIFO order: the· |
61 * first event inserted in the scheduling queue is scheduled to· | 65 * first event inserted in the scheduling queue is scheduled to· |
62 * expire first. | 66 * expire first. |
63 *· | 67 *· |
64 * A simple example of how to use the Simulator class to schedule events | 68 * A simple example of how to use the Simulator class to schedule events |
65 * is shown in sample-simulator.cc: | 69 * is shown in sample-simulator.cc: |
66 * @include src/core/examples/sample-simulator.cc | 70 * @include src/core/examples/sample-simulator.cc |
67 */ | 71 */ |
68 class Simulator· | 72 class NS3_EXPORT Simulator· |
69 { | 73 { |
70 public: | 74 public: |
71 /** | 75 /** |
72 * @param [in] impl A new simulator implementation. | 76 * @param [in] impl A new simulator implementation. |
73 * | 77 * |
74 * The simulator provides a mechanism to swap out different implementations. | 78 * The simulator provides a mechanism to swap out different implementations. |
75 * For example, the default implementation is a single-threaded simulator | 79 * For example, the default implementation is a single-threaded simulator |
76 * that performs no realtime synchronization. By calling this method, you | 80 * that performs no realtime synchronization. By calling this method, you |
77 * can substitute in a new simulator implementation that might be multi- | 81 * can substitute in a new simulator implementation that might be multi- |
78 * threaded and synchronize events to a realtime clock. | 82 * threaded and synchronize events to a realtime clock. |
(...skipping 1276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1355 * current simulation time. | 1359 * current simulation time. |
1356 * | 1360 * |
1357 * This is really a shortcut for the ns3::Simulator::Now method. | 1361 * This is really a shortcut for the ns3::Simulator::Now method. |
1358 * It is typically used as shown below to schedule an event | 1362 * It is typically used as shown below to schedule an event |
1359 * which expires at the absolute time "2 seconds": | 1363 * which expires at the absolute time "2 seconds": |
1360 * @code | 1364 * @code |
1361 * Simulator::Schedule (Seconds (2.0) - Now (), &my_function); | 1365 * Simulator::Schedule (Seconds (2.0) - Now (), &my_function); |
1362 * @endcode | 1366 * @endcode |
1363 * @return The current simulation time. | 1367 * @return The current simulation time. |
1364 */ | 1368 */ |
1365 Time Now (void); | 1369 NS3_EXPORT Time Now (void); |
1366 | 1370 |
1367 } // namespace ns3 | 1371 } // namespace ns3 |
1368 | 1372 |
1369 | 1373 |
1370 /******************************************************************** | 1374 /******************************************************************** |
1371 * Implementation of the templates declared above. | 1375 * Implementation of the templates declared above. |
1372 ********************************************************************/ | 1376 ********************************************************************/ |
1373 | 1377 |
1374 namespace ns3 { | 1378 namespace ns3 { |
1375 | 1379 |
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1774 typename T1, typename T2, typename T3, typename T4, typename T5, typen
ame T6> | 1778 typename T1, typename T2, typename T3, typename T4, typename T5, typen
ame T6> |
1775 EventId | 1779 EventId |
1776 Simulator::ScheduleDestroy (void (*f)(U1,U2,U3,U4,U5,U6), T1 a1, T2 a2, T3 a3, T
4 a4, T5 a5, T6 a6) | 1780 Simulator::ScheduleDestroy (void (*f)(U1,U2,U3,U4,U5,U6), T1 a1, T2 a2, T3 a3, T
4 a4, T5 a5, T6 a6) |
1777 { | 1781 { |
1778 return DoScheduleDestroy (MakeEvent (f, a1, a2, a3, a4, a5, a6)); | 1782 return DoScheduleDestroy (MakeEvent (f, a1, a2, a3, a4, a5, a6)); |
1779 } | 1783 } |
1780 | 1784 |
1781 } // namespace ns3 | 1785 } // namespace ns3 |
1782 | 1786 |
1783 #endif /* SIMULATOR_H */ | 1787 #endif /* SIMULATOR_H */ |
OLD | NEW |