ns-3
|
A block of packet or message TLVs (PbbTlv). More...
#include <packetbb.h>
Public Types | |
typedef std::list< Ptr< PbbTlv > >::iterator | Iterator |
typedef std::list< Ptr< PbbTlv > >::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< PbbTlv > | Front (void) const |
Ptr< PbbTlv > | Back (void) const |
void | PushFront (Ptr< PbbTlv > tlv) |
Prepends a TLV to the front of this block. | |
void | PopFront (void) |
Removes a TLV from the front of this block. | |
void | PushBack (Ptr< PbbTlv > tlv) |
Appends a TLV to the back of this block. | |
void | PopBack (void) |
Removes a TLV from the back of this block. | |
Iterator | Insert (Iterator position, const Ptr< PbbTlv > tlv) |
Inserts a TLV at the specified position in this block. | |
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). | |
void | Clear (void) |
Removes all 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 PbbTlvBlock &other) const |
bool | operator!= (const PbbTlvBlock &other) const |
A block of packet or message TLVs (PbbTlv).
Acts similar to a C++ STL container. Should not be used for Address TLVs.
Ptr< PbbTlv > ns3::PbbTlvBlock::Back | ( | void | ) | const |
Referenced by ns3::PbbPacket::TlvBack(), and ns3::PbbMessage::TlvBack().
PbbTlvBlock::Iterator ns3::PbbTlvBlock::Begin | ( | void | ) |
Referenced by Clear(), GetSerializedSize(), Print(), Serialize(), ns3::PbbPacket::TlvBegin(), and ns3::PbbMessage::TlvBegin().
PbbTlvBlock::ConstIterator ns3::PbbTlvBlock::Begin | ( | void | ) | const |
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.
References ns3::Buffer::Iterator::GetDistanceFrom(), PushBack(), and ns3::Buffer::Iterator::ReadNtohU16().
Referenced by ns3::PbbPacket::Deserialize(), and ns3::PbbMessage::Deserialize().
bool ns3::PbbTlvBlock::Empty | ( | void | ) | const |
Referenced by Serialize(), ns3::PbbPacket::TlvEmpty(), and ns3::PbbMessage::TlvEmpty().
PbbTlvBlock::Iterator ns3::PbbTlvBlock::End | ( | void | ) |
Referenced by Clear(), GetSerializedSize(), Print(), Serialize(), ns3::PbbPacket::TlvEnd(), and ns3::PbbMessage::TlvEnd().
PbbTlvBlock::ConstIterator ns3::PbbTlvBlock::End | ( | void | ) | const |
PbbTlvBlock::Iterator ns3::PbbTlvBlock::Erase | ( | PbbTlvBlock::Iterator | position | ) |
Removes the TLV at the specified position.
position | an Iterator pointing to the TLV to erase. |
Referenced by ns3::PbbPacket::Erase(), and ns3::PbbMessage::TlvErase().
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. |
Ptr< PbbTlv > ns3::PbbTlvBlock::Front | ( | void | ) | const |
Referenced by ns3::PbbPacket::TlvFront(), and ns3::PbbMessage::TlvFront().
uint32_t ns3::PbbTlvBlock::GetSerializedSize | ( | void | ) | const |
References Begin(), and End().
Referenced by ns3::PbbPacket::GetSerializedSize(), and ns3::PbbMessage::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. |
void ns3::PbbTlvBlock::Print | ( | std::ostream & | os | ) | const |
Pretty-prints the contents of this block.
os | a stream object to print to. |
Referenced by ns3::PbbPacket::Print(), and ns3::PbbMessage::Print().
void ns3::PbbTlvBlock::Print | ( | std::ostream & | os, |
int | level | ||
) | const |
void ns3::PbbTlvBlock::PushBack | ( | Ptr< PbbTlv > | tlv | ) |
Appends a TLV to the back of this block.
tlv | a smart pointer to the TLV to append. |
Referenced by Deserialize(), ns3::PbbPacket::TlvPushBack(), and ns3::PbbMessage::TlvPushBack().
void ns3::PbbTlvBlock::PushFront | ( | Ptr< PbbTlv > | tlv | ) |
Prepends a TLV to the front of this block.
tlv | a smart pointer to the TLV to prepend. |
Referenced by ns3::PbbPacket::TlvPushFront(), and ns3::PbbMessage::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.
References Begin(), Empty(), End(), ns3::Buffer::Iterator::GetDistanceFrom(), ns3::Buffer::Iterator::Next(), and ns3::Buffer::Iterator::WriteHtonU16().
Referenced by ns3::PbbPacket::Serialize(), and ns3::PbbMessage::Serialize().
int ns3::PbbTlvBlock::Size | ( | void | ) | const |
Referenced by Print(), ns3::PbbPacket::TlvSize(), and ns3::PbbMessage::TlvSize().