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 | Private Attributes | List of all members
leansdr::buffer_writer< T > Struct Template Reference

#include <generic.h>

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

Public Member Functions

 buffer_writer (scheduler *sch, pipebuf< T > &_in, T *_data, int _count)
 
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 ()
 

Private Attributes

pipereader< T > in
 
T * data
 
int count
 
int pos
 

Additional Inherited Members

- Public Attributes inherited from leansdr::runnable_common
const char * name
 
- Protected Attributes inherited from leansdr::runnable
schedulersch
 

Detailed Description

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

Definition at line 435 of file generic.h.

Constructor & Destructor Documentation

◆ buffer_writer()

template<typename T >
leansdr::buffer_writer< T >::buffer_writer ( scheduler sch,
pipebuf< T > &  _in,
T *  _data,
int  _count 
)
inline

Definition at line 437 of file generic.h.

438  : runnable(sch, "buffer_reader"),
439  in(_in), data(_data), count(_count), pos(0)
440  {
441  }
runnable(scheduler *_sch, const char *name)
Definition: framework.h:193
pipereader< T > in
Definition: generic.h:451
scheduler * sch
Definition: framework.h:199

Member Function Documentation

◆ run()

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

Reimplemented from leansdr::runnable_common.

Definition at line 442 of file generic.h.

References leansdr::min().

443  {
444  int n = min(in.readable(), (unsigned long)(count - pos));
445  memcpy(&data[pos], in.rd(), n * sizeof(T));
446  in.read(n);
447  pos += n;
448  }
pipereader< T > in
Definition: generic.h:451
T min(const T &x, const T &y)
Definition: framework.h:440
+ Here is the call graph for this function:

Member Data Documentation

◆ count

template<typename T >
int leansdr::buffer_writer< T >::count
private

Definition at line 453 of file generic.h.

◆ data

template<typename T >
T* leansdr::buffer_writer< T >::data
private

Definition at line 452 of file generic.h.

◆ in

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

Definition at line 451 of file generic.h.

◆ pos

template<typename T >
int leansdr::buffer_writer< T >::pos
private

Definition at line 454 of file generic.h.


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