A Discrete-Event Network Simulator
API
visual-simulator-impl.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2010 Gustavo Carneiro
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: Gustavo Carneiro <gjcarneiro@gmail.com>
19  */
20 
21 #ifndef VISUAL_SIMULATOR_IMPL_H
22 #define VISUAL_SIMULATOR_IMPL_H
23 
24 #include "ns3/simulator-impl.h"
25 
26 namespace ns3 {
27 
28 
45 {
46 public:
51  static TypeId GetTypeId (void);
52 
55 
56  virtual void Destroy ();
57  virtual bool IsFinished (void) const;
58  virtual void Stop (void);
59  virtual void Stop (Time const &delay);
60  virtual EventId Schedule (Time const &delay, EventImpl *event);
61  virtual void ScheduleWithContext (uint32_t context, Time const &delay, EventImpl *event);
62  virtual EventId ScheduleNow (EventImpl *event);
63  virtual EventId ScheduleDestroy (EventImpl *event);
64  virtual void Remove (const EventId &id);
65  virtual void Cancel (const EventId &id);
66  virtual bool IsExpired (const EventId &id) const;
67  virtual void Run (void);
68  virtual Time Now (void) const;
69  virtual Time GetDelayLeft (const EventId &id) const;
70  virtual Time GetMaximumSimulationTime (void) const;
71  virtual void SetScheduler (ObjectFactory schedulerFactory);
72  virtual uint32_t GetSystemId (void) const;
73  virtual uint32_t GetContext (void) const;
74 
76  void RunRealSimulator (void);
77 
78 protected:
79  void DoDispose ();
80  void NotifyConstructionCompleted (void);
81 
82 private:
86 
87 };
88 
89 } // namespace ns3
90 
91 #endif /* DEFAULT_SIMULATOR_IMPL_H */
virtual EventId Schedule(Time const &delay, EventImpl *event)
Schedule a future event execution (in the same context).
void NotifyConstructionCompleted(void)
Notifier called once the ObjectBase is fully constructed.
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:102
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:73
virtual void Run(void)
Run the simulation.
void DoDispose()
Destructor implementation.
ObjectFactory m_simulatorImplFactory
simulator implementation factory
virtual void Remove(const EventId &id)
Remove an event from the event list.
virtual void SetScheduler(ObjectFactory schedulerFactory)
Set the Scheduler to be used to manage the event list.
A replacement simulator that starts the visualizer.
virtual void ScheduleWithContext(uint32_t context, Time const &delay, EventImpl *event)
Schedule a future event execution (in a different context).
virtual bool IsFinished(void) const
Check if the simulation should finish.
virtual void Stop(void)
Tell the Simulator the calling event should be the last one executed.
virtual Time GetMaximumSimulationTime(void) const
Get the maximum representable simulation time.
virtual Time GetDelayLeft(const EventId &id) const
Get the remaining time until this event will execute.
virtual bool IsExpired(const EventId &id) const
Check if an event has already run or been cancelled.
virtual void Destroy()
Execute the events scheduled with ScheduleDestroy().
virtual EventId ScheduleNow(EventImpl *event)
Schedule an event to run at the current virtual time.
Ptr< SimulatorImpl > m_simulator
the simulator implementation
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void RunRealSimulator(void)
calls Run() in the wrapped simulator
Instantiate subclasses of ns3::Object.
A simulation event.
Definition: event-impl.h:44
An identifier for simulation events.
Definition: event-id.h:53
virtual uint32_t GetSystemId(void) const
Get the system id of this simulator.
virtual void Cancel(const EventId &id)
Set the cancel bit on this event: the event's associated function will not be invoked when it expires...
virtual Time Now(void) const
Return the current simulation virtual time.
a unique identifier for an interface.
Definition: type-id.h:58
virtual uint32_t GetContext(void) const
Get the current simulation context.
virtual EventId ScheduleDestroy(EventImpl *event)
Schedule an event to run at the end of the simulation, after the Stop() time or condition has been re...
static TypeId GetTypeId(void)
Get the type ID.
The SimulatorImpl base class.
Ptr< SimulatorImpl > GetSim()
get the simulator implementation