A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
visual-simulator-impl.h
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:
47  static TypeId GetTypeId (void);
48 
51 
52  virtual void Destroy ();
53  virtual bool IsFinished (void) const;
54  virtual void Stop (void);
55  virtual void Stop (Time const &time);
56  virtual EventId Schedule (Time const &time, EventImpl *event);
57  virtual void ScheduleWithContext (uint32_t context, Time const &time, EventImpl *event);
58  virtual EventId ScheduleNow (EventImpl *event);
59  virtual EventId ScheduleDestroy (EventImpl *event);
60  virtual void Remove (const EventId &ev);
61  virtual void Cancel (const EventId &ev);
62  virtual bool IsExpired (const EventId &ev) const;
63  virtual void Run (void);
64  virtual Time Now (void) const;
65  virtual Time GetDelayLeft (const EventId &id) const;
66  virtual Time GetMaximumSimulationTime (void) const;
67  virtual void SetScheduler (ObjectFactory schedulerFactory);
68  virtual uint32_t GetSystemId (void) const;
69  virtual uint32_t GetContext (void) const;
70 
72  void RunRealSimulator (void);
73 
74 protected:
75  void DoDispose ();
76  void NotifyConstructionCompleted (void);
77 
78 private:
79  Ptr<SimulatorImpl> GetSim ();
80  Ptr<SimulatorImpl> m_simulator;
81  ObjectFactory m_simulatorImplFactory;
82 
83 };
84 
85 } // namespace ns3
86 
87 #endif /* DEFAULT_SIMULATOR_IMPL_H */
keep track of time unit.
Definition: nstime.h:149
smart pointer class similar to boost::intrusive_ptr
Definition: ptr.h:59
virtual void ScheduleWithContext(uint32_t context, Time const &time, EventImpl *event)
virtual void SetScheduler(ObjectFactory schedulerFactory)
A replacement simulator that starts the visualizer.
virtual void Cancel(const EventId &ev)
virtual bool IsFinished(void) const
virtual Time GetMaximumSimulationTime(void) const
virtual EventId Schedule(Time const &time, EventImpl *event)
virtual void Remove(const EventId &ev)
virtual Time GetDelayLeft(const EventId &id) const
virtual EventId ScheduleNow(EventImpl *event)
void RunRealSimulator(void)
calls Run() in the wrapped simulator
instantiate subclasses of ns3::Object.
a simulation event
Definition: event-impl.h:39
an identifier for simulation events.
Definition: event-id.h:46
virtual bool IsExpired(const EventId &ev) const
virtual uint32_t GetSystemId(void) const
virtual Time Now(void) const
a unique identifier for an interface.
Definition: type-id.h:44
virtual uint32_t GetContext(void) const
virtual EventId ScheduleDestroy(EventImpl *event)