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 | List of all members
leansdr::scheduler Struct Reference

#include <framework.h>

+ Collaboration diagram for leansdr::scheduler:

Public Member Functions

 scheduler ()
 
void add_pipe (pipebuf_common *p)
 
void add_runnable (runnable_common *r)
 
void step ()
 
void run ()
 
void shutdown ()
 
unsigned long long hash ()
 
void dump ()
 

Public Attributes

pipebuf_commonpipes [MAX_PIPES]
 
int npipes
 
runnable_commonrunnables [MAX_RUNNABLES]
 
int nrunnables
 
window_placementwindows
 
bool verbose
 
bool debug
 
bool debug2
 

Detailed Description

Definition at line 114 of file framework.h.

Constructor & Destructor Documentation

◆ scheduler()

leansdr::scheduler::scheduler ( )
inline

Definition at line 123 of file framework.h.

123  : npipes(0),
124  nrunnables(0),
125  windows(NULL),
126  verbose(false),
127  debug(false),
128  debug2(false)
129  {
130  }
window_placement * windows
Definition: framework.h:120

Member Function Documentation

◆ add_pipe()

void leansdr::scheduler::add_pipe ( pipebuf_common p)
inline

Definition at line 132 of file framework.h.

References leansdr::fail().

Referenced by leansdr::pipebuf< leansdr::complex< leansdr::f32 > >::pipebuf().

133  {
134  if (npipes == MAX_PIPES)
135  fail("MAX_PIPES");
136  pipes[npipes++] = p;
137  }
void fail(const char *s)
Definition: framework.cpp:11
pipebuf_common * pipes[MAX_PIPES]
Definition: framework.h:116
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ add_runnable()

void leansdr::scheduler::add_runnable ( runnable_common r)
inline

Definition at line 139 of file framework.h.

References leansdr::fail().

140  {
141  if (nrunnables == MAX_RUNNABLES)
142  fail("MAX_RUNNABLES");
143  runnables[nrunnables++] = r;
144  }
void fail(const char *s)
Definition: framework.cpp:11
runnable_common * runnables[MAX_RUNNABLES]
Definition: framework.h:118
+ Here is the call graph for this function:

◆ dump()

void leansdr::scheduler::dump ( )
inline

Definition at line 180 of file framework.h.

References leansdr::pipebuf_common::dump(), and i.

181  {
182  fprintf(stderr, "\n");
183  std::size_t total_bufs = 0;
184  for (int i = 0; i < npipes; ++i)
185  pipes[i]->dump(&total_bufs);
186  fprintf(stderr, "Total buffer memory: %ld KiB\n",
187  (unsigned long)total_bufs / 1024);
188  }
int32_t i
Definition: decimators.h:244
pipebuf_common * pipes[MAX_PIPES]
Definition: framework.h:116
+ Here is the call graph for this function:

◆ hash()

unsigned long long leansdr::scheduler::hash ( )
inline

Definition at line 172 of file framework.h.

References leansdr::pipebuf_common::hash(), and i.

173  {
174  unsigned long long h = 0;
175  for (int i = 0; i < npipes; ++i)
176  h += (1 + i) * pipes[i]->hash();
177  return h;
178  }
int32_t i
Definition: decimators.h:244
pipebuf_common * pipes[MAX_PIPES]
Definition: framework.h:116
virtual long long hash()
Definition: framework.h:60
+ Here is the call graph for this function:

◆ run()

void leansdr::scheduler::run ( )
inline

Definition at line 152 of file framework.h.

References leansdr::pipebuf_common::hash().

153  {
154  unsigned long long prev_hash = 0;
155 
156  while (1)
157  {
158  step();
159  unsigned long long h = hash();
160  if (h == prev_hash)
161  break;
162  prev_hash = h;
163  }
164  }
unsigned long long hash()
Definition: framework.h:172
+ Here is the call graph for this function:

◆ shutdown()

void leansdr::scheduler::shutdown ( )
inline

Definition at line 166 of file framework.h.

References i.

Referenced by DATVDemod::CleanUpDATVFramework().

167  {
168  for (int i = 0; i < nrunnables; ++i)
169  runnables[i]->shutdown();
170  }
int32_t i
Definition: decimators.h:244
runnable_common * runnables[MAX_RUNNABLES]
Definition: framework.h:118
+ Here is the caller graph for this function:

◆ step()

void leansdr::scheduler::step ( )
inline

Definition at line 146 of file framework.h.

References i.

Referenced by DATVDemod::feed().

147  {
148  for (int i = 0; i < nrunnables; ++i)
149  runnables[i]->run();
150  }
int32_t i
Definition: decimators.h:244
runnable_common * runnables[MAX_RUNNABLES]
Definition: framework.h:118
+ Here is the caller graph for this function:

Member Data Documentation

◆ debug

bool leansdr::scheduler::debug

◆ debug2

bool leansdr::scheduler::debug2

Definition at line 121 of file framework.h.

◆ npipes

int leansdr::scheduler::npipes

Definition at line 117 of file framework.h.

◆ nrunnables

int leansdr::scheduler::nrunnables

Definition at line 119 of file framework.h.

◆ pipes

pipebuf_common* leansdr::scheduler::pipes[MAX_PIPES]

Definition at line 116 of file framework.h.

◆ runnables

runnable_common* leansdr::scheduler::runnables[MAX_RUNNABLES]

Definition at line 118 of file framework.h.

◆ verbose

bool leansdr::scheduler::verbose

◆ windows

window_placement* leansdr::scheduler::windows

Definition at line 120 of file framework.h.


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