GNU Radio 3.3.0 C++ API
|
The abstract base class for all signal processing blocks.Basic blocks are the bare abstraction of an entity that has a name, a set of inputs and outputs, and a message queue. These are never instantiated directly; rather, this is the abstract parent class of both gr_hier_block, which is a recursive container, and gr_block, which implements actual signal processing functions. More...
#include <gr_basic_block.h>
Public Member Functions | |
virtual | ~gr_basic_block () |
long | unique_id () const |
std::string | name () const |
gr_io_signature_sptr | input_signature () const |
gr_io_signature_sptr | output_signature () const |
gr_basic_block_sptr | basic_block () |
virtual bool | check_topology (int ninputs, int noutputs) |
Confirm that ninputs and noutputs is an acceptable combination. | |
virtual void | handle_msg (pmt::pmt_t msg) |
Block message handler. | |
Protected Types | |
enum | vcolor { WHITE, GREY, BLACK } |
Protected Member Functions | |
gr_basic_block (const std::string &name, gr_io_signature_sptr input_signature, gr_io_signature_sptr output_signature) | |
Protected constructor prevents instantiation by non-derived classes. | |
void | set_input_signature (gr_io_signature_sptr iosig) |
may only be called during constructor | |
void | set_output_signature (gr_io_signature_sptr iosig) |
may only be called during constructor | |
void | set_color (vcolor color) |
Allow the flowgraph to set for sorting and partitioning. | |
vcolor | color () const |
Protected Attributes | |
std::string | d_name |
gr_io_signature_sptr | d_input_signature |
gr_io_signature_sptr | d_output_signature |
long | d_unique_id |
vcolor | d_color |
Friends | |
class | gr_flowgraph |
class | gr_flat_flowgraph |
The abstract base class for all signal processing blocks.
Basic blocks are the bare abstraction of an entity that has a name, a set of inputs and outputs, and a message queue. These are never instantiated directly; rather, this is the abstract parent class of both gr_hier_block, which is a recursive container, and gr_block, which implements actual signal processing functions.
enum gr_basic_block::vcolor [protected] |
gr_basic_block::gr_basic_block | ( | const std::string & | name, |
gr_io_signature_sptr | input_signature, | ||
gr_io_signature_sptr | output_signature | ||
) | [protected] |
Protected constructor prevents instantiation by non-derived classes.
virtual gr_basic_block::~gr_basic_block | ( | ) | [virtual] |
gr_basic_block_sptr gr_basic_block::basic_block | ( | ) |
virtual bool gr_basic_block::check_topology | ( | int | ninputs, |
int | noutputs | ||
) | [inline, virtual] |
Confirm that ninputs and noutputs is an acceptable combination.
ninputs | number of input streams connected |
noutputs | number of output streams connected |
This function is called by the runtime system whenever the topology changes. Most classes do not need to override this. This check is in addition to the constraints specified by the input and output gr_io_signatures.
Reimplemented in gr_pfb_clock_sync_ccf, gr_pfb_clock_sync_fff, gr_align_on_samplenumbers_ss, gr_copy, gr_deinterleave, gr_interleave, gr_kludge_copy, gr_test, gr_oscope_sink_f, audio_alsa_sink, audio_alsa_source, audio_jack_sink, audio_jack_source, audio_osx_source, audio_portaudio_sink, audio_portaudio_source, comedi_sink_s, and comedi_source_s.
vcolor gr_basic_block::color | ( | ) | const [inline, protected] |
References d_color.
Referenced by set_color().
virtual void gr_basic_block::handle_msg | ( | pmt::pmt_t | msg | ) | [inline, virtual] |
Block message handler.
msg | Arbitrary message encapsulated as pmt::pmt_t |
This function is called by the runtime system whenever there are messages in its queue. Blocks should override this to receive messages; the default behavior is to drop them on the floor.
gr_io_signature_sptr gr_basic_block::input_signature | ( | ) | const [inline] |
References d_input_signature.
std::string gr_basic_block::name | ( | ) | const [inline] |
References d_name.
gr_io_signature_sptr gr_basic_block::output_signature | ( | ) | const [inline] |
References d_output_signature.
void gr_basic_block::set_color | ( | vcolor | color | ) | [inline, protected] |
void gr_basic_block::set_input_signature | ( | gr_io_signature_sptr | iosig | ) | [inline, protected] |
may only be called during constructor
References d_input_signature.
void gr_basic_block::set_output_signature | ( | gr_io_signature_sptr | iosig | ) | [inline, protected] |
may only be called during constructor
References d_output_signature.
long gr_basic_block::unique_id | ( | ) | const [inline] |
References d_unique_id.
friend class gr_flat_flowgraph [friend] |
friend class gr_flowgraph [friend] |
vcolor gr_basic_block::d_color [protected] |
Referenced by color(), and set_color().
Referenced by input_signature(), and set_input_signature().
std::string gr_basic_block::d_name [protected] |
Referenced by name().
Referenced by output_signature(), and set_output_signature().
long gr_basic_block::d_unique_id [protected] |
Referenced by unique_id().