Bela
Real-time, ultra-low-latency audio and sensor processing system for BeagleBone Black
|
#include <Pipe.h>
Public Member Functions | |
Pipe (const std::string &pipeName, size_t size=65536 *128, bool newBlockingRt=false, bool newBlockingNonRt=false) | |
Pipe (Pipe &&)=delete | |
bool | setup (const std::string &pipeName=defaultName, size_t size=65536 *128, bool newBlockingRt=false, bool newBlockingNonRt=false) |
void | cleanup () |
void | setBlockingRt (bool blocking) |
void | setBlockingNonRt (bool blocking) |
void | setTimeoutMsRt (double timeoutMs) |
void | setTimeoutMsNonRt (double timeoutMs) |
template<typename T > | |
bool | writeNonRt (const T &data) |
template<typename T > | |
bool | writeNonRt (T *ptr, size_t count) |
template<typename T > | |
bool | writeRt (const T &data) |
template<typename T > | |
bool | writeRt (T *ptr, size_t count) |
template<typename T > | |
ssize_t | readNonRt (T &dest) |
template<typename T > | |
ssize_t | readNonRt (T *dest, size_t count) |
template<typename T > | |
ssize_t | readRt (T &dest) |
template<typename T > | |
ssize_t | readRt (T *dest, size_t count) |
A bi-directional pipe to exchange data between a RT and a non-RT thread.
bool Pipe::setup | ( | const std::string & | pipeName = defaultName , |
size_t | size = 65536 * 128 , |
||
bool | newBlockingRt = false , |
||
bool | newBlockingNonRt = false |
||
) |
Initialise the Pipe.
the | name of the Pipe. Pipes with the same name share data. |
the | size of the Pipe. This is the amount of data that can be stored in the pipe. If the pipe is full, writes will fail. |
whether | reads at the RT side should be blocking (can be modified later) |
whether | reads at the non-RT side should be blocking (can be modified later) |
void Pipe::setBlockingRt | ( | bool | blocking | ) |
Set whether reads at the RT side should be blocking
void Pipe::setBlockingNonRt | ( | bool | blocking | ) |
Set whether reads at the non-RT side should be blocking
void Pipe::setTimeoutMsRt | ( | double | timeoutMs | ) |
Set timeout for blocking reads at the RT side.
void Pipe::setTimeoutMsNonRt | ( | double | timeoutMs | ) |
Set timeout for blocking reads at the non-RT side.
bool Pipe::writeNonRt | ( | const T & | data | ) |
Send data from the non-RT side.
bool Pipe::writeNonRt | ( | T * | ptr, |
size_t | count | ||
) |
Send data from the non-RT side.
bool Pipe::writeRt | ( | const T & | data | ) |
Send data from the RT side.
bool Pipe::writeRt | ( | T * | ptr, |
size_t | count | ||
) |
Send data from the RT side.
ssize_t Pipe::readNonRt | ( | T & | dest | ) |
Read data from the non-RT side.
ssize_t Pipe::readNonRt | ( | T * | dest, |
size_t | count | ||
) |
Read data from the non-RT side.
ssize_t Pipe::readRt | ( | T & | dest | ) |
Read data from the RT side.
ssize_t Pipe::readRt | ( | T * | dest, |
size_t | count | ||
) |
Read data from the RT side.