LibJuno 1.0.1
LibJuno is a lightweight C11 library designed specifically for embedded systems.
Loading...
Searching...
No Matches
juno::buff Namespace Reference

Data Structures

struct  QUEUE_API_T
 
struct  STACK_API_T
 The stack buffer api. More...
 

Functions

template<typename T , const size_t N>
struct QUEUE_ROOT_T JUNO_MODULE_ROOT (JUNO_MODULE_ARG(QUEUE_API_T< T, N >), ARRAY_T< T, N > tArrBuff;size_t iStartIndex;size_t zLength;)
 
template<typename T , const size_t N>
struct STACK_ROOT_T JUNO_MODULE_ROOT (JUNO_MODULE_ARG(STACK_API_T< T, N >), ARRAY_T< T, N > tArrBuff;size_t zLength;)
 The stack root module.
 
template<typename T , const size_t N>
JUNO_STATUS_T Enqueue (QUEUE_ROOT_T< T, N > &tQueue, T tData)
 
template<typename T , const size_t N>
RESULT_T< TDequeue (QUEUE_ROOT_T< T, N > &tQueue)
 
template<typename T , const size_t N>
RESULT_T< T * > QueuePeek (QUEUE_ROOT_T< T, N > &tQueue)
 
template<typename T , const size_t N>
struct JUNO_QUEUE_T JUNO_MODULE_DERIVE (JUNO_MODULE_ARG(QUEUE_ROOT_T< T, N >), static JUNO_STATUS_T New(QUEUE_ROOT_T< T, N > &tQueue, const QUEUE_API_T< T, N > &tApi, JUNO_FAILURE_HANDLER_T pfcnFailureHandler, JUNO_USER_DATA_T *pvFailureUserData) { auto &tNew=reinterpret_cast< JUNO_QUEUE_T< T, N > & >(tQueue);tNew.tRoot.ptApi=&tApi;tNew.tRoot._pfcnFailureHandler=pfcnFailureHandler;tNew.tRoot._pvFailureUserData=pvFailureUserData;tNew.tRoot.iStartIndex=0;tNew.tRoot.zLength=0;return JUNO_STATUS_SUCCESS;} static constexpr QUEUE_API_T< T, N > NewApi() { return {Enqueue< T, N >, Dequeue< T, N >, QueuePeek< T, N >};})
 
template<typename T , const size_t N>
JUNO_STATUS_T Push (STACK_ROOT_T< T, N > &tStack, T tData)
 
template<typename T , const size_t N>
RESULT_T< TPop (STACK_ROOT_T< T, N > &tStack)
 
template<typename T , const size_t N>
RESULT_T< T * > StackPeek (STACK_ROOT_T< T, N > &tStack)
 
template<typename T , const size_t N>
struct JUNO_STACK_T JUNO_MODULE_DERIVE (JUNO_MODULE_ARG(STACK_ROOT_T< T, N >), static JUNO_STATUS_T New(STACK_ROOT_T< T, N > &tStack, const STACK_API_T< T, N > &tApi, JUNO_FAILURE_HANDLER_T pfcnFailureHandler, JUNO_USER_DATA_T *pvFailureUserData) { auto &tNew=reinterpret_cast< JUNO_STACK_T< T, N > & >(tStack);tNew.tRoot.ptApi=&tApi;tNew.tRoot._pfcnFailureHandler=pfcnFailureHandler;tNew.tRoot._pvFailureUserData=pvFailureUserData;tNew.tRoot.zLength=0;return JUNO_STATUS_SUCCESS;} static constexpr STACK_API_T< T, N > NewApi() { return {Push< T, N >, Pop< T, N >, StackPeek< T, N >};})
 

Function Documentation

◆ Dequeue()

template<typename T , const size_t N>
RESULT_T< T > juno::buff::Dequeue ( QUEUE_ROOT_T< T, N > &  tQueue)

◆ Enqueue()

template<typename T , const size_t N>
JUNO_STATUS_T juno::buff::Enqueue ( QUEUE_ROOT_T< T, N > &  tQueue,
T  tData 
)

◆ JUNO_MODULE_DERIVE() [1/2]

template<typename T , const size_t N>
struct JUNO_QUEUE_T juno::buff::JUNO_MODULE_DERIVE ( JUNO_MODULE_ARG(QUEUE_ROOT_T< T, N >)  ,
static JUNO_STATUS_T New(QUEUE_ROOT_T< T, N > &tQueue, const QUEUE_API_T< T, N > &tApi, JUNO_FAILURE_HANDLER_T pfcnFailureHandler, JUNO_USER_DATA_T *pvFailureUserData) { auto &tNew=reinterpret_cast< JUNO_QUEUE_T< T, N > & >(tQueue);tNew.tRoot.ptApi=&tApi;tNew.tRoot._pfcnFailureHandler=pfcnFailureHandler;tNew.tRoot._pvFailureUserData=pvFailureUserData;tNew.tRoot.iStartIndex=0;tNew.tRoot.zLength=0;return JUNO_STATUS_SUCCESS;} static constexpr QUEUE_API_T< T, N > NewApi() { return {Enqueue< T, N >, Dequeue< T, N >, QueuePeek< T, N >};}   
)

◆ JUNO_MODULE_DERIVE() [2/2]

template<typename T , const size_t N>
struct JUNO_STACK_T juno::buff::JUNO_MODULE_DERIVE ( JUNO_MODULE_ARG(STACK_ROOT_T< T, N >)  ,
static JUNO_STATUS_T New(STACK_ROOT_T< T, N > &tStack, const STACK_API_T< T, N > &tApi, JUNO_FAILURE_HANDLER_T pfcnFailureHandler, JUNO_USER_DATA_T *pvFailureUserData) { auto &tNew=reinterpret_cast< JUNO_STACK_T< T, N > & >(tStack);tNew.tRoot.ptApi=&tApi;tNew.tRoot._pfcnFailureHandler=pfcnFailureHandler;tNew.tRoot._pvFailureUserData=pvFailureUserData;tNew.tRoot.zLength=0;return JUNO_STATUS_SUCCESS;} static constexpr STACK_API_T< T, N > NewApi() { return {Push< T, N >, Pop< T, N >, StackPeek< T, N >};}   
)

◆ JUNO_MODULE_ROOT() [1/2]

template<typename T , const size_t N>
struct QUEUE_ROOT_T juno::buff::JUNO_MODULE_ROOT ( JUNO_MODULE_ARG(QUEUE_API_T< T, N >)  ,
ARRAY_T< T, N > tArrBuff;size_t iStartIndex;size_t zLength  
)

The queue root implementation

◆ JUNO_MODULE_ROOT() [2/2]

template<typename T , const size_t N>
struct STACK_ROOT_T juno::buff::JUNO_MODULE_ROOT ( JUNO_MODULE_ARG(STACK_API_T< T, N >)  ,
ARRAY_T< T, N > tArrBuff;size_t zLength  
)

The stack root module.

◆ Pop()

template<typename T , const size_t N>
RESULT_T< T > juno::buff::Pop ( STACK_ROOT_T< T, N > &  tStack)

◆ Push()

template<typename T , const size_t N>
JUNO_STATUS_T juno::buff::Push ( STACK_ROOT_T< T, N > &  tStack,
T  tData 
)

◆ QueuePeek()

template<typename T , const size_t N>
RESULT_T< T * > juno::buff::QueuePeek ( QUEUE_ROOT_T< T, N > &  tQueue)

◆ StackPeek()

template<typename T , const size_t N>
RESULT_T< T * > juno::buff::StackPeek ( STACK_ROOT_T< T, N > &  tStack)