23 #ifndef INCLUDED_GR_RUNTIME_BLOCK_H
24 #define INCLUDED_GR_RUNTIME_BLOCK_H
66 WORK_CALLED_PRODUCE = -2,
85 unsigned history()
const {
return d_history; }
109 virtual void forecast(
int noutput_items,
126 virtual int general_work(
int noutput_items,
139 virtual bool start();
156 void set_output_multiple(
int multiple);
177 void set_alignment(
int multiple);
180 void set_unaligned(
int na);
182 void set_is_unaligned(
bool u);
189 void consume(
int which_input,
int how_many_items);
195 void consume_each(
int how_many_items);
204 void produce(
int which_output,
int how_many_items);
215 void set_relative_rate(
double relative_rate);
234 virtual int fixed_rate_ninput_to_noutput(
int ninput);
241 virtual int fixed_rate_noutput_to_ninput(
int noutput);
246 uint64_t nitems_read(
unsigned int which_input);
251 uint64_t nitems_written(
unsigned int which_output);
256 tag_propagation_policy_t tag_propagation_policy();
261 void set_tag_propagation_policy(tag_propagation_policy_t p);
284 int max_noutput_items();
292 void set_max_noutput_items(
int m);
309 void unset_max_noutput_items();
315 bool is_set_max_noutput_items();
324 void expand_minmax_buffer(
int port);
329 long max_output_buffer(
size_t i);
334 void set_max_output_buffer(
long max_output_buffer);
339 void set_max_output_buffer(
int port,
long max_output_buffer);
344 long min_output_buffer(
size_t i);
349 void set_min_output_buffer(
long min_output_buffer);
354 void set_min_output_buffer(
int port,
long min_output_buffer);
361 float pc_noutput_items();
366 float pc_noutput_items_avg();
371 float pc_noutput_items_var();
376 float pc_nproduced();
381 float pc_nproduced_avg();
386 float pc_nproduced_var();
391 float pc_input_buffers_full(
int which);
396 float pc_input_buffers_full_avg(
int which);
401 float pc_input_buffers_full_var(
int which);
406 std::vector<float> pc_input_buffers_full();
411 std::vector<float> pc_input_buffers_full_avg();
416 std::vector<float> pc_input_buffers_full_var();
421 float pc_output_buffers_full(
int which);
426 float pc_output_buffers_full_avg(
int which);
431 float pc_output_buffers_full_var(
int which);
436 std::vector<float> pc_output_buffers_full();
441 std::vector<float> pc_output_buffers_full_avg();
446 std::vector<float> pc_output_buffers_full_var();
451 float pc_work_time();
456 float pc_work_time_avg();
461 float pc_work_time_var();
466 void reset_perf_counters();
495 void set_processor_affinity(
const std::vector<int> &mask);
500 void unset_processor_affinity();
510 int active_thread_priority();
525 int d_output_multiple;
526 bool d_output_multiple_set;
529 double d_relative_rate;
533 bool d_max_noutput_items_set;
534 int d_max_noutput_items;
535 int d_min_noutput_items;
536 tag_propagation_policy_t d_tag_propagation_policy;
537 std::vector<int> d_affinity;
570 this->add_item_tag(which_output, tag);
579 void add_item_tag(
unsigned int which_output,
const tag_t &tag);
604 this->remove_item_tag(which_input, tag);
615 void remove_item_tag(
unsigned int which_input,
const tag_t &tag);
630 void get_tags_in_range(std::vector<tag_t> &v,
631 unsigned int which_input,
650 void get_tags_in_range(std::vector<tag_t> &v,
651 unsigned int which_input,
std::string logger_ptr
Definition: logger.h:65
pmt::pmt_t value
the value of tag (as a PMT)
Definition: tags.h:40
uint64_t offset
the item tag occurred at (as a uint64_t)
Definition: tags.h:34
gr::logger_ptr d_debug_logger
Definition: block.h:669
std::vector< int > processor_affinity()
Get the current processor affinity.
Definition: block.h:505
std::vector< block_sptr > block_vector_t
Definition: block.h:679
block_detail_sptr detail() const
Definition: block.h:675
void set_fixed_rate(bool fixed_rate)
Definition: block.h:547
void add_item_tag(unsigned int which_output, uint64_t abs_offset, const pmt::pmt_t &key, const pmt::pmt_t &value, const pmt::pmt_t &srcid=pmt::PMT_F)
Adds a new tag onto the given output buffer.
Definition: block.h:559
bool output_multiple_set() const
Definition: block.h:158
void set_history(unsigned history)
Definition: block.h:86
gr::thread::mutex d_setlock
Definition: block.h:664
gr::logger_ptr d_logger
Definition: block.h:668
std::vector< const void * > gr_vector_const_void_star
Definition: gnuradio-runtime/include/gnuradio/types.h:38
int unaligned() const
Definition: block.h:181
#define GR_RUNTIME_API
Definition: gnuradio-runtime/include/gnuradio/api.h:30
int min_noutput_items() const
Return the minimum number of output items this block can produce during a call to work...
Definition: block.h:270
GR_RUNTIME_API int set_thread_priority(gr_thread_t thread, int priority)
get current thread priority for a given thread ID
std::vector< long > d_min_output_buffer
Definition: block.h:657
std::vector< void * > gr_vector_void_star
Definition: gnuradio-runtime/include/gnuradio/types.h:37
std::vector< int > gr_vector_int
Definition: gnuradio-runtime/include/gnuradio/types.h:33
std::vector< block_sptr >::iterator block_viter_t
Definition: block.h:680
std::vector< long > d_max_output_buffer
Definition: block.h:656
The abstract base class for all signal processing blocks.Basic blocks are the bare abstraction of an ...
Definition: basic_block.h:58
unsigned __int64 uint64_t
Definition: stdint.h:90
bool fixed_rate() const
Return true if this block has a fixed input to output rate.
Definition: block.h:93
block(void)
Definition: block.h:542
void set_min_noutput_items(int m)
Set the minimum number of output items this block can produce during a call to work.
Definition: block.h:278
GR_RUNTIME_API int thread_priority(gr_thread_t thread)
get current thread priority for a given thread ID
tag_propagation_policy_t
Definition: block.h:70
PMT_API const pmt_t PMT_F
bool is_pc_rpc_set()
Checks if this block is already exporting perf. counters to ControlPort.
Definition: block.h:478
pmt::pmt_t key
the key of tag (as a PMT symbol)
Definition: tags.h:37
std::ostream & operator<<(std::ostream &os, basic_block_sptr basic_block)
Definition: basic_block.h:366
VOLK_API $kern pname $kern name
A function pointer to the dispatcher implementation.
bool is_unaligned() const
Definition: block.h:183
boost::mutex mutex
Definition: thread.h:46
unsigned history() const
Definition: block.h:85
double relative_rate() const
return the approximate output rate / input rate
Definition: block.h:220
pmt::pmt_t srcid
the source ID of tag (as a PMT)
Definition: tags.h:43
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
The abstract base class for all 'terminal' processing blocks.A signal processing flow is constructed ...
Definition: block.h:60
void set_detail(block_detail_sptr detail)
Definition: block.h:676
int alignment() const
Definition: block.h:178
void no_pc_rpc()
If the block calls this in its constructor, it's perf. counters will not be exported.
Definition: block.h:484
void remove_item_tag(unsigned int which_input, uint64_t abs_offset, const pmt::pmt_t &key, const pmt::pmt_t &value, const pmt::pmt_t &srcid=pmt::PMT_F)
Removes a tag from the given input buffer.
Definition: block.h:593
int output_multiple() const
Definition: block.h:157