keep track of the tags stored in a packet. More...
#include <tag-list.h>
Classes | |
class | Iterator |
Public Member Functions | |
TagList () | |
TagList (const TagList &o) | |
TagList & | operator= (const TagList &o) |
~TagList () | |
TagBuffer | Add (TypeId tid, uint32_t bufferSize, int32_t start, int32_t end) |
void | Add (const TagList &o) |
void | RemoveAll (void) |
TagList::Iterator | Begin (int32_t offsetStart, int32_t offsetEnd) const |
void | AddAtEnd (int32_t adjustment, int32_t appendOffset) |
void | AddAtStart (int32_t adjustment, int32_t prependOffset) |
Private Member Functions | |
bool | IsDirtyAtEnd (int32_t appendOffset) |
bool | IsDirtyAtStart (int32_t prependOffset) |
TagList::Iterator | BeginAll (void) const |
struct TagListData * | Allocate (uint32_t size) |
void | Deallocate (struct TagListData *data) |
Private Attributes | |
uint16_t | m_used |
struct TagListData * | m_data |
keep track of the tags stored in a packet.
This class is mostly private to the Packet implementation and users should never have to access it directly.
Definition at line 68 of file tag-list.h.
ns3::TagList::TagList | ( | ) |
Definition at line 118 of file tag-list.cc.
References NS_LOG_FUNCTION.
ns3::TagList::TagList | ( | const TagList & | o | ) |
Definition at line 124 of file tag-list.cc.
References ns3::TagListData::count, m_data, and NS_LOG_FUNCTION.
ns3::TagList::~TagList | ( | ) |
Definition at line 152 of file tag-list.cc.
References Deallocate(), m_data, m_used, and NS_LOG_FUNCTION.
void ns3::TagList::Add | ( | const TagList & | o | ) |
o | the other list of tags to aggregate. |
Aggregate the two lists of tags.
Definition at line 191 of file tag-list.cc.
References Add(), BeginAll(), ns3::TagList::Iterator::Item::buf, ns3::TagBuffer::CopyFrom(), ns3::TagList::Iterator::Item::end, ns3::TagList::Iterator::HasNext(), ns3::TagList::Iterator::Next(), NS_LOG_FUNCTION, ns3::TagList::Iterator::Item::size, ns3::TagList::Iterator::Item::start, and ns3::TagList::Iterator::Item::tid.
tid | the typeid of the tag added | |
bufferSize | the size of the tag when its serialization will be completed. Typically, the return value of Tag::GetSerializedSize | |
start | offset which uniquely identifies the first byte tagged by this tag. | |
end | offset which uniquely identifies the last byte tagged by this tag. |
Definition at line 161 of file tag-list.cc.
References Allocate(), ns3::TagListData::count, ns3::TagListData::data, Deallocate(), ns3::TagListData::dirty, ns3::TypeId::GetUid(), m_data, m_used, NS_ASSERT, NS_LOG_FUNCTION, ns3::TagListData::size, and ns3::TagBuffer::WriteU32().
Referenced by Add(), AddAtEnd(), ns3::Packet::AddAtEnd(), AddAtStart(), and ns3::Packet::AddTag().
void ns3::TagList::AddAtEnd | ( | int32_t | adjustment, | |
int32_t | appendOffset | |||
) |
Adjust the offsets stored internally by the adjustment delta and make sure that all offsets are smaller than appendOffset which represents the location where new bytes have been added to the byte buffer.
Definition at line 268 of file tag-list.cc.
References Add(), BeginAll(), ns3::TagList::Iterator::Item::buf, ns3::TagBuffer::CopyFrom(), ns3::TagList::Iterator::Item::end, ns3::TagList::Iterator::HasNext(), IsDirtyAtEnd(), ns3::TagList::Iterator::Next(), NS_LOG_FUNCTION, ns3::TagList::Iterator::Item::size, ns3::TagList::Iterator::Item::start, and ns3::TagList::Iterator::Item::tid.
Referenced by ns3::Packet::AddAtEnd(), ns3::Packet::AddPaddingAtEnd(), and ns3::Packet::AddTrailer().
void ns3::TagList::AddAtStart | ( | int32_t | adjustment, | |
int32_t | prependOffset | |||
) |
Adjust the offsets stored internally by the adjustment delta and make sure that all offsets are bigger than prependOffset which represents the location where new bytes have been added to the byte buffer.
Definition at line 302 of file tag-list.cc.
References Add(), BeginAll(), ns3::TagList::Iterator::Item::buf, ns3::TagBuffer::CopyFrom(), ns3::TagList::Iterator::Item::end, ns3::TagList::Iterator::HasNext(), IsDirtyAtStart(), ns3::TagList::Iterator::Next(), NS_LOG_FUNCTION, ns3::TagList::Iterator::Item::size, ns3::TagList::Iterator::Item::start, and ns3::TagList::Iterator::Item::tid.
Referenced by ns3::Packet::AddAtEnd(), and ns3::Packet::AddHeader().
struct TagListData * ns3::TagList::Allocate | ( | uint32_t | size | ) | [read, private] |
Definition at line 338 of file tag-list.cc.
References ns3::TagListData::count, ns3::TagListData::dirty, ns3::g_freeList, ns3::g_maxSize, NS_ASSERT, NS_LOG_FUNCTION, and ns3::TagListData::size.
Referenced by Add().
TagList::Iterator ns3::TagList::Begin | ( | int32_t | offsetStart, | |
int32_t | offsetEnd | |||
) | const |
offsetStart | the offset which uniquely identifies the first data byte present in the byte buffer associated to this TagList. | |
offsetEnd | the offset which uniquely identifies the last data byte present in the byte buffer associated to this TagList. |
The returned iterator will allow you to loop through the set of tags present in this list: the boundaries of each tag as reported by their start and end offsets will be included within the input offsetStart and offsetEnd.
Definition at line 222 of file tag-list.cc.
References ns3::TagListData::data, m_data, m_used, and NS_LOG_FUNCTION.
Referenced by BeginAll(), and ns3::Packet::GetTagIterator().
TagList::Iterator ns3::TagList::BeginAll | ( | void | ) | const [private] |
Definition at line 213 of file tag-list.cc.
References Begin(), NS_LOG_FUNCTION, and OFFSET_MAX.
Referenced by Add(), AddAtEnd(), AddAtStart(), IsDirtyAtEnd(), and IsDirtyAtStart().
void ns3::TagList::Deallocate | ( | struct TagListData * | data | ) | [private] |
Definition at line 364 of file tag-list.cc.
References ns3::TagListData::count, FREE_LIST_SIZE, ns3::g_freeList, ns3::g_maxSize, NS_LOG_FUNCTION, and ns3::TagListData::size.
Referenced by Add(), operator=(), RemoveAll(), and ~TagList().
bool ns3::TagList::IsDirtyAtEnd | ( | int32_t | appendOffset | ) | [private] |
Definition at line 236 of file tag-list.cc.
References BeginAll(), ns3::TagList::Iterator::Item::end, ns3::TagList::Iterator::HasNext(), ns3::TagList::Iterator::Next(), and NS_LOG_FUNCTION.
Referenced by AddAtEnd().
bool ns3::TagList::IsDirtyAtStart | ( | int32_t | prependOffset | ) | [private] |
Definition at line 252 of file tag-list.cc.
References BeginAll(), ns3::TagList::Iterator::HasNext(), ns3::TagList::Iterator::Next(), NS_LOG_FUNCTION, and ns3::TagList::Iterator::Item::start.
Referenced by AddAtStart().
Definition at line 135 of file tag-list.cc.
References ns3::TagListData::count, Deallocate(), m_data, m_used, and NS_LOG_FUNCTION.
void ns3::TagList::RemoveAll | ( | void | ) |
Definition at line 204 of file tag-list.cc.
References Deallocate(), m_data, m_used, and NS_LOG_FUNCTION.
Referenced by ns3::Packet::RemoveAllTags().
struct TagListData* ns3::TagList::m_data [private] |
Definition at line 165 of file tag-list.h.
Referenced by Add(), Begin(), operator=(), RemoveAll(), TagList(), and ~TagList().
uint16_t ns3::TagList::m_used [private] |
Definition at line 164 of file tag-list.h.
Referenced by Add(), Begin(), operator=(), RemoveAll(), and ~TagList().