|
HARDT - The Ham Radio DSP Toolkit
|
#include <hcustomwriter.h>


Public Member Functions | |
| HCustomWriter (std::function< int(T *, size_t)> customWriteFunc) | |
| HCustomWriter (std::function< int(T *, size_t)> customWriteFunc, HWriterConsumer< T > *consumer) | |
| int | Write (T *src, size_t blocksize) |
| bool | Start () |
| bool | Stop () |
| bool | Command (HCommand *command) |
Public Member Functions inherited from HWriter< T > | |
| virtual | ~HWriter ()=default |
| HWriter< T > * | Writer () |
Public Member Functions inherited from HObject | |
| HObject () | |
Static Public Member Functions | |
| static HCustomWriter< T > * | Create (int(*customWriteFunc)(T *, size_t blocksize)) |
| static HCustomWriter< T > * | Create (int(*customWriteFunc)(T *, size_t blocksize), HWriterConsumer< T > *consumer) |
| template<typename F > | |
| static HCustomWriter< T > * | Create (F *customWriterObject, int(F::*customWriteFunc)(T *, size_t blocksize)) |
| template<typename F > | |
| static HCustomWriter< T > * | Create (F *customWriterObject, int(F::*customWriteFunc)(T *, size_t blocksize), HWriterConsumer< T > *consumer) |
Provide a HWriter interface by wrapping a call to a function defined by your code.
You must provide a std::function<T> object initialized with a function with the signature 'int func(T* src, size_t blocksize)' where T is the base integer type in use.
The easiest way to create a customwriter is to use one of the factory methods Create(). They can either take a function pointer to a static (or global) function, or a function pointer to a member function in a given object.
When used as a writer, each call to Write() will the call your local 'function()' with the input sample buffer and the number of input samples. Your custom writer function must return the number of samples written (or consumed).
|
inline |
Construct a HCustomWriter that wraps a function "int func(T* data, size_t size){}" by use of std::function
|
inline |
Construct a new HCustomWriter that wraps a function "int func(T* data, size_t size){}" by use of std::function and registers with an upstream writer
|
inlinevirtual |
Receive, handle and propagate command
Returns: True if the command was executed correctly False otherwise. Errors is written to the error log
Implements HWriter< T >.
|
inlinestatic |
Factory function to create a new HCustomWriter by wrapping a member function function "int F::func(T* data, size_t size){}"
|
inlinestatic |
Factory function to create a new HCustomWriter by wrapping a member function function "int F::func(T* data, size_t size){}" and register with an upstream writer
|
inlinestatic |
Factory function to create a new HCustomWriter by wrapping a static function "int func(T* data, size_t size){}"
|
inlinestatic |
Factory function to create a new HCustomWriter by wrapping a static function "int func(T* data, size_t size){}" and register with an upstream writer
|
inlinevirtual |
Initialize before first write
Reimplemented from HWriter< T >.
|
inlinevirtual |
Cleanup after last write
Reimplemented from HWriter< T >.
|
inlinevirtual |
Write a block of data
Implements HWriter< T >.
1.8.17