23 #ifndef INCLUDED_GR_RUNTIME_BLOCK_H 24 #define INCLUDED_GR_RUNTIME_BLOCK_H 96 unsigned history()
const;
97 void set_history(
unsigned history);
118 void declare_sample_delay(
int which,
unsigned delay);
124 void declare_sample_delay(
unsigned delay);
134 unsigned sample_delay(
int which)
const;
157 virtual void forecast(
int noutput_items,
181 virtual int general_work(
int noutput_items,
194 virtual bool start();
211 void set_output_multiple(
int multiple);
232 void set_alignment(
int multiple);
235 void set_unaligned(
int na);
237 void set_is_unaligned(
bool u);
249 void consume(
int which_input,
int how_many_items);
257 void consume_each(
int how_many_items);
270 void produce(
int which_output,
int how_many_items);
281 void set_relative_rate(
double relative_rate);
300 virtual int fixed_rate_ninput_to_noutput(
int ninput);
307 virtual int fixed_rate_noutput_to_ninput(
int noutput);
312 uint64_t nitems_read(
unsigned int which_input);
317 uint64_t nitems_written(
unsigned int which_output);
350 int max_noutput_items();
358 void set_max_noutput_items(
int m);
375 void unset_max_noutput_items();
381 bool is_set_max_noutput_items();
390 void expand_minmax_buffer(
int port);
395 long max_output_buffer(
size_t i);
413 void set_max_output_buffer(
long max_output_buffer);
432 void set_max_output_buffer(
int port,
long max_output_buffer);
437 long min_output_buffer(
size_t i);
456 void set_min_output_buffer(
long min_output_buffer);
475 void set_min_output_buffer(
int port,
long min_output_buffer);
482 float pc_noutput_items();
487 float pc_noutput_items_avg();
492 float pc_noutput_items_var();
497 float pc_nproduced();
502 float pc_nproduced_avg();
507 float pc_nproduced_var();
512 float pc_input_buffers_full(
int which);
517 float pc_input_buffers_full_avg(
int which);
522 float pc_input_buffers_full_var(
int which);
527 std::vector<float> pc_input_buffers_full();
532 std::vector<float> pc_input_buffers_full_avg();
537 std::vector<float> pc_input_buffers_full_var();
542 float pc_output_buffers_full(
int which);
547 float pc_output_buffers_full_avg(
int which);
552 float pc_output_buffers_full_var(
int which);
557 std::vector<float> pc_output_buffers_full();
562 std::vector<float> pc_output_buffers_full_avg();
567 std::vector<float> pc_output_buffers_full_var();
572 float pc_work_time();
577 float pc_work_time_avg();
582 float pc_work_time_var();
587 float pc_work_time_total();
592 float pc_throughput_avg();
597 void reset_perf_counters();
626 void set_processor_affinity(
const std::vector<int> &mask);
631 void unset_processor_affinity();
641 int active_thread_priority();
653 bool update_rate()
const;
668 int d_output_multiple;
669 bool d_output_multiple_set;
672 double d_relative_rate;
673 block_detail_sptr d_detail;
675 unsigned d_attr_delay;
677 bool d_max_noutput_items_set;
678 int d_max_noutput_items;
679 int d_min_noutput_items;
681 std::vector<int> d_affinity;
689 block(
const std::string &name,
716 this->add_item_tag(which_output, tag);
725 void add_item_tag(
unsigned int which_output,
const tag_t &tag);
750 this->remove_item_tag(which_input, tag);
759 void remove_item_tag(
unsigned int which_input,
const tag_t &tag);
774 void get_tags_in_range(std::vector<tag_t> &
v,
775 unsigned int which_input,
794 void get_tags_in_range(std::vector<tag_t> &v,
795 unsigned int which_input,
821 void get_tags_in_window(std::vector<tag_t> &v,
822 unsigned int which_input,
838 void get_tags_in_window(std::vector<tag_t> &v,
839 unsigned int which_input,
844 void enable_update_rate(
bool en);
873 block_detail_sptr
detail()
const {
return d_detail; }
874 void set_detail(block_detail_sptr detail) { d_detail = detail; }
878 void notify_msg_neighbors();
889 inline block_sptr cast_to_block_sptr(basic_block_sptr p)
boost::shared_ptr< io_signature > sptr
Definition: io_signature.h:45
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:859
std::vector< int > processor_affinity()
Get the current processor affinity.
Definition: block.h:636
std::vector< block_sptr > block_vector_t
Definition: block.h:886
const pmt::pmt_t d_system_port
Definition: block.h:870
block_detail_sptr detail() const
Definition: block.h:873
void set_fixed_rate(bool fixed_rate)
Definition: block.h:693
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:705
Definition: block_gateway.h:53
bool output_multiple_set() const
Definition: block.h:213
#define PMT_F
Definition: pmt.h:105
gr::thread::mutex d_setlock
Definition: block.h:854
gr::logger_ptr d_logger
Definition: block.h:858
std::vector< const void * > gr_vector_const_void_star
Definition: gnuradio-runtime/include/gnuradio/types.h:40
Definition: cc_common.h:45
int unaligned() const
Definition: block.h:236
#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:336
void clear_finished()
Make sure we don't think we are finished.
Definition: block.h:882
Definition: block_gateway.h:46
Definition: block_gateway.h:47
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:847
std::vector< void * > gr_vector_void_star
Definition: gnuradio-runtime/include/gnuradio/types.h:39
Definition: block_gateway.h:51
std::vector< int > gr_vector_int
Definition: gnuradio-runtime/include/gnuradio/types.h:35
std::vector< block_sptr >::iterator block_viter_t
Definition: block.h:887
std::vector< long > d_max_output_buffer
Definition: block.h:846
Include this header to use the message passing features.
Definition: logger.h:695
void * logger_ptr
Definition: logger.h:696
The abstract base class for all signal processing blocks.Basic blocks are the bare abstraction of an ...
Definition: basic_block.h:58
bool fixed_rate() const
Return true if this block has a fixed input to output rate.
Definition: block.h:141
block(void)
Definition: block.h:688
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:344
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:78
bool is_pc_rpc_set()
Checks if this block is already exporting perf. counters to ControlPort.
Definition: block.h:609
pmt::pmt_t key
the key of tag (as a PMT symbol)
Definition: tags.h:37
Definition: block_gateway.h:50
std::ostream & operator<<(std::ostream &os, basic_block_sptr basic_block)
Definition: basic_block.h:399
bool is_unaligned() const
Definition: block.h:238
boost::mutex mutex
Definition: thread.h:48
Definition: block_gateway.h:52
double relative_rate() const
return the approximate output rate / input rate
Definition: block.h:286
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:65
const pmt::pmt_t d_pmt_done
Definition: block.h:866
void set_detail(block_detail_sptr detail)
Definition: block.h:874
int alignment() const
Definition: block.h:233
void no_pc_rpc()
If the block calls this in its constructor, it's perf. counters will not be exported.
Definition: block.h:615
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:739
int output_multiple() const
Definition: block.h:212