A Discrete-Event Network Simulator
API
tx-vector-tag.cc
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2005,2006,2007 INRIA
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: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
19  */
20 
21 #include "tx-vector-tag.h"
22 
23 /***************************************************************
24  * Packet Mode Tagger
25  ***************************************************************/
26 
27 namespace ns3 {
28 
30 {
31 }
32 
34  : m_dataTxVector (dataTxVector)
35 {
36 }
37 
40 {
41  return m_dataTxVector;
42 }
43 
44 TypeId
46 {
47  static TypeId tid = TypeId ("ns3::HighLatencyDataTxVectorTag")
48  .SetParent<Tag> ()
49  .SetGroupName ("Wifi")
50  .AddConstructor<HighLatencyDataTxVectorTag> ()
51  ;
52  return tid;
53 }
54 
55 TypeId
57 {
58  return GetTypeId ();
59 }
60 
61 uint32_t
63 {
64  return sizeof (WifiTxVector);
65 }
66 
67 void
69 {
70  i.Write ((uint8_t *)&m_dataTxVector, sizeof (WifiTxVector));
71 }
72 
73 void
75 {
76  i.Read ((uint8_t *)&m_dataTxVector, sizeof (WifiTxVector));
77 }
78 
79 void
80 HighLatencyDataTxVectorTag::Print (std::ostream &os) const
81 {
82  os << "Data=" << m_dataTxVector;
83 }
84 
86 {
87 }
88 
90  : m_rtsTxVector (rtsTxVector)
91 {
92 }
93 
96 {
97  return m_rtsTxVector;
98 }
99 
100 TypeId
102 {
103  static TypeId tid = TypeId ("ns3::HighLatencyRtsTxVectorTag")
104  .SetParent<Tag> ()
105  .SetGroupName ("Wifi")
106  .AddConstructor<HighLatencyRtsTxVectorTag> ()
107  ;
108  return tid;
109 }
110 
111 TypeId
113 {
114  return GetTypeId ();
115 }
116 
117 uint32_t
119 {
120  return sizeof (WifiTxVector);
121 }
122 
123 void
125 {
126  i.Write ((uint8_t *)&m_rtsTxVector, sizeof (WifiTxVector));
127 }
128 
129 void
131 {
132  i.Read ((uint8_t *)&m_rtsTxVector, sizeof (WifiTxVector));
133 }
134 
135 void
136 HighLatencyRtsTxVectorTag::Print (std::ostream &os) const
137 {
138  os << "Rts=" << m_rtsTxVector;
139 }
140 
142 {
143 }
144 
146  : m_ctsToSelfTxVector (ctsToSelfTxVector)
147 {
148 }
149 
152 {
153  return m_ctsToSelfTxVector;
154 }
155 
156 TypeId
158 {
159  static TypeId tid = TypeId ("ns3::HighLatencyCtsToSelfTxVectorTag")
160  .SetParent<Tag> ()
161  .SetGroupName ("Wifi")
162  .AddConstructor<HighLatencyCtsToSelfTxVectorTag> ()
163  ;
164  return tid;
165 }
166 
167 TypeId
169 {
170  return GetTypeId ();
171 }
172 
173 uint32_t
175 {
176  return sizeof (WifiTxVector);
177 }
178 
179 void
181 {
182  i.Write ((uint8_t *)&m_ctsToSelfTxVector, sizeof (WifiTxVector));
183 }
184 
185 void
187 {
188  i.Read ((uint8_t *)&m_ctsToSelfTxVector, sizeof (WifiTxVector));
189 }
190 
191 void
193 {
194  os << "Cts To Self=" << m_ctsToSelfTxVector;
195 }
196 
197 } //namespace ns3
virtual void Deserialize(TagBuffer i)
virtual void Print(std::ostream &os) const
void Write(const uint8_t *buffer, uint32_t size)
Definition: tag-buffer.cc:125
HighLatencyDataTxVectorTag class.
Definition: tx-vector-tag.h:36
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
virtual void Serialize(TagBuffer i) const
WifiTxVector m_rtsTxVector
TXVECTOR for data frames.
Definition: tx-vector-tag.h:97
WifiTxVector m_ctsToSelfTxVector
TXVECTOR for CTS-to-self frames.
WifiTxVector GetRtsTxVector(void) const
virtual TypeId GetInstanceTypeId(void) const
Get the most derived TypeId for this Object.
static TypeId GetTypeId(void)
Get the type ID.
virtual TypeId GetInstanceTypeId(void) const
Get the most derived TypeId for this Object.
WifiTxVector GetDataTxVector(void) const
WifiTxVector m_dataTxVector
TXVECTOR for data frames.
Definition: tx-vector-tag.h:63
tag a set of bytes in a packet
Definition: tag.h:36
Every class exported by the ns3 library is enclosed in the ns3 namespace.
virtual uint32_t GetSerializedSize(void) const
static TypeId GetTypeId(void)
Get the type ID.
virtual void Print(std::ostream &os) const
virtual void Serialize(TagBuffer i) const
HighLatencyCtsToSelfTxVectorTag class.
static TypeId GetTypeId(void)
Get the type ID.
virtual void Deserialize(TagBuffer i)
read and write tag data
Definition: tag-buffer.h:51
virtual uint32_t GetSerializedSize(void) const
virtual TypeId GetInstanceTypeId(void) const
Get the most derived TypeId for this Object.
virtual void Serialize(TagBuffer i) const
void Read(uint8_t *buffer, uint32_t size)
Definition: tag-buffer.cc:176
WifiTxVector GetCtsToSelfTxVector(void) const
virtual void Deserialize(TagBuffer i)
a unique identifier for an interface.
Definition: type-id.h:58
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition: type-id.cc:915
HighLatencyRtsTxVectorTag class.
Definition: tx-vector-tag.h:69
virtual uint32_t GetSerializedSize(void) const
virtual void Print(std::ostream &os) const