A block of packet or message TLVs (PbbTlv). More...
#include "packetbb.h"
Public Types | |
typedef std::list< Ptr< PbbTlv > >::const_iterator | ConstIterator |
PbbTlv container const iterator. | |
typedef std::list< Ptr< PbbTlv > >::iterator | Iterator |
PbbTlv container iterator. | |
Public Member Functions | |
PbbTlvBlock () | |
~PbbTlvBlock () | |
Ptr< PbbTlv > | Back () const |
Iterator | Begin () |
ConstIterator | Begin () const |
void | Clear () |
Removes all TLVs from this block. | |
void | Deserialize (Buffer::Iterator &start) |
Deserializes a block from the specified buffer. | |
bool | Empty () const |
Iterator | End () |
ConstIterator | End () const |
Iterator | Erase (Iterator first, Iterator last) |
Removes all TLVs from [first, last) (includes first, not includes last). | |
Iterator | Erase (Iterator position) |
Removes the TLV at the specified position. | |
Ptr< PbbTlv > | Front () const |
uint32_t | GetSerializedSize () 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 |
Inequality operator for PbbTlvBlock. | |
bool | operator== (const PbbTlvBlock &other) const |
Equality operator for PbbTlvBlock. | |
void | PopBack () |
Removes a TLV from the back of this block. | |
void | PopFront () |
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 () const |
Private Attributes | |
std::list< Ptr< PbbTlv > > | m_tlvList |
PbbTlv container. | |
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 45 of file packetbb.h.
typedef std::list<Ptr<PbbTlv>>::const_iterator ns3::PbbTlvBlock::ConstIterator |
PbbTlv container const iterator.
Definition at line 51 of file packetbb.h.
typedef std::list<Ptr<PbbTlv>>::iterator ns3::PbbTlvBlock::Iterator |
PbbTlv container iterator.
Definition at line 49 of file packetbb.h.
ns3::PbbTlvBlock::PbbTlvBlock | ( | ) |
Definition at line 54 of file packetbb.cc.
References NS_LOG_FUNCTION.
ns3::PbbTlvBlock::~PbbTlvBlock | ( | ) |
Definition at line 59 of file packetbb.cc.
References Clear(), and NS_LOG_FUNCTION.
Definition at line 115 of file packetbb.cc.
References m_tlvList, and NS_LOG_FUNCTION.
Referenced by ns3::PbbMessage::TlvBack(), ns3::PbbMessage::TlvBack(), ns3::PbbPacket::TlvBack(), and ns3::PbbPacket::TlvBack().
PbbTlvBlock::Iterator ns3::PbbTlvBlock::Begin | ( | ) |
Definition at line 66 of file packetbb.cc.
References m_tlvList, and NS_LOG_FUNCTION.
Referenced by Clear(), GetSerializedSize(), operator==(), Print(), Serialize(), ns3::PbbMessage::TlvBegin(), ns3::PbbMessage::TlvBegin(), ns3::PbbPacket::TlvBegin(), and ns3::PbbPacket::TlvBegin().
PbbTlvBlock::ConstIterator ns3::PbbTlvBlock::Begin | ( | ) | const |
Definition at line 73 of file packetbb.cc.
References m_tlvList, and NS_LOG_FUNCTION.
void ns3::PbbTlvBlock::Clear | ( | ) |
Removes all TLVs from this block.
Definition at line 171 of file packetbb.cc.
References Begin(), End(), m_tlvList, and NS_LOG_FUNCTION.
Referenced by ~PbbTlvBlock(), ns3::PbbMessage::TlvClear(), and ns3::PbbPacket::TlvClear().
void ns3::PbbTlvBlock::Deserialize | ( | Buffer::Iterator & | start | ) |
Deserializes a block from the specified buffer.
start | a 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 218 of file packetbb.cc.
References ns3::Create(), NS_LOG_FUNCTION, and PushBack().
Referenced by ns3::PbbMessage::Deserialize(), and ns3::PbbPacket::Deserialize().
bool ns3::PbbTlvBlock::Empty | ( | ) | const |
Definition at line 101 of file packetbb.cc.
References m_tlvList, and NS_LOG_FUNCTION.
Referenced by Serialize(), ns3::PbbMessage::TlvEmpty(), and ns3::PbbPacket::TlvEmpty().
PbbTlvBlock::Iterator ns3::PbbTlvBlock::End | ( | ) |
Definition at line 80 of file packetbb.cc.
References m_tlvList, and NS_LOG_FUNCTION.
Referenced by Clear(), GetSerializedSize(), operator==(), Print(), Serialize(), ns3::PbbMessage::TlvEnd(), ns3::PbbMessage::TlvEnd(), ns3::PbbPacket::TlvEnd(), and ns3::PbbPacket::TlvEnd().
PbbTlvBlock::ConstIterator ns3::PbbTlvBlock::End | ( | ) | const |
Definition at line 87 of file packetbb.cc.
References m_tlvList, and NS_LOG_FUNCTION.
PbbTlvBlock::Iterator ns3::PbbTlvBlock::Erase | ( | PbbTlvBlock::Iterator | first, |
PbbTlvBlock::Iterator | last ) |
Removes all TLVs from [first, last) (includes first, not includes last).
first | an Iterator pointing to the first TLV to erase (inclusive). |
last | an Iterator pointing to the element past the last TLV to erase. |
Definition at line 164 of file packetbb.cc.
References m_tlvList, and NS_LOG_FUNCTION.
PbbTlvBlock::Iterator ns3::PbbTlvBlock::Erase | ( | PbbTlvBlock::Iterator | position | ) |
Removes the TLV at the specified position.
position | an Iterator pointing to the TLV to erase. |
Definition at line 157 of file packetbb.cc.
References m_tlvList, and NS_LOG_FUNCTION.
Referenced by ns3::PbbPacket::Erase(), ns3::PbbPacket::Erase(), ns3::PbbMessage::TlvErase(), and ns3::PbbMessage::TlvErase().
Definition at line 108 of file packetbb.cc.
References m_tlvList, and NS_LOG_FUNCTION.
Referenced by ns3::PbbMessage::TlvFront(), ns3::PbbMessage::TlvFront(), ns3::PbbPacket::TlvFront(), and ns3::PbbPacket::TlvFront().
uint32_t ns3::PbbTlvBlock::GetSerializedSize | ( | ) | const |
Definition at line 182 of file packetbb.cc.
References Begin(), End(), and NS_LOG_FUNCTION.
Referenced by ns3::PbbMessage::GetSerializedSize(), and ns3::PbbPacket::GetSerializedSize().
PbbTlvBlock::Iterator ns3::PbbTlvBlock::Insert | ( | PbbTlvBlock::Iterator | position, |
const Ptr< PbbTlv > | tlv ) |
Inserts a TLV at the specified position in this block.
position | an Iterator pointing to the position in this block to insert the TLV. |
tlv | a smart pointer to the TLV to insert. |
Definition at line 150 of file packetbb.cc.
References m_tlvList, and NS_LOG_FUNCTION.
bool ns3::PbbTlvBlock::operator!= | ( | const PbbTlvBlock & | other | ) | const |
Inequality operator for PbbTlvBlock.
other | PbbTlvBlock to compare this one to |
Definition at line 286 of file packetbb.cc.
bool ns3::PbbTlvBlock::operator== | ( | const PbbTlvBlock & | other | ) | const |
Equality operator for PbbTlvBlock.
other | PbbTlvBlock to compare this one to |
Definition at line 266 of file packetbb.cc.
References Begin(), End(), and Size().
void ns3::PbbTlvBlock::PopBack | ( | ) |
Removes a TLV from the back of this block.
Definition at line 143 of file packetbb.cc.
References m_tlvList, and NS_LOG_FUNCTION.
Referenced by ns3::PbbMessage::TlvPopBack(), and ns3::PbbPacket::TlvPopBack().
void ns3::PbbTlvBlock::PopFront | ( | ) |
Removes a TLV from the front of this block.
Definition at line 129 of file packetbb.cc.
References m_tlvList, and NS_LOG_FUNCTION.
Referenced by ns3::PbbMessage::TlvPopFront(), and ns3::PbbPacket::TlvPopFront().
void ns3::PbbTlvBlock::Print | ( | std::ostream & | os | ) | const |
Pretty-prints the contents of this block.
os | a stream object to print to. |
Definition at line 236 of file packetbb.cc.
References NS_LOG_FUNCTION, and Print().
Referenced by ns3::PbbMessage::Print(), ns3::PbbPacket::Print(), and Print().
void ns3::PbbTlvBlock::Print | ( | std::ostream & | os, |
int | level ) const |
Pretty-prints the contents of this block, with specified indentation.
os | a stream object to print to. |
level | level of indentation. |
This probably never needs to be called by users. This is used when recursively printing sub-objects.
Definition at line 243 of file packetbb.cc.
References Begin(), End(), NS_LOG_FUNCTION, and Size().
Appends a TLV to the back of this block.
tlv | a smart pointer to the TLV to append. |
Definition at line 136 of file packetbb.cc.
References m_tlvList, and NS_LOG_FUNCTION.
Referenced by Deserialize(), ns3::PbbMessage::TlvPushBack(), and ns3::PbbPacket::TlvPushBack().
Prepends a TLV to the front of this block.
tlv | a smart pointer to the TLV to prepend. |
Definition at line 122 of file packetbb.cc.
References m_tlvList, and NS_LOG_FUNCTION.
Referenced by ns3::PbbMessage::TlvPushFront(), and ns3::PbbPacket::TlvPushFront().
void ns3::PbbTlvBlock::Serialize | ( | Buffer::Iterator & | start | ) | const |
Serializes this block into the specified buffer.
start | a 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 195 of file packetbb.cc.
References Begin(), Empty(), End(), ns3::Buffer::Iterator::Next(), NS_LOG_FUNCTION, and ns3::Buffer::Iterator::WriteHtonU16().
Referenced by ns3::PbbMessage::Serialize(), and ns3::PbbPacket::Serialize().
int ns3::PbbTlvBlock::Size | ( | ) | const |
Definition at line 94 of file packetbb.cc.
References m_tlvList, and NS_LOG_FUNCTION.
Referenced by operator==(), Print(), ns3::PbbMessage::TlvSize(), and ns3::PbbPacket::TlvSize().
PbbTlv container.
Definition at line 201 of file packetbb.h.
Referenced by Back(), Begin(), Begin(), Clear(), Empty(), End(), End(), Erase(), Erase(), Front(), Insert(), PopBack(), PopFront(), PushBack(), PushFront(), and Size().