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

#include <hdemux.h>

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

Public Member Functions

 HDeMux (std::vector< HWriter< T > * > writers, size_t blocksize)
 
 HDeMux (HWriterConsumer< T > *consumer, size_t blocksize)
 
 HDeMux (HReader< T > *reader, int readers, size_t blocksize)
 
 ~HDeMux ()
 
int Write (T *src, size_t blocksize)
 
int Read (T *dest, size_t blocksize)
 
void SetWriter (HWriter< T > *writer)
 
bool Command (HCommand *command)
 
bool Start ()
 
bool Stop ()
 
- 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< T >
HWriterConsumer< T > * Consumer ()
 
- Public Member Functions inherited from HReader< T >
virtual ~HReader ()=default
 
HReader< T > * Reader ()
 

Detailed Description

template<class T>
class HDeMux< T >

De-multiplex a stream of samples. The incomming samples are written round-robin to the writer given in the list when constructing the object.

Ex: Having sampled a signal from 2 channels, writing the stream of samples from soundcard to an instanse of this class initiaized with two writers - would result in the two writers receaving either the left or the right samples. Another use is to split an IQ stream into an I and Q branch.

The number of samples per block written to the output writers will be half the number of incomming samples in the above example.

Constructor & Destructor Documentation

◆ HDeMux() [1/3]

template<class T >
HDeMux< T >::HDeMux ( std::vector< HWriter< T > * >  writers,
size_t  blocksize 
)

Construct a new HDemux object that writes to a writer

◆ HDeMux() [2/3]

template<class T >
HDeMux< T >::HDeMux ( HWriterConsumer< T > *  consumer,
size_t  blocksize 
)

Construct a new HDemux object that registers with an upstream writer

◆ HDeMux() [3/3]

template<class T >
HDeMux< T >::HDeMux ( HReader< T > *  reader,
int  readers,
size_t  blocksize 
)

Construct a new HDemux object that reads from a reader

◆ ~HDeMux()

template<class T >
HDeMux< T >::~HDeMux

Default destructor

Member Function Documentation

◆ Command()

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

Forward a command

Implements HReader< T >.

◆ Read()

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

Read a block of samples

Implements HReader< T >.

◆ SetWriter()

template<class T >
void HDeMux< T >::SetWriter ( HWriter< T > *  writer)
inlinevirtual

◆ Start()

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

Initialize before first read/write

Reimplemented from HReader< T >.

◆ Stop()

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

Cleanup after last read/write

Reimplemented from HReader< T >.

◆ Write()

template<class T >
int HDeMux< T >::Write ( T *  src,
size_t  blocksize 
)
virtual

Write a block of samples

Implements HWriter< T >.


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