summaryrefslogtreecommitdiff
path: root/gnuradio-core/src/lib/general/gr_feval.h
diff options
context:
space:
mode:
authoreb <eb@221aa14e-8319-0410-a670-987f0aec2ac5>2006-10-31 16:07:47 +0000
committereb <eb@221aa14e-8319-0410-a670-987f0aec2ac5>2006-10-31 16:07:47 +0000
commit2c1032480d2874f38af9b5b9d18e753e968619e5 (patch)
tree6f910bda577337475ffc4a53ad94c026f480f026 /gnuradio-core/src/lib/general/gr_feval.h
parent3695548d8598f524dd203f7dfc4f73f301b7282a (diff)
Merged eb/binstats -r3848:3906 into trunk. These changes
(1) fix a problem with gr_feval* where when called from a live flowgraph, they resulted in the call back into Python occuring without holding the Global Interpreter Lock causing a SIGSEGV. (2) add gr_bin_statistics_f which combines statistics gathering with a control state machine that allows spectrum sensing or related applications that need to step through the spectrum to be built. (3) usrp_spectrum_sense.py which ties all this together in an application which steps through the spectrum a chunk at a time and gathers statistics. In the current version, the stats are gathered by nothing is done with them. Think of this as the framework for a real application. This code may require tuning of the --tune-delay and --dwell-delay timeouts to ensure that the samples being processed are associated with the given center frequency. git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@3907 221aa14e-8319-0410-a670-987f0aec2ac5
Diffstat (limited to 'gnuradio-core/src/lib/general/gr_feval.h')
-rw-r--r--gnuradio-core/src/lib/general/gr_feval.h60
1 files changed, 44 insertions, 16 deletions
diff --git a/gnuradio-core/src/lib/general/gr_feval.h b/gnuradio-core/src/lib/general/gr_feval.h
index a2f7020a44..b8a5eec25d 100644
--- a/gnuradio-core/src/lib/general/gr_feval.h
+++ b/gnuradio-core/src/lib/general/gr_feval.h
@@ -31,17 +31,24 @@
* and is callable from both places. It uses SWIG's
* "director" feature to implement the magic.
* It's slow. Don't use it in a performance critical path.
+ *
+ * Override eval to define the behavior.
+ * Use calleval to invoke eval (this kludge is required to allow a
+ * python specific "shim" to be inserted.
*/
class gr_feval_dd
{
-public:
- gr_feval_dd() {}
- virtual ~gr_feval_dd();
-
+protected:
/*!
* \brief override this to define the function
*/
virtual double eval(double x);
+
+public:
+ gr_feval_dd() {}
+ virtual ~gr_feval_dd();
+
+ virtual double calleval(double x); // invoke "eval"
};
/*!
@@ -51,17 +58,24 @@ public:
* and is callable from both places. It uses SWIG's
* "director" feature to implement the magic.
* It's slow. Don't use it in a performance critical path.
+ *
+ * Override eval to define the behavior.
+ * Use calleval to invoke eval (this kludge is required to allow a
+ * python specific "shim" to be inserted.
*/
class gr_feval_cc
{
-public:
- gr_feval_cc() {}
- virtual ~gr_feval_cc();
-
+protected:
/*!
* \brief override this to define the function
*/
virtual gr_complex eval(gr_complex x);
+
+public:
+ gr_feval_cc() {}
+ virtual ~gr_feval_cc();
+
+ virtual gr_complex calleval(gr_complex x); // invoke "eval"
};
/*!
@@ -71,17 +85,24 @@ public:
* and is callable from both places. It uses SWIG's
* "director" feature to implement the magic.
* It's slow. Don't use it in a performance critical path.
+ *
+ * Override eval to define the behavior.
+ * Use calleval to invoke eval (this kludge is required to allow a
+ * python specific "shim" to be inserted.
*/
class gr_feval_ll
{
-public:
- gr_feval_ll() {}
- virtual ~gr_feval_ll();
-
+protected:
/*!
* \brief override this to define the function
*/
virtual long eval(long x);
+
+public:
+ gr_feval_ll() {}
+ virtual ~gr_feval_ll();
+
+ virtual long calleval(long x); // invoke "eval"
};
/*!
@@ -91,17 +112,24 @@ public:
* and is callable from both places. It uses SWIG's
* "director" feature to implement the magic.
* It's slow. Don't use it in a performance critical path.
+ *
+ * Override eval to define the behavior.
+ * Use calleval to invoke eval (this kludge is required to allow a
+ * python specific "shim" to be inserted.
*/
class gr_feval
{
-public:
- gr_feval() {}
- virtual ~gr_feval();
-
+protected:
/*!
* \brief override this to define the function
*/
virtual void eval();
+
+public:
+ gr_feval() {}
+ virtual ~gr_feval();
+
+ virtual void calleval(); // invoke "eval"
};
/*!