ns-3
ns3::PbbAddressTlvBlock Class Reference

A block of Address TLVs (PbbAddressTlv). More...

#include <packetbb.h>

List of all members.

Public Types

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

Public Member Functions

Iterator Begin (void)
ConstIterator Begin (void) const
Iterator End (void)
ConstIterator End (void) const
int Size (void) const
bool Empty (void) const
Ptr< PbbAddressTlvFront (void) const
Ptr< PbbAddressTlvBack (void) const
void PushFront (Ptr< PbbAddressTlv > tlv)
 Prepends an Address TLV to the front of this block.
void PopFront (void)
 Removes an AddressTLV from the front of this block.
void PushBack (Ptr< PbbAddressTlv > tlv)
 Appends an Address TLV to the back of this block.
void PopBack (void)
 Removes an Address TLV from the back of this block.
Iterator Insert (Iterator position, const Ptr< PbbAddressTlv > tlv)
 Inserts an Address TLV at the specified position in this block.
Iterator Erase (Iterator position)
 Removes the Address TLV at the specified position.
Iterator Erase (Iterator first, Iterator last)
 Removes all Address TLVs from [first, last) (includes first, not includes last).
void Clear (void)
 Removes all Address TLVs from this block.
uint32_t GetSerializedSize (void) const
void Serialize (Buffer::Iterator &start) const
 Serializes this block into the specified buffer.
void Deserialize (Buffer::Iterator &start)
 Deserializes a block from the specified buffer.
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.
bool operator== (const PbbAddressTlvBlock &other) const
bool operator!= (const PbbAddressTlvBlock &other) const

Detailed Description

A block of Address TLVs (PbbAddressTlv).

Acts similar to a C++ STL container.


Member Function Documentation

Ptr< PbbAddressTlv > ns3::PbbAddressTlvBlock::Back ( void  ) const
Returns:
the last AddressTLV in this block.

Referenced by ns3::PbbAddressBlock::TlvBack().

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

Referenced by Clear(), GetSerializedSize(), Print(), Serialize(), and ns3::PbbAddressBlock::TlvBegin().

PbbAddressTlvBlock::ConstIterator ns3::PbbAddressTlvBlock::Begin ( void  ) const
Returns:
a const iterator to the first Address TLV in this block.
void ns3::PbbAddressTlvBlock::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.

References ns3::Buffer::Iterator::GetDistanceFrom(), PushBack(), and ns3::Buffer::Iterator::ReadNtohU16().

Referenced by ns3::PbbAddressBlock::Deserialize().

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

Referenced by Serialize(), and ns3::PbbAddressBlock::TlvEmpty().

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

Referenced by Clear(), GetSerializedSize(), Print(), Serialize(), and ns3::PbbAddressBlock::TlvEnd().

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

Removes the Address TLV at the specified position.

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

Referenced by ns3::PbbAddressBlock::TlvErase().

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

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

Parameters:
firstan Iterator pointing to the first Address TLV to erase (inclusive).
lastan Iterator pointing to the element past the last Address TLV to erase.
Returns:
an iterator pointing to the next Address TLV in the block.
Ptr< PbbAddressTlv > ns3::PbbAddressTlvBlock::Front ( void  ) const
Returns:
the first Address TLV in this block.

Referenced by ns3::PbbAddressBlock::TlvFront().

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

References Begin(), and End().

Referenced by ns3::PbbAddressBlock::GetSerializedSize().

PbbAddressTlvBlock::Iterator ns3::PbbAddressTlvBlock::Insert ( PbbAddressTlvBlock::Iterator  position,
const Ptr< PbbAddressTlv tlv 
)

Inserts an Address TLV at the specified position in this block.

Parameters:
positionan Iterator pointing to the position in this block to insert the Address TLV.
tlva smart pointer to the Address TLV to insert.
Returns:
An iterator pointing to the newly inserted Address TLV.
void ns3::PbbAddressTlvBlock::Print ( std::ostream &  os) const

Pretty-prints the contents of this block.

Parameters:
osa stream object to print to.

Referenced by ns3::PbbAddressBlock::Print().

void ns3::PbbAddressTlvBlock::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.

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

void ns3::PbbAddressTlvBlock::PushBack ( Ptr< PbbAddressTlv tlv)

Appends an Address TLV to the back of this block.

Parameters:
tlva smart pointer to the Address TLV to append.

Referenced by Deserialize(), and ns3::PbbAddressBlock::TlvPushBack().

void ns3::PbbAddressTlvBlock::PushFront ( Ptr< PbbAddressTlv tlv)

Prepends an Address TLV to the front of this block.

Parameters:
tlva smart pointer to the Address TLV to prepend.

Referenced by ns3::PbbAddressBlock::TlvPushFront().

void ns3::PbbAddressTlvBlock::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.

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

Referenced by ns3::PbbAddressBlock::Serialize().

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

Referenced by Print(), and ns3::PbbAddressBlock::TlvSize().


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