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

#include <hreader.h>

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

Public Member Functions

virtual ~HReader ()=default
 
virtual int Read (T *dest, size_t blocksize)=0
 
virtual bool Start ()
 
virtual bool Stop ()
 
HReader< T > * Reader ()
 
virtual bool Command (HCommand *command)=0
 
- Public Member Functions inherited from HObject
 HObject ()
 

Detailed Description

template<class T>
class HReader< T >

The base class for any reader type. It provides a pure virtual Read() function which must be implemented by the specific reader.

It further provides two virtual methods Start() and Stop() which is used by specifik readers to do any initialization/clean-up when reading starts and stops.

If you implement types that uses a HReader, you must implement Start() and Stop() so that they call Start() and Stop() on the reader the use.

Ex: You implement a mp3 file decoder based on the HFileReader class. The processor will read from your decoder class by calling Start() and then Read() untill you return 0 (zero). Then Stop() will be called. If your decoder class do not call Start() and Stop() on the base HFilerReader, the file will never be opened and the first Read() will return 0 (zero).

Always cascade Start() and Stop() to any HReader you implement or use.!

Constructor & Destructor Documentation

◆ ~HReader()

template<class T >
virtual HReader< T >::~HReader ( )
virtualdefault

Virtual destructor enabling delete on derived objects

Member Function Documentation

◆ Command()

template<class T >
virtual bool HReader< T >::Command ( HCommand command)
pure virtual

◆ Read()

template<class T >
virtual int HReader< T >::Read ( T *  dest,
size_t  blocksize 
)
pure virtual

◆ Reader()

template<class T >
HReader<T>* HReader< T >::Reader ( )
inline

Returns a HReader* to this reader

◆ Start()

template<class T >
virtual bool HReader< T >::Start ( )
inlinevirtual

◆ Stop()

template<class T >
virtual bool HReader< T >::Stop ( )
inlinevirtual

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