Write context type, which allows efficient and safe reading.
To read data: 1) Construct ReadContext. This spin-waits for data to be available if it is not already (see also HasData()). 2) Read data from the pointer returned by GetData(). 3) Destroy ReadContext. This released the data back to the buffer, allowing it to be overwritten by the producer.
Name | Description |
---|---|
~ReadContext() | Destructor, releases data back to buffer. |
GetData() | Get the data to read. |
ReadContext(RingBuffer &) | Construct read context, waiting if data is not available. |
public: ~ReadContext()
Destructor, releases data back to buffer.
public: void * GetData() const
Get the data to read.
public: ReadContext
(
RingBuffer & buffer
)
Construct read context, waiting if data is not available.