A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Portuguese
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
higher-tx-tag.cc
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2008 INRIA
4
* Copyright (c) 2013 Dalian University of Technology
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
* Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
20
* Junling Bu <linlinjavaer@gmail.com>
21
*/
22
#include "
higher-tx-tag.h
"
23
#include "ns3/tag.h"
24
#include "ns3/log.h"
25
#include "ns3/uinteger.h"
26
27
NS_LOG_COMPONENT_DEFINE
(
"HigherDataTxVectorTag"
);
28
29
namespace
ns3 {
30
31
NS_OBJECT_ENSURE_REGISTERED
(HigherDataTxVectorTag);
32
33
TypeId
34
HigherDataTxVectorTag::GetTypeId
(
void
)
35
{
36
static
TypeId
tid =
TypeId
(
"ns3::HigherDataTxVectorTag"
)
37
.
SetParent
<
Tag
> ()
38
.AddConstructor<HigherDataTxVectorTag> ()
39
;
40
return
tid;
41
}
42
HigherDataTxVectorTag::HigherDataTxVectorTag
(
void
)
43
: m_adapter (false)
44
{
45
NS_LOG_FUNCTION
(
this
);
46
}
47
HigherDataTxVectorTag::HigherDataTxVectorTag
(
WifiTxVector
dataTxVector,
bool
adapter)
48
: m_dataTxVector (dataTxVector),
49
m_adapter (adapter)
50
{
51
NS_LOG_FUNCTION
(
this
);
52
}
53
HigherDataTxVectorTag::~HigherDataTxVectorTag
(
void
)
54
{
55
NS_LOG_FUNCTION
(
this
);
56
}
57
TypeId
58
HigherDataTxVectorTag::GetInstanceTypeId
(
void
)
const
59
{
60
NS_LOG_FUNCTION
(
this
);
61
return
GetTypeId
();
62
}
63
64
WifiTxVector
65
HigherDataTxVectorTag::GetDataTxVector
(
void
)
const
66
{
67
NS_LOG_FUNCTION
(
this
);
68
return
m_dataTxVector
;
69
}
70
bool
71
HigherDataTxVectorTag::IsAdapter
(
void
)
const
72
{
73
NS_LOG_FUNCTION
(
this
);
74
return
m_adapter
;
75
}
76
77
uint32_t
78
HigherDataTxVectorTag::GetSerializedSize
(
void
)
const
79
{
80
NS_LOG_FUNCTION
(
this
);
81
return
(
sizeof
(
WifiTxVector
) + 1);
82
}
83
void
84
HigherDataTxVectorTag::Serialize
(
TagBuffer
i)
const
85
{
86
NS_LOG_FUNCTION
(
this
<< &i);
87
i.
Write
((uint8_t *)&
m_dataTxVector
,
sizeof
(
WifiTxVector
));
88
i.
WriteU8
(static_cast<uint8_t> (
m_adapter
));
89
}
90
void
91
HigherDataTxVectorTag::Deserialize
(
TagBuffer
i)
92
{
93
NS_LOG_FUNCTION
(
this
<< &i);
94
i.
Read
((uint8_t *)&
m_dataTxVector
,
sizeof
(
WifiTxVector
));
95
m_adapter
= i.
ReadU8
();
96
}
97
void
98
HigherDataTxVectorTag::Print
(std::ostream &os)
const
99
{
100
NS_LOG_FUNCTION
(
this
<< &os);
101
os <<
" Data="
<<
m_dataTxVector
<<
" Adapter="
<<
m_adapter
;
102
}
103
104
}
// namespace ns3
ns3::HigherDataTxVectorTag::m_dataTxVector
WifiTxVector m_dataTxVector
Definition:
higher-tx-tag.h:53
ns3::TagBuffer::Write
void Write(const uint8_t *buffer, uint32_t size)
Definition:
tag-buffer.cc:125
NS_LOG_FUNCTION
#define NS_LOG_FUNCTION(parameters)
Definition:
log.h:345
ns3::WifiTxVector
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
Definition:
wifi-tx-vector.h:47
higher-tx-tag.h
ns3::NS_OBJECT_ENSURE_REGISTERED
NS_OBJECT_ENSURE_REGISTERED(NullMessageSimulatorImpl)
ns3::TagBuffer::ReadU8
TAG_BUFFER_INLINE uint8_t ReadU8(void)
Definition:
tag-buffer.h:179
ns3::HigherDataTxVectorTag::GetSerializedSize
virtual uint32_t GetSerializedSize(void) const
Definition:
higher-tx-tag.cc:78
NS_LOG_COMPONENT_DEFINE
NS_LOG_COMPONENT_DEFINE("HigherDataTxVectorTag")
ns3::HigherDataTxVectorTag::GetDataTxVector
WifiTxVector GetDataTxVector(void) const
Definition:
higher-tx-tag.cc:65
ns3::Tag
tag a set of bytes in a packet
Definition:
tag.h:36
ns3::HigherDataTxVectorTag::Serialize
virtual void Serialize(TagBuffer i) const
Definition:
higher-tx-tag.cc:84
ns3::HigherDataTxVectorTag::Deserialize
virtual void Deserialize(TagBuffer i)
Definition:
higher-tx-tag.cc:91
ns3::TagBuffer::WriteU8
TAG_BUFFER_INLINE void WriteU8(uint8_t v)
Definition:
tag-buffer.h:156
ns3::HigherDataTxVectorTag::m_adapter
bool m_adapter
Definition:
higher-tx-tag.h:54
ns3::TagBuffer
read and write tag data
Definition:
tag-buffer.h:51
ns3::TagBuffer::Read
void Read(uint8_t *buffer, uint32_t size)
Definition:
tag-buffer.cc:176
ns3::HigherDataTxVectorTag::HigherDataTxVectorTag
HigherDataTxVectorTag(void)
Definition:
higher-tx-tag.cc:42
ns3::HigherDataTxVectorTag::~HigherDataTxVectorTag
virtual ~HigherDataTxVectorTag(void)
Definition:
higher-tx-tag.cc:53
ns3::HigherDataTxVectorTag::GetInstanceTypeId
virtual TypeId GetInstanceTypeId(void) const
Definition:
higher-tx-tag.cc:58
ns3::HigherDataTxVectorTag::GetTypeId
static TypeId GetTypeId(void)
Definition:
higher-tx-tag.cc:34
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:49
ns3::TypeId::SetParent
TypeId SetParent(TypeId tid)
Definition:
type-id.cc:611
ns3::HigherDataTxVectorTag::Print
virtual void Print(std::ostream &os) const
Definition:
higher-tx-tag.cc:98
ns3::HigherDataTxVectorTag::IsAdapter
bool IsAdapter(void) const
Definition:
higher-tx-tag.cc:71
src
wave
model
higher-tx-tag.cc
Generated on Sat Apr 19 2014 14:07:10 for ns-3 by
1.8.6