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::file_vectorprinter< T, N > Struct Template Reference

#include <generic.h>

+ Inheritance diagram for leansdr::file_vectorprinter< T, N >:
+ Collaboration diagram for leansdr::file_vectorprinter< T, N >:

Public Member Functions

 file_vectorprinter (scheduler *sch, const char *_head, const char *_format, const char *_sep, const char *_tail, pipebuf< T[N]> &_in, int _fdout, int _n=N)
 
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

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

Private Attributes

pipereader< T[N]> in
 
const char * head
 
const char * format
 
const char * sep
 
const char * tail
 
FILE * fout
 
int n
 

Additional Inherited Members

- Protected Attributes inherited from leansdr::runnable
schedulersch
 

Detailed Description

template<typename T, int N>
struct leansdr::file_vectorprinter< T, N >

Definition at line 238 of file generic.h.

Constructor & Destructor Documentation

◆ file_vectorprinter()

template<typename T , int N>
leansdr::file_vectorprinter< T, N >::file_vectorprinter ( scheduler sch,
const char *  _head,
const char *  _format,
const char *  _sep,
const char *  _tail,
pipebuf< T[N]> &  _in,
int  _fdout,
int  _n = N 
)
inline

Definition at line 240 of file generic.h.

References leansdr::fatal().

245  : runnable(sch, _in.name), scale(1), in(_in),
246  head(_head), format(_format), sep(_sep), tail(_tail), n(_n)
247  {
248  fout = fdopen(_fdout, "w");
249  if (!fout)
250  fatal("fdopen");
251  }
runnable(scheduler *_sch, const char *name)
Definition: framework.h:193
void fatal(const char *s)
Definition: framework.cpp:6
pipereader< T[N]> in
Definition: generic.h:273
scheduler * sch
Definition: framework.h:199
+ Here is the call graph for this function:

Member Function Documentation

◆ run()

template<typename T , int N>
void leansdr::file_vectorprinter< T, N >::run ( )
inlinevirtual

Reimplemented from leansdr::runnable_common.

Definition at line 252 of file generic.h.

References i.

253  {
254  while (in.readable() >= 1)
255  {
256  fprintf(fout, head, n);
257  T(*pin)
258  [N] = in.rd();
259  for (int i = 0; i < n; ++i)
260  {
261  if (i)
262  fprintf(fout, "%s", sep);
263  fprintf(fout, format, (*pin)[i] * scale);
264  }
265  fprintf(fout, "%s", tail);
266  in.read(1);
267  }
268  fflush(fout);
269  }
int32_t i
Definition: decimators.h:244
pipereader< T[N]> in
Definition: generic.h:273
void read(unsigned long n)
Definition: framework.h:367

Member Data Documentation

◆ format

template<typename T , int N>
const char * leansdr::file_vectorprinter< T, N >::format
private

Definition at line 274 of file generic.h.

◆ fout

template<typename T , int N>
FILE* leansdr::file_vectorprinter< T, N >::fout
private

Definition at line 275 of file generic.h.

◆ head

template<typename T , int N>
const char* leansdr::file_vectorprinter< T, N >::head
private

Definition at line 274 of file generic.h.

◆ in

template<typename T , int N>
pipereader<T[N]> leansdr::file_vectorprinter< T, N >::in
private

Definition at line 273 of file generic.h.

◆ n

template<typename T , int N>
int leansdr::file_vectorprinter< T, N >::n
private

Definition at line 276 of file generic.h.

◆ scale

template<typename T , int N>
T leansdr::file_vectorprinter< T, N >::scale

Definition at line 270 of file generic.h.

◆ sep

template<typename T , int N>
const char * leansdr::file_vectorprinter< T, N >::sep
private

Definition at line 274 of file generic.h.

◆ tail

template<typename T , int N>
const char * leansdr::file_vectorprinter< T, N >::tail
private

Definition at line 274 of file generic.h.


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