A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
simulator-impl.h
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2005,2006 INRIA
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation;
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
19  */
20 
21 #ifndef SIMULATOR_IMPL_H
22 #define SIMULATOR_IMPL_H
23 
24 #include "event-impl.h"
25 #include "event-id.h"
26 #include "nstime.h"
27 #include "object.h"
28 #include "object-factory.h"
29 #include "ptr.h"
30 
31 namespace ns3 {
32 
33 class Scheduler;
34 
35 class SimulatorImpl : public Object
36 {
37 public:
38  static TypeId GetTypeId (void);
39 
47  virtual void Destroy () = 0;
53  virtual bool IsFinished (void) const = 0;
59  virtual void Stop (void) = 0;
67  virtual void Stop (Time const &time) = 0;
76  virtual EventId Schedule (Time const &time, EventImpl *event) = 0;
86  virtual void ScheduleWithContext (uint32_t context, Time const &time, EventImpl *event) = 0;
94  virtual EventId ScheduleNow (EventImpl *event) = 0;
102  virtual EventId ScheduleDestroy (EventImpl *event) = 0;
114  virtual void Remove (const EventId &ev) = 0;
127  virtual void Cancel (const EventId &ev) = 0;
140  virtual bool IsExpired (const EventId &ev) const = 0;
149  virtual void Run (void) = 0;
153  virtual Time Now (void) const = 0;
160  virtual Time GetDelayLeft (const EventId &id) const = 0;
167  virtual Time GetMaximumSimulationTime (void) const = 0;
175  virtual void SetScheduler (ObjectFactory schedulerFactory) = 0;
180  virtual uint32_t GetSystemId () const = 0;
184  virtual uint32_t GetContext (void) const = 0;
185 };
186 
187 } // namespace ns3
188 
189 #endif /* SIMULATOR_IMPL_H */
keep track of time unit.
Definition: nstime.h:149
virtual void ScheduleWithContext(uint32_t context, Time const &time, EventImpl *event)=0
virtual bool IsExpired(const EventId &ev) const =0
virtual Time Now(void) const =0
virtual EventId ScheduleNow(EventImpl *event)=0
virtual void SetScheduler(ObjectFactory schedulerFactory)=0
virtual void Run(void)=0
virtual Time GetMaximumSimulationTime(void) const =0
virtual bool IsFinished(void) const =0
virtual Time GetDelayLeft(const EventId &id) const =0
virtual EventId ScheduleDestroy(EventImpl *event)=0
virtual void Cancel(const EventId &ev)=0
virtual EventId Schedule(Time const &time, EventImpl *event)=0
instantiate subclasses of ns3::Object.
a simulation event
Definition: event-impl.h:39
virtual void Remove(const EventId &ev)=0
an identifier for simulation events.
Definition: event-id.h:46
virtual void Destroy()=0
virtual void Stop(void)=0
virtual uint32_t GetSystemId() const =0
a base class which provides memory management and object aggregation
Definition: object.h:63
virtual uint32_t GetContext(void) const =0
a unique identifier for an interface.
Definition: type-id.h:44