跳轉到主要內容

LockFreeDMA_Queue

touchgfx/hal/DMA.hpp

This implements a simple lock-free FIFO queue (single producer, single consumer)

See: DMA_Queue

Inherits from: DMA_Queue

Public Functions

virtual boolisEmpty()
Query if this object is empty.
virtual boolisFull()
Query if this object is full.
LockFreeDMA_Queue(BlitOp * mem, atomic_t n)
Constructs a lock-free queue.
virtual voidpushCopyOf(const BlitOp & op)
Adds the specified blitop to the queue.

Protected Functions

virtual const BlitOp *first()
Gets the first element in the queue.
virtual voidpop()
Pops an element from the queue.

Protected Attributes

atomic_tcapacity
The number of elements the queue can contain.
atomic_thead
Index to the head element.
BlitOp *q
Pointer to the queue memory.
atomic_ttail
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

DMA_Queue()
Initializes a new instance of the DMA_Queue class.

Public Functions Documentation

isEmpty

virtual bool isEmpty()

Query if this object is empty.

Returns:

true if the queue is empty.

Reimplements: touchgfx::DMA_Queue::isEmpty

isFull

virtual bool isFull()

Query if this object is full.

Returns:

true if the queue is full.

Reimplements: touchgfx::DMA_Queue::isFull

LockFreeDMA_Queue

LockFreeDMA_Queue(BlitOp *mem ,
atomic_tn
)

Constructs a lock-free queue.

Parameters:
memPointer to the memory used by the queue to store elements.
nNumber of elements the memory provided can contain.

pushCopyOf

virtual void pushCopyOf(const BlitOp &op)

Adds the specified blitop to the queue.

Parameters:
opThe blitop to add.

Reimplements: touchgfx::DMA_Queue::pushCopyOf

Protected Functions Documentation

first

virtual const BlitOp * first()

Gets the first element in the queue.

Returns:

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.

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.