Write context type, which allows efficient and safe writing.
To write data: 1) Construct WriteContext with the desired size and alignment. This reserves space in the buffer. 2) Write data to the pointer returned by GetAllocation(). 3) Destroy WriteContext. This commits the write, allowing it to be read by the consumer.
Name | Description |
---|---|
~WriteContext() | Destructor, commits data to buffer. |
GetAllocation() | Get the pointer to the data to be written. |
WriteContext(RingBuffer &, u32, u32) | Construct write context, reserving space in the buffer. |
public: ~WriteContext()
Destructor, commits data to buffer.
public: void * GetAllocation() const
Get the pointer to the data to be written.
public: WriteContext
(
RingBuffer & buffer,
u32 size,
u32 alignment
)
Construct write context, reserving space in the buffer.