RTXI  2.4
The Real-Time eXperiment Interface Documentation
Public Member Functions
Fifo Class Reference

#include <fifo.h>

Collaboration diagram for Fifo:
Collaboration graph

Public Member Functions

 Fifo (size_t)
 
 ~Fifo (void)
 
size_t read (void *, size_t, bool=true)
 
size_t write (const void *, size_t)
 

Detailed Description

Simple FIFO(First In First Out) for data transfer between components in RTXI

See also
AtomicFifo

Definition at line 31 of file fifo.h.

Constructor & Destructor Documentation

◆ Fifo()

Fifo::Fifo(size_t s)

FIFO constructor. Builds a simple FIFO object.

Parameters
sSize of the FIFO

Definition at line 26 of file fifo.cpp.

◆ ~Fifo()

Fifo::~Fifo(void )

FIFO Destructor

Definition at line 34 of file fifo.cpp.

Member Function Documentation

◆ read()

size_t Fifo::read(void * buffer,
size_t n,
bool blocking = true 
)

Read the data stored in the FIFO. clears out the data after the operation is complete.

Parameters
bufferThe buffer where the data from the buffer should be written to
sizeThe size of the data to read from the buffer
blockingWhether the thread should expect to be blocked or not
Returns
n Number of elements read. Same as size.

Definition at line 42 of file fifo.cpp.

◆ write()

size_t Fifo::write(const void * buffer,
size_t n 
)

Write to the FIFO.

Parameters
bufferThe buffer holding the data to write to the FIFO.
sizeThe size of the data to read from the buffer
Returns
n Number of elements written. Same as size.

Definition at line 81 of file fifo.cpp.

Here is the call graph for this function:

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