author | mathieu.lacage@sophia.inria.fr |
Wed, 10 Dec 2008 17:01:06 -0800 | |
changeset 4009 | 76cb8ed8fe98 |
parent 3816 | edd4928b2046 |
child 4552 | 8d3801089629 |
permissions | -rw-r--r-- |
3469
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
1 |
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
2 |
/* |
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
3 |
* Copyright (c) 2005,2006 INRIA |
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
4 |
* |
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
5 |
* This program is free software; you can redistribute it and/or modify |
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
6 |
* it under the terms of the GNU General Public License version 2 as |
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation; |
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
8 |
* |
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
9 |
* This program is distributed in the hope that it will be useful, |
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
12 |
* GNU General Public License for more details. |
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
13 |
* |
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
14 |
* You should have received a copy of the GNU General Public License |
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
15 |
* along with this program; if not, write to the Free Software |
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
16 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
17 |
* |
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
18 |
* Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr> |
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
19 |
*/ |
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
20 |
|
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
21 |
#ifndef SIMULATOR_IMPL_H |
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
22 |
#define SIMULATOR_IMPL_H |
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
23 |
|
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
24 |
#include "event-impl.h" |
3807
268b86ce5435
don't use EventId in Schedulers: use Scheduler::Event instead.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3515
diff
changeset
|
25 |
#include "event-id.h" |
3470
21022872009d
make simulator implementation replaceable via global default value
Craig Dowell <craigdo@ee.washington.edu>
parents:
3469
diff
changeset
|
26 |
#include "nstime.h" |
3809
5e007004402e
move MakeEvent out of Simulator
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3808
diff
changeset
|
27 |
#include "ns3/object.h" |
3469
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
28 |
#include "ns3/ptr.h" |
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
29 |
|
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
30 |
namespace ns3 { |
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
31 |
|
3809
5e007004402e
move MakeEvent out of Simulator
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3808
diff
changeset
|
32 |
class Scheduler; |
5e007004402e
move MakeEvent out of Simulator
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3808
diff
changeset
|
33 |
|
3469
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
34 |
class SimulatorImpl : public Object |
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
35 |
{ |
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
36 |
public: |
3470
21022872009d
make simulator implementation replaceable via global default value
Craig Dowell <craigdo@ee.washington.edu>
parents:
3469
diff
changeset
|
37 |
virtual void Destroy () = 0; |
21022872009d
make simulator implementation replaceable via global default value
Craig Dowell <craigdo@ee.washington.edu>
parents:
3469
diff
changeset
|
38 |
virtual bool IsFinished (void) const = 0; |
21022872009d
make simulator implementation replaceable via global default value
Craig Dowell <craigdo@ee.washington.edu>
parents:
3469
diff
changeset
|
39 |
virtual Time Next (void) const = 0; |
21022872009d
make simulator implementation replaceable via global default value
Craig Dowell <craigdo@ee.washington.edu>
parents:
3469
diff
changeset
|
40 |
virtual void Stop (void) = 0; |
3808
ace932ee6eef
avoid using Ptr<EventImpl>
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3807
diff
changeset
|
41 |
virtual EventId Schedule (Time const &time, EventImpl *event) = 0; |
ace932ee6eef
avoid using Ptr<EventImpl>
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3807
diff
changeset
|
42 |
virtual EventId ScheduleNow (EventImpl *event) = 0; |
ace932ee6eef
avoid using Ptr<EventImpl>
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3807
diff
changeset
|
43 |
virtual EventId ScheduleDestroy (EventImpl *event) = 0; |
3470
21022872009d
make simulator implementation replaceable via global default value
Craig Dowell <craigdo@ee.washington.edu>
parents:
3469
diff
changeset
|
44 |
virtual void Remove (const EventId &ev) = 0; |
21022872009d
make simulator implementation replaceable via global default value
Craig Dowell <craigdo@ee.washington.edu>
parents:
3469
diff
changeset
|
45 |
virtual void Cancel (const EventId &ev) = 0; |
21022872009d
make simulator implementation replaceable via global default value
Craig Dowell <craigdo@ee.washington.edu>
parents:
3469
diff
changeset
|
46 |
virtual bool IsExpired (const EventId &ev) const = 0; |
21022872009d
make simulator implementation replaceable via global default value
Craig Dowell <craigdo@ee.washington.edu>
parents:
3469
diff
changeset
|
47 |
virtual void Run (void) = 0; |
3515
88e9cee20461
Bug #270: Simulator::RunOneEvent
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3489
diff
changeset
|
48 |
virtual void RunOneEvent (void) = 0; |
3470
21022872009d
make simulator implementation replaceable via global default value
Craig Dowell <craigdo@ee.washington.edu>
parents:
3469
diff
changeset
|
49 |
virtual Time Now (void) const = 0; |
21022872009d
make simulator implementation replaceable via global default value
Craig Dowell <craigdo@ee.washington.edu>
parents:
3469
diff
changeset
|
50 |
virtual Time GetDelayLeft (const EventId &id) const = 0; |
21022872009d
make simulator implementation replaceable via global default value
Craig Dowell <craigdo@ee.washington.edu>
parents:
3469
diff
changeset
|
51 |
virtual Time GetMaximumSimulationTime (void) const = 0; |
21022872009d
make simulator implementation replaceable via global default value
Craig Dowell <craigdo@ee.washington.edu>
parents:
3469
diff
changeset
|
52 |
virtual void SetScheduler (Ptr<Scheduler> scheduler) = 0; |
21022872009d
make simulator implementation replaceable via global default value
Craig Dowell <craigdo@ee.washington.edu>
parents:
3469
diff
changeset
|
53 |
virtual Ptr<Scheduler> GetScheduler (void) const = 0; |
3469
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
54 |
}; |
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
55 |
|
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
56 |
} // namespace ns3 |
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
57 |
|
9e763021e045
factor simulator into interface and (multiple) implementation pieces
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
58 |
#endif /* SIMULATOR_IMPL_H */ |