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);
131 void remove_item_tag(
unsigned int which_input,
const tag_t &tag,
long id);
148 void get_tags_in_range(std::vector<tag_t> &
v,
149 unsigned int which_input,
173 void get_tags_in_range(std::vector<tag_t> &v,
174 unsigned int which_input,
187 void set_processor_affinity(
const std::vector<int> &mask);
192 void unset_processor_affinity();
209 void start_perf_counters();
210 void stop_perf_counters(
int noutput_items,
int nproduced);
211 void reset_perf_counters();
214 float pc_noutput_items();
215 float pc_nproduced();
216 float pc_input_buffers_full(
size_t which);
217 std::vector<float> pc_input_buffers_full();
218 float pc_output_buffers_full(
size_t which);
219 std::vector<float> pc_output_buffers_full();
220 float pc_work_time();
222 float pc_noutput_items_avg();
223 float pc_nproduced_avg();
224 float pc_input_buffers_full_avg(
size_t which);
225 std::vector<float> pc_input_buffers_full_avg();
226 float pc_output_buffers_full_avg(
size_t which);
227 std::vector<float> pc_output_buffers_full_avg();
228 float pc_work_time_avg();
229 float pc_throughput_avg();
231 float pc_noutput_items_var();
232 float pc_nproduced_var();
233 float pc_input_buffers_full_var(
size_t which);
234 std::vector<float> pc_input_buffers_full_var();
235 float pc_output_buffers_full_var(
size_t which);
236 std::vector<float> pc_output_buffers_full_var();
237 float pc_work_time_var();
239 float pc_work_time_total();
244 int consumed()
const;
249 unsigned int d_ninputs;
250 unsigned int d_noutputs;
251 std::vector<buffer_reader_sptr> d_input;
252 std::vector<buffer_sptr> d_output;
257 float d_ins_noutput_items;
258 float d_avg_noutput_items;
259 float d_var_noutput_items;
260 float d_total_noutput_items;
263 float d_ins_nproduced;
264 float d_avg_nproduced;
265 float d_var_nproduced;
266 std::vector<float> d_ins_input_buffers_full;
267 std::vector<float> d_avg_input_buffers_full;
268 std::vector<float> d_var_input_buffers_full;
269 std::vector<float> d_ins_output_buffers_full;
270 std::vector<float> d_avg_output_buffers_full;
271 std::vector<float> d_var_output_buffers_full;
273 float d_ins_work_time;
274 float d_avg_work_time;
275 float d_var_work_time;
276 float d_total_work_time;
277 float d_avg_throughput;
280 block_detail(
unsigned int ninputs,
unsigned int noutputs);
buffer_reader_sptr input(unsigned int which)
Definition: block_detail.h:58
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:207
pthread_t gr_thread_t
a system-dependent typedef for the underlying thread type.
Definition: thread.h:61
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:55
Include this header to use the message passing features.
Definition: logger.h:695
int d_produce_or
Definition: block_detail.h:242
bool sink_p() const
Definition: block_detail.h:51
GR_RUNTIME_API int thread_priority(gr_thread_t thread)
get current thread priority for a given thread ID
bool done() const
Definition: block_detail.h:55
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:206
tpb_detail d_tpb
Definition: block_detail.h:241
bool source_p() const
Definition: block_detail.h:52
buffer_sptr output(unsigned int which)
Definition: block_detail.h:66
boost::intrusive_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:56
int ninputs() const
Definition: block_detail.h:49
int noutputs() const
Definition: block_detail.h:50