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


Public Member Functions | |
| int | Read (T *dest, int blocksize) |
| int | Write (T *src, int blocksize) |
| HReader< T > * | GetReader () |
| HWriter< T > * | GetWriter () |
| virtual void | Run (long unsigned int blocks=0) |
| virtual void | Halt () |
| bool | Command (H_COMMAND_CLASS commandClass, H_COMMAND_OPCODE commandOpcode, int32_t value) |
| bool | Command (H_COMMAND_CLASS commandClass, H_COMMAND_OPCODE commandOpcode, int16_t length, void *content) |
| bool | Command (H_COMMAND_CLASS commandClass, H_COMMAND_OPCODE commandOpcode, bool state) |
| virtual bool | Command (H_COMMAND_CLASS commandClass, H_COMMAND_OPCODE commandOpcode, int16_t length, HCommandData data)=0 |
| HMetrics * | GetMetrics () |
Public Member Functions inherited from HWriterConsumer< T > | |
| HWriterConsumer< T > * | Consumer () |
Public Member Functions inherited from HObject | |
| HObject () | |
Protected Member Functions | |
| HProcessor (HWriter< T > *writer, HReader< T > *reader, size_t blocksize, bool *terminationToken) | |
| HProcessor (HReader< T > *reader, size_t blocksize, bool *terminationToken) | |
| ~HProcessor () | |
| void | SetWriter (HWriter< T > *writer) |
Protected Attributes | |
| HWriter< T > * | _writer |
| HReader< T > * | _reader |
The processor makes a Hardt application tick, it reads from a given reader component and writes the data to a writer class.
This allows you to split your DSP chain into one or more readers, and one or more writers. Readers sort of 'pull' data from reader endpoints and writers 'push' data to writer endpoints (typical a HOutput type), but it can also be a HNullWriter if you dont need to have the output.
When you have created your readers and writers, then create a processor with the last reader and first writer and then call Run() on the processor.
A processor will stop when it receives a zero-length read or if you call the Halt() method, or the bool variable pointed to by the 'terminationToken' parameter of the constructor is set to true (especially usefull if you have multiple threads or does signal handling).
|
protected |
Construct a new HProcessor
| writer | The writer |
| reader | The reader |
| blocksize | Number of samples to read and write per cycle |
| terminationToken | The termination token. Set to true to halt the processor |
|
protected |
Construct a new HProcessor
| reader | The reader |
| blocksize | Number of samples to read and write per cycle |
| terminationToken | The termination token. Set to true to halt the processor |
|
protected |
Default destructor
|
inline |
Send a command to the reader and writer chain of this processor
| commandClass | Class of command |
| commandOpcode | Opcode of command |
| state | Bool value to send as the data |
|
pure virtual |
Send a command to the reader and writer chain of this processor
| commandClass | Class of command |
| commandOpcode | Opcode of command |
| length | The command data length (zero for int and bool values) |
| data | The command data to send |
Implemented in HNetworkProcessor< T >, and HStreamProcessor< T >.
|
inline |
Send a command to the reader and writer chain of this processor
| commandClass | Class of command |
| commandOpcode | Opcode of command |
| length | Length of the data pointed to by 'content' |
| content | void* to the data to send as the data |
|
inline |
Send a command to the reader and writer chain of this processor
| commandClass | Class of command |
| commandOpcode | Opcode of command |
| value | integer value to send as the data |
|
inline |
Get the metrics object
| HReader< T > * HProcessor< T >::GetReader |
Get the associated reader
| HWriter< T > * HProcessor< T >::GetWriter |
Get the associated writer
|
virtual |
Stop processing.
If the reader and writer is not destroyed, processing can be resumed by calling Run() once agan after setting the terminationToken to false
Reimplemented in HNetworkProcessor< T >.
| int HProcessor< T >::Read | ( | T * | dest, |
| int | blocksize | ||
| ) |
Read directly from the associated reader
| dest | Destination buffer |
| blocksize | Number of samples to read |
|
virtual |
Read from the reader and write to the writer.
Processing stops when a zero-length read is received, halt() is called or the associated terminationToken is set to true.
| blocks | Number of blocks to read or zero to read untill stopped (or null-read) |
Reimplemented in HNetworkProcessor< T >, and HStreamProcessor< T >.
|
inlineprotectedvirtual |
| int HProcessor< T >::Write | ( | T * | src, |
| int | blocksize | ||
| ) |
Write directly to the associated writer
| src | Source buffer |
| blocksize | Number of samples to write |
|
protected |
The reader used by this processor
|
protected |
The writer used by this processor
1.8.17