Added optional vlen parameter to vector_source_* and vector_sink_*.
[debian/gnuradio] / gnuradio-core / src / lib / gengen / gr_vector_sink_X.cc.t
index 303ac4cdd100257ca9ae59ddd8ca9b72a81cd280..b2a6c4ac4e66d1e68f01031095c2f686ef6a42ca 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2004 Free Software Foundation, Inc.
+ * Copyright 2004,2008 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
 #include <gr_io_signature.h>
 
 
-@NAME@::@NAME@ ()
+@NAME@::@NAME@ (int vlen)
   : gr_sync_block ("@BASE_NAME@",
-              gr_make_io_signature (1, 1, sizeof (@TYPE@)),
-              gr_make_io_signature (0, 0, 0))
+                  gr_make_io_signature (1, 1, sizeof (@TYPE@) * vlen),
+                  gr_make_io_signature (0, 0, 0)),
+    d_vlen(vlen)
 {
 }
 
@@ -43,7 +44,7 @@ int
                    gr_vector_void_star &output_items)
 {
   @TYPE@ *iptr = (@TYPE@ *) input_items[0];
-  for (int i = 0; i < noutput_items; i++)
+  for (int i = 0; i < noutput_items * d_vlen; i++)
     d_data.push_back (iptr[i]);
 
   return noutput_items;
@@ -51,9 +52,9 @@ int
 
 
 @NAME@_sptr
-gr_make_@BASE_NAME@ ()
+gr_make_@BASE_NAME@ (int vlen)
 {
-  return @NAME@_sptr (new @NAME@ ());
+  return @NAME@_sptr (new @NAME@ (vlen));
 }
 
 std::vector<@TYPE@>