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 |
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 #ifndef EVENT_ID_H | 20 #ifndef EVENT_ID_H |
21 #define EVENT_ID_H | 21 #define EVENT_ID_H |
22 | 22 |
23 #include <stdint.h> | 23 #include <stdint.h> |
24 #include "ptr.h" | 24 #include "ptr.h" |
25 #include "event-impl.h" | 25 #include "event-impl.h" |
26 | 26 |
| 27 #include "ns3/ns3-module.h" |
| 28 #define NS3_MODULE NS3_CORE_MODULE |
| 29 #include "ns3/ns3-export.h" |
| 30 |
27 /** | 31 /** |
28 * \file | 32 * \file |
29 * \ingroup events | 33 * \ingroup events |
30 * ns3::EventId declarations. | 34 * ns3::EventId declarations. |
31 */ | 35 */ |
32 | 36 |
33 namespace ns3 { | 37 namespace ns3 { |
34 | 38 |
35 class EventImpl; | 39 class EventImpl; |
36 | 40 |
37 /** | 41 /** |
38 * \ingroup events | 42 * \ingroup events |
39 * \brief An identifier for simulation events. | 43 * \brief An identifier for simulation events. |
40 * | 44 * |
41 * Each EventId identifies a unique event scheduled with one | 45 * Each EventId identifies a unique event scheduled with one |
42 * of the many Simulator::Schedule() methods. This EventId can | 46 * of the many Simulator::Schedule() methods. This EventId can |
43 * be used to cancel or remove events after they are scheduled | 47 * be used to cancel or remove events after they are scheduled |
44 * with Simulator::Cancel() or Simulator::Remove(). | 48 * with Simulator::Cancel() or Simulator::Remove(). |
45 * | 49 * |
46 * The important thing to remember about this class is that | 50 * The important thing to remember about this class is that |
47 * every variable of this type is _always_ in a valid state,· | 51 * every variable of this type is _always_ in a valid state,· |
48 * even when it has not been assigned an EventId coming from a | 52 * even when it has not been assigned an EventId coming from a |
49 * Simulator::Schedule() method: calling Simulator::Cancel(), IsRunning(), | 53 * Simulator::Schedule() method: calling Simulator::Cancel(), IsRunning(), |
50 * IsExpired() or passing around instances of this object | 54 * IsExpired() or passing around instances of this object |
51 * will not result in crashes or memory leaks. | 55 * will not result in crashes or memory leaks. |
52 */ | 56 */ |
53 class EventId { | 57 class NS3_EXPORT EventId { |
54 public: | 58 public: |
55 /** Default constructor. This EventId does nothing. */ | 59 /** Default constructor. This EventId does nothing. */ |
56 EventId (); | 60 EventId (); |
57 /** | 61 /** |
58 * Construct a real event. | 62 * Construct a real event. |
59 * | 63 * |
60 * \param [in] impl The implementation of this event. | 64 * \param [in] impl The implementation of this event. |
61 * \param [in] ts The virtual time stamp this event should occur. | 65 * \param [in] ts The virtual time stamp this event should occur. |
62 * \param [in] context The execution context for this event. | 66 * \param [in] context The execution context for this event. |
63 * \param [in] uid The unique id for this EventId. | 67 * \param [in] uid The unique id for this EventId. |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 inline·· | 155 inline·· |
152 bool | 156 bool |
153 operator < (const EventId &a, const EventId &b) | 157 operator < (const EventId &a, const EventId &b) |
154 { | 158 { |
155 return (a.GetTs () < b.GetTs ()); | 159 return (a.GetTs () < b.GetTs ()); |
156 } | 160 } |
157 | 161 |
158 } // namespace ns3 | 162 } // namespace ns3 |
159 | 163 |
160 #endif /* EVENT_ID_H */ | 164 #endif /* EVENT_ID_H */ |
OLD | NEW |