23 #ifndef INCLUDED_GR_RUNTIME_BLOCK_DETAIL_H 24 #define INCLUDED_GR_RUNTIME_BLOCK_DETAIL_H 51 bool sink_p()
const {
return d_noutputs == 0; }
52 bool source_p()
const {
return d_ninputs == 0; }
54 void set_done(
bool done);
55 bool done()
const {
return d_done; }
57 void set_input(
unsigned int which, buffer_reader_sptr reader);
58 buffer_reader_sptr
input(
unsigned int which)
60 if (which >= d_ninputs)
61 throw std::invalid_argument(
"block_detail::input");
62 return d_input[which];
65 void set_output(
unsigned int which, buffer_sptr
buffer);
66 buffer_sptr
output(
unsigned int which)
68 if (which >= d_noutputs)
69 throw std::invalid_argument(
"block_detail::output");
70 return d_output[which];
77 void consume(
int which_input,
int how_many_items);
83 void consume_each(
int how_many_items);
89 void produce(
int which_output,
int how_many_items);
95 void produce_each(
int how_many_items);
98 uint64_t nitems_read(
unsigned int which_input);
101 uint64_t nitems_written(
unsigned int which_output);
105 void reset_nitem_counters();
119 void add_item_tag(
unsigned int which_output,
const tag_t& tag);
132 void remove_item_tag(
unsigned int which_input,
const tag_t& tag,
long id);
149 void get_tags_in_range(std::vector<tag_t>&
v,
150 unsigned int which_input,
174 void get_tags_in_range(std::vector<tag_t>& v,
175 unsigned int which_input,
188 void set_processor_affinity(
const std::vector<int>& mask);
193 void unset_processor_affinity();
210 void start_perf_counters();
211 void stop_perf_counters(
int noutput_items,
int nproduced);
212 void reset_perf_counters();
215 float pc_noutput_items();
216 float pc_nproduced();
217 float pc_input_buffers_full(
size_t which);
218 std::vector<float> pc_input_buffers_full();
219 float pc_output_buffers_full(
size_t which);
220 std::vector<float> pc_output_buffers_full();
221 float pc_work_time();
223 float pc_noutput_items_avg();
224 float pc_nproduced_avg();
225 float pc_input_buffers_full_avg(
size_t which);
226 std::vector<float> pc_input_buffers_full_avg();
227 float pc_output_buffers_full_avg(
size_t which);
228 std::vector<float> pc_output_buffers_full_avg();
229 float pc_work_time_avg();
230 float pc_throughput_avg();
232 float pc_noutput_items_var();
233 float pc_nproduced_var();
234 float pc_input_buffers_full_var(
size_t which);
235 std::vector<float> pc_input_buffers_full_var();
236 float pc_output_buffers_full_var(
size_t which);
237 std::vector<float> pc_output_buffers_full_var();
238 float pc_work_time_var();
240 float pc_work_time_total();
245 int consumed()
const;
250 unsigned int d_ninputs;
251 unsigned int d_noutputs;
252 std::vector<buffer_reader_sptr> d_input;
253 std::vector<buffer_sptr> d_output;
258 float d_ins_noutput_items;
259 float d_avg_noutput_items;
260 float d_var_noutput_items;
261 float d_total_noutput_items;
264 float d_ins_nproduced;
265 float d_avg_nproduced;
266 float d_var_nproduced;
267 std::vector<float> d_ins_input_buffers_full;
268 std::vector<float> d_avg_input_buffers_full;
269 std::vector<float> d_var_input_buffers_full;
270 std::vector<float> d_ins_output_buffers_full;
271 std::vector<float> d_avg_output_buffers_full;
272 std::vector<float> d_var_output_buffers_full;
274 float d_ins_work_time;
275 float d_avg_work_time;
276 float d_var_work_time;
277 float d_total_work_time;
278 float d_avg_throughput;
281 block_detail(
unsigned int ninputs,
unsigned int noutputs);
286 unsigned int noutputs);
290 unsigned int noutputs);
bool done() const
Definition: block_detail.h:55
buffer_reader_sptr input(unsigned int which)
Definition: block_detail.h:58
boost::shared_ptr< pmt_base > pmt_t
typedef for shared pointer (transparent reference counting). See http://www.boost.org/libs/smart_ptr/smart_ptr.htm
Definition: pmt.h:96
GR_RUNTIME_API block_detail_sptr make_block_detail(unsigned int ninputs, unsigned int noutputs)
Implementation details to support the signal processing abstractionThis class contains implementation...
Definition: block_detail.h:44
gr::thread::gr_thread_t thread
Definition: block_detail.h:208
pthread_t gr_thread_t
a system-dependent typedef for the underlying thread type.
Definition: thread.h:61
bool source_p() const
Definition: block_detail.h:52
Definition: cc_common.h:45
#define GR_RUNTIME_API
Definition: gnuradio-runtime/include/gnuradio/api.h:30
GR_RUNTIME_API int set_thread_priority(gr_thread_t thread, int priority)
set current thread priority for a given thread ID
GR_RUNTIME_API long block_detail_ncurrently_allocated()
Single writer, multiple reader fifo.
Definition: buffer.h:56
GNU Radio logging wrapper for log4cpp library (C++ port of log4j)
Definition: basic_block.h:43
int d_produce_or
Definition: block_detail.h:243
GR_RUNTIME_API int thread_priority(gr_thread_t thread)
get current thread priority for a given thread ID
signed long long high_res_timer_type
Typedef for the timer tick count.
Definition: high_res_timer.h:49
used by thread-per-block scheduler
Definition: tpb_detail.h:37
bool threaded
Definition: block_detail.h:207
int noutputs() const
Definition: block_detail.h:50
tpb_detail d_tpb
Definition: block_detail.h:242
buffer_sptr output(unsigned int which)
Definition: block_detail.h:66
bool sink_p() const
Definition: block_detail.h:51
int ninputs() const
Definition: block_detail.h:49