![]() |
This is Unofficial EPICS BASE Doxygen Site
|
A circular buffer to store pointers. More...
Go to the source code of this file.
Macros | |
#define | epicsRingPointerSize epicsRingPointerGetSize |
Typedefs | |
typedef void * | epicsRingPointerId |
An identifier for the C API to a ring buffer storing pointers. More... | |
typedef void const * | epicsRingPointerIdConst |
Functions | |
LIBCOM_API epicsRingPointerId epicsStdCall | epicsRingPointerCreate (int size) |
Create a new ring buffer. More... | |
LIBCOM_API epicsRingPointerId epicsStdCall | epicsRingPointerLockedCreate (int size) |
Create a new ring buffer, secured by a spinlock. More... | |
LIBCOM_API void epicsStdCall | epicsRingPointerDelete (epicsRingPointerId id) |
Delete the ring buffer and free any associated memory. More... | |
LIBCOM_API int epicsStdCall | epicsRingPointerPush (epicsRingPointerId id, void *p) |
Push pointer into the ring buffer. More... | |
LIBCOM_API void *epicsStdCall | epicsRingPointerPop (epicsRingPointerId id) |
Take an element off the ring. More... | |
LIBCOM_API void epicsStdCall | epicsRingPointerFlush (epicsRingPointerId id) |
Remove all elements from the ring. More... | |
LIBCOM_API int epicsStdCall | epicsRingPointerGetFree (epicsRingPointerId id) |
Return the amount of empty space in the ring buffer. More... | |
LIBCOM_API int epicsStdCall | epicsRingPointerGetUsed (epicsRingPointerId id) |
Return the number of elements stored in the ring buffer. More... | |
LIBCOM_API int epicsStdCall | epicsRingPointerGetSize (epicsRingPointerId id) |
Return the size of the ring. More... | |
LIBCOM_API int epicsStdCall | epicsRingPointerIsEmpty (epicsRingPointerId id) |
Check if the ring buffer is currently empty. More... | |
LIBCOM_API int epicsStdCall | epicsRingPointerIsFull (epicsRingPointerId id) |
Check if the ring buffer is currently full. More... | |
LIBCOM_API int epicsStdCall | epicsRingPointerGetHighWaterMark (epicsRingPointerIdConst id) |
Get the Highwater mark of the ring buffer. More... | |
LIBCOM_API void epicsStdCall | epicsRingPointerResetHighWaterMark (epicsRingPointerId id) |
Reset the Highwater mark of the ring buffer. More... | |
A circular buffer to store pointers.
epicsRingPointer.h provides both C and C++ APIs for creating and using ring buffers (first in first out circular buffers) that store pointers. The unlocked kind is designed so that one writer thread and one reader thread can access the ring simultaneously without requiring mutual exclusion. The locked variant uses an epicsSpinLock, and works with any numbers of writer and reader threads.
Definition in file epicsRingPointer.h.
#define epicsRingPointerSize epicsRingPointerGetSize |
Definition at line 207 of file epicsRingPointer.h.
typedef void* epicsRingPointerId |
An identifier for the C API to a ring buffer storing pointers.
Definition at line 118 of file epicsRingPointer.h.
typedef void const* epicsRingPointerIdConst |
Definition at line 119 of file epicsRingPointer.h.
LIBCOM_API epicsRingPointerId epicsStdCall epicsRingPointerCreate | ( | int | size | ) |
Create a new ring buffer.
size | Size of ring buffer to create |
Definition at line 27 of file epicsRingPointer.cpp.
LIBCOM_API void epicsStdCall epicsRingPointerDelete | ( | epicsRingPointerId | id | ) |
Delete the ring buffer and free any associated memory.
id | Ring buffer identifier |
Definition at line 39 of file epicsRingPointer.cpp.
LIBCOM_API void epicsStdCall epicsRingPointerFlush | ( | epicsRingPointerId | id | ) |
Remove all elements from the ring.
id | Ring buffer identifier |
Definition at line 57 of file epicsRingPointer.cpp.
LIBCOM_API int epicsStdCall epicsRingPointerGetFree | ( | epicsRingPointerId | id | ) |
Return the amount of empty space in the ring buffer.
id | Ring buffer identifier |
Definition at line 63 of file epicsRingPointer.cpp.
LIBCOM_API int epicsStdCall epicsRingPointerGetHighWaterMark | ( | epicsRingPointerIdConst | id | ) |
Get the Highwater mark of the ring buffer.
Returns the largest number of elements the ring buffer has held since the water mark was last reset. A new ring buffer starts with a water mark of 0.
id | Ring buffer identifier |
Definition at line 93 of file epicsRingPointer.cpp.
LIBCOM_API int epicsStdCall epicsRingPointerGetSize | ( | epicsRingPointerId | id | ) |
Return the size of the ring.
id | Ring buffer identifier |
size
given when the ring was created. Definition at line 75 of file epicsRingPointer.cpp.
LIBCOM_API int epicsStdCall epicsRingPointerGetUsed | ( | epicsRingPointerId | id | ) |
Return the number of elements stored in the ring buffer.
id | Ring buffer identifier |
Definition at line 69 of file epicsRingPointer.cpp.
LIBCOM_API int epicsStdCall epicsRingPointerIsEmpty | ( | epicsRingPointerId | id | ) |
Check if the ring buffer is currently empty.
id | Ring buffer identifier |
Definition at line 81 of file epicsRingPointer.cpp.
LIBCOM_API int epicsStdCall epicsRingPointerIsFull | ( | epicsRingPointerId | id | ) |
Check if the ring buffer is currently full.
id | Ring buffer identifier |
Definition at line 87 of file epicsRingPointer.cpp.
LIBCOM_API epicsRingPointerId epicsStdCall epicsRingPointerLockedCreate | ( | int | size | ) |
Create a new ring buffer, secured by a spinlock.
size | Size of ring buffer to create |
Definition at line 33 of file epicsRingPointer.cpp.
LIBCOM_API void* epicsStdCall epicsRingPointerPop | ( | epicsRingPointerId | id | ) |
Take an element off the ring.
id | Ring buffer identifier |
Definition at line 45 of file epicsRingPointer.cpp.
LIBCOM_API int epicsStdCall epicsRingPointerPush | ( | epicsRingPointerId | id, |
void * | p | ||
) |
Push pointer into the ring buffer.
id | Ring buffer identifier |
p | Pointer to be pushed to the ring |
Definition at line 51 of file epicsRingPointer.cpp.
LIBCOM_API void epicsStdCall epicsRingPointerResetHighWaterMark | ( | epicsRingPointerId | id | ) |
Reset the Highwater mark of the ring buffer.
The Highwater mark will be set to the current usage
id | Ring buffer identifier |
Definition at line 99 of file epicsRingPointer.cpp.