commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] r11599 - in gnuradio/trunk/gnuradio-core/src/lib: filt


From: eb
Subject: [Commit-gnuradio] r11599 - in gnuradio/trunk/gnuradio-core/src/lib: filter general gengen
Date: Sat, 15 Aug 2009 12:32:57 -0600 (MDT)

Author: eb
Date: 2009-08-15 12:32:56 -0600 (Sat, 15 Aug 2009)
New Revision: 11599

Modified:
   gnuradio/trunk/gnuradio-core/src/lib/filter/gr_pfb_channelizer_ccf.cc
   gnuradio/trunk/gnuradio-core/src/lib/filter/gr_pfb_channelizer_ccf.h
   gnuradio/trunk/gnuradio-core/src/lib/filter/gr_pfb_channelizer_ccf.i
   gnuradio/trunk/gnuradio-core/src/lib/general/gr_head.cc
   gnuradio/trunk/gnuradio-core/src/lib/general/gr_head.h
   gnuradio/trunk/gnuradio-core/src/lib/general/gr_head.i
   gnuradio/trunk/gnuradio-core/src/lib/gengen/gr_vector_sink_X.h.t
   gnuradio/trunk/gnuradio-core/src/lib/gengen/gr_vector_sink_X.i.t
Log:
Added reset method to gr_head and gr_vector_sink.  This allows graphs
containing these blocks to be run more than once with user control
over when the reset of the counter and sink occurs.



Property changes on: 
gnuradio/trunk/gnuradio-core/src/lib/filter/gr_pfb_channelizer_ccf.cc
___________________________________________________________________
Modified: svn:mergeinfo
   - 
   + 
/gnuradio/branches/developers/eb/vrt2/gnuradio-core/src/lib/filter/gr_pfb_channelizer_ccf.cc:11519-11598


Property changes on: 
gnuradio/trunk/gnuradio-core/src/lib/filter/gr_pfb_channelizer_ccf.h
___________________________________________________________________
Modified: svn:mergeinfo
   - 
   + 
/gnuradio/branches/developers/eb/vrt2/gnuradio-core/src/lib/filter/gr_pfb_channelizer_ccf.h:11519-11598


Property changes on: 
gnuradio/trunk/gnuradio-core/src/lib/filter/gr_pfb_channelizer_ccf.i
___________________________________________________________________
Modified: svn:mergeinfo
   - 
   + 
/gnuradio/branches/developers/eb/vrt2/gnuradio-core/src/lib/filter/gr_pfb_channelizer_ccf.i:11519-11598

Modified: gnuradio/trunk/gnuradio-core/src/lib/general/gr_head.cc
===================================================================
--- gnuradio/trunk/gnuradio-core/src/lib/general/gr_head.cc     2009-08-15 
17:39:48 UTC (rev 11598)
+++ gnuradio/trunk/gnuradio-core/src/lib/general/gr_head.cc     2009-08-15 
18:32:56 UTC (rev 11599)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2004 Free Software Foundation, Inc.
+ * Copyright 2004,2009 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -35,10 +35,10 @@
 {
 }
 
-gr_block_sptr
+gr_head_sptr
 gr_make_head (size_t sizeof_stream_item, int nitems)
 {
-  return gr_block_sptr (new gr_head (sizeof_stream_item, nitems));
+  return gnuradio::get_initial_sptr(new gr_head (sizeof_stream_item, nitems));
 }
 
 int

Modified: gnuradio/trunk/gnuradio-core/src/lib/general/gr_head.h
===================================================================
--- gnuradio/trunk/gnuradio-core/src/lib/general/gr_head.h      2009-08-15 
17:39:48 UTC (rev 11598)
+++ gnuradio/trunk/gnuradio-core/src/lib/general/gr_head.h      2009-08-15 
18:32:56 UTC (rev 11599)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2004 Free Software Foundation, Inc.
+ * Copyright 2004,2009 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -26,6 +26,9 @@
 #include <gr_sync_block.h>
 #include <stddef.h>                    // size_t
 
+class gr_head;
+typedef boost::shared_ptr<gr_head> gr_head_sptr;
+
 /*!
  * \brief copies the first N items to the output then signals done
  * \ingroup slicedice_blk
@@ -35,7 +38,7 @@
 
 class gr_head : public gr_sync_block
 {
-  friend gr_block_sptr gr_make_head (size_t sizeof_stream_item, int nitems);
+  friend gr_head_sptr gr_make_head (size_t sizeof_stream_item, int nitems);
   gr_head (size_t sizeof_stream_item, int nitems);
 
   int  d_nitems;
@@ -45,9 +48,11 @@
   int work (int noutput_items,
                 gr_vector_const_void_star &input_items,
                 gr_vector_void_star &output_items);
+
+  void reset() { d_ncopied_items = 0; }
 };
 
-gr_block_sptr
+gr_head_sptr
 gr_make_head (size_t sizeof_stream_item, int nitems);
 
 

Modified: gnuradio/trunk/gnuradio-core/src/lib/general/gr_head.i
===================================================================
--- gnuradio/trunk/gnuradio-core/src/lib/general/gr_head.i      2009-08-15 
17:39:48 UTC (rev 11598)
+++ gnuradio/trunk/gnuradio-core/src/lib/general/gr_head.i      2009-08-15 
18:32:56 UTC (rev 11599)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2004 Free Software Foundation, Inc.
+ * Copyright 2004,2009 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -20,11 +20,13 @@
  * Boston, MA 02110-1301, USA.
  */
 
-%ignore gr_head;
+GR_SWIG_BLOCK_MAGIC(gr,head);
+
+gr_head_sptr gr_make_head(size_t sizeof_stream_item, int nitems);
+
 class gr_head : public gr_block {
-  friend gr_block_sptr gr_make_head (size_t sizeof_stream_item, int nitems);
-  gr_head (size_t sizeof_stream_item, int nitems);
+  gr_head();
+public:
+  void reset();
 };
 
-%rename(head) gr_make_head;
-gr_block_sptr gr_make_head (size_t sizeof_stream_item, int nitems);

Modified: gnuradio/trunk/gnuradio-core/src/lib/gengen/gr_vector_sink_X.h.t
===================================================================
--- gnuradio/trunk/gnuradio-core/src/lib/gengen/gr_vector_sink_X.h.t    
2009-08-15 17:39:48 UTC (rev 11598)
+++ gnuradio/trunk/gnuradio-core/src/lib/gengen/gr_vector_sink_X.h.t    
2009-08-15 18:32:56 UTC (rev 11599)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2004,2008 Free Software Foundation, Inc.
+ * Copyright 2004,2008,2009 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -50,7 +50,8 @@
                    gr_vector_const_void_star &input_items,
                    gr_vector_void_star &output_items);
 
-  void clear() {d_data.clear();}
+  void reset() {d_data.clear();}
+  void clear() {reset(); }             // deprecated
   std::vector<@TYPE@> data () const;
 };
 

Modified: gnuradio/trunk/gnuradio-core/src/lib/gengen/gr_vector_sink_X.i.t
===================================================================
--- gnuradio/trunk/gnuradio-core/src/lib/gengen/gr_vector_sink_X.i.t    
2009-08-15 17:39:48 UTC (rev 11598)
+++ gnuradio/trunk/gnuradio-core/src/lib/gengen/gr_vector_sink_X.i.t    
2009-08-15 18:32:56 UTC (rev 11599)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2004,2008 Free Software Foundation, Inc.
+ * Copyright 2004,2008,2009 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -32,7 +32,8 @@
   @NAME@ (int vlen);
 
  public:
-  void clear() {d_data.clear();}
+  void clear();                        // deprecated
+  void reset();
   std::vector<@TYPE@> data () const;
 };
 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]