43#if !defined(CMN_SIMPLE_FIFO_H)
44#define CMN_SIMPLE_FIFO_H
102 uint8_t* m_pChunk[2];
123typedef void* (*CMN_SimpleFifoCopierFunc)(
124 void* pCopierFuncExtInfo,
210 const void* pElement,
247 const void* pElement,
250 void* pCopierFuncExtInfo);
292 const void* pElement,
350 const void* pElement,
355 void* pCopierFuncExtInfo);
428 void* pCopierFuncExtInfo);
490static inline size_t CMN_SimpleFifoPeek(
631 void* pCopierFuncExtInfo);
size_t CMN_SimpleFifoGetDataSizeOfPeekHandle(const CMN_SimpleFifoPeekHandle *pPeekHandle)
Get total size of data in peek handle.
size_t CMN_SimpleFifoOfferWithSpecificCopier(CMN_SimpleFifoHandle *pHandle, const void *pElement, size_t sz, CMN_SimpleFifoCopierFunc copierFunc, void *pCopierFuncExtInfo)
Insert data to the FIFO using the specified copier.
size_t CMN_SimpleFifoCopyFromPeekHandleWithSpecificCopier(const CMN_SimpleFifoPeekHandle *pPeekHandle, void *pDest, size_t sz, CMN_SimpleFifoCopierFunc copierFunc, void *pCopierFuncExtInfo)
Copy data pointed by PeekHandle using specific copier.
void *(* CMN_SimpleFifoCopierFunc)(void *pCopierFuncExtInfo, void *pDest, const void *pSrc, size_t sz)
Definition of data copier function.
Definition: CMN_SimpleFifo.h:123
size_t CMN_SimpleFifoPoll(CMN_SimpleFifoHandle *pHandle, void *pElement, size_t sz)
Retrieves data on the head of FIFO and removes it from the FIFO using the default copier(memcpy like)...
size_t CMN_SimpleFifoPollWithSpecificCopier(CMN_SimpleFifoHandle *pHandle, void *pElement, size_t sz, CMN_SimpleFifoCopierFunc copierFunc, void *pCopierFuncExtInfo)
Retrieves data on the head of FIFO and removes it from the FIFO using the specified copier.
size_t CMN_SimpleFifoCopyFromPeekHandle(const CMN_SimpleFifoPeekHandle *pPeekHandle, void *pDest, size_t sz)
Copy data pointed by PeekHandle using default copier(memcpy like).
size_t CMN_SimpleFifoPeekWithOffset(const CMN_SimpleFifoHandle *pHandle, CMN_SimpleFifoPeekHandle *pPeekHandle, size_t sz, size_t offset)
Retrieves data on the offset from head of the FIFO but does not remove from the FIFO.
size_t CMN_SimpleFifoOfferContinuousWithSpecificCopier(CMN_SimpleFifoHandle *pHandle, const void *pElement, size_t sz, int fallback, size_t *pGap, CMN_SimpleFifoCopierFunc copierFunc, void *pCopierFuncExtInfo)
Insert data to the FIFO with Continuous Region Option using the specified copier.
void CMN_SimpleFifoClear(CMN_SimpleFifoHandle *pHandle)
Reset the RP/WP of the FIFO.
size_t CMN_SimpleFifoOfferContinuous(CMN_SimpleFifoHandle *pHandle, const void *pElement, size_t sz, int fallback, size_t *pGap)
Insert data to the FIFO with Continuous Region Option using the default copier(memcpy like).
int CMN_SimpleFifoInitialize(CMN_SimpleFifoHandle *pHandle, void *pFifoBuffer, size_t szFifoBuffer, void *pExtInfo)
Initialize FIFO.
size_t CMN_SimpleFifoGetVacantSize(const CMN_SimpleFifoHandle *pHandle)
Get vacant size of the FIFO.
size_t CMN_SimpleFifoGetOccupiedSize(const CMN_SimpleFifoHandle *pHandle)
Get occupied size of the FIFO.
void * CMN_SimpleFifoGetExtInfo(const CMN_SimpleFifoHandle *pHandle)
Get the value of the ExtInfo set to the FIFO.
size_t CMN_SimpleFifoOffer(CMN_SimpleFifoHandle *pHandle, const void *pElement, size_t sz)
Insert data to the FIFO using the default copier(memcpy like).
size_t m_rp
Read Pointer. Index of the m_pBuf.
Definition: CMN_SimpleFifo.h:83
size_t m_size
Size of the internal ring buffer. Available size if m_size - 1 because one element is used as a separ...
Definition: CMN_SimpleFifo.h:81
void * m_pExtInfo
Info set to the fifo. CMN_SimpleFifo APIs never refer/modify it. Use CMN_SimpleFifoGetExtInfo() to re...
Definition: CMN_SimpleFifo.h:80
uint8_t * m_pBuf
Internal ring buffer.
Definition: CMN_SimpleFifo.h:79
size_t m_wp
Write Pointer. Index of the m_pBuf.
Definition: CMN_SimpleFifo.h:82
FIFO handle which holds data required to manipulate FIFO.
Definition: CMN_SimpleFifo.h:78
Data handle used for CMN_SimpleFifoPeek().
Definition: CMN_SimpleFifo.h:101