#include <tag-buffer.h>
Public Member Functions | |
TAG_BUFFER_INLINE void | WriteU8 (uint8_t v) |
TAG_BUFFER_INLINE void | WriteU16 (uint16_t v) |
TAG_BUFFER_INLINE void | WriteU32 (uint32_t v) |
void | WriteU64 (uint64_t v) |
void | WriteDouble (double v) |
void | Write (const uint8_t *buffer, uint32_t size) |
TAG_BUFFER_INLINE uint8_t | ReadU8 (void) |
TAG_BUFFER_INLINE uint16_t | ReadU16 (void) |
TAG_BUFFER_INLINE uint32_t | ReadU32 (void) |
uint64_t | ReadU64 (void) |
double | ReadDouble (void) |
void | Read (uint8_t *buffer, uint32_t size) |
This class allows subclasses of the ns3::Tag base class to serialize and deserialize their data through a stream-like API. This class keeps track of the "current" point in the buffer and advances that "current" point everytime data is written. The in-memory format of the data written by this class is unspecified.
If the user attempts to write more data in the buffer than he allocated with Tag::GetSerializedSize, he will trigger an NS_ASSERT error.
void ns3::TagBuffer::Read | ( | uint8_t * | buffer, | |
uint32_t | size | |||
) |
buffer | a pointer to the buffer where data should be written. | |
size | the number of bytes to read. |
double ns3::TagBuffer::ReadDouble | ( | void | ) |
uint16_t ns3::TagBuffer::ReadU16 | ( | void | ) |
References ReadU8().
uint32_t ns3::TagBuffer::ReadU32 | ( | void | ) |
References ReadU8().
uint64_t ns3::TagBuffer::ReadU64 | ( | void | ) |
uint8_t ns3::TagBuffer::ReadU8 | ( | void | ) |
void ns3::TagBuffer::Write | ( | const uint8_t * | buffer, | |
uint32_t | size | |||
) |
buffer | a pointer to data to write | |
size | the size of the data to write |
void ns3::TagBuffer::WriteDouble | ( | double | v | ) |
v | the value to write |
void ns3::TagBuffer::WriteU16 | ( | uint16_t | v | ) |
v | the value to write |
References WriteU8().
void ns3::TagBuffer::WriteU32 | ( | uint32_t | v | ) |
v | the value to write |
References WriteU8().
void ns3::TagBuffer::WriteU64 | ( | uint64_t | v | ) |
v | the value to write |
void ns3::TagBuffer::WriteU8 | ( | uint8_t | v | ) |
v | the value to write |
References NS_ASSERT.
Referenced by WriteU16(), and WriteU32().