Fixing output types from tap_type to o_type in gr_single_pole_iir.h. Doesn't make...
[debian/gnuradio] / gnuradio-core / src / lib / runtime / gr_block.cc
index 1b1d357560eb1ad4208068af206cf576059bd185..8915f3360fb56c9a6c6459bd3565bee82ffaba7b 100644 (file)
@@ -1,12 +1,12 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2004 Free Software Foundation, Inc.
+ * Copyright 2004,2009 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
  * GNU Radio is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
+ * the Free Software Foundation; either version 3, or (at your option)
  * any later version.
  * 
  * GNU Radio is distributed in the hope that it will be useful,
@@ -51,7 +51,7 @@ gr_block::forecast (int noutput_items, gr_vector_int &ninput_items_required)
 {
   unsigned ninputs = ninput_items_required.size ();
   for (unsigned i = 0; i < ninputs; i++)
-    ninput_items_required[i] = noutput_items;
+    ninput_items_required[i] = noutput_items + history() - 1;
 }
 
 // default implementation
@@ -99,6 +99,12 @@ gr_block::consume_each (int how_many_items)
   d_detail->consume_each (how_many_items);
 }
 
+void
+gr_block::produce (int which_output, int how_many_items)
+{
+  d_detail->produce (which_output, how_many_items);
+}
+
 int
 gr_block::fixed_rate_ninput_to_noutput(int ninput)
 {
@@ -110,3 +116,11 @@ gr_block::fixed_rate_noutput_to_ninput(int noutput)
 {
   throw std::runtime_error("Unimplemented");
 }
+
+std::ostream&
+operator << (std::ostream& os, const gr_block *m)
+{
+  os << "<gr_block " << m->name() << " (" << m->unique_id() << ")>";
+  return os;
+}
+