58 template <
typename T1>
66 template <
typename T1,
typename T2>
76 template <
typename T1,
typename T2,
typename T3>
77 void SetArgs(T1 a1, T2 a2, T3 a3);
88 template <
typename T1,
typename T2,
typename T3,
typename T4>
89 void SetArgs(T1 a1, T2 a2, T3 a3, T4 a4);
102 template <
typename T1,
typename T2,
typename T3,
typename T4,
typename T5>
103 void SetArgs(T1 a1, T2 a2, T3 a3, T4 a4, T5 a5);
118 template <
typename T1,
typename T2,
typename T3,
typename T4,
typename T5,
typename T6>
119 void SetArgs(T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6);
149template <
typename T1>
161template <
typename T1,
typename T2>
174template <
typename T1,
typename T2,
typename T3>
188template <
typename T1,
typename T2,
typename T3,
typename T4>
203template <
typename T1,
typename T2,
typename T3,
typename T4,
typename T5>
219template <
typename T1,
typename T2,
typename T3,
typename T4,
typename T5,
typename T6>
232 virtual void SetArguments(T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6) = 0;
252template <
typename FN>
264template <
typename FN>
268 struct FnTimerImplZero :
public TimerImpl
270 FnTimerImplZero(FN fn)
277 return Simulator::Schedule(delay, m_fn);
280 void Invoke()
override
286 }* function =
new FnTimerImplZero(fn);
295template <
typename FN>
303 struct FnTimerImplOne :
public TimerImplOne<T1Parameter>
305 FnTimerImplOne(FN fn)
310 void SetArguments(T1Parameter a1)
override
317 return Simulator::Schedule(delay, m_fn, m_a1);
320 void Invoke()
override
327 }* function =
new FnTimerImplOne(fn);
336template <
typename FN>
347 struct FnTimerImplTwo :
public TimerImplTwo<T1Parameter, T2Parameter>
349 FnTimerImplTwo(FN fn)
354 void SetArguments(T1Parameter a1, T2Parameter a2)
override
362 return Simulator::Schedule(delay, m_fn, m_a1, m_a2);
365 void Invoke()
override
373 }* function =
new FnTimerImplTwo(fn);
382template <
typename FN>
396 struct FnTimerImplThree :
public TimerImplThree<T1Parameter, T2Parameter, T3Parameter>
398 FnTimerImplThree(FN fn)
403 void SetArguments(T1Parameter a1, T2Parameter a2, T3Parameter a3)
override
412 return Simulator::Schedule(delay, m_fn, m_a1, m_a2, m_a3);
415 void Invoke()
override
417 m_fn(m_a1, m_a2, m_a3);
424 }* function =
new FnTimerImplThree(fn);
433template <
typename FN>
450 struct FnTimerImplFour
451 :
public TimerImplFour<T1Parameter, T2Parameter, T3Parameter, T4Parameter>
453 FnTimerImplFour(FN fn)
458 void SetArguments(T1Parameter a1, T2Parameter a2, T3Parameter a3, T4Parameter a4)
override
468 return Simulator::Schedule(delay, m_fn, m_a1, m_a2, m_a3, m_a4);
471 void Invoke()
override
473 m_fn(m_a1, m_a2, m_a3, m_a4);
481 }* function =
new FnTimerImplFour(fn);
490template <
typename FN>
510 struct FnTimerImplFive
511 :
public TimerImplFive<T1Parameter, T2Parameter, T3Parameter, T4Parameter, T5Parameter>
513 FnTimerImplFive(FN fn)
518 void SetArguments(T1Parameter a1,
522 T5Parameter a5)
override
533 return Simulator::Schedule(delay, m_fn, m_a1, m_a2, m_a3, m_a4, m_a5);
536 void Invoke()
override
538 m_fn(m_a1, m_a2, m_a3, m_a4, m_a5);
547 }* function =
new FnTimerImplFive(fn);
556template <
typename FN>
579 struct FnTimerImplSix :
public TimerImplSix<T1Parameter,
586 FnTimerImplSix(FN fn)
591 virtual void SetArguments(T1Parameter a1,
608 return Simulator::Schedule(delay, m_fn, m_a1, m_a2, m_a3, m_a4, m_a5, m_a6);
611 virtual void Invoke()
613 m_fn(m_a1, m_a2, m_a3, m_a4, m_a5, m_a6);
623 }* function =
new FnTimerImplSix(fn);
674template <
typename MEM_PTR,
typename OBJ_PTR>
688template <
typename MEM_PTR,
typename OBJ_PTR>
692 struct MemFnTimerImplZero :
public TimerImpl
694 MemFnTimerImplZero(MEM_PTR memPtr, OBJ_PTR objPtr)
702 return Simulator::Schedule(delay, m_memPtr, m_objPtr);
705 void Invoke()
override
712 }* function =
new MemFnTimerImplZero(memPtr, objPtr);
721template <
typename MEM_PTR,
typename OBJ_PTR>
729 struct MemFnTimerImplOne :
public TimerImplOne<T1Parameter>
731 MemFnTimerImplOne(MEM_PTR memPtr, OBJ_PTR objPtr)
737 void SetArguments(T1Parameter a1)
override
744 return Simulator::Schedule(delay, m_memPtr, m_objPtr, m_a1);
747 void Invoke()
override
755 }* function =
new MemFnTimerImplOne(memPtr, objPtr);
764template <
typename MEM_PTR,
typename OBJ_PTR>
775 struct MemFnTimerImplTwo :
public TimerImplTwo<T1Parameter, T2Parameter>
777 MemFnTimerImplTwo(MEM_PTR memPtr, OBJ_PTR objPtr)
783 void SetArguments(T1Parameter a1, T2Parameter a2)
override
791 return Simulator::Schedule(delay, m_memPtr, m_objPtr, m_a1, m_a2);
794 void Invoke()
override
803 }* function =
new MemFnTimerImplTwo(memPtr, objPtr);
812template <
typename MEM_PTR,
typename OBJ_PTR>
826 struct MemFnTimerImplThree :
public TimerImplThree<T1Parameter, T2Parameter, T3Parameter>
828 MemFnTimerImplThree(MEM_PTR memPtr, OBJ_PTR objPtr)
834 void SetArguments(T1Parameter a1, T2Parameter a2, T3Parameter a3)
override
843 return Simulator::Schedule(delay, m_memPtr, m_objPtr, m_a1, m_a2, m_a3);
846 void Invoke()
override
856 }* function =
new MemFnTimerImplThree(memPtr, objPtr);
865template <
typename MEM_PTR,
typename OBJ_PTR>
882 struct MemFnTimerImplFour
883 :
public TimerImplFour<T1Parameter, T2Parameter, T3Parameter, T4Parameter>
885 MemFnTimerImplFour(MEM_PTR memPtr, OBJ_PTR objPtr)
891 void SetArguments(T1Parameter a1, T2Parameter a2, T3Parameter a3, T4Parameter a4)
override
901 return Simulator::Schedule(delay, m_memPtr, m_objPtr, m_a1, m_a2, m_a3, m_a4);
904 void Invoke()
override
907 m_memPtr)(m_a1, m_a2, m_a3, m_a4);
916 }* function =
new MemFnTimerImplFour(memPtr, objPtr);
925template <
typename MEM_PTR,
typename OBJ_PTR>
945 struct MemFnTimerImplFive
946 :
public TimerImplFive<T1Parameter, T2Parameter, T3Parameter, T4Parameter, T5Parameter>
948 MemFnTimerImplFive(MEM_PTR memPtr, OBJ_PTR objPtr)
954 void SetArguments(T1Parameter a1,
958 T5Parameter a5)
override
969 return Simulator::Schedule(delay, m_memPtr, m_objPtr, m_a1, m_a2, m_a3, m_a4, m_a5);
972 void Invoke()
override
975 m_memPtr)(m_a1, m_a2, m_a3, m_a4, m_a5);
985 }* function =
new MemFnTimerImplFive(memPtr, objPtr);
994template <
typename MEM_PTR,
typename OBJ_PTR>
1017 struct MemFnTimerImplSix :
public TimerImplSix<T1Parameter,
1024 MemFnTimerImplSix(MEM_PTR memPtr, OBJ_PTR objPtr)
1030 virtual void SetArguments(T1Parameter a1,
1047 return Simulator::Schedule(delay,
1058 virtual void Invoke()
1061 m_memPtr)(m_a1, m_a2, m_a3, m_a4, m_a5, m_a6);
1072 }* function =
new MemFnTimerImplSix(memPtr, objPtr);
1083template <
typename T1>
1088 TimerImplBase* impl =
dynamic_cast<TimerImplBase*
>(
this);
1089 if (impl ==
nullptr)
1091 NS_FATAL_ERROR(
"You tried to set Timer arguments incompatible with its function.");
1094 impl->SetArguments(a1);
1097template <
typename T1,
typename T2>
1104 TimerImplBase* impl =
dynamic_cast<TimerImplBase*
>(
this);
1105 if (impl ==
nullptr)
1107 NS_FATAL_ERROR(
"You tried to set Timer arguments incompatible with its function.");
1110 impl->SetArguments(a1, a2);
1113template <
typename T1,
typename T2,
typename T3>
1121 TimerImplBase* impl =
dynamic_cast<TimerImplBase*
>(
this);
1122 if (impl ==
nullptr)
1124 NS_FATAL_ERROR(
"You tried to set Timer arguments incompatible with its function.");
1127 impl->SetArguments(a1, a2, a3);
1130template <
typename T1,
typename T2,
typename T3,
typename T4>
1139 TimerImplBase* impl =
dynamic_cast<TimerImplBase*
>(
this);
1140 if (impl ==
nullptr)
1142 NS_FATAL_ERROR(
"You tried to set Timer arguments incompatible with its function.");
1145 impl->SetArguments(a1, a2, a3, a4);
1148template <
typename T1,
typename T2,
typename T3,
typename T4,
typename T5>
1158 TimerImplBase* impl =
dynamic_cast<TimerImplBase*
>(
this);
1159 if (impl ==
nullptr)
1161 NS_FATAL_ERROR(
"You tried to set Timer arguments incompatible with its function.");
1164 impl->SetArguments(a1, a2, a3, a4, a5);
1167template <
typename T1,
typename T2,
typename T3,
typename T4,
typename T5,
typename T6>
1178 TimerImplBase* impl =
dynamic_cast<TimerImplBase*
>(
this);
1181 NS_FATAL_ERROR(
"You tried to set Timer arguments incompatible with its function.");
1184 impl->SetArguments(a1, a2, a3, a4, a5, a6);
An identifier for simulation events.
Simulation virtual time values and global simulation resolution.
The timer implementation underlying Timer and Watchdog.
void SetArgs(T1 a1)
Set the arguments to be used when invoking the expire function.
virtual ~TimerImpl()
Destructor.
virtual void Invoke()=0
Invoke the expire function.
virtual EventId Schedule(const Time &delay)=0
Schedule the callback for a future time.
NS_FATAL_x macro definitions.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
TimerImpl * MakeTimerImpl(FN fn)
Make a TimerImpl from a function pointer taking varying numbers of arguments.
ns3::IntToType template class.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::Simulator declaration.
Convert an integer into a type.
TimerImpl specialization class for varying numbers of arguments.
virtual void SetArguments(T1 a1, T2 a2, T3 a3, T4 a4, T5 a5)=0
Bind the arguments to be used when the callback function is invoked.
TimerImpl specialization class for varying numbers of arguments.
virtual void SetArguments(T1 a1, T2 a2, T3 a3, T4 a4)=0
Bind the arguments to be used when the callback function is invoked.
static T & GetReference(T *p)
Convert a pointer type to a reference.
Helper for the MakeTimerImpl functions which take a class method.
TimerImpl specialization class for varying numbers of arguments.
virtual void SetArguments(T1 a1)=0
Bind the arguments to be used when the callback function is invoked.
TimerImpl specialization class for varying numbers of arguments.
virtual void SetArguments(T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6)=0
Bind the arguments to be used when the callback function is invoked.
TimerImpl specialization class for varying numbers of arguments.
virtual void SetArguments(T1 a1, T2 a2, T3 a3)=0
Bind the arguments to be used when the callback function is invoked.
TimerImpl specialization class for varying numbers of arguments.
virtual void SetArguments(T1 a1, T2 a2)=0
Bind the arguments to be used when the callback function is invoked.
Type and reference traits for TimerImpl arguments.
TypeTraits< typenameTypeTraits< T >::ReferencedType >::NonConstType StoredType
Storage type for an argument.
const StoredType & ParameterType
Parameter type for an argument.
Inspect a type to deduce its features.
ns3::TypeTraits introspection declaration and template implementation.