avoid using Ptr<EventImpl>
This commit is contained in:
@@ -185,14 +185,14 @@ DefaultSimulatorImpl::Stop (Time const &time)
|
||||
// Schedule an event for a _relative_ time in the future.
|
||||
//
|
||||
EventId
|
||||
DefaultSimulatorImpl::Schedule (Time const &time, const Ptr<EventImpl> &event)
|
||||
DefaultSimulatorImpl::Schedule (Time const &time, EventImpl *event)
|
||||
{
|
||||
Time tAbsolute = time + Now();
|
||||
|
||||
NS_ASSERT (tAbsolute.IsPositive ());
|
||||
NS_ASSERT (tAbsolute >= TimeStep (m_currentTs));
|
||||
Scheduler::Event ev;
|
||||
ev.impl = GetPointer (event);
|
||||
ev.impl = event;
|
||||
ev.key.m_ts = (uint64_t) tAbsolute.GetTimeStep ();
|
||||
ev.key.m_uid = m_uid;
|
||||
m_uid++;
|
||||
@@ -202,10 +202,10 @@ DefaultSimulatorImpl::Schedule (Time const &time, const Ptr<EventImpl> &event)
|
||||
}
|
||||
|
||||
EventId
|
||||
DefaultSimulatorImpl::ScheduleNow (const Ptr<EventImpl> &event)
|
||||
DefaultSimulatorImpl::ScheduleNow (EventImpl *event)
|
||||
{
|
||||
Scheduler::Event ev;
|
||||
ev.impl = GetPointer (event);
|
||||
ev.impl = event;
|
||||
ev.key.m_ts = m_currentTs;
|
||||
ev.key.m_uid = m_uid;
|
||||
m_uid++;
|
||||
@@ -215,9 +215,9 @@ DefaultSimulatorImpl::ScheduleNow (const Ptr<EventImpl> &event)
|
||||
}
|
||||
|
||||
EventId
|
||||
DefaultSimulatorImpl::ScheduleDestroy (const Ptr<EventImpl> &event)
|
||||
DefaultSimulatorImpl::ScheduleDestroy (EventImpl *event)
|
||||
{
|
||||
EventId id (event, m_currentTs, 2);
|
||||
EventId id (Ptr<EventImpl> (event, false), m_currentTs, 2);
|
||||
m_destroyEvents.push_back (id);
|
||||
m_uid++;
|
||||
return id;
|
||||
|
||||
@@ -48,9 +48,9 @@ public:
|
||||
virtual Time Next (void) const;
|
||||
virtual void Stop (void);
|
||||
virtual void Stop (Time const &time);
|
||||
virtual EventId Schedule (Time const &time, const Ptr<EventImpl> &event);
|
||||
virtual EventId ScheduleNow (const Ptr<EventImpl> &event);
|
||||
virtual EventId ScheduleDestroy (const Ptr<EventImpl> &event);
|
||||
virtual EventId Schedule (Time const &time, EventImpl *event);
|
||||
virtual EventId ScheduleNow (EventImpl *event);
|
||||
virtual EventId ScheduleDestroy (EventImpl *event);
|
||||
virtual void Remove (const EventId &ev);
|
||||
virtual void Cancel (const EventId &ev);
|
||||
virtual bool IsExpired (const EventId &ev) const;
|
||||
|
||||
@@ -589,7 +589,7 @@ RealtimeSimulatorImpl::Stop (Time const &time)
|
||||
// Schedule an event for a _relative_ time in the future.
|
||||
//
|
||||
EventId
|
||||
RealtimeSimulatorImpl::Schedule (Time const &time, const Ptr<EventImpl> &impl)
|
||||
RealtimeSimulatorImpl::Schedule (Time const &time, EventImpl *impl)
|
||||
{
|
||||
NS_LOG_FUNCTION (time << impl);
|
||||
|
||||
@@ -605,7 +605,7 @@ RealtimeSimulatorImpl::Schedule (Time const &time, const Ptr<EventImpl> &impl)
|
||||
Time tAbsolute = Simulator::Now () + time;
|
||||
NS_ASSERT_MSG (tAbsolute.IsPositive (), "RealtimeSimulatorImpl::Schedule(): Negative time");
|
||||
NS_ASSERT_MSG (tAbsolute >= TimeStep (m_currentTs), "RealtimeSimulatorImpl::Schedule(): time < m_currentTs");
|
||||
ev.impl = GetPointer (impl);
|
||||
ev.impl = impl;
|
||||
ev.key.m_ts = (uint64_t) tAbsolute.GetTimeStep ();
|
||||
ev.key.m_uid = m_uid;
|
||||
m_uid++;
|
||||
@@ -618,14 +618,14 @@ RealtimeSimulatorImpl::Schedule (Time const &time, const Ptr<EventImpl> &impl)
|
||||
}
|
||||
|
||||
EventId
|
||||
RealtimeSimulatorImpl::ScheduleNow (const Ptr<EventImpl> &impl)
|
||||
RealtimeSimulatorImpl::ScheduleNow (EventImpl *impl)
|
||||
{
|
||||
NS_LOG_FUNCTION_NOARGS ();
|
||||
Scheduler::Event ev;
|
||||
{
|
||||
CriticalSection cs (m_mutex);
|
||||
|
||||
ev.impl = GetPointer (impl);
|
||||
ev.impl = impl;
|
||||
ev.key.m_ts = m_currentTs;
|
||||
ev.key.m_uid = m_uid;
|
||||
m_uid++;
|
||||
@@ -702,7 +702,7 @@ RealtimeSimulatorImpl::RealtimeNow (void) const
|
||||
}
|
||||
|
||||
EventId
|
||||
RealtimeSimulatorImpl::ScheduleDestroy (const Ptr<EventImpl> &impl)
|
||||
RealtimeSimulatorImpl::ScheduleDestroy (EventImpl *impl)
|
||||
{
|
||||
NS_LOG_FUNCTION_NOARGS ();
|
||||
|
||||
@@ -715,7 +715,7 @@ RealtimeSimulatorImpl::ScheduleDestroy (const Ptr<EventImpl> &impl)
|
||||
// overridden by the uid of 2 which identifies this as an event to be
|
||||
// executed at Simulator::Destroy time.
|
||||
//
|
||||
id = EventId (impl, m_currentTs, 2);
|
||||
id = EventId (Ptr<EventImpl> (impl, false), m_currentTs, 2);
|
||||
m_destroyEvents.push_back (id);
|
||||
m_uid++;
|
||||
}
|
||||
|
||||
@@ -61,29 +61,27 @@ public:
|
||||
RealtimeSimulatorImpl ();
|
||||
~RealtimeSimulatorImpl ();
|
||||
|
||||
void Destroy ();
|
||||
|
||||
bool IsFinished (void) const;
|
||||
Time Next (void) const;
|
||||
void Stop (void);
|
||||
void Stop (Time const &time);
|
||||
EventId Schedule (Time const &time, const Ptr<EventImpl> &event);
|
||||
EventId ScheduleNow (const Ptr<EventImpl> &event);
|
||||
virtual void Destroy ();
|
||||
virtual bool IsFinished (void) const;
|
||||
virtual Time Next (void) const;
|
||||
virtual void Stop (void);
|
||||
virtual void Stop (Time const &time);
|
||||
virtual EventId Schedule (Time const &time, EventImpl *event);
|
||||
virtual EventId ScheduleNow (EventImpl *event);
|
||||
virtual EventId ScheduleDestroy (EventImpl *event);
|
||||
virtual void Remove (const EventId &ev);
|
||||
virtual void Cancel (const EventId &ev);
|
||||
virtual bool IsExpired (const EventId &ev) const;
|
||||
virtual void Run (void);
|
||||
virtual void RunOneEvent (void);
|
||||
virtual Time Now (void) const;
|
||||
virtual Time GetDelayLeft (const EventId &id) const;
|
||||
virtual Time GetMaximumSimulationTime (void) const;
|
||||
virtual void SetScheduler (Ptr<Scheduler> scheduler);
|
||||
virtual Ptr<Scheduler> GetScheduler (void) const;
|
||||
EventId ScheduleRealtime (Time const &time, const Ptr<EventImpl> &event);
|
||||
EventId ScheduleRealtimeNow (const Ptr<EventImpl> &event);
|
||||
EventId ScheduleDestroy (const Ptr<EventImpl> &event);
|
||||
Time Now (void) const;
|
||||
Time RealtimeNow (void) const;
|
||||
void Remove (const EventId &ev);
|
||||
void Cancel (const EventId &ev);
|
||||
bool IsExpired (const EventId &ev) const;
|
||||
virtual void RunOneEvent (void);
|
||||
void Run (void);
|
||||
Time GetDelayLeft (const EventId &id) const;
|
||||
Time GetMaximumSimulationTime (void) const;
|
||||
|
||||
void SetScheduler (Ptr<Scheduler> scheduler);
|
||||
Ptr<Scheduler> GetScheduler (void) const;
|
||||
|
||||
void SetSynchronizationMode (RealtimeSimulatorImpl::SynchronizationMode mode);
|
||||
RealtimeSimulatorImpl::SynchronizationMode GetSynchronizationMode (void) const;
|
||||
|
||||
@@ -299,34 +299,9 @@ public:
|
||||
typename T1, typename T2, typename T3, typename T4, typename T5>
|
||||
static EventId ScheduleRealtimeNow (void (*f) (U1,U2,U3,U4,U5), T1 a1, T2 a2, T3 a3, T4 a4, T5 a5);
|
||||
|
||||
/**
|
||||
* Return the "current normalized real-time".
|
||||
*/
|
||||
static Time RealtimeNow (void);
|
||||
|
||||
/**
|
||||
* \param time delay until the event expires
|
||||
* \param event the event to schedule
|
||||
* \returns a unique identifier for the newly-scheduled event.
|
||||
*
|
||||
* This method will be typically used by language bindings
|
||||
* to delegate events to their own subclass of the EventImpl base class.
|
||||
*/
|
||||
static EventId ScheduleRealtime (Time const &time, const Ptr<EventImpl> &event);
|
||||
|
||||
/**
|
||||
* \param event the event to schedule
|
||||
* \returns a unique identifier for the newly-scheduled event.
|
||||
*
|
||||
* This method will be typically used by language bindings
|
||||
* to delegate events to their own subclass of the EventImpl base class.
|
||||
*/
|
||||
static EventId ScheduleRealtimeNow (const Ptr<EventImpl> &event);
|
||||
private:
|
||||
RealtimeSimulator ();
|
||||
~RealtimeSimulator ();
|
||||
|
||||
static RealtimeSimulatorImpl *GetRealtimeImpl (void);
|
||||
};
|
||||
|
||||
template <typename MEM, typename OBJ>
|
||||
|
||||
@@ -43,9 +43,9 @@ public:
|
||||
virtual Time Next (void) const = 0;
|
||||
virtual void Stop (void) = 0;
|
||||
virtual void Stop (Time const &time) = 0;
|
||||
virtual EventId Schedule (Time const &time, const Ptr<EventImpl> &event) = 0;
|
||||
virtual EventId ScheduleNow (const Ptr<EventImpl> &event) = 0;
|
||||
virtual EventId ScheduleDestroy (const Ptr<EventImpl> &event) = 0;
|
||||
virtual EventId Schedule (Time const &time, EventImpl *event) = 0;
|
||||
virtual EventId ScheduleNow (EventImpl *event) = 0;
|
||||
virtual EventId ScheduleDestroy (EventImpl *event) = 0;
|
||||
virtual void Remove (const EventId &ev) = 0;
|
||||
virtual void Cancel (const EventId &ev) = 0;
|
||||
virtual bool IsExpired (const EventId &ev) const = 0;
|
||||
|
||||
@@ -184,7 +184,7 @@ Simulator::GetDelayLeft (const EventId &id)
|
||||
return GetImpl ()->GetDelayLeft (id);
|
||||
}
|
||||
|
||||
Ptr<EventImpl>
|
||||
EventImpl *
|
||||
Simulator::MakeEvent (void (*f) (void))
|
||||
{
|
||||
NS_LOG_FUNCTION (f);
|
||||
@@ -205,49 +205,65 @@ Simulator::MakeEvent (void (*f) (void))
|
||||
private:
|
||||
F m_function;
|
||||
} *ev = new EventFunctionImpl0 (f);
|
||||
return Ptr<EventImpl> (ev, false);
|
||||
return ev;
|
||||
}
|
||||
|
||||
EventId
|
||||
Simulator::Schedule (Time const &time, const Ptr<EventImpl> &ev)
|
||||
{
|
||||
NS_LOG_FUNCTION (time << ev);
|
||||
return GetImpl ()->Schedule (time, ev);
|
||||
return DoSchedule (time, GetPointer (ev));
|
||||
}
|
||||
|
||||
EventId
|
||||
Simulator::ScheduleNow (const Ptr<EventImpl> &ev)
|
||||
{
|
||||
NS_LOG_FUNCTION (ev);
|
||||
return GetImpl ()->ScheduleNow (ev);
|
||||
return DoScheduleNow (GetPointer (ev));
|
||||
}
|
||||
|
||||
EventId
|
||||
Simulator::ScheduleDestroy (const Ptr<EventImpl> &ev)
|
||||
{
|
||||
NS_LOG_FUNCTION (ev);
|
||||
return GetImpl ()->ScheduleDestroy (ev);
|
||||
}
|
||||
return DoScheduleDestroy (GetPointer (ev));
|
||||
}
|
||||
EventId
|
||||
Simulator::DoSchedule (Time const &time, EventImpl *impl)
|
||||
{
|
||||
return GetImpl ()->Schedule (time, impl);
|
||||
}
|
||||
EventId
|
||||
Simulator::DoScheduleNow (EventImpl *impl)
|
||||
{
|
||||
return GetImpl ()->ScheduleNow (impl);
|
||||
}
|
||||
EventId
|
||||
Simulator::DoScheduleDestroy (EventImpl *impl)
|
||||
{
|
||||
return GetImpl ()->ScheduleDestroy (impl);
|
||||
}
|
||||
|
||||
|
||||
EventId
|
||||
Simulator::Schedule (Time const &time, void (*f) (void))
|
||||
{
|
||||
NS_LOG_FUNCTION (time << f);
|
||||
return Schedule (time, MakeEvent (f));
|
||||
return DoSchedule (time, MakeEvent (f));
|
||||
}
|
||||
|
||||
EventId
|
||||
Simulator::ScheduleNow (void (*f) (void))
|
||||
{
|
||||
NS_LOG_FUNCTION (f);
|
||||
return ScheduleNow (MakeEvent (f));
|
||||
return DoScheduleNow (MakeEvent (f));
|
||||
}
|
||||
|
||||
EventId
|
||||
Simulator::ScheduleDestroy (void (*f) (void))
|
||||
{
|
||||
NS_LOG_FUNCTION (f);
|
||||
return ScheduleDestroy (MakeEvent (f));
|
||||
return DoScheduleDestroy (MakeEvent (f));
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -619,40 +619,44 @@ private:
|
||||
Simulator ();
|
||||
~Simulator ();
|
||||
|
||||
static EventId DoSchedule (Time const &time, EventImpl *event);
|
||||
static EventId DoScheduleNow (EventImpl *event);
|
||||
static EventId DoScheduleDestroy (EventImpl *event);
|
||||
|
||||
template <typename MEM, typename OBJ>
|
||||
static Ptr<EventImpl> MakeEvent (MEM mem_ptr, OBJ obj);
|
||||
static EventImpl *MakeEvent (MEM mem_ptr, OBJ obj);
|
||||
template <typename MEM, typename OBJ,
|
||||
typename T1>
|
||||
static Ptr<EventImpl> MakeEvent (MEM mem_ptr, OBJ obj, T1 a1);
|
||||
static EventImpl *MakeEvent (MEM mem_ptr, OBJ obj, T1 a1);
|
||||
template <typename MEM, typename OBJ,
|
||||
typename T1, typename T2>
|
||||
static Ptr<EventImpl> MakeEvent (MEM mem_ptr, OBJ obj, T1 a1, T2 a2);
|
||||
static EventImpl * MakeEvent (MEM mem_ptr, OBJ obj, T1 a1, T2 a2);
|
||||
template <typename MEM, typename OBJ,
|
||||
typename T1, typename T2, typename T3>
|
||||
static Ptr<EventImpl> MakeEvent (MEM mem_ptr, OBJ obj, T1 a1, T2 a2, T3 a3);
|
||||
static EventImpl * MakeEvent (MEM mem_ptr, OBJ obj, T1 a1, T2 a2, T3 a3);
|
||||
template <typename MEM, typename OBJ,
|
||||
typename T1, typename T2, typename T3, typename T4>
|
||||
static Ptr<EventImpl> MakeEvent (MEM mem_ptr, OBJ obj, T1 a1, T2 a2, T3 a3, T4 a4);
|
||||
static EventImpl * MakeEvent (MEM mem_ptr, OBJ obj, T1 a1, T2 a2, T3 a3, T4 a4);
|
||||
template <typename MEM, typename OBJ,
|
||||
typename T1, typename T2, typename T3, typename T4, typename T5>
|
||||
static Ptr<EventImpl> MakeEvent (MEM mem_ptr, OBJ obj,
|
||||
static EventImpl * MakeEvent (MEM mem_ptr, OBJ obj,
|
||||
T1 a1, T2 a2, T3 a3, T4 a4, T5 a5);
|
||||
static Ptr<EventImpl> MakeEvent (void (*f) (void));
|
||||
static EventImpl * MakeEvent (void (*f) (void));
|
||||
template <typename U1,
|
||||
typename T1>
|
||||
static Ptr<EventImpl> MakeEvent (void (*f) (U1), T1 a1);
|
||||
static EventImpl * MakeEvent (void (*f) (U1), T1 a1);
|
||||
template <typename U1, typename U2,
|
||||
typename T1, typename T2>
|
||||
static Ptr<EventImpl> MakeEvent (void (*f) (U1,U2), T1 a1, T2 a2);
|
||||
static EventImpl * MakeEvent (void (*f) (U1,U2), T1 a1, T2 a2);
|
||||
template <typename U1, typename U2, typename U3,
|
||||
typename T1, typename T2, typename T3>
|
||||
static Ptr<EventImpl> MakeEvent (void (*f) (U1,U2,U3), T1 a1, T2 a2, T3 a3);
|
||||
static EventImpl * MakeEvent (void (*f) (U1,U2,U3), T1 a1, T2 a2, T3 a3);
|
||||
template <typename U1, typename U2, typename U3, typename U4,
|
||||
typename T1, typename T2, typename T3, typename T4>
|
||||
static Ptr<EventImpl> MakeEvent (void (*f) (U1,U2,U3,U4), T1 a1, T2 a2, T3 a3, T4 a4);
|
||||
static EventImpl * MakeEvent (void (*f) (U1,U2,U3,U4), T1 a1, T2 a2, T3 a3, T4 a4);
|
||||
template <typename U1, typename U2, typename U3, typename U4, typename U5,
|
||||
typename T1, typename T2, typename T3, typename T4, typename T5>
|
||||
static Ptr<EventImpl> MakeEvent (void (*f) (U1,U2,U3,U4,U5), T1 a1, T2 a2, T3 a3, T4 a4, T5 a5);
|
||||
static EventImpl * MakeEvent (void (*f) (U1,U2,U3,U4,U5), T1 a1, T2 a2, T3 a3, T4 a4, T5 a5);
|
||||
|
||||
static SimulatorImpl *GetImpl (void);
|
||||
static Ptr<SimulatorImpl> m_impl;
|
||||
@@ -673,7 +677,7 @@ private:
|
||||
*/
|
||||
Time Now (void);
|
||||
|
||||
}; // namespace ns3
|
||||
} // namespace ns3
|
||||
|
||||
|
||||
/********************************************************************
|
||||
@@ -694,7 +698,7 @@ struct EventMemberImplObjTraits<T *>
|
||||
};
|
||||
|
||||
template <typename MEM, typename OBJ>
|
||||
Ptr<EventImpl> Simulator::MakeEvent (MEM mem_ptr, OBJ obj)
|
||||
EventImpl * Simulator::MakeEvent (MEM mem_ptr, OBJ obj)
|
||||
{
|
||||
// zero argument version
|
||||
class EventMemberImpl0 : public EventImpl {
|
||||
@@ -711,13 +715,13 @@ Ptr<EventImpl> Simulator::MakeEvent (MEM mem_ptr, OBJ obj)
|
||||
OBJ m_obj;
|
||||
MEM m_function;
|
||||
} * ev = new EventMemberImpl0 (obj, mem_ptr);
|
||||
return Ptr<EventImpl> (ev, false);
|
||||
return ev;
|
||||
}
|
||||
|
||||
|
||||
template <typename MEM, typename OBJ,
|
||||
typename T1>
|
||||
Ptr<EventImpl> Simulator::MakeEvent (MEM mem_ptr, OBJ obj, T1 a1)
|
||||
EventImpl * Simulator::MakeEvent (MEM mem_ptr, OBJ obj, T1 a1)
|
||||
{
|
||||
// one argument version
|
||||
class EventMemberImpl1 : public EventImpl {
|
||||
@@ -737,12 +741,12 @@ Ptr<EventImpl> Simulator::MakeEvent (MEM mem_ptr, OBJ obj, T1 a1)
|
||||
MEM m_function;
|
||||
typename TypeTraits<T1>::ReferencedType m_a1;
|
||||
} *ev = new EventMemberImpl1 (obj, mem_ptr, a1);
|
||||
return Ptr<EventImpl> (ev, false);
|
||||
return ev;
|
||||
}
|
||||
|
||||
template <typename MEM, typename OBJ,
|
||||
typename T1, typename T2>
|
||||
Ptr<EventImpl> Simulator::MakeEvent (MEM mem_ptr, OBJ obj, T1 a1, T2 a2)
|
||||
EventImpl * Simulator::MakeEvent (MEM mem_ptr, OBJ obj, T1 a1, T2 a2)
|
||||
{
|
||||
// two argument version
|
||||
class EventMemberImpl2 : public EventImpl {
|
||||
@@ -764,12 +768,12 @@ Ptr<EventImpl> Simulator::MakeEvent (MEM mem_ptr, OBJ obj, T1 a1, T2 a2)
|
||||
typename TypeTraits<T1>::ReferencedType m_a1;
|
||||
typename TypeTraits<T2>::ReferencedType m_a2;
|
||||
} *ev = new EventMemberImpl2 (obj, mem_ptr, a1, a2);
|
||||
return Ptr<EventImpl> (ev, false);
|
||||
return ev;
|
||||
}
|
||||
|
||||
template <typename MEM, typename OBJ,
|
||||
typename T1, typename T2, typename T3>
|
||||
Ptr<EventImpl> Simulator::MakeEvent (MEM mem_ptr, OBJ obj, T1 a1, T2 a2, T3 a3)
|
||||
EventImpl * Simulator::MakeEvent (MEM mem_ptr, OBJ obj, T1 a1, T2 a2, T3 a3)
|
||||
{
|
||||
// three argument version
|
||||
class EventMemberImpl3 : public EventImpl {
|
||||
@@ -793,12 +797,12 @@ Ptr<EventImpl> Simulator::MakeEvent (MEM mem_ptr, OBJ obj, T1 a1, T2 a2, T3 a3)
|
||||
typename TypeTraits<T2>::ReferencedType m_a2;
|
||||
typename TypeTraits<T3>::ReferencedType m_a3;
|
||||
} *ev = new EventMemberImpl3 (obj, mem_ptr, a1, a2, a3);
|
||||
return Ptr<EventImpl> (ev, false);
|
||||
return ev;
|
||||
}
|
||||
|
||||
template <typename MEM, typename OBJ,
|
||||
typename T1, typename T2, typename T3, typename T4>
|
||||
Ptr<EventImpl> Simulator::MakeEvent (MEM mem_ptr, OBJ obj, T1 a1, T2 a2, T3 a3, T4 a4)
|
||||
EventImpl * Simulator::MakeEvent (MEM mem_ptr, OBJ obj, T1 a1, T2 a2, T3 a3, T4 a4)
|
||||
{
|
||||
// four argument version
|
||||
class EventMemberImpl4 : public EventImpl {
|
||||
@@ -824,12 +828,12 @@ Ptr<EventImpl> Simulator::MakeEvent (MEM mem_ptr, OBJ obj, T1 a1, T2 a2, T3 a3,
|
||||
typename TypeTraits<T3>::ReferencedType m_a3;
|
||||
typename TypeTraits<T4>::ReferencedType m_a4;
|
||||
} *ev = new EventMemberImpl4 (obj, mem_ptr, a1, a2, a3, a4);
|
||||
return Ptr<EventImpl> (ev, false);
|
||||
return ev;
|
||||
}
|
||||
|
||||
template <typename MEM, typename OBJ,
|
||||
typename T1, typename T2, typename T3, typename T4, typename T5>
|
||||
Ptr<EventImpl> Simulator::MakeEvent (MEM mem_ptr, OBJ obj,
|
||||
EventImpl * Simulator::MakeEvent (MEM mem_ptr, OBJ obj,
|
||||
T1 a1, T2 a2, T3 a3, T4 a4, T5 a5)
|
||||
{
|
||||
// five argument version
|
||||
@@ -858,11 +862,11 @@ Ptr<EventImpl> Simulator::MakeEvent (MEM mem_ptr, OBJ obj,
|
||||
typename TypeTraits<T4>::ReferencedType m_a4;
|
||||
typename TypeTraits<T5>::ReferencedType m_a5;
|
||||
} *ev = new EventMemberImpl5 (obj, mem_ptr, a1, a2, a3, a4, a5);
|
||||
return Ptr<EventImpl> (ev, false);
|
||||
return ev;
|
||||
}
|
||||
|
||||
template <typename U1, typename T1>
|
||||
Ptr<EventImpl> Simulator::MakeEvent (void (*f) (U1), T1 a1)
|
||||
EventImpl * Simulator::MakeEvent (void (*f) (U1), T1 a1)
|
||||
{
|
||||
// one arg version
|
||||
class EventFunctionImpl1 : public EventImpl {
|
||||
@@ -882,11 +886,11 @@ Ptr<EventImpl> Simulator::MakeEvent (void (*f) (U1), T1 a1)
|
||||
F m_function;
|
||||
typename TypeTraits<T1>::ReferencedType m_a1;
|
||||
} *ev = new EventFunctionImpl1 (f, a1);
|
||||
return Ptr<EventImpl> (ev, false);
|
||||
return ev;
|
||||
}
|
||||
|
||||
template <typename U1, typename U2, typename T1, typename T2>
|
||||
Ptr<EventImpl> Simulator::MakeEvent (void (*f) (U1,U2), T1 a1, T2 a2)
|
||||
EventImpl * Simulator::MakeEvent (void (*f) (U1,U2), T1 a1, T2 a2)
|
||||
{
|
||||
// two arg version
|
||||
class EventFunctionImpl2 : public EventImpl {
|
||||
@@ -908,12 +912,12 @@ Ptr<EventImpl> Simulator::MakeEvent (void (*f) (U1,U2), T1 a1, T2 a2)
|
||||
typename TypeTraits<T1>::ReferencedType m_a1;
|
||||
typename TypeTraits<T2>::ReferencedType m_a2;
|
||||
} *ev = new EventFunctionImpl2 (f, a1, a2);
|
||||
return Ptr<EventImpl> (ev, false);
|
||||
return ev;
|
||||
}
|
||||
|
||||
template <typename U1, typename U2, typename U3,
|
||||
typename T1, typename T2, typename T3>
|
||||
Ptr<EventImpl> Simulator::MakeEvent (void (*f) (U1,U2,U3), T1 a1, T2 a2, T3 a3)
|
||||
EventImpl * Simulator::MakeEvent (void (*f) (U1,U2,U3), T1 a1, T2 a2, T3 a3)
|
||||
{
|
||||
// three arg version
|
||||
class EventFunctionImpl3 : public EventImpl {
|
||||
@@ -937,12 +941,12 @@ Ptr<EventImpl> Simulator::MakeEvent (void (*f) (U1,U2,U3), T1 a1, T2 a2, T3 a3)
|
||||
typename TypeTraits<T2>::ReferencedType m_a2;
|
||||
typename TypeTraits<T3>::ReferencedType m_a3;
|
||||
} *ev = new EventFunctionImpl3 (f, a1, a2, a3);
|
||||
return Ptr<EventImpl> (ev, false);
|
||||
return ev;
|
||||
}
|
||||
|
||||
template <typename U1, typename U2, typename U3, typename U4,
|
||||
typename T1, typename T2, typename T3, typename T4>
|
||||
Ptr<EventImpl> Simulator::MakeEvent (void (*f) (U1,U2,U3,U4), T1 a1, T2 a2, T3 a3, T4 a4)
|
||||
EventImpl * Simulator::MakeEvent (void (*f) (U1,U2,U3,U4), T1 a1, T2 a2, T3 a3, T4 a4)
|
||||
{
|
||||
// four arg version
|
||||
class EventFunctionImpl4 : public EventImpl {
|
||||
@@ -968,12 +972,12 @@ Ptr<EventImpl> Simulator::MakeEvent (void (*f) (U1,U2,U3,U4), T1 a1, T2 a2, T3 a
|
||||
typename TypeTraits<T3>::ReferencedType m_a3;
|
||||
typename TypeTraits<T4>::ReferencedType m_a4;
|
||||
} *ev = new EventFunctionImpl4 (f, a1, a2, a3, a4);
|
||||
return Ptr<EventImpl> (ev, false);
|
||||
return ev;
|
||||
}
|
||||
|
||||
template <typename U1, typename U2, typename U3, typename U4, typename U5,
|
||||
typename T1, typename T2, typename T3, typename T4, typename T5>
|
||||
Ptr<EventImpl> Simulator::MakeEvent (void (*f) (U1,U2,U3,U4,U5), T1 a1, T2 a2, T3 a3, T4 a4, T5 a5)
|
||||
EventImpl * Simulator::MakeEvent (void (*f) (U1,U2,U3,U4,U5), T1 a1, T2 a2, T3 a3, T4 a4, T5 a5)
|
||||
{
|
||||
// five arg version
|
||||
class EventFunctionImpl5 : public EventImpl {
|
||||
@@ -1001,13 +1005,13 @@ Ptr<EventImpl> Simulator::MakeEvent (void (*f) (U1,U2,U3,U4,U5), T1 a1, T2 a2, T
|
||||
typename TypeTraits<T4>::ReferencedType m_a4;
|
||||
typename TypeTraits<T5>::ReferencedType m_a5;
|
||||
} *ev = new EventFunctionImpl5 (f, a1, a2, a3, a4, a5);
|
||||
return Ptr<EventImpl> (ev, false);
|
||||
return ev;
|
||||
}
|
||||
|
||||
template <typename MEM, typename OBJ>
|
||||
EventId Simulator::Schedule (Time const &time, MEM mem_ptr, OBJ obj)
|
||||
{
|
||||
return Schedule (time, MakeEvent (mem_ptr, obj));
|
||||
return DoSchedule (time, MakeEvent (mem_ptr, obj));
|
||||
}
|
||||
|
||||
|
||||
@@ -1015,28 +1019,28 @@ template <typename MEM, typename OBJ,
|
||||
typename T1>
|
||||
EventId Simulator::Schedule (Time const &time, MEM mem_ptr, OBJ obj, T1 a1)
|
||||
{
|
||||
return Schedule (time, MakeEvent (mem_ptr, obj, a1));
|
||||
return DoSchedule (time, MakeEvent (mem_ptr, obj, a1));
|
||||
}
|
||||
|
||||
template <typename MEM, typename OBJ,
|
||||
typename T1, typename T2>
|
||||
EventId Simulator::Schedule (Time const &time, MEM mem_ptr, OBJ obj, T1 a1, T2 a2)
|
||||
{
|
||||
return Schedule (time, MakeEvent (mem_ptr, obj, a1, a2));
|
||||
return DoSchedule (time, MakeEvent (mem_ptr, obj, a1, a2));
|
||||
}
|
||||
|
||||
template <typename MEM, typename OBJ,
|
||||
typename T1, typename T2, typename T3>
|
||||
EventId Simulator::Schedule (Time const &time, MEM mem_ptr, OBJ obj, T1 a1, T2 a2, T3 a3)
|
||||
{
|
||||
return Schedule (time, MakeEvent (mem_ptr, obj, a1, a2, a3));
|
||||
return DoSchedule (time, MakeEvent (mem_ptr, obj, a1, a2, a3));
|
||||
}
|
||||
|
||||
template <typename MEM, typename OBJ,
|
||||
typename T1, typename T2, typename T3, typename T4>
|
||||
EventId Simulator::Schedule (Time const &time, MEM mem_ptr, OBJ obj, T1 a1, T2 a2, T3 a3, T4 a4)
|
||||
{
|
||||
return Schedule (time, MakeEvent (mem_ptr, obj, a1, a2, a3, a4));
|
||||
return DoSchedule (time, MakeEvent (mem_ptr, obj, a1, a2, a3, a4));
|
||||
}
|
||||
|
||||
template <typename MEM, typename OBJ,
|
||||
@@ -1044,41 +1048,41 @@ template <typename MEM, typename OBJ,
|
||||
EventId Simulator::Schedule (Time const &time, MEM mem_ptr, OBJ obj,
|
||||
T1 a1, T2 a2, T3 a3, T4 a4, T5 a5)
|
||||
{
|
||||
return Schedule (time, MakeEvent (mem_ptr, obj, a1, a2, a3, a4, a5));
|
||||
return DoSchedule (time, MakeEvent (mem_ptr, obj, a1, a2, a3, a4, a5));
|
||||
}
|
||||
|
||||
template <typename U1, typename T1>
|
||||
EventId Simulator::Schedule (Time const &time, void (*f) (U1), T1 a1)
|
||||
{
|
||||
return Schedule (time, MakeEvent (f, a1));
|
||||
return DoSchedule (time, MakeEvent (f, a1));
|
||||
}
|
||||
|
||||
template <typename U1, typename U2,
|
||||
typename T1, typename T2>
|
||||
EventId Simulator::Schedule (Time const &time, void (*f) (U1,U2), T1 a1, T2 a2)
|
||||
{
|
||||
return Schedule (time, MakeEvent (f, a1, a2));
|
||||
return DoSchedule (time, MakeEvent (f, a1, a2));
|
||||
}
|
||||
|
||||
template <typename U1, typename U2, typename U3,
|
||||
typename T1, typename T2, typename T3>
|
||||
EventId Simulator::Schedule (Time const &time, void (*f) (U1,U2,U3), T1 a1, T2 a2, T3 a3)
|
||||
{
|
||||
return Schedule (time, MakeEvent (f, a1, a2, a3));
|
||||
return DoSchedule (time, MakeEvent (f, a1, a2, a3));
|
||||
}
|
||||
|
||||
template <typename U1, typename U2, typename U3, typename U4,
|
||||
typename T1, typename T2, typename T3, typename T4>
|
||||
EventId Simulator::Schedule (Time const &time, void (*f) (U1,U2,U3,U4), T1 a1, T2 a2, T3 a3, T4 a4)
|
||||
{
|
||||
return Schedule (time, MakeEvent (f, a1, a2, a3, a4));
|
||||
return DoSchedule (time, MakeEvent (f, a1, a2, a3, a4));
|
||||
}
|
||||
|
||||
template <typename U1, typename U2, typename U3, typename U4, typename U5,
|
||||
typename T1, typename T2, typename T3, typename T4, typename T5>
|
||||
EventId Simulator::Schedule (Time const &time, void (*f) (U1,U2,U3,U4,U5), T1 a1, T2 a2, T3 a3, T4 a4, T5 a5)
|
||||
{
|
||||
return Schedule (time, MakeEvent (f, a1, a2, a3, a4, a5));
|
||||
return DoSchedule (time, MakeEvent (f, a1, a2, a3, a4, a5));
|
||||
}
|
||||
|
||||
|
||||
@@ -1088,7 +1092,7 @@ template <typename MEM, typename OBJ>
|
||||
EventId
|
||||
Simulator::ScheduleNow (MEM mem_ptr, OBJ obj)
|
||||
{
|
||||
return ScheduleNow (MakeEvent (mem_ptr, obj));
|
||||
return DoScheduleNow (MakeEvent (mem_ptr, obj));
|
||||
}
|
||||
|
||||
|
||||
@@ -1097,7 +1101,7 @@ template <typename MEM, typename OBJ,
|
||||
EventId
|
||||
Simulator::ScheduleNow (MEM mem_ptr, OBJ obj, T1 a1)
|
||||
{
|
||||
return ScheduleNow (MakeEvent (mem_ptr, obj, a1));
|
||||
return DoScheduleNow (MakeEvent (mem_ptr, obj, a1));
|
||||
}
|
||||
|
||||
template <typename MEM, typename OBJ,
|
||||
@@ -1105,7 +1109,7 @@ template <typename MEM, typename OBJ,
|
||||
EventId
|
||||
Simulator::ScheduleNow (MEM mem_ptr, OBJ obj, T1 a1, T2 a2)
|
||||
{
|
||||
return ScheduleNow (MakeEvent (mem_ptr, obj, a1, a2));
|
||||
return DoScheduleNow (MakeEvent (mem_ptr, obj, a1, a2));
|
||||
}
|
||||
|
||||
template <typename MEM, typename OBJ,
|
||||
@@ -1113,7 +1117,7 @@ template <typename MEM, typename OBJ,
|
||||
EventId
|
||||
Simulator::ScheduleNow (MEM mem_ptr, OBJ obj, T1 a1, T2 a2, T3 a3)
|
||||
{
|
||||
return ScheduleNow (MakeEvent (mem_ptr, obj, a1, a2, a3));
|
||||
return DoScheduleNow (MakeEvent (mem_ptr, obj, a1, a2, a3));
|
||||
}
|
||||
|
||||
template <typename MEM, typename OBJ,
|
||||
@@ -1121,7 +1125,7 @@ template <typename MEM, typename OBJ,
|
||||
EventId
|
||||
Simulator::ScheduleNow (MEM mem_ptr, OBJ obj, T1 a1, T2 a2, T3 a3, T4 a4)
|
||||
{
|
||||
return ScheduleNow (MakeEvent (mem_ptr, obj, a1, a2, a3, a4));
|
||||
return DoScheduleNow (MakeEvent (mem_ptr, obj, a1, a2, a3, a4));
|
||||
}
|
||||
|
||||
template <typename MEM, typename OBJ,
|
||||
@@ -1130,7 +1134,7 @@ EventId
|
||||
Simulator::ScheduleNow (MEM mem_ptr, OBJ obj,
|
||||
T1 a1, T2 a2, T3 a3, T4 a4, T5 a5)
|
||||
{
|
||||
return ScheduleNow (MakeEvent (mem_ptr, obj, a1, a2, a3, a4, a5));
|
||||
return DoScheduleNow (MakeEvent (mem_ptr, obj, a1, a2, a3, a4, a5));
|
||||
}
|
||||
|
||||
template <typename U1,
|
||||
@@ -1138,7 +1142,7 @@ template <typename U1,
|
||||
EventId
|
||||
Simulator::ScheduleNow (void (*f) (U1), T1 a1)
|
||||
{
|
||||
return ScheduleNow (MakeEvent (f, a1));
|
||||
return DoScheduleNow (MakeEvent (f, a1));
|
||||
}
|
||||
|
||||
template <typename U1, typename U2,
|
||||
@@ -1146,7 +1150,7 @@ template <typename U1, typename U2,
|
||||
EventId
|
||||
Simulator::ScheduleNow (void (*f) (U1,U2), T1 a1, T2 a2)
|
||||
{
|
||||
return ScheduleNow (MakeEvent (f, a1, a2));
|
||||
return DoScheduleNow (MakeEvent (f, a1, a2));
|
||||
}
|
||||
|
||||
template <typename U1, typename U2, typename U3,
|
||||
@@ -1154,7 +1158,7 @@ template <typename U1, typename U2, typename U3,
|
||||
EventId
|
||||
Simulator::ScheduleNow (void (*f) (U1,U2,U3), T1 a1, T2 a2, T3 a3)
|
||||
{
|
||||
return ScheduleNow (MakeEvent (f, a1, a2, a3));
|
||||
return DoScheduleNow (MakeEvent (f, a1, a2, a3));
|
||||
}
|
||||
|
||||
template <typename U1, typename U2, typename U3, typename U4,
|
||||
@@ -1162,7 +1166,7 @@ template <typename U1, typename U2, typename U3, typename U4,
|
||||
EventId
|
||||
Simulator::ScheduleNow (void (*f) (U1,U2,U3,U4), T1 a1, T2 a2, T3 a3, T4 a4)
|
||||
{
|
||||
return ScheduleNow (MakeEvent (f, a1, a2, a3, a4));
|
||||
return DoScheduleNow (MakeEvent (f, a1, a2, a3, a4));
|
||||
}
|
||||
|
||||
template <typename U1, typename U2, typename U3, typename U4, typename U5,
|
||||
@@ -1170,7 +1174,7 @@ template <typename U1, typename U2, typename U3, typename U4, typename U5,
|
||||
EventId
|
||||
Simulator::ScheduleNow (void (*f) (U1,U2,U3,U4,U5), T1 a1, T2 a2, T3 a3, T4 a4, T5 a5)
|
||||
{
|
||||
return ScheduleNow (MakeEvent (f, a1, a2, a3, a4, a5));
|
||||
return DoScheduleNow (MakeEvent (f, a1, a2, a3, a4, a5));
|
||||
}
|
||||
|
||||
|
||||
@@ -1179,7 +1183,7 @@ template <typename MEM, typename OBJ>
|
||||
EventId
|
||||
Simulator::ScheduleDestroy (MEM mem_ptr, OBJ obj)
|
||||
{
|
||||
return ScheduleDestroy (MakeEvent (mem_ptr, obj));
|
||||
return DoScheduleDestroy (MakeEvent (mem_ptr, obj));
|
||||
}
|
||||
|
||||
|
||||
@@ -1188,7 +1192,7 @@ template <typename MEM, typename OBJ,
|
||||
EventId
|
||||
Simulator::ScheduleDestroy (MEM mem_ptr, OBJ obj, T1 a1)
|
||||
{
|
||||
return ScheduleDestroy (MakeEvent (mem_ptr, obj, a1));
|
||||
return DoScheduleDestroy (MakeEvent (mem_ptr, obj, a1));
|
||||
}
|
||||
|
||||
template <typename MEM, typename OBJ,
|
||||
@@ -1196,7 +1200,7 @@ template <typename MEM, typename OBJ,
|
||||
EventId
|
||||
Simulator::ScheduleDestroy (MEM mem_ptr, OBJ obj, T1 a1, T2 a2)
|
||||
{
|
||||
return ScheduleDestroy (MakeEvent (mem_ptr, obj, a1, a2));
|
||||
return DoScheduleDestroy (MakeEvent (mem_ptr, obj, a1, a2));
|
||||
}
|
||||
|
||||
template <typename MEM, typename OBJ,
|
||||
@@ -1204,7 +1208,7 @@ template <typename MEM, typename OBJ,
|
||||
EventId
|
||||
Simulator::ScheduleDestroy (MEM mem_ptr, OBJ obj, T1 a1, T2 a2, T3 a3)
|
||||
{
|
||||
return ScheduleDestroy (MakeEvent (mem_ptr, obj, a1, a2, a3));
|
||||
return DoScheduleDestroy (MakeEvent (mem_ptr, obj, a1, a2, a3));
|
||||
}
|
||||
|
||||
template <typename MEM, typename OBJ,
|
||||
@@ -1212,7 +1216,7 @@ template <typename MEM, typename OBJ,
|
||||
EventId
|
||||
Simulator::ScheduleDestroy (MEM mem_ptr, OBJ obj, T1 a1, T2 a2, T3 a3, T4 a4)
|
||||
{
|
||||
return ScheduleDestroy (MakeEvent (mem_ptr, obj, a1, a2, a3, a4));
|
||||
return DoScheduleDestroy (MakeEvent (mem_ptr, obj, a1, a2, a3, a4));
|
||||
}
|
||||
|
||||
template <typename MEM, typename OBJ,
|
||||
@@ -1221,7 +1225,7 @@ EventId
|
||||
Simulator::ScheduleDestroy (MEM mem_ptr, OBJ obj,
|
||||
T1 a1, T2 a2, T3 a3, T4 a4, T5 a5)
|
||||
{
|
||||
return ScheduleDestroy (MakeEvent (mem_ptr, obj, a1, a2, a3, a4, a5));
|
||||
return DoScheduleDestroy (MakeEvent (mem_ptr, obj, a1, a2, a3, a4, a5));
|
||||
}
|
||||
|
||||
template <typename U1,
|
||||
@@ -1229,7 +1233,7 @@ template <typename U1,
|
||||
EventId
|
||||
Simulator::ScheduleDestroy (void (*f) (U1), T1 a1)
|
||||
{
|
||||
return ScheduleDestroy (MakeEvent (f, a1));
|
||||
return DoScheduleDestroy (MakeEvent (f, a1));
|
||||
}
|
||||
|
||||
template <typename U1, typename U2,
|
||||
@@ -1237,7 +1241,7 @@ template <typename U1, typename U2,
|
||||
EventId
|
||||
Simulator::ScheduleDestroy (void (*f) (U1,U2), T1 a1, T2 a2)
|
||||
{
|
||||
return ScheduleDestroy (MakeEvent (f, a1, a2));
|
||||
return DoScheduleDestroy (MakeEvent (f, a1, a2));
|
||||
}
|
||||
|
||||
template <typename U1, typename U2, typename U3,
|
||||
@@ -1245,7 +1249,7 @@ template <typename U1, typename U2, typename U3,
|
||||
EventId
|
||||
Simulator::ScheduleDestroy (void (*f) (U1,U2,U3), T1 a1, T2 a2, T3 a3)
|
||||
{
|
||||
return ScheduleDestroy (MakeEvent (f, a1, a2, a3));
|
||||
return DoScheduleDestroy (MakeEvent (f, a1, a2, a3));
|
||||
}
|
||||
|
||||
template <typename U1, typename U2, typename U3, typename U4,
|
||||
@@ -1253,7 +1257,7 @@ template <typename U1, typename U2, typename U3, typename U4,
|
||||
EventId
|
||||
Simulator::ScheduleDestroy (void (*f) (U1,U2,U3,U4), T1 a1, T2 a2, T3 a3, T4 a4)
|
||||
{
|
||||
return ScheduleDestroy (MakeEvent (f, a1, a2, a3, a4));
|
||||
return DoScheduleDestroy (MakeEvent (f, a1, a2, a3, a4));
|
||||
}
|
||||
|
||||
template <typename U1, typename U2, typename U3, typename U4, typename U5,
|
||||
@@ -1261,9 +1265,9 @@ template <typename U1, typename U2, typename U3, typename U4, typename U5,
|
||||
EventId
|
||||
Simulator::ScheduleDestroy (void (*f) (U1,U2,U3,U4,U5), T1 a1, T2 a2, T3 a3, T4 a4, T5 a5)
|
||||
{
|
||||
return ScheduleDestroy (MakeEvent (f, a1, a2, a3, a4, a5));
|
||||
return DoScheduleDestroy (MakeEvent (f, a1, a2, a3, a4, a5));
|
||||
}
|
||||
|
||||
}; // namespace ns3
|
||||
} // namespace ns3
|
||||
|
||||
#endif /* SIMULATOR_H */
|
||||
|
||||
Reference in New Issue
Block a user