GNU Radio 3.4.0 C++ API
|
Top-level hierarchical block representing a flowgraph. More...
#include <gr_top_block.h>
Public Member Functions | |
~gr_top_block () | |
void | run () |
The simple interface to running a flowgraph. | |
void | start () |
void | stop () |
void | wait () |
virtual void | lock () |
virtual void | unlock () |
void | dump () |
gr_top_block_sptr | to_top_block () |
Protected Member Functions | |
gr_top_block (const std::string &name) | |
Friends | |
gr_top_block_sptr | gr_make_top_block (const std::string &name) |
Top-level hierarchical block representing a flowgraph.
gr_top_block::gr_top_block | ( | const std::string & | name | ) | [protected] |
gr_top_block::~gr_top_block | ( | ) |
void gr_top_block::dump | ( | ) |
Displays flattened flowgraph edges and block connectivity
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., gr_block::work method) or deadlock will occur when reconfiguration happens.
Reimplemented from gr_hier_block2.
void gr_top_block::run | ( | ) |
void gr_top_block::start | ( | ) |
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.
void gr_top_block::stop | ( | ) |
Stop the running flowgraph. Notifies each thread created by the scheduler to shutdown, then returns to caller. Calling stop() on a top_block that is already stopped IS NOT an error.
gr_top_block_sptr gr_top_block::to_top_block | ( | ) |
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., gr_block::work method) or deadlock will occur when reconfiguration happens.
Reimplemented from gr_hier_block2.
void gr_top_block::wait | ( | ) |
Wait for a flowgraph to complete. Flowgraphs complete when either (1) all blocks indicate that they are done (typically only when using gr.file_source, or gr.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_top_block_sptr gr_make_top_block | ( | const std::string & | name | ) | [friend] |