Bela
Real-time, ultra-low-latency audio and sensor processing system for BeagleBone Black
 All Classes Files Functions Variables Typedefs Macros Groups
Public Member Functions | List of all members
Pipe Class Reference

#include <Pipe.h>

Public Member Functions

 Pipe (const std::string &pipeName, size_t size=65536 *128, bool newBlockingRt=false, bool newBlockingNonRt=false)
 
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 readRt (T &dest)
 
template<typename T >
ssize_t readNonRt (T *dest, size_t count)
 
template<typename T >
ssize_t readRt (T *dest, size_t count)
 

Detailed Description

A bi-directional pipe to exchange data between a RT and a non-RT thread.

Member Function Documentation

bool Pipe::setup ( const std::string &  pipeName = defaultName,
size_t  size = 65536 * 128,
bool  newBlockingRt = false,
bool  newBlockingNonRt = false 
)

Initialise the Pipe.

Parameters
thename of the Pipe. Pipes with the same name share data.
thesize of the Pipe. This is the amount of data that can be stored in the pipe. If the pipe is full, writes will fail.
whetherreads at the RT side should be blocking (can be modified later)
whetherreads 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.

template<typename T >
bool Pipe::writeNonRt ( const T &  data)

Send data to the non-RT side.

template<typename T >
bool Pipe::writeNonRt ( T *  ptr,
size_t  count 
)

Send data to the non-RT side.

template<typename T >
bool Pipe::writeRt ( const T &  data)

Send data to the RT side.

template<typename T >
bool Pipe::writeRt ( T *  ptr,
size_t  count 
)

Send data to the RT side.

template<typename T >
ssize_t Pipe::readNonRt ( T &  dest)

Read data from the non-RT side.

template<typename T >
ssize_t Pipe::readRt ( T &  dest)

Read data from the non-RT side.

template<typename T >
ssize_t Pipe::readNonRt ( T *  dest,
size_t  count 
)

Read data from the RT side.

template<typename T >
ssize_t Pipe::readRt ( T *  dest,
size_t  count 
)

Read data from the RT side.


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