RTXI 3.0.0 The Real-Time eXperiment Interface Reference Manual |
#include <fifo.hpp>
Public Member Functions | |
Fifo ()=default | |
Fifo (const Fifo &fifo)=delete | |
Fifo & | operator= (const Fifo &fifo)=delete |
Fifo (Fifo &&)=default | |
Fifo & | operator= (Fifo &&)=default |
virtual | ~Fifo ()=default |
virtual int64_t | read (void *buf, size_t data_size)=0 |
virtual int64_t | write (void *buf, size_t data_size)=0 |
virtual int64_t | readRT (void *buf, size_t data_size)=0 |
virtual int64_t | writeRT (void *buf, size_t data_size)=0 |
virtual size_t | getCapacity ()=0 |
virtual void | poll ()=0 |
virtual void | close ()=0 |
Simple FIFO(First In First Out) for data transfer between RTXI threads
This data structure is a fundamental component to the inter-process communication between threads spawned by RTXI. In particular this is used for communication between the real-time thread and non-realtime(UI) threads. This is platform and interface dependent, so the FIFO primitive used in posix interface will be different than Xenomai's evl interface
This structure should not be used between two threads of the same priority. It is meant only for realtime and non-realtime thread communications. In the case where you need communication between two ui threads, consider using a message queue. for communication between two RT threads, use the underlying OS provided IPCs.
| default |
| delete |
| default |
| virtualdefault |
| pure virtual |
Closes the handle stored and prevents reading from the ui side
Implemented in RT::OS::xenomaiFifo, RT::OS::posixFifo, RT::OS::evlFifo, and RT::OS::xbuffFifo.
| pure virtual |
Get the memory capacity of the fifo
Implemented in RT::OS::xenomaiFifo, RT::OS::posixFifo, RT::OS::evlFifo, and RT::OS::xbuffFifo.
| pure virtual |
Checks whether there is available data to read on the non-rt side
This function is primarily for non-rt threads to wait on available data from the rt thread. It blocks (sleeps) the calling thread until woken by data availability. SHOULD NOT RUN IN REAL TIME!!
Implemented in RT::OS::xenomaiFifo, RT::OS::posixFifo, RT::OS::evlFifo, and RT::OS::xbuffFifo.
| pure virtual |
Read the data stored in the FIFO written by realtime thread. Must be run from non-rt thread.
buf | The buffer where the data from the buffer should be written to |
data_size | The size of the data to read from the buffer |
Implemented in RT::OS::posixFifo, RT::OS::xbuffFifo, RT::OS::xenomaiFifo, and RT::OS::evlFifo.
| pure virtual |
Read the data stored in the FIFO written by non-RT thread. Must be run from realtime thread.
buf | The buffer where the data from the buffer should be written to |
data_size | The size of the data to read from the buffer |
Implemented in RT::OS::posixFifo, RT::OS::xbuffFifo, RT::OS::xenomaiFifo, and RT::OS::evlFifo.
| pure virtual |
Write to the FIFO storage for the realtime thread. Must be run from non-rt thread.
buf | The buffer holding the data to write to the FIFO. |
data_size | The size of the data to read from the buffer |
Implemented in RT::OS::posixFifo, RT::OS::xbuffFifo, RT::OS::xenomaiFifo, and RT::OS::evlFifo.
| pure virtual |
Write to the FIFO storage for the non-RT thread. Must be run from realtime thread.
buf | The buffer holding the data to write to the FIFO. |
data_size | The size of the data to read from the buffer |
Implemented in RT::OS::posixFifo, RT::OS::xbuffFifo, RT::OS::xenomaiFifo, and RT::OS::evlFifo.