A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
animation-interface-helper.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * This program is free software; you can redistribute it and/or modify
4  * it under the terms of the GNU General Public License version 2 as
5  * published by the Free Software Foundation;
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software
14  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
15  *
16  * Author: John Abraham <john.abraham@gatech.edu>
17  */
18 
19 // Animation Interface helpers
20 
21 #ifndef _ANIMATION_INTERFACE_HELPER_H_
22 #define _ANIMATION_INTERFACE_HELPER_H_
23 
24 #include "ns3/node.h"
25 #include "ns3/mobility-model.h"
26 #include "ns3/packet.h"
27 #include "ns3/simulator.h"
28 #include <vector>
29 #include <map>
30 
31 namespace ns3 {
32 
33 
48 {
49 public:
50 
55  AnimRxInfo () {};
56 
64  AnimRxInfo (const Time& fbRx, Ptr <const NetDevice> nd ,double rxRange)
65  : m_fbRx (fbRx.GetSeconds ()), m_lbRx (0), m_rxnd (nd), rxRange (rxRange), m_PhyRxComplete (false){}
66 
72  double m_fbRx;
73 
79  double m_lbRx;
80 
87 
93  double rxRange;
94 
100  bool IsPhyRxComplete ();
101 
106  void SetPhyRxComplete ();
107 
108 private:
110 
111 };
112 
129 
130 {
131 public:
132 
137  AnimPacketInfo ();
138 
148  AnimPacketInfo(Ptr <const NetDevice> tx_nd, const Time& fbTx, const Time& lbTx,Vector txLoc, uint32_t txNodeId = 0);
149 
156 
162  uint32_t m_txNodeId;
163 
169  double m_fbTx;
170 
176  double m_lbTx;
177 
184 
185 
191  std::map<uint32_t,AnimRxInfo> m_rx;
192 
199  void ProcessRxBegin (Ptr <const NetDevice> nd, const Time& fbRx);
200 
209  bool ProcessRxEnd (Ptr <const NetDevice> nd, const Time& fbRx, Vector rxLoc);
210 
217 
225 
232 
238 
239 };
240 
241 } // namespace ns3
242 
243 #endif
double rxRange
Reception range.
keep track of time values and allow control of global simulation resolution
Definition: nstime.h:81
smart pointer class similar to boost::intrusive_ptr
Definition: ptr.h:59
AnimRxInfo GetRxInfo(Ptr< const NetDevice > nd)
GetRxInfo.
void RemoveRxInfo(Ptr< const NetDevice > nd)
RemoveRxInfo.
AnimRxInfo helper class.
Vector m_txLoc
Transmitter's location.
bool ProcessRxEnd(Ptr< const NetDevice > nd, const Time &fbRx, Vector rxLoc)
Process RxEnd notifications.
a 3d vector
Definition: vector.h:31
void ProcessRxBegin(Ptr< const NetDevice > nd, const Time &fbRx)
Process RxBegin notifications.
void ProcessRxDrop(Ptr< const NetDevice > nd)
Process RxDrop notifications.
Ptr< const NetDevice > m_rxnd
Ptr to receiving NetDevice.
double m_fbRx
First bit receive time.
double firstlastbitDelta
Time delta between First bit Rx and Last bit Rx.
double m_lbTx
Last bit transmission time.
uint32_t m_txNodeId
Tx Node Id if NetDevice is unknown.
double m_lbRx
Last bit receive time.
bool IsPhyRxComplete()
Check if Wifi Phy Rx is Complete.
std::map< uint32_t, AnimRxInfo > m_rx
Collection of receivers.
Ptr< const NetDevice > m_txnd
Ptr to NetDevice that is transmitting.
AnimPacketInfo()
Default constructor.
double m_fbTx
First bit transmission time.
AnimRxInfo(const Time &fbRx, Ptr< const NetDevice > nd, double rxRange)
Constructor.
void SetPhyRxComplete()
Set Wifi Phy Rx Complete.
AnimRxInfo()
Default constructor.
AnimPacketInfo helper class.