12 #ifndef INCLUDE_DISTORTOS_INTERNAL_SYNCHRONIZATION_FIFOQUEUEBASE_HPP_ 13 #define INCLUDE_DISTORTOS_INTERNAL_SYNCHRONIZATION_FIFOQUEUEBASE_HPP_ 126 Semaphore& postSemaphore,
void*& storage);
154 #endif // INCLUDE_DISTORTOS_INTERNAL_SYNCHRONIZATION_FIFOQUEUEBASE_HPP_ void * writePosition_
pointer to first free slot available for writing
Definition: FifoQueueBase.hpp:144
Semaphore is the basic synchronization primitive.
Definition: Semaphore.hpp:30
FifoQueueBase(StorageUniquePointer &&storageUniquePointer, size_t elementSize, size_t maxElements)
FifoQueueBase's constructor.
Definition: FifoQueueBase.cpp:26
const StorageUniquePointer storageUniquePointer_
storage for queue elements
Definition: FifoQueueBase.hpp:135
Semaphore popSemaphore_
semaphore guarding access to "pop" functions - its value is equal to the number of available elements
Definition: FifoQueueBase.hpp:129
int pop(const SemaphoreFunctor &waitSemaphoreFunctor, const QueueFunctor &functor)
Implementation of pop() using type-erased functor.
Definition: FifoQueueBase.hpp:83
~FifoQueueBase()
FifoQueueBase's destructor.
Definition: FifoQueueBase.cpp:39
void * readPosition_
pointer to first element available for reading
Definition: FifoQueueBase.hpp:141
const void *const storageEnd_
pointer to past-the-last element of storage for queue elements
Definition: FifoQueueBase.hpp:138
Value getMaxValue() const
Definition: Semaphore.hpp:71
std::unique_ptr< void, void(&)(void *)> StorageUniquePointer
unique_ptr (with deleter) to storage
Definition: FifoQueueBase.hpp:34
FifoQueueBase class implements basic functionality of FifoQueue template class.
Definition: FifoQueueBase.hpp:29
Top-level namespace of distortos project.
Definition: buttons.hpp:33
QueueFunctor class header.
size_t getElementSize() const
Definition: FifoQueueBase.hpp:66
SemaphoreFunctor is a type-erased interface for functors which execute some action on semaphore (wait...
Definition: SemaphoreFunctor.hpp:34
size_t getCapacity() const
Definition: FifoQueueBase.hpp:57
int popPush(const SemaphoreFunctor &waitSemaphoreFunctor, const QueueFunctor &functor, Semaphore &waitSemaphore, Semaphore &postSemaphore, void *&storage)
Implementation of pop() and push() using type-erased functor.
Definition: FifoQueueBase.cpp:48
QueueFunctor is a type-erased interface for functors which execute some action on queue's storage (li...
Definition: QueueFunctor.hpp:31
SemaphoreFunctor class header.
int push(const SemaphoreFunctor &waitSemaphoreFunctor, const QueueFunctor &functor)
Implementation of push() using type-erased functor.
Definition: FifoQueueBase.hpp:100
Semaphore pushSemaphore_
semaphore guarding access to "push" functions - its value is equal to the number of free slots
Definition: FifoQueueBase.hpp:132
const size_t elementSize_
size of single queue element, bytes
Definition: FifoQueueBase.hpp:147