3 * Copyright 2008 Free Software Foundation, Inc.
5 * This file is part of GNU Radio
7 * GNU Radio is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 3, or (at your option)
12 * GNU Radio is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License along
18 * with this program; if not, write to the Free Software Foundation, Inc.,
19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
25 #include <gr_tpb_detail.h>
27 #include <gr_block_detail.h>
28 #include <gr_buffer.h>
31 * We assume that no worker threads are ever running when the
32 * graph structure is being manipulated, thus it's safe for us to poke
33 * around in our neighbors w/o holding any locks.
37 gr_tpb_detail::notify_upstream(gr_block_detail *d)
39 // For each of our inputs, tell the guy upstream that we've consumed
40 // some input, and that he most likely has more output buffer space
43 for (size_t i = 0; i < d->d_input.size(); i++){
44 // Can you say, "pointer chasing?"
45 d->d_input[i]->buffer()->link()->detail()->d_tpb.set_output_changed();
50 gr_tpb_detail::notify_downstream(gr_block_detail *d)
52 // For each of our outputs, tell the guys downstream that they have
53 // new input available.
55 for (size_t i = 0; i < d->d_output.size(); i++){
56 gr_buffer_sptr buf = d->d_output[i];
57 for (size_t j = 0, k = buf->nreaders(); j < k; j++)
58 buf->reader(j)->link()->detail()->d_tpb.set_input_changed();
63 gr_tpb_detail::notify_neighbors(gr_block_detail *d)