summaryrefslogtreecommitdiff
path: root/gnuradio-core/src/lib
diff options
context:
space:
mode:
authoreb2008-05-26 13:33:34 +0000
committereb2008-05-26 13:33:34 +0000
commit30fde16beb9901189fa9546f95b26049df48c4c1 (patch)
tree643a53898b26e9c0022aae58d8523a2dbcf9f31b /gnuradio-core/src/lib
parentfcf2cfb0c0949db3cb7cdd635376a683cbc13f4d (diff)
downloadgnuradio-30fde16beb9901189fa9546f95b26049df48c4c1.tar.gz
gnuradio-30fde16beb9901189fa9546f95b26049df48c4c1.tar.bz2
gnuradio-30fde16beb9901189fa9546f95b26049df48c4c1.zip
Added rewind() and clear() to vector sources and sinks. This is useful
when doing automatic testing of a block (e.g. BER vs SNR). Patch from Andreas Müller. git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@8509 221aa14e-8319-0410-a670-987f0aec2ac5
Diffstat (limited to 'gnuradio-core/src/lib')
-rw-r--r--gnuradio-core/src/lib/gengen/gr_vector_sink_X.h.t1
-rw-r--r--gnuradio-core/src/lib/gengen/gr_vector_sink_X.i.t1
-rw-r--r--gnuradio-core/src/lib/gengen/gr_vector_source_X.h.t1
-rw-r--r--gnuradio-core/src/lib/gengen/gr_vector_source_X.i.t2
4 files changed, 5 insertions, 0 deletions
diff --git a/gnuradio-core/src/lib/gengen/gr_vector_sink_X.h.t b/gnuradio-core/src/lib/gengen/gr_vector_sink_X.h.t
index 6aeb99480..ec0ebb8bb 100644
--- a/gnuradio-core/src/lib/gengen/gr_vector_sink_X.h.t
+++ b/gnuradio-core/src/lib/gengen/gr_vector_sink_X.h.t
@@ -49,6 +49,7 @@ class @NAME@ : public gr_sync_block {
gr_vector_const_void_star &input_items,
gr_vector_void_star &output_items);
+ void clear() {d_data.clear();}
std::vector<@TYPE@> data () const;
};
diff --git a/gnuradio-core/src/lib/gengen/gr_vector_sink_X.i.t b/gnuradio-core/src/lib/gengen/gr_vector_sink_X.i.t
index 988340e30..563171123 100644
--- a/gnuradio-core/src/lib/gengen/gr_vector_sink_X.i.t
+++ b/gnuradio-core/src/lib/gengen/gr_vector_sink_X.i.t
@@ -32,6 +32,7 @@ class @NAME@ : public gr_sync_block {
@NAME@ ();
public:
+ void clear() {d_data.clear();}
std::vector<@TYPE@> data () const;
};
diff --git a/gnuradio-core/src/lib/gengen/gr_vector_source_X.h.t b/gnuradio-core/src/lib/gengen/gr_vector_source_X.h.t
index 62a4dc8ad..0b8d92a9c 100644
--- a/gnuradio-core/src/lib/gengen/gr_vector_source_X.h.t
+++ b/gnuradio-core/src/lib/gengen/gr_vector_source_X.h.t
@@ -46,6 +46,7 @@ class @NAME@ : public gr_sync_block {
@NAME@ (const std::vector<@TYPE@> &data, bool repeat);
public:
+ void rewind() {d_offset=0;}
virtual int work (int noutput_items,
gr_vector_const_void_star &input_items,
gr_vector_void_star &output_items);
diff --git a/gnuradio-core/src/lib/gengen/gr_vector_source_X.i.t b/gnuradio-core/src/lib/gengen/gr_vector_source_X.i.t
index c56f72877..1e94ce401 100644
--- a/gnuradio-core/src/lib/gengen/gr_vector_source_X.i.t
+++ b/gnuradio-core/src/lib/gengen/gr_vector_source_X.i.t
@@ -28,6 +28,8 @@ GR_SWIG_BLOCK_MAGIC(gr,@BASE_NAME@);
gr_make_@BASE_NAME@ (const std::vector<@TYPE@> &data, bool repeat = false);
class @NAME@ : public gr_sync_block {
+ public:
+ void rewind() {d_offset=0;}
private:
@NAME@ (const std::vector<@TYPE@> &data);
};