SDRAngel  4.11.5
Developer docs for <a href="https://github.com/f4exb/sdrangel">SDRangel<\a>, an Open Source Qt5 / OpenGL 3.0+ SDR and signal analyzer frontend to various hardware.
Public Member Functions | Public Attributes | Private Attributes | List of all members
leansdr::decimator< T > Struct Template Reference

#include <generic.h>

+ Inheritance diagram for leansdr::decimator< T >:
+ Collaboration diagram for leansdr::decimator< T >:

Public Member Functions

 decimator (scheduler *sch, int _d, pipebuf< T > &_in, pipebuf< T > &_out)
 
void run ()
 
- Public Member Functions inherited from leansdr::runnable
 runnable (scheduler *_sch, const char *name)
 
- Public Member Functions inherited from leansdr::runnable_common
 runnable_common (const char *_name)
 
virtual ~runnable_common ()
 
virtual void shutdown ()
 

Public Attributes

int d
 
- Public Attributes inherited from leansdr::runnable_common
const char * name
 

Private Attributes

pipereader< T > in
 
pipewriter< T > out
 

Additional Inherited Members

- Protected Attributes inherited from leansdr::runnable
schedulersch
 

Detailed Description

template<typename T>
struct leansdr::decimator< T >

Definition at line 309 of file generic.h.

Constructor & Destructor Documentation

◆ decimator()

template<typename T>
leansdr::decimator< T >::decimator ( scheduler sch,
int  _d,
pipebuf< T > &  _in,
pipebuf< T > &  _out 
)
inline

Definition at line 313 of file generic.h.

314  : runnable(sch, "decimator"),
315  d(_d),
316  in(_in), out(_out)
317  {
318  }
pipereader< T > in
Definition: generic.h:330
runnable(scheduler *_sch, const char *name)
Definition: framework.h:193
pipewriter< T > out
Definition: generic.h:331
scheduler * sch
Definition: framework.h:199

Member Function Documentation

◆ run()

template<typename T>
void leansdr::decimator< T >::run ( )
inlinevirtual

Reimplemented from leansdr::runnable_common.

Definition at line 319 of file generic.h.

320  {
321  long count = min(in.readable() / d, out.writable());
322  T *pin = in.rd(), *pend = pin + count * d, *pout = out.wr();
323  for (; pin < pend; pin += d, ++pout)
324  *pout = *pin;
325  in.read(count * d);
326  out.written(count);
327  }
pipereader< T > in
Definition: generic.h:330
pipewriter< T > out
Definition: generic.h:331
T min(const T &x, const T &y)
Definition: framework.h:440

Member Data Documentation

◆ d

template<typename T>
int leansdr::decimator< T >::d

Definition at line 311 of file generic.h.

◆ in

template<typename T>
pipereader<T> leansdr::decimator< T >::in
private

Definition at line 330 of file generic.h.

◆ out

template<typename T>
pipewriter<T> leansdr::decimator< T >::out
private

Definition at line 331 of file generic.h.


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