RTC Toolkit  2.0.0
Functions
rtctk::dataTask::detail Namespace Reference

Functions

std::chrono::milliseconds CalcTimeout (size_t count, float loop_frequency, float error_margin)
 free helper function to calulate the estimated time to read the a number of samples at a given frequency More...
 
template<typename ReaderType , typename Operation >
std::error_code Read (ReaderType &reader, Operation &&op, size_t count, float loop_frequency, float error_margin)
 helper function to wrap the ipcq.read with handling of timeouts and count values More...
 
template<typename ReaderType >
std::error_code Skip (ReaderType &reader, size_t count, float loop_frequency, float error_margin)
 helper function to wrap the ipcq.skip with handling of timeouts and count values More...
 
template<typename ReaderType >
std::error_code Reset (ReaderType &reader)
 helper function to reset the ipcq.reader to latest sample More...
 
template<typename ReaderType >
size_t NumFree (ReaderType &reader)
 helper function to get the free space in the shm. More...
 

Function Documentation

◆ CalcTimeout()

std::chrono::milliseconds rtctk::dataTask::detail::CalcTimeout ( size_t  count,
float  loop_frequency,
float  error_margin 
)
inline

free helper function to calulate the estimated time to read the a number of samples at a given frequency

Parameters
countnumber of samples
loop_frequencyfrequency of loop
error_marginmargin of error in calculation defaults to 1.0
Returns
number of milliseconds to read count at frequency

◆ NumFree()

template<typename ReaderType >
size_t rtctk::dataTask::detail::NumFree ( ReaderType &  reader)

helper function to get the free space in the shm.

Template Parameters
ReaderType.type of ipcq.reader
Parameters
readerthe reader being used
Returns
number of unread samples in queue.

◆ Read()

template<typename ReaderType , typename Operation >
std::error_code rtctk::dataTask::detail::Read ( ReaderType &  reader,
Operation &&  op,
size_t  count,
float  loop_frequency,
float  error_margin 
)

helper function to wrap the ipcq.read with handling of timeouts and count values

Template Parameters
ReaderType.type of ipcq.reader
Operationthe callback to process the shm data
Parameters
readerthe reader being used
opthe callback to process shm data samples
countnumber of samples requested
loop_frequencyexpected frequency of the loop.
error_marginmargin of error in the loop frequency. defaults to: 2.0
Returns
error_code

◆ Reset()

template<typename ReaderType >
std::error_code rtctk::dataTask::detail::Reset ( ReaderType &  reader)

helper function to reset the ipcq.reader to latest sample

Template Parameters
ReaderType.type of ipcq.reader
Parameters
readerthe reader being used
Returns
error_code

◆ Skip()

template<typename ReaderType >
std::error_code rtctk::dataTask::detail::Skip ( ReaderType &  reader,
size_t  count,
float  loop_frequency,
float  error_margin 
)

helper function to wrap the ipcq.skip with handling of timeouts and count values

Template Parameters
ReaderType.type of ipcq.reader
Parameters
readerthe reader being used
countnumber of samples requested to skip
loop_frequencyexpected frequency of the loop.
error_marginmargin of error in the loop frequency. defaults to: 2.0
Returns
error_code