Nil RTOS
Public Member Functions | List of all members
NilFIFO< Type, Size > Class Template Reference

A thread safe FIFO. More...

#include <NilFIFO.h>

Public Member Functions

size_t dataCount ()
 
size_t freeCount ()
 
 NilFIFO ()
 
void signalData ()
 
void signalFree ()
 
Type * waitData (systime_t time)
 
Type * waitFree (systime_t time)
 

Detailed Description

template<typename Type, size_t Size>
class NilFIFO< Type, Size >

A thread safe FIFO.

A FIFO for a single producer/consumer pair.

Constructor & Destructor Documentation

template<typename Type , size_t Size>
NilFIFO< Type, Size >::NilFIFO ( )
inline

constructor

Member Function Documentation

template<typename Type , size_t Size>
size_t NilFIFO< Type, Size >::dataCount ( )
inline
Returns
count of data records in the FIFO.
template<typename Type , size_t Size>
size_t NilFIFO< Type, Size >::freeCount ( )
inline
Returns
count of free records in the FIFO.
template<typename Type , size_t Size>
void NilFIFO< Type, Size >::signalData ( )
inline

Signal that a data record is ready.

Note
Must only be called in producer thread.
template<typename Type , size_t Size>
void NilFIFO< Type, Size >::signalFree ( )
inline

Signal that a record is free.

Note
Must only be called in consumer thread.
template<typename Type , size_t Size>
Type* NilFIFO< Type, Size >::waitData ( systime_t  time)
inline

Wait for a data record.

Parameters
[in]timethe number of ticks before the operation timeouts, the following special values are allowed:
  • TIME_IMMEDIATE immediate timeout.
  • TIME_INFINITE no timeout.
Note
Must only be called in consumer thread.
Returns
pointer to the data record or null if no data record is availabile.
template<typename Type , size_t Size>
Type* NilFIFO< Type, Size >::waitFree ( systime_t  time)
inline

Wait for a free record.

Parameters
[in]timethe number of ticks before the operation timeouts, the following special values are allowed:
  • TIME_IMMEDIATE immediate timeout.
  • TIME_INFINITE no timeout.
Note
Must only be called in producer thread.
Returns
pointer to the free record or null if no free record is availabile.

The documentation for this class was generated from the following file: