This is the documentation for Enlighten.
Ring Buffer class.
Stores values of any type in a fixed length buffer. Thread safe for single writer single reader only.
| Name | Description |
|---|---|
| Geo::RingBuffer::ReadContext | Write context type, which allows efficient and safe reading. |
| Geo::RingBuffer::WriteContext | Write context type, which allows efficient and safe writing. |
| Name | Description |
|---|---|
| GetMaxBlockedDurationTicks() | Return the maximum duration that the writing thread was blocked due to the buffer being full. |
| GetNumBlockedWrites() | Return the number of recorded blocked writes. |
| HasData() | Do we have any data to read? |
| RecordBlockedDuration(s64) | Record that the writing thread was blocked due to the buffer being full. |
| ResetBlockedWritesCounter() | Reset the counters which keep track of # of times buffer writes are blocked. |
| RingBuffer(u32, const u32) | Construct a new ring buffer with the given size and maximum allocation alignment. |
| Write(T &&) | Helper function to write an object to the buffer. |
public: Geo::s64 GetMaxBlockedDurationTicks() const
Return the maximum duration that the writing thread was blocked due to the buffer being full.
public: Geo::s32 GetNumBlockedWrites() const
Return the number of recorded blocked writes.
public: bool HasData() const
Do we have any data to read?
public: void RecordBlockedDuration
(
s64 durationTicks
)
Record that the writing thread was blocked due to the buffer being full.
public: void ResetBlockedWritesCounter()
Reset the counters which keep track of # of times buffer writes are blocked.
public: RingBuffer
(
u32 size,
const u32 maxAlignment
)
Construct a new ring buffer with the given size and maximum allocation alignment.
Size must
public: void Write
(
T && data
)
Helper function to write an object to the buffer.
Not necessarily the most efficient way, as it uses the default alignment of the buffer.