LockFreeDMA_Queue
This implements a simple lock-free FIFO queue (single producer, single consumer)
See: DMA_Queue
Inherits from: DMA_Queue
Public Functions
| virtual bool | isEmpty() |
| Query if this object is empty. | |
| virtual bool | isFull() |
| Query if this object is full. | |
| LockFreeDMA_Queue(BlitOp * mem, atomic_t n) | |
| Constructs a lock-free queue. | |
| virtual void | pushCopyOf(const BlitOp & op) |
| Adds the specified blitop to the queue. | |
Protected Functions
| virtual const BlitOp * | first() |
| Gets the first element in the queue. | |
| virtual void | pop() |
| Pops an element from the queue. | |
Protected Attributes
| atomic_t | capacity |
| The number of elements the queue can contain. | |
| atomic_t | head |
| Index to the head element. | |
| BlitOp * | q |
| Pointer to the queue memory. | |
| atomic_t | tail |
| Index to the tail element. | |
Additional inherited members
Public Functions inherited from DMA_Queue
| virtual | ~DMA_Queue() |
| Finalizes an instance of the DMA_Queue class. | |
Protected Functions inherited from DMA_Queue
Public Functions Documentation
isEmpty
| virtual bool isEmpty | ( | ) |
Query if this object is empty.
true if the queue is empty.
Reimplements: touchgfx::DMA_Queue::isEmpty
isFull
| virtual bool isFull | ( | ) |
Query if this object is full.
true if the queue is full.
Reimplements: touchgfx::DMA_Queue::isFull
LockFreeDMA_Queue
| LockFreeDMA_Queue | ( | BlitOp * | mem , | ||
| atomic_t | n | ||||
| ) |
Constructs a lock-free queue.
| mem | Pointer to the memory used by the queue to store elements. |
| n | Number of elements the memory provided can contain. |
pushCopyOf
| virtual void pushCopyOf | ( | const BlitOp & | op | ) | |
Adds the specified blitop to the queue.
| op | The blitop to add. |
Reimplements: touchgfx::DMA_Queue::pushCopyOf
Protected Functions Documentation
first
| virtual const BlitOp * first | ( | ) |
Gets the first element in the queue.
The first element in the queue.
Reimplements: touchgfx::DMA_Queue::first
pop
| virtual void pop | ( | ) |
Pops an element from the queue.
Reimplements: touchgfx::DMA_Queue::pop
Protected Attributes Documentation
capacity
atomic_t capacity
The number of elements the queue can contain.
head
atomic_t head
Index to the head element.
q
BlitOp * q
Pointer to the queue memory.
tail
atomic_t tail
Index to the tail element.