GNU Radio 3.7.1 C++ API
|
Top-level hierarchical block representing a flowgraph. More...
#include <top_block.h>
Public Member Functions | |
~top_block () | |
void | run (int max_noutput_items=100000000) |
The simple interface to running a flowgraph. | |
void | start (int max_noutput_items=100000000) |
void | stop () |
void | wait () |
virtual void | lock () |
virtual void | unlock () |
std::string | edge_list () |
std::string | msg_edge_list () |
void | dump () |
int | max_noutput_items () |
Get the number of max noutput_items in the flowgraph. | |
void | set_max_noutput_items (int nmax) |
Set the maximum number of noutput_items in the flowgraph. | |
top_block_sptr | to_top_block () |
void | setup_rpc () |
Set up the RPC registered variables. | |
Protected Member Functions | |
top_block (const std::string &name) | |
Friends | |
GR_RUNTIME_API top_block_sptr | make_top_block (const std::string &name) |
Top-level hierarchical block representing a flowgraph.
gr::top_block::top_block | ( | const std::string & | name | ) | [protected] |
Displays flattened flowgraph edges and block connectivity
std::string gr::top_block::edge_list | ( | ) |
Returns a string that lists the edge connections in the flattened flowgraph.
virtual void gr::top_block::lock | ( | ) | [virtual] |
Lock a flowgraph in preparation for reconfiguration. When an equal number of calls to lock() and unlock() have occurred, the flowgraph will be reconfigured.
N.B. lock() and unlock() may not be called from a flowgraph thread (E.g., block::work method) or deadlock will occur when reconfiguration happens.
Reimplemented from gr::hier_block2.
int gr::top_block::max_noutput_items | ( | ) |
Get the number of max noutput_items in the flowgraph.
std::string gr::top_block::msg_edge_list | ( | ) |
Returns a string that lists the msg edge connections in the flattened flowgraph.
void gr::top_block::run | ( | int | max_noutput_items = 100000000 | ) |
The simple interface to running a flowgraph.
Calls start() then wait(). Used to run a flowgraph that will stop on its own, or when another thread will call stop().
max_noutput_items | the maximum number of output items allowed for any block in the flowgraph. This passes through to the start function; see that function for more details. |
void gr::top_block::set_max_noutput_items | ( | int | nmax | ) |
Set the maximum number of noutput_items in the flowgraph.
void gr::top_block::setup_rpc | ( | ) | [virtual] |
Set up the RPC registered variables.
This must be overloaded by a block that wants to use controlport. This is where rpcbasic_register_{get,set} pointers are created, which then get wrapped as shared pointers (rpcbasic_sptr(...)) and stored using add_rpc_variable.
Reimplemented from gr::basic_block.
void gr::top_block::start | ( | int | max_noutput_items = 100000000 | ) |
Start the contained flowgraph. Creates one or more threads to execute the flow graph. Returns to the caller once the threads are created. Calling start() on a top_block that is already started IS an error.
max_noutput_items | the maximum number of output items allowed for any block in the flowgraph; the noutput_items can always be less than this, but this will cap it as a maximum. Use this to adjust the maximum latency a flowgraph can exhibit. |
virtual void gr::top_block::unlock | ( | ) | [virtual] |
Unlock a flowgraph in preparation for reconfiguration. When an equal number of calls to lock() and unlock() have occurred, the flowgraph will be reconfigured.
N.B. lock() and unlock() may not be called from a flowgraph thread (E.g., block::work method) or deadlock will occur when reconfiguration happens.
Reimplemented from gr::hier_block2.
Wait for a flowgraph to complete. Flowgraphs complete when either (1) all blocks indicate that they are done (typically only when using blocks.file_source, or blocks.head, or (2) after stop() has been called to request shutdown. Calling wait on a top_block that is not running IS NOT an error (wait returns w/o blocking).
GR_RUNTIME_API top_block_sptr make_top_block | ( | const std::string & | name | ) | [friend] |