author | Mathieu Lacage <mathieu.lacage@sophia.inria.fr> |
Tue, 02 Sep 2008 10:12:14 -0700 | |
changeset 3576 | f6abfdf47163 |
parent 3515 | 88e9cee20461 |
child 3796 | 75c6a3d424d9 |
permissions | -rw-r--r-- |
150
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
148
diff
changeset
|
1 |
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
9
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
2 |
/* |
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
3 |
* Copyright (c) 2005,2006 INRIA |
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
4 |
* |
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
5 |
* This program is free software; you can redistribute it and/or modify |
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
6 |
* it under the terms of the GNU General Public License version 2 as |
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation; |
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
8 |
* |
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
9 |
* This program is distributed in the hope that it will be useful, |
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
12 |
* GNU General Public License for more details. |
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
13 |
* |
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
14 |
* You should have received a copy of the GNU General Public License |
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
15 |
* along with this program; if not, write to the Free Software |
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
16 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
17 |
* |
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
18 |
* Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr> |
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
19 |
*/ |
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
20 |
|
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
21 |
#include "simulator.h" |
3469
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
22 |
#include "simulator-impl.h" |
3470
21022872009d
make simulator implementation replaceable via global default value
Craig Dowell <craigdo@ee.washington.edu>
parents:
3469
diff
changeset
|
23 |
#include "default-simulator-impl.h" |
9
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
24 |
#include "scheduler.h" |
3469
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
25 |
#include "map-scheduler.h" |
25
9b3bb088c560
first cut at george's ideas on api
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
24
diff
changeset
|
26 |
#include "event-impl.h" |
9
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
27 |
|
1008
6f2ea723a1db
use a Ptr<> to manage EventImpl instances
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1005
diff
changeset
|
28 |
#include "ns3/ptr.h" |
3470
21022872009d
make simulator implementation replaceable via global default value
Craig Dowell <craigdo@ee.washington.edu>
parents:
3469
diff
changeset
|
29 |
#include "ns3/string.h" |
21022872009d
make simulator implementation replaceable via global default value
Craig Dowell <craigdo@ee.washington.edu>
parents:
3469
diff
changeset
|
30 |
#include "ns3/object-factory.h" |
21022872009d
make simulator implementation replaceable via global default value
Craig Dowell <craigdo@ee.washington.edu>
parents:
3469
diff
changeset
|
31 |
#include "ns3/global-value.h" |
439
fed13fb45eef
Incorporated defaults and command-line arguments
Raj Bhattacharjea <raj.b@gatech.edu>
parents:
336
diff
changeset
|
32 |
#include "ns3/assert.h" |
2979
3d39dd617b8d
add time logging support
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2901
diff
changeset
|
33 |
#include "ns3/log.h" |
439
fed13fb45eef
Incorporated defaults and command-line arguments
Raj Bhattacharjea <raj.b@gatech.edu>
parents:
336
diff
changeset
|
34 |
|
9
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
35 |
#include <math.h> |
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
36 |
#include <fstream> |
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
37 |
#include <list> |
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
38 |
#include <vector> |
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
39 |
#include <iostream> |
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
40 |
|
3469
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
41 |
NS_LOG_COMPONENT_DEFINE ("Simulator"); |
9
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
42 |
|
16
99e833adbb46
change yans namespace to ns3
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
14
diff
changeset
|
43 |
namespace ns3 { |
9
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
44 |
|
3470
21022872009d
make simulator implementation replaceable via global default value
Craig Dowell <craigdo@ee.washington.edu>
parents:
3469
diff
changeset
|
45 |
GlobalValue g_simTypeImpl = GlobalValue ("SimulatorImplementationType", |
21022872009d
make simulator implementation replaceable via global default value
Craig Dowell <craigdo@ee.washington.edu>
parents:
3469
diff
changeset
|
46 |
"The object class to use as the simulator implementation", |
21022872009d
make simulator implementation replaceable via global default value
Craig Dowell <craigdo@ee.washington.edu>
parents:
3469
diff
changeset
|
47 |
StringValue ("ns3::DefaultSimulatorImpl"), |
21022872009d
make simulator implementation replaceable via global default value
Craig Dowell <craigdo@ee.washington.edu>
parents:
3469
diff
changeset
|
48 |
MakeStringChecker ()); |
21022872009d
make simulator implementation replaceable via global default value
Craig Dowell <craigdo@ee.washington.edu>
parents:
3469
diff
changeset
|
49 |
|
21022872009d
make simulator implementation replaceable via global default value
Craig Dowell <craigdo@ee.washington.edu>
parents:
3469
diff
changeset
|
50 |
Ptr<SimulatorImpl> Simulator::m_impl = 0; |
21022872009d
make simulator implementation replaceable via global default value
Craig Dowell <craigdo@ee.washington.edu>
parents:
3469
diff
changeset
|
51 |
|
2981
982a6f364d2c
fix optimized build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2979
diff
changeset
|
52 |
#ifdef NS3_LOG_ENABLE |
3470
21022872009d
make simulator implementation replaceable via global default value
Craig Dowell <craigdo@ee.washington.edu>
parents:
3469
diff
changeset
|
53 |
|
21022872009d
make simulator implementation replaceable via global default value
Craig Dowell <craigdo@ee.washington.edu>
parents:
3469
diff
changeset
|
54 |
// |
21022872009d
make simulator implementation replaceable via global default value
Craig Dowell <craigdo@ee.washington.edu>
parents:
3469
diff
changeset
|
55 |
// Note: Calls that take TimePrinter as a parameter are defined as nothing |
21022872009d
make simulator implementation replaceable via global default value
Craig Dowell <craigdo@ee.washington.edu>
parents:
3469
diff
changeset
|
56 |
// in the logging module if NS3_LOG_ENABLE is not defined. |
21022872009d
make simulator implementation replaceable via global default value
Craig Dowell <craigdo@ee.washington.edu>
parents:
3469
diff
changeset
|
57 |
// |
21022872009d
make simulator implementation replaceable via global default value
Craig Dowell <craigdo@ee.washington.edu>
parents:
3469
diff
changeset
|
58 |
|
2979
3d39dd617b8d
add time logging support
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2901
diff
changeset
|
59 |
static void |
3d39dd617b8d
add time logging support
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2901
diff
changeset
|
60 |
TimePrinter (std::ostream &os) |
3d39dd617b8d
add time logging support
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2901
diff
changeset
|
61 |
{ |
3d39dd617b8d
add time logging support
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2901
diff
changeset
|
62 |
os << Simulator::Now (); |
3d39dd617b8d
add time logging support
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2901
diff
changeset
|
63 |
} |
3470
21022872009d
make simulator implementation replaceable via global default value
Craig Dowell <craigdo@ee.washington.edu>
parents:
3469
diff
changeset
|
64 |
|
2981
982a6f364d2c
fix optimized build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2979
diff
changeset
|
65 |
#endif /* NS3_LOG_ENABLE */ |
9
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
66 |
|
3470
21022872009d
make simulator implementation replaceable via global default value
Craig Dowell <craigdo@ee.washington.edu>
parents:
3469
diff
changeset
|
67 |
SimulatorImpl * |
3469
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
68 |
Simulator::GetImpl (void) |
9
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
69 |
{ |
3503
b8cccd54da26
bug 269: revert parts of 9e763021e045 and add comments to avoid getting these again.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3489
diff
changeset
|
70 |
/* Please, don't include any calls to logging macros in this function |
b8cccd54da26
bug 269: revert parts of 9e763021e045 and add comments to avoid getting these again.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3489
diff
changeset
|
71 |
* or pay the price, that is, stack explosions. |
b8cccd54da26
bug 269: revert parts of 9e763021e045 and add comments to avoid getting these again.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3489
diff
changeset
|
72 |
*/ |
3469
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
73 |
if (m_impl == 0) |
150
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
148
diff
changeset
|
74 |
{ |
3470
21022872009d
make simulator implementation replaceable via global default value
Craig Dowell <craigdo@ee.washington.edu>
parents:
3469
diff
changeset
|
75 |
ObjectFactory factory; |
21022872009d
make simulator implementation replaceable via global default value
Craig Dowell <craigdo@ee.washington.edu>
parents:
3469
diff
changeset
|
76 |
StringValue s; |
21022872009d
make simulator implementation replaceable via global default value
Craig Dowell <craigdo@ee.washington.edu>
parents:
3469
diff
changeset
|
77 |
|
21022872009d
make simulator implementation replaceable via global default value
Craig Dowell <craigdo@ee.washington.edu>
parents:
3469
diff
changeset
|
78 |
g_simTypeImpl.GetValue (s); |
21022872009d
make simulator implementation replaceable via global default value
Craig Dowell <craigdo@ee.washington.edu>
parents:
3469
diff
changeset
|
79 |
factory.SetTypeId (s.Get ()); |
21022872009d
make simulator implementation replaceable via global default value
Craig Dowell <craigdo@ee.washington.edu>
parents:
3469
diff
changeset
|
80 |
m_impl = factory.Create<SimulatorImpl> (); |
3469
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
81 |
|
2913
66dd24c80d75
bug 143: rename scheduler files
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2901
diff
changeset
|
82 |
Ptr<Scheduler> scheduler = CreateObject<MapScheduler> (); |
3469
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
83 |
m_impl->SetScheduler (scheduler); |
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
84 |
|
3470
21022872009d
make simulator implementation replaceable via global default value
Craig Dowell <craigdo@ee.washington.edu>
parents:
3469
diff
changeset
|
85 |
// |
21022872009d
make simulator implementation replaceable via global default value
Craig Dowell <craigdo@ee.washington.edu>
parents:
3469
diff
changeset
|
86 |
// Note: we call LogSetTimePrinter _after_ creating the implementation |
21022872009d
make simulator implementation replaceable via global default value
Craig Dowell <craigdo@ee.washington.edu>
parents:
3469
diff
changeset
|
87 |
// object because the act of creation can trigger calls to the logging |
21022872009d
make simulator implementation replaceable via global default value
Craig Dowell <craigdo@ee.washington.edu>
parents:
3469
diff
changeset
|
88 |
// framework which would call the TimePrinter function which would call |
21022872009d
make simulator implementation replaceable via global default value
Craig Dowell <craigdo@ee.washington.edu>
parents:
3469
diff
changeset
|
89 |
// Simulator::Now which would call Simulator::GetImpl, and, thus, get us |
21022872009d
make simulator implementation replaceable via global default value
Craig Dowell <craigdo@ee.washington.edu>
parents:
3469
diff
changeset
|
90 |
// in an infinite recursion until the stack explodes. |
21022872009d
make simulator implementation replaceable via global default value
Craig Dowell <craigdo@ee.washington.edu>
parents:
3469
diff
changeset
|
91 |
// |
3005
cc521f35f033
avoid segfault when setting NS_LOG=*
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2989
diff
changeset
|
92 |
LogSetTimePrinter (&TimePrinter); |
150
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
148
diff
changeset
|
93 |
} |
3470
21022872009d
make simulator implementation replaceable via global default value
Craig Dowell <craigdo@ee.washington.edu>
parents:
3469
diff
changeset
|
94 |
return PeekPointer (m_impl); |
9
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
95 |
} |
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
96 |
|
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
97 |
void |
122
6b8f1eda5c57
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
121
diff
changeset
|
98 |
Simulator::Destroy (void) |
9
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
99 |
{ |
3469
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
100 |
NS_LOG_FUNCTION_NOARGS (); |
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
101 |
|
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
102 |
if (m_impl == 0) |
2901
81ac5e25e8c2
Make sure that we really attempt to destroy everything upon process exit. Gets rid of spurious leak reports in valgrind.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2630
diff
changeset
|
103 |
{ |
81ac5e25e8c2
Make sure that we really attempt to destroy everything upon process exit. Gets rid of spurious leak reports in valgrind.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2630
diff
changeset
|
104 |
return; |
81ac5e25e8c2
Make sure that we really attempt to destroy everything upon process exit. Gets rid of spurious leak reports in valgrind.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2630
diff
changeset
|
105 |
} |
3469
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
106 |
/* Note: we have to call LogSetTimePrinter (0) below because if we do not do |
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
107 |
* this, and restart a simulation after this call to Destroy, (which is |
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
108 |
* legal), Simulator::GetImpl will trigger again an infinite recursion until |
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
109 |
* the stack explodes. |
3006
054b9ca57390
add comments about previous bug fix
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3005
diff
changeset
|
110 |
*/ |
3005
cc521f35f033
avoid segfault when setting NS_LOG=*
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2989
diff
changeset
|
111 |
LogSetTimePrinter (0); |
3469
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
112 |
m_impl->Destroy (); |
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
113 |
m_impl = 0; |
9
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
114 |
} |
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
115 |
|
3469
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
116 |
void |
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
117 |
Simulator::SetScheduler (Ptr<Scheduler> scheduler) |
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
118 |
{ |
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
119 |
NS_LOG_FUNCTION (scheduler); |
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
120 |
GetImpl ()->SetScheduler (scheduler); |
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
121 |
} |
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
122 |
|
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
123 |
void |
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
124 |
Simulator::EnableLogTo (char const *filename) |
3489
b5ef00370c70
bug 252: get rid of dead code.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3479
diff
changeset
|
125 |
{} |
9
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
126 |
|
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
127 |
bool |
122
6b8f1eda5c57
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
121
diff
changeset
|
128 |
Simulator::IsFinished (void) |
9
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
129 |
{ |
3469
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
130 |
NS_LOG_FUNCTION_NOARGS (); |
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
131 |
return GetImpl ()->IsFinished (); |
9
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
132 |
} |
3469
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
133 |
|
25
9b3bb088c560
first cut at george's ideas on api
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
24
diff
changeset
|
134 |
Time |
122
6b8f1eda5c57
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
121
diff
changeset
|
135 |
Simulator::Next (void) |
9
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
136 |
{ |
3469
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
137 |
NS_LOG_FUNCTION_NOARGS (); |
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
138 |
return GetImpl ()->Next (); |
9
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
139 |
} |
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
140 |
|
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
141 |
void |
122
6b8f1eda5c57
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
121
diff
changeset
|
142 |
Simulator::Run (void) |
9
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
143 |
{ |
3469
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
144 |
NS_LOG_FUNCTION_NOARGS (); |
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
145 |
GetImpl ()->Run (); |
9
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
146 |
} |
3469
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
147 |
|
9
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
148 |
void |
3515
88e9cee20461
Bug #270: Simulator::RunOneEvent
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3503
diff
changeset
|
149 |
Simulator::RunOneEvent (void) |
88e9cee20461
Bug #270: Simulator::RunOneEvent
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3503
diff
changeset
|
150 |
{ |
88e9cee20461
Bug #270: Simulator::RunOneEvent
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3503
diff
changeset
|
151 |
NS_LOG_FUNCTION_NOARGS (); |
88e9cee20461
Bug #270: Simulator::RunOneEvent
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3503
diff
changeset
|
152 |
GetImpl ()->RunOneEvent (); |
88e9cee20461
Bug #270: Simulator::RunOneEvent
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3503
diff
changeset
|
153 |
} |
88e9cee20461
Bug #270: Simulator::RunOneEvent
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3503
diff
changeset
|
154 |
|
88e9cee20461
Bug #270: Simulator::RunOneEvent
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3503
diff
changeset
|
155 |
void |
122
6b8f1eda5c57
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
121
diff
changeset
|
156 |
Simulator::Stop (void) |
9
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
157 |
{ |
3469
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
158 |
NS_LOG_LOGIC ("stop"); |
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
159 |
GetImpl ()->Stop (); |
9
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
160 |
} |
3469
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
161 |
|
9
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
162 |
void |
3174
efeb6e5c276d
Make Application::Start/Stop times relative, Simulator::StopAt(time) renamed to Simulator::Stop(time) and time also made relative, to improve consistency of the API which uses relative times everywhere else. Closes bug #191.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3008
diff
changeset
|
163 |
Simulator::Stop (Time const &time) |
9
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
164 |
{ |
3469
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
165 |
NS_LOG_FUNCTION (time); |
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
166 |
GetImpl ()->Stop (time); |
9
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
167 |
} |
3469
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
168 |
|
25
9b3bb088c560
first cut at george's ideas on api
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
24
diff
changeset
|
169 |
Time |
122
6b8f1eda5c57
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
121
diff
changeset
|
170 |
Simulator::Now (void) |
9
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
171 |
{ |
3503
b8cccd54da26
bug 269: revert parts of 9e763021e045 and add comments to avoid getting these again.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3489
diff
changeset
|
172 |
/* Please, don't include any calls to logging macros in this function |
b8cccd54da26
bug 269: revert parts of 9e763021e045 and add comments to avoid getting these again.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3489
diff
changeset
|
173 |
* or pay the price, that is, stack explosions. |
b8cccd54da26
bug 269: revert parts of 9e763021e045 and add comments to avoid getting these again.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3489
diff
changeset
|
174 |
*/ |
3469
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
175 |
return GetImpl ()->Now (); |
9
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
176 |
} |
3469
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
177 |
|
1690
16b198d63c1e
add Simulator::GetDelayLeft
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1522
diff
changeset
|
178 |
Time |
16b198d63c1e
add Simulator::GetDelayLeft
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1522
diff
changeset
|
179 |
Simulator::GetDelayLeft (const EventId &id) |
16b198d63c1e
add Simulator::GetDelayLeft
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1522
diff
changeset
|
180 |
{ |
3469
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
181 |
NS_LOG_FUNCTION (&id); |
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
182 |
return GetImpl ()->GetDelayLeft (id); |
1690
16b198d63c1e
add Simulator::GetDelayLeft
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1522
diff
changeset
|
183 |
} |
25
9b3bb088c560
first cut at george's ideas on api
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
24
diff
changeset
|
184 |
|
1008
6f2ea723a1db
use a Ptr<> to manage EventImpl instances
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1005
diff
changeset
|
185 |
Ptr<EventImpl> |
146
2c9ef359e320
implement overloads for ScheduleNow and ScheduleDestroy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
145
diff
changeset
|
186 |
Simulator::MakeEvent (void (*f) (void)) |
145
947b77174b72
start of work to re-implement Schedule* methods
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
144
diff
changeset
|
187 |
{ |
3469
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
188 |
NS_LOG_FUNCTION (f); |
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
189 |
// zero arg version |
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
190 |
class EventFunctionImpl0 : public EventImpl |
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
191 |
{ |
150
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
148
diff
changeset
|
192 |
public: |
1008
6f2ea723a1db
use a Ptr<> to manage EventImpl instances
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1005
diff
changeset
|
193 |
typedef void (*F)(void); |
150
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
148
diff
changeset
|
194 |
|
1008
6f2ea723a1db
use a Ptr<> to manage EventImpl instances
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1005
diff
changeset
|
195 |
EventFunctionImpl0 (F function) |
6f2ea723a1db
use a Ptr<> to manage EventImpl instances
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1005
diff
changeset
|
196 |
: m_function (function) |
6f2ea723a1db
use a Ptr<> to manage EventImpl instances
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1005
diff
changeset
|
197 |
{} |
6f2ea723a1db
use a Ptr<> to manage EventImpl instances
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1005
diff
changeset
|
198 |
virtual ~EventFunctionImpl0 () {} |
150
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
148
diff
changeset
|
199 |
protected: |
1008
6f2ea723a1db
use a Ptr<> to manage EventImpl instances
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1005
diff
changeset
|
200 |
virtual void Notify (void) { |
6f2ea723a1db
use a Ptr<> to manage EventImpl instances
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1005
diff
changeset
|
201 |
(*m_function) (); |
6f2ea723a1db
use a Ptr<> to manage EventImpl instances
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1005
diff
changeset
|
202 |
} |
150
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
148
diff
changeset
|
203 |
private: |
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
148
diff
changeset
|
204 |
F m_function; |
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
148
diff
changeset
|
205 |
} *ev = new EventFunctionImpl0 (f); |
1008
6f2ea723a1db
use a Ptr<> to manage EventImpl instances
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1005
diff
changeset
|
206 |
return Ptr<EventImpl> (ev, false); |
146
2c9ef359e320
implement overloads for ScheduleNow and ScheduleDestroy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
145
diff
changeset
|
207 |
} |
3469
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
208 |
|
146
2c9ef359e320
implement overloads for ScheduleNow and ScheduleDestroy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
145
diff
changeset
|
209 |
EventId |
1010
3a252ceeac44
more optimizations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1009
diff
changeset
|
210 |
Simulator::Schedule (Time const &time, const Ptr<EventImpl> &ev) |
146
2c9ef359e320
implement overloads for ScheduleNow and ScheduleDestroy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
145
diff
changeset
|
211 |
{ |
3469
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
212 |
NS_LOG_FUNCTION (time << ev); |
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
213 |
return GetImpl ()->Schedule (Now () + time, ev); |
146
2c9ef359e320
implement overloads for ScheduleNow and ScheduleDestroy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
145
diff
changeset
|
214 |
} |
3469
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
215 |
|
963
3a7a66d1942c
add support to cancel Now and Destroy events.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
948
diff
changeset
|
216 |
EventId |
1010
3a252ceeac44
more optimizations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1009
diff
changeset
|
217 |
Simulator::ScheduleNow (const Ptr<EventImpl> &ev) |
146
2c9ef359e320
implement overloads for ScheduleNow and ScheduleDestroy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
145
diff
changeset
|
218 |
{ |
3469
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
219 |
NS_LOG_FUNCTION (ev); |
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
220 |
return GetImpl ()->ScheduleNow (ev); |
146
2c9ef359e320
implement overloads for ScheduleNow and ScheduleDestroy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
145
diff
changeset
|
221 |
} |
3469
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
222 |
|
963
3a7a66d1942c
add support to cancel Now and Destroy events.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
948
diff
changeset
|
223 |
EventId |
1010
3a252ceeac44
more optimizations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1009
diff
changeset
|
224 |
Simulator::ScheduleDestroy (const Ptr<EventImpl> &ev) |
146
2c9ef359e320
implement overloads for ScheduleNow and ScheduleDestroy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
145
diff
changeset
|
225 |
{ |
3469
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
226 |
NS_LOG_FUNCTION (ev); |
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
227 |
return GetImpl ()->ScheduleDestroy (ev); |
146
2c9ef359e320
implement overloads for ScheduleNow and ScheduleDestroy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
145
diff
changeset
|
228 |
} |
3469
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
229 |
|
146
2c9ef359e320
implement overloads for ScheduleNow and ScheduleDestroy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
145
diff
changeset
|
230 |
EventId |
2c9ef359e320
implement overloads for ScheduleNow and ScheduleDestroy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
145
diff
changeset
|
231 |
Simulator::Schedule (Time const &time, void (*f) (void)) |
2c9ef359e320
implement overloads for ScheduleNow and ScheduleDestroy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
145
diff
changeset
|
232 |
{ |
3469
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
233 |
NS_LOG_FUNCTION (time << f); |
150
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
148
diff
changeset
|
234 |
return Schedule (time, MakeEvent (f)); |
146
2c9ef359e320
implement overloads for ScheduleNow and ScheduleDestroy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
145
diff
changeset
|
235 |
} |
3469
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
236 |
|
963
3a7a66d1942c
add support to cancel Now and Destroy events.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
948
diff
changeset
|
237 |
EventId |
146
2c9ef359e320
implement overloads for ScheduleNow and ScheduleDestroy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
145
diff
changeset
|
238 |
Simulator::ScheduleNow (void (*f) (void)) |
2c9ef359e320
implement overloads for ScheduleNow and ScheduleDestroy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
145
diff
changeset
|
239 |
{ |
3469
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
240 |
NS_LOG_FUNCTION (f); |
150
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
148
diff
changeset
|
241 |
return ScheduleNow (MakeEvent (f)); |
146
2c9ef359e320
implement overloads for ScheduleNow and ScheduleDestroy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
145
diff
changeset
|
242 |
} |
3469
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
243 |
|
963
3a7a66d1942c
add support to cancel Now and Destroy events.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
948
diff
changeset
|
244 |
EventId |
146
2c9ef359e320
implement overloads for ScheduleNow and ScheduleDestroy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
145
diff
changeset
|
245 |
Simulator::ScheduleDestroy (void (*f) (void)) |
2c9ef359e320
implement overloads for ScheduleNow and ScheduleDestroy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
145
diff
changeset
|
246 |
{ |
3469
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
247 |
NS_LOG_FUNCTION (f); |
150
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
148
diff
changeset
|
248 |
return ScheduleDestroy (MakeEvent (f)); |
75
0f3f4b0a158b
reorganize the implementation of template member methods in Simulator class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
54
diff
changeset
|
249 |
} |
0f3f4b0a158b
reorganize the implementation of template member methods in Simulator class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
54
diff
changeset
|
250 |
|
25
9b3bb088c560
first cut at george's ideas on api
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
24
diff
changeset
|
251 |
void |
1011
7e5be9b118c9
be more consistant in the handling of references
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1010
diff
changeset
|
252 |
Simulator::Remove (const EventId &ev) |
9
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
253 |
{ |
3469
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
254 |
NS_LOG_FUNCTION (&ev); |
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
255 |
return GetImpl ()->Remove (ev); |
9
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
256 |
} |
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
257 |
|
25
9b3bb088c560
first cut at george's ideas on api
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
24
diff
changeset
|
258 |
void |
1011
7e5be9b118c9
be more consistant in the handling of references
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1010
diff
changeset
|
259 |
Simulator::Cancel (const EventId &ev) |
25
9b3bb088c560
first cut at george's ideas on api
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
24
diff
changeset
|
260 |
{ |
3469
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
261 |
NS_LOG_FUNCTION (&ev); |
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
262 |
return GetImpl ()->Cancel (ev); |
25
9b3bb088c560
first cut at george's ideas on api
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
24
diff
changeset
|
263 |
} |
3469
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
264 |
|
25
9b3bb088c560
first cut at george's ideas on api
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
24
diff
changeset
|
265 |
bool |
1011
7e5be9b118c9
be more consistant in the handling of references
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1010
diff
changeset
|
266 |
Simulator::IsExpired (const EventId &id) |
25
9b3bb088c560
first cut at george's ideas on api
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
24
diff
changeset
|
267 |
{ |
3469
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
268 |
NS_LOG_FUNCTION (&id); |
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
269 |
return GetImpl ()->IsExpired (id); |
25
9b3bb088c560
first cut at george's ideas on api
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
24
diff
changeset
|
270 |
} |
9b3bb088c560
first cut at george's ideas on api
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
24
diff
changeset
|
271 |
|
679
0c4773ca0f29
avoid cyclic dependency between Simulator and Time code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
675
diff
changeset
|
272 |
Time Now (void) |
0c4773ca0f29
avoid cyclic dependency between Simulator and Time code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
675
diff
changeset
|
273 |
{ |
3469
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
274 |
NS_LOG_FUNCTION_NOARGS (); |
679
0c4773ca0f29
avoid cyclic dependency between Simulator and Time code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
675
diff
changeset
|
275 |
return Time (Simulator::Now ()); |
0c4773ca0f29
avoid cyclic dependency between Simulator and Time code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
675
diff
changeset
|
276 |
} |
0c4773ca0f29
avoid cyclic dependency between Simulator and Time code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
675
diff
changeset
|
277 |
|
1863
50fa1ca3b26c
bug 104: add a method to retrive the maximum simulation time.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1696
diff
changeset
|
278 |
Time |
50fa1ca3b26c
bug 104: add a method to retrive the maximum simulation time.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1696
diff
changeset
|
279 |
Simulator::GetMaximumSimulationTime (void) |
50fa1ca3b26c
bug 104: add a method to retrive the maximum simulation time.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1696
diff
changeset
|
280 |
{ |
3469
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
281 |
NS_LOG_FUNCTION_NOARGS (); |
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
282 |
return GetImpl ()->GetMaximumSimulationTime (); |
1863
50fa1ca3b26c
bug 104: add a method to retrive the maximum simulation time.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1696
diff
changeset
|
283 |
} |
50fa1ca3b26c
bug 104: add a method to retrive the maximum simulation time.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1696
diff
changeset
|
284 |
|
3479
d89e9db667f0
Add empty implementation of Simulator::SetImplementation, to make Python bindings work.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3470
diff
changeset
|
285 |
void |
d89e9db667f0
Add empty implementation of Simulator::SetImplementation, to make Python bindings work.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3470
diff
changeset
|
286 |
Simulator::SetImplementation (Ptr<SimulatorImpl> impl) |
d89e9db667f0
Add empty implementation of Simulator::SetImplementation, to make Python bindings work.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3470
diff
changeset
|
287 |
{ |
d89e9db667f0
Add empty implementation of Simulator::SetImplementation, to make Python bindings work.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3470
diff
changeset
|
288 |
NS_FATAL_ERROR ("TODO"); |
d89e9db667f0
Add empty implementation of Simulator::SetImplementation, to make Python bindings work.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3470
diff
changeset
|
289 |
} |
d89e9db667f0
Add empty implementation of Simulator::SetImplementation, to make Python bindings work.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3470
diff
changeset
|
290 |
|
d89e9db667f0
Add empty implementation of Simulator::SetImplementation, to make Python bindings work.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3470
diff
changeset
|
291 |
|
1863
50fa1ca3b26c
bug 104: add a method to retrive the maximum simulation time.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1696
diff
changeset
|
292 |
} // namespace ns3 |
9
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
293 |
|
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
294 |
|
30
eb38b7903dfb
add empty simulator test
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
29
diff
changeset
|
295 |
#ifdef RUN_SELF_TESTS |
eb38b7903dfb
add empty simulator test
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
29
diff
changeset
|
296 |
|
eb38b7903dfb
add empty simulator test
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
29
diff
changeset
|
297 |
#include "ns3/test.h" |
690 | 298 |
#include "ns3/ptr.h" |
2913
66dd24c80d75
bug 143: rename scheduler files
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2901
diff
changeset
|
299 |
#include "list-scheduler.h" |
66dd24c80d75
bug 143: rename scheduler files
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2901
diff
changeset
|
300 |
#include "heap-scheduler.h" |
30
eb38b7903dfb
add empty simulator test
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
29
diff
changeset
|
301 |
|
eb38b7903dfb
add empty simulator test
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
29
diff
changeset
|
302 |
namespace ns3 { |
eb38b7903dfb
add empty simulator test
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
29
diff
changeset
|
303 |
|
146
2c9ef359e320
implement overloads for ScheduleNow and ScheduleDestroy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
145
diff
changeset
|
304 |
static void foo0 (void) |
2c9ef359e320
implement overloads for ScheduleNow and ScheduleDestroy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
145
diff
changeset
|
305 |
{} |
2c9ef359e320
implement overloads for ScheduleNow and ScheduleDestroy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
145
diff
changeset
|
306 |
static void foo1 (int) |
2c9ef359e320
implement overloads for ScheduleNow and ScheduleDestroy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
145
diff
changeset
|
307 |
{} |
2c9ef359e320
implement overloads for ScheduleNow and ScheduleDestroy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
145
diff
changeset
|
308 |
static void foo2 (int, int) |
2c9ef359e320
implement overloads for ScheduleNow and ScheduleDestroy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
145
diff
changeset
|
309 |
{} |
2c9ef359e320
implement overloads for ScheduleNow and ScheduleDestroy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
145
diff
changeset
|
310 |
static void foo3 (int, int, int) |
2c9ef359e320
implement overloads for ScheduleNow and ScheduleDestroy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
145
diff
changeset
|
311 |
{} |
2c9ef359e320
implement overloads for ScheduleNow and ScheduleDestroy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
145
diff
changeset
|
312 |
static void foo4 (int, int, int, int) |
2c9ef359e320
implement overloads for ScheduleNow and ScheduleDestroy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
145
diff
changeset
|
313 |
{} |
2c9ef359e320
implement overloads for ScheduleNow and ScheduleDestroy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
145
diff
changeset
|
314 |
static void foo5 (int, int, int, int, int) |
945
6b8efd6b621a
failing testcases to for events with references as arguments
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
927
diff
changeset
|
315 |
{} |
6b8efd6b621a
failing testcases to for events with references as arguments
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
927
diff
changeset
|
316 |
|
948
8dc076230f11
finish support for references as arguments to event handlers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
945
diff
changeset
|
317 |
#if 1 |
945
6b8efd6b621a
failing testcases to for events with references as arguments
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
927
diff
changeset
|
318 |
static void ber1 (int &) |
6b8efd6b621a
failing testcases to for events with references as arguments
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
927
diff
changeset
|
319 |
{} |
6b8efd6b621a
failing testcases to for events with references as arguments
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
927
diff
changeset
|
320 |
static void ber2 (int &, int &) |
6b8efd6b621a
failing testcases to for events with references as arguments
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
927
diff
changeset
|
321 |
{} |
6b8efd6b621a
failing testcases to for events with references as arguments
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
927
diff
changeset
|
322 |
static void ber3 (int &, int &, int &) |
6b8efd6b621a
failing testcases to for events with references as arguments
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
927
diff
changeset
|
323 |
{} |
6b8efd6b621a
failing testcases to for events with references as arguments
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
927
diff
changeset
|
324 |
static void ber4 (int &, int &, int &, int &) |
6b8efd6b621a
failing testcases to for events with references as arguments
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
927
diff
changeset
|
325 |
{} |
6b8efd6b621a
failing testcases to for events with references as arguments
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
927
diff
changeset
|
326 |
static void ber5 (int &, int &, int &, int &, int &) |
6b8efd6b621a
failing testcases to for events with references as arguments
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
927
diff
changeset
|
327 |
{} |
948
8dc076230f11
finish support for references as arguments to event handlers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
945
diff
changeset
|
328 |
#endif |
8dc076230f11
finish support for references as arguments to event handlers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
945
diff
changeset
|
329 |
|
8dc076230f11
finish support for references as arguments to event handlers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
945
diff
changeset
|
330 |
static void cber1 (const int &) |
8dc076230f11
finish support for references as arguments to event handlers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
945
diff
changeset
|
331 |
{} |
8dc076230f11
finish support for references as arguments to event handlers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
945
diff
changeset
|
332 |
static void cber2 (const int &, const int &) |
8dc076230f11
finish support for references as arguments to event handlers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
945
diff
changeset
|
333 |
{} |
8dc076230f11
finish support for references as arguments to event handlers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
945
diff
changeset
|
334 |
static void cber3 (const int &, const int &, const int &) |
8dc076230f11
finish support for references as arguments to event handlers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
945
diff
changeset
|
335 |
{} |
8dc076230f11
finish support for references as arguments to event handlers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
945
diff
changeset
|
336 |
static void cber4 (const int &, const int &, const int &, const int &) |
8dc076230f11
finish support for references as arguments to event handlers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
945
diff
changeset
|
337 |
{} |
8dc076230f11
finish support for references as arguments to event handlers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
945
diff
changeset
|
338 |
static void cber5 (const int &, const int &, const int &, const int &, const int &) |
8dc076230f11
finish support for references as arguments to event handlers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
945
diff
changeset
|
339 |
{} |
146
2c9ef359e320
implement overloads for ScheduleNow and ScheduleDestroy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
145
diff
changeset
|
340 |
|
2c9ef359e320
implement overloads for ScheduleNow and ScheduleDestroy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
145
diff
changeset
|
341 |
|
2630
17b545238ab3
do not use ObjectBase as a base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2577
diff
changeset
|
342 |
class SimulatorTests : public Test |
17b545238ab3
do not use ObjectBase as a base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2577
diff
changeset
|
343 |
{ |
30
eb38b7903dfb
add empty simulator test
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
29
diff
changeset
|
344 |
public: |
150
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
148
diff
changeset
|
345 |
SimulatorTests (); |
690 | 346 |
// only here for testing of Ptr<> |
1296
173efb6d92d8
fix last errors for new tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1294
diff
changeset
|
347 |
void Ref (void) const; |
173efb6d92d8
fix last errors for new tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1294
diff
changeset
|
348 |
void Unref (void) const; |
150
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
148
diff
changeset
|
349 |
virtual ~SimulatorTests (); |
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
148
diff
changeset
|
350 |
virtual bool RunTests (void); |
31
2def0da92178
add simulator tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
30
diff
changeset
|
351 |
private: |
150
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
148
diff
changeset
|
352 |
uint64_t NowUs (); |
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
148
diff
changeset
|
353 |
bool RunOneTest (void); |
1294
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
354 |
void RunTestsConst (void) const; |
150
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
148
diff
changeset
|
355 |
void A (int a); |
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
148
diff
changeset
|
356 |
void B (int b); |
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
148
diff
changeset
|
357 |
void C (int c); |
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
148
diff
changeset
|
358 |
void D (int d); |
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
148
diff
changeset
|
359 |
void bar0 (void); |
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
148
diff
changeset
|
360 |
void bar1 (int); |
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
148
diff
changeset
|
361 |
void bar2 (int, int); |
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
148
diff
changeset
|
362 |
void bar3 (int, int, int); |
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
148
diff
changeset
|
363 |
void bar4 (int, int, int, int); |
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
148
diff
changeset
|
364 |
void bar5 (int, int, int, int, int); |
945
6b8efd6b621a
failing testcases to for events with references as arguments
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
927
diff
changeset
|
365 |
void baz1 (int &); |
6b8efd6b621a
failing testcases to for events with references as arguments
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
927
diff
changeset
|
366 |
void baz2 (int &, int &); |
6b8efd6b621a
failing testcases to for events with references as arguments
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
927
diff
changeset
|
367 |
void baz3 (int &, int &, int &); |
6b8efd6b621a
failing testcases to for events with references as arguments
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
927
diff
changeset
|
368 |
void baz4 (int &, int &, int &, int &); |
6b8efd6b621a
failing testcases to for events with references as arguments
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
927
diff
changeset
|
369 |
void baz5 (int &, int &, int &, int &, int &); |
948
8dc076230f11
finish support for references as arguments to event handlers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
945
diff
changeset
|
370 |
void cbaz1 (const int &); |
8dc076230f11
finish support for references as arguments to event handlers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
945
diff
changeset
|
371 |
void cbaz2 (const int &, const int &); |
8dc076230f11
finish support for references as arguments to event handlers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
945
diff
changeset
|
372 |
void cbaz3 (const int &, const int &, const int &); |
8dc076230f11
finish support for references as arguments to event handlers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
945
diff
changeset
|
373 |
void cbaz4 (const int &, const int &, const int &, const int &); |
8dc076230f11
finish support for references as arguments to event handlers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
945
diff
changeset
|
374 |
void cbaz5 (const int &, const int &, const int &, const int &, const int &); |
1294
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
375 |
|
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
376 |
void bar0c (void) const; |
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
377 |
void bar1c (int) const; |
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
378 |
void bar2c (int, int) const; |
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
379 |
void bar3c (int, int, int) const; |
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
380 |
void bar4c (int, int, int, int) const; |
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
381 |
void bar5c (int, int, int, int, int) const; |
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
382 |
void baz1c (int &) const; |
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
383 |
void baz2c (int &, int &) const; |
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
384 |
void baz3c (int &, int &, int &) const; |
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
385 |
void baz4c (int &, int &, int &, int &) const; |
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
386 |
void baz5c (int &, int &, int &, int &, int &) const; |
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
387 |
void cbaz1c (const int &) const; |
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
388 |
void cbaz2c (const int &, const int &) const; |
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
389 |
void cbaz3c (const int &, const int &, const int &) const; |
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
390 |
void cbaz4c (const int &, const int &, const int &, const int &) const; |
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
391 |
void cbaz5c (const int &, const int &, const int &, const int &, const int &) const; |
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
392 |
|
964
e49de7414508
make sure IsExpired handles destroy events correctly
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
963
diff
changeset
|
393 |
void destroy (void); |
146
2c9ef359e320
implement overloads for ScheduleNow and ScheduleDestroy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
145
diff
changeset
|
394 |
|
150
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
148
diff
changeset
|
395 |
bool m_b; |
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
148
diff
changeset
|
396 |
bool m_a; |
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
148
diff
changeset
|
397 |
bool m_c; |
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
148
diff
changeset
|
398 |
bool m_d; |
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
148
diff
changeset
|
399 |
EventId m_idC; |
964
e49de7414508
make sure IsExpired handles destroy events correctly
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
963
diff
changeset
|
400 |
bool m_destroy; |
e49de7414508
make sure IsExpired handles destroy events correctly
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
963
diff
changeset
|
401 |
EventId m_destroyId; |
30
eb38b7903dfb
add empty simulator test
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
29
diff
changeset
|
402 |
}; |
eb38b7903dfb
add empty simulator test
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
29
diff
changeset
|
403 |
|
eb38b7903dfb
add empty simulator test
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
29
diff
changeset
|
404 |
SimulatorTests::SimulatorTests () |
150
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
148
diff
changeset
|
405 |
: Test ("Simulator") |
30
eb38b7903dfb
add empty simulator test
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
29
diff
changeset
|
406 |
{} |
3469
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
407 |
|
30
eb38b7903dfb
add empty simulator test
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
29
diff
changeset
|
408 |
SimulatorTests::~SimulatorTests () |
eb38b7903dfb
add empty simulator test
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
29
diff
changeset
|
409 |
{} |
3469
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
410 |
|
690 | 411 |
void |
1296
173efb6d92d8
fix last errors for new tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1294
diff
changeset
|
412 |
SimulatorTests::Ref (void) const |
690 | 413 |
{} |
3469
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
414 |
|
690 | 415 |
void |
1296
173efb6d92d8
fix last errors for new tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1294
diff
changeset
|
416 |
SimulatorTests::Unref (void) const |
690 | 417 |
{} |
3469
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
418 |
|
143
552ff26b4224
new Time implementation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
129
diff
changeset
|
419 |
uint64_t |
552ff26b4224
new Time implementation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
129
diff
changeset
|
420 |
SimulatorTests::NowUs (void) |
552ff26b4224
new Time implementation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
129
diff
changeset
|
421 |
{ |
163
2a7e05018eeb
rename Time::ApproximateTo methods to Time::Get
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
162
diff
changeset
|
422 |
uint64_t ns = Now ().GetNanoSeconds (); |
150
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
148
diff
changeset
|
423 |
return ns / 1000; |
143
552ff26b4224
new Time implementation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
129
diff
changeset
|
424 |
} |
3469
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
425 |
|
31
2def0da92178
add simulator tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
30
diff
changeset
|
426 |
void |
122
6b8f1eda5c57
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
121
diff
changeset
|
427 |
SimulatorTests::A (int a) |
31
2def0da92178
add simulator tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
30
diff
changeset
|
428 |
{ |
150
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
148
diff
changeset
|
429 |
m_a = false; |
31
2def0da92178
add simulator tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
30
diff
changeset
|
430 |
} |
3469
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
431 |
|
31
2def0da92178
add simulator tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
30
diff
changeset
|
432 |
void |
122
6b8f1eda5c57
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
121
diff
changeset
|
433 |
SimulatorTests::B (int b) |
31
2def0da92178
add simulator tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
30
diff
changeset
|
434 |
{ |
150
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
148
diff
changeset
|
435 |
if (b != 2 || NowUs () != 11) |
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
148
diff
changeset
|
436 |
{ |
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
148
diff
changeset
|
437 |
m_b = false; |
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
148
diff
changeset
|
438 |
} |
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
148
diff
changeset
|
439 |
else |
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
148
diff
changeset
|
440 |
{ |
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
148
diff
changeset
|
441 |
m_b = true; |
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
148
diff
changeset
|
442 |
} |
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
148
diff
changeset
|
443 |
Simulator::Remove (m_idC); |
162
5b398ac221c7
make Time relative instead of Absolute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
150
diff
changeset
|
444 |
Simulator::Schedule (MicroSeconds (10), &SimulatorTests::D, this, 4); |
31
2def0da92178
add simulator tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
30
diff
changeset
|
445 |
} |
3469
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
446 |
|
31
2def0da92178
add simulator tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
30
diff
changeset
|
447 |
void |
122
6b8f1eda5c57
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
121
diff
changeset
|
448 |
SimulatorTests::C (int c) |
31
2def0da92178
add simulator tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
30
diff
changeset
|
449 |
{ |
150
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
148
diff
changeset
|
450 |
m_c = false; |
31
2def0da92178
add simulator tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
30
diff
changeset
|
451 |
} |
3469
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
452 |
|
32 | 453 |
void |
122
6b8f1eda5c57
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
121
diff
changeset
|
454 |
SimulatorTests::D (int d) |
32 | 455 |
{ |
150
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
148
diff
changeset
|
456 |
if (d != 4 || NowUs () != (11+10)) |
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
148
diff
changeset
|
457 |
{ |
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
148
diff
changeset
|
458 |
m_d = false; |
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
148
diff
changeset
|
459 |
} |
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
148
diff
changeset
|
460 |
else |
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
148
diff
changeset
|
461 |
{ |
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
148
diff
changeset
|
462 |
m_d = true; |
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
148
diff
changeset
|
463 |
} |
32 | 464 |
} |
3469
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
465 |
|
964
e49de7414508
make sure IsExpired handles destroy events correctly
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
963
diff
changeset
|
466 |
void |
e49de7414508
make sure IsExpired handles destroy events correctly
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
963
diff
changeset
|
467 |
SimulatorTests::destroy (void) |
e49de7414508
make sure IsExpired handles destroy events correctly
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
963
diff
changeset
|
468 |
{ |
e49de7414508
make sure IsExpired handles destroy events correctly
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
963
diff
changeset
|
469 |
if (m_destroyId.IsExpired ()) |
e49de7414508
make sure IsExpired handles destroy events correctly
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
963
diff
changeset
|
470 |
{ |
e49de7414508
make sure IsExpired handles destroy events correctly
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
963
diff
changeset
|
471 |
m_destroy = true; |
e49de7414508
make sure IsExpired handles destroy events correctly
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
963
diff
changeset
|
472 |
} |
e49de7414508
make sure IsExpired handles destroy events correctly
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
963
diff
changeset
|
473 |
} |
3469
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
474 |
|
146
2c9ef359e320
implement overloads for ScheduleNow and ScheduleDestroy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
145
diff
changeset
|
475 |
void |
2c9ef359e320
implement overloads for ScheduleNow and ScheduleDestroy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
145
diff
changeset
|
476 |
SimulatorTests::bar0 (void) |
2c9ef359e320
implement overloads for ScheduleNow and ScheduleDestroy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
145
diff
changeset
|
477 |
{} |
3469
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
478 |
|
146
2c9ef359e320
implement overloads for ScheduleNow and ScheduleDestroy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
145
diff
changeset
|
479 |
void |
2c9ef359e320
implement overloads for ScheduleNow and ScheduleDestroy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
145
diff
changeset
|
480 |
SimulatorTests::bar1 (int) |
2c9ef359e320
implement overloads for ScheduleNow and ScheduleDestroy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
145
diff
changeset
|
481 |
{} |
3469
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
482 |
|
146
2c9ef359e320
implement overloads for ScheduleNow and ScheduleDestroy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
145
diff
changeset
|
483 |
void |
2c9ef359e320
implement overloads for ScheduleNow and ScheduleDestroy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
145
diff
changeset
|
484 |
SimulatorTests::bar2 (int, int) |
2c9ef359e320
implement overloads for ScheduleNow and ScheduleDestroy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
145
diff
changeset
|
485 |
{} |
3469
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
486 |
|
146
2c9ef359e320
implement overloads for ScheduleNow and ScheduleDestroy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
145
diff
changeset
|
487 |
void |
2c9ef359e320
implement overloads for ScheduleNow and ScheduleDestroy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
145
diff
changeset
|
488 |
SimulatorTests::bar3 (int, int, int) |
2c9ef359e320
implement overloads for ScheduleNow and ScheduleDestroy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
145
diff
changeset
|
489 |
{} |
3469
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
490 |
|
146
2c9ef359e320
implement overloads for ScheduleNow and ScheduleDestroy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
145
diff
changeset
|
491 |
void |
2c9ef359e320
implement overloads for ScheduleNow and ScheduleDestroy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
145
diff
changeset
|
492 |
SimulatorTests::bar4 (int, int, int, int) |
2c9ef359e320
implement overloads for ScheduleNow and ScheduleDestroy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
145
diff
changeset
|
493 |
{} |
3469
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
494 |
|
146
2c9ef359e320
implement overloads for ScheduleNow and ScheduleDestroy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
145
diff
changeset
|
495 |
void |
2c9ef359e320
implement overloads for ScheduleNow and ScheduleDestroy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
145
diff
changeset
|
496 |
SimulatorTests::bar5 (int, int, int, int, int) |
2c9ef359e320
implement overloads for ScheduleNow and ScheduleDestroy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
145
diff
changeset
|
497 |
{} |
2c9ef359e320
implement overloads for ScheduleNow and ScheduleDestroy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
145
diff
changeset
|
498 |
|
945
6b8efd6b621a
failing testcases to for events with references as arguments
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
927
diff
changeset
|
499 |
void |
6b8efd6b621a
failing testcases to for events with references as arguments
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
927
diff
changeset
|
500 |
SimulatorTests::baz1 (int &) |
6b8efd6b621a
failing testcases to for events with references as arguments
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
927
diff
changeset
|
501 |
{} |
3469
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
502 |
|
945
6b8efd6b621a
failing testcases to for events with references as arguments
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
927
diff
changeset
|
503 |
void |
6b8efd6b621a
failing testcases to for events with references as arguments
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
927
diff
changeset
|
504 |
SimulatorTests::baz2 (int &, int &) |
6b8efd6b621a
failing testcases to for events with references as arguments
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
927
diff
changeset
|
505 |
{} |
3469
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
506 |
|
945
6b8efd6b621a
failing testcases to for events with references as arguments
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
927
diff
changeset
|
507 |
void |
6b8efd6b621a
failing testcases to for events with references as arguments
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
927
diff
changeset
|
508 |
SimulatorTests::baz3 (int &, int &, int &) |
6b8efd6b621a
failing testcases to for events with references as arguments
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
927
diff
changeset
|
509 |
{} |
3469
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
510 |
|
945
6b8efd6b621a
failing testcases to for events with references as arguments
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
927
diff
changeset
|
511 |
void |
6b8efd6b621a
failing testcases to for events with references as arguments
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
927
diff
changeset
|
512 |
SimulatorTests::baz4 (int &, int &, int &, int &) |
6b8efd6b621a
failing testcases to for events with references as arguments
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
927
diff
changeset
|
513 |
{} |
3469
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
514 |
|
945
6b8efd6b621a
failing testcases to for events with references as arguments
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
927
diff
changeset
|
515 |
void |
6b8efd6b621a
failing testcases to for events with references as arguments
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
927
diff
changeset
|
516 |
SimulatorTests::baz5 (int &, int &, int &, int &, int &) |
6b8efd6b621a
failing testcases to for events with references as arguments
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
927
diff
changeset
|
517 |
{} |
6b8efd6b621a
failing testcases to for events with references as arguments
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
927
diff
changeset
|
518 |
|
948
8dc076230f11
finish support for references as arguments to event handlers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
945
diff
changeset
|
519 |
void |
8dc076230f11
finish support for references as arguments to event handlers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
945
diff
changeset
|
520 |
SimulatorTests::cbaz1 (const int &) |
8dc076230f11
finish support for references as arguments to event handlers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
945
diff
changeset
|
521 |
{} |
3469
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
522 |
|
948
8dc076230f11
finish support for references as arguments to event handlers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
945
diff
changeset
|
523 |
void |
8dc076230f11
finish support for references as arguments to event handlers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
945
diff
changeset
|
524 |
SimulatorTests::cbaz2 (const int &, const int &) |
8dc076230f11
finish support for references as arguments to event handlers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
945
diff
changeset
|
525 |
{} |
3469
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
526 |
|
948
8dc076230f11
finish support for references as arguments to event handlers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
945
diff
changeset
|
527 |
void |
8dc076230f11
finish support for references as arguments to event handlers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
945
diff
changeset
|
528 |
SimulatorTests::cbaz3 (const int &, const int &, const int &) |
8dc076230f11
finish support for references as arguments to event handlers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
945
diff
changeset
|
529 |
{} |
3469
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
530 |
|
948
8dc076230f11
finish support for references as arguments to event handlers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
945
diff
changeset
|
531 |
void |
8dc076230f11
finish support for references as arguments to event handlers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
945
diff
changeset
|
532 |
SimulatorTests::cbaz4 (const int &, const int &, const int &, const int &) |
8dc076230f11
finish support for references as arguments to event handlers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
945
diff
changeset
|
533 |
{} |
3469
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
534 |
|
948
8dc076230f11
finish support for references as arguments to event handlers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
945
diff
changeset
|
535 |
void |
8dc076230f11
finish support for references as arguments to event handlers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
945
diff
changeset
|
536 |
SimulatorTests::cbaz5 (const int &, const int &, const int &, const int &, const int &) |
8dc076230f11
finish support for references as arguments to event handlers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
945
diff
changeset
|
537 |
{} |
8dc076230f11
finish support for references as arguments to event handlers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
945
diff
changeset
|
538 |
|
1294
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
539 |
void |
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
540 |
SimulatorTests::bar0c (void) const |
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
541 |
{} |
3469
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
542 |
|
1294
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
543 |
void |
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
544 |
SimulatorTests::bar1c (int) const |
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
545 |
{} |
3469
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
546 |
|
1294
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
547 |
void |
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
548 |
SimulatorTests::bar2c (int, int) const |
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
549 |
{} |
3469
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
550 |
|
1294
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
551 |
void |
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
552 |
SimulatorTests::bar3c (int, int, int) const |
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
553 |
{} |
3469
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
554 |
|
1294
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
555 |
void |
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
556 |
SimulatorTests::bar4c (int, int, int, int) const |
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
557 |
{} |
3469
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
558 |
|
1294
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
559 |
void |
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
560 |
SimulatorTests::bar5c (int, int, int, int, int) const |
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
561 |
{} |
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
562 |
|
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
563 |
void |
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
564 |
SimulatorTests::baz1c (int &) const |
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
565 |
{} |
3469
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
566 |
|
1294
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
567 |
void |
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
568 |
SimulatorTests::baz2c (int &, int &) const |
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
569 |
{} |
3469
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
570 |
|
1294
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
571 |
void |
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
572 |
SimulatorTests::baz3c (int &, int &, int &) const |
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
573 |
{} |
3469
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
574 |
|
1294
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
575 |
void |
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
576 |
SimulatorTests::baz4c (int &, int &, int &, int &) const |
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
577 |
{} |
3469
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
578 |
|
1294
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
579 |
void |
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
580 |
SimulatorTests::baz5c (int &, int &, int &, int &, int &) const |
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
581 |
{} |
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
582 |
|
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
583 |
void |
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
584 |
SimulatorTests::cbaz1c (const int &) const |
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
585 |
{} |
3469
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
586 |
|
1294
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
587 |
void |
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
588 |
SimulatorTests::cbaz2c (const int &, const int &) const |
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
589 |
{} |
3469
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
590 |
|
1294
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
591 |
void |
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
592 |
SimulatorTests::cbaz3c (const int &, const int &, const int &) const |
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
593 |
{} |
3469
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
594 |
|
1294
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
595 |
void |
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
596 |
SimulatorTests::cbaz4c (const int &, const int &, const int &, const int &) const |
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
597 |
{} |
3469
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
598 |
|
1294
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
599 |
void |
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
600 |
SimulatorTests::cbaz5c (const int &, const int &, const int &, const int &, const int &) const |
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
601 |
{} |
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
602 |
|
114
fe0504af6d16
test each default event scheduler
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
111
diff
changeset
|
603 |
bool |
122
6b8f1eda5c57
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
121
diff
changeset
|
604 |
SimulatorTests::RunOneTest (void) |
30
eb38b7903dfb
add empty simulator test
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
29
diff
changeset
|
605 |
{ |
1521
7563328d71ea
Use NS_TEST_* macros for simulator unit tests
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
1296
diff
changeset
|
606 |
bool result = true; |
150
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
148
diff
changeset
|
607 |
m_a = true; |
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
148
diff
changeset
|
608 |
m_b = false; |
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
148
diff
changeset
|
609 |
m_c = true; |
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
148
diff
changeset
|
610 |
m_d = false; |
114
fe0504af6d16
test each default event scheduler
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
111
diff
changeset
|
611 |
|
162
5b398ac221c7
make Time relative instead of Absolute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
150
diff
changeset
|
612 |
EventId a = Simulator::Schedule (MicroSeconds (10), &SimulatorTests::A, this, 1); |
5b398ac221c7
make Time relative instead of Absolute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
150
diff
changeset
|
613 |
Simulator::Schedule (MicroSeconds (11), &SimulatorTests::B, this, 2); |
5b398ac221c7
make Time relative instead of Absolute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
150
diff
changeset
|
614 |
m_idC = Simulator::Schedule (MicroSeconds (12), &SimulatorTests::C, this, 3); |
31
2def0da92178
add simulator tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
30
diff
changeset
|
615 |
|
1521
7563328d71ea
Use NS_TEST_* macros for simulator unit tests
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
1296
diff
changeset
|
616 |
NS_TEST_ASSERT (!m_idC.IsExpired ()); |
7563328d71ea
Use NS_TEST_* macros for simulator unit tests
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
1296
diff
changeset
|
617 |
NS_TEST_ASSERT (!a.IsExpired ()); |
150
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
148
diff
changeset
|
618 |
Simulator::Cancel (a); |
1521
7563328d71ea
Use NS_TEST_* macros for simulator unit tests
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
1296
diff
changeset
|
619 |
NS_TEST_ASSERT (a.IsExpired ()); |
150
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
148
diff
changeset
|
620 |
Simulator::Run (); |
1521
7563328d71ea
Use NS_TEST_* macros for simulator unit tests
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
1296
diff
changeset
|
621 |
NS_TEST_ASSERT (m_a); |
7563328d71ea
Use NS_TEST_* macros for simulator unit tests
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
1296
diff
changeset
|
622 |
NS_TEST_ASSERT (m_b); |
7563328d71ea
Use NS_TEST_* macros for simulator unit tests
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
1296
diff
changeset
|
623 |
NS_TEST_ASSERT (m_c); |
7563328d71ea
Use NS_TEST_* macros for simulator unit tests
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
1296
diff
changeset
|
624 |
NS_TEST_ASSERT (m_d); |
7563328d71ea
Use NS_TEST_* macros for simulator unit tests
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
1296
diff
changeset
|
625 |
return result; |
114
fe0504af6d16
test each default event scheduler
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
111
diff
changeset
|
626 |
} |
3469
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
3188
diff
changeset
|
627 |
|
1294
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
628 |
void |
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
629 |
SimulatorTests::RunTestsConst (void) const |
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
630 |
{ |
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
631 |
Simulator::Schedule (Seconds (0.0), &SimulatorTests::bar0c, this); |
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
632 |
Simulator::Schedule (Seconds (0.0), &SimulatorTests::bar1c, this, 0); |
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
633 |
Simulator::Schedule (Seconds (0.0), &SimulatorTests::bar2c, this, 0, 0); |
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
634 |
Simulator::Schedule (Seconds (0.0), &SimulatorTests::bar3c, this, 0, 0, 0); |
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
635 |
Simulator::Schedule (Seconds (0.0), &SimulatorTests::bar4c, this, 0, 0, 0, 0); |
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
636 |
Simulator::Schedule (Seconds (0.0), &SimulatorTests::bar5c, this, 0, 0, 0, 0, 0); |
1296
173efb6d92d8
fix last errors for new tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1294
diff
changeset
|
637 |
Simulator::Schedule (Seconds (0.0), &SimulatorTests::bar0c, Ptr<const SimulatorTests> (this)); |
173efb6d92d8
fix last errors for new tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1294
diff
changeset
|
638 |
Simulator::Schedule (Seconds (0.0), &SimulatorTests::bar1c, Ptr<const SimulatorTests> (this), 0); |
173efb6d92d8
fix last errors for new tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1294
diff
changeset
|
639 |
Simulator::Schedule (Seconds (0.0), &SimulatorTests::bar2c, Ptr<const SimulatorTests> (this), 0, 0); |
173efb6d92d8
fix last errors for new tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1294
diff
changeset
|
640 |
Simulator::Schedule (Seconds (0.0), &SimulatorTests::bar3c, Ptr<const SimulatorTests> (this), 0, 0, 0); |
173efb6d92d8
fix last errors for new tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1294
diff
changeset
|
641 |
Simulator::Schedule (Seconds (0.0), &SimulatorTests::bar4c, Ptr<const SimulatorTests> (this), 0, 0, 0, 0); |
173efb6d92d8
fix last errors for new tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1294
diff
changeset
|
642 |
Simulator::Schedule (Seconds (0.0), &SimulatorTests::bar5c, Ptr<const SimulatorTests> (this), 0, 0, 0, 0, 0); |
1294
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
643 |
Simulator::Schedule (Seconds (0.0), &SimulatorTests::cbaz1c, this, 0); |
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
644 |
Simulator::Schedule (Seconds (0.0), &SimulatorTests::cbaz2c, this, 0, 0); |
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
645 |
Simulator::Schedule (Seconds (0.0), &SimulatorTests::cbaz3c, this, 0, 0, 0); |
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
646 |
Simulator::Schedule (Seconds (0.0), &SimulatorTests::cbaz4c, this, 0, 0, 0, 0); |
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
647 |
Simulator::Schedule (Seconds (0.0), &SimulatorTests::cbaz5c, this, 0, 0, 0, 0, 0); |
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
648 |
Simulator::ScheduleNow (&SimulatorTests::bar0c, this); |
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
649 |
Simulator::ScheduleNow (&SimulatorTests::bar1c, this, 0); |
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
650 |
Simulator::ScheduleNow (&SimulatorTests::bar2c, this, 0, 0); |
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
651 |
Simulator::ScheduleNow (&SimulatorTests::bar3c, this, 0, 0, 0); |
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
652 |
Simulator::ScheduleNow (&SimulatorTests::bar4c, this, 0, 0, 0, 0); |
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
653 |
Simulator::ScheduleNow (&SimulatorTests::bar5c, this, 0, 0, 0, 0, 0); |
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
654 |
Simulator::ScheduleNow (&SimulatorTests::cbaz1c, this, 0); |
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
655 |
Simulator::ScheduleNow (&SimulatorTests::cbaz2c, this, 0, 0); |
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
656 |
Simulator::ScheduleNow (&SimulatorTests::cbaz3c, this, 0, 0, 0); |
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
657 |
Simulator::ScheduleNow (&SimulatorTests::cbaz4c, this, 0, 0, 0, 0); |
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
658 |
Simulator::ScheduleNow (&SimulatorTests::cbaz5c, this, 0, 0, 0, 0, 0); |
1296
173efb6d92d8
fix last errors for new tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1294
diff
changeset
|
659 |
Simulator::ScheduleNow (&SimulatorTests::bar0c, Ptr<const SimulatorTests> (this)); |
173efb6d92d8
fix last errors for new tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1294
diff
changeset
|
660 |
Simulator::ScheduleNow (&SimulatorTests::bar1c, Ptr<const SimulatorTests> (this), 0); |
173efb6d92d8
fix last errors for new tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1294
diff
changeset
|
661 |
Simulator::ScheduleNow (&SimulatorTests::bar2c, Ptr<const SimulatorTests> (this), 0, 0); |
173efb6d92d8
fix last errors for new tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1294
diff
changeset
|
662 |
Simulator::ScheduleNow (&SimulatorTests::bar3c, Ptr<const SimulatorTests> (this), 0, 0, 0); |
173efb6d92d8
fix last errors for new tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1294
diff
changeset
|
663 |
Simulator::ScheduleNow (&SimulatorTests::bar4c, Ptr<const SimulatorTests> (this), 0, 0, 0, 0); |
173efb6d92d8
fix last errors for new tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1294
diff
changeset
|
664 |
Simulator::ScheduleNow (&SimulatorTests::bar5c, Ptr<const SimulatorTests> (this), 0, 0, 0, 0, 0); |
1294
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
665 |
Simulator::ScheduleDestroy (&SimulatorTests::bar0c, this); |
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
666 |
Simulator::ScheduleDestroy (&SimulatorTests::bar1c, this, 0); |
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
667 |
Simulator::ScheduleDestroy (&SimulatorTests::bar2c, this, 0, 0); |
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
668 |
Simulator::ScheduleDestroy (&SimulatorTests::bar3c, this, 0, 0, 0); |
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
669 |
Simulator::ScheduleDestroy (&SimulatorTests::bar4c, this, 0, 0, 0, 0); |
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
670 |
Simulator::ScheduleDestroy (&SimulatorTests::bar5c, this, 0, 0, 0, 0, 0); |
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
671 |
Simulator::ScheduleDestroy (&SimulatorTests::cbaz1c, this, 0); |
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
672 |
Simulator::ScheduleDestroy (&SimulatorTests::cbaz2c, this, 0, 0); |
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
673 |
Simulator::ScheduleDestroy (&SimulatorTests::cbaz3c, this, 0, 0, 0); |
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
674 |
Simulator::ScheduleDestroy (&SimulatorTests::cbaz4c, this, 0, 0, 0, 0); |
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
675 |
Simulator::ScheduleDestroy (&SimulatorTests::cbaz5c, this, 0, 0, 0, 0, 0); |
1296
173efb6d92d8
fix last errors for new tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1294
diff
changeset
|
676 |
Simulator::ScheduleDestroy (&SimulatorTests::bar0c, Ptr<const SimulatorTests> (this)); |
173efb6d92d8
fix last errors for new tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1294
diff
changeset
|
677 |
Simulator::ScheduleDestroy (&SimulatorTests::bar1c, Ptr<const SimulatorTests> (this), 0); |
173efb6d92d8
fix last errors for new tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1294
diff
changeset
|
678 |
Simulator::ScheduleDestroy (&SimulatorTests::bar2c, Ptr<const SimulatorTests> (this), 0, 0); |
173efb6d92d8
fix last errors for new tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1294
diff
changeset
|
679 |
Simulator::ScheduleDestroy (&SimulatorTests::bar3c, Ptr<const SimulatorTests> (this), 0, 0, 0); |
173efb6d92d8
fix last errors for new tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1294
diff
changeset
|
680 |
Simulator::ScheduleDestroy (&SimulatorTests::bar4c, Ptr<const SimulatorTests> (this), 0, 0, 0, 0); |
173efb6d92d8
fix last errors for new tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1294
diff
changeset
|
681 |
Simulator::ScheduleDestroy (&SimulatorTests::bar5c, Ptr<const SimulatorTests> (this), 0, 0, 0, 0, 0); |
1294
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
682 |
Simulator::Schedule (Seconds (0.0), &SimulatorTests::baz1c, this, 0); |
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
683 |
Simulator::Schedule (Seconds (0.0), &SimulatorTests::baz2c, this, 0, 0); |
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
684 |
Simulator::Schedule (Seconds (0.0), &SimulatorTests::baz3c, this, 0, 0, 0); |
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
685 |
Simulator::Schedule (Seconds (0.0), &SimulatorTests::baz4c, this, 0, 0, 0, 0); |
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
686 |
Simulator::Schedule (Seconds (0.0), &SimulatorTests::baz5c, this, 0, 0, 0, 0, 0); |
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
687 |
Simulator::ScheduleNow (&SimulatorTests::baz1c, this, 0); |
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
688 |
Simulator::ScheduleNow (&SimulatorTests::baz2c, this, 0, 0); |
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
689 |
Simulator::ScheduleNow (&SimulatorTests::baz3c, this, 0, 0, 0); |
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
690 |
Simulator::ScheduleNow (&SimulatorTests::baz4c, this, 0, 0, 0, 0); |
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
691 |
Simulator::ScheduleNow (&SimulatorTests::baz5c, this, 0, 0, 0, 0, 0); |
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
692 |
Simulator::ScheduleDestroy (&SimulatorTests::baz1c, this, 0); |
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
693 |
Simulator::ScheduleDestroy (&SimulatorTests::baz2c, this, 0, 0); |
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
694 |
Simulator::ScheduleDestroy (&SimulatorTests::baz3c, this, 0, 0, 0); |
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
695 |
Simulator::ScheduleDestroy (&SimulatorTests::baz4c, this, 0, 0, 0, 0); |
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
696 |
Simulator::ScheduleDestroy (&SimulatorTests::baz5c, this, 0, 0, 0, 0, 0); |
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
697 |
|
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
698 |
Simulator::Run (); |
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
699 |
Simulator::Destroy (); |
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
700 |
} |
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
701 |
|
114
fe0504af6d16
test each default event scheduler
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
111
diff
changeset
|
702 |
bool |
122
6b8f1eda5c57
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
121
diff
changeset
|
703 |
SimulatorTests::RunTests (void) |
114
fe0504af6d16
test each default event scheduler
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
111
diff
changeset
|
704 |
{ |
1521
7563328d71ea
Use NS_TEST_* macros for simulator unit tests
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
1296
diff
changeset
|
705 |
bool result = true; |
7563328d71ea
Use NS_TEST_* macros for simulator unit tests
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
1296
diff
changeset
|
706 |
|
1522
70371ffd0ce5
Call Simulator::Destroy () before running simulator unit tests, to force time to start from zero (some tests check for absolute times)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
1521
diff
changeset
|
707 |
Simulator::Destroy (); |
2913
66dd24c80d75
bug 143: rename scheduler files
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2901
diff
changeset
|
708 |
Simulator::SetScheduler (CreateObject<ListScheduler> ()); |
150
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
148
diff
changeset
|
709 |
if (!RunOneTest ()) |
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
148
diff
changeset
|
710 |
{ |
1521
7563328d71ea
Use NS_TEST_* macros for simulator unit tests
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
1296
diff
changeset
|
711 |
result = false; |
150
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
148
diff
changeset
|
712 |
} |
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
148
diff
changeset
|
713 |
Simulator::Destroy (); |
2913
66dd24c80d75
bug 143: rename scheduler files
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2901
diff
changeset
|
714 |
Simulator::SetScheduler (CreateObject<HeapScheduler> ()); |
150
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
148
diff
changeset
|
715 |
if (!RunOneTest ()) |
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
148
diff
changeset
|
716 |
{ |
1521
7563328d71ea
Use NS_TEST_* macros for simulator unit tests
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
1296
diff
changeset
|
717 |
result = false; |
150
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
148
diff
changeset
|
718 |
} |
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
148
diff
changeset
|
719 |
Simulator::Destroy (); |
2913
66dd24c80d75
bug 143: rename scheduler files
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2901
diff
changeset
|
720 |
Simulator::SetScheduler (CreateObject<MapScheduler> ()); |
150
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
148
diff
changeset
|
721 |
if (!RunOneTest ()) |
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
148
diff
changeset
|
722 |
{ |
1521
7563328d71ea
Use NS_TEST_* macros for simulator unit tests
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
1296
diff
changeset
|
723 |
result = false; |
150
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
148
diff
changeset
|
724 |
} |
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
148
diff
changeset
|
725 |
Simulator::Destroy (); |
31
2def0da92178
add simulator tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
30
diff
changeset
|
726 |
|
150
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
148
diff
changeset
|
727 |
Simulator::Schedule (Seconds (0.0), &foo0); |
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
148
diff
changeset
|
728 |
Simulator::Schedule (Seconds (0.0), &foo1, 0); |
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
148
diff
changeset
|
729 |
Simulator::Schedule (Seconds (0.0), &foo2, 0, 0); |
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
148
diff
changeset
|
730 |
Simulator::Schedule (Seconds (0.0), &foo3, 0, 0, 0); |
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
148
diff
changeset
|
731 |
Simulator::Schedule (Seconds (0.0), &foo4, 0, 0, 0, 0); |
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
148
diff
changeset
|
732 |
Simulator::Schedule (Seconds (0.0), &foo5, 0, 0, 0, 0, 0); |
948
8dc076230f11
finish support for references as arguments to event handlers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
945
diff
changeset
|
733 |
Simulator::Schedule (Seconds (0.0), &cber1, 0); |
8dc076230f11
finish support for references as arguments to event handlers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
945
diff
changeset
|
734 |
Simulator::Schedule (Seconds (0.0), &cber2, 0, 0); |
8dc076230f11
finish support for references as arguments to event handlers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
945
diff
changeset
|
735 |
Simulator::Schedule (Seconds (0.0), &cber3, 0, 0, 0); |
8dc076230f11
finish support for references as arguments to event handlers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
945
diff
changeset
|
736 |
Simulator::Schedule (Seconds (0.0), &cber4, 0, 0, 0, 0); |
8dc076230f11
finish support for references as arguments to event handlers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
945
diff
changeset
|
737 |
Simulator::Schedule (Seconds (0.0), &cber5, 0, 0, 0, 0, 0); |
150
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
148
diff
changeset
|
738 |
Simulator::Schedule (Seconds (0.0), &SimulatorTests::bar0, this); |
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
148
diff
changeset
|
739 |
Simulator::Schedule (Seconds (0.0), &SimulatorTests::bar1, this, 0); |
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
148
diff
changeset
|
740 |
Simulator::Schedule (Seconds (0.0), &SimulatorTests::bar2, this, 0, 0); |
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
148
diff
changeset
|
741 |
Simulator::Schedule (Seconds (0.0), &SimulatorTests::bar3, this, 0, 0, 0); |
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
148
diff
changeset
|
742 |
Simulator::Schedule (Seconds (0.0), &SimulatorTests::bar4, this, 0, 0, 0, 0); |
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
148
diff
changeset
|
743 |
Simulator::Schedule (Seconds (0.0), &SimulatorTests::bar5, this, 0, 0, 0, 0, 0); |
690 | 744 |
Simulator::Schedule (Seconds (0.0), &SimulatorTests::bar0, Ptr<SimulatorTests> (this)); |
745 |
Simulator::Schedule (Seconds (0.0), &SimulatorTests::bar1, Ptr<SimulatorTests> (this), 0); |
|
746 |
Simulator::Schedule (Seconds (0.0), &SimulatorTests::bar2, Ptr<SimulatorTests> (this), 0, 0); |
|
747 |
Simulator::Schedule (Seconds (0.0), &SimulatorTests::bar3, Ptr<SimulatorTests> (this), 0, 0, 0); |
|
748 |
Simulator::Schedule (Seconds (0.0), &SimulatorTests::bar4, Ptr<SimulatorTests> (this), 0, 0, 0, 0); |
|
749 |
Simulator::Schedule (Seconds (0.0), &SimulatorTests::bar5, Ptr<SimulatorTests> (this), 0, 0, 0, 0, 0); |
|
948
8dc076230f11
finish support for references as arguments to event handlers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
945
diff
changeset
|
750 |
Simulator::Schedule (Seconds (0.0), &SimulatorTests::cbaz1, this, 0); |
8dc076230f11
finish support for references as arguments to event handlers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
945
diff
changeset
|
751 |
Simulator::Schedule (Seconds (0.0), &SimulatorTests::cbaz2, this, 0, 0); |
8dc076230f11
finish support for references as arguments to event handlers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
945
diff
changeset
|
752 |
Simulator::Schedule (Seconds (0.0), &SimulatorTests::cbaz3, this, 0, 0, 0); |
8dc076230f11
finish support for references as arguments to event handlers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
945
diff
changeset
|
753 |
Simulator::Schedule (Seconds (0.0), &SimulatorTests::cbaz4, this, 0, 0, 0, 0); |
8dc076230f11
finish support for references as arguments to event handlers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
945
diff
changeset
|
754 |
Simulator::Schedule (Seconds (0.0), &SimulatorTests::cbaz5, this, 0, 0, 0, 0, 0); |
150
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
148
diff
changeset
|
755 |
Simulator::ScheduleNow (&foo0); |
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
148
diff
changeset
|
756 |
Simulator::ScheduleNow (&foo1, 0); |
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
148
diff
changeset
|
757 |
Simulator::ScheduleNow (&foo2, 0, 0); |
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
148
diff
changeset
|
758 |
Simulator::ScheduleNow (&foo3, 0, 0, 0); |
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
148
diff
changeset
|
759 |
Simulator::ScheduleNow (&foo4, 0, 0, 0, 0); |
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
148
diff
changeset
|
760 |
Simulator::ScheduleNow (&foo5, 0, 0, 0, 0, 0); |
948
8dc076230f11
finish support for references as arguments to event handlers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
945
diff
changeset
|
761 |
Simulator::ScheduleNow (&cber1, 0); |
8dc076230f11
finish support for references as arguments to event handlers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
945
diff
changeset
|
762 |
Simulator::ScheduleNow (&cber2, 0, 0); |
8dc076230f11
finish support for references as arguments to event handlers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
945
diff
changeset
|
763 |
Simulator::ScheduleNow (&cber3, 0, 0, 0); |
8dc076230f11
finish support for references as arguments to event handlers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
945
diff
changeset
|
764 |
Simulator::ScheduleNow (&cber4, 0, 0, 0, 0); |
8dc076230f11
finish support for references as arguments to event handlers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
945
diff
changeset
|
765 |
Simulator::ScheduleNow (&cber5, 0, 0, 0, 0, 0); |
150
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
148
diff
changeset
|
766 |
Simulator::ScheduleNow (&SimulatorTests::bar0, this); |
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
148
diff
changeset
|
767 |
Simulator::ScheduleNow (&SimulatorTests::bar1, this, 0); |
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
148
diff
changeset
|
768 |
Simulator::ScheduleNow (&SimulatorTests::bar2, this, 0, 0); |
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
148
diff
changeset
|
769 |
Simulator::ScheduleNow (&SimulatorTests::bar3, this, 0, 0, 0); |
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
148
diff
changeset
|
770 |
Simulator::ScheduleNow (&SimulatorTests::bar4, this, 0, 0, 0, 0); |
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
148
diff
changeset
|
771 |
Simulator::ScheduleNow (&SimulatorTests::bar5, this, 0, 0, 0, 0, 0); |
948
8dc076230f11
finish support for references as arguments to event handlers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
945
diff
changeset
|
772 |
Simulator::ScheduleNow (&SimulatorTests::cbaz1, this, 0); |
8dc076230f11
finish support for references as arguments to event handlers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
945
diff
changeset
|
773 |
Simulator::ScheduleNow (&SimulatorTests::cbaz2, this, 0, 0); |
8dc076230f11
finish support for references as arguments to event handlers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
945
diff
changeset
|
774 |
Simulator::ScheduleNow (&SimulatorTests::cbaz3, this, 0, 0, 0); |
8dc076230f11
finish support for references as arguments to event handlers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
945
diff
changeset
|
775 |
Simulator::ScheduleNow (&SimulatorTests::cbaz4, this, 0, 0, 0, 0); |
8dc076230f11
finish support for references as arguments to event handlers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
945
diff
changeset
|
776 |
Simulator::ScheduleNow (&SimulatorTests::cbaz5, this, 0, 0, 0, 0, 0); |
690 | 777 |
Simulator::ScheduleNow (&SimulatorTests::bar0, Ptr<SimulatorTests> (this)); |
778 |
Simulator::ScheduleNow (&SimulatorTests::bar1, Ptr<SimulatorTests> (this), 0); |
|
779 |
Simulator::ScheduleNow (&SimulatorTests::bar2, Ptr<SimulatorTests> (this), 0, 0); |
|
780 |
Simulator::ScheduleNow (&SimulatorTests::bar3, Ptr<SimulatorTests> (this), 0, 0, 0); |
|
781 |
Simulator::ScheduleNow (&SimulatorTests::bar4, Ptr<SimulatorTests> (this), 0, 0, 0, 0); |
|
782 |
Simulator::ScheduleNow (&SimulatorTests::bar5, Ptr<SimulatorTests> (this), 0, 0, 0, 0, 0); |
|
150
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
148
diff
changeset
|
783 |
Simulator::ScheduleDestroy (&foo0); |
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
148
diff
changeset
|
784 |
Simulator::ScheduleDestroy (&foo1, 0); |
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
148
diff
changeset
|
785 |
Simulator::ScheduleDestroy (&foo2, 0, 0); |
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
148
diff
changeset
|
786 |
Simulator::ScheduleDestroy (&foo3, 0, 0, 0); |
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
148
diff
changeset
|
787 |
Simulator::ScheduleDestroy (&foo4, 0, 0, 0, 0); |
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
148
diff
changeset
|
788 |
Simulator::ScheduleDestroy (&foo5, 0, 0, 0, 0, 0); |
948
8dc076230f11
finish support for references as arguments to event handlers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
945
diff
changeset
|
789 |
Simulator::ScheduleDestroy (&cber1, 0); |
8dc076230f11
finish support for references as arguments to event handlers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
945
diff
changeset
|
790 |
Simulator::ScheduleDestroy (&cber2, 0, 0); |
8dc076230f11
finish support for references as arguments to event handlers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
945
diff
changeset
|
791 |
Simulator::ScheduleDestroy (&cber3, 0, 0, 0); |
8dc076230f11
finish support for references as arguments to event handlers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
945
diff
changeset
|
792 |
Simulator::ScheduleDestroy (&cber4, 0, 0, 0, 0); |
8dc076230f11
finish support for references as arguments to event handlers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
945
diff
changeset
|
793 |
Simulator::ScheduleDestroy (&cber5, 0, 0, 0, 0, 0); |
150
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
148
diff
changeset
|
794 |
Simulator::ScheduleDestroy (&SimulatorTests::bar0, this); |
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
148
diff
changeset
|
795 |
Simulator::ScheduleDestroy (&SimulatorTests::bar1, this, 0); |
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
148
diff
changeset
|
796 |
Simulator::ScheduleDestroy (&SimulatorTests::bar2, this, 0, 0); |
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
148
diff
changeset
|
797 |
Simulator::ScheduleDestroy (&SimulatorTests::bar3, this, 0, 0, 0); |
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
148
diff
changeset
|
798 |
Simulator::ScheduleDestroy (&SimulatorTests::bar4, this, 0, 0, 0, 0); |
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
148
diff
changeset
|
799 |
Simulator::ScheduleDestroy (&SimulatorTests::bar5, this, 0, 0, 0, 0, 0); |
948
8dc076230f11
finish support for references as arguments to event handlers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
945
diff
changeset
|
800 |
Simulator::ScheduleDestroy (&SimulatorTests::cbaz1, this, 0); |
8dc076230f11
finish support for references as arguments to event handlers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
945
diff
changeset
|
801 |
Simulator::ScheduleDestroy (&SimulatorTests::cbaz2, this, 0, 0); |
8dc076230f11
finish support for references as arguments to event handlers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
945
diff
changeset
|
802 |
Simulator::ScheduleDestroy (&SimulatorTests::cbaz3, this, 0, 0, 0); |
8dc076230f11
finish support for references as arguments to event handlers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
945
diff
changeset
|
803 |
Simulator::ScheduleDestroy (&SimulatorTests::cbaz4, this, 0, 0, 0, 0); |
8dc076230f11
finish support for references as arguments to event handlers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
945
diff
changeset
|
804 |
Simulator::ScheduleDestroy (&SimulatorTests::cbaz5, this, 0, 0, 0, 0, 0); |
690 | 805 |
Simulator::ScheduleDestroy (&SimulatorTests::bar0, Ptr<SimulatorTests> (this)); |
806 |
Simulator::ScheduleDestroy (&SimulatorTests::bar1, Ptr<SimulatorTests> (this), 0); |
|
807 |
Simulator::ScheduleDestroy (&SimulatorTests::bar2, Ptr<SimulatorTests> (this), 0, 0); |
|
808 |
Simulator::ScheduleDestroy (&SimulatorTests::bar3, Ptr<SimulatorTests> (this), 0, 0, 0); |
|
809 |
Simulator::ScheduleDestroy (&SimulatorTests::bar4, Ptr<SimulatorTests> (this), 0, 0, 0, 0); |
|
810 |
Simulator::ScheduleDestroy (&SimulatorTests::bar5, Ptr<SimulatorTests> (this), 0, 0, 0, 0, 0); |
|
181
006158ef00f1
fix memory leaks
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
163
diff
changeset
|
811 |
|
948
8dc076230f11
finish support for references as arguments to event handlers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
945
diff
changeset
|
812 |
|
8dc076230f11
finish support for references as arguments to event handlers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
945
diff
changeset
|
813 |
// the code below does not compile, as expected. |
8dc076230f11
finish support for references as arguments to event handlers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
945
diff
changeset
|
814 |
//Simulator::Schedule (Seconds (0.0), &cber1, 0.0); |
8dc076230f11
finish support for references as arguments to event handlers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
945
diff
changeset
|
815 |
|
8dc076230f11
finish support for references as arguments to event handlers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
945
diff
changeset
|
816 |
#if 1 |
8dc076230f11
finish support for references as arguments to event handlers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
945
diff
changeset
|
817 |
Simulator::Schedule (Seconds (0.0), &ber1, 0); |
8dc076230f11
finish support for references as arguments to event handlers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
945
diff
changeset
|
818 |
Simulator::Schedule (Seconds (0.0), &ber2, 0, 0); |
8dc076230f11
finish support for references as arguments to event handlers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
945
diff
changeset
|
819 |
Simulator::Schedule (Seconds (0.0), &ber3, 0, 0, 0); |
8dc076230f11
finish support for references as arguments to event handlers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
945
diff
changeset
|
820 |
Simulator::Schedule (Seconds (0.0), &ber4, 0, 0, 0, 0); |
8dc076230f11
finish support for references as arguments to event handlers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
945
diff
changeset
|
821 |
Simulator::Schedule (Seconds (0.0), &ber5, 0, 0, 0, 0, 0); |
8dc076230f11
finish support for references as arguments to event handlers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
945
diff
changeset
|
822 |
Simulator::Schedule (Seconds (0.0), &SimulatorTests::baz1, this, 0); |
8dc076230f11
finish support for references as arguments to event handlers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
945
diff
changeset
|
823 |
Simulator::Schedule (Seconds (0.0), &SimulatorTests::baz2, this, 0, 0); |
8dc076230f11
finish support for references as arguments to event handlers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
945
diff
changeset
|
824 |
Simulator::Schedule (Seconds (0.0), &SimulatorTests::baz3, this, 0, 0, 0); |
8dc076230f11
finish support for references as arguments to event handlers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
945
diff
changeset
|
825 |
Simulator::Schedule (Seconds (0.0), &SimulatorTests::baz4, this, 0, 0, 0, 0); |
8dc076230f11
finish support for references as arguments to event handlers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
945
diff
changeset
|
826 |
Simulator::Schedule (Seconds (0.0), &SimulatorTests::baz5, this, 0, 0, 0, 0, 0); |
8dc076230f11
finish support for references as arguments to event handlers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
945
diff
changeset
|
827 |
Simulator::ScheduleNow (&ber1, 0); |
8dc076230f11
finish support for references as arguments to event handlers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
945
diff
changeset
|
828 |
Simulator::ScheduleNow (&ber2, 0, 0); |
8dc076230f11
finish support for references as arguments to event handlers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
945
diff
changeset
|
829 |
Simulator::ScheduleNow (&ber3, 0, 0, 0); |
8dc076230f11
finish support for references as arguments to event handlers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
945
diff
changeset
|
830 |
Simulator::ScheduleNow (&ber4, 0, 0, 0, 0); |
8dc076230f11
finish support for references as arguments to event handlers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
945
diff
changeset
|
831 |
Simulator::ScheduleNow (&ber5, 0, 0, 0, 0, 0); |
8dc076230f11
finish support for references as arguments to event handlers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
945
diff
changeset
|
832 |
Simulator::ScheduleNow (&SimulatorTests::baz1, this, 0); |
8dc076230f11
finish support for references as arguments to event handlers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
945
diff
changeset
|
833 |
Simulator::ScheduleNow (&SimulatorTests::baz2, this, 0, 0); |
8dc076230f11
finish support for references as arguments to event handlers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
945
diff
changeset
|
834 |
Simulator::ScheduleNow (&SimulatorTests::baz3, this, 0, 0, 0); |
8dc076230f11
finish support for references as arguments to event handlers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
945
diff
changeset
|
835 |
Simulator::ScheduleNow (&SimulatorTests::baz4, this, 0, 0, 0, 0); |
8dc076230f11
finish support for references as arguments to event handlers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
945
diff
changeset
|
836 |
Simulator::ScheduleNow (&SimulatorTests::baz5, this, 0, 0, 0, 0, 0); |
8dc076230f11
finish support for references as arguments to event handlers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
945
diff
changeset
|
837 |
Simulator::ScheduleDestroy (&ber1, 0); |
8dc076230f11
finish support for references as arguments to event handlers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
945
diff
changeset
|
838 |
Simulator::ScheduleDestroy (&ber2, 0, 0); |
8dc076230f11
finish support for references as arguments to event handlers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
945
diff
changeset
|
839 |
Simulator::ScheduleDestroy (&ber3, 0, 0, 0); |
8dc076230f11
finish support for references as arguments to event handlers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
945
diff
changeset
|
840 |
Simulator::ScheduleDestroy (&ber4, 0, 0, 0, 0); |
8dc076230f11
finish support for references as arguments to event handlers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
945
diff
changeset
|
841 |
Simulator::ScheduleDestroy (&ber5, 0, 0, 0, 0, 0); |
8dc076230f11
finish support for references as arguments to event handlers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
945
diff
changeset
|
842 |
Simulator::ScheduleDestroy (&SimulatorTests::baz1, this, 0); |
8dc076230f11
finish support for references as arguments to event handlers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
945
diff
changeset
|
843 |
Simulator::ScheduleDestroy (&SimulatorTests::baz2, this, 0, 0); |
8dc076230f11
finish support for references as arguments to event handlers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
945
diff
changeset
|
844 |
Simulator::ScheduleDestroy (&SimulatorTests::baz3, this, 0, 0, 0); |
8dc076230f11
finish support for references as arguments to event handlers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
945
diff
changeset
|
845 |
Simulator::ScheduleDestroy (&SimulatorTests::baz4, this, 0, 0, 0, 0); |
8dc076230f11
finish support for references as arguments to event handlers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
945
diff
changeset
|
846 |
Simulator::ScheduleDestroy (&SimulatorTests::baz5, this, 0, 0, 0, 0, 0); |
8dc076230f11
finish support for references as arguments to event handlers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
945
diff
changeset
|
847 |
#endif |
8dc076230f11
finish support for references as arguments to event handlers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
945
diff
changeset
|
848 |
|
1294
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
849 |
RunTestsConst (); |
b59fb36ab86a
add failing tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1224
diff
changeset
|
850 |
|
963
3a7a66d1942c
add support to cancel Now and Destroy events.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
948
diff
changeset
|
851 |
EventId nowId = Simulator::ScheduleNow (&foo0); |
964
e49de7414508
make sure IsExpired handles destroy events correctly
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
963
diff
changeset
|
852 |
m_destroyId = Simulator::ScheduleDestroy (&SimulatorTests::destroy, this); |
1521
7563328d71ea
Use NS_TEST_* macros for simulator unit tests
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
1296
diff
changeset
|
853 |
NS_TEST_ASSERT (!m_destroyId.IsExpired ()); |
963
3a7a66d1942c
add support to cancel Now and Destroy events.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
948
diff
changeset
|
854 |
|
181
006158ef00f1
fix memory leaks
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
163
diff
changeset
|
855 |
Simulator::Run (); |
964
e49de7414508
make sure IsExpired handles destroy events correctly
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
963
diff
changeset
|
856 |
m_destroy = false; |
181
006158ef00f1
fix memory leaks
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
163
diff
changeset
|
857 |
Simulator::Destroy (); |
1521
7563328d71ea
Use NS_TEST_* macros for simulator unit tests
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
1296
diff
changeset
|
858 |
NS_TEST_ASSERT (m_destroy); |
146
2c9ef359e320
implement overloads for ScheduleNow and ScheduleDestroy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
145
diff
changeset
|
859 |
|
1008
6f2ea723a1db
use a Ptr<> to manage EventImpl instances
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1005
diff
changeset
|
860 |
EventId anId = Simulator::ScheduleNow (&foo0); |
6f2ea723a1db
use a Ptr<> to manage EventImpl instances
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1005
diff
changeset
|
861 |
EventId anotherId = anId; |
1521
7563328d71ea
Use NS_TEST_* macros for simulator unit tests
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
1296
diff
changeset
|
862 |
NS_TEST_ASSERT (!(anId.IsExpired () || anotherId.IsExpired ())); |
7563328d71ea
Use NS_TEST_* macros for simulator unit tests
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
1296
diff
changeset
|
863 |
|
1008
6f2ea723a1db
use a Ptr<> to manage EventImpl instances
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1005
diff
changeset
|
864 |
Simulator::Remove (anId); |
1521
7563328d71ea
Use NS_TEST_* macros for simulator unit tests
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
1296
diff
changeset
|
865 |
NS_TEST_ASSERT (anId.IsExpired ()); |
7563328d71ea
Use NS_TEST_* macros for simulator unit tests
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
1296
diff
changeset
|
866 |
NS_TEST_ASSERT (anotherId.IsExpired ()); |
1008
6f2ea723a1db
use a Ptr<> to manage EventImpl instances
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1005
diff
changeset
|
867 |
|
6f2ea723a1db
use a Ptr<> to manage EventImpl instances
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1005
diff
changeset
|
868 |
Simulator::Run (); |
6f2ea723a1db
use a Ptr<> to manage EventImpl instances
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1005
diff
changeset
|
869 |
Simulator::Destroy (); |
2357
d64b1561b1c2
Release all events left upon Simulator::Destroy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1863
diff
changeset
|
870 |
|
d64b1561b1c2
Release all events left upon Simulator::Destroy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1863
diff
changeset
|
871 |
Simulator::Schedule (Seconds (10.0), &SimulatorTests::baz1, this, 0); |
3174
efeb6e5c276d
Make Application::Start/Stop times relative, Simulator::StopAt(time) renamed to Simulator::Stop(time) and time also made relative, to improve consistency of the API which uses relative times everywhere else. Closes bug #191.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3008
diff
changeset
|
872 |
Simulator::Stop (Seconds (1.0)); |
2357
d64b1561b1c2
Release all events left upon Simulator::Destroy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1863
diff
changeset
|
873 |
Simulator::Run (); |
d64b1561b1c2
Release all events left upon Simulator::Destroy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1863
diff
changeset
|
874 |
Simulator::Destroy (); |
1008
6f2ea723a1db
use a Ptr<> to manage EventImpl instances
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1005
diff
changeset
|
875 |
|
1521
7563328d71ea
Use NS_TEST_* macros for simulator unit tests
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
1296
diff
changeset
|
876 |
return result; |
30
eb38b7903dfb
add empty simulator test
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
29
diff
changeset
|
877 |
} |
eb38b7903dfb
add empty simulator test
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
29
diff
changeset
|
878 |
|
53
ae406f4957d5
variable/method/function coding style update
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
52
diff
changeset
|
879 |
SimulatorTests gSimulatorTests; |
30
eb38b7903dfb
add empty simulator test
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
29
diff
changeset
|
880 |
|
eb38b7903dfb
add empty simulator test
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
29
diff
changeset
|
881 |
}; // namespace ns3 |
eb38b7903dfb
add empty simulator test
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
29
diff
changeset
|
882 |
|
eb38b7903dfb
add empty simulator test
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
29
diff
changeset
|
883 |
#endif /* RUN_SELF_TESTS */ |
24 | 884 |
|
885 |
||
37
af78cb75be51
improve tests
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
36
diff
changeset
|
886 |