LASP 1.0
Library for Acoustic Signal Processing
Loading...
Searching...
No Matches
ThreadedInDataHandler< Derived > Class Template Reference

A bit of curiously recurring template pattern, to connect the specific handlers and connect the proper callbacks in a type-agnostic way. Using this class, each threaded handler should just implement its reset() and inCallback() method. Ellides the virtual method calls. More...

#include <lasp_threadedindatahandler.h>

Inheritance diagram for ThreadedInDataHandler< Derived >:
Collaboration diagram for ThreadedInDataHandler< Derived >:

Public Member Functions

 ThreadedInDataHandler (SmgrHandle mgr)
 
void _reset (const Daq *daq)
 
void _inCallback (const DaqData &data)
 
- Public Member Functions inherited from ThreadedInDataHandlerBase
 ThreadedInDataHandlerBase (SmgrHandle mgr, InCallbackType cb, InResetType reset)
 
 ~ThreadedInDataHandlerBase ()
 
void startThread ()
 This method should be called from the derived class' constructor, to start the thread and data is incoming.
 
void stopThread ()
 This method SHOULD be called from all classes that derive on ThreadedInDataHandler. It is to make sure the inCallback_threaded() function is no longer called when the destructor of the derived class is called. Not calling this function is regarded as a BUG.
 

Detailed Description

template<typename Derived>
class ThreadedInDataHandler< Derived >

A bit of curiously recurring template pattern, to connect the specific handlers and connect the proper callbacks in a type-agnostic way. Using this class, each threaded handler should just implement its reset() and inCallback() method. Ellides the virtual method calls.

Usage: class XHandler: public ThreadedInDataHandler<XHandler> { public: XHandler(streammgr) : ThreadedInDataHandler(streammgr) {} void inCallback(const DaqData& d) { ... do something with d } void reset(const Daq* daq) { ... do something with daq } };

For examples, see PPMHandler, etc.

Template Parameters
DerivedThe

Definition at line 96 of file lasp_threadedindatahandler.h.

Constructor & Destructor Documentation

◆ ThreadedInDataHandler()

template<typename Derived >
ThreadedInDataHandler< Derived >::ThreadedInDataHandler ( SmgrHandle  mgr)
inline

Definition at line 98 of file lasp_threadedindatahandler.h.

Member Function Documentation

◆ _inCallback()

template<typename Derived >
void ThreadedInDataHandler< Derived >::_inCallback ( const DaqData data)
inline

Definition at line 110 of file lasp_threadedindatahandler.h.

◆ _reset()

template<typename Derived >
void ThreadedInDataHandler< Derived >::_reset ( const Daq daq)
inline

Definition at line 106 of file lasp_threadedindatahandler.h.


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