HARDT - The Ham Radio DSP Toolkit
Public Member Functions | List of all members
HOutput< T, O > Class Template Referenceabstract

#include <houtput.h>

Inheritance diagram for HOutput< T, O >:
Inheritance graph
[legend]
Collaboration diagram for HOutput< T, O >:
Collaboration graph
[legend]

Public Member Functions

void Ready (O *buffer, size_t blocksize)
 
void Ready (O value)
 
void Ready ()
 
bool Start ()
 
bool Stop ()
 
 HOutput ()
 
 HOutput (HWriterConsumer< T > *consumer)
 
 HOutput (std::function< void(O *, size_t)> ready)
 
 HOutput (std::function< void(O *, size_t)> ready, HWriterConsumer< T > *consumer)
 
 HOutput (std::function< void(O)> ready)
 
 HOutput (std::function< void(O)> ready, HWriterConsumer< T > *consumer)
 
 HOutput (std::function< void()> ready)
 
 HOutput (std::function< void()> ready, HWriterConsumer< T > *consumer)
 
 HOutput (HWriter< O > *writer)
 
 HOutput (HWriter< O > *writer, HWriterConsumer< T > *consumer)
 
 HOutput (int chunksize)
 
 HOutput (int chunksize, HWriterConsumer< T > *consumer)
 
 HOutput (std::function< void(O *, size_t)> ready, int chunksize)
 
 HOutput (std::function< void(O *, size_t)> ready, int chunksize, HWriterConsumer< T > *consumer)
 
 HOutput (std::function< void(O)> ready, int chunksize)
 
 HOutput (std::function< void(O)> ready, int chunksize, HWriterConsumer< T > *consumer)
 
 HOutput (std::function< void()> ready, int chunksize)
 
 HOutput (std::function< void()> ready, int chunksize, HWriterConsumer< T > *consumer)
 
 HOutput (HWriter< O > *writer, int chunksize)
 
 HOutput (HWriter< O > *writer, int chunksize, HWriterConsumer< T > *consumer)
 
int WriteChunk (T *src, size_t blocksize)
 
virtual int Output (T *src, size_t blocksize)=0
 
void SetWriter (HWriter< O > *writer)
 
- Public Member Functions inherited from HChunkWriter< T >
int Write (T *src, size_t blocksize)
 
 HChunkWriter ()
 
 HChunkWriter (int chunksize)
 
int GetChunksize ()
 
virtual bool Command (HCommand *command)=0
 
- Public Member Functions inherited from HWriter< T >
virtual ~HWriter ()=default
 
HWriter< T > * Writer ()
 
- Public Member Functions inherited from HObject
 HObject ()
 
- Public Member Functions inherited from HWriterConsumer< O >
HWriterConsumer< O > * Consumer ()
 

Detailed Description

template<class T, class O>
class HOutput< T, O >

The HOutput class is the base class for components that terminates a chain, such as the output of an DFFT calculation or a signal level indicator. An ouput may require a writer, but the data that the output writes is significant different, to the input samples written to the output. An fft calculation may require 4 blocks of 1024 samples, yet will only perform 1 write to a writer after having calculated the fft's and the averaged spectrum. The writer will then receive a write of length 1 and a pointer to the FFT result object.

For clarity, the HSoundcardWriter is not an HOutput since it actually outputs - allthough in a different physical form - the samples provided 1 to 1.

An HOutput class can be created with any writer, but very few writers will accept any datatype other than sample values in an integer format, so the most common way to use an output type is to provide a HCustomWWriter object which then calls a locally defined handler.

Internally, HOutput implements the HChunkWriter, so writes will be chunked to a size decided upon by the implementing class.

Constructor & Destructor Documentation

◆ HOutput() [1/20]

template<class T , class O >
HOutput< T, O >::HOutput ( )
inline

Construct a new HOutput

◆ HOutput() [2/20]

template<class T , class O >
HOutput< T, O >::HOutput ( HWriterConsumer< T > *  consumer)
inline

Construct a new HOutput that registers with an upstream writer

◆ HOutput() [3/20]

template<class T , class O >
HOutput< T, O >::HOutput ( std::function< void(O *, size_t)>  ready)
inline

Construct a new HOutput that calls a function with a result pointer and the length of the result

◆ HOutput() [4/20]

template<class T , class O >
HOutput< T, O >::HOutput ( std::function< void(O *, size_t)>  ready,
HWriterConsumer< T > *  consumer 
)
inline

Construct a new HOutput that calls a function with a result pointer and the length of the result. The HOutput registers with the upstream writer

◆ HOutput() [5/20]

template<class T , class O >
HOutput< T, O >::HOutput ( std::function< void(O)>  ready)
inline

Construct a new HOutput that calls a function with an int value

◆ HOutput() [6/20]

template<class T , class O >
HOutput< T, O >::HOutput ( std::function< void(O)>  ready,
HWriterConsumer< T > *  consumer 
)
inline

Construct a new HOutput that calls a function with an int value. The HOutput registers with the upstream writer

◆ HOutput() [7/20]

template<class T , class O >
HOutput< T, O >::HOutput ( std::function< void()>  ready)
inline

Construct a new HOutput that calls a function

◆ HOutput() [8/20]

template<class T , class O >
HOutput< T, O >::HOutput ( std::function< void()>  ready,
HWriterConsumer< T > *  consumer 
)
inline

Construct a new HOutput that calls a function. The HOutput registers with the upstream writer

◆ HOutput() [9/20]

template<class T , class O >
HOutput< T, O >::HOutput ( HWriter< O > *  writer)
inline

Construct a new HOutput that writes a result to a writer

◆ HOutput() [10/20]

template<class T , class O >
HOutput< T, O >::HOutput ( HWriter< O > *  writer,
HWriterConsumer< T > *  consumer 
)
inline

Construct a new HOutput that writes to a writer and registers with the upstream writer

◆ HOutput() [11/20]

template<class T , class O >
HOutput< T, O >::HOutput ( int  chunksize)
inline

Construct a new HOutput that processes input in chunks

◆ HOutput() [12/20]

template<class T , class O >
HOutput< T, O >::HOutput ( int  chunksize,
HWriterConsumer< T > *  consumer 
)
inline

Construct a new HOutput that processes input in chunks and registers with the upstream writer

◆ HOutput() [13/20]

template<class T , class O >
HOutput< T, O >::HOutput ( std::function< void(O *, size_t)>  ready,
int  chunksize 
)
inline

Construct a new HOutput that processes input in chunks, then calls a function with a result object and the size of the object

◆ HOutput() [14/20]

template<class T , class O >
HOutput< T, O >::HOutput ( std::function< void(O *, size_t)>  ready,
int  chunksize,
HWriterConsumer< T > *  consumer 
)
inline

Construct a new HOutput that processes input in chunks, then calls a function with a result object and the size of the object. The output registers with the upstream writer

◆ HOutput() [15/20]

template<class T , class O >
HOutput< T, O >::HOutput ( std::function< void(O)>  ready,
int  chunksize 
)
inline

Construct a new HOutput that processes input in chunks, then calls a function with a value

◆ HOutput() [16/20]

template<class T , class O >
HOutput< T, O >::HOutput ( std::function< void(O)>  ready,
int  chunksize,
HWriterConsumer< T > *  consumer 
)
inline

Construct a new HOutput that processes input in chunks, then calls a function with a value. The output registers with the upstream writer

◆ HOutput() [17/20]

template<class T , class O >
HOutput< T, O >::HOutput ( std::function< void()>  ready,
int  chunksize 
)
inline

Construct a new HOutput the processes input in chunks, then calls a function

◆ HOutput() [18/20]

template<class T , class O >
HOutput< T, O >::HOutput ( std::function< void()>  ready,
int  chunksize,
HWriterConsumer< T > *  consumer 
)
inline

Construct a new HOutput that processes input in chunks, then calls a function. The output registers with the upstream writer

◆ HOutput() [19/20]

template<class T , class O >
HOutput< T, O >::HOutput ( HWriter< O > *  writer,
int  chunksize 
)
inline

Construct a new HOutput that processes input in chunks and writes the result to a writer

◆ HOutput() [20/20]

template<class T , class O >
HOutput< T, O >::HOutput ( HWriter< O > *  writer,
int  chunksize,
HWriterConsumer< T > *  consumer 
)
inline

Construct a new HOutput that processes input in chunks and writes the result to a writer. The output registers with the upstream writer

Member Function Documentation

◆ Output()

template<class T , class O >
virtual int HOutput< T, O >::Output ( T *  src,
size_t  blocksize 
)
pure virtual

Process this chunk of samples

Implemented in HFftOutput< T >, HGoertzelOutput< T >, and HSignalLevelOutput< T >.

◆ Ready() [1/3]

template<class T , class O >
void HOutput< T, O >::Ready ( )
inline

A result is ready, but no data is available (this behaves more like an event)

◆ Ready() [2/3]

template<class T , class O >
void HOutput< T, O >::Ready ( O *  buffer,
size_t  blocksize 
)
inline

A result is ready, buffer has the result and the length of the result is given by blocksize

◆ Ready() [3/3]

template<class T , class O >
void HOutput< T, O >::Ready ( value)
inline

A result is ready, the result has the value given by value

◆ SetWriter()

template<class T , class O >
void HOutput< T, O >::SetWriter ( HWriter< O > *  writer)
inlinevirtual

◆ Start()

template<class T , class O >
bool HOutput< T, O >::Start ( )
inlinevirtual

Initialize before first write

Reimplemented from HWriter< T >.

◆ Stop()

template<class T , class O >
bool HOutput< T, O >::Stop ( )
inlinevirtual

Cleanup after last write

Reimplemented from HWriter< T >.

◆ WriteChunk()

template<class T , class O >
int HOutput< T, O >::WriteChunk ( T *  src,
size_t  blocksize 
)
inlinevirtual

Write a chunk of samples

Implements HChunkWriter< T >.


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