A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
ns3::ByteTagList::Iterator Class Reference

An iterator for iterating through a byte tag list. More...

#include "byte-tag-list.h"

+ Collaboration diagram for ns3::ByteTagList::Iterator:

Classes

struct  Item
 An item specifies an individual tag within a byte buffer. More...
 

Public Member Functions

uint32_t GetOffsetStart () const
 Returns the offset from the start of the virtual byte buffer to the ByteTagList.
 
bool HasNext () const
 Used to determine if the iterator is at the end of the byteTagList.
 
ByteTagList::Iterator::Item Next ()
 Returns the next Item from the ByteTagList.
 

Private Member Functions

 Iterator (uint8_t *start, uint8_t *end, int32_t offsetStart, int32_t offsetEnd, int32_t adjustment)
 Constructor.
 
void PrepareForNext ()
 Prepare the iterator for the next tag.
 

Private Attributes

int32_t m_adjustment
 Adjustment to byte tag offsets.
 
uint8_t * m_current
 Current tag.
 
uint8_t * m_end
 End tag.
 
int32_t m_nextEnd
 End of the next tag.
 
uint32_t m_nextSize
 Size of the next tag.
 
int32_t m_nextStart
 Start of the next tag.
 
uint32_t m_nextTid
 TypeId of the next tag.
 
int32_t m_offsetEnd
 Offset to the end of the tag from the virtual byte buffer.
 
int32_t m_offsetStart
 Offset to the start of the tag from the virtual byte buffer.
 

Friends

class ByteTagList
 Friend class.
 

Detailed Description

An iterator for iterating through a byte tag list.

An iterator for iterating through a byte tag list

Definition at line 63 of file byte-tag-list.h.

Constructor & Destructor Documentation

◆ Iterator()

ns3::ByteTagList::Iterator::Iterator ( uint8_t * start,
uint8_t * end,
int32_t offsetStart,
int32_t offsetEnd,
int32_t adjustment )
private

Constructor.

Parameters
startStarting tag
endEnd tag
offsetStartoffset to the start of the tag from the virtual byte buffer
offsetEndoffset to the end of the tag from the virtual byte buffer
adjustmentadjustment to byte tag offsets

Definition at line 117 of file byte-tag-list.cc.

References NS_LOG_FUNCTION, and PrepareForNext().

+ Here is the call graph for this function:

Member Function Documentation

◆ GetOffsetStart()

uint32_t ns3::ByteTagList::Iterator::GetOffsetStart ( ) const

Returns the offset from the start of the virtual byte buffer to the ByteTagList.

Returns
offset to the start of this ByteTagList

Definition at line 133 of file byte-tag-list.cc.

References NS_LOG_FUNCTION.

Referenced by ns3::ByteTagIterator::Next().

+ Here is the caller graph for this function:

◆ HasNext()

bool ns3::ByteTagList::Iterator::HasNext ( ) const

Used to determine if the iterator is at the end of the byteTagList.

Returns
true if there are more Items in the list

Definition at line 74 of file byte-tag-list.cc.

References m_current, m_end, and NS_LOG_FUNCTION.

Referenced by ns3::ByteTagList::Add(), ns3::ByteTagList::AddAtEnd(), ns3::ByteTagList::AddAtStart(), ns3::ByteTagList::GetSerializedSize(), ns3::ByteTagIterator::HasNext(), Next(), and ns3::ByteTagList::Serialize().

+ Here is the caller graph for this function:

◆ Next()

ByteTagList::Iterator::Item ns3::ByteTagList::Iterator::Next ( )

Returns the next Item from the ByteTagList.

Returns
the next Item in the ByteTagList

Definition at line 81 of file byte-tag-list.cc.

References ns3::ByteTagList::Iterator::Item::buf, ns3::ByteTagList::Iterator::Item::end, HasNext(), m_current, m_end, m_nextEnd, m_nextSize, m_nextStart, m_nextTid, m_offsetEnd, m_offsetStart, NS_ASSERT, PrepareForNext(), ns3::TypeId::SetUid(), ns3::ByteTagList::Iterator::Item::size, ns3::ByteTagList::Iterator::Item::start, ns3::ByteTagList::Iterator::Item::tid, and ns3::TagBuffer::TrimAtEnd().

Referenced by ns3::ByteTagList::Add(), ns3::ByteTagList::AddAtEnd(), ns3::ByteTagList::AddAtStart(), ns3::ByteTagList::GetSerializedSize(), ns3::ByteTagIterator::Next(), and ns3::ByteTagList::Serialize().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ PrepareForNext()

void ns3::ByteTagList::Iterator::PrepareForNext ( )
private

Prepare the iterator for the next tag.

Definition at line 96 of file byte-tag-list.cc.

References m_adjustment, m_current, m_end, m_nextEnd, m_nextSize, m_nextStart, m_nextTid, m_offsetEnd, m_offsetStart, NS_LOG_FUNCTION, and ns3::TagBuffer::ReadU32().

Referenced by Iterator(), and Next().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Friends And Related Symbol Documentation

◆ ByteTagList

friend class ByteTagList
friend

Friend class.

Definition at line 114 of file byte-tag-list.h.

Member Data Documentation

◆ m_adjustment

int32_t ns3::ByteTagList::Iterator::m_adjustment
private

Adjustment to byte tag offsets.

Definition at line 138 of file byte-tag-list.h.

Referenced by PrepareForNext().

◆ m_current

uint8_t* ns3::ByteTagList::Iterator::m_current
private

Current tag.

Definition at line 134 of file byte-tag-list.h.

Referenced by HasNext(), Next(), and PrepareForNext().

◆ m_end

uint8_t* ns3::ByteTagList::Iterator::m_end
private

End tag.

Definition at line 135 of file byte-tag-list.h.

Referenced by HasNext(), Next(), and PrepareForNext().

◆ m_nextEnd

int32_t ns3::ByteTagList::Iterator::m_nextEnd
private

End of the next tag.

Definition at line 142 of file byte-tag-list.h.

Referenced by Next(), and PrepareForNext().

◆ m_nextSize

uint32_t ns3::ByteTagList::Iterator::m_nextSize
private

Size of the next tag.

Definition at line 140 of file byte-tag-list.h.

Referenced by Next(), and PrepareForNext().

◆ m_nextStart

int32_t ns3::ByteTagList::Iterator::m_nextStart
private

Start of the next tag.

Definition at line 141 of file byte-tag-list.h.

Referenced by Next(), and PrepareForNext().

◆ m_nextTid

uint32_t ns3::ByteTagList::Iterator::m_nextTid
private

TypeId of the next tag.

Definition at line 139 of file byte-tag-list.h.

Referenced by Next(), and PrepareForNext().

◆ m_offsetEnd

int32_t ns3::ByteTagList::Iterator::m_offsetEnd
private

Offset to the end of the tag from the virtual byte buffer.

Definition at line 137 of file byte-tag-list.h.

Referenced by Next(), and PrepareForNext().

◆ m_offsetStart

int32_t ns3::ByteTagList::Iterator::m_offsetStart
private

Offset to the start of the tag from the virtual byte buffer.

Definition at line 136 of file byte-tag-list.h.

Referenced by Next(), and PrepareForNext().


The documentation for this class was generated from the following files: