A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ns3::PbbTlvBlock Class Reference

A block of packet or message TLVs (PbbTlv). More...

#include <packetbb.h>

+ Collaboration diagram for ns3::PbbTlvBlock:

Public Types

typedef std::list< Ptr< PbbTlv >
>::const_iterator 
ConstIterator
typedef std::list< Ptr< PbbTlv >
>::iterator 
Iterator

Public Member Functions

 PbbTlvBlock (void)
 ~PbbTlvBlock (void)
Ptr< PbbTlvBack (void) const
Iterator Begin (void)
ConstIterator Begin (void) const
void Clear (void)
 Removes all TLVs from this block.
void Deserialize (Buffer::Iterator &start)
 Deserializes a block from the specified buffer.
bool Empty (void) const
Iterator End (void)
ConstIterator End (void) const
Iterator Erase (Iterator position)
 Removes the TLV at the specified position.
Iterator Erase (Iterator first, Iterator last)
 Removes all TLVs from [first, last) (includes first, not includes last).
Ptr< PbbTlvFront (void) const
uint32_t GetSerializedSize (void) const
Iterator Insert (Iterator position, const Ptr< PbbTlv > tlv)
 Inserts a TLV at the specified position in this block.
bool operator!= (const PbbTlvBlock &other) const
bool operator== (const PbbTlvBlock &other) const
void PopBack (void)
 Removes a TLV from the back of this block.
void PopFront (void)
 Removes a TLV from the front of this block.
void Print (std::ostream &os) const
 Pretty-prints the contents of this block.
void Print (std::ostream &os, int level) const
 Pretty-prints the contents of this block, with specified indentation.
void PushBack (Ptr< PbbTlv > tlv)
 Appends a TLV to the back of this block.
void PushFront (Ptr< PbbTlv > tlv)
 Prepends a TLV to the front of this block.
void Serialize (Buffer::Iterator &start) const
 Serializes this block into the specified buffer.
int Size (void) const

Private Attributes

std::list< Ptr< PbbTlv > > m_tlvList

Detailed Description

A block of packet or message TLVs (PbbTlv).

Acts similar to a C++ STL container. Should not be used for Address TLVs.

Definition at line 55 of file packetbb.h.

Member Typedef Documentation

typedef std::list< Ptr<PbbTlv> >::const_iterator ns3::PbbTlvBlock::ConstIterator

Definition at line 59 of file packetbb.h.

Definition at line 58 of file packetbb.h.

Constructor & Destructor Documentation

ns3::PbbTlvBlock::PbbTlvBlock ( void  )

Definition at line 61 of file packetbb.cc.

ns3::PbbTlvBlock::~PbbTlvBlock ( void  )

Definition at line 66 of file packetbb.cc.

References Clear().

+ Here is the call graph for this function:

Member Function Documentation

Ptr< PbbTlv > ns3::PbbTlvBlock::Back ( void  ) const
Returns
a smart pointer to the last TLV in this block.

Definition at line 114 of file packetbb.cc.

References m_tlvList.

Referenced by ns3::PbbPacket::TlvBack(), and ns3::PbbMessage::TlvBack().

+ Here is the caller graph for this function:

PbbTlvBlock::Iterator ns3::PbbTlvBlock::Begin ( void  )
Returns
an iterator to the first TLV in this block.

Definition at line 72 of file packetbb.cc.

References m_tlvList.

Referenced by Clear(), GetSerializedSize(), operator==(), Print(), Serialize(), ns3::PbbPacket::TlvBegin(), and ns3::PbbMessage::TlvBegin().

+ Here is the caller graph for this function:

PbbTlvBlock::ConstIterator ns3::PbbTlvBlock::Begin ( void  ) const
Returns
a const iterator to the first TLV in this block.

Definition at line 78 of file packetbb.cc.

References m_tlvList.

void ns3::PbbTlvBlock::Clear ( void  )

Removes all TLVs from this block.

Definition at line 162 of file packetbb.cc.

References Begin(), End(), and m_tlvList.

Referenced by ns3::PbbPacket::TlvClear(), ns3::PbbMessage::TlvClear(), and ~PbbTlvBlock().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::PbbTlvBlock::Deserialize ( Buffer::Iterator start)

Deserializes a block from the specified buffer.

Parameters
starta reference to the point in a buffer to begin deserializing.

Users should not need to call this. Blocks will be deserialized by their containing packet.

Definition at line 206 of file packetbb.cc.

References ns3::PbbTlv::Deserialize(), ns3::Buffer::Iterator::GetDistanceFrom(), PushBack(), ns3::Buffer::Iterator::ReadNtohU16(), and visualizer.core::start().

Referenced by ns3::PbbPacket::Deserialize(), and ns3::PbbMessage::Deserialize().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool ns3::PbbTlvBlock::Empty ( void  ) const
Returns
true if there are no TLVs in this block, false otherwise.

Definition at line 102 of file packetbb.cc.

References m_tlvList.

Referenced by Serialize(), ns3::PbbPacket::TlvEmpty(), and ns3::PbbMessage::TlvEmpty().

+ Here is the caller graph for this function:

PbbTlvBlock::Iterator ns3::PbbTlvBlock::End ( void  )
Returns
an iterator to the past-the-end element in this block.

Definition at line 84 of file packetbb.cc.

References m_tlvList.

Referenced by Clear(), GetSerializedSize(), operator==(), Print(), Serialize(), ns3::PbbPacket::TlvEnd(), and ns3::PbbMessage::TlvEnd().

+ Here is the caller graph for this function:

PbbTlvBlock::ConstIterator ns3::PbbTlvBlock::End ( void  ) const
Returns
a const iterator to the past-the-end element in this block.

Definition at line 90 of file packetbb.cc.

References m_tlvList.

PbbTlvBlock::Iterator ns3::PbbTlvBlock::Erase ( PbbTlvBlock::Iterator  position)

Removes the TLV at the specified position.

Parameters
positionan Iterator pointing to the TLV to erase.
Returns
an iterator pointing to the next TLV in the block.

Definition at line 150 of file packetbb.cc.

References m_tlvList.

Referenced by ns3::PbbPacket::Erase(), and ns3::PbbMessage::TlvErase().

+ Here is the caller graph for this function:

PbbTlvBlock::Iterator ns3::PbbTlvBlock::Erase ( PbbTlvBlock::Iterator  first,
PbbTlvBlock::Iterator  last 
)

Removes all TLVs from [first, last) (includes first, not includes last).

Parameters
firstan Iterator pointing to the first TLV to erase (inclusive).
lastan Iterator pointing to the element past the last TLV to erase.
Returns
an iterator pointing to the next TLV in the block.

Definition at line 156 of file packetbb.cc.

References m_tlvList.

Ptr< PbbTlv > ns3::PbbTlvBlock::Front ( void  ) const
Returns
a smart pointer to the first TLV in this block.

Definition at line 108 of file packetbb.cc.

References m_tlvList.

Referenced by ns3::PbbPacket::TlvFront(), and ns3::PbbMessage::TlvFront().

+ Here is the caller graph for this function:

uint32_t ns3::PbbTlvBlock::GetSerializedSize ( void  ) const
Returns
The size (in bytes) needed to serialize this block.

Definition at line 172 of file packetbb.cc.

References Begin(), and End().

Referenced by ns3::PbbPacket::GetSerializedSize(), and ns3::PbbMessage::GetSerializedSize().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

PbbTlvBlock::Iterator ns3::PbbTlvBlock::Insert ( PbbTlvBlock::Iterator  position,
const Ptr< PbbTlv tlv 
)

Inserts a TLV at the specified position in this block.

Parameters
positionan Iterator pointing to the position in this block to insert the TLV.
tlva smart pointer to the TLV to insert.
Returns
An iterator pointing to the newly inserted TLV.

Definition at line 144 of file packetbb.cc.

References m_tlvList.

bool ns3::PbbTlvBlock::operator!= ( const PbbTlvBlock other) const

Definition at line 272 of file packetbb.cc.

bool ns3::PbbTlvBlock::operator== ( const PbbTlvBlock other) const

Definition at line 251 of file packetbb.cc.

References Begin(), End(), and Size().

+ Here is the call graph for this function:

void ns3::PbbTlvBlock::PopBack ( void  )

Removes a TLV from the back of this block.

Definition at line 138 of file packetbb.cc.

References m_tlvList.

Referenced by ns3::PbbPacket::TlvPopBack(), and ns3::PbbMessage::TlvPopBack().

+ Here is the caller graph for this function:

void ns3::PbbTlvBlock::PopFront ( void  )

Removes a TLV from the front of this block.

Definition at line 126 of file packetbb.cc.

References m_tlvList.

Referenced by ns3::PbbPacket::TlvPopFront(), and ns3::PbbMessage::TlvPopFront().

+ Here is the caller graph for this function:

void ns3::PbbTlvBlock::Print ( std::ostream &  os) const

Pretty-prints the contents of this block.

Parameters
osa stream object to print to.

Definition at line 223 of file packetbb.cc.

Referenced by ns3::PbbPacket::Print(), and ns3::PbbMessage::Print().

+ Here is the caller graph for this function:

void ns3::PbbTlvBlock::Print ( std::ostream &  os,
int  level 
) const

Pretty-prints the contents of this block, with specified indentation.

Parameters
osa stream object to print to.
levellevel of indentation.

This probably never needs to be called by users. This is used when recursively printing sub-objects.

Definition at line 229 of file packetbb.cc.

References Begin(), End(), and Size().

+ Here is the call graph for this function:

void ns3::PbbTlvBlock::PushBack ( Ptr< PbbTlv tlv)

Appends a TLV to the back of this block.

Parameters
tlva smart pointer to the TLV to append.

Definition at line 132 of file packetbb.cc.

References m_tlvList.

Referenced by Deserialize(), ns3::PbbPacket::TlvPushBack(), and ns3::PbbMessage::TlvPushBack().

+ Here is the caller graph for this function:

void ns3::PbbTlvBlock::PushFront ( Ptr< PbbTlv tlv)

Prepends a TLV to the front of this block.

Parameters
tlva smart pointer to the TLV to prepend.

Definition at line 120 of file packetbb.cc.

References m_tlvList.

Referenced by ns3::PbbPacket::TlvPushFront(), and ns3::PbbMessage::TlvPushFront().

+ Here is the caller graph for this function:

void ns3::PbbTlvBlock::Serialize ( Buffer::Iterator start) const

Serializes this block into the specified buffer.

Parameters
starta reference to the point in a buffer to begin serializing.

Users should not need to call this. Blocks will be serialized by their containing packet.

Definition at line 184 of file packetbb.cc.

References Begin(), Empty(), End(), ns3::Buffer::Iterator::GetDistanceFrom(), ns3::Buffer::Iterator::Next(), visualizer.core::start(), and ns3::Buffer::Iterator::WriteHtonU16().

Referenced by ns3::PbbPacket::Serialize(), and ns3::PbbMessage::Serialize().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int ns3::PbbTlvBlock::Size ( void  ) const
Returns
the number of TLVs in this block.

Definition at line 96 of file packetbb.cc.

References m_tlvList.

Referenced by operator==(), Print(), ns3::PbbPacket::TlvSize(), and ns3::PbbMessage::TlvSize().

+ Here is the caller graph for this function:

Member Data Documentation

std::list< Ptr<PbbTlv> > ns3::PbbTlvBlock::m_tlvList
private

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