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

#include <generic.h>

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

Public Member Functions

 file_carrayprinter (scheduler *sch, const char *_head, const char *_format, const char *_sep, const char *_tail, pipebuf< complex< T >> &_in, int _fdout)
 
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
 
int fixed_size
 
- Public Attributes inherited from leansdr::runnable_common
const char * name
 

Private Attributes

pipereader< complex< T > > in
 
const char * head
 
const char * format
 
const char * sep
 
const char * tail
 
FILE * fout
 

Additional Inherited Members

- Protected Attributes inherited from leansdr::runnable
schedulersch
 

Detailed Description

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

Definition at line 193 of file generic.h.

Constructor & Destructor Documentation

◆ file_carrayprinter()

template<typename T >
leansdr::file_carrayprinter< T >::file_carrayprinter ( scheduler sch,
const char *  _head,
const char *  _format,
const char *  _sep,
const char *  _tail,
pipebuf< complex< T >> &  _in,
int  _fdout 
)
inline

Definition at line 195 of file generic.h.

200  : runnable(sch, _in.name),
201  scale(1), fixed_size(0), in(_in),
202  head(_head), format(_format), sep(_sep), tail(_tail),
203  fout(fdopen(_fdout, "w"))
204  {
205  }
runnable(scheduler *_sch, const char *name)
Definition: framework.h:193
pipereader< complex< T > > in
Definition: generic.h:232
scheduler * sch
Definition: framework.h:199

Member Function Documentation

◆ run()

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

Reimplemented from leansdr::runnable_common.

Definition at line 206 of file generic.h.

References i.

207  {
208  int n, nmin = fixed_size ? fixed_size : 1;
209  while ((n = in.readable()) >= nmin)
210  {
211  if (fixed_size)
212  n = fixed_size;
213  if (fout)
214  {
215  fprintf(fout, head, n);
216  complex<T> *pin = in.rd();
217  for (int i = 0; i < n; ++i)
218  {
219  if (i)
220  fprintf(fout, "%s", sep);
221  fprintf(fout, format, pin[i].re * scale, pin[i].im * scale);
222  }
223  fprintf(fout, "%s", tail);
224  }
225  fflush(fout);
226  in.read(n);
227  }
228  }
pipereader< complex< T > > in
Definition: generic.h:232
int32_t i
Definition: decimators.h:244

Member Data Documentation

◆ fixed_size

template<typename T >
int leansdr::file_carrayprinter< T >::fixed_size

Definition at line 230 of file generic.h.

◆ format

template<typename T >
const char * leansdr::file_carrayprinter< T >::format
private

Definition at line 233 of file generic.h.

◆ fout

template<typename T >
FILE* leansdr::file_carrayprinter< T >::fout
private

Definition at line 234 of file generic.h.

◆ head

template<typename T >
const char* leansdr::file_carrayprinter< T >::head
private

Definition at line 233 of file generic.h.

◆ in

template<typename T >
pipereader<complex<T> > leansdr::file_carrayprinter< T >::in
private

Definition at line 232 of file generic.h.

◆ scale

template<typename T >
T leansdr::file_carrayprinter< T >::scale

Definition at line 229 of file generic.h.

◆ sep

template<typename T >
const char * leansdr::file_carrayprinter< T >::sep
private

Definition at line 233 of file generic.h.

◆ tail

template<typename T >
const char * leansdr::file_carrayprinter< T >::tail
private

Definition at line 233 of file generic.h.


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