etk::Fifo< MY_TYPE > Class Template Reference

#include <Fifo.hpp>

Public Member Functions

 Fifo ()
 
 ~Fifo ()
 
bool wait (MY_TYPE &_data)
 
bool wait (MY_TYPE &_data, uint32_t _timeOutInUs)
 
int32_t count ()
 
void post (MY_TYPE &_data)
 
void post (const MY_TYPE &_data)
 
void clean ()
 

Detailed Description

template<class MY_TYPE = int32_t>
class etk::Fifo< MY_TYPE >

Fifo tamplate is a simple messaged fifo element to transfer data message from a thead to an other.

Parameters
[in]MY_TYPEType of the fifo message are tranfered.

Constructor & Destructor Documentation

§ Fifo()

template<class MY_TYPE = int32_t>
etk::Fifo< MY_TYPE >::Fifo ( )
inline

Create a fifo with no message.

§ ~Fifo()

template<class MY_TYPE = int32_t>
etk::Fifo< MY_TYPE >::~Fifo ( )
inline

Remove the fifo and all message inside.

Member Function Documentation

§ clean()

template<class MY_TYPE = int32_t>
void etk::Fifo< MY_TYPE >::clean ( )
inline

Remove all the message in the fifo.

§ count()

template<class MY_TYPE = int32_t>
int32_t etk::Fifo< MY_TYPE >::count ( )
inline

Get the number of message in the fifo.

Returns
Number of message in the fifo.

§ post() [1/2]

template<class MY_TYPE = int32_t>
void etk::Fifo< MY_TYPE >::post ( MY_TYPE &  _data)
inline

Send a message at the other thread by setting a new message in the fifo.

Parameters
[in]_dataNew data to add at the fifo.

§ post() [2/2]

template<class MY_TYPE = int32_t>
void etk::Fifo< MY_TYPE >::post ( const MY_TYPE &  _data)
inline

Send a message at the other thread by setting a new message in the fifo.

Parameters
[in]_dataNew data to add at the fifo.

§ wait() [1/2]

template<class MY_TYPE = int32_t>
bool etk::Fifo< MY_TYPE >::wait ( MY_TYPE &  _data)
inline

Wait a message from the other thread. (no timeout set)

Parameters
[out]_dataData find in the fifo.
Returns
true A data has been find.
false No data found or closed fifo

§ wait() [2/2]

template<class MY_TYPE = int32_t>
bool etk::Fifo< MY_TYPE >::wait ( MY_TYPE &  _data,
uint32_t  _timeOutInUs 
)
inline

Wait a message from the other thread, with a specified timeout.

Parameters
[out]_datakeeped data from the fifo.
[in]_timeOutInUsTime-out to wait a message in the fifo. It mightbespecify in micro-second.
Returns
true We keep a massage.
false No message found while time-out appear.

The documentation for this class was generated from the following file:
  • framework/atria-soft/etk/etk/os/Fifo.hpp