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...

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 659 of file buffer.h.

Member Data Documentation

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 665 of file buffer.h.

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

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 684 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().

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 679 of file buffer.h.

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

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 674 of file buffer.h.

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

uint32_t ns3::Buffer::Data::m_size

the size of the m_data field below.

Definition at line 669 of file buffer.h.

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


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