gr_top_block Class Reference

#include <gr_top_block.h>

Inheritance diagram for gr_top_block:

Inheritance graph
[legend]
Collaboration diagram for gr_top_block:

Collaboration graph
[legend]

List of all members.


Detailed Description

Top-level hierarchical block representing a flowgraph.

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 ()
bool is_running ()

Protected Member Functions

 gr_top_block (const std::string &name)

Friends

gr_top_block_sptr gr_make_top_block (const std::string &name)

Constructor & Destructor Documentation

gr_top_block::gr_top_block ( const std::string &  name  )  [protected]

gr_top_block::~gr_top_block (  ) 

References stop(), and wait().


Member Function Documentation

void gr_top_block::run (  ) 

The simple interface to running a flowgraph.

Calls start() then wait(). Used to run a flowgraph that will stop on its own, or to run a flowgraph indefinitely until SIGINT is received.

References start(), and wait().

void gr_top_block::start ( void   ) 

Start the contained flowgraph. Creates one or more threads to execute the flow graph. Returns to the caller once the threads are created.

References gr_top_block_impl::start().

Referenced by run().

void gr_top_block::stop (  ) 

Stop the running flowgraph. Notifies each thread created by the scheduler to shutdown, then returns to caller.

References gr_top_block_impl::stop().

Referenced by ~gr_top_block().

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.

References gr_top_block_impl::wait().

Referenced by run(), and ~gr_top_block().

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 restarted automatically.

N.B. lock() and unlock() cannot be called from a flowgraph thread (E.g., gr_block::work method) or deadlock will occur when reconfiguration happens.

Reimplemented from gr_hier_block2.

References gr_top_block_impl::lock().

void gr_top_block::unlock (  )  [virtual]

Lock a flowgraph in preparation for reconfiguration. When an equal number of calls to lock() and unlock() have occurred, the flowgraph will be restarted automatically.

N.B. lock() and unlock() cannot be called from a flowgraph thread (E.g., gr_block::work method) or deadlock will occur when reconfiguration happens.

Reimplemented from gr_hier_block2.

References gr_top_block_impl::unlock().

bool gr_top_block::is_running (  ) 

Returns true if flowgraph is running

References gr_top_block_impl::is_running().


Friends And Related Function Documentation

gr_top_block_sptr gr_make_top_block ( const std::string &  name  )  [friend]


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

Generated on Thu Mar 27 14:51:01 2008 for GNU Radio 3.1.1 by  doxygen 1.5.5