ns3::TagList Class Reference
[Packet]

keep track of the tags stored in a packet. More...

#include <tag-list.h>

Collaboration diagram for ns3::TagList:
Collaboration graph
[legend]

List of all members.

Classes

class  Iterator

Public Member Functions

 TagList ()
 TagList (const TagList &o)
TagListoperator= (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 TagListDataAllocate (uint32_t size)
void Deallocate (struct TagListData *data)

Private Attributes

uint16_t m_used
struct TagListDatam_data

Detailed Description

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.


Constructor & Destructor Documentation

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.


Member Function Documentation

void ns3::TagList::Add ( const TagList o  ) 
TagBuffer ns3::TagList::Add ( TypeId  tid,
uint32_t  bufferSize,
int32_t  start,
int32_t  end 
)
Parameters:
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.
Returns:
a buffer which can be used to write the tag data.

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]
TagList::Iterator ns3::TagList::Begin ( int32_t  offsetStart,
int32_t  offsetEnd 
) const
Parameters:
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.
Returns:
an iterator

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]
bool ns3::TagList::IsDirtyAtEnd ( int32_t  appendOffset  )  [private]
bool ns3::TagList::IsDirtyAtStart ( int32_t  prependOffset  )  [private]
TagList & ns3::TagList::operator= ( const TagList o  ) 

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().


Member Data Documentation

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().


The documentation for this class was generated from the following files:
Generated on Thu Dec 3 14:10:00 2009 for NS-3 by  doxygen 1.6.3