diff options
-rw-r--r-- | gnuradio-core/src/lib/runtime/gr_top_block.cc | 6 | ||||
-rw-r--r-- | gnuradio-core/src/lib/runtime/gr_top_block.h | 5 | ||||
-rw-r--r-- | gnuradio-core/src/lib/runtime/gr_top_block.i | 1 | ||||
-rw-r--r-- | gnuradio-core/src/lib/runtime/gr_top_block_impl.cc | 6 | ||||
-rw-r--r-- | gnuradio-core/src/lib/runtime/gr_top_block_impl.h | 3 |
5 files changed, 21 insertions, 0 deletions
diff --git a/gnuradio-core/src/lib/runtime/gr_top_block.cc b/gnuradio-core/src/lib/runtime/gr_top_block.cc index 09e46dfbb..3fa324257 100644 --- a/gnuradio-core/src/lib/runtime/gr_top_block.cc +++ b/gnuradio-core/src/lib/runtime/gr_top_block.cc @@ -78,6 +78,12 @@ gr_top_block::run() wait(); } +bool +gr_top_block::is_running() +{ + return d_impl->is_running(); +} + void gr_top_block::lock() { diff --git a/gnuradio-core/src/lib/runtime/gr_top_block.h b/gnuradio-core/src/lib/runtime/gr_top_block.h index b47ec019c..415bb21f2 100644 --- a/gnuradio-core/src/lib/runtime/gr_top_block.h +++ b/gnuradio-core/src/lib/runtime/gr_top_block.h @@ -78,6 +78,11 @@ public: void wait(); /*! + * Is the flowgraph running? + */ + bool is_running(); + + /*! * 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. diff --git a/gnuradio-core/src/lib/runtime/gr_top_block.i b/gnuradio-core/src/lib/runtime/gr_top_block.i index 670e5b5e5..b5ced3cda 100644 --- a/gnuradio-core/src/lib/runtime/gr_top_block.i +++ b/gnuradio-core/src/lib/runtime/gr_top_block.i @@ -44,6 +44,7 @@ public: void stop(); void wait(); void run(); + bool is_running(); void lock(); void unlock() throw (std::runtime_error); void dump(); diff --git a/gnuradio-core/src/lib/runtime/gr_top_block_impl.cc b/gnuradio-core/src/lib/runtime/gr_top_block_impl.cc index 50d480d00..97b19adad 100644 --- a/gnuradio-core/src/lib/runtime/gr_top_block_impl.cc +++ b/gnuradio-core/src/lib/runtime/gr_top_block_impl.cc @@ -87,6 +87,12 @@ gr_top_block_impl::~gr_top_block_impl() d_owner = 0; } +bool +gr_top_block_impl::is_running() +{ + return (d_state != IDLE); +} + void gr_top_block_impl::start() { diff --git a/gnuradio-core/src/lib/runtime/gr_top_block_impl.h b/gnuradio-core/src/lib/runtime/gr_top_block_impl.h index 35fb44ef9..794c4bc0d 100644 --- a/gnuradio-core/src/lib/runtime/gr_top_block_impl.h +++ b/gnuradio-core/src/lib/runtime/gr_top_block_impl.h @@ -60,6 +60,9 @@ public: // Dump the flowgraph to stdout void dump(); + + // Has flowgraph been started? + bool is_running(); protected: |