1.1 --- a/src/simulator/event-impl.h Wed Oct 15 15:01:12 2008 +0200
1.2 +++ b/src/simulator/event-impl.h Thu Nov 12 13:01:01 2009 +0100
1.3 @@ -21,6 +21,7 @@
1.4 #define EVENT_IMPL_H
1.5
1.6 #include <stdint.h>
1.7 +#include "ns3/simple-ref-count.h"
1.8
1.9 namespace ns3 {
1.10
1.11 @@ -35,12 +36,10 @@
1.12 * most subclasses are usually created by one of the many Simulator::Schedule
1.13 * methods.
1.14 */
1.15 -class EventImpl
1.16 +class EventImpl : public SimpleRefCount<EventImpl>
1.17 {
1.18 public:
1.19 EventImpl ();
1.20 - inline void Ref (void) const;
1.21 - inline void Unref (void) const;
1.22 virtual ~EventImpl () = 0;
1.23 /**
1.24 * Called by the simulation engine to notify the event that it has expired.
1.25 @@ -64,30 +63,8 @@
1.26
1.27 private:
1.28 bool m_cancel;
1.29 - mutable uint32_t m_count;
1.30 };
1.31
1.32 -}; // namespace ns3
1.33 -
1.34 -namespace ns3 {
1.35 -
1.36 -void
1.37 -EventImpl::Ref (void) const
1.38 -{
1.39 - m_count++;
1.40 -}
1.41 -
1.42 -void
1.43 -EventImpl::Unref (void) const
1.44 -{
1.45 - uint32_t c;
1.46 - c = --m_count;
1.47 - if (c == 0)
1.48 - {
1.49 - delete this;
1.50 - }
1.51 -}
1.52 -
1.53 } // namespace ns3
1.54
1.55 #endif /* EVENT_IMPL_H */