A Discrete-Event Network Simulator
API
ns3::Buffer::Data Struct Reference

This data structure is variable-sized through its last member whose size is determined at allocation time and stored in the m_size field. More...

+ Collaboration diagram for ns3::Buffer::Data:

Public Attributes

uint32_t m_count
 The reference count of an instance of this data structure. More...
 
uint8_t m_data [1]
 The real data buffer holds at least one byte. More...
 
uint32_t m_dirtyEnd
 offset from the start of the m_data field below to the end of the area in which user bytes were written. More...
 
uint32_t m_dirtyStart
 offset from the start of the m_data field below to the start of the area in which user bytes were written. More...
 
uint32_t m_size
 the size of the m_data field below. More...
 

Detailed Description

This data structure is variable-sized through its last member whose size is determined at allocation time and stored in the m_size field.

The so-called "dirty area" describes the area in the buffer which has been reserved and used by a user. Multiple Buffer instances may reference the same Buffer::Data object instance and may reference different parts of the underlying byte buffer. The "dirty area" is union of all the areas referenced by the Buffer instances which reference the same BufferData instance. New user data can be safely written only outside of the "dirty area" if the reference count is higher than 1 (that is, if more than one Buffer instance references the same BufferData).

Definition at line 662 of file buffer.h.

Member Data Documentation

◆ m_count

uint32_t ns3::Buffer::Data::m_count

The reference count of an instance of this data structure.

Each buffer which references an instance holds a count.

Definition at line 668 of file buffer.h.

Referenced by ns3::Buffer::Buffer(), ns3::Buffer::~Buffer(), ns3::Buffer::AddAtEnd(), ns3::Buffer::AddAtStart(), ns3::Buffer::CheckInternalState(), and ns3::Buffer::operator=().

◆ m_data

uint8_t ns3::Buffer::Data::m_data[1]

The real data buffer holds at least one byte.

Its real size is stored in the m_size field.

Definition at line 687 of file buffer.h.

Referenced by ns3::Buffer::AddAtEnd(), ns3::Buffer::AddAtStart(), ns3::Buffer::Iterator::Construct(), ns3::Buffer::CopyData(), ns3::Buffer::CreateFullCopy(), ns3::Buffer::PeekData(), and ns3::Buffer::Serialize().

◆ m_dirtyEnd

uint32_t ns3::Buffer::Data::m_dirtyEnd

offset from the start of the m_data field below to the end of the area in which user bytes were written.

Definition at line 682 of file buffer.h.

Referenced by ns3::Buffer::AddAtEnd(), ns3::Buffer::AddAtStart(), ns3::Buffer::CheckInternalState(), and ns3::Buffer::Initialize().

◆ m_dirtyStart

uint32_t ns3::Buffer::Data::m_dirtyStart

offset from the start of the m_data field below to the start of the area in which user bytes were written.

Definition at line 677 of file buffer.h.

Referenced by ns3::Buffer::AddAtEnd(), ns3::Buffer::AddAtStart(), ns3::Buffer::CheckInternalState(), and ns3::Buffer::Initialize().

◆ m_size

uint32_t ns3::Buffer::Data::m_size

the size of the m_data field below.

Definition at line 672 of file buffer.h.

Referenced by ns3::Buffer::CheckInternalState(), and ns3::Buffer::Initialize().


The documentation for this struct was generated from the following file: