Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

class Geo::RingBuffer

Ring Buffer class.

Stores values of any type in a fixed length buffer. Thread safe for single writer single reader only.

Classes

NameDescription
Geo::RingBuffer::ReadContext

Write context type, which allows efficient and safe reading.

Geo::RingBuffer::WriteContext

Write context type, which allows efficient and safe writing.

Functions

NameDescription
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?

NonCopyable(NonCopyable &&)

Defaulted to allow move.

operator=(NonCopyable &&)

Defaulted to allow move.

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.


Anchor
ad28b3639c601ad26c3e65ae1355a37fa
ad28b3639c601ad26c3e65ae1355a37fa

Geo::s64 Geo::RingBuffer::GetMaxBlockedDurationTicks

...

public: Geo::s64 GetMaxBlockedDurationTicks() const

...

Return the maximum duration that the writing thread was blocked due to the buffer being full.


Anchor
a8c4d1260533aaf9cd32024150b3c67b8
a8c4d1260533aaf9cd32024150b3c67b8

Geo::s32 Geo::RingBuffer::GetNumBlockedWrites

...

public: Geo::s32 GetNumBlockedWrites() const

...

Return the number of recorded blocked writes.


Anchor
ae477e5df74ccffe77d5501d6506e0323
ae477e5df74ccffe77d5501d6506e0323

bool Geo::RingBuffer::HasData

...

public: bool HasData() const

...

Do we have any data to read?


Anchor
adaed81b4c59f263dcb4e78c4126f4683
adaed81b4c59f263dcb4e78c4126f4683

Geo::NonCopyable::NonCopyable

...

public: NonCopyable
(
    NonCopyable &&
)

...

Defaulted to allow move.


Anchor
a6abc781e23b8f4864e0b868806e0acbf
a6abc781e23b8f4864e0b868806e0acbf

NonCopyable& Geo::NonCopyable::operator=

...

public: NonCopyable & operator=
(
    NonCopyable &&
)

...

Defaulted to allow move.


Anchor
ab04a009c603177894331dd5d26cd0dee
ab04a009c603177894331dd5d26cd0dee

void Geo::RingBuffer::RecordBlockedDuration

...

public: void RecordBlockedDuration
(
    s64 durationTicks
)

...

Record that the writing thread was blocked due to the buffer being full.


Anchor
aeb9b1a405ff1fb615c5c55f14db8a7f8
aeb9b1a405ff1fb615c5c55f14db8a7f8

void Geo::RingBuffer::ResetBlockedWritesCounter

...

public: void ResetBlockedWritesCounter()

...

Reset the counters which keep track of # of times buffer writes are blocked.


Anchor
aea9ae4a15d1dc92b9bde9bb7cbac33ef
aea9ae4a15d1dc92b9bde9bb7cbac33ef

Geo::RingBuffer::RingBuffer

...

public: RingBuffer
(
    u32 size,
    const u32 maxAlignment
)

...

Construct a new ring buffer with the given size and maximum allocation alignment.

Size must

...


Anchor
a17e845b8d025d2dc3a017b1f83bf90c4
a17e845b8d025d2dc3a017b1f83bf90c4

void Geo::RingBuffer::Write

...

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.