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_reader< T > Struct Template Reference

#include <generic.h>

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

Public Member Functions

 buffer_reader (scheduler *sch, T *_data, int _count, 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 ()
 

Private Attributes

T * data
 
int count
 
pipewriter< T > out
 
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_reader< T >

Definition at line 410 of file generic.h.

Constructor & Destructor Documentation

◆ buffer_reader()

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

Definition at line 412 of file generic.h.

413  : runnable(sch, "buffer_reader"),
414  data(_data), count(_count), out(_out), pos(0)
415  {
416  }
pipewriter< T > out
Definition: generic.h:428
runnable(scheduler *_sch, const char *name)
Definition: framework.h:193
scheduler * sch
Definition: framework.h:199

Member Function Documentation

◆ run()

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

Reimplemented from leansdr::runnable_common.

Definition at line 417 of file generic.h.

References leansdr::min(), and leansdr::file_reader< T >::out.

418  {
419  int n = min(out.writable(), (unsigned long)(count - pos));
420  memcpy(out.wr(), &data[pos], n * sizeof(T));
421  pos += n;
422  out.written(n);
423  }
pipewriter< T > out
Definition: generic.h:428
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_reader< T >::count
private

Definition at line 427 of file generic.h.

◆ data

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

Definition at line 426 of file generic.h.

◆ out

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

Definition at line 428 of file generic.h.

◆ pos

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

Definition at line 429 of file generic.h.


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