author | John Abraham <john.abraham@gatech.edu> |
Wed, 07 Sep 2011 10:40:15 -0400 | |
changeset 7476 | 2761997c72b2 |
parent 7454 | e1bbc514be33 |
child 7484 | cd2d8cd79237 |
permissions | -rw-r--r-- |
5776 | 1 |
/* |
2 |
* This program is free software; you can redistribute it and/or modify |
|
3 |
* it under the terms of the GNU General Public License version 2 as |
|
4 |
* published by the Free Software Foundation; |
|
5 |
* |
|
6 |
* This program is distributed in the hope that it will be useful, |
|
7 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
8 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
9 |
* GNU General Public License for more details. |
|
10 |
* |
|
11 |
* You should have received a copy of the GNU General Public License |
|
12 |
* along with this program; if not, write to the Free Software |
|
13 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
14 |
* |
|
15 |
* Author: George F. Riley<riley@ece.gatech.edu> |
|
7360
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
16 |
* Modified by: John Abraham <john.abraham@gatech.edu> |
5776 | 17 |
*/ |
18 |
||
19 |
// Interface between ns3 and the network animator |
|
20 |
||
21 |
#ifndef ANIMATION_INTERFACE__H |
|
22 |
#define ANIMATION_INTERFACE__H |
|
23 |
||
24 |
#include <string> |
|
7360
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
25 |
#include <stdio.h> |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
26 |
#include <map> |
5776 | 27 |
#include "ns3/ptr.h" |
28 |
#include "ns3/net-device.h" |
|
29 |
#include "ns3/nstime.h" |
|
30 |
#include "ns3/log.h" |
|
31 |
#include "ns3/node-list.h" |
|
7360
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
32 |
#include "ns3/simulator.h" |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
33 |
#include "ns3/config.h" |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
34 |
#include "ns3/animation-interface-helper.h" |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
35 |
#include "ns3/mac48-address.h" |
5776 | 36 |
|
37 |
namespace ns3 { |
|
7241
0a7a16b599e8
Make some more modules show up on doxygen modules page
Mitch Watrous <watrous@u.washington.edu>
parents:
7181
diff
changeset
|
38 |
|
5776 | 39 |
/** |
7271
73bb230b6d6c
organize doxygen modules alphabetically
Tom Henderson <tomh@tomh.org>
parents:
7243
diff
changeset
|
40 |
* \defgroup netanim Netanim |
73bb230b6d6c
organize doxygen modules alphabetically
Tom Henderson <tomh@tomh.org>
parents:
7243
diff
changeset
|
41 |
* |
73bb230b6d6c
organize doxygen modules alphabetically
Tom Henderson <tomh@tomh.org>
parents:
7243
diff
changeset
|
42 |
* This section documents the API of the ns-3 netanim module. For a generic functional description, please refer to the ns-3 manual. |
73bb230b6d6c
organize doxygen modules alphabetically
Tom Henderson <tomh@tomh.org>
parents:
7243
diff
changeset
|
43 |
*/ |
73bb230b6d6c
organize doxygen modules alphabetically
Tom Henderson <tomh@tomh.org>
parents:
7243
diff
changeset
|
44 |
|
73bb230b6d6c
organize doxygen modules alphabetically
Tom Henderson <tomh@tomh.org>
parents:
7243
diff
changeset
|
45 |
/** |
7241
0a7a16b599e8
Make some more modules show up on doxygen modules page
Mitch Watrous <watrous@u.washington.edu>
parents:
7181
diff
changeset
|
46 |
* \ingroup netanim |
0a7a16b599e8
Make some more modules show up on doxygen modules page
Mitch Watrous <watrous@u.washington.edu>
parents:
7181
diff
changeset
|
47 |
* |
5776 | 48 |
* \brief Interface to network animator |
49 |
* |
|
50 |
* Provides functions that facilitate communications with an |
|
51 |
* external or internal network animator. |
|
52 |
*/ |
|
53 |
class AnimationInterface |
|
54 |
{ |
|
55 |
public: |
|
7360
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
56 |
|
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
57 |
/** |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
58 |
* \brief Construct the animator interface. No arguments needed. |
7362
36b42a8b16d1
Bug 1172 Special case handling for duplicates,forwards and some doxygen fixes
John Abraham <john.abraham@gatech.edu>
parents:
7360
diff
changeset
|
59 |
* |
7360
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
60 |
*/ |
5776 | 61 |
AnimationInterface (); |
7360
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
62 |
|
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
63 |
/** |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
64 |
* \brief Destructor for the animator interface. |
7362
36b42a8b16d1
Bug 1172 Special case handling for duplicates,forwards and some doxygen fixes
John Abraham <john.abraham@gatech.edu>
parents:
7360
diff
changeset
|
65 |
* |
7360
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
66 |
*/ |
5776 | 67 |
~AnimationInterface (); |
7360
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
68 |
|
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
69 |
/** |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
70 |
* \brief Constructor |
7362
36b42a8b16d1
Bug 1172 Special case handling for duplicates,forwards and some doxygen fixes
John Abraham <john.abraham@gatech.edu>
parents:
7360
diff
changeset
|
71 |
* \param filename The Filename for the trace file used by the Animator |
36b42a8b16d1
Bug 1172 Special case handling for duplicates,forwards and some doxygen fixes
John Abraham <john.abraham@gatech.edu>
parents:
7360
diff
changeset
|
72 |
* \param usingXML Set to true if XML output traces are required |
7360
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
73 |
* |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
74 |
*/ |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
75 |
AnimationInterface (const std::string filename, bool usingXML = true); |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
76 |
|
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
77 |
/** |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
78 |
* \brief Constructor |
7362
36b42a8b16d1
Bug 1172 Special case handling for duplicates,forwards and some doxygen fixes
John Abraham <john.abraham@gatech.edu>
parents:
7360
diff
changeset
|
79 |
* \param port Port on which ns-3 should listen to for connection from the |
7360
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
80 |
* external netanim application |
7362
36b42a8b16d1
Bug 1172 Special case handling for duplicates,forwards and some doxygen fixes
John Abraham <john.abraham@gatech.edu>
parents:
7360
diff
changeset
|
81 |
* \param usingXML Set to true if XML output traces are required |
7360
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
82 |
* |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
83 |
*/ |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
84 |
AnimationInterface (uint16_t port, bool usingXML = true); |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
85 |
|
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
86 |
/** |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
87 |
* \brief Specify that animation commands are to be written |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
88 |
* to the specified output file. |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
89 |
* |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
90 |
* This call is used to write the animation information to a text |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
91 |
* file that can later be used as input to the network animator tool. |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
92 |
* |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
93 |
* \param fn The name of the output file. |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
94 |
* \returns true if successful open. |
7362
36b42a8b16d1
Bug 1172 Special case handling for duplicates,forwards and some doxygen fixes
John Abraham <john.abraham@gatech.edu>
parents:
7360
diff
changeset
|
95 |
* |
7360
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
96 |
*/ |
5776 | 97 |
bool SetOutputFile (const std::string& fn); |
98 |
||
7360
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
99 |
/** |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
100 |
* \brief Specify that animation commands are to be written |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
101 |
* in XML format. |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
102 |
* |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
103 |
* \returns none |
7362
36b42a8b16d1
Bug 1172 Special case handling for duplicates,forwards and some doxygen fixes
John Abraham <john.abraham@gatech.edu>
parents:
7360
diff
changeset
|
104 |
* |
7360
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
105 |
*/ |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
106 |
void SetXMLOutput (); |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
107 |
|
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
108 |
/** |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
109 |
* \brief Specify that animation commands are to be written to |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
110 |
* a socket. |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
111 |
* |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
112 |
* This call is used to set the ns3 process in server mode, waiting |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
113 |
* for a TCP connection from the animator. This call will not |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
114 |
* return until the animator connects in, or if the bind to the |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
115 |
* specified port fails. |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
116 |
* |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
117 |
* \param port Port number to bind to. |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
118 |
* \returns true if connection created, false if bind failed. |
7362
36b42a8b16d1
Bug 1172 Special case handling for duplicates,forwards and some doxygen fixes
John Abraham <john.abraham@gatech.edu>
parents:
7360
diff
changeset
|
119 |
* |
7360
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
120 |
*/ |
5776 | 121 |
bool SetServerPort (uint16_t port); |
122 |
||
7360
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
123 |
/** |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
124 |
* \brief Writes the topology information and sets up the appropriate |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
125 |
* animation packet tx callback |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
126 |
* |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
127 |
* Writes the topology information to the appropriate output, depending |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
128 |
* on prior calls to SetOutputFile, SetServerPort, or SetInternalAnimation. |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
129 |
* Then creates the callbacks needed for the animator to start processing |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
130 |
* packets. |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
131 |
* |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
132 |
*/ |
5776 | 133 |
void StartAnimation (); |
134 |
||
7360
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
135 |
/** |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
136 |
* \brief Closes the interface to the animator. |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
137 |
* |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
138 |
*/ |
5776 | 139 |
void StopAnimation (); |
140 |
||
7360
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
141 |
/** |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
142 |
* \brief Set mobility poll interval:WARNING: setting a low interval can |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
143 |
* cause slowness |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
144 |
* |
7362
36b42a8b16d1
Bug 1172 Special case handling for duplicates,forwards and some doxygen fixes
John Abraham <john.abraham@gatech.edu>
parents:
7360
diff
changeset
|
145 |
* \param t Time interval between fetching mobility/position information |
7360
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
146 |
* Default: 0.25s |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
147 |
* |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
148 |
*/ |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
149 |
void SetMobilityPollInterval (Time t); |
5776 | 150 |
|
7454
e1bbc514be33
NetAnim: Simple Write callback
John Abraham <john.abraham@gatech.edu>
parents:
7362
diff
changeset
|
151 |
/** |
7476
2761997c72b2
NetAnim: Set a random position if mobility model does not exist
John Abraham <john.abraham@gatech.edu>
parents:
7454
diff
changeset
|
152 |
* \brief Set random position if a Mobility Model does not exists for the node |
2761997c72b2
NetAnim: Set a random position if mobility model does not exist
John Abraham <john.abraham@gatech.edu>
parents:
7454
diff
changeset
|
153 |
* |
2761997c72b2
NetAnim: Set a random position if mobility model does not exist
John Abraham <john.abraham@gatech.edu>
parents:
7454
diff
changeset
|
154 |
* \param setRandPos True if a random position can be set for a node without a |
2761997c72b2
NetAnim: Set a random position if mobility model does not exist
John Abraham <john.abraham@gatech.edu>
parents:
7454
diff
changeset
|
155 |
* Mobililty model |
2761997c72b2
NetAnim: Set a random position if mobility model does not exist
John Abraham <john.abraham@gatech.edu>
parents:
7454
diff
changeset
|
156 |
* |
2761997c72b2
NetAnim: Set a random position if mobility model does not exist
John Abraham <john.abraham@gatech.edu>
parents:
7454
diff
changeset
|
157 |
*/ |
2761997c72b2
NetAnim: Set a random position if mobility model does not exist
John Abraham <john.abraham@gatech.edu>
parents:
7454
diff
changeset
|
158 |
void SetRandomPosition (bool setRandPos); |
2761997c72b2
NetAnim: Set a random position if mobility model does not exist
John Abraham <john.abraham@gatech.edu>
parents:
7454
diff
changeset
|
159 |
|
2761997c72b2
NetAnim: Set a random position if mobility model does not exist
John Abraham <john.abraham@gatech.edu>
parents:
7454
diff
changeset
|
160 |
/** |
7454
e1bbc514be33
NetAnim: Simple Write callback
John Abraham <john.abraham@gatech.edu>
parents:
7362
diff
changeset
|
161 |
* \brief typedef for WriteCallBack used for listening to AnimationInterface |
e1bbc514be33
NetAnim: Simple Write callback
John Abraham <john.abraham@gatech.edu>
parents:
7362
diff
changeset
|
162 |
* write messages |
e1bbc514be33
NetAnim: Simple Write callback
John Abraham <john.abraham@gatech.edu>
parents:
7362
diff
changeset
|
163 |
* |
e1bbc514be33
NetAnim: Simple Write callback
John Abraham <john.abraham@gatech.edu>
parents:
7362
diff
changeset
|
164 |
*/ |
e1bbc514be33
NetAnim: Simple Write callback
John Abraham <john.abraham@gatech.edu>
parents:
7362
diff
changeset
|
165 |
typedef void (*AnimWriteCallback) (const char * str); |
e1bbc514be33
NetAnim: Simple Write callback
John Abraham <john.abraham@gatech.edu>
parents:
7362
diff
changeset
|
166 |
|
e1bbc514be33
NetAnim: Simple Write callback
John Abraham <john.abraham@gatech.edu>
parents:
7362
diff
changeset
|
167 |
/** |
e1bbc514be33
NetAnim: Simple Write callback
John Abraham <john.abraham@gatech.edu>
parents:
7362
diff
changeset
|
168 |
* \brief Set a callback function to listen to AnimationInterface write events |
e1bbc514be33
NetAnim: Simple Write callback
John Abraham <john.abraham@gatech.edu>
parents:
7362
diff
changeset
|
169 |
* |
e1bbc514be33
NetAnim: Simple Write callback
John Abraham <john.abraham@gatech.edu>
parents:
7362
diff
changeset
|
170 |
* \param cb Address of callback function |
e1bbc514be33
NetAnim: Simple Write callback
John Abraham <john.abraham@gatech.edu>
parents:
7362
diff
changeset
|
171 |
* |
e1bbc514be33
NetAnim: Simple Write callback
John Abraham <john.abraham@gatech.edu>
parents:
7362
diff
changeset
|
172 |
*/ |
e1bbc514be33
NetAnim: Simple Write callback
John Abraham <john.abraham@gatech.edu>
parents:
7362
diff
changeset
|
173 |
void SetAnimWriteCallback (AnimWriteCallback cb); |
e1bbc514be33
NetAnim: Simple Write callback
John Abraham <john.abraham@gatech.edu>
parents:
7362
diff
changeset
|
174 |
|
e1bbc514be33
NetAnim: Simple Write callback
John Abraham <john.abraham@gatech.edu>
parents:
7362
diff
changeset
|
175 |
/** |
e1bbc514be33
NetAnim: Simple Write callback
John Abraham <john.abraham@gatech.edu>
parents:
7362
diff
changeset
|
176 |
* \brief Reset the write callback function |
e1bbc514be33
NetAnim: Simple Write callback
John Abraham <john.abraham@gatech.edu>
parents:
7362
diff
changeset
|
177 |
* |
e1bbc514be33
NetAnim: Simple Write callback
John Abraham <john.abraham@gatech.edu>
parents:
7362
diff
changeset
|
178 |
*/ |
e1bbc514be33
NetAnim: Simple Write callback
John Abraham <john.abraham@gatech.edu>
parents:
7362
diff
changeset
|
179 |
void ResetAnimWriteCallback (); |
e1bbc514be33
NetAnim: Simple Write callback
John Abraham <john.abraham@gatech.edu>
parents:
7362
diff
changeset
|
180 |
|
5776 | 181 |
private: |
7362
36b42a8b16d1
Bug 1172 Special case handling for duplicates,forwards and some doxygen fixes
John Abraham <john.abraham@gatech.edu>
parents:
7360
diff
changeset
|
182 |
|
7360
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
183 |
int m_fHandle; // File handle for output (-1 if none) |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
184 |
bool m_xml; // True if xml format desired |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
185 |
Time mobilitypollinterval; |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
186 |
bool usingSockets; |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
187 |
uint16_t mport; |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
188 |
std::string outputfilename; |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
189 |
bool OutputFileSet; |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
190 |
bool ServerPortSet; |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
191 |
void DevTxTrace (std::string context, |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
192 |
Ptr<const Packet> p, |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
193 |
Ptr<NetDevice> tx, |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
194 |
Ptr<NetDevice> rx, |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
195 |
Time txTime, |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
196 |
Time rxTime); |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
197 |
void WifiPhyTxBeginTrace (std::string context, |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
198 |
Ptr<const Packet> p); |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
199 |
void WifiPhyTxEndTrace (std::string context, |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
200 |
Ptr<const Packet> p); |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
201 |
void WifiPhyTxDropTrace (std::string context, |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
202 |
Ptr<const Packet> p); |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
203 |
void WifiPhyRxBeginTrace (std::string context, |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
204 |
Ptr<const Packet> p); |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
205 |
void WifiPhyRxEndTrace (std::string context, |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
206 |
Ptr<const Packet> p); |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
207 |
void WifiPhyRxDropTrace (std::string context, |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
208 |
Ptr<const Packet> p); |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
209 |
void WimaxTxTrace (std::string context, |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
210 |
Ptr<const Packet> p, |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
211 |
const Mac48Address &); |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
212 |
void WimaxRxTrace (std::string context, |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
213 |
Ptr<const Packet> p, |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
214 |
const Mac48Address &); |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
215 |
void MobilityCourseChangeTrace (Ptr <const MobilityModel> mob); |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
216 |
|
5776 | 217 |
// Write specified amount of data to the specified handle |
218 |
int WriteN (int, const char*, uint32_t); |
|
7360
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
219 |
|
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
220 |
// Write a string to the specified handle; |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
221 |
int WriteN (int, const std::string&); |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
222 |
|
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
223 |
//Helpers to output xml wireless packet |
7362
36b42a8b16d1
Bug 1172 Special case handling for duplicates,forwards and some doxygen fixes
John Abraham <john.abraham@gatech.edu>
parents:
7360
diff
changeset
|
224 |
void OutputWirelessPacket (AnimPacketInfo& pktInfo, AnimRxInfo pktrxInfo); |
7360
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
225 |
void MobilityAutoCheck (); |
7362
36b42a8b16d1
Bug 1172 Special case handling for duplicates,forwards and some doxygen fixes
John Abraham <john.abraham@gatech.edu>
parents:
7360
diff
changeset
|
226 |
|
36b42a8b16d1
Bug 1172 Special case handling for duplicates,forwards and some doxygen fixes
John Abraham <john.abraham@gatech.edu>
parents:
7360
diff
changeset
|
227 |
uint64_t gAnimUid ; // Packet unique identifier used by Animtion |
36b42a8b16d1
Bug 1172 Special case handling for duplicates,forwards and some doxygen fixes
John Abraham <john.abraham@gatech.edu>
parents:
7360
diff
changeset
|
228 |
|
7360
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
229 |
std::map<uint64_t, AnimPacketInfo> pendingWifiPackets; |
7362
36b42a8b16d1
Bug 1172 Special case handling for duplicates,forwards and some doxygen fixes
John Abraham <john.abraham@gatech.edu>
parents:
7360
diff
changeset
|
230 |
void AddPendingWifiPacket (uint64_t AnimUid, AnimPacketInfo&); |
36b42a8b16d1
Bug 1172 Special case handling for duplicates,forwards and some doxygen fixes
John Abraham <john.abraham@gatech.edu>
parents:
7360
diff
changeset
|
231 |
bool WifiPacketIsPending (uint64_t AnimUid); |
36b42a8b16d1
Bug 1172 Special case handling for duplicates,forwards and some doxygen fixes
John Abraham <john.abraham@gatech.edu>
parents:
7360
diff
changeset
|
232 |
|
7360
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
233 |
std::map<uint64_t, AnimPacketInfo> pendingWimaxPackets; |
7362
36b42a8b16d1
Bug 1172 Special case handling for duplicates,forwards and some doxygen fixes
John Abraham <john.abraham@gatech.edu>
parents:
7360
diff
changeset
|
234 |
void AddPendingWimaxPacket (uint64_t AnimUid, AnimPacketInfo&); |
36b42a8b16d1
Bug 1172 Special case handling for duplicates,forwards and some doxygen fixes
John Abraham <john.abraham@gatech.edu>
parents:
7360
diff
changeset
|
235 |
bool WimaxPacketIsPending (uint64_t AnimUid); |
36b42a8b16d1
Bug 1172 Special case handling for duplicates,forwards and some doxygen fixes
John Abraham <john.abraham@gatech.edu>
parents:
7360
diff
changeset
|
236 |
|
36b42a8b16d1
Bug 1172 Special case handling for duplicates,forwards and some doxygen fixes
John Abraham <john.abraham@gatech.edu>
parents:
7360
diff
changeset
|
237 |
uint64_t GetAnimUidFromPacket (Ptr <const Packet>); |
36b42a8b16d1
Bug 1172 Special case handling for duplicates,forwards and some doxygen fixes
John Abraham <john.abraham@gatech.edu>
parents:
7360
diff
changeset
|
238 |
|
7360
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
239 |
std::map<uint32_t, Vector> nodeLocation; |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
240 |
Vector GetPosition (Ptr <Node> n); |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
241 |
Vector UpdatePosition (Ptr <Node> n); |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
242 |
Vector UpdatePosition (Ptr <Node> n, Vector v); |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
243 |
void WriteDummyPacket (); |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
244 |
bool NodeHasMoved (Ptr <Node> n, Vector newLocation); |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
245 |
void AddMargin (); |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
246 |
|
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
247 |
// Recalculate topology bounds |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
248 |
void RecalcTopoBounds (Vector v); |
7362
36b42a8b16d1
Bug 1172 Special case handling for duplicates,forwards and some doxygen fixes
John Abraham <john.abraham@gatech.edu>
parents:
7360
diff
changeset
|
249 |
std::vector < Ptr <Node> > RecalcTopoBounds (); |
7360
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
250 |
|
7476
2761997c72b2
NetAnim: Set a random position if mobility model does not exist
John Abraham <john.abraham@gatech.edu>
parents:
7454
diff
changeset
|
251 |
bool randomPosition; |
7454
e1bbc514be33
NetAnim: Simple Write callback
John Abraham <john.abraham@gatech.edu>
parents:
7362
diff
changeset
|
252 |
AnimWriteCallback m_writeCallback; |
e1bbc514be33
NetAnim: Simple Write callback
John Abraham <john.abraham@gatech.edu>
parents:
7362
diff
changeset
|
253 |
|
7360
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
254 |
// Path helper |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
255 |
std::vector<std::string> GetElementsFromContext (std::string context); |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
256 |
Ptr <NetDevice> GetNetDeviceFromContext (std::string context); |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
257 |
|
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
258 |
// XML helpers |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
259 |
std::string GetPreamble (void); |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
260 |
// Topology element dimensions |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
261 |
double topo_minX; |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
262 |
double topo_minY; |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
263 |
double topo_maxX; |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
264 |
double topo_maxY; |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
265 |
|
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
266 |
std::string GetXMLOpen_anim (uint32_t lp); |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
267 |
std::string GetXMLOpen_topology (double minX,double minY,double maxX,double maxY); |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
268 |
std::string GetXMLOpenClose_node (uint32_t lp,uint32_t id,double locX,double locY); |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
269 |
std::string GetXMLOpenClose_link (uint32_t fromLp,uint32_t fromId, uint32_t toLp, uint32_t toId); |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
270 |
std::string GetXMLOpen_packet (uint32_t fromLp,uint32_t fromId, double fbTx, double lbTx); |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
271 |
std::string GetXMLOpenClose_rx (uint32_t toLp, uint32_t toId, double fbRx, double lbRx); |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
272 |
std::string GetXMLOpen_wpacket (uint32_t fromLp,uint32_t fromId, double fbTx, double lbTx, double range); |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
273 |
std::string GetXMLClose (std::string name) {return "</" + name + ">\n"; } |
5949904cf955
Bug 1172 Implement trivial XML output feature for Animation Interface
John Abraham <john.abraham@gatech.edu>
parents:
7271
diff
changeset
|
274 |
|
5776 | 275 |
}; |
7362
36b42a8b16d1
Bug 1172 Special case handling for duplicates,forwards and some doxygen fixes
John Abraham <john.abraham@gatech.edu>
parents:
7360
diff
changeset
|
276 |
|
36b42a8b16d1
Bug 1172 Special case handling for duplicates,forwards and some doxygen fixes
John Abraham <john.abraham@gatech.edu>
parents:
7360
diff
changeset
|
277 |
/** |
36b42a8b16d1
Bug 1172 Special case handling for duplicates,forwards and some doxygen fixes
John Abraham <john.abraham@gatech.edu>
parents:
7360
diff
changeset
|
278 |
* \ingroup netanim |
36b42a8b16d1
Bug 1172 Special case handling for duplicates,forwards and some doxygen fixes
John Abraham <john.abraham@gatech.edu>
parents:
7360
diff
changeset
|
279 |
* |
36b42a8b16d1
Bug 1172 Special case handling for duplicates,forwards and some doxygen fixes
John Abraham <john.abraham@gatech.edu>
parents:
7360
diff
changeset
|
280 |
* \brief Byte tag using by Anim to uniquely identify packets |
36b42a8b16d1
Bug 1172 Special case handling for duplicates,forwards and some doxygen fixes
John Abraham <john.abraham@gatech.edu>
parents:
7360
diff
changeset
|
281 |
* |
36b42a8b16d1
Bug 1172 Special case handling for duplicates,forwards and some doxygen fixes
John Abraham <john.abraham@gatech.edu>
parents:
7360
diff
changeset
|
282 |
* When Anim receives a Tx Notification we tag the packet with a unique global uint64_t identifier |
36b42a8b16d1
Bug 1172 Special case handling for duplicates,forwards and some doxygen fixes
John Abraham <john.abraham@gatech.edu>
parents:
7360
diff
changeset
|
283 |
* before recording Tx information |
36b42a8b16d1
Bug 1172 Special case handling for duplicates,forwards and some doxygen fixes
John Abraham <john.abraham@gatech.edu>
parents:
7360
diff
changeset
|
284 |
* When Anim receives Rx notifications the tag is used to retrieve Tx information recorded earlier |
36b42a8b16d1
Bug 1172 Special case handling for duplicates,forwards and some doxygen fixes
John Abraham <john.abraham@gatech.edu>
parents:
7360
diff
changeset
|
285 |
* |
36b42a8b16d1
Bug 1172 Special case handling for duplicates,forwards and some doxygen fixes
John Abraham <john.abraham@gatech.edu>
parents:
7360
diff
changeset
|
286 |
*/ |
36b42a8b16d1
Bug 1172 Special case handling for duplicates,forwards and some doxygen fixes
John Abraham <john.abraham@gatech.edu>
parents:
7360
diff
changeset
|
287 |
|
36b42a8b16d1
Bug 1172 Special case handling for duplicates,forwards and some doxygen fixes
John Abraham <john.abraham@gatech.edu>
parents:
7360
diff
changeset
|
288 |
class AnimByteTag : public Tag |
36b42a8b16d1
Bug 1172 Special case handling for duplicates,forwards and some doxygen fixes
John Abraham <john.abraham@gatech.edu>
parents:
7360
diff
changeset
|
289 |
{ |
36b42a8b16d1
Bug 1172 Special case handling for duplicates,forwards and some doxygen fixes
John Abraham <john.abraham@gatech.edu>
parents:
7360
diff
changeset
|
290 |
public: |
36b42a8b16d1
Bug 1172 Special case handling for duplicates,forwards and some doxygen fixes
John Abraham <john.abraham@gatech.edu>
parents:
7360
diff
changeset
|
291 |
|
36b42a8b16d1
Bug 1172 Special case handling for duplicates,forwards and some doxygen fixes
John Abraham <john.abraham@gatech.edu>
parents:
7360
diff
changeset
|
292 |
/** |
36b42a8b16d1
Bug 1172 Special case handling for duplicates,forwards and some doxygen fixes
John Abraham <john.abraham@gatech.edu>
parents:
7360
diff
changeset
|
293 |
* \brief Get Type Id |
36b42a8b16d1
Bug 1172 Special case handling for duplicates,forwards and some doxygen fixes
John Abraham <john.abraham@gatech.edu>
parents:
7360
diff
changeset
|
294 |
* \returns Type Id |
36b42a8b16d1
Bug 1172 Special case handling for duplicates,forwards and some doxygen fixes
John Abraham <john.abraham@gatech.edu>
parents:
7360
diff
changeset
|
295 |
* |
36b42a8b16d1
Bug 1172 Special case handling for duplicates,forwards and some doxygen fixes
John Abraham <john.abraham@gatech.edu>
parents:
7360
diff
changeset
|
296 |
*/ |
36b42a8b16d1
Bug 1172 Special case handling for duplicates,forwards and some doxygen fixes
John Abraham <john.abraham@gatech.edu>
parents:
7360
diff
changeset
|
297 |
static TypeId GetTypeId (void); |
36b42a8b16d1
Bug 1172 Special case handling for duplicates,forwards and some doxygen fixes
John Abraham <john.abraham@gatech.edu>
parents:
7360
diff
changeset
|
298 |
|
36b42a8b16d1
Bug 1172 Special case handling for duplicates,forwards and some doxygen fixes
John Abraham <john.abraham@gatech.edu>
parents:
7360
diff
changeset
|
299 |
/** |
36b42a8b16d1
Bug 1172 Special case handling for duplicates,forwards and some doxygen fixes
John Abraham <john.abraham@gatech.edu>
parents:
7360
diff
changeset
|
300 |
* \brief Get Instance Type Id |
36b42a8b16d1
Bug 1172 Special case handling for duplicates,forwards and some doxygen fixes
John Abraham <john.abraham@gatech.edu>
parents:
7360
diff
changeset
|
301 |
* \returns Type Id |
36b42a8b16d1
Bug 1172 Special case handling for duplicates,forwards and some doxygen fixes
John Abraham <john.abraham@gatech.edu>
parents:
7360
diff
changeset
|
302 |
* |
36b42a8b16d1
Bug 1172 Special case handling for duplicates,forwards and some doxygen fixes
John Abraham <john.abraham@gatech.edu>
parents:
7360
diff
changeset
|
303 |
*/ |
36b42a8b16d1
Bug 1172 Special case handling for duplicates,forwards and some doxygen fixes
John Abraham <john.abraham@gatech.edu>
parents:
7360
diff
changeset
|
304 |
virtual TypeId GetInstanceTypeId (void) const; |
36b42a8b16d1
Bug 1172 Special case handling for duplicates,forwards and some doxygen fixes
John Abraham <john.abraham@gatech.edu>
parents:
7360
diff
changeset
|
305 |
|
36b42a8b16d1
Bug 1172 Special case handling for duplicates,forwards and some doxygen fixes
John Abraham <john.abraham@gatech.edu>
parents:
7360
diff
changeset
|
306 |
/** |
36b42a8b16d1
Bug 1172 Special case handling for duplicates,forwards and some doxygen fixes
John Abraham <john.abraham@gatech.edu>
parents:
7360
diff
changeset
|
307 |
* \brief Get Serialized Size |
36b42a8b16d1
Bug 1172 Special case handling for duplicates,forwards and some doxygen fixes
John Abraham <john.abraham@gatech.edu>
parents:
7360
diff
changeset
|
308 |
* \returns Serialized Size (i.e size of uint64_t) |
36b42a8b16d1
Bug 1172 Special case handling for duplicates,forwards and some doxygen fixes
John Abraham <john.abraham@gatech.edu>
parents:
7360
diff
changeset
|
309 |
* |
36b42a8b16d1
Bug 1172 Special case handling for duplicates,forwards and some doxygen fixes
John Abraham <john.abraham@gatech.edu>
parents:
7360
diff
changeset
|
310 |
*/ |
36b42a8b16d1
Bug 1172 Special case handling for duplicates,forwards and some doxygen fixes
John Abraham <john.abraham@gatech.edu>
parents:
7360
diff
changeset
|
311 |
virtual uint32_t GetSerializedSize (void) const; |
36b42a8b16d1
Bug 1172 Special case handling for duplicates,forwards and some doxygen fixes
John Abraham <john.abraham@gatech.edu>
parents:
7360
diff
changeset
|
312 |
|
36b42a8b16d1
Bug 1172 Special case handling for duplicates,forwards and some doxygen fixes
John Abraham <john.abraham@gatech.edu>
parents:
7360
diff
changeset
|
313 |
/** |
36b42a8b16d1
Bug 1172 Special case handling for duplicates,forwards and some doxygen fixes
John Abraham <john.abraham@gatech.edu>
parents:
7360
diff
changeset
|
314 |
* \brief Serialize function |
36b42a8b16d1
Bug 1172 Special case handling for duplicates,forwards and some doxygen fixes
John Abraham <john.abraham@gatech.edu>
parents:
7360
diff
changeset
|
315 |
* \param i Tag Buffer |
36b42a8b16d1
Bug 1172 Special case handling for duplicates,forwards and some doxygen fixes
John Abraham <john.abraham@gatech.edu>
parents:
7360
diff
changeset
|
316 |
* |
36b42a8b16d1
Bug 1172 Special case handling for duplicates,forwards and some doxygen fixes
John Abraham <john.abraham@gatech.edu>
parents:
7360
diff
changeset
|
317 |
*/ |
36b42a8b16d1
Bug 1172 Special case handling for duplicates,forwards and some doxygen fixes
John Abraham <john.abraham@gatech.edu>
parents:
7360
diff
changeset
|
318 |
virtual void Serialize (TagBuffer i) const; |
36b42a8b16d1
Bug 1172 Special case handling for duplicates,forwards and some doxygen fixes
John Abraham <john.abraham@gatech.edu>
parents:
7360
diff
changeset
|
319 |
|
36b42a8b16d1
Bug 1172 Special case handling for duplicates,forwards and some doxygen fixes
John Abraham <john.abraham@gatech.edu>
parents:
7360
diff
changeset
|
320 |
/** |
36b42a8b16d1
Bug 1172 Special case handling for duplicates,forwards and some doxygen fixes
John Abraham <john.abraham@gatech.edu>
parents:
7360
diff
changeset
|
321 |
* \brief Deserialize function |
36b42a8b16d1
Bug 1172 Special case handling for duplicates,forwards and some doxygen fixes
John Abraham <john.abraham@gatech.edu>
parents:
7360
diff
changeset
|
322 |
* \param i Tag Buffer |
36b42a8b16d1
Bug 1172 Special case handling for duplicates,forwards and some doxygen fixes
John Abraham <john.abraham@gatech.edu>
parents:
7360
diff
changeset
|
323 |
* |
36b42a8b16d1
Bug 1172 Special case handling for duplicates,forwards and some doxygen fixes
John Abraham <john.abraham@gatech.edu>
parents:
7360
diff
changeset
|
324 |
*/ |
36b42a8b16d1
Bug 1172 Special case handling for duplicates,forwards and some doxygen fixes
John Abraham <john.abraham@gatech.edu>
parents:
7360
diff
changeset
|
325 |
virtual void Deserialize (TagBuffer i); |
36b42a8b16d1
Bug 1172 Special case handling for duplicates,forwards and some doxygen fixes
John Abraham <john.abraham@gatech.edu>
parents:
7360
diff
changeset
|
326 |
|
36b42a8b16d1
Bug 1172 Special case handling for duplicates,forwards and some doxygen fixes
John Abraham <john.abraham@gatech.edu>
parents:
7360
diff
changeset
|
327 |
/** |
36b42a8b16d1
Bug 1172 Special case handling for duplicates,forwards and some doxygen fixes
John Abraham <john.abraham@gatech.edu>
parents:
7360
diff
changeset
|
328 |
* \brief Print tag info |
36b42a8b16d1
Bug 1172 Special case handling for duplicates,forwards and some doxygen fixes
John Abraham <john.abraham@gatech.edu>
parents:
7360
diff
changeset
|
329 |
* \param os Reference of ostream object |
36b42a8b16d1
Bug 1172 Special case handling for duplicates,forwards and some doxygen fixes
John Abraham <john.abraham@gatech.edu>
parents:
7360
diff
changeset
|
330 |
* |
36b42a8b16d1
Bug 1172 Special case handling for duplicates,forwards and some doxygen fixes
John Abraham <john.abraham@gatech.edu>
parents:
7360
diff
changeset
|
331 |
*/ |
36b42a8b16d1
Bug 1172 Special case handling for duplicates,forwards and some doxygen fixes
John Abraham <john.abraham@gatech.edu>
parents:
7360
diff
changeset
|
332 |
virtual void Print (std::ostream &os) const; |
36b42a8b16d1
Bug 1172 Special case handling for duplicates,forwards and some doxygen fixes
John Abraham <john.abraham@gatech.edu>
parents:
7360
diff
changeset
|
333 |
|
36b42a8b16d1
Bug 1172 Special case handling for duplicates,forwards and some doxygen fixes
John Abraham <john.abraham@gatech.edu>
parents:
7360
diff
changeset
|
334 |
/** |
36b42a8b16d1
Bug 1172 Special case handling for duplicates,forwards and some doxygen fixes
John Abraham <john.abraham@gatech.edu>
parents:
7360
diff
changeset
|
335 |
* \brief Set global Uid in tag |
36b42a8b16d1
Bug 1172 Special case handling for duplicates,forwards and some doxygen fixes
John Abraham <john.abraham@gatech.edu>
parents:
7360
diff
changeset
|
336 |
* \param AnimUid global Uid |
36b42a8b16d1
Bug 1172 Special case handling for duplicates,forwards and some doxygen fixes
John Abraham <john.abraham@gatech.edu>
parents:
7360
diff
changeset
|
337 |
* |
36b42a8b16d1
Bug 1172 Special case handling for duplicates,forwards and some doxygen fixes
John Abraham <john.abraham@gatech.edu>
parents:
7360
diff
changeset
|
338 |
*/ |
36b42a8b16d1
Bug 1172 Special case handling for duplicates,forwards and some doxygen fixes
John Abraham <john.abraham@gatech.edu>
parents:
7360
diff
changeset
|
339 |
void Set (uint64_t AnimUid); |
36b42a8b16d1
Bug 1172 Special case handling for duplicates,forwards and some doxygen fixes
John Abraham <john.abraham@gatech.edu>
parents:
7360
diff
changeset
|
340 |
|
36b42a8b16d1
Bug 1172 Special case handling for duplicates,forwards and some doxygen fixes
John Abraham <john.abraham@gatech.edu>
parents:
7360
diff
changeset
|
341 |
/** |
36b42a8b16d1
Bug 1172 Special case handling for duplicates,forwards and some doxygen fixes
John Abraham <john.abraham@gatech.edu>
parents:
7360
diff
changeset
|
342 |
* \brief Get Uid in tag |
36b42a8b16d1
Bug 1172 Special case handling for duplicates,forwards and some doxygen fixes
John Abraham <john.abraham@gatech.edu>
parents:
7360
diff
changeset
|
343 |
* \returns Uid in tag |
36b42a8b16d1
Bug 1172 Special case handling for duplicates,forwards and some doxygen fixes
John Abraham <john.abraham@gatech.edu>
parents:
7360
diff
changeset
|
344 |
* |
36b42a8b16d1
Bug 1172 Special case handling for duplicates,forwards and some doxygen fixes
John Abraham <john.abraham@gatech.edu>
parents:
7360
diff
changeset
|
345 |
*/ |
36b42a8b16d1
Bug 1172 Special case handling for duplicates,forwards and some doxygen fixes
John Abraham <john.abraham@gatech.edu>
parents:
7360
diff
changeset
|
346 |
uint64_t Get (void) const; |
36b42a8b16d1
Bug 1172 Special case handling for duplicates,forwards and some doxygen fixes
John Abraham <john.abraham@gatech.edu>
parents:
7360
diff
changeset
|
347 |
|
36b42a8b16d1
Bug 1172 Special case handling for duplicates,forwards and some doxygen fixes
John Abraham <john.abraham@gatech.edu>
parents:
7360
diff
changeset
|
348 |
private: |
36b42a8b16d1
Bug 1172 Special case handling for duplicates,forwards and some doxygen fixes
John Abraham <john.abraham@gatech.edu>
parents:
7360
diff
changeset
|
349 |
uint64_t m_AnimUid; |
36b42a8b16d1
Bug 1172 Special case handling for duplicates,forwards and some doxygen fixes
John Abraham <john.abraham@gatech.edu>
parents:
7360
diff
changeset
|
350 |
}; |
36b42a8b16d1
Bug 1172 Special case handling for duplicates,forwards and some doxygen fixes
John Abraham <john.abraham@gatech.edu>
parents:
7360
diff
changeset
|
351 |
|
5776 | 352 |
} |
353 |
#endif |
|
354 |