24 BufferAccumulator::ArrayFIFOBuffer ::ArrayFIFOBuffer()
25 : m_elements(nullptr),
33 BufferAccumulator::ArrayFIFOBuffer ::~ArrayFIFOBuffer() {}
39 void BufferAccumulator::ArrayFIFOBuffer ::init(
Fw::Buffer*
const elements,
41 this->m_elements = elements;
42 this->m_capacity = capacity;
50 bool BufferAccumulator::ArrayFIFOBuffer ::enqueue(
const Fw::Buffer& e) {
52 if (this->m_elements ==
nullptr) {
57 if (this->m_size < this->m_capacity) {
59 FW_ASSERT(m_enqueueIndex < this->m_capacity, m_enqueueIndex);
60 this->m_elements[this->m_enqueueIndex] = e;
61 this->m_enqueueIndex = (this->m_enqueueIndex + 1) % this->m_capacity;
71 bool BufferAccumulator::ArrayFIFOBuffer ::dequeue(
Fw::Buffer& e) {
73 if (this->m_elements ==
nullptr) {
80 if (this->m_size > 0) {
82 FW_ASSERT(m_dequeueIndex < this->m_capacity, m_dequeueIndex);
83 e = this->m_elements[this->m_dequeueIndex];
84 this->m_dequeueIndex = (this->m_dequeueIndex + 1) % this->m_capacity;
94 U32 BufferAccumulator::ArrayFIFOBuffer ::getSize()
const {
98 U32 BufferAccumulator::ArrayFIFOBuffer ::getCapacity()
const {
99 return this->m_capacity;
PlatformUIntType NATIVE_UINT_TYPE
C++ header for working with basic fprime types.