author | Mitch Watrous <watrous@u.washington.edu> |
Wed, 18 May 2011 17:24:04 -0700 | |
changeset 7241 | 0a7a16b599e8 |
parent 7194 | d57648faced2 |
child 7799 | 3bed76b33779 |
permissions | -rw-r--r-- |
6676
8a57344a8d09
Codereview Issue 2692041: Add pyviz module
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
1 |
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
8a57344a8d09
Codereview Issue 2692041: Add pyviz module
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
2 |
/* |
8a57344a8d09
Codereview Issue 2692041: Add pyviz module
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
3 |
* Copyright (c) 2010 Gustavo Carneiro |
8a57344a8d09
Codereview Issue 2692041: Add pyviz module
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
4 |
* |
8a57344a8d09
Codereview Issue 2692041: Add pyviz module
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
5 |
* This program is free software; you can redistribute it and/or modify |
8a57344a8d09
Codereview Issue 2692041: Add pyviz module
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
6 |
* it under the terms of the GNU General Public License version 2 as |
8a57344a8d09
Codereview Issue 2692041: Add pyviz module
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation; |
8a57344a8d09
Codereview Issue 2692041: Add pyviz module
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
8 |
* |
8a57344a8d09
Codereview Issue 2692041: Add pyviz module
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
9 |
* This program is distributed in the hope that it will be useful, |
8a57344a8d09
Codereview Issue 2692041: Add pyviz module
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
8a57344a8d09
Codereview Issue 2692041: Add pyviz module
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
8a57344a8d09
Codereview Issue 2692041: Add pyviz module
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
12 |
* GNU General Public License for more details. |
8a57344a8d09
Codereview Issue 2692041: Add pyviz module
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
13 |
* |
8a57344a8d09
Codereview Issue 2692041: Add pyviz module
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
14 |
* You should have received a copy of the GNU General Public License |
8a57344a8d09
Codereview Issue 2692041: Add pyviz module
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
15 |
* along with this program; if not, write to the Free Software |
8a57344a8d09
Codereview Issue 2692041: Add pyviz module
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
16 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
8a57344a8d09
Codereview Issue 2692041: Add pyviz module
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
17 |
* |
8a57344a8d09
Codereview Issue 2692041: Add pyviz module
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
18 |
* Author: Gustavo Carneiro <gjcarneiro@gmail.com> |
8a57344a8d09
Codereview Issue 2692041: Add pyviz module
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
19 |
*/ |
8a57344a8d09
Codereview Issue 2692041: Add pyviz module
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
20 |
|
8a57344a8d09
Codereview Issue 2692041: Add pyviz module
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
21 |
#ifndef VISUAL_SIMULATOR_IMPL_H |
8a57344a8d09
Codereview Issue 2692041: Add pyviz module
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
22 |
#define VISUAL_SIMULATOR_IMPL_H |
8a57344a8d09
Codereview Issue 2692041: Add pyviz module
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
23 |
|
8a57344a8d09
Codereview Issue 2692041: Add pyviz module
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
24 |
#include "ns3/simulator-impl.h" |
8a57344a8d09
Codereview Issue 2692041: Add pyviz module
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
25 |
|
8a57344a8d09
Codereview Issue 2692041: Add pyviz module
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
26 |
namespace ns3 { |
8a57344a8d09
Codereview Issue 2692041: Add pyviz module
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
27 |
|
7194
d57648faced2
visualizer coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6946
diff
changeset
|
28 |
|
6676
8a57344a8d09
Codereview Issue 2692041: Add pyviz module
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
29 |
/** |
7241
0a7a16b599e8
Make some more modules show up on doxygen modules page
Mitch Watrous <watrous@u.washington.edu>
parents:
7194
diff
changeset
|
30 |
* \defgroup visualizer Visualizer |
0a7a16b599e8
Make some more modules show up on doxygen modules page
Mitch Watrous <watrous@u.washington.edu>
parents:
7194
diff
changeset
|
31 |
* |
0a7a16b599e8
Make some more modules show up on doxygen modules page
Mitch Watrous <watrous@u.washington.edu>
parents:
7194
diff
changeset
|
32 |
*/ |
0a7a16b599e8
Make some more modules show up on doxygen modules page
Mitch Watrous <watrous@u.washington.edu>
parents:
7194
diff
changeset
|
33 |
|
0a7a16b599e8
Make some more modules show up on doxygen modules page
Mitch Watrous <watrous@u.washington.edu>
parents:
7194
diff
changeset
|
34 |
/** |
0a7a16b599e8
Make some more modules show up on doxygen modules page
Mitch Watrous <watrous@u.washington.edu>
parents:
7194
diff
changeset
|
35 |
* \ingroup visualizer |
0a7a16b599e8
Make some more modules show up on doxygen modules page
Mitch Watrous <watrous@u.washington.edu>
parents:
7194
diff
changeset
|
36 |
* |
6676
8a57344a8d09
Codereview Issue 2692041: Add pyviz module
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
37 |
* \brief A replacement simulator that starts the visualizer |
8a57344a8d09
Codereview Issue 2692041: Add pyviz module
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
38 |
* \internal |
8a57344a8d09
Codereview Issue 2692041: Add pyviz module
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
39 |
* |
8a57344a8d09
Codereview Issue 2692041: Add pyviz module
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
40 |
* To use this class, run any ns-3 simulation with the command-line |
8a57344a8d09
Codereview Issue 2692041: Add pyviz module
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
41 |
* argument --SimulatorImplementationType=ns3::VisualSimulatorImpl. |
8a57344a8d09
Codereview Issue 2692041: Add pyviz module
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
42 |
* This causes the visualizer (PyViz) to start automatically. |
8a57344a8d09
Codereview Issue 2692041: Add pyviz module
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
43 |
**/ |
8a57344a8d09
Codereview Issue 2692041: Add pyviz module
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
44 |
class VisualSimulatorImpl : public SimulatorImpl |
8a57344a8d09
Codereview Issue 2692041: Add pyviz module
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
45 |
{ |
8a57344a8d09
Codereview Issue 2692041: Add pyviz module
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
46 |
public: |
8a57344a8d09
Codereview Issue 2692041: Add pyviz module
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
47 |
static TypeId GetTypeId (void); |
8a57344a8d09
Codereview Issue 2692041: Add pyviz module
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
48 |
|
8a57344a8d09
Codereview Issue 2692041: Add pyviz module
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
49 |
VisualSimulatorImpl (); |
8a57344a8d09
Codereview Issue 2692041: Add pyviz module
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
50 |
~VisualSimulatorImpl (); |
8a57344a8d09
Codereview Issue 2692041: Add pyviz module
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
51 |
|
8a57344a8d09
Codereview Issue 2692041: Add pyviz module
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
52 |
virtual void Destroy (); |
8a57344a8d09
Codereview Issue 2692041: Add pyviz module
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
53 |
virtual bool IsFinished (void) const; |
8a57344a8d09
Codereview Issue 2692041: Add pyviz module
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
54 |
virtual Time Next (void) const; |
8a57344a8d09
Codereview Issue 2692041: Add pyviz module
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
55 |
virtual void Stop (void); |
8a57344a8d09
Codereview Issue 2692041: Add pyviz module
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
56 |
virtual void Stop (Time const &time); |
8a57344a8d09
Codereview Issue 2692041: Add pyviz module
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
57 |
virtual EventId Schedule (Time const &time, EventImpl *event); |
8a57344a8d09
Codereview Issue 2692041: Add pyviz module
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
58 |
virtual void ScheduleWithContext (uint32_t context, Time const &time, EventImpl *event); |
8a57344a8d09
Codereview Issue 2692041: Add pyviz module
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
59 |
virtual EventId ScheduleNow (EventImpl *event); |
8a57344a8d09
Codereview Issue 2692041: Add pyviz module
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
60 |
virtual EventId ScheduleDestroy (EventImpl *event); |
8a57344a8d09
Codereview Issue 2692041: Add pyviz module
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
61 |
virtual void Remove (const EventId &ev); |
8a57344a8d09
Codereview Issue 2692041: Add pyviz module
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
62 |
virtual void Cancel (const EventId &ev); |
8a57344a8d09
Codereview Issue 2692041: Add pyviz module
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
63 |
virtual bool IsExpired (const EventId &ev) const; |
8a57344a8d09
Codereview Issue 2692041: Add pyviz module
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
64 |
virtual void Run (void); |
8a57344a8d09
Codereview Issue 2692041: Add pyviz module
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
65 |
virtual void RunOneEvent (void); |
8a57344a8d09
Codereview Issue 2692041: Add pyviz module
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
66 |
virtual Time Now (void) const; |
8a57344a8d09
Codereview Issue 2692041: Add pyviz module
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
67 |
virtual Time GetDelayLeft (const EventId &id) const; |
8a57344a8d09
Codereview Issue 2692041: Add pyviz module
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
68 |
virtual Time GetMaximumSimulationTime (void) const; |
8a57344a8d09
Codereview Issue 2692041: Add pyviz module
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
69 |
virtual void SetScheduler (ObjectFactory schedulerFactory); |
8a57344a8d09
Codereview Issue 2692041: Add pyviz module
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
70 |
virtual uint32_t GetSystemId (void) const; |
8a57344a8d09
Codereview Issue 2692041: Add pyviz module
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
71 |
virtual uint32_t GetContext (void) const; |
8a57344a8d09
Codereview Issue 2692041: Add pyviz module
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
72 |
|
8a57344a8d09
Codereview Issue 2692041: Add pyviz module
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
73 |
/// calls Run() in the wrapped simulator |
8a57344a8d09
Codereview Issue 2692041: Add pyviz module
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
74 |
void RunRealSimulator (void); |
8a57344a8d09
Codereview Issue 2692041: Add pyviz module
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
75 |
|
8a57344a8d09
Codereview Issue 2692041: Add pyviz module
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
76 |
protected: |
8a57344a8d09
Codereview Issue 2692041: Add pyviz module
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
77 |
void DoDispose (); |
8a57344a8d09
Codereview Issue 2692041: Add pyviz module
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
78 |
void NotifyConstructionCompleted (void); |
7194
d57648faced2
visualizer coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6946
diff
changeset
|
79 |
|
6676
8a57344a8d09
Codereview Issue 2692041: Add pyviz module
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
80 |
private: |
8a57344a8d09
Codereview Issue 2692041: Add pyviz module
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
81 |
Ptr<SimulatorImpl> GetSim (); |
8a57344a8d09
Codereview Issue 2692041: Add pyviz module
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
82 |
Ptr<SimulatorImpl> m_simulator; |
8a57344a8d09
Codereview Issue 2692041: Add pyviz module
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
83 |
ObjectFactory m_simulatorImplFactory; |
8a57344a8d09
Codereview Issue 2692041: Add pyviz module
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
84 |
|
8a57344a8d09
Codereview Issue 2692041: Add pyviz module
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
85 |
}; |
8a57344a8d09
Codereview Issue 2692041: Add pyviz module
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
86 |
|
8a57344a8d09
Codereview Issue 2692041: Add pyviz module
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
87 |
} // namespace ns3 |
8a57344a8d09
Codereview Issue 2692041: Add pyviz module
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
88 |
|
8a57344a8d09
Codereview Issue 2692041: Add pyviz module
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
89 |
#endif /* DEFAULT_SIMULATOR_IMPL_H */ |