#include <DataFifo.h>
|
int | setup (const std::string &name, size_t msgSize, size_t maxMsg, bool blocking, bool recreate=true) |
|
int | send (const char *buf, size_t size) |
|
int | receive (char *buf, double timeoutMs=0) |
|
int | cleanup () |
|
Uni-directional RT-safe-queue. A light wrapper around __wrap_mq_...
int DataFifo::setup |
( |
const std::string & |
name, |
|
|
size_t |
msgSize, |
|
|
size_t |
maxMsg, |
|
|
bool |
blocking, |
|
|
bool |
recreate = true |
|
) |
| |
Set queue
- Parameters
-
name | name of queue (should start with / and contain no other / ) |
msgSize | maximum size of each message in the queue (bytes) |
maxMsg | maximum number of messages in the queue |
blocking | set to 1 if queue should block when reading and not data is available, 0 for non-blocking |
recreate | if a queue with the same name already exists, destroy it and create a new one (this is the only way the msgSize and maxMsg parameters can be enforced). |
- Returns
- 0 on success,
-errno
otherwise
int DataFifo::send |
( |
const char * |
buf, |
|
|
size_t |
size |
|
) |
| |
Send buffer to queue
- Parameters
-
buf | buffer containing data to send |
size | maximum size of each message |
- Returns
- 0 on success,
-errno
otherwise
int DataFifo::receive |
( |
char * |
buf, |
|
|
double |
timeoutMs = 0 |
|
) |
| |
Receive buffer from queue
- Parameters
-
buf | buffer to write the received data into. This must have space for at least size bytes, as passed to setup() |
- Returns
- size of message on success,
-errno
otherwise
int DataFifo::cleanup |
( |
| ) |
|
Cleanup queue
- Returns
- 0 on success,
-errno
otherwise
The documentation for this class was generated from the following file: