23 #ifndef INCLUDED_GR_RUNTIME_BLOCK_H 24 #define INCLUDED_GR_RUNTIME_BLOCK_H 102 unsigned history()
const;
103 void set_history(
unsigned history);
124 void declare_sample_delay(
int which,
unsigned delay);
130 void declare_sample_delay(
unsigned delay);
140 unsigned sample_delay(
int which)
const;
163 virtual void forecast(
int noutput_items,
gr_vector_int& ninput_items_required);
188 virtual int general_work(
int noutput_items,
201 virtual bool start();
218 void set_output_multiple(
int multiple);
239 void set_alignment(
int multiple);
242 void set_unaligned(
int na);
244 void set_is_unaligned(
bool u);
256 void consume(
int which_input,
int how_many_items);
264 void consume_each(
int how_many_items);
277 void produce(
int which_output,
int how_many_items);
288 void set_relative_rate(
double relative_rate);
298 void set_inverse_relative_rate(
double inverse_relative_rate);
309 void set_relative_rate(uint64_t interpolation, uint64_t decimation);
322 return (uint64_t)d_mp_relative_rate.get_num().get_ui();
331 return (uint64_t)d_mp_relative_rate.get_den().get_ui();
352 virtual int fixed_rate_ninput_to_noutput(
int ninput);
359 virtual int fixed_rate_noutput_to_ninput(
int noutput);
364 uint64_t nitems_read(
unsigned int which_input);
369 uint64_t nitems_written(
unsigned int which_output);
402 int max_noutput_items();
410 void set_max_noutput_items(
int m);
427 void unset_max_noutput_items();
433 bool is_set_max_noutput_items();
442 void expand_minmax_buffer(
int port);
447 long max_output_buffer(
size_t i);
465 void set_max_output_buffer(
long max_output_buffer);
484 void set_max_output_buffer(
int port,
long max_output_buffer);
489 long min_output_buffer(
size_t i);
508 void set_min_output_buffer(
long min_output_buffer);
527 void set_min_output_buffer(
int port,
long min_output_buffer);
534 float pc_noutput_items();
539 float pc_noutput_items_avg();
544 float pc_noutput_items_var();
549 float pc_nproduced();
554 float pc_nproduced_avg();
559 float pc_nproduced_var();
564 float pc_input_buffers_full(
int which);
569 float pc_input_buffers_full_avg(
int which);
574 float pc_input_buffers_full_var(
int which);
579 std::vector<float> pc_input_buffers_full();
584 std::vector<float> pc_input_buffers_full_avg();
589 std::vector<float> pc_input_buffers_full_var();
594 float pc_output_buffers_full(
int which);
599 float pc_output_buffers_full_avg(
int which);
604 float pc_output_buffers_full_var(
int which);
609 std::vector<float> pc_output_buffers_full();
614 std::vector<float> pc_output_buffers_full_avg();
619 std::vector<float> pc_output_buffers_full_var();
624 float pc_work_time();
629 float pc_work_time_avg();
634 float pc_work_time_var();
639 float pc_work_time_total();
644 float pc_throughput_avg();
649 void reset_perf_counters();
678 void set_processor_affinity(
const std::vector<int>& mask);
683 void unset_processor_affinity();
693 int active_thread_priority();
705 bool update_rate()
const;
731 void set_log_level(std::string level);
736 std::string log_level();
744 int d_output_multiple;
745 bool d_output_multiple_set;
748 double d_relative_rate;
749 mpq_class d_mp_relative_rate;
750 block_detail_sptr d_detail;
752 unsigned d_attr_delay;
754 bool d_max_noutput_items_set;
755 int d_max_noutput_items;
756 int d_min_noutput_items;
758 d_tag_propagation_policy;
759 std::vector<int> d_affinity;
767 block(
const std::string& name,
794 this->add_item_tag(which_output, tag);
803 void add_item_tag(
unsigned int which_output,
const tag_t& tag);
828 this->remove_item_tag(which_input, tag);
837 void remove_item_tag(
unsigned int which_input,
const tag_t& tag);
852 void get_tags_in_range(std::vector<tag_t>&
v,
853 unsigned int which_input,
872 void get_tags_in_range(std::vector<tag_t>& v,
873 unsigned int which_input,
899 void get_tags_in_window(std::vector<tag_t>& v,
900 unsigned int which_input,
916 void get_tags_in_window(std::vector<tag_t>& v,
917 unsigned int which_input,
922 void enable_update_rate(
bool en);
951 block_detail_sptr
detail()
const {
return d_detail; }
952 void set_detail(block_detail_sptr detail) { d_detail = detail; }
956 void notify_msg_neighbors();
962 std::string identifier()
const;
968 inline block_sptr cast_to_block_sptr(basic_block_sptr p)
double relative_rate() const
return the approximate output rate / input rate
Definition: block.h:314
uint64_t relative_rate_i() const
return the numerator, or interpolation rate, of the approximate output rate / input rate ...
Definition: block.h:320
boost::shared_ptr< io_signature > sptr
Definition: io_signature.h:46
pmt::pmt_t value
the value of tag (as a PMT)
Definition: tags.h:39
uint64_t offset
the item tag occurred at (as a uint64_t)
Definition: tags.h:33
gr::logger_ptr d_debug_logger
Definition: block.h:937
std::vector< int > processor_affinity()
Get the current processor affinity.
Definition: block.h:688
std::vector< block_sptr > block_vector_t
Definition: block.h:965
const pmt::pmt_t d_system_port
Definition: block.h:948
block_detail_sptr detail() const
Definition: block.h:951
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
int output_multiple() const
Definition: block.h:219
void set_fixed_rate(bool fixed_rate)
Definition: block.h:771
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:783
std::vector< const void * > gr_vector_const_void_star
Definition: types.h:40
Definition: block_gateway.h:50
#define PMT_F
Definition: pmt.h:136
gr::thread::mutex d_setlock
Definition: block.h:932
bool output_multiple_set() const
Definition: block.h:220
gr::logger_ptr d_logger
Definition: block.h:936
Definition: cc_common.h:45
#define GR_RUNTIME_API
Definition: gnuradio-runtime/include/gnuradio/api.h:30
void clear_finished()
Make sure we don't think we are finished.
Definition: block.h:960
Definition: block_gateway.h:45
bool is_unaligned() const
Definition: block.h:245
Definition: block_gateway.h:45
GR_RUNTIME_API int set_thread_priority(gr_thread_t thread, int priority)
set current thread priority for a given thread ID
std::vector< long > d_min_output_buffer
Definition: block.h:925
std::vector< void * > gr_vector_void_star
Definition: types.h:39
Definition: block_gateway.h:48
std::vector< block_sptr >::iterator block_viter_t
Definition: block.h:966
std::vector< long > d_max_output_buffer
Definition: block.h:924
GNU Radio logging wrapper for log4cpp library (C++ port of log4j)
Definition: basic_block.h:43
int unaligned() const
Definition: block.h:243
The abstract base class for all signal processing blocks.Basic blocks are the bare abstraction of an ...
Definition: basic_block.h:56
block(void)
Definition: block.h:766
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:396
GR_RUNTIME_API int thread_priority(gr_thread_t thread)
get current thread priority for a given thread ID
tag_propagation_policy_t
enum to represent different tag propagation policies.
Definition: block.h:80
int min_noutput_items() const
Return the minimum number of output items this block can produce during a call to work...
Definition: block.h:388
bool is_pc_rpc_set()
Checks if this block is already exporting perf. counters to ControlPort.
Definition: block.h:661
int alignment() const
Definition: block.h:240
pmt::pmt_t key
the key of tag (as a PMT symbol)
Definition: tags.h:36
log4cpp::Category * logger_ptr
GR_LOG macrosThese macros wrap the standard LOG4CPP_LEVEL macros. The availablie macros are: LOG_DEBU...
Definition: logger.h:71
Definition: block_gateway.h:47
std::ostream & operator<<(std::ostream &os, basic_block_sptr basic_block)
Definition: basic_block.h:416
boost::mutex mutex
Definition: thread.h:48
Definition: block_gateway.h:49
pmt::pmt_t srcid
the source ID of tag (as a PMT)
Definition: tags.h:42
The abstract base class for all 'terminal' processing blocks.A signal processing flow is constructed ...
Definition: block.h:71
const pmt::pmt_t d_pmt_done
Definition: block.h:944
bool fixed_rate() const
Return true if this block has a fixed input to output rate.
Definition: block.h:147
void set_detail(block_detail_sptr detail)
Definition: block.h:952
uint64_t relative_rate_d() const
return the denominator, or decimation rate, of the approximate output rate / input rate ...
Definition: block.h:329
void no_pc_rpc()
If the block calls this in its constructor, it's perf. counters will not be exported.
Definition: block.h:667
mpq_class & mp_relative_rate()
return a reference to the multiple precision rational represntation of the approximate output rate / ...
Definition: block.h:338
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)
DEPRECATED. Will be removed in 3.8.
Definition: block.h:817
std::vector< int > gr_vector_int
Definition: types.h:35