Left: | ||
Right: |
OLD | NEW |
---|---|
(Empty) | |
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ | |
2 /* | |
3 * Copyright (c) 2005, 2009 INRIA | |
4 * Copyright (c) 2009 MIRKO BANCHI | |
5 * | |
6 * This program is free software; you can redistribute it and/or modify | |
7 * it under the terms of the GNU General Public License version 2 as | |
8 * published by the Free Software Foundation; | |
9 * | |
10 * This program is distributed in the hope that it will be useful, | |
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
13 * GNU General Public License for more details. | |
14 * | |
15 * You should have received a copy of the GNU General Public License | |
16 * along with this program; if not, write to the Free Software | |
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
18 * | |
19 * Authors: Mathieu Lacage <mathieu.lacage@sophia.inria.fr> | |
20 * Mirko Banchi <mk.banchi@gmail.com> | |
21 * Stefano Avallone <stavallo@unina.it> | |
22 */ | |
23 | |
24 #ifndef WIFI_MAC_QUEUE_ITEM_H | |
25 #define WIFI_MAC_QUEUE_ITEM_H | |
26 | |
27 #include "ns3/queue.h" | |
28 #include "wifi-mac-header.h" | |
29 | |
30 namespace ns3 { | |
31 | |
32 class QosBlockedDestinations; | |
33 | |
34 /** | |
35 * \ingroup wifi | |
36 * | |
37 * WifiMacQueueItem stores (const) packets along with their Wifi MAC headers | |
38 * and the time when they were enqueued. | |
39 */ | |
40 class WifiMacQueueItem : public SimpleRefCount<WifiMacQueueItem> | |
41 { | |
42 public: | |
43 /** | |
44 * \brief Create a Wifi MAC queue item containing a packet and a Wifi MAC head er. | |
45 * \param p the const packet included in the created item. | |
46 * \param header the Wifi Mac header included in the created item. | |
47 */ | |
48 WifiMacQueueItem (Ptr<const Packet> p, const WifiMacHeader & header); | |
49 | |
50 virtual ~WifiMacQueueItem (); | |
51 | |
52 /** | |
53 * \brief Get the packet stored in this item | |
54 * \return the packet stored in this item. | |
55 */ | |
56 Ptr<const Packet> GetPacket (void) const; | |
57 | |
58 /** | |
59 * \brief Get the header stored in this item | |
60 * \return the header stored in this item. | |
61 */ | |
62 const WifiMacHeader & GetHeader (void) const; | |
63 | |
64 /** | |
65 * \brief Return the requested address present in the header | |
66 * \param type the type of the address to return | |
67 * \return the address | |
68 */ | |
69 Mac48Address GetAddress (enum WifiMacHeader::AddressType type) const; | |
70 | |
71 /** | |
72 * \brief Get the timestamp included in this item | |
73 * \return the timestamp included in this item. | |
74 */ | |
75 Time GetTimeStamp (void) const; | |
76 | |
77 /** | |
78 * \brief Return the size of the packet included in this item | |
79 * | |
80 * \return the size of the packet included in this item. | |
81 */ | |
82 uint32_t GetSize (void) const; | |
83 | |
84 private: | |
85 /** | |
86 * \brief Default constructor | |
87 * | |
88 * Defined and unimplemented to avoid misuse | |
89 */ | |
90 WifiMacQueueItem (); | |
91 /** | |
92 * \brief Copy constructor | |
93 * | |
94 * Defined and unimplemented to avoid misuse | |
95 */ | |
96 WifiMacQueueItem (const WifiMacQueueItem &); | |
97 /** | |
98 * \brief Assignment operator | |
99 * | |
100 * Defined and unimplemented to avoid misuse | |
101 * \returns | |
102 */ | |
103 WifiMacQueueItem &operator = (const WifiMacQueueItem &); | |
104 | |
105 Ptr<const Packet> m_packet; //!< The packet contained in this queue item | |
106 WifiMacHeader m_header; //!< Wifi MAC header associated with the packet | |
107 Time m_tstamp; //!< timestamp when the packet arrived at the que ue | |
108 }; | |
109 | |
110 | |
111 // The following explicit template instantiation declaration prevents modules | |
112 // including this header file from implicitly instantiating Queue<WifiMacQueueIt em>. | |
113 // This would cause python examples using wifi to crash at runtime with the | |
114 // following error message: "Trying to allocate twice the same uid: | |
115 // ns3::Queue<WifiMacQueueItem>" | |
116 #ifndef _WIN32 | |
S. Deronne
2018/02/13 21:08:16
Why do we need this? This change should also be ch
ammo6818-vandals.uidaho.edu
2018/02/18 05:37:45
this was required to compile on Visual Studio.
| |
117 extern template class Queue<WifiMacQueueItem>; | |
118 #else | |
119 template class Queue<WifiMacQueueItem>; | |
120 #endif | |
121 | |
122 | |
123 } //namespace ns3 | |
124 | |
125 #endif /* WIFI_MAC_QUEUE_ITEM_H */ | |
OLD | NEW |