ns3::Buffer::Buffer::Iterator Class Reference
iterator in a
Buffer instance
More...
#include <buffer.h>
List of all members.
Detailed Description
iterator in a
Buffer instance
Member Function Documentation
uint16_t ns3::Buffer::Buffer::Iterator::CalculateIpChecksum |
( |
uint16_t |
size, |
|
|
uint32_t |
initialChecksum | |
|
) |
| | |
Calculate the checksum.
- Parameters:
-
| size | size of the buffer. |
| initialChecksum | initial value |
- Returns:
- checksum
uint16_t ns3::Buffer::Buffer::Iterator::CalculateIpChecksum |
( |
uint16_t |
size |
) |
|
Calculate the checksum.
- Parameters:
-
- Returns:
- checksum
uint32_t ns3::Buffer::Buffer::Iterator::GetDistanceFrom |
( |
Iterator const & |
o |
) |
const |
- Parameters:
-
- Returns:
- number of bytes included between the two iterators
This method works only if the two iterators point to the same underlying buffer. Debug builds ensure this with an assert.
uint32_t ns3::Buffer::Buffer::Iterator::GetSize |
( |
void |
|
) |
const |
- Returns:
- the size of the underlying buffer we are iterating
bool ns3::Buffer::Buffer::Iterator::IsEnd |
( |
void |
|
) |
const |
- Returns:
- true if this iterator points to the end of the byte array. false otherwise.
bool ns3::Buffer::Buffer::Iterator::IsStart |
( |
void |
|
) |
const |
- Returns:
- true if this iterator points to the start of the byte array. false otherwise.
void ns3::Buffer::Buffer::Iterator::Next |
( |
uint32_t |
delta |
) |
|
- Parameters:
-
| delta | number of bytes to go forward |
void ns3::Buffer::Buffer::Iterator::Next |
( |
void |
|
) |
|
void ns3::Buffer::Buffer::Iterator::Prev |
( |
uint32_t |
delta |
) |
|
- Parameters:
-
| delta | number of bytes to go backward |
void ns3::Buffer::Buffer::Iterator::Prev |
( |
void |
|
) |
|
void ns3::Buffer::Buffer::Iterator::Read |
( |
uint8_t * |
buffer, |
|
|
uint32_t |
size | |
|
) |
| | |
- Parameters:
-
| buffer | buffer to copy data into |
| size | number of bytes to copy |
Copy size bytes of data from the internal buffer to the input buffer and avance the
Iterator by the number of bytes read.
uint16_t ns3::Buffer::Buffer::Iterator::ReadLsbtohU16 |
( |
void |
|
) |
|
- Returns:
- the two bytes read in the buffer.
Read data and advance the
Iterator by the number of bytes read. The data is read in network format and return in host format.
uint32_t ns3::Buffer::Buffer::Iterator::ReadLsbtohU32 |
( |
void |
|
) |
|
- Returns:
- the four bytes read in the buffer.
Read data and advance the
Iterator by the number of bytes read. The data is read in network format and return in host format.
uint64_t ns3::Buffer::Buffer::Iterator::ReadLsbtohU64 |
( |
void |
|
) |
|
- Returns:
- the eight bytes read in the buffer.
Read data and advance the
Iterator by the number of bytes read. The data is read in network format and return in host format.
uint16_t ns3::Buffer::Buffer::Iterator::ReadNtohU16 |
( |
void |
|
) |
|
- Returns:
- the two bytes read in the buffer.
Read data and advance the
Iterator by the number of bytes read. The data is read in network format and return in host format.
uint32_t ns3::Buffer::Buffer::Iterator::ReadNtohU32 |
( |
void |
|
) |
|
- Returns:
- the four bytes read in the buffer.
Read data and advance the
Iterator by the number of bytes read. The data is read in network format and return in host format.
uint64_t ns3::Buffer::Buffer::Iterator::ReadNtohU64 |
( |
void |
|
) |
|
- Returns:
- the eight bytes read in the buffer.
Read data and advance the
Iterator by the number of bytes read. The data is read in network format and return in host format.
uint16_t ns3::Buffer::Buffer::Iterator::ReadU16 |
( |
void |
|
) |
|
- Returns:
- the two bytes read in the buffer.
Read data and advance the
Iterator by the number of bytes read. The data is read in the format written by writeU16.
uint32_t ns3::Buffer::Buffer::Iterator::ReadU32 |
( |
void |
|
) |
|
- Returns:
- the four bytes read in the buffer.
Read data and advance the
Iterator by the number of bytes read. The data is read in the format written by writeU32.
uint64_t ns3::Buffer::Buffer::Iterator::ReadU64 |
( |
void |
|
) |
|
- Returns:
- the eight bytes read in the buffer.
Read data and advance the
Iterator by the number of bytes read. The data is read in the format written by writeU64.
uint8_t ns3::Buffer::Buffer::Iterator::ReadU8 |
( |
void |
|
) |
|
- Returns:
- the byte read in the buffer.
Read data and advance the
Iterator by the number of bytes read.
References NS_ASSERT.
- Parameters:
-
| start | the start of the data to copy |
| end | the end of the data to copy |
Write the data delimited by start and end in internal buffer and avance the iterator position by the number of bytes copied. The input interators _must_ not point to the same
Buffer as we do to avoid overlapping copies. This is enforced in debug builds by asserts.
void ns3::Buffer::Buffer::Iterator::Write |
( |
uint8_t const * |
buffer, |
|
|
uint32_t |
size | |
|
) |
| | |
- Parameters:
-
| buffer | a byte buffer to copy in the internal buffer. |
| size | number of bytes to copy. |
Write the data in buffer and avance the iterator position by size bytes.
void ns3::Buffer::Buffer::Iterator::WriteHtolsbU16 |
( |
uint16_t |
data |
) |
|
- Parameters:
-
| data | data to write in buffer |
Write the data in buffer and avance the iterator position by two bytes. The data is written in network order and the input data is expected to be in host order.
void ns3::Buffer::Buffer::Iterator::WriteHtolsbU32 |
( |
uint32_t |
data |
) |
|
- Parameters:
-
| data | data to write in buffer |
Write the data in buffer and avance the iterator position by four bytes. The data is written in least significant byte order and the input data is expected to be in host order.
void ns3::Buffer::Buffer::Iterator::WriteHtolsbU64 |
( |
uint64_t |
data |
) |
|
- Parameters:
-
| data | data to write in buffer |
Write the data in buffer and avance the iterator position by eight bytes. The data is written in least significant byte order and the input data is expected to be in host order.
void ns3::Buffer::Buffer::Iterator::WriteHtonU16 |
( |
uint16_t |
data |
) |
|
- Parameters:
-
| data | data to write in buffer |
Write the data in buffer and avance the iterator position by two bytes. The data is written in least significant byte order and the input data is expected to be in host order.
void ns3::Buffer::Buffer::Iterator::WriteHtonU32 |
( |
uint32_t |
data |
) |
|
- Parameters:
-
| data | data to write in buffer |
Write the data in buffer and avance the iterator position by four bytes. The data is written in network order and the input data is expected to be in host order.
void ns3::Buffer::Buffer::Iterator::WriteHtonU64 |
( |
uint64_t |
data |
) |
|
- Parameters:
-
| data | data to write in buffer |
Write the data in buffer and avance the iterator position by eight bytes. The data is written in network order and the input data is expected to be in host order.
void ns3::Buffer::Buffer::Iterator::WriteU16 |
( |
uint16_t |
data |
) |
|
- Parameters:
-
| data | data to write in buffer |
Write the data in buffer and avance the iterator position by two bytes. The format of the data written in the byte buffer is non-portable. We only ensure that readU16 will return exactly what we wrote with writeU16 if the program is run on the same machine.
void ns3::Buffer::Buffer::Iterator::WriteU32 |
( |
uint32_t |
data |
) |
|
- Parameters:
-
| data | data to write in buffer |
Write the data in buffer and avance the iterator position by four bytes. The format of the data written in the byte buffer is non-portable. We only ensure that readU32 will return exactly what we wrote with writeU32 if the program is run on the same machine.
void ns3::Buffer::Buffer::Iterator::WriteU64 |
( |
uint64_t |
data |
) |
|
- Parameters:
-
| data | data to write in buffer |
Write the data in buffer and avance the iterator position by eight bytes. The format of the data written in the byte buffer is non-portable. We only ensure that readU64 will return exactly what we wrote with writeU64 if the program is run on the same machine.
void ns3::Buffer::Buffer::Iterator::WriteU8 |
( |
uint8_t |
data, |
|
|
uint32_t |
len | |
|
) |
| | |
- Parameters:
-
| data | data to write in buffer |
| len | number of times data must be written in buffer |
Write the data in buffer len times and avance the iterator position by len byte.
References NS_ASSERT.
void ns3::Buffer::Buffer::Iterator::WriteU8 |
( |
uint8_t |
data |
) |
|
- Parameters:
-
| data | data to write in buffer |
Write the data in buffer and avance the iterator position by one byte.
References NS_ASSERT.
The documentation for this class was generated from the following file: