ReaderThread for the Data Class.
More...
#include <readerThread.hpp>
template<typename TopicType, template< typename > typename ReaderType = ipcq::Reader>
class rtctk::dataTask::ReaderThread< TopicType, ReaderType >
ReaderThread for the Data Class.
Thread class for the reading of data out of the ipcq shared memory and handling state.
- Template Parameters
-
TopicType | the queue topic. |
Reader | type of ipcq writer to be used defaults to ipcq::Reader<TopicType> |
◆ ReaderThread()
template<typename TopicType , template< typename > typename ReaderType = ipcq::Reader>
◆ ~ReaderThread()
template<typename TopicType , template< typename > typename ReaderType = ipcq::Reader>
◆ Idle()
template<typename TopicType , template< typename > typename ReaderType = ipcq::Reader>
send Idle request to readerThread.
◆ Join()
template<typename TopicType , template< typename > typename ReaderType = ipcq::Reader>
waits for thread to complete and rejoins
sends Async request to reader thread to exit. Wait for it to be acknowledge for timeout Thread is rejoined and variables are unclocked. see parameter
- Note
- timeout set for 1200 ms
◆ RegisterInitThreadCallback()
template<typename TopicType , template< typename > typename ReaderType = ipcq::Reader>
optional callback
Sets the callback to be invoked by reader thread for any calculation specific initalisation. This is though to be used by GPUs to initalised for specific thread.
◆ RegisterOnDataCallback()
template<typename TopicType , template< typename > typename ReaderType = ipcq::Reader>
required callback
Sets the callback to pass to shm. to processes data and copy to calculation buffers
◆ Run()
template<typename TopicType , template< typename > typename ReaderType = ipcq::Reader>
send synchronous run request to readerThread.
◆ SetCpuAffinity()
template<typename TopicType , template< typename > typename ReaderType = ipcq::Reader>
optional setter sets the cpu affinity name, if unlocked.
see parameter
◆ SetErrorMargin()
template<typename TopicType , template< typename > typename ReaderType = ipcq::Reader>
optional setter sets the timeout tolerance.
see parameter This is used for setting timeouts on reading from shm
◆ SetLoopFrequency()
template<typename TopicType , template< typename > typename ReaderType = ipcq::Reader>
required setter sets the loop frequency, if unlocked.
see parameter This is used for setting timeouts on reading from shm
◆ SetMode()
template<typename TopicType , template< typename > typename ReaderType = ipcq::Reader>
optional setter sets the mode of the reader.
see parameter
◆ SetQueueName()
template<typename TopicType , template< typename > typename ReaderType = ipcq::Reader>
required setter sets the queue name to be used if unlocked.
see parameter
◆ SetSamplesToRead()
template<typename TopicType , template< typename > typename ReaderType = ipcq::Reader>
required setter sets the number of samples to be read, if unlocked.
see parameter
◆ SetSamplesToSkip()
template<typename TopicType , template< typename > typename ReaderType = ipcq::Reader>
required setter sets the number of samples to skip, if unlocked.
see parameter
◆ SetThreadName()
template<typename TopicType , template< typename > typename ReaderType = ipcq::Reader>
optional setter sets the thread name to be used, if unlocked.
see parameter
◆ SignalComputationDone()
template<typename TopicType , template< typename > typename ReaderType = ipcq::Reader>
returns from the buisness logic that te calculation has completed so that the readerThread is safe to begin reading again once the specified skip samples has completed
◆ Spawn()
template<typename TopicType , template< typename > typename ReaderType = ipcq::Reader>
Spawn the reader thread.
Checks correct values have been set then creates and locks values see messageQueue. Launches thread and waits for thread to be launched and acknowledges Async Request within timeout.
- Note
- Timeout set to 1200 ms
-
Asserts that OnDataAvailable Callback must be set.
◆ WaitUntilComputationAllowed() [1/2]
template<typename TopicType , template< typename > typename ReaderType = ipcq::Reader>
wait until the computation can be launched.
checks state to check if the specified numner of data samples have been recieved and processed.
- Note
- this is to be called by the buisness logic.
◆ WaitUntilComputationAllowed() [2/2]
template<typename TopicType , template< typename > typename ReaderType = ipcq::Reader>
The documentation for this class was generated from the following file: