X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=gnuradio-core%2Fsrc%2Flib%2Fruntime%2Fgr_block.h;fp=gnuradio-core%2Fsrc%2Flib%2Fruntime%2Fgr_block.h;h=b6f724dde0a89bc79629602209b0baf710ef6a10;hb=35e43e8d8c271e6842191cac3fc3f2f88a861183;hp=354695c0b70bb9de3d6b27a7d66310e6f58c54d7;hpb=ea29b08aeb54227e6628f655ccfdb96fe4d8c378;p=debian%2Fgnuradio diff --git a/gnuradio-core/src/lib/runtime/gr_block.h b/gnuradio-core/src/lib/runtime/gr_block.h index 354695c0..b6f724dd 100644 --- a/gnuradio-core/src/lib/runtime/gr_block.h +++ b/gnuradio-core/src/lib/runtime/gr_block.h @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004,2007 Free Software Foundation, Inc. + * Copyright 2004,2007,2009 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -57,6 +57,12 @@ class gr_block : public gr_basic_block { public: + //! Magic return values from general_work + enum { + WORK_CALLED_PRODUCE = -2, + WORK_DONE = -1 + }; + virtual ~gr_block (); /*! @@ -70,7 +76,7 @@ class gr_block : public gr_basic_block { void set_history (unsigned history) { d_history = history; } /*! - * \brief return true if this block has a fixed input to output rate + * \brief Return true if this block has a fixed input to output rate. * * If true, then fixed_rate_in_to_out and fixed_rate_out_to_in may be called. */ @@ -149,6 +155,13 @@ class gr_block : public gr_basic_block { */ void consume_each (int how_many_items); + /*! + * \brief Tell the scheduler \p how_many_items were produced on output stream \p which_output. + * + * If the block's general_work method calls produce, \p general_work must return WORK_CALLED_PRODUCE. + */ + void produce (int which_output, int how_many_items); + /*! * \brief Set the approximate output rate / input rate * @@ -191,7 +204,7 @@ class gr_block : public gr_basic_block { int d_output_multiple; double d_relative_rate; // approx output_rate / input_rate - gr_block_detail_sptr d_detail; // implementation details + gr_block_detail_sptr d_detail; // implementation details unsigned d_history; bool d_fixed_rate;