View | Details | Raw Unified | Return to bug 2457
Collapse All | Expand All

(-)a/src/core/model/callback.h (-156 / +12 lines)
 Lines 1485-1569    Link Here 
1485
 * Build Callbacks for class method members which take varying numbers of arguments
1485
 * Build Callbacks for class method members which take varying numbers of arguments
1486
 * and potentially returning a value.
1486
 * and potentially returning a value.
1487
 */     
1487
 */     
1488
template <typename T, typename OBJ, typename R>
1488
template <typename T, typename OBJ, typename R, typename... Ts>
1489
Callback<R> MakeCallback (R (T::*memPtr)(void), OBJ objPtr) {
1489
Callback<R,Ts...> MakeCallback (R (T::*memPtr)(Ts...), OBJ objPtr) {
1490
  return Callback<R> (objPtr, memPtr);
1490
  return Callback<R,Ts...> (objPtr, memPtr);
1491
}
1491
}
1492
template <typename T, typename OBJ, typename R>
1492
template <typename T, typename OBJ, typename R, typename... Ts>
1493
Callback<R> MakeCallback (R (T::*memPtr)() const, OBJ objPtr) {
1493
Callback<R,Ts...> MakeCallback (R (T::*memPtr)(Ts...) const, OBJ objPtr) {
1494
  return Callback<R> (objPtr, memPtr);
1494
  return Callback<R,Ts...> (objPtr, memPtr);
1495
}
1496
template <typename T, typename OBJ, typename R, typename T1>
1497
Callback<R,T1> MakeCallback (R (T::*memPtr)(T1), OBJ objPtr) {
1498
  return Callback<R,T1> (objPtr, memPtr);
1499
}
1500
template <typename T, typename OBJ, typename R, typename T1>
1501
Callback<R,T1> MakeCallback (R (T::*memPtr)(T1) const, OBJ objPtr) {
1502
  return Callback<R,T1> (objPtr, memPtr);
1503
}
1504
template <typename T, typename OBJ, typename R, typename T1, typename T2>
1505
Callback<R,T1,T2> MakeCallback (R (T::*memPtr)(T1,T2), OBJ objPtr) {
1506
  return Callback<R,T1,T2> (objPtr, memPtr);
1507
}
1508
template <typename T, typename OBJ, typename R, typename T1, typename T2>
1509
Callback<R,T1,T2> MakeCallback (R (T::*memPtr)(T1,T2) const, OBJ objPtr) {
1510
  return Callback<R,T1,T2> (objPtr, memPtr);
1511
}
1512
template <typename T, typename OBJ, typename R, typename T1,typename T2, typename T3>
1513
Callback<R,T1,T2,T3> MakeCallback (R (T::*memPtr)(T1,T2,T3), OBJ objPtr) {
1514
  return Callback<R,T1,T2,T3> (objPtr, memPtr);
1515
}
1516
template <typename T, typename OBJ, typename R, typename T1,typename T2, typename T3>
1517
Callback<R,T1,T2,T3> MakeCallback (R (T::*memPtr)(T1,T2,T3) const, OBJ objPtr) {
1518
  return Callback<R,T1,T2,T3> (objPtr, memPtr);
1519
}
1520
template <typename T, typename OBJ, typename R, typename T1, typename T2, typename T3, typename T4>
1521
Callback<R,T1,T2,T3,T4> MakeCallback (R (T::*memPtr)(T1,T2,T3,T4), OBJ objPtr) {
1522
  return Callback<R,T1,T2,T3,T4> (objPtr, memPtr);
1523
}
1524
template <typename T, typename OBJ, typename R, typename T1, typename T2, typename T3, typename T4>
1525
Callback<R,T1,T2,T3,T4> MakeCallback (R (T::*memPtr)(T1,T2,T3,T4) const, OBJ objPtr) {
1526
  return Callback<R,T1,T2,T3,T4> (objPtr, memPtr);
1527
}
1528
template <typename T, typename OBJ, typename R, typename T1, typename T2, typename T3, typename T4,typename T5>
1529
Callback<R,T1,T2,T3,T4,T5> MakeCallback (R (T::*memPtr)(T1,T2,T3,T4,T5), OBJ objPtr) {
1530
  return Callback<R,T1,T2,T3,T4,T5> (objPtr, memPtr);
1531
}
1532
template <typename T, typename OBJ, typename R, typename T1, typename T2, typename T3, typename T4,typename T5>
1533
Callback<R,T1,T2,T3,T4,T5> MakeCallback (R (T::*memPtr)(T1,T2,T3,T4,T5) const, OBJ objPtr) {
1534
  return Callback<R,T1,T2,T3,T4,T5> (objPtr, memPtr);
1535
}
1536
template <typename T, typename OBJ, typename R, typename T1, typename T2, typename T3, typename T4,typename T5,typename T6>
1537
Callback<R,T1,T2,T3,T4,T5,T6> MakeCallback (R (T::*memPtr)(T1,T2,T3,T4,T5,T6), OBJ objPtr) {
1538
  return Callback<R,T1,T2,T3,T4,T5,T6> (objPtr, memPtr);
1539
}
1540
template <typename T, typename OBJ, typename R, typename T1, typename T2, typename T3, typename T4,typename T5, typename T6>
1541
Callback<R,T1,T2,T3,T4,T5,T6> MakeCallback (R (T::*memPtr)(T1,T2,T3,T4,T5,T6) const, OBJ objPtr) {
1542
  return Callback<R,T1,T2,T3,T4,T5,T6> (objPtr, memPtr);
1543
}
1544
template <typename T, typename OBJ, typename R, typename T1, typename T2, typename T3, typename T4,typename T5,typename T6, typename T7>
1545
Callback<R,T1,T2,T3,T4,T5,T6,T7> MakeCallback (R (T::*memPtr)(T1,T2,T3,T4,T5,T6,T7), OBJ objPtr) {
1546
  return Callback<R,T1,T2,T3,T4,T5,T6,T7> (objPtr, memPtr);
1547
}
1548
template <typename T, typename OBJ, typename R, typename T1, typename T2, typename T3, typename T4,typename T5, typename T6, typename T7>
1549
Callback<R,T1,T2,T3,T4,T5,T6,T7> MakeCallback (R (T::*memPtr)(T1,T2,T3,T4,T5,T6,T7) const, OBJ objPtr) {
1550
  return Callback<R,T1,T2,T3,T4,T5,T6,T7> (objPtr, memPtr);
1551
}
1552
template <typename T, typename OBJ, typename R, typename T1, typename T2, typename T3, typename T4,typename T5,typename T6, typename T7, typename T8>
1553
Callback<R,T1,T2,T3,T4,T5,T6,T7,T8> MakeCallback (R (T::*memPtr)(T1,T2,T3,T4,T5,T6,T7,T8), OBJ objPtr) {
1554
  return Callback<R,T1,T2,T3,T4,T5,T6,T7,T8> (objPtr, memPtr);
1555
}
1556
template <typename T, typename OBJ, typename R, typename T1, typename T2, typename T3, typename T4,typename T5, typename T6, typename T7, typename T8>
1557
Callback<R,T1,T2,T3,T4,T5,T6,T7,T8> MakeCallback (R (T::*memPtr)(T1,T2,T3,T4,T5,T6,T7,T8) const, OBJ objPtr) {
1558
  return Callback<R,T1,T2,T3,T4,T5,T6,T7,T8> (objPtr, memPtr);
1559
}
1560
template <typename T, typename OBJ, typename R, typename T1, typename T2, typename T3, typename T4,typename T5,typename T6, typename T7, typename T8, typename T9>
1561
Callback<R,T1,T2,T3,T4,T5,T6,T7,T8,T9> MakeCallback (R (T::*memPtr)(T1,T2,T3,T4,T5,T6,T7,T8,T9), OBJ objPtr) {
1562
  return Callback<R,T1,T2,T3,T4,T5,T6,T7,T8,T9> (objPtr, memPtr);
1563
}
1564
template <typename T, typename OBJ, typename R, typename T1, typename T2, typename T3, typename T4,typename T5, typename T6, typename T7, typename T8, typename T9>
1565
Callback<R,T1,T2,T3,T4,T5,T6,T7,T8,T9> MakeCallback (R (T::*memPtr)(T1,T2,T3,T4,T5,T6,T7,T8,T9) const, OBJ objPtr) {
1566
  return Callback<R,T1,T2,T3,T4,T5,T6,T7,T8,T9> (objPtr, memPtr);
1567
}
1495
}
1568
/**@}*/
1496
/**@}*/
1569
1497
 Lines 1578-1622    Link Here 
1578
 * Build Callbacks for functions which take varying numbers of arguments
1506
 * Build Callbacks for functions which take varying numbers of arguments
1579
 * and potentially returning a value.
1507
 * and potentially returning a value.
1580
 */
1508
 */
1581
template <typename R>
1509
template <typename R, typename... Ts>
1582
Callback<R> MakeCallback (R (*fnPtr)()) {
1510
Callback<R,Ts...> MakeCallback (R (*fnPtr)(Ts...)) {
1583
  return Callback<R> (fnPtr, true, true);
1511
  return Callback<R,Ts...> (fnPtr, true, true);
1584
}
1585
template <typename R, typename T1>
1586
Callback<R,T1> MakeCallback (R (*fnPtr)(T1)) {
1587
  return Callback<R,T1> (fnPtr, true, true);
1588
}
1589
template <typename R, typename T1, typename T2>
1590
Callback<R,T1,T2> MakeCallback (R (*fnPtr)(T1,T2)) {
1591
  return Callback<R,T1,T2> (fnPtr, true, true);
1592
}
1593
template <typename R, typename T1, typename T2,typename T3>
1594
Callback<R,T1,T2,T3> MakeCallback (R (*fnPtr)(T1,T2,T3)) {
1595
  return Callback<R,T1,T2,T3> (fnPtr, true, true);
1596
}
1597
template <typename R, typename T1, typename T2,typename T3,typename T4>
1598
Callback<R,T1,T2,T3,T4> MakeCallback (R (*fnPtr)(T1,T2,T3,T4)) {
1599
  return Callback<R,T1,T2,T3,T4> (fnPtr, true, true);
1600
}
1601
template <typename R, typename T1, typename T2,typename T3,typename T4,typename T5>
1602
Callback<R,T1,T2,T3,T4,T5> MakeCallback (R (*fnPtr)(T1,T2,T3,T4,T5)) {
1603
  return Callback<R,T1,T2,T3,T4,T5> (fnPtr, true, true);
1604
}
1605
template <typename R, typename T1, typename T2,typename T3,typename T4,typename T5,typename T6>
1606
Callback<R,T1,T2,T3,T4,T5,T6> MakeCallback (R (*fnPtr)(T1,T2,T3,T4,T5,T6)) {
1607
  return Callback<R,T1,T2,T3,T4,T5,T6> (fnPtr, true, true);
1608
}
1609
template <typename R, typename T1, typename T2,typename T3,typename T4,typename T5,typename T6, typename T7>
1610
Callback<R,T1,T2,T3,T4,T5,T6,T7> MakeCallback (R (*fnPtr)(T1,T2,T3,T4,T5,T6,T7)) {
1611
  return Callback<R,T1,T2,T3,T4,T5,T6,T7> (fnPtr, true, true);
1612
}
1613
template <typename R, typename T1, typename T2,typename T3,typename T4,typename T5,typename T6, typename T7, typename T8>
1614
Callback<R,T1,T2,T3,T4,T5,T6,T7,T8> MakeCallback (R (*fnPtr)(T1,T2,T3,T4,T5,T6,T7,T8)) {
1615
  return Callback<R,T1,T2,T3,T4,T5,T6,T7,T8> (fnPtr, true, true);
1616
}
1617
template <typename R, typename T1, typename T2,typename T3,typename T4,typename T5,typename T6, typename T7, typename T8, typename T9>
1618
Callback<R,T1,T2,T3,T4,T5,T6,T7,T8,T9> MakeCallback (R (*fnPtr)(T1,T2,T3,T4,T5,T6,T7,T8,T9)) {
1619
  return Callback<R,T1,T2,T3,T4,T5,T6,T7,T8,T9> (fnPtr, true, true);
1620
}
1512
}
1621
/**@}*/
1513
/**@}*/
1622
1514
 Lines 1631-1675    Link Here 
1631
 * for varying number of template arguments,
1523
 * for varying number of template arguments,
1632
 * and potentially returning a value.
1524
 * and potentially returning a value.
1633
 */     
1525
 */     
1634
template <typename R>
1526
template <typename R, typename... Ts>
1635
Callback<R> MakeNullCallback (void) {
1527
Callback<R,Ts...> MakeNullCallback (void) {
1636
  return Callback<R> ();
1528
  return Callback<R,Ts...> ();
1637
}
1638
template <typename R, typename T1>
1639
Callback<R,T1> MakeNullCallback (void) {
1640
  return Callback<R,T1> ();
1641
}
1642
template <typename R, typename T1, typename T2>
1643
Callback<R,T1,T2> MakeNullCallback (void) {
1644
  return Callback<R,T1,T2> ();
1645
}
1646
template <typename R, typename T1, typename T2,typename T3>
1647
Callback<R,T1,T2,T3> MakeNullCallback (void) {
1648
  return Callback<R,T1,T2,T3> ();
1649
}
1650
template <typename R, typename T1, typename T2,typename T3,typename T4>
1651
Callback<R,T1,T2,T3,T4> MakeNullCallback (void) {
1652
  return Callback<R,T1,T2,T3,T4> ();
1653
}
1654
template <typename R, typename T1, typename T2,typename T3,typename T4,typename T5>
1655
Callback<R,T1,T2,T3,T4,T5> MakeNullCallback (void) {
1656
  return Callback<R,T1,T2,T3,T4,T5> ();
1657
}
1658
template <typename R, typename T1, typename T2,typename T3,typename T4,typename T5,typename T6>
1659
Callback<R,T1,T2,T3,T4,T5,T6> MakeNullCallback (void) {
1660
  return Callback<R,T1,T2,T3,T4,T5,T6> ();
1661
}
1662
template <typename R, typename T1, typename T2,typename T3,typename T4,typename T5,typename T6, typename T7>
1663
Callback<R,T1,T2,T3,T4,T5,T6,T7> MakeNullCallback (void) {
1664
  return Callback<R,T1,T2,T3,T4,T5,T6,T7> ();
1665
}
1666
template <typename R, typename T1, typename T2,typename T3,typename T4,typename T5,typename T6, typename T7, typename T8>
1667
Callback<R,T1,T2,T3,T4,T5,T6,T7,T8> MakeNullCallback (void) {
1668
  return Callback<R,T1,T2,T3,T4,T5,T6,T7,T8> ();
1669
}
1670
template <typename R, typename T1, typename T2,typename T3,typename T4,typename T5,typename T6, typename T7, typename T8, typename T9>
1671
Callback<R,T1,T2,T3,T4,T5,T6,T7,T8,T9> MakeNullCallback (void) {
1672
  return Callback<R,T1,T2,T3,T4,T5,T6,T7,T8,T9> ();
1673
}
1529
}
1674
/**@}*/
1530
/**@}*/
1675
1531
(-)a/src/core/model/object.h (-135 / +3 lines)
 Lines 527-668    Link Here 
527
 * \tparam T \explicit The type of the derived object to construct.
527
 * \tparam T \explicit The type of the derived object to construct.
528
 * \return The derived object.
528
 * \return The derived object.
529
 */
529
 */
530
template <typename T>
530
template <typename T, typename... Args>
531
Ptr<T> CreateObject (void)
531
Ptr<T> CreateObject (Args... args)
532
{
532
{
533
  return CompleteConstruct (new T ());
533
  return CompleteConstruct (new T (args...));
534
}
535
/**
536
 * \copybrief CreateObject()
537
 * \tparam T \explicit The type of the derived object to construct.
538
 * \tparam T1 \deduced The type of the constructor argument.
539
 * \param [in] a1 The constructor argument
540
 * \return The derived object.
541
 */
542
template <typename T, typename T1>
543
Ptr<T> CreateObject (T1 a1)
544
{
545
  return CompleteConstruct (new T (a1));
546
}
547
548
/**
549
 * \copybrief CreateObject()
550
 * \tparam T \explicit The type of the derived object to construct.
551
 * \tparam T1 \deduced The type of the first constructor argument.
552
 * \tparam T2 \deduced The type of the second constructor argument.
553
 * \param [in] a1 The constructor first argument
554
 * \param [in] a2 The constructor second argument
555
 * \return The derived object.
556
 */
557
template <typename T, typename T1, typename T2>
558
Ptr<T> CreateObject (T1 a1, T2 a2)
559
{
560
  return CompleteConstruct (new T (a1,a2));
561
}
562
563
/**
564
 * \copybrief CreateObject()
565
 * \tparam T \explicit The type of the derived object to construct.
566
 * \tparam T1 \deduced The type of the first constructor argument.
567
 * \tparam T2 \deduced The type of the second constructor argument.
568
 * \tparam T3 \deduced The type of the third constructor argument.
569
 * \param [in] a1 The constructor first argument
570
 * \param [in] a2 The constructor second argument
571
 * \param [in] a3 The constructor third argument
572
 * \return The derived object.
573
 */
574
template <typename T, typename T1, typename T2, typename T3>
575
Ptr<T> CreateObject (T1 a1, T2 a2, T3 a3)
576
{
577
  return CompleteConstruct (new T (a1,a2,a3));
578
}
579
580
/**
581
 * \copybrief CreateObject()
582
 * \tparam T \explicit The type of the derived object to construct.
583
 * \tparam T1 \deduced The type of the first constructor argument.
584
 * \tparam T2 \deduced The type of the second constructor argument.
585
 * \tparam T3 \deduced The type of the third constructor argument.
586
 * \tparam T4 \deduced The type of the fourth constructor argument.
587
 * \param [in] a1 The constructor first argument
588
 * \param [in] a2 The constructor second argument
589
 * \param [in] a3 The constructor third argument
590
 * \param [in] a4 The constructor fourth argument
591
 * \return The derived object.
592
 */
593
template <typename T, typename T1, typename T2, typename T3, typename T4>
594
Ptr<T> CreateObject (T1 a1, T2 a2, T3 a3, T4 a4)
595
{
596
  return CompleteConstruct (new T (a1,a2,a3,a4));
597
}
598
599
/**
600
 * \copybrief CreateObject()
601
 * \tparam T \explicit The type of the derived object to construct.
602
 * \tparam T1 \deduced The type of the first constructor argument.
603
 * \tparam T2 \deduced The type of the second constructor argument.
604
 * \tparam T3 \deduced The type of the third constructor argument.
605
 * \tparam T4 \deduced The type of the fourth constructor argument.
606
 * \tparam T5 \deduced The type of the fifth constructor argument.
607
 * \param [in] a1 The constructor first argument
608
 * \param [in] a2 The constructor second argument
609
 * \param [in] a3 The constructor third argument
610
 * \param [in] a4 The constructor fourth argument
611
 * \param [in] a5 The constructor fifth argument
612
 * \return The derived object.
613
 */
614
template <typename T, typename T1, typename T2, typename T3, typename T4, typename T5>
615
Ptr<T> CreateObject (T1 a1, T2 a2, T3 a3, T4 a4, T5 a5)
616
{
617
  return CompleteConstruct (new T (a1,a2,a3,a4,a5));
618
}
619
620
/**
621
 * \copybrief CreateObject()
622
 * \tparam T \explicit The type of the derived object to construct.
623
 * \tparam T1 \deduced The type of the first constructor argument.
624
 * \tparam T2 \deduced The type of the second constructor argument.
625
 * \tparam T3 \deduced The type of the third constructor argument.
626
 * \tparam T4 \deduced The type of the fourth constructor argument.
627
 * \tparam T5 \deduced The type of the fifth constructor argument.
628
 * \tparam T6 \deduced The type of the sixth constructor argument.
629
 * \param [in] a1 The constructor first argument
630
 * \param [in] a2 The constructor second argument
631
 * \param [in] a3 The constructor third argument
632
 * \param [in] a4 The constructor fourth argument
633
 * \param [in] a5 The constructor fifth argument
634
 * \param [in] a6 The constructor sixth argument
635
 * \return The derived object.
636
 */
637
template <typename T, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6>
638
Ptr<T> CreateObject (T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6)
639
{
640
  return CompleteConstruct (new T (a1,a2,a3,a4,a5,a6));
641
}
642
643
/**
644
 * \copybrief CreateObject()
645
 * \tparam T \explicit The type of the derived object to construct.
646
 * \tparam T1 \deduced The type of the first constructor argument.
647
 * \tparam T2 \deduced The type of the second constructor argument.
648
 * \tparam T3 \deduced The type of the third constructor argument.
649
 * \tparam T4 \deduced The type of the fourth constructor argument.
650
 * \tparam T5 \deduced The type of the fifth constructor argument.
651
 * \tparam T6 \deduced The type of the sixth constructor argument.
652
 * \tparam T7 \deduced The type of the seventh constructor argument.
653
 * \param [in] a1 The constructor first argument
654
 * \param [in] a2 The constructor second argument
655
 * \param [in] a3 The constructor third argument
656
 * \param [in] a4 The constructor fourth argument
657
 * \param [in] a5 The constructor fifth argument
658
 * \param [in] a6 The constructor sixth argument
659
 * \param [in] a7 The constructor seventh argument
660
 * \return The derived object.
661
 */
662
template <typename T, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7>
663
Ptr<T> CreateObject (T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7)
664
{
665
  return CompleteConstruct (new T (a1,a2,a3,a4,a5,a6,a7));
666
}
534
}
667
/**@}*/
535
/**@}*/
668
536
(-)a/src/core/model/ptr.h (-167 / +7 lines)
 Lines 216-347    Link Here 
216
 */
216
 */
217
/** @{ */
217
/** @{ */
218
/**
218
/**
219
 * \tparam T \explicit The type of class object to create.
220
 * \return A Ptr to the newly created \c T.
221
 */
222
template <typename T>
223
Ptr<T> Create (void);
224
225
/**
226
 * \tparam T  \explicit The type of class object to create.
219
 * \tparam T  \explicit The type of class object to create.
227
 * \tparam T1 \deduced The type of the first constructor argument.
220
 * \tparam Ts \deduced Types of the constructor arguments.
228
 * \param  [in] a1 The first constructor argument.
221
 * \param  [in] args Constructor argument.
229
 * \return A Ptr to the newly created \c T.
222
 * \return A Ptr to the newly created \c T.
230
 */
223
 */
231
template <typename T,
224
template <typename T,
232
          typename T1>
225
          typename... Ts>
233
Ptr<T> Create (T1 a1);
226
Ptr<T> Create (Ts... args);
234
235
/**
236
 * \tparam T  \explicit The type of class object to create.
237
 * \tparam T1 \deduced The type of the first constructor argument.
238
 * \tparam T2 \deduced The type of the second constructor argument.
239
 * \param  [in] a1 The first constructor argument.
240
 * \param  [in] a2 The second constructor argument.
241
 * \return A Ptr to the newly created \c T.
242
 */
243
template <typename T,
244
          typename T1, typename T2>
245
Ptr<T> Create (T1 a1, T2 a2);
246
247
/**
248
 * \tparam T  \explicit The type of class object to create.
249
 * \tparam T1 \deduced The type of the first constructor argument.
250
 * \tparam T2 \deduced The type of the second constructor argument.
251
 * \tparam T3 \deduced The type of the third constructor argument.
252
 * \param  [in] a1 The first constructor argument.
253
 * \param  [in] a2 The second constructor argument.
254
 * \param  [in] a3 The third constructor argument.
255
 * \return A Ptr to the newly created \c T.
256
 */
257
template <typename T,
258
          typename T1, typename T2,
259
          typename T3>
260
Ptr<T> Create (T1 a1, T2 a2, T3 a3);
261
262
/**
263
 * \tparam T  \explicit The type of class object to create.
264
 * \tparam T1 \deduced The type of the first constructor argument.
265
 * \tparam T2 \deduced The type of the second constructor argument.
266
 * \tparam T3 \deduced The type of the third constructor argument.
267
 * \tparam T4 \deduced The type of the fourth constructor argument.
268
 * \param  [in] a1 The first constructor argument.
269
 * \param  [in] a2 The second constructor argument.
270
 * \param  [in] a3 The third constructor argument.
271
 * \param  [in] a4 The fourth constructor argument.
272
 * \return A Ptr to the newly created \c T.
273
 */
274
template <typename T,
275
          typename T1, typename T2,
276
          typename T3, typename T4>
277
Ptr<T> Create (T1 a1, T2 a2, T3 a3, T4 a4);
278
279
/**
280
 * \tparam T  \explicit The type of class object to create.
281
 * \tparam T1 \deduced The type of the first constructor argument.
282
 * \tparam T2 \deduced The type of the second constructor argument.
283
 * \tparam T3 \deduced The type of the third constructor argument.
284
 * \tparam T4 \deduced The type of the fourth constructor argument.
285
 * \tparam T5 \deduced The type of the fifth constructor argument.
286
 * \param  [in] a1 The first constructor argument.
287
 * \param  [in] a2 The second constructor argument.
288
 * \param  [in] a3 The third constructor argument.
289
 * \param  [in] a4 The fourth constructor argument.
290
 * \param  [in] a5 The fifth constructor argument.
291
 * \return A Ptr to the newly created \c T.
292
 */
293
template <typename T,
294
          typename T1, typename T2,
295
          typename T3, typename T4,
296
          typename T5>
297
Ptr<T> Create (T1 a1, T2 a2, T3 a3, T4 a4, T5 a5);
298
299
/**
300
 * \tparam T  \explicit The type of class object to create.
301
 * \tparam T1 \deduced The type of the first constructor argument.
302
 * \tparam T2 \deduced The type of the second constructor argument.
303
 * \tparam T3 \deduced The type of the third constructor argument.
304
 * \tparam T4 \deduced The type of the fourth constructor argument.
305
 * \tparam T5 \deduced The type of the fifth constructor argument.
306
 * \tparam T6 \deduced The type of the sixth constructor argument.
307
 * \param  [in] a1 The first constructor argument.
308
 * \param  [in] a2 The second constructor argument.
309
 * \param  [in] a3 The third constructor argument.
310
 * \param  [in] a4 The fourth constructor argument.
311
 * \param  [in] a5 The fifth constructor argument.
312
 * \param  [in] a6 The sixth constructor argument.
313
 * \return A Ptr to the newly created \c T.
314
 */
315
template <typename T,
316
          typename T1, typename T2,
317
          typename T3, typename T4,
318
          typename T5, typename T6>
319
Ptr<T> Create (T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6);
320
321
/**
322
 * \tparam T  \explicit The type of class object to create.
323
 * \tparam T1 \deduced The type of the first constructor argument.
324
 * \tparam T2 \deduced The type of the second constructor argument.
325
 * \tparam T3 \deduced The type of the third constructor argument.
326
 * \tparam T4 \deduced The type of the fourth constructor argument.
327
 * \tparam T5 \deduced The type of the fifth constructor argument.
328
 * \tparam T6 \deduced The type of the sixth constructor argument.
329
 * \tparam T7 \deduced The type of the seventh constructor argument.
330
 * \param  [in] a1 The first constructor argument.
331
 * \param  [in] a2 The second constructor argument.
332
 * \param  [in] a3 The third constructor argument.
333
 * \param  [in] a4 The fourth constructor argument.
334
 * \param  [in] a5 The fifth constructor argument.
335
 * \param  [in] a6 The sixth constructor argument.
336
 * \param  [in] a7 The seventh constructor argument.
337
 * \return A Ptr to the newly created \c T.
338
 */
339
template <typename T,
340
          typename T1, typename T2,
341
          typename T3, typename T4,
342
          typename T5, typename T6,
343
          typename T7>
344
Ptr<T> Create (T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7);
345
/** @}*/
227
/** @}*/
346
228
347
/**
229
/**
 Lines 510-561    Link Here 
510
 *  friend non-member function implementations
392
 *  friend non-member function implementations
511
 ************************************************/
393
 ************************************************/
512
394
513
template <typename T>
395
template <typename T, typename... Ts>
514
Ptr<T> Create (void)
396
Ptr<T> Create (Ts... args)
515
{
397
{
516
  return Ptr<T> (new T (), false);
398
  return Ptr<T> (new T (args...), false);
517
}
518
519
template <typename T, typename T1>
520
Ptr<T> Create (T1 a1)
521
{
522
  return Ptr<T> (new T (a1), false);
523
}
524
525
template <typename T, typename T1, typename T2>
526
Ptr<T> Create (T1 a1, T2 a2)
527
{
528
  return Ptr<T> (new T (a1, a2), false);
529
}
530
531
template <typename T, typename T1, typename T2, typename T3>
532
Ptr<T> Create (T1 a1, T2 a2, T3 a3)
533
{
534
  return Ptr<T> (new T (a1, a2, a3), false);
535
}
536
537
template <typename T, typename T1, typename T2, typename T3, typename T4>
538
Ptr<T> Create (T1 a1, T2 a2, T3 a3, T4 a4)
539
{
540
  return Ptr<T> (new T (a1, a2, a3, a4), false);
541
}
542
543
template <typename T, typename T1, typename T2, typename T3, typename T4, typename T5>
544
Ptr<T> Create (T1 a1, T2 a2, T3 a3, T4 a4, T5 a5)
545
{
546
  return Ptr<T> (new T (a1, a2, a3, a4, a5), false);
547
}
548
549
template <typename T, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6>
550
Ptr<T> Create (T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6)
551
{
552
  return Ptr<T> (new T (a1, a2, a3, a4, a5, a6), false);
553
}
554
555
template <typename T, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7>
556
Ptr<T> Create (T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7)
557
{
558
  return Ptr<T> (new T (a1, a2, a3, a4, a5, a6, a7), false);
559
}
399
}
560
400
561
template <typename U>
401
template <typename U>
(-)a/src/core/model/simulator.cc (-24 lines)
 Lines 283-312    Link Here 
283
}
283
}
284
284
285
285
286
EventId
287
Simulator::Schedule (Time const &delay, void (*f)(void))
288
{
289
  return DoSchedule (delay, MakeEvent (f));
290
}
291
292
void
293
Simulator::ScheduleWithContext (uint32_t context, Time const &delay, void (*f)(void))
294
{
295
  return ScheduleWithContext (context, delay, MakeEvent (f));
296
}
297
298
EventId
299
Simulator::ScheduleNow (void (*f)(void))
300
{
301
  return DoScheduleNow (MakeEvent (f));
302
}
303
304
EventId
305
Simulator::ScheduleDestroy (void (*f)(void))
306
{
307
  return DoScheduleDestroy (MakeEvent (f));
308
}
309
310
void
286
void
311
Simulator::Remove (const EventId &id)
287
Simulator::Remove (const EventId &id)
312
{
288
{
(-)a/src/core/model/simulator.h (-1067 / +70 lines)
 Lines 207-314    Link Here 
207
   *
207
   *
208
   * @tparam MEM @deduced Class method function signature type.
208
   * @tparam MEM @deduced Class method function signature type.
209
   * @tparam OBJ @deduced Class type of the object.
209
   * @tparam OBJ @deduced Class type of the object.
210
   * @tparam Ts @deduced Argument types.
210
   * @param [in] delay The relative expiration time of the event.
211
   * @param [in] delay The relative expiration time of the event.
211
   * @param [in] mem_ptr Member method pointer to invoke
212
   * @param [in] mem_ptr Member method pointer to invoke
212
   * @param [in] obj The object on which to invoke the member method
213
   * @param [in] obj The object on which to invoke the member method
214
   * @param [in] args Arguments to pass to the invoked method
213
   * @returns The id for the scheduled event.
215
   * @returns The id for the scheduled event.
214
   */
216
   */
215
  template <typename MEM, typename OBJ>
217
  template <typename MEM, typename OBJ, typename... Ts>
216
  static EventId Schedule (Time const &delay, MEM mem_ptr, OBJ obj);
218
  static EventId Schedule (Time const &delay, MEM mem_ptr, OBJ obj, Ts... args);
217
219
218
  /**
220
  /**
219
   * @see Schedule(const Time&,MEM,OBJ)
220
   * @tparam MEM @deduced Class method function signature type.
221
   * @tparam OBJ @deduced Class type of the object.
222
   * @tparam T1 @deduced Type of first argument.
223
   * @param [in] delay The relative expiration time of the event.
224
   * @param [in] mem_ptr Member method pointer to invoke
225
   * @param [in] obj The object on which to invoke the member method
226
   * @param [in] a1 The first argument to pass to the invoked method
227
   * @returns The id for the scheduled event.
228
   */
229
  template <typename MEM, typename OBJ, typename T1>
230
  static EventId Schedule (Time const &delay, MEM mem_ptr, OBJ obj, T1 a1);
231
232
  /**
233
   * @see Schedule(const Time&,MEM,OBJ)
234
   * @tparam MEM @deduced Class method function signature type.
235
   * @tparam OBJ @deduced Class type of the object.
236
   * @tparam T1 @deduced Type of first argument.
237
   * @tparam T2 @deduced Type of second argument.
238
   * @param [in] delay The relative expiration time of the event.
239
   * @param [in] mem_ptr Member method pointer to invoke
240
   * @param [in] obj The object on which to invoke the member method
241
   * @param [in] a1 The first argument to pass to the invoked method
242
   * @param [in] a2 The second argument to pass to the invoked method
243
   * @returns The id for the scheduled event.
244
   */
245
  template <typename MEM, typename OBJ, typename T1, typename T2>
246
  static EventId Schedule (Time const &delay, MEM mem_ptr, OBJ obj, T1 a1, T2 a2);
247
248
  /**
249
   * @see Schedule(const Time&,MEM,OBJ)
250
   * @tparam MEM @deduced Class method function signature type.
251
   * @tparam OBJ @deduced Class type of the object.
252
   * @tparam T1 @deduced Type of first argument.
253
   * @tparam T2 @deduced Type of second argument.
254
   * @tparam T3 @deduced Type of third argument.
255
   * @param [in] delay The relative expiration time of the event.
256
   * @param [in] mem_ptr Member method pointer to invoke
257
   * @param [in] obj The object on which to invoke the member method
258
   * @param [in] a1 The first argument to pass to the invoked method
259
   * @param [in] a2 The second argument to pass to the invoked method
260
   * @param [in] a3 The third argument to pass to the invoked method
261
   * @returns The id for the scheduled event.
262
   */
263
  template <typename MEM, typename OBJ, 
264
            typename T1, typename T2, typename T3>
265
  static EventId Schedule (Time const &delay, MEM mem_ptr, OBJ obj, T1 a1, T2 a2, T3 a3);
266
267
  /**
268
   * @see Schedule(const Time&,MEM,OBJ)
269
   * @tparam MEM @deduced Class method function signature type.
270
   * @tparam OBJ @deduced Class type of the object.
271
   * @tparam T1 @deduced Type of first argument.
272
   * @tparam T2 @deduced Type of second argument.
273
   * @tparam T3 @deduced Type of third argument.
274
   * @tparam T4 @deduced Type of fourth argument.
275
   * @param [in] delay The relative expiration time of the event.
276
   * @param [in] mem_ptr Member method pointer to invoke
277
   * @param [in] obj The object on which to invoke the member method
278
   * @param [in] a1 The first argument to pass to the invoked method
279
   * @param [in] a2 The second argument to pass to the invoked method
280
   * @param [in] a3 The third argument to pass to the invoked method
281
   * @param [in] a4 The fourth argument to pass to the invoked method
282
   * @returns The id for the scheduled event.
283
   */
284
  template <typename MEM, typename OBJ, 
285
            typename T1, typename T2, typename T3, typename T4>
286
  static EventId Schedule (Time const &delay, MEM mem_ptr, OBJ obj, T1 a1, T2 a2, T3 a3, T4 a4);
287
288
  /**
289
   * @see Schedule(const Time&,MEM,OBJ)
290
   * @tparam MEM @deduced Class method function signature type.
291
   * @tparam OBJ @deduced Class type of the object.
292
   * @tparam T1 @deduced Type of first argument.
293
   * @tparam T2 @deduced Type of second argument.
294
   * @tparam T3 @deduced Type of third argument.
295
   * @tparam T4 @deduced Type of fourth argument.
296
   * @tparam T5 @deduced Type of fifth argument.
297
   * @param [in] delay The relative expiration time of the event.
298
   * @param [in] mem_ptr Member method pointer to invoke
299
   * @param [in] obj The object on which to invoke the member method
300
   * @param [in] a1 The first argument to pass to the invoked method
301
   * @param [in] a2 The second argument to pass to the invoked method
302
   * @param [in] a3 The third argument to pass to the invoked method
303
   * @param [in] a4 The fourth argument to pass to the invoked method
304
   * @param [in] a5 The fifth argument to pass to the invoked method
305
   * @returns The id for the scheduled event.
306
   */
307
  template <typename MEM, typename OBJ, 
308
            typename T1, typename T2, typename T3, typename T4, typename T5>
309
  static EventId Schedule (Time const &delay, MEM mem_ptr, OBJ obj, 
310
                           T1 a1, T2 a2, T3 a3, T4 a4, T5 a5);
311
  /**
312
   * Schedule an event to expire after @p delay.
221
   * Schedule an event to expire after @p delay.
313
   * This can be thought of as scheduling an event
222
   * This can be thought of as scheduling an event
314
   * for the current simulation time plus the @p delay  passed as a
223
   * for the current simulation time plus the @p delay  passed as a
 Lines 316-421    Link Here 
316
   *
225
   *
317
   * When the event expires (when it becomes due to be run), the
226
   * When the event expires (when it becomes due to be run), the
318
   * function will be invoked with any supplied arguments.
227
   * function will be invoked with any supplied arguments.
319
   * @param [in] delay The relative expiration time of the event.
228
   * @tparam Us @deduced Formal type of the function arguments.
320
   * @param [in] f The function to invoke
229
   * @tparam Ts @deduced Actual type of the function arguments.
321
   * @returns The id for the scheduled event.
322
   */
323
  static EventId Schedule (Time const &delay, void (*f)(void));
324
325
  /**
326
   * @see Schedule(const Time&,(*)())
327
   * @tparam U1 @deduced Formal type of the first argument to the function.
328
   * @tparam T1 @deduced Actual type of the first argument.
329
   * @param [in] delay The relative expiration time of the event.
230
   * @param [in] delay The relative expiration time of the event.
330
   * @param [in] f The function to invoke
231
   * @param [in] f The function to invoke
331
   * @param [in] a1 The first argument to pass to the function to invoke.
232
   * @param [in] a1 The first argument to pass to the function to invoke.
332
   * @returns The id for the scheduled event.
233
   * @returns The id for the scheduled event.
333
   */
234
   */
334
  template <typename U1, typename T1>
235
  template <typename... Us, typename... Ts>
335
  static EventId Schedule (Time const &delay, void (*f)(U1), T1 a1);
236
  static EventId Schedule (Time const &delay, void (*f)(Us...), Ts... args);
336
337
  /**
338
   * @see Schedule(const Time&,(*)())
339
   * @tparam U1 @deduced Formal type of the first argument to the function.
340
   * @tparam U2 @deduced Formal type of the second argument to the function.
341
   * @tparam T1 @deduced Actual type of the first argument.
342
   * @tparam T2 @deduced Actual type of the second argument.
343
   * @param [in] delay The relative expiration time of the event.
344
   * @param [in] f The function to invoke
345
   * @param [in] a1 The first argument to pass to the function to invoke
346
   * @param [in] a2 The second argument to pass to the function to invoke
347
   * @returns The id for the scheduled event.
348
   */
349
  template <typename U1, typename U2,
350
            typename T1, typename T2>
351
  static EventId Schedule (Time const &delay, void (*f)(U1,U2), T1 a1, T2 a2);
352
353
  /**
354
   * @see Schedule(const Time&,void(*)())
355
   * @tparam U1 @deduced Formal type of the first argument to the function.
356
   * @tparam U2 @deduced Formal type of the second argument to the function.
357
   * @tparam U3 @deduced Formal type of the third argument to the function.
358
   * @tparam T1 @deduced Actual type of the first argument.
359
   * @tparam T2 @deduced Actual type of the second argument.
360
   * @tparam T3 @deduced Actual type of the third argument.
361
   * @param [in] delay The relative expiration time of the event.
362
   * @param [in] f The function to invoke
363
   * @param [in] a1 The first argument to pass to the function to invoke
364
   * @param [in] a2 The second argument to pass to the function to invoke
365
   * @param [in] a3 The third argument to pass to the function to invoke
366
   * @returns The id for the scheduled event.
367
   */
368
  template <typename U1, typename U2, typename U3,
369
            typename T1, typename T2, typename T3>
370
  static EventId Schedule (Time const &delay, void (*f)(U1,U2,U3), T1 a1, T2 a2, T3 a3);
371
372
  /**
373
   * @see Schedule(const Time&,(*)(void))
374
   * @tparam U1 @deduced Formal type of the first argument to the function.
375
   * @tparam U2 @deduced Formal type of the second argument to the function.
376
   * @tparam U3 @deduced Formal type of the third argument to the function.
377
   * @tparam U4 @deduced Formal type of the fourth argument to the function.
378
   * @tparam T1 @deduced Actual type of the first argument.
379
   * @tparam T2 @deduced Actual type of the second argument.
380
   * @tparam T3 @deduced Actual type of the third argument.
381
   * @tparam T4 @deduced Actual type of the fourth argument.
382
   * @param [in] delay The relative expiration time of the event.
383
   * @param [in] f The function to invoke
384
   * @param [in] a1 The first argument to pass to the function to invoke
385
   * @param [in] a2 The second argument to pass to the function to invoke
386
   * @param [in] a3 The third argument to pass to the function to invoke
387
   * @param [in] a4 The fourth argument to pass to the function to invoke
388
   * @returns The id for the scheduled event.
389
   */
390
  template <typename U1, typename U2, typename U3, typename U4, 
391
            typename T1, typename T2, typename T3, typename T4>
392
  static EventId Schedule (Time const &delay, void (*f)(U1,U2,U3,U4), T1 a1, T2 a2, T3 a3, T4 a4);
393
394
  /**
395
   * @see Schedule(const Time&,void(*)(void))
396
   * @tparam U1 @deduced Formal type of the first argument to the function.
397
   * @tparam U2 @deduced Formal type of the second argument to the function.
398
   * @tparam U3 @deduced Formal type of the third argument to the function.
399
   * @tparam U4 @deduced Formal type of the fourth argument to the function.
400
   * @tparam U5 @deduced Formal type of the fifth argument to the function.
401
   * @tparam T1 @deduced Actual type of the first argument.
402
   * @tparam T2 @deduced Actual type of the second argument.
403
   * @tparam T3 @deduced Actual type of the third argument.
404
   * @tparam T4 @deduced Actual type of the fourth argument.
405
   * @tparam T5 @deduced Actual type of the fifth argument.
406
   * @param [in] delay The relative expiration time of the event.
407
   * @param [in] f The function to invoke
408
   * @param [in] a1 The first argument to pass to the function to invoke
409
   * @param [in] a2 The second argument to pass to the function to invoke
410
   * @param [in] a3 The third argument to pass to the function to invoke
411
   * @param [in] a4 The fourth argument to pass to the function to invoke
412
   * @param [in] a5 The fifth argument to pass to the function to invoke
413
   * @returns The id for the scheduled event.
414
   */
415
  template <typename U1, typename U2, typename U3, typename U4, typename U5,
416
            typename T1, typename T2, typename T3, typename T4, typename T5>
417
  static EventId Schedule (Time const &delay, void (*f)(U1,U2,U3,U4,U5), T1 a1, T2 a2, T3 a3, T4 a4, T5 a5);
418
419
  /** @} */
237
  /** @} */
420
238
421
  /**
239
  /**
 Lines 432-539    Link Here 
432
   * @see Schedule(const Time&,MEM,OBJ)
250
   * @see Schedule(const Time&,MEM,OBJ)
433
   * @tparam MEM @deduced Class method function signature type.
251
   * @tparam MEM @deduced Class method function signature type.
434
   * @tparam OBJ @deduced Class type of the object.
252
   * @tparam OBJ @deduced Class type of the object.
435
   * @param [in] context User-specified context parameter
253
   * @tparam Ts @deduced Argument types.
436
   * @param [in] delay The relative expiration time of the event.
437
   * @param [in] mem_ptr Member method pointer to invoke
438
   * @param [in] obj The object on which to invoke the member method
439
   */
440
  template <typename MEM, typename OBJ>
441
  static void ScheduleWithContext (uint32_t context, Time const &delay, MEM mem_ptr, OBJ obj);
442
443
  /**
444
   * @see ScheduleWithContext(uint32_t,const Time&,MEM,OBJ)
445
   * @tparam MEM @deduced Class method function signature type.
446
   * @tparam OBJ @deduced Class type of the object.
447
   * @tparam T1 @deduced Type of first argument.
448
   * @param [in] context User-specified context parameter
254
   * @param [in] context User-specified context parameter
449
   * @param [in] delay The relative expiration time of the event.
255
   * @param [in] delay The relative expiration time of the event.
450
   * @param [in] mem_ptr Member method pointer to invoke
256
   * @param [in] mem_ptr Member method pointer to invoke
451
   * @param [in] obj The object on which to invoke the member method
257
   * @param [in] obj The object on which to invoke the member method
452
   * @param [in] a1 The first argument to pass to the invoked method
258
   * @param [in] a1 The first argument to pass to the invoked method
453
   */
259
   */
454
  template <typename MEM, typename OBJ, typename T1>
260
  template <typename MEM, typename OBJ, typename... Ts>
455
  static void ScheduleWithContext (uint32_t context, Time const &delay, MEM mem_ptr, OBJ obj, T1 a1);
261
  static void ScheduleWithContext (uint32_t context, Time const &delay, MEM mem_ptr, OBJ obj, Ts... args);
456
262
457
  /**
263
  /**
458
   * @see ScheduleWithContext(uint32_t,const Time&,MEM,OBJ)
459
   * @tparam MEM @deduced Class method function signature type.
460
   * @tparam OBJ @deduced Class type of the object.
461
   * @tparam T1 @deduced Type of first argument.
462
   * @tparam T2 @deduced Type of second argument.
463
   * @param [in] context User-specified context parameter
464
   * @param [in] delay The relative expiration time of the event.
465
   * @param [in] mem_ptr Member method pointer to invoke
466
   * @param [in] obj The object on which to invoke the member method
467
   * @param [in] a1 The first argument to pass to the invoked method
468
   * @param [in] a2 The second argument to pass to the invoked method
469
   */
470
  template <typename MEM, typename OBJ, typename T1, typename T2>
471
  static void ScheduleWithContext (uint32_t context, Time const &delay, MEM mem_ptr, OBJ obj, T1 a1, T2 a2);
472
473
  /**
474
   * @see ScheduleWithContext(uint32_t,const Time&,MEM,OBJ)
475
   * @tparam MEM @deduced Class method function signature type.
476
   * @tparam OBJ @deduced Class type of the object.
477
   * @tparam T1 @deduced Type of first argument.
478
   * @tparam T2 @deduced Type of second argument.
479
   * @tparam T3 @deduced Type of third argument.
480
   * @param [in] context User-specified context parameter
481
   * @param [in] delay The relative expiration time of the event.
482
   * @param [in] mem_ptr Member method pointer to invoke
483
   * @param [in] obj The object on which to invoke the member method
484
   * @param [in] a1 The first argument to pass to the invoked method
485
   * @param [in] a2 The second argument to pass to the invoked method
486
   * @param [in] a3 The third argument to pass to the invoked method
487
   */
488
  template <typename MEM, typename OBJ, 
489
            typename T1, typename T2, typename T3>
490
  static void ScheduleWithContext (uint32_t context, Time const &delay, MEM mem_ptr, OBJ obj, T1 a1, T2 a2, T3 a3);
491
492
  /**
493
   * @see ScheduleWithContext(uint32_t,const Time&,MEM,OBJ)
494
   * @tparam MEM @deduced Class method function signature type.
495
   * @tparam OBJ @deduced Class type of the object.
496
   * @tparam T1 @deduced Type of first argument.
497
   * @tparam T2 @deduced Type of second argument.
498
   * @tparam T3 @deduced Type of third argument.
499
   * @tparam T4 @deduced Type of fourth argument.
500
   * @param [in] context User-specified context parameter
501
   * @param [in] delay The relative expiration time of the event.
502
   * @param [in] mem_ptr Member method pointer to invoke
503
   * @param [in] obj The object on which to invoke the member method
504
   * @param [in] a1 The first argument to pass to the invoked method
505
   * @param [in] a2 The second argument to pass to the invoked method
506
   * @param [in] a3 The third argument to pass to the invoked method
507
   * @param [in] a4 The fourth argument to pass to the invoked method
508
   */
509
  template <typename MEM, typename OBJ, 
510
            typename T1, typename T2, typename T3, typename T4>
511
  static void ScheduleWithContext (uint32_t context, Time const &delay, MEM mem_ptr, OBJ obj, T1 a1, T2 a2, T3 a3, T4 a4);
512
513
  /**
514
   * @see ScheduleWithContext(uint32_t,const Time&,MEM,OBJ)
515
   * @tparam MEM @deduced Class method function signature type.
516
   * @tparam OBJ @deduced Class type of the object.
517
   * @tparam T1 @deduced Type of first argument.
518
   * @tparam T2 @deduced Type of second argument.
519
   * @tparam T3 @deduced Type of third argument.
520
   * @tparam T4 @deduced Type of fourth argument.
521
   * @tparam T5 @deduced Type of fifth argument.
522
   * @param [in] context User-specified context parameter
523
   * @param [in] delay The relative expiration time of the event.
524
   * @param [in] mem_ptr Member method pointer to invoke
525
   * @param [in] obj The object on which to invoke the member method
526
   * @param [in] a1 The first argument to pass to the invoked method
527
   * @param [in] a2 The second argument to pass to the invoked method
528
   * @param [in] a3 The third argument to pass to the invoked method
529
   * @param [in] a4 The fourth argument to pass to the invoked method
530
   * @param [in] a5 The fifth argument to pass to the invoked method
531
   */
532
  template <typename MEM, typename OBJ, 
533
            typename T1, typename T2, typename T3, typename T4, typename T5>
534
  static void ScheduleWithContext (uint32_t context, Time const &delay, MEM mem_ptr, OBJ obj, 
535
                                   T1 a1, T2 a2, T3 a3, T4 a4, T5 a5);
536
  /**
537
   * Schedule an event with the given context.
264
   * Schedule an event with the given context.
538
   * A context of 0xffffffff means no context is specified.
265
   * A context of 0xffffffff means no context is specified.
539
   * This method is thread-safe: it can be called from any thread.
266
   * This method is thread-safe: it can be called from any thread.
 Lines 542-650    Link Here 
542
   * function will be invoked with any supplied arguments.
269
   * function will be invoked with any supplied arguments.
543
   *
270
   *
544
   * This method is thread-safe: it can be called from any thread.
271
   * This method is thread-safe: it can be called from any thread.
545
   * @param [in] context User-specified context parameter
272
   * @tparam Us @deduced Formal type of the function arguments.
546
   * @param [in] delay The relative expiration time of the event.
273
   * @tparam Ts @deduced Actual type of the function arguments.
547
   * @param [in] f The function to invoke
548
   */
549
  static void ScheduleWithContext (uint32_t context, Time const &delay, void (*f)(void));
550
551
  /**
552
   * @see ScheduleWithContext(uint32_t,const Time&,(*)())
553
   * @tparam U1 @deduced Formal type of the first argument to the function.
554
   * @tparam T1 @deduced Actual type of the first argument.
555
   * @param [in] context User-specified context parameter
274
   * @param [in] context User-specified context parameter
556
   * @param [in] delay The relative expiration time of the event.
275
   * @param [in] delay The relative expiration time of the event.
557
   * @param [in] f The function to invoke
276
   * @param [in] f The function to invoke
558
   * @param [in] a1 The first argument to pass to the function to invoke
277
   * @param [in] a1 The first argument to pass to the function to invoke
559
   */
278
   */
560
  template <typename U1,
279
  template <typename... Us, typename... Ts>
561
            typename T1>
280
  static void ScheduleWithContext (uint32_t context, Time const &delay, void (*f)(Us...), Ts... args);
562
  static void ScheduleWithContext (uint32_t context, Time const &delay, void (*f)(U1), T1 a1);
563
564
  /**
565
   * @see ScheduleWithContext(uint32_t,const Time&,(*)())
566
   * @tparam U1 @deduced Formal type of the first argument to the function.
567
   * @tparam U2 @deduced Formal type of the second argument to the function.
568
   * @tparam T1 @deduced Actual type of the first argument.
569
   * @tparam T2 @deduced Actual type of the second argument.
570
   * @param [in] context User-specified context parameter
571
   * @param [in] delay The relative expiration time of the event.
572
   * @param [in] f The function to invoke
573
   * @param [in] a1 The first argument to pass to the function to invoke
574
   * @param [in] a2 The second argument to pass to the function to invoke
575
   */
576
  template <typename U1, typename U2,
577
            typename T1, typename T2>
578
  static void ScheduleWithContext (uint32_t context, Time const &delay, void (*f)(U1,U2), T1 a1, T2 a2);
579
580
  /**
581
   * @see ScheduleWithContext(uint32_t,const Time&,(*)())
582
   * @tparam U1 @deduced Formal type of the first argument to the function.
583
   * @tparam U2 @deduced Formal type of the second argument to the function.
584
   * @tparam U3 @deduced Formal type of the third argument to the function.
585
   * @tparam T1 @deduced Actual type of the first argument.
586
   * @tparam T2 @deduced Actual type of the second argument.
587
   * @tparam T3 @deduced Actual type of the third argument.
588
   * @param [in] context User-specified context parameter
589
   * @param [in] delay The relative expiration time of the event.
590
   * @param [in] f The function to invoke
591
   * @param [in] a1 The first argument to pass to the function to invoke
592
   * @param [in] a2 The second argument to pass to the function to invoke
593
   * @param [in] a3 The third argument to pass to the function to invoke
594
   */
595
  template <typename U1, typename U2, typename U3,
596
            typename T1, typename T2, typename T3>
597
  static void ScheduleWithContext (uint32_t context, Time const &delay, void (*f)(U1,U2,U3), T1 a1, T2 a2, T3 a3);
598
599
  /**
600
   * @see ScheduleWithContext(uint32_t,const Time&,(*)())
601
   * @tparam U1 @deduced Formal type of the first argument to the function.
602
   * @tparam U2 @deduced Formal type of the second argument to the function.
603
   * @tparam U3 @deduced Formal type of the third argument to the function.
604
   * @tparam U4 @deduced Formal type of the fourth argument to the function.
605
   * @tparam T1 @deduced Actual type of the first argument.
606
   * @tparam T2 @deduced Actual type of the second argument.
607
   * @tparam T3 @deduced Actual type of the third argument.
608
   * @tparam T4 @deduced Actual type of the fourth argument.
609
   * @param [in] context User-specified context parameter
610
   * @param [in] delay The relative expiration time of the event.
611
   * @param [in] f The function to invoke
612
   * @param [in] a1 The first argument to pass to the function to invoke
613
   * @param [in] a2 The second argument to pass to the function to invoke
614
   * @param [in] a3 The third argument to pass to the function to invoke
615
   * @param [in] a4 The fourth argument to pass to the function to invoke
616
   */
617
  template <typename U1, typename U2, typename U3, typename U4, 
618
            typename T1, typename T2, typename T3, typename T4>
619
  static void ScheduleWithContext (uint32_t context, Time const &delay, void (*f)(U1,U2,U3,U4), T1 a1, T2 a2, T3 a3, T4 a4);
620
621
  /**
622
   * @see ScheduleWithContext(uint32_t,const Time&,(*)())
623
   * @tparam U1 @deduced Formal type of the first argument to the function.
624
   * @tparam U2 @deduced Formal type of the second argument to the function.
625
   * @tparam U3 @deduced Formal type of the third argument to the function.
626
   * @tparam U4 @deduced Formal type of the fourth argument to the function.
627
   * @tparam U5 @deduced Formal type of the fifth argument to the function.
628
   * @tparam T1 @deduced Actual type of the first argument.
629
   * @tparam T2 @deduced Actual type of the second argument.
630
   * @tparam T3 @deduced Actual type of the third argument.
631
   * @tparam T4 @deduced Actual type of the fourth argument.
632
   * @tparam T5 @deduced Actual type of the fifth argument.
633
   * @param [in] context User-specified context parameter
634
   * @param [in] delay The relative expiration time of the event.
635
   * @param [in] f The function to invoke
636
   * @param [in] a1 The first argument to pass to the function to invoke
637
   * @param [in] a2 The second argument to pass to the function to invoke
638
   * @param [in] a3 The third argument to pass to the function to invoke
639
   * @param [in] a4 The fourth argument to pass to the function to invoke
640
   * @param [in] a5 The fifth argument to pass to the function to invoke
641
   */
642
  template <typename U1, typename U2, typename U3, typename U4, typename U5,
643
            typename T1, typename T2, typename T3, typename T4, typename T5>
644
  static void ScheduleWithContext (uint32_t context, Time const &delay, void (*f)(U1,U2,U3,U4,U5), T1 a1, T2 a2, T3 a3, T4 a4, T5 a5);
645
281
646
  /** @} */
282
  /** @} */
647
  
283
648
  /**
284
  /**
649
   * @name Schedule events (in the same context) to run now.
285
   * @name Schedule events (in the same context) to run now.
650
   */
286
   */
 Lines 656-858    Link Here 
656
   *
292
   *
657
   * @tparam MEM @deduced Class method function signature type.
293
   * @tparam MEM @deduced Class method function signature type.
658
   * @tparam OBJ @deduced Class type of the object.
294
   * @tparam OBJ @deduced Class type of the object.
295
   * @tparam T1 @deduced Argument types.
659
   * @param [in] mem_ptr Member method pointer to invoke
296
   * @param [in] mem_ptr Member method pointer to invoke
660
   * @param [in] obj The object on which to invoke the member method
297
   * @param [in] obj The object on which to invoke the member method
298
   * @param [in] args Arguments to pass to the invoked method
661
   * @return The EventId of the scheduled event.
299
   * @return The EventId of the scheduled event.
662
   */
300
   */
663
  template <typename MEM, typename OBJ>
301
  template <typename MEM, typename OBJ, typename... Ts>
664
  static EventId ScheduleNow (MEM mem_ptr, OBJ obj);
302
  static EventId ScheduleNow (MEM mem_ptr, OBJ obj, Ts... args);
665
303
666
  /**
304
  /**
667
   * @see ScheduleNow(MEM,OBJ)
668
   * @tparam MEM @deduced Class method function signature type.
669
   * @tparam OBJ @deduced Class type of the object.
670
   * @tparam T1 @deduced Type of first argument.
671
   * @param [in] mem_ptr Member method pointer to invoke
672
   * @param [in] obj The object on which to invoke the member method
673
   * @param [in] a1 The first argument to pass to the invoked method
674
   * @return The EventId of the scheduled event.
675
   */
676
  template <typename MEM, typename OBJ, 
677
            typename T1>
678
  static EventId ScheduleNow (MEM mem_ptr, OBJ obj, T1 a1);
679
680
  /**
681
   * @see ScheduleNow(MEM,OBJ)
682
   * @tparam MEM @deduced Class method function signature type.
683
   * @tparam OBJ @deduced Class type of the object.
684
   * @tparam T1 @deduced Type of first argument.
685
   * @tparam T2 @deduced Type of second argument.
686
   * @param [in] mem_ptr Member method pointer to invoke
687
   * @param [in] obj The object on which to invoke the member method
688
   * @param [in] a1 The first argument to pass to the invoked method
689
   * @param [in] a2 The second argument to pass to the invoked method
690
   * @return The EventId of the scheduled event.
691
   */
692
  template <typename MEM, typename OBJ, 
693
            typename T1, typename T2>
694
  static EventId ScheduleNow (MEM mem_ptr, OBJ obj, T1 a1, T2 a2);
695
696
  /**
697
   * @see ScheduleNow(MEM,OBJ)
698
   * @tparam MEM @deduced Class method function signature type.
699
   * @tparam OBJ @deduced Class type of the object.
700
   * @tparam T1 @deduced Type of first argument.
701
   * @tparam T2 @deduced Type of second argument.
702
   * @tparam T3 @deduced Type of third argument.
703
   * @param [in] mem_ptr Member method pointer to invoke
704
   * @param [in] obj The object on which to invoke the member method
705
   * @param [in] a1 The first argument to pass to the invoked method
706
   * @param [in] a2 The second argument to pass to the invoked method
707
   * @param [in] a3 The third argument to pass to the invoked method
708
   * @return The EventId of the scheduled event.
709
   */
710
  template <typename MEM, typename OBJ, 
711
            typename T1, typename T2, typename T3>
712
  static EventId ScheduleNow (MEM mem_ptr, OBJ obj, T1 a1, T2 a2, T3 a3);
713
714
  /**
715
   * @see ScheduleNow(MEM,OBJ)
716
   * @tparam MEM @deduced Class method function signature type.
717
   * @tparam OBJ @deduced Class type of the object.
718
   * @tparam T1 @deduced Type of first argument.
719
   * @tparam T2 @deduced Type of second argument.
720
   * @tparam T3 @deduced Type of third argument.
721
   * @tparam T4 @deduced Type of fourth argument.
722
   * @param [in] mem_ptr Member method pointer to invoke
723
   * @param [in] obj The object on which to invoke the member method
724
   * @param [in] a1 The first argument to pass to the invoked method
725
   * @param [in] a2 The second argument to pass to the invoked method
726
   * @param [in] a3 The third argument to pass to the invoked method
727
   * @param [in] a4 The fourth argument to pass to the invoked method
728
   * @return The EventId of the scheduled event.
729
   */
730
  template <typename MEM, typename OBJ, 
731
            typename T1, typename T2, typename T3, typename T4>
732
  static EventId ScheduleNow (MEM mem_ptr, OBJ obj, 
733
                              T1 a1, T2 a2, T3 a3, T4 a4);
734
  /**
735
   * @see ScheduleNow(MEM,OBJ)
736
   * @tparam MEM @deduced Class method function signature type.
737
   * @tparam OBJ @deduced Class type of the object.
738
   * @tparam T1 @deduced Type of first argument.
739
   * @tparam T2 @deduced Type of second argument.
740
   * @tparam T3 @deduced Type of third argument.
741
   * @tparam T4 @deduced Type of fourth argument.
742
   * @tparam T5 @deduced Type of fifth argument.
743
   * @param [in] mem_ptr Member method pointer to invoke
744
   * @param [in] obj The object on which to invoke the member method
745
   * @param [in] a1 The first argument to pass to the invoked method
746
   * @param [in] a2 The second argument to pass to the invoked method
747
   * @param [in] a3 The third argument to pass to the invoked method
748
   * @param [in] a4 The fourth argument to pass to the invoked method
749
   * @param [in] a5 The fifth argument to pass to the invoked method
750
   * @return The EventId of the scheduled event.
751
   */
752
  template <typename MEM, typename OBJ, 
753
            typename T1, typename T2, typename T3, typename T4, typename T5>
754
  static EventId ScheduleNow (MEM mem_ptr, OBJ obj, 
755
                              T1 a1, T2 a2, T3 a3, T4 a4, T5 a5);
756
  /**
757
   * @copybrief ScheduleNow(MEM,OBJ)
305
   * @copybrief ScheduleNow(MEM,OBJ)
758
   *
306
   *
759
   * When the event expires (when it becomes due to be run), the
307
   * When the event expires (when it becomes due to be run), the
760
   * function will be invoked with any supplied arguments.
308
   * function will be invoked with any supplied arguments.
309
   * @tparam Us @deduced Formal type of the function arguments.
310
   * @tparam Ts @deduced Actual type of the function arguments.
761
   * @param [in] f The function to invoke
311
   * @param [in] f The function to invoke
312
   * @param [in] args Arguments to pass to the function to invoke
762
   * @return The EventId of the scheduled event.
313
   * @return The EventId of the scheduled event.
763
   */
314
   */
764
  static EventId ScheduleNow (void (*f)(void));
315
  template <typename... Us, typename... Ts>
765
316
  static EventId ScheduleNow (void (*f)(Us...), Ts... args);
766
  /**
767
   * @see ScheduleNow(*)
768
   * @tparam U1 @deduced Formal type of the first argument to the function.
769
   * @tparam T1 @deduced Actual type of the first argument.
770
   * @param [in] f The function to invoke
771
   * @param [in] a1 The first argument to pass to the function to invoke
772
   * @return The EventId of the scheduled event.
773
   */
774
  template <typename U1,
775
            typename T1>
776
  static EventId ScheduleNow (void (*f)(U1), T1 a1);
777
778
  /**
779
   * @see ScheduleNow(*)
780
   * @tparam U1 @deduced Formal type of the first argument to the function.
781
   * @tparam U2 @deduced Formal type of the second argument to the function.
782
   * @tparam T1 @deduced Actual type of the first argument.
783
   * @tparam T2 @deduced Actual type of the second argument.
784
   * @param [in] f The function to invoke
785
   * @param [in] a1 The first argument to pass to the function to invoke
786
   * @param [in] a2 The second argument to pass to the function to invoke
787
   * @return The EventId of the scheduled event.
788
   */
789
  template <typename U1, typename U2,
790
            typename T1, typename T2>
791
  static EventId ScheduleNow (void (*f)(U1,U2), T1 a1, T2 a2);
792
793
  /**
794
   * @see ScheduleNow(*)
795
   * @tparam U1 @deduced Formal type of the first argument to the function.
796
   * @tparam U2 @deduced Formal type of the second argument to the function.
797
   * @tparam U3 @deduced Formal type of the third argument to the function.
798
   * @tparam T1 @deduced Actual type of the first argument.
799
   * @tparam T2 @deduced Actual type of the second argument.
800
   * @tparam T3 @deduced Actual type of the third argument.
801
   * @param [in] f The function to invoke
802
   * @param [in] a1 The first argument to pass to the function to invoke
803
   * @param [in] a2 The second argument to pass to the function to invoke
804
   * @param [in] a3 The third argument to pass to the function to invoke
805
   * @return The EventId of the scheduled event.
806
   */
807
  template <typename U1, typename U2, typename U3,
808
            typename T1, typename T2, typename T3>
809
  static EventId ScheduleNow (void (*f)(U1,U2,U3), T1 a1, T2 a2, T3 a3);
810
811
  /**
812
   * @see ScheduleNow(*)
813
   * @tparam U1 @deduced Formal type of the first argument to the function.
814
   * @tparam U2 @deduced Formal type of the second argument to the function.
815
   * @tparam U3 @deduced Formal type of the third argument to the function.
816
   * @tparam U4 @deduced Formal type of the fourth argument to the function.
817
   * @tparam T1 @deduced Actual type of the first argument.
818
   * @tparam T2 @deduced Actual type of the second argument.
819
   * @tparam T3 @deduced Actual type of the third argument.
820
   * @tparam T4 @deduced Actual type of the fourth argument.
821
   * @param [in] f The function to invoke
822
   * @param [in] a1 The first argument to pass to the function to invoke
823
   * @param [in] a2 The second argument to pass to the function to invoke
824
   * @param [in] a3 The third argument to pass to the function to invoke
825
   * @param [in] a4 The fourth argument to pass to the function to invoke
826
   * @return The EventId of the scheduled event.
827
   */
828
  template <typename U1, typename U2, typename U3, typename U4,
829
            typename T1, typename T2, typename T3, typename T4>
830
  static EventId ScheduleNow (void (*f)(U1,U2,U3,U4), T1 a1, T2 a2, T3 a3, T4 a4);
831
832
  /**
833
   * @see ScheduleNow(*)
834
   * @tparam U1 @deduced Formal type of the first argument to the function.
835
   * @tparam U2 @deduced Formal type of the second argument to the function.
836
   * @tparam U3 @deduced Formal type of the third argument to the function.
837
   * @tparam U4 @deduced Formal type of the fourth argument to the function.
838
   * @tparam U5 @deduced Formal type of the fifth argument to the function.
839
   * @tparam T1 @deduced Actual type of the first argument.
840
   * @tparam T2 @deduced Actual type of the second argument.
841
   * @tparam T3 @deduced Actual type of the third argument.
842
   * @tparam T4 @deduced Actual type of the fourth argument.
843
   * @tparam T5 @deduced Actual type of the fifth argument.
844
   * @param [in] f The function to invoke
845
   * @param [in] a1 The first argument to pass to the function to invoke
846
   * @param [in] a2 The second argument to pass to the function to invoke
847
   * @param [in] a3 The third argument to pass to the function to invoke
848
   * @param [in] a4 The fourth argument to pass to the function to invoke
849
   * @param [in] a5 The fifth argument to pass to the function to invoke
850
   * @return The EventId of the scheduled event.
851
   */
852
  template <typename U1, typename U2, typename U3, typename U4, typename U5,
853
            typename T1, typename T2, typename T3, typename T4, typename T5>
854
  static EventId ScheduleNow (void (*f)(U1,U2,U3,U4,U5), T1 a1, T2 a2, T3 a3, T4 a4, T5 a5);
855
856
  /** @} */
317
  /** @} */
857
318
858
  /**
319
  /**
 Lines 864-1068    Link Here 
864
   * All events scheduled to expire at "Destroy" time are scheduled FIFO, 
325
   * All events scheduled to expire at "Destroy" time are scheduled FIFO, 
865
   * after all normal events have expired and only when 
326
   * after all normal events have expired and only when 
866
   * Simulator::Destroy is invoked.
327
   * Simulator::Destroy is invoked.
867
   *
868
   * @tparam MEM @deduced Class method function signature type.
328
   * @tparam MEM @deduced Class method function signature type.
869
   * @tparam OBJ @deduced Class type of the object.
329
   * @tparam OBJ @deduced Class type of the object.
330
   * @tparam Ts @deduced Argument types.
870
   * @param [in] mem_ptr Member method pointer to invoke
331
   * @param [in] mem_ptr Member method pointer to invoke
871
   * @param [in] obj The object on which to invoke the member method
332
   * @param [in] obj The object on which to invoke the member method
333
   * @param [in] args Arguments to pass to the invoked method
872
   * @return The EventId of the scheduled event.
334
   * @return The EventId of the scheduled event.
873
   */
335
   */
874
  template <typename MEM, typename OBJ>
336
  template <typename MEM, typename OBJ, typename... Ts>
875
  static EventId ScheduleDestroy (MEM mem_ptr, OBJ obj);
337
  static EventId ScheduleDestroy (MEM mem_ptr, OBJ obj, Ts... args);
876
338
877
  /**
339
  /**
878
   * @see ScheduleDestroy(MEM,OBJ)
879
   * @tparam MEM @deduced Class method function signature type.
880
   * @tparam OBJ @deduced Class type of the object.
881
   * @tparam T1 @deduced Type of first argument.
882
   * @param [in] mem_ptr Member method pointer to invoke
883
   * @param [in] obj The object on which to invoke the member method
884
   * @param [in] a1 The first argument to pass to the invoked method
885
   * @return The EventId of the scheduled event.
886
   */
887
  template <typename MEM, typename OBJ, 
888
            typename T1>
889
  static EventId ScheduleDestroy (MEM mem_ptr, OBJ obj, T1 a1);
890
891
  /**
892
   * @see ScheduleDestroy(MEM,OBJ)
893
   * @tparam MEM @deduced Class method function signature type.
894
   * @tparam OBJ @deduced Class type of the object.
895
   * @tparam T1 @deduced Type of first argument.
896
   * @tparam T2 @deduced Type of second argument.
897
   * @param [in] mem_ptr Member method pointer to invoke
898
   * @param [in] obj The object on which to invoke the member method
899
   * @param [in] a1 The first argument to pass to the invoked method
900
   * @param [in] a2 The second argument to pass to the invoked method
901
   * @return The EventId of the scheduled event.
902
   */
903
  template <typename MEM, typename OBJ,
904
            typename T1, typename T2>
905
  static EventId ScheduleDestroy (MEM mem_ptr, OBJ obj, T1 a1, T2 a2);
906
907
  /**
908
   * @see ScheduleDestroy(MEM,OBJ)
909
   * @tparam MEM @deduced Class method function signature type.
910
   * @tparam OBJ @deduced Class type of the object.
911
   * @tparam T1 @deduced Type of first argument.
912
   * @tparam T2 @deduced Type of second argument.
913
   * @tparam T3 @deduced Type of third argument.
914
   * @param [in] mem_ptr Member method pointer to invoke
915
   * @param [in] obj The object on which to invoke the member method
916
   * @param [in] a1 The first argument to pass to the invoked method
917
   * @param [in] a2 The second argument to pass to the invoked method
918
   * @param [in] a3 The third argument to pass to the invoked method
919
   * @return The EventId of the scheduled event.
920
   */
921
  template <typename MEM, typename OBJ, 
922
            typename T1, typename T2, typename T3>
923
  static EventId ScheduleDestroy (MEM mem_ptr, OBJ obj, T1 a1, T2 a2, T3 a3);
924
925
  /**
926
   * @see ScheduleDestroy(MEM,OBJ)
927
   * @tparam MEM @deduced Class method function signature type.
928
   * @tparam OBJ @deduced Class type of the object.
929
   * @tparam T1 @deduced Type of first argument.
930
   * @tparam T2 @deduced Type of second argument.
931
   * @tparam T3 @deduced Type of third argument.
932
   * @tparam T4 @deduced Type of fourth argument.
933
   * @param [in] mem_ptr Member method pointer to invoke
934
   * @param [in] obj The object on which to invoke the member method
935
   * @param [in] a1 The first argument to pass to the invoked method
936
   * @param [in] a2 The second argument to pass to the invoked method
937
   * @param [in] a3 The third argument to pass to the invoked method
938
   * @param [in] a4 The fourth argument to pass to the invoked method
939
   * @return The EventId of the scheduled event.
940
   */
941
  template <typename MEM, typename OBJ, 
942
            typename T1, typename T2, typename T3, typename T4>
943
  static EventId ScheduleDestroy (MEM mem_ptr, OBJ obj, 
944
                                  T1 a1, T2 a2, T3 a3, T4 a4);
945
  /**
946
   * @see ScheduleDestroy(MEM,OBJ)
947
   * @tparam MEM @deduced Class method function signature type.
948
   * @tparam OBJ @deduced Class type of the object.
949
   * @tparam T1 @deduced Type of first argument.
950
   * @tparam T2 @deduced Type of second argument.
951
   * @tparam T3 @deduced Type of third argument.
952
   * @tparam T4 @deduced Type of fourth argument.
953
   * @tparam T5 @deduced Type of fifth argument.
954
   * @param [in] mem_ptr Member method pointer to invoke
955
   * @param [in] obj The object on which to invoke the member method
956
   * @param [in] a1 The first argument to pass to the invoked method
957
   * @param [in] a2 The second argument to pass to the invoked method
958
   * @param [in] a3 The third argument to pass to the invoked method
959
   * @param [in] a4 The fourth argument to pass to the invoked method
960
   * @param [in] a5 The fifth argument to pass to the invoked method
961
   * @return The EventId of the scheduled event.
962
   */
963
  template <typename MEM, typename OBJ, 
964
            typename T1, typename T2, typename T3, typename T4, typename T5>
965
  static EventId ScheduleDestroy (MEM mem_ptr, OBJ obj, 
966
                                  T1 a1, T2 a2, T3 a3, T4 a4, T5 a5);
967
  /**
968
   * @copybrief ScheduleDestroy(MEM,OBJ)
340
   * @copybrief ScheduleDestroy(MEM,OBJ)
969
   * When Simulator::Destroy() is called, the
341
   * When Simulator::Destroy() is called, the
970
   * function will be invoked with any supplied arguments.
342
   * function will be invoked with any supplied arguments.
343
   * @tparam Us @deduced Formal types of the function arguments.
344
   * @tparam Ts @deduced Actual types of the function arguments.
971
   * @param [in] f The function to invoke
345
   * @param [in] f The function to invoke
346
   * @param [in] args Arguments to pass to the function to invoke
972
   * @return The EventId of the scheduled event.
347
   * @return The EventId of the scheduled event.
973
   */
348
   */
974
  static EventId ScheduleDestroy (void (*f)(void));
349
  template <typename... Us, typename... Ts>
975
350
  static EventId ScheduleDestroy (void (*f)(Us...), Ts... args);
976
  /**
977
   * @see ScheduleDestory((*)())
978
   * @tparam U1 @deduced Formal type of the first argument to the function.
979
   * @tparam T1 @deduced Actual type of the first argument.
980
   * @param [in] f The function to invoke
981
   * @param [in] a1 The first argument to pass to the function to invoke
982
   * @return The EventId of the scheduled event.
983
   */
984
  template <typename U1,
985
            typename T1>
986
  static EventId ScheduleDestroy (void (*f)(U1), T1 a1);
987
988
  /**
989
   * @see ScheduleDestory((*)())
990
   * @tparam U1 @deduced Formal type of the first argument to the function.
991
   * @tparam U2 @deduced Formal type of the second argument to the function.
992
   * @tparam T1 @deduced Actual type of the first argument.
993
   * @tparam T2 @deduced Actual type of the second argument.
994
   * @param [in] f The function to invoke
995
   * @param [in] a1 The first argument to pass to the function to invoke
996
   * @param [in] a2 The second argument to pass to the function to invoke
997
   * @return The EventId of the scheduled event.
998
   */
999
  template <typename U1, typename U2,
1000
            typename T1, typename T2>
1001
  static EventId ScheduleDestroy (void (*f)(U1,U2), T1 a1, T2 a2);
1002
1003
  /**
1004
   * @see ScheduleDestory((*)())
1005
   * @tparam U1 @deduced Formal type of the first argument to the function.
1006
   * @tparam U2 @deduced Formal type of the second argument to the function.
1007
   * @tparam U3 @deduced Formal type of the third argument to the function.
1008
   * @tparam T1 @deduced Actual type of the first argument.
1009
   * @tparam T2 @deduced Actual type of the second argument.
1010
   * @tparam T3 @deduced Actual type of the third argument.
1011
   * @param [in] f The function to invoke
1012
   * @param [in] a1 The first argument to pass to the function to invoke
1013
   * @param [in] a2 The second argument to pass to the function to invoke
1014
   * @param [in] a3 The third argument to pass to the function to invoke
1015
   * @return The EventId of the scheduled event.
1016
   */
1017
  template <typename U1, typename U2, typename U3,
1018
            typename T1, typename T2, typename T3>
1019
  static EventId ScheduleDestroy (void (*f)(U1,U2,U3), T1 a1, T2 a2, T3 a3);
1020
1021
  /**
1022
   * @see ScheduleDestory((*)())
1023
   * @tparam U1 @deduced Formal type of the first argument to the function.
1024
   * @tparam U2 @deduced Formal type of the second argument to the function.
1025
   * @tparam U3 @deduced Formal type of the third argument to the function.
1026
   * @tparam U4 @deduced Formal type of the fourth argument to the function.
1027
   * @tparam T1 @deduced Actual type of the first argument.
1028
   * @tparam T2 @deduced Actual type of the second argument.
1029
   * @tparam T3 @deduced Actual type of the third argument.
1030
   * @tparam T4 @deduced Actual type of the fourth argument.
1031
   * @param [in] f The function to invoke
1032
   * @param [in] a1 The first argument to pass to the function to invoke
1033
   * @param [in] a2 The second argument to pass to the function to invoke
1034
   * @param [in] a3 The third argument to pass to the function to invoke
1035
   * @param [in] a4 The fourth argument to pass to the function to invoke
1036
   * @return The EventId of the scheduled event.
1037
   */
1038
  template <typename U1, typename U2, typename U3, typename U4,
1039
            typename T1, typename T2, typename T3, typename T4>
1040
  static EventId ScheduleDestroy (void (*f)(U1,U2,U3,U4), T1 a1, T2 a2, T3 a3, T4 a4);
1041
1042
  /**
1043
   * @see ScheduleDestory((*)())
1044
   * @tparam U1 @deduced Formal type of the first argument to the function.
1045
   * @tparam U2 @deduced Formal type of the second argument to the function.
1046
   * @tparam U3 @deduced Formal type of the third argument to the function.
1047
   * @tparam U4 @deduced Formal type of the fourth argument to the function.
1048
   * @tparam U5 @deduced Formal type of the fifth argument to the function.
1049
   * @tparam T1 @deduced Actual type of the first argument.
1050
   * @tparam T2 @deduced Actual type of the second argument.
1051
   * @tparam T3 @deduced Actual type of the third argument.
1052
   * @tparam T4 @deduced Actual type of the fourth argument.
1053
   * @tparam T5 @deduced Actual type of the fifth argument.
1054
   * @param [in] f The function to invoke
1055
   * @param [in] a1 The first argument to pass to the function to invoke
1056
   * @param [in] a2 The second argument to pass to the function to invoke
1057
   * @param [in] a3 The third argument to pass to the function to invoke
1058
   * @param [in] a4 The fourth argument to pass to the function to invoke
1059
   * @param [in] a5 The fifth argument to pass to the function to invoke
1060
   * @return The EventId of the scheduled event.
1061
   */
1062
  template <typename U1, typename U2, typename U3, typename U4, typename U5,
1063
            typename T1, typename T2, typename T3, typename T4, typename T5>
1064
  static EventId ScheduleDestroy (void (*f)(U1,U2,U3,U4,U5), T1 a1, T2 a2, T3 a3, T4 a4, T5 a5);
1065
1066
  /** @} */
351
  /** @} */
1067
352
1068
  /**
353
  /**
 Lines 1234-1579    Link Here 
1234
519
1235
namespace ns3 {
520
namespace ns3 {
1236
521
1237
template <typename MEM, typename OBJ>
522
template <typename MEM, typename OBJ, typename... Ts>
1238
EventId Simulator::Schedule (Time const &delay, MEM mem_ptr, OBJ obj) 
523
EventId Simulator::Schedule (Time const &delay, MEM mem_ptr, OBJ obj, Ts... args)
1239
{
524
{
1240
  return DoSchedule (delay, MakeEvent (mem_ptr, obj));
525
  return DoSchedule (delay, MakeEvent (mem_ptr, obj, args...));
1241
}
526
}
1242
527
1243
528
template <typename... Us, typename... Ts>
1244
template <typename MEM, typename OBJ,
529
EventId Simulator::Schedule (Time const &delay, void (*f)(Us...), Ts... args)
1245
          typename T1>
1246
EventId Simulator::Schedule (Time const &delay, MEM mem_ptr, OBJ obj, T1 a1) 
1247
{
530
{
1248
  return DoSchedule (delay, MakeEvent (mem_ptr, obj, a1));
531
  return DoSchedule (delay, MakeEvent (f, args...));
1249
}
532
}
1250
533
1251
template <typename MEM, typename OBJ, 
534
1252
          typename T1, typename T2>
535
1253
EventId Simulator::Schedule (Time const &delay, MEM mem_ptr, OBJ obj, T1 a1, T2 a2)
536
537
template <typename MEM, typename OBJ, typename... Ts>
538
void Simulator::ScheduleWithContext (uint32_t context, Time const &delay, MEM mem_ptr, OBJ obj, Ts... args)
1254
{
539
{
1255
  return DoSchedule (delay, MakeEvent (mem_ptr, obj, a1, a2));
540
  return ScheduleWithContext (context, delay, MakeEvent (mem_ptr, obj, args...));
1256
}
541
}
1257
542
1258
template <typename MEM, typename OBJ,
543
template <typename... Us, typename... Ts>
1259
          typename T1, typename T2, typename T3>
544
void Simulator::ScheduleWithContext (uint32_t context, Time const &delay, void (*f)(Us...), Ts... args)
1260
EventId Simulator::Schedule (Time const &delay, MEM mem_ptr, OBJ obj, T1 a1, T2 a2, T3 a3) 
1261
{
545
{
1262
  return DoSchedule (delay, MakeEvent (mem_ptr, obj, a1, a2, a3));
546
  return ScheduleWithContext (context, delay, MakeEvent (f, args...));
1263
}
547
}
1264
548
1265
template <typename MEM, typename OBJ, 
549
1266
          typename T1, typename T2, typename T3, typename T4>
550
1267
EventId Simulator::Schedule (Time const &delay, MEM mem_ptr, OBJ obj, T1 a1, T2 a2, T3 a3, T4 a4) 
551
552
template <typename MEM, typename OBJ, typename... Ts>
553
EventId
554
Simulator::ScheduleNow (MEM mem_ptr, OBJ obj, Ts... args) 
1268
{
555
{
1269
  return DoSchedule (delay, MakeEvent (mem_ptr, obj, a1, a2, a3, a4));
556
  return DoScheduleNow (MakeEvent (mem_ptr, obj, args...));
1270
}
557
}
1271
558
1272
template <typename MEM, typename OBJ, 
559
template <typename... Us, typename... Ts>
1273
          typename T1, typename T2, typename T3, typename T4, typename T5>
560
EventId
1274
EventId Simulator::Schedule (Time const &delay, MEM mem_ptr, OBJ obj, 
561
Simulator::ScheduleNow (void (*f)(Us...), Ts... args)
1275
                             T1 a1, T2 a2, T3 a3, T4 a4, T5 a5) 
1276
{
562
{
1277
  return DoSchedule (delay, MakeEvent (mem_ptr, obj, a1, a2, a3, a4, a5));
563
  return DoScheduleNow (MakeEvent (f, args...));
1278
}
564
}
1279
565
1280
template <typename U1,
566
1281
          typename T1>
567
1282
EventId Simulator::Schedule (Time const &delay, void (*f)(U1), T1 a1)
568
template <typename MEM, typename OBJ, typename... Ts>
569
EventId
570
Simulator::ScheduleDestroy (MEM mem_ptr, OBJ obj, Ts... args)
1283
{
571
{
1284
  return DoSchedule (delay, MakeEvent (f, a1));
572
  return DoScheduleDestroy (MakeEvent (mem_ptr, obj, args...));
1285
}
573
}
1286
574
1287
template <typename U1, typename U2, 
575
template <typename... Us, typename... Ts>
1288
          typename T1, typename T2>
576
EventId
1289
EventId Simulator::Schedule (Time const &delay, void (*f)(U1,U2), T1 a1, T2 a2)
577
Simulator::ScheduleDestroy (void (*f)(Us...), Ts... args)
1290
{
578
{
1291
  return DoSchedule (delay, MakeEvent (f, a1, a2));
579
  return DoScheduleDestroy (MakeEvent (f, args...));
1292
}
1293
1294
template <typename U1, typename U2, typename U3,
1295
          typename T1, typename T2, typename T3>
1296
EventId Simulator::Schedule (Time const &delay, void (*f)(U1,U2,U3), T1 a1, T2 a2, T3 a3)
1297
{
1298
  return DoSchedule (delay, MakeEvent (f, a1, a2, a3));
1299
}
1300
1301
template <typename U1, typename U2, typename U3, typename U4,
1302
          typename T1, typename T2, typename T3, typename T4>
1303
EventId Simulator::Schedule (Time const &delay, void (*f)(U1,U2,U3,U4), T1 a1, T2 a2, T3 a3, T4 a4)
1304
{
1305
  return DoSchedule (delay, MakeEvent (f, a1, a2, a3, a4));
1306
}
1307
1308
template <typename U1, typename U2, typename U3, typename U4, typename U5,
1309
          typename T1, typename T2, typename T3, typename T4, typename T5>
1310
EventId Simulator::Schedule (Time const &delay, void (*f)(U1,U2,U3,U4,U5), T1 a1, T2 a2, T3 a3, T4 a4, T5 a5)
1311
{
1312
  return DoSchedule (delay, MakeEvent (f, a1, a2, a3, a4, a5));
1313
}
1314
1315
1316
1317
1318
template <typename MEM, typename OBJ>
1319
void Simulator::ScheduleWithContext (uint32_t context, Time const &delay, MEM mem_ptr, OBJ obj)
1320
{
1321
  ScheduleWithContext (context, delay, MakeEvent (mem_ptr, obj));
1322
}
1323
1324
1325
template <typename MEM, typename OBJ,
1326
          typename T1>
1327
void Simulator::ScheduleWithContext (uint32_t context, Time const &delay, MEM mem_ptr, OBJ obj, T1 a1)
1328
{
1329
  return ScheduleWithContext (context, delay, MakeEvent (mem_ptr, obj, a1));
1330
}
1331
1332
template <typename MEM, typename OBJ,
1333
          typename T1, typename T2>
1334
void Simulator::ScheduleWithContext (uint32_t context, Time const &delay, MEM mem_ptr, OBJ obj, T1 a1, T2 a2)
1335
{
1336
  return ScheduleWithContext (context, delay, MakeEvent (mem_ptr, obj, a1, a2));
1337
}
1338
1339
template <typename MEM, typename OBJ,
1340
          typename T1, typename T2, typename T3>
1341
void Simulator::ScheduleWithContext (uint32_t context, Time const &delay, MEM mem_ptr, OBJ obj, T1 a1, T2 a2, T3 a3)
1342
{
1343
  return ScheduleWithContext (context, delay, MakeEvent (mem_ptr, obj, a1, a2, a3));
1344
}
1345
1346
template <typename MEM, typename OBJ,
1347
          typename T1, typename T2, typename T3, typename T4>
1348
void Simulator::ScheduleWithContext (uint32_t context, Time const &delay, MEM mem_ptr, OBJ obj, T1 a1, T2 a2, T3 a3, T4 a4)
1349
{
1350
  return ScheduleWithContext (context, delay, MakeEvent (mem_ptr, obj, a1, a2, a3, a4));
1351
}
1352
1353
template <typename MEM, typename OBJ,
1354
          typename T1, typename T2, typename T3, typename T4, typename T5>
1355
void Simulator::ScheduleWithContext (uint32_t context, Time const &delay, MEM mem_ptr, OBJ obj,
1356
                                     T1 a1, T2 a2, T3 a3, T4 a4, T5 a5)
1357
{
1358
  return ScheduleWithContext (context, delay, MakeEvent (mem_ptr, obj, a1, a2, a3, a4, a5));
1359
}
1360
1361
template <typename U1,
1362
          typename T1>
1363
void Simulator::ScheduleWithContext (uint32_t context, Time const &delay, void (*f)(U1), T1 a1)
1364
{
1365
  return ScheduleWithContext (context, delay, MakeEvent (f, a1));
1366
}
1367
1368
template <typename U1, typename U2,
1369
          typename T1, typename T2>
1370
void Simulator::ScheduleWithContext (uint32_t context, Time const &delay, void (*f)(U1,U2), T1 a1, T2 a2)
1371
{
1372
  return ScheduleWithContext (context, delay, MakeEvent (f, a1, a2));
1373
}
1374
1375
template <typename U1, typename U2, typename U3,
1376
          typename T1, typename T2, typename T3>
1377
void Simulator::ScheduleWithContext (uint32_t context, Time const &delay, void (*f)(U1,U2,U3), T1 a1, T2 a2, T3 a3)
1378
{
1379
  return ScheduleWithContext (context, delay, MakeEvent (f, a1, a2, a3));
1380
}
1381
1382
template <typename U1, typename U2, typename U3, typename U4,
1383
          typename T1, typename T2, typename T3, typename T4>
1384
void Simulator::ScheduleWithContext (uint32_t context, Time const &delay, void (*f)(U1,U2,U3,U4), T1 a1, T2 a2, T3 a3, T4 a4)
1385
{
1386
  return ScheduleWithContext (context, delay, MakeEvent (f, a1, a2, a3, a4));
1387
}
1388
1389
template <typename U1, typename U2, typename U3, typename U4, typename U5,
1390
          typename T1, typename T2, typename T3, typename T4, typename T5>
1391
void Simulator::ScheduleWithContext (uint32_t context, Time const &delay, void (*f)(U1,U2,U3,U4,U5), T1 a1, T2 a2, T3 a3, T4 a4, T5 a5)
1392
{
1393
  return ScheduleWithContext (context, delay, MakeEvent (f, a1, a2, a3, a4, a5));
1394
}
1395
1396
1397
1398
1399
template <typename MEM, typename OBJ>
1400
EventId
1401
Simulator::ScheduleNow (MEM mem_ptr, OBJ obj) 
1402
{
1403
  return DoScheduleNow (MakeEvent (mem_ptr, obj));
1404
}
1405
1406
1407
template <typename MEM, typename OBJ, 
1408
          typename T1>
1409
EventId
1410
Simulator::ScheduleNow (MEM mem_ptr, OBJ obj, T1 a1) 
1411
{
1412
  return DoScheduleNow (MakeEvent (mem_ptr, obj, a1));
1413
}
1414
1415
template <typename MEM, typename OBJ, 
1416
          typename T1, typename T2>
1417
EventId
1418
Simulator::ScheduleNow (MEM mem_ptr, OBJ obj, T1 a1, T2 a2) 
1419
{
1420
  return DoScheduleNow (MakeEvent (mem_ptr, obj, a1, a2));
1421
}
1422
1423
template <typename MEM, typename OBJ, 
1424
          typename T1, typename T2, typename T3>
1425
EventId
1426
Simulator::ScheduleNow (MEM mem_ptr, OBJ obj, T1 a1, T2 a2, T3 a3) 
1427
{
1428
  return DoScheduleNow (MakeEvent (mem_ptr, obj, a1, a2, a3));
1429
}
1430
1431
template <typename MEM, typename OBJ, 
1432
          typename T1, typename T2, typename T3, typename T4>
1433
EventId
1434
Simulator::ScheduleNow (MEM mem_ptr, OBJ obj, T1 a1, T2 a2, T3 a3, T4 a4) 
1435
{
1436
  return DoScheduleNow (MakeEvent (mem_ptr, obj, a1, a2, a3, a4));
1437
}
1438
1439
template <typename MEM, typename OBJ, 
1440
          typename T1, typename T2, typename T3, typename T4, typename T5>
1441
EventId
1442
Simulator::ScheduleNow (MEM mem_ptr, OBJ obj, 
1443
                        T1 a1, T2 a2, T3 a3, T4 a4, T5 a5) 
1444
{
1445
  return DoScheduleNow (MakeEvent (mem_ptr, obj, a1, a2, a3, a4, a5));
1446
}
1447
1448
template <typename U1,
1449
          typename T1>
1450
EventId
1451
Simulator::ScheduleNow (void (*f)(U1), T1 a1)
1452
{
1453
  return DoScheduleNow (MakeEvent (f, a1));
1454
}
1455
1456
template <typename U1, typename U2,
1457
          typename T1, typename T2>
1458
EventId
1459
Simulator::ScheduleNow (void (*f)(U1,U2), T1 a1, T2 a2)
1460
{
1461
  return DoScheduleNow (MakeEvent (f, a1, a2));
1462
}
1463
1464
template <typename U1, typename U2, typename U3,
1465
          typename T1, typename T2, typename T3>
1466
EventId
1467
Simulator::ScheduleNow (void (*f)(U1,U2,U3), T1 a1, T2 a2, T3 a3)
1468
{
1469
  return DoScheduleNow (MakeEvent (f, a1, a2, a3));
1470
}
1471
1472
template <typename U1, typename U2, typename U3, typename U4,
1473
          typename T1, typename T2, typename T3, typename T4>
1474
EventId
1475
Simulator::ScheduleNow (void (*f)(U1,U2,U3,U4), T1 a1, T2 a2, T3 a3, T4 a4)
1476
{
1477
  return DoScheduleNow (MakeEvent (f, a1, a2, a3, a4));
1478
}
1479
1480
template <typename U1, typename U2, typename U3, typename U4, typename U5,
1481
          typename T1, typename T2, typename T3, typename T4, typename T5>
1482
EventId
1483
Simulator::ScheduleNow (void (*f)(U1,U2,U3,U4,U5), T1 a1, T2 a2, T3 a3, T4 a4, T5 a5)
1484
{
1485
  return DoScheduleNow (MakeEvent (f, a1, a2, a3, a4, a5));
1486
}
1487
1488
1489
1490
template <typename MEM, typename OBJ>
1491
EventId
1492
Simulator::ScheduleDestroy (MEM mem_ptr, OBJ obj) 
1493
{
1494
  return DoScheduleDestroy (MakeEvent (mem_ptr, obj));
1495
}
1496
1497
1498
template <typename MEM, typename OBJ, 
1499
          typename T1>
1500
EventId
1501
Simulator::ScheduleDestroy (MEM mem_ptr, OBJ obj, T1 a1) 
1502
{
1503
  return DoScheduleDestroy (MakeEvent (mem_ptr, obj, a1));
1504
}
1505
1506
template <typename MEM, typename OBJ, 
1507
          typename T1, typename T2>
1508
EventId
1509
Simulator::ScheduleDestroy (MEM mem_ptr, OBJ obj, T1 a1, T2 a2) 
1510
{
1511
  return DoScheduleDestroy (MakeEvent (mem_ptr, obj, a1, a2));
1512
}
1513
1514
template <typename MEM, typename OBJ, 
1515
          typename T1, typename T2, typename T3>
1516
EventId
1517
Simulator::ScheduleDestroy (MEM mem_ptr, OBJ obj, T1 a1, T2 a2, T3 a3) 
1518
{
1519
  return DoScheduleDestroy (MakeEvent (mem_ptr, obj, a1, a2, a3));
1520
}
1521
1522
template <typename MEM, typename OBJ,
1523
          typename T1, typename T2, typename T3, typename T4>
1524
EventId
1525
Simulator::ScheduleDestroy (MEM mem_ptr, OBJ obj, T1 a1, T2 a2, T3 a3, T4 a4) 
1526
{
1527
  return DoScheduleDestroy (MakeEvent (mem_ptr, obj, a1, a2, a3, a4));
1528
}
1529
1530
template <typename MEM, typename OBJ, 
1531
          typename T1, typename T2, typename T3, typename T4, typename T5>
1532
EventId
1533
Simulator::ScheduleDestroy (MEM mem_ptr, OBJ obj, 
1534
                            T1 a1, T2 a2, T3 a3, T4 a4, T5 a5) 
1535
{
1536
  return DoScheduleDestroy (MakeEvent (mem_ptr, obj, a1, a2, a3, a4, a5));
1537
}
1538
1539
template <typename U1,
1540
          typename T1>
1541
EventId
1542
Simulator::ScheduleDestroy (void (*f)(U1), T1 a1)
1543
{
1544
  return DoScheduleDestroy (MakeEvent (f, a1));
1545
}
1546
1547
template <typename U1, typename U2,
1548
          typename T1, typename T2>
1549
EventId
1550
Simulator::ScheduleDestroy (void (*f)(U1,U2), T1 a1, T2 a2)
1551
{
1552
  return DoScheduleDestroy (MakeEvent (f, a1, a2));
1553
}
1554
1555
template <typename U1, typename U2, typename U3,
1556
          typename T1, typename T2, typename T3>
1557
EventId
1558
Simulator::ScheduleDestroy (void (*f)(U1,U2,U3), T1 a1, T2 a2, T3 a3)
1559
{
1560
  return DoScheduleDestroy (MakeEvent (f, a1, a2, a3));
1561
}
1562
1563
template <typename U1, typename U2, typename U3, typename U4,
1564
          typename T1, typename T2, typename T3, typename T4>
1565
EventId
1566
Simulator::ScheduleDestroy (void (*f)(U1,U2,U3,U4), T1 a1, T2 a2, T3 a3, T4 a4)
1567
{
1568
  return DoScheduleDestroy (MakeEvent (f, a1, a2, a3, a4));
1569
}
1570
1571
template <typename U1, typename U2, typename U3, typename U4, typename U5,
1572
          typename T1, typename T2, typename T3, typename T4, typename T5>
1573
EventId
1574
Simulator::ScheduleDestroy (void (*f)(U1,U2,U3,U4,U5), T1 a1, T2 a2, T3 a3, T4 a4, T5 a5)
1575
{
1576
  return DoScheduleDestroy (MakeEvent (f, a1, a2, a3, a4, a5));
1577
}
580
}
1578
581
1579
} // namespace ns3
582
} // namespace ns3
(-)a/src/core/model/timer.h (-115 / +6 lines)
 Lines 134-195    Link Here 
134
134
135
135
136
  /**
136
  /**
137
   * \param [in] a1 the first argument
137
   * \param [in] args arguments
138
   *
139
   * Store this argument in this Timer for later use by Timer::Schedule.
140
   */
141
  template <typename T1>
142
  void SetArguments (T1 a1);
143
  /**
144
   * \param [in] a1 the first argument
145
   * \param [in] a2 the second argument
146
   *
138
   *
147
   * Store these arguments in this Timer for later use by Timer::Schedule.
139
   * Store these arguments in this Timer for later use by Timer::Schedule.
148
   */
140
   */
149
  template <typename T1, typename T2>
141
  template <typename... Ts>
150
  void SetArguments (T1 a1, T2 a2);
142
  void SetArguments (Ts... args);
151
  /**
152
   * \param [in] a1 the first argument
153
   * \param [in] a2 the second argument
154
   * \param [in] a3 the third argument
155
   *
156
   * Store these arguments in this Timer for later use by Timer::Schedule.
157
   */
158
  template <typename T1, typename T2, typename T3>
159
  void SetArguments (T1 a1, T2 a2, T3 a3);
160
  /**
161
   * \param [in] a1 the first argument
162
   * \param [in] a2 the second argument
163
   * \param [in] a3 the third argument
164
   * \param [in] a4 the fourth argument
165
   *
166
   * Store these arguments in this Timer for later use by Timer::Schedule.
167
   */
168
  template <typename T1, typename T2, typename T3, typename T4>
169
  void SetArguments (T1 a1, T2 a2, T3 a3, T4 a4);
170
  /**
171
   * \param [in] a1 the first argument
172
   * \param [in] a2 the second argument
173
   * \param [in] a3 the third argument
174
   * \param [in] a4 the fourth argument
175
   * \param [in] a5 the fifth argument
176
   *
177
   * Store these arguments in this Timer for later use by Timer::Schedule.
178
   */
179
  template <typename T1, typename T2, typename T3, typename T4, typename T5>
180
  void SetArguments (T1 a1, T2 a2, T3 a3, T4 a4, T5 a5);
181
  /**
182
   * \param [in] a1 the first argument
183
   * \param [in] a2 the second argument
184
   * \param [in] a3 the third argument
185
   * \param [in] a4 the fourth argument
186
   * \param [in] a5 the fifth argument
187
   * \param [in] a6 the sixth argument
188
   *
189
   * Store these arguments in this Timer for later use by Timer::Schedule.
190
   */
191
  template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6>
192
  void SetArguments (T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6);
193
143
194
  /**
144
  /**
195
   * \param [in] delay The delay
145
   * \param [in] delay The delay
 Lines 319-393    Link Here 
319
  m_impl = MakeTimerImpl (memPtr, objPtr);
269
  m_impl = MakeTimerImpl (memPtr, objPtr);
320
}
270
}
321
271
322
template <typename T1>
272
template <typename... Ts>
323
void
273
void
324
Timer::SetArguments (T1 a1)
274
Timer::SetArguments (Ts... args)
325
{
275
{
326
  if (m_impl == 0)
276
  if (m_impl == 0)
327
    {
277
    {
328
      NS_FATAL_ERROR ("You cannot set the arguments of a Timer before setting its function.");
278
      NS_FATAL_ERROR ("You cannot set the arguments of a Timer before setting its function.");
329
      return;
279
      return;
330
    }
280
    }
331
  m_impl->SetArgs (a1);
281
  m_impl->SetArgs (args...);
332
}
333
template <typename T1, typename T2>
334
void
335
Timer::SetArguments (T1 a1, T2 a2)
336
{
337
  if (m_impl == 0)
338
    {
339
      NS_FATAL_ERROR ("You cannot set the arguments of a Timer before setting its function.");
340
      return;
341
    }
342
  m_impl->SetArgs (a1, a2);
343
}
344
345
template <typename T1, typename T2, typename T3>
346
void
347
Timer::SetArguments (T1 a1, T2 a2, T3 a3)
348
{
349
  if (m_impl == 0)
350
    {
351
      NS_FATAL_ERROR ("You cannot set the arguments of a Timer before setting its function.");
352
      return;
353
    }
354
  m_impl->SetArgs (a1, a2, a3);
355
}
356
357
template <typename T1, typename T2, typename T3, typename T4>
358
void
359
Timer::SetArguments (T1 a1, T2 a2, T3 a3, T4 a4)
360
{
361
  if (m_impl == 0)
362
    {
363
      NS_FATAL_ERROR ("You cannot set the arguments of a Timer before setting its function.");
364
      return;
365
    }
366
  m_impl->SetArgs (a1, a2, a3, a4);
367
}
368
369
template <typename T1, typename T2, typename T3, typename T4, typename T5>
370
void
371
Timer::SetArguments (T1 a1, T2 a2, T3 a3, T4 a4, T5 a5)
372
{
373
  if (m_impl == 0)
374
    {
375
      NS_FATAL_ERROR ("You cannot set the arguments of a Timer before setting its function.");
376
      return;
377
    }
378
  m_impl->SetArgs (a1, a2, a3, a4, a5);
379
}
380
381
template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6>
382
void
383
Timer::SetArguments (T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6)
384
{
385
  if (m_impl == 0)
386
    {
387
      NS_FATAL_ERROR ("You cannot set the arguments of a Timer before setting its function.");
388
      return;
389
    }
390
  m_impl->SetArgs (a1, a2, a3, a4, a5, a6);
391
}
282
}
392
283
393
} // namespace ns3
284
} // namespace ns3
(-)a/src/core/model/traced-callback.h (-273 / +26 lines)
 Lines 43-64    Link Here 
43
 * of callbacks.  Disconnect removes a Callback from the chain of callbacks.
43
 * of callbacks.  Disconnect removes a Callback from the chain of callbacks.
44
 *
44
 *
45
 * This is a functor: the chain of Callbacks is invoked by
45
 * This is a functor: the chain of Callbacks is invoked by
46
 * calling one of the \c operator() forms with the appropriate
46
 * calling the \c operator() form with the appropriate
47
 * number of arguments.
47
 * number of arguments.
48
 *
48
 *
49
 * \tparam T1 \explicit Type of the first argument to the functor.
49
 * \tparam Ts \explicit Type of the fuctor arguments.
50
 * \tparam T2 \explicit Type of the second argument to the functor.
51
 * \tparam T3 \explicit Type of the third argument to the functor.
52
 * \tparam T4 \explicit Type of the fourth argument to the functor.
53
 * \tparam T5 \explicit Type of the fifth argument to the functor.
54
 * \tparam T6 \explicit Type of the sixth argument to the functor.
55
 * \tparam T7 \explicit Type of the seventh argument to the functor.
56
 * \tparam T8 \explicit Type of the eighth argument to the functor.
57
 */
50
 */
58
template<typename T1 = empty, typename T2 = empty, 
51
template<typename... Ts>
59
         typename T3 = empty, typename T4 = empty,
60
         typename T5 = empty, typename T6 = empty,
61
         typename T7 = empty, typename T8 = empty>
62
class TracedCallback 
52
class TracedCallback 
63
{
53
{
64
public:
54
public:
 Lines 94-213    Link Here 
94
   */
84
   */
95
  void Disconnect (const CallbackBase & callback, std::string path);
85
  void Disconnect (const CallbackBase & callback, std::string path);
96
  /**
86
  /**
97
   * \name Functors taking various numbers of arguments.
87
   * \brief Functor which invokes the chain of Callbacks.
98
   *
88
   * \tparam Ts \deduced Type of the functor arguments.
99
   * The version selected is determined by the number of arguments
100
   * at the point where the Callback is invoked in the class
101
   * which fires the Callback.
102
   */
103
  /**@{*/
104
  /** Functor which invokes the chain of Callbacks. */
105
  void operator() (void) const;
106
  /**
107
   * \copybrief operator()()
108
   * \tparam T1 \deduced Type of the first argument to the functor.
109
   * \param [in] a1 The first argument to the functor.
110
   */
111
  void operator() (T1 a1) const;
112
  /**
113
   * \copybrief operator()()
114
   * \tparam T1 \deduced Type of the first argument to the functor.
115
   * \tparam T2 \deduced Type of the second argument to the functor.
116
   * \param [in] a1 The first argument to the functor.
89
   * \param [in] a1 The first argument to the functor.
117
   * \param [in] a2 The second argument to the functor.
90
   * \param [in] a2 The second argument to the functor.
118
   */
91
   */
119
  void operator() (T1 a1, T2 a2) const;
92
  void operator() (Ts... args) const;
120
  /**
121
   * \copybrief operator()()
122
   * \tparam T1 \deduced Type of the first argument to the functor.
123
   * \tparam T2 \deduced Type of the second argument to the functor.
124
   * \tparam T3 \deduced Type of the third argument to the functor.
125
   * \param [in] a1 The first argument to the functor.
126
   * \param [in] a2 The second argument to the functor.
127
   * \param [in] a3 The third argument to the functor.
128
   */
129
  void operator() (T1 a1, T2 a2, T3 a3) const;
130
  /**
131
   * \copybrief operator()()
132
   * \tparam T1 \deduced Type of the first argument to the functor.
133
   * \tparam T2 \deduced Type of the second argument to the functor.
134
   * \tparam T3 \deduced Type of the third argument to the functor.
135
   * \tparam T4 \deduced Type of the fourth argument to the functor.
136
   * \param [in] a1 The first argument to the functor.
137
   * \param [in] a2 The second argument to the functor.
138
   * \param [in] a3 The third argument to the functor.
139
   * \param [in] a4 The fourth argument to the functor.
140
   */
141
  void operator() (T1 a1, T2 a2, T3 a3, T4 a4) const;
142
  /**
143
   * \copybrief operator()()
144
   * \tparam T1 \deduced Type of the first argument to the functor.
145
   * \tparam T2 \deduced Type of the second argument to the functor.
146
   * \tparam T3 \deduced Type of the third argument to the functor.
147
   * \tparam T4 \deduced Type of the fourth argument to the functor.
148
   * \tparam T5 \deduced Type of the fifth argument to the functor.
149
   * \param [in] a1 The first argument to the functor.
150
   * \param [in] a2 The second argument to the functor.
151
   * \param [in] a3 The third argument to the functor.
152
   * \param [in] a4 The fourth argument to the functor.
153
   * \param [in] a5 The fifth argument to the functor.
154
   */
155
  void operator() (T1 a1, T2 a2, T3 a3, T4 a4, T5 a5) const;
156
  /**
157
   * \copybrief operator()()
158
   * \tparam T1 \deduced Type of the first argument to the functor.
159
   * \tparam T2 \deduced Type of the second argument to the functor.
160
   * \tparam T3 \deduced Type of the third argument to the functor.
161
   * \tparam T4 \deduced Type of the fourth argument to the functor.
162
   * \tparam T5 \deduced Type of the fifth argument to the functor.
163
   * \tparam T6 \deduced Type of the sixth argument to the functor.
164
   * \param [in] a1 The first argument to the functor.
165
   * \param [in] a2 The second argument to the functor.
166
   * \param [in] a3 The third argument to the functor.
167
   * \param [in] a4 The fourth argument to the functor.
168
   * \param [in] a5 The fifth argument to the functor.
169
   * \param [in] a6 The sixth argument to the functor.
170
   */
171
  void operator() (T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6) const;
172
  /**
173
   * \copybrief operator()()
174
   * \tparam T1 \deduced Type of the first argument to the functor.
175
   * \tparam T2 \deduced Type of the second argument to the functor.
176
   * \tparam T3 \deduced Type of the third argument to the functor.
177
   * \tparam T4 \deduced Type of the fourth argument to the functor.
178
   * \tparam T5 \deduced Type of the fifth argument to the functor.
179
   * \tparam T6 \deduced Type of the sixth argument to the functor.
180
   * \tparam T7 \deduced Type of the seventh argument to the functor.
181
   * \param [in] a1 The first argument to the functor.
182
   * \param [in] a2 The second argument to the functor.
183
   * \param [in] a3 The third argument to the functor.
184
   * \param [in] a4 The fourth argument to the functor.
185
   * \param [in] a5 The fifth argument to the functor.
186
   * \param [in] a6 The sixth argument to the functor.
187
   * \param [in] a7 The seventh argument to the functor.
188
   */
189
  void operator() (T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7) const;
190
  /**
191
   * \copybrief operator()()
192
   * \tparam T1 \deduced Type of the first argument to the functor.
193
   * \tparam T2 \deduced Type of the second argument to the functor.
194
   * \tparam T3 \deduced Type of the third argument to the functor.
195
   * \tparam T4 \deduced Type of the fourth argument to the functor.
196
   * \tparam T5 \deduced Type of the fifth argument to the functor.
197
   * \tparam T6 \deduced Type of the sixth argument to the functor.
198
   * \tparam T7 \deduced Type of the seventh argument to the functor.
199
   * \tparam T8 \deduced Type of the eighth argument to the functor.
200
   * \param [in] a1 The first argument to the functor.
201
   * \param [in] a2 The second argument to the functor.
202
   * \param [in] a3 The third argument to the functor.
203
   * \param [in] a4 The fourth argument to the functor.
204
   * \param [in] a5 The fifth argument to the functor.
205
   * \param [in] a6 The sixth argument to the functor.
206
   * \param [in] a7 The seventh argument to the functor.
207
   * \param [in] a8 The eighth argument to the functor.
208
   */
209
  void operator() (T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8) const;
210
  /**@}*/
211
93
212
  /**
94
  /**
213
   *  TracedCallback signature for POD.
95
   *  TracedCallback signature for POD.
 Lines 225-240    Link Here 
225
  /**
107
  /**
226
   * Container type for holding the chain of Callbacks.
108
   * Container type for holding the chain of Callbacks.
227
   *
109
   *
228
   * \tparam T1 \deduced Type of the first argument to the functor.
110
   * \tparam Ts \deduced Types of the functor arguments.
229
   * \tparam T2 \deduced Type of the second argument to the functor.
230
   * \tparam T3 \deduced Type of the third argument to the functor.
231
   * \tparam T4 \deduced Type of the fourth argument to the functor.
232
   * \tparam T5 \deduced Type of the fifth argument to the functor.
233
   * \tparam T6 \deduced Type of the sixth argument to the functor.
234
   * \tparam T7 \deduced Type of the seventh argument to the functor.
235
   * \tparam T8 \deduced Type of the eighth argument to the functor.
236
   */
111
   */
237
  typedef std::list<Callback<void,T1,T2,T3,T4,T5,T6,T7,T8> > CallbackList;
112
  typedef std::list<Callback<void,Ts...> > CallbackList;
238
  /** The chain of Callbacks. */
113
  /** The chain of Callbacks. */
239
  CallbackList m_callbackList;
114
  CallbackList m_callbackList;
240
};
115
};
 Lines 248-292    Link Here 
248
123
249
namespace ns3 {
124
namespace ns3 {
250
125
251
template<typename T1, typename T2, 
126
template<typename... Ts>
252
         typename T3, typename T4,
127
TracedCallback<Ts...>::TracedCallback ()
253
         typename T5, typename T6,
254
         typename T7, typename T8>
255
TracedCallback<T1,T2,T3,T4,T5,T6,T7,T8>::TracedCallback ()
256
  : m_callbackList () 
128
  : m_callbackList () 
257
{
129
{
258
}
130
}
259
template<typename T1, typename T2,
131
template<typename... Ts>
260
         typename T3, typename T4,
261
         typename T5, typename T6,
262
         typename T7, typename T8>
263
void
132
void
264
TracedCallback<T1,T2,T3,T4,T5,T6,T7,T8>::ConnectWithoutContext (const CallbackBase & callback)
133
TracedCallback<Ts...>::ConnectWithoutContext (const CallbackBase & callback)
265
{
134
{
266
  Callback<void,T1,T2,T3,T4,T5,T6,T7,T8> cb;
135
  Callback<void,Ts...> cb;
267
  if (!cb.Assign (callback))
136
  if (!cb.Assign (callback))
268
    NS_FATAL_ERROR_NO_MSG();
137
    NS_FATAL_ERROR_NO_MSG();
269
  m_callbackList.push_back (cb);
138
  m_callbackList.push_back (cb);
270
}
139
}
271
template<typename T1, typename T2,
140
template<typename... Ts>
272
         typename T3, typename T4,
273
         typename T5, typename T6,
274
         typename T7, typename T8>
275
void
141
void
276
TracedCallback<T1,T2,T3,T4,T5,T6,T7,T8>::Connect (const CallbackBase & callback, std::string path)
142
TracedCallback<Ts...>::Connect (const CallbackBase & callback, std::string path)
277
{
143
{
278
  Callback<void,std::string,T1,T2,T3,T4,T5,T6,T7,T8> cb;
144
  Callback<void,std::string,Ts...> cb;
279
  if (!cb.Assign (callback))
145
  if (!cb.Assign (callback))
280
    NS_FATAL_ERROR ("when connecting to " << path);
146
    NS_FATAL_ERROR ("when connecting to " << path);
281
  Callback<void,T1,T2,T3,T4,T5,T6,T7,T8> realCb = cb.Bind (path);
147
  Callback<void,Ts...> realCb = cb.Bind (path);
282
  m_callbackList.push_back (realCb);
148
  m_callbackList.push_back (realCb);
283
}
149
}
284
template<typename T1, typename T2, 
150
template<typename... Ts>
285
         typename T3, typename T4,
286
         typename T5, typename T6,
287
         typename T7, typename T8>
288
void 
151
void 
289
TracedCallback<T1,T2,T3,T4,T5,T6,T7,T8>::DisconnectWithoutContext (const CallbackBase & callback)
152
TracedCallback<Ts...>::DisconnectWithoutContext (const CallbackBase & callback)
290
{
153
{
291
  for (typename CallbackList::iterator i = m_callbackList.begin ();
154
  for (typename CallbackList::iterator i = m_callbackList.begin ();
292
       i != m_callbackList.end (); /* empty */)
155
       i != m_callbackList.end (); /* empty */)
 Lines 301-434    Link Here 
301
        }
164
        }
302
    }
165
    }
303
}
166
}
304
template<typename T1, typename T2, 
167
template<typename... Ts>
305
         typename T3, typename T4,
306
         typename T5, typename T6,
307
         typename T7, typename T8>
308
void 
168
void 
309
TracedCallback<T1,T2,T3,T4,T5,T6,T7,T8>::Disconnect (const CallbackBase & callback, std::string path)
169
TracedCallback<Ts...>::Disconnect (const CallbackBase & callback, std::string path)
310
{
170
{
311
  Callback<void,std::string,T1,T2,T3,T4,T5,T6,T7,T8> cb;
171
  Callback<void,std::string,Ts...> cb;
312
  if (!cb.Assign (callback))
172
  if (!cb.Assign (callback))
313
    NS_FATAL_ERROR ("when disconnecting from " << path);
173
    NS_FATAL_ERROR ("when disconnecting from " << path);
314
  Callback<void,T1,T2,T3,T4,T5,T6,T7,T8> realCb = cb.Bind (path);
174
  Callback<void,Ts...> realCb = cb.Bind (path);
315
  DisconnectWithoutContext (realCb);
175
  DisconnectWithoutContext (realCb);
316
}
176
}
317
template<typename T1, typename T2, 
177
template<typename... Ts>
318
         typename T3, typename T4,
319
         typename T5, typename T6,
320
         typename T7, typename T8>
321
void 
178
void 
322
TracedCallback<T1,T2,T3,T4,T5,T6,T7,T8>::operator() (void) const
179
TracedCallback<Ts...>::operator() (Ts... args) const
323
{
180
{
324
  for (typename CallbackList::const_iterator i = m_callbackList.begin ();
181
  for (typename CallbackList::const_iterator i = m_callbackList.begin ();
325
       i != m_callbackList.end (); i++)
182
       i != m_callbackList.end (); i++)
326
    {
183
    {
327
      (*i)();
184
      (*i)(args...);
328
    }
329
}
330
template<typename T1, typename T2, 
331
         typename T3, typename T4,
332
         typename T5, typename T6,
333
         typename T7, typename T8>
334
void 
335
TracedCallback<T1,T2,T3,T4,T5,T6,T7,T8>::operator() (T1 a1) const
336
{
337
  for (typename CallbackList::const_iterator i = m_callbackList.begin ();
338
       i != m_callbackList.end (); i++)
339
    {
340
      (*i)(a1);
341
    }
342
}
343
template<typename T1, typename T2, 
344
         typename T3, typename T4,
345
         typename T5, typename T6,
346
         typename T7, typename T8>
347
void 
348
TracedCallback<T1,T2,T3,T4,T5,T6,T7,T8>::operator() (T1 a1, T2 a2) const
349
{
350
  for (typename CallbackList::const_iterator i = m_callbackList.begin ();
351
       i != m_callbackList.end (); i++)
352
    {
353
      (*i)(a1, a2);
354
    }
355
}
356
template<typename T1, typename T2, 
357
         typename T3, typename T4,
358
         typename T5, typename T6,
359
         typename T7, typename T8>
360
void 
361
TracedCallback<T1,T2,T3,T4,T5,T6,T7,T8>::operator() (T1 a1, T2 a2, T3 a3) const
362
{
363
  for (typename CallbackList::const_iterator i = m_callbackList.begin ();
364
       i != m_callbackList.end (); i++)
365
    {
366
      (*i)(a1, a2, a3);
367
    }
368
}
369
template<typename T1, typename T2, 
370
         typename T3, typename T4,
371
         typename T5, typename T6,
372
         typename T7, typename T8>
373
void 
374
TracedCallback<T1,T2,T3,T4,T5,T6,T7,T8>::operator() (T1 a1, T2 a2, T3 a3, T4 a4) const
375
{
376
  for (typename CallbackList::const_iterator i = m_callbackList.begin ();
377
       i != m_callbackList.end (); i++)
378
    {
379
      (*i)(a1, a2, a3, a4);
380
    }
381
}
382
template<typename T1, typename T2, 
383
         typename T3, typename T4,
384
         typename T5, typename T6,
385
         typename T7, typename T8>
386
void 
387
TracedCallback<T1,T2,T3,T4,T5,T6,T7,T8>::operator() (T1 a1, T2 a2, T3 a3, T4 a4, T5 a5) const
388
{
389
  for (typename CallbackList::const_iterator i = m_callbackList.begin ();
390
       i != m_callbackList.end (); i++)
391
    {
392
      (*i)(a1, a2, a3, a4, a5);
393
    }
394
}
395
template<typename T1, typename T2, 
396
         typename T3, typename T4,
397
         typename T5, typename T6,
398
         typename T7, typename T8>
399
void 
400
TracedCallback<T1,T2,T3,T4,T5,T6,T7,T8>::operator() (T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6) const
401
{
402
  for (typename CallbackList::const_iterator i = m_callbackList.begin ();
403
       i != m_callbackList.end (); i++)
404
    {
405
      (*i)(a1, a2, a3, a4, a5, a6);
406
    }
407
}
408
template<typename T1, typename T2, 
409
         typename T3, typename T4,
410
         typename T5, typename T6,
411
         typename T7, typename T8>
412
void 
413
TracedCallback<T1,T2,T3,T4,T5,T6,T7,T8>::operator() (T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7) const
414
{
415
  for (typename CallbackList::const_iterator i = m_callbackList.begin ();
416
       i != m_callbackList.end (); i++)
417
    {
418
      (*i)(a1, a2, a3, a4, a5, a6, a7);
419
    }
420
}
421
template<typename T1, typename T2, 
422
         typename T3, typename T4,
423
         typename T5, typename T6,
424
         typename T7, typename T8>
425
void 
426
TracedCallback<T1,T2,T3,T4,T5,T6,T7,T8>::operator() (T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8) const
427
{
428
  for (typename CallbackList::const_iterator i = m_callbackList.begin ();
429
       i != m_callbackList.end (); i++)
430
    {
431
      (*i)(a1, a2, a3, a4, a5, a6, a7, a8);
432
    }
185
    }
433
}
186
}
434
187
(-)a/src/core/model/watchdog.h (-126 / +7 lines)
 Lines 101-171    Link Here 
101
   */
101
   */
102
  /**@{*/
102
  /**@{*/
103
  /**
103
  /**
104
   * \tparam T1 \deduced Type of the first argument.
104
   * \tparam Ts \deduced Argument types
105
   * \param [in] a1 The first argument
105
   * \param [in] args arguments
106
   */
106
   */
107
  template <typename T1>
107
  template <typename... Ts>
108
  void SetArguments (T1 a1);
108
  void SetArguments (Ts... args);
109
  /**
110
   * \tparam T1 \deduced Type of the first argument.
111
   * \tparam T2 \deduced Type of the second argument.
112
   * \param [in] a1 the first argument
113
   * \param [in] a2 the second argument
114
   */
115
  template <typename T1, typename T2>
116
  void SetArguments (T1 a1, T2 a2);
117
  /**
118
   * \tparam T1 \deduced Type of the first argument.
119
   * \tparam T2 \deduced Type of the second argument.
120
   * \tparam T3 \deduced Type of the third argument.
121
   * \param [in] a1 the first argument
122
   * \param [in] a2 the second argument
123
   * \param [in] a3 the third argument
124
   */
125
  template <typename T1, typename T2, typename T3>
126
  void SetArguments (T1 a1, T2 a2, T3 a3);
127
  /**
128
   * \tparam T1 \deduced Type of the first argument.
129
   * \tparam T2 \deduced Type of the second argument.
130
   * \tparam T3 \deduced Type of the third argument.
131
   * \tparam T4 \deduced Type of the fourth argument.
132
   * \param [in] a1 the first argument
133
   * \param [in] a2 the second argument
134
   * \param [in] a3 the third argument
135
   * \param [in] a4 the fourth argument
136
   */
137
  template <typename T1, typename T2, typename T3, typename T4>
138
  void SetArguments (T1 a1, T2 a2, T3 a3, T4 a4);
139
  /**
140
   * \tparam T1 \deduced Type of the first argument.
141
   * \tparam T2 \deduced Type of the second argument.
142
   * \tparam T3 \deduced Type of the third argument.
143
   * \tparam T4 \deduced Type of the fourth argument.
144
   * \tparam T5 \deduced Type of the fifth argument.
145
   * \param [in] a1 the first argument
146
   * \param [in] a2 the second argument
147
   * \param [in] a3 the third argument
148
   * \param [in] a4 the fourth argument
149
   * \param [in] a5 the fifth argument
150
   */
151
  template <typename T1, typename T2, typename T3, typename T4, typename T5>
152
  void SetArguments (T1 a1, T2 a2, T3 a3, T4 a4, T5 a5);
153
  /**
154
   * \tparam T1 \deduced Type of the first argument.
155
   * \tparam T2 \deduced Type of the second argument.
156
   * \tparam T3 \deduced Type of the third argument.
157
   * \tparam T4 \deduced Type of the fourth argument.
158
   * \tparam T5 \deduced Type of the fifth argument.
159
   * \tparam T6 \deduced Type of the sixth argument.
160
   * \param [in] a1 the first argument
161
   * \param [in] a2 the second argument
162
   * \param [in] a3 the third argument
163
   * \param [in] a4 the fourth argument
164
   * \param [in] a5 the fifth argument
165
   * \param [in] a6 the sixth argument
166
   */
167
  template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6>
168
  void SetArguments (T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6);
169
  /**@}*/
109
  /**@}*/
170
110
171
private:
111
private:
 Lines 209-283    Link Here 
209
  m_impl = MakeTimerImpl (memPtr, objPtr);
149
  m_impl = MakeTimerImpl (memPtr, objPtr);
210
}
150
}
211
151
212
template <typename T1>
152
template <typename... Ts>
213
void 
153
void 
214
Watchdog::SetArguments (T1 a1)
154
Watchdog::SetArguments (Ts... args)
215
{
155
{
216
  if (m_impl == 0)
156
  if (m_impl == 0)
217
    {
157
    {
218
      NS_FATAL_ERROR ("You cannot set the arguments of a Watchdog before setting its function.");
158
      NS_FATAL_ERROR ("You cannot set the arguments of a Watchdog before setting its function.");
219
      return;
159
      return;
220
    }
160
    }
221
  m_impl->SetArgs (a1);
161
  m_impl->SetArgs (args...);
222
}
223
template <typename T1, typename T2>
224
void 
225
Watchdog::SetArguments (T1 a1, T2 a2)
226
{
227
  if (m_impl == 0)
228
    {
229
      NS_FATAL_ERROR ("You cannot set the arguments of a Watchdog before setting its function.");
230
      return;
231
    }
232
  m_impl->SetArgs (a1, a2);
233
}
234
235
template <typename T1, typename T2, typename T3>
236
void 
237
Watchdog::SetArguments (T1 a1, T2 a2, T3 a3)
238
{
239
  if (m_impl == 0)
240
    {
241
      NS_FATAL_ERROR ("You cannot set the arguments of a Watchdog before setting its function.");
242
      return;
243
    }
244
  m_impl->SetArgs (a1, a2, a3);
245
}
246
247
template <typename T1, typename T2, typename T3, typename T4>
248
void 
249
Watchdog::SetArguments (T1 a1, T2 a2, T3 a3, T4 a4)
250
{
251
  if (m_impl == 0)
252
    {
253
      NS_FATAL_ERROR ("You cannot set the arguments of a Watchdog before setting its function.");
254
      return;
255
    }
256
  m_impl->SetArgs (a1, a2, a3, a4);
257
}
258
259
template <typename T1, typename T2, typename T3, typename T4, typename T5>
260
void 
261
Watchdog::SetArguments (T1 a1, T2 a2, T3 a3, T4 a4, T5 a5)
262
{
263
  if (m_impl == 0)
264
    {
265
      NS_FATAL_ERROR ("You cannot set the arguments of a Watchdog before setting its function.");
266
      return;
267
    }
268
  m_impl->SetArgs (a1, a2, a3, a4, a5);
269
}
270
271
template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6>
272
void 
273
Watchdog::SetArguments (T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6)
274
{
275
  if (m_impl == 0)
276
    {
277
      NS_FATAL_ERROR ("You cannot set the arguments of a Watchdog before setting its function.");
278
      return;
279
    }
280
  m_impl->SetArgs (a1, a2, a3, a4, a5, a6);
281
}
162
}
282
163
283
} // namespace ns3
164
} // namespace ns3

Return to bug 2457