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

#include <hmemoryreader.h>

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

Public Member Functions

 HMemoryReader (T *buffer, size_t size, bool infinite=false)
 
int Read (T *dest, size_t blocksize)
 
bool Command (HCommand *command)
 
void Reset ()
 
int GetPosition ()
 
int GetSize ()
 
- Public Member Functions inherited from HReader< T >
virtual ~HReader ()=default
 
virtual bool Start ()
 
virtual bool Stop ()
 
HReader< T > * Reader ()
 
- Public Member Functions inherited from HObject
 HObject ()
 

Detailed Description

template<class T>
class HMemoryReader< T >

Read from a fixed buffer

Will read a finite number of samples to from a fixed buffer, then return 0 on subsequent reads.

Most usefull while your are building or testing an application and need to read a single block of samples from a fixed bufer

Constructor & Destructor Documentation

◆ HMemoryReader()

template<class T >
HMemoryReader< T >::HMemoryReader ( T *  buffer,
size_t  size,
bool  infinite = false 
)
inline

Construct a new HMemoryReader

Member Function Documentation

◆ Command()

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

Execute or carry through a command

Implements HReader< T >.

◆ GetPosition()

template<class T >
int HMemoryReader< T >::GetPosition ( )
inline

Get the current buffer position (index of next read start)

◆ GetSize()

template<class T >
int HMemoryReader< T >::GetSize ( )
inline

Get the size of the buffer

◆ Read()

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

Read a block of samples

Implements HReader< T >.

◆ Reset()

template<class T >
void HMemoryReader< T >::Reset ( )
inline

Reset the buffer position so next read is from the start of the buffer


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