OLD | NEW |
(Empty) | |
| 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 ·· |
| 29 /** |
| 30 * \brief A replacement simulator that starts the visualizer |
| 31 * \internal |
| 32 * |
| 33 * To use this class, run any ns-3 simulation with the command-line |
| 34 * argument --SimulatorImplementationType=ns3::VisualSimulatorImpl. |
| 35 * This causes the visualizer (PyViz) to start automatically. |
| 36 **/ |
| 37 class VisualSimulatorImpl : public SimulatorImpl |
| 38 { |
| 39 public: |
| 40 static TypeId GetTypeId (void); |
| 41 |
| 42 VisualSimulatorImpl (); |
| 43 ~VisualSimulatorImpl (); |
| 44 |
| 45 virtual void Destroy (); |
| 46 virtual bool IsFinished (void) const; |
| 47 virtual Time Next (void) const; |
| 48 virtual void Stop (void); |
| 49 virtual void Stop (Time const &time); |
| 50 virtual EventId Schedule (Time const &time, EventImpl *event); |
| 51 virtual void ScheduleWithContext (uint32_t context, Time const &time, EventImp
l *event); |
| 52 virtual EventId ScheduleNow (EventImpl *event); |
| 53 virtual EventId ScheduleDestroy (EventImpl *event); |
| 54 virtual void Remove (const EventId &ev); |
| 55 virtual void Cancel (const EventId &ev); |
| 56 virtual bool IsExpired (const EventId &ev) const; |
| 57 virtual void Run (void); |
| 58 virtual void RunOneEvent (void); |
| 59 virtual Time Now (void) const; |
| 60 virtual Time GetDelayLeft (const EventId &id) const; |
| 61 virtual Time GetMaximumSimulationTime (void) const; |
| 62 virtual void SetScheduler (ObjectFactory schedulerFactory); |
| 63 virtual uint32_t GetSystemId (void) const;· |
| 64 virtual uint32_t GetContext (void) const; |
| 65 |
| 66 /// calls Run() in the wrapped simulator |
| 67 void RunRealSimulator (void); |
| 68 |
| 69 protected: |
| 70 void DoDispose (); |
| 71 void NotifyConstructionCompleted (void); |
| 72 ·· |
| 73 private: |
| 74 Ptr<SimulatorImpl> GetSim (); |
| 75 Ptr<SimulatorImpl> m_simulator; |
| 76 ObjectFactory m_simulatorImplFactory; |
| 77 |
| 78 }; |
| 79 |
| 80 } // namespace ns3 |
| 81 |
| 82 #endif /* DEFAULT_SIMULATOR_IMPL_H */ |
OLD | NEW |