RingBuffer class implementation.
More...
#include <RingBuffer.hpp>
|
| | RingBuffer (uint32_t _capacity=32) |
| | Value constructor
|
| |
| | ~RingBuffer () |
| |
| void | Push (T &&_obj) |
| | Push an object to the queue Yield current thread if queue is full.
|
| |
| bool | Pop (T &_obj, std::atomic< bool > &_bIsRunning) |
| | Pop an object from the queue. Yield current thread if queue is empty.
|
| |
|
uint32_t | Size () const noexcept |
| | Current size of the queue.
|
| |
|
uint32_t | Capacity () const noexcept |
| | Maximum capacity of the queue.
|
| |
|
bool | IsEmpty () const noexcept |
| | Whether the queue is empty.
|
| |
template<typename T>
class SA::RingBuffer< T >
RingBuffer class implementation.
- Template Parameters
-
| ExcepT | Object's type to buffer. |
◆ RingBuffer()
Value constructor
- Parameters
-
◆ ~RingBuffer()
Destructor Does NOT check for remaining size before destroy.
◆ Pop()
template<typename T >
| bool SA::RingBuffer< T >::Pop |
( |
T & | _obj, |
|
|
std::atomic< bool > & | _bIsRunning ) |
Pop an object from the queue. Yield current thread if queue is empty.
- Parameters
-
| [out] | _obj | Object to pop from the queue. |
| [in] | _bIsRunning | Current running thread state. |
◆ Push()
Push an object to the queue Yield current thread if queue is full.
- Parameters
-
| [in,out] | _obj | Object to move to the queue. |
The documentation for this class was generated from the following file: