GNU Radio 3.7.1 C++ API

Top-level hierarchical block representing a flowgraph. More...

#include <top_block.h>

Inheritance diagram for gr::top_block:

List of all members.

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)

Detailed Description

Top-level hierarchical block representing a flowgraph.


Constructor & Destructor Documentation

gr::top_block::top_block ( const std::string &  name) [protected]

Member Function Documentation

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.

Get the number of max noutput_items in the flowgraph.

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().

Parameters:
max_noutput_itemsthe 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.

Set the maximum number of noutput_items in the flowgraph.

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.

Parameters:
max_noutput_itemsthe 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.

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.

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).


Friends And Related Function Documentation

GR_RUNTIME_API top_block_sptr make_top_block ( const std::string &  name) [friend]

The documentation for this class was generated from the following file: