HARDT - The Ham Radio DSP Toolkit
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
HFilter< T > Class Template Referenceabstract

#include <hfilter.h>

Inheritance diagram for HFilter< T >:
Inheritance graph
[legend]
Collaboration diagram for HFilter< T >:
Collaboration graph
[legend]

Public Member Functions

 ~HFilter ()
 
int Write (T *src, size_t blocksize)
 
int Read (T *dest, size_t blocksize)
 
virtual void Filter (T *src, T *dest, size_t blocksize)=0
 
bool Start ()
 
bool Stop ()
 
bool Command (HCommand *command)
 
void Enable ()
 
void Disable ()
 
bool GetEnabled ()
 
- Public Member Functions inherited from HObject
 HObject ()
 
- Public Member Functions inherited from HWriter< T >
virtual ~HWriter ()=default
 
HWriter< T > * Writer ()
 
- Public Member Functions inherited from HReader< T >
virtual ~HReader ()=default
 
HReader< T > * Reader ()
 
- Public Member Functions inherited from HWriterConsumer< T >
HWriterConsumer< T > * Consumer ()
 

Static Public Member Functions

static std::vector< float > ReadCoeffsFromFile (std::string filename)
 
static std::vector< float > ReadCoeffsFromFile (char *filename)
 

Protected Member Functions

 HFilter (HWriter< T > *writer, size_t blocksize, HProbe< T > *probe=NULL)
 
 HFilter (HWriterConsumer< T > *consumer, size_t blocksize, HProbe< T > *probe=NULL)
 
 HFilter (HReader< T > *reader, size_t blocksize, HProbe< T > *probe=NULL)
 
void SetWriter (HWriter< T > *writer)
 

Protected Attributes

int _blocksize
 

Detailed Description

template<class T>
class HFilter< T >

Base class for filter implementations. This class defines a pure virtual method, Filter(), which must be implemented by classes inheriting this class.

The constructor is protected, this class cannot be instantianted directly.

Constructor & Destructor Documentation

◆ HFilter() [1/3]

template<class T >
HFilter< T >::HFilter ( HWriter< T > *  writer,
size_t  blocksize,
HProbe< T > *  probe = NULL 
)
inlineprotected

Construct a new HFilter that writes to a writer

◆ HFilter() [2/3]

template<class T >
HFilter< T >::HFilter ( HWriterConsumer< T > *  consumer,
size_t  blocksize,
HProbe< T > *  probe = NULL 
)
inlineprotected

Construct a new HFilter that registers with an upstream writer

◆ HFilter() [3/3]

template<class T >
HFilter< T >::HFilter ( HReader< T > *  reader,
size_t  blocksize,
HProbe< T > *  probe = NULL 
)
inlineprotected

Construct a new HFilter that reads from a reader

◆ ~HFilter()

template<class T >
HFilter< T >::~HFilter ( )
inline

Default destructor

Member Function Documentation

◆ Command()

template<class T >
bool HFilter< T >::Command ( HCommand command)
inlinevirtual

Execute or carry through a command

Implements HReader< T >.

◆ Disable()

template<class T >
void HFilter< T >::Disable ( )
inline

Disable the filter

◆ Enable()

template<class T >
void HFilter< T >::Enable ( )
inline

Enable the filter (the filter is always enabled after construction)

◆ Filter()

template<class T >
virtual void HFilter< T >::Filter ( T *  src,
T *  dest,
size_t  blocksize 
)
pure virtual

◆ GetEnabled()

template<class T >
bool HFilter< T >::GetEnabled ( )
inline

Returns true if the filter is enabled (filter is always enabled after construction), false otherwise

◆ Read()

template<class T >
int HFilter< T >::Read ( T *  dest,
size_t  blocksize 
)
inlinevirtual

Read a block of samples

Implements HReader< T >.

◆ ReadCoeffsFromFile() [1/2]

template<class T >
static std::vector<float> HFilter< T >::ReadCoeffsFromFile ( char *  filename)
inlinestatic

Utility function that reads a list of floating point coefficients from a file

It can handle files with one parameter on each line or several parameters on each line separated by comma, blankspace or semicolon. It will ignore other junk (characters) and terminates a line on a c-style single line comment ('//')

◆ ReadCoeffsFromFile() [2/2]

template<class T >
static std::vector<float> HFilter< T >::ReadCoeffsFromFile ( std::string  filename)
inlinestatic

Utility function that reads a list of floating point coefficients from a file

It can handle files with one parameter on each line or several parameters on each line separated by comma, blankspace or semicolon. It will ignore other junk (characters) and terminates a line on a c-style single line comment ('//')

◆ SetWriter()

template<class T >
void HFilter< T >::SetWriter ( HWriter< T > *  writer)
inlineprotectedvirtual

◆ Start()

template<class T >
bool HFilter< T >::Start ( )
inlinevirtual

Initialize before first read/write

Reimplemented from HReader< T >.

Reimplemented in HMute< T >.

◆ Stop()

template<class T >
bool HFilter< T >::Stop ( )
inlinevirtual

Cleanup after last read/write

Reimplemented from HReader< T >.

Reimplemented in HMute< T >.

◆ Write()

template<class T >
int HFilter< T >::Write ( T *  src,
size_t  blocksize 
)
inlinevirtual

Write a block of samples

Implements HWriter< T >.

Member Data Documentation

◆ _blocksize

template<class T >
int HFilter< T >::_blocksize
protected

The filters set blocksize


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