summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
m---------gnuradio0
-rw-r--r--include/gras/block.hpp20
-rw-r--r--include/gras/top_block.hpp12
-rw-r--r--lib/block.cpp8
-rw-r--r--lib/block_handlers.cpp2
-rw-r--r--lib/block_task.cpp2
-rw-r--r--lib/top_block.cpp26
-rw-r--r--python/gras/GRAS_Block.i28
8 files changed, 34 insertions, 64 deletions
diff --git a/gnuradio b/gnuradio
-Subproject 7b6594232b5f3f48352cad0e335ad0cdbc3d004
+Subproject ea42d0aa849bf5adfa0d1768e7b189a60b35e78
diff --git a/include/gras/block.hpp b/include/gras/block.hpp
index c33f7f9..8baecfd 100644
--- a/include/gras/block.hpp
+++ b/include/gras/block.hpp
@@ -204,12 +204,6 @@ struct GRAS_API Block : Element
* Work related routines and fail states
******************************************************************/
- //! Called when the flow graph is started, can overload
- virtual bool start(void);
-
- //! Called when the flow graph is stopped, can overload
- virtual bool stop(void);
-
typedef WorkBufferArray<const void *> InputItems;
typedef WorkBufferArray<void *> OutputItems;
@@ -308,6 +302,20 @@ struct GRAS_API Block : Element
void post_output_buffer(const size_t which_output, const SBuffer &buffer);
/*!
+ * Overload notify_active to get called when block becomes active.
+ * This will be called when the TopBlock start/run API call executes.
+ * The default implementation of notify_active is a NOP.
+ */
+ virtual void notify_active(void);
+
+ /*!
+ * Overload notify_inactive to get called when block becomes inactive.
+ * This will be called when the TopBlock stop/run API call executes.
+ * The default implementation of notify_inactive is a NOP.
+ */
+ virtual void notify_inactive(void);
+
+ /*!
* Overload notify_topology to get called on topological changes.
* Use notify_topology to perform one-time resizing operations
* to avoid a conditional resizing operation inside the work().
diff --git a/include/gras/top_block.hpp b/include/gras/top_block.hpp
index 2f0dc87..fadcefa 100644
--- a/include/gras/top_block.hpp
+++ b/include/gras/top_block.hpp
@@ -77,18 +77,6 @@ struct GRAS_API TopBlock : HierBlock
*/
virtual bool wait(const double timeout);
- //! Deprecated
- void start(const size_t max_items);
-
- //! Deprecated
- void run(const size_t max_items);
-
- //! Deprecated
- int max_noutput_items(void) const;
-
- //! Deprecated
- void set_max_noutput_items(int max_items);
-
};
} //namespace gras
diff --git a/lib/block.cpp b/lib/block.cpp
index 716873b..128a9b8 100644
--- a/lib/block.cpp
+++ b/lib/block.cpp
@@ -189,14 +189,14 @@ void Block::propagate_tags(const size_t i, const TagIter &iter)
}
}
-bool Block::start(void)
+void Block::notify_active(void)
{
- return true;
+ //NOP
}
-bool Block::stop(void)
+void Block::notify_inactive(void)
{
- return true;
+ //NOP
}
void Block::notify_topology(const size_t, const size_t)
diff --git a/lib/block_handlers.cpp b/lib/block_handlers.cpp
index 215be6d..1290a67 100644
--- a/lib/block_handlers.cpp
+++ b/lib/block_handlers.cpp
@@ -15,7 +15,7 @@ void BlockActor::handle_top_active(
if (this->block_state != BLOCK_STATE_LIVE)
{
- this->block_ptr->start();
+ this->block_ptr->notify_active();
}
this->block_state = BLOCK_STATE_LIVE;
this->active_token = message.token;
diff --git a/lib/block_task.cpp b/lib/block_task.cpp
index 47c0019..b97dabf 100644
--- a/lib/block_task.cpp
+++ b/lib/block_task.cpp
@@ -9,7 +9,7 @@ void BlockActor::mark_done(void)
{
if (this->block_state == BLOCK_STATE_DONE) return; //can re-enter checking done first
- this->block_ptr->stop();
+ this->block_ptr->notify_inactive();
//flush partial output buffers to the downstream
for (size_t i = 0; i < this->get_num_outputs(); i++)
diff --git a/lib/top_block.cpp b/lib/top_block.cpp
index 4d2f956..bfb0e85 100644
--- a/lib/top_block.cpp
+++ b/lib/top_block.cpp
@@ -136,29 +136,3 @@ bool TopBlock::wait(const double timeout)
return (*this)->token.unique();
}
-
-///////////////////////// Deprecated interfaces ////////////////////////
-
-void TopBlock::start(const size_t max_items)
-{
- this->set_max_noutput_items(max_items);
- this->start();
-}
-
-void TopBlock::run(const size_t max_items)
-{
- this->set_max_noutput_items(max_items);
- this->run();
-}
-
-int TopBlock::max_noutput_items(void) const
-{
- return this->get_global_config().maximum_output_items;
-}
-
-void TopBlock::set_max_noutput_items(int max_items)
-{
- gras::GlobalBlockConfig config = this->get_global_config();
- config.maximum_output_items = max_items;
- this->set_global_config(config);
-}
diff --git a/python/gras/GRAS_Block.i b/python/gras/GRAS_Block.i
index e8df07c..1cf226e 100644
--- a/python/gras/GRAS_Block.i
+++ b/python/gras/GRAS_Block.i
@@ -8,8 +8,8 @@
%feature("nodirector") gras::BlockPython::input_buffer_allocator;
%feature("nodirector") gras::BlockPython::output_buffer_allocator;
%feature("nodirector") gras::BlockPython::propagate_tags;
-%feature("nodirector") gras::BlockPython::start;
-%feature("nodirector") gras::BlockPython::stop;
+%feature("nodirector") gras::BlockPython::notify_active;
+%feature("nodirector") gras::BlockPython::notify_inactive;
%feature("nodirector") gras::BlockPython::notify_topology;
%feature("nodirector") gras::BlockPython::work;
@@ -101,21 +101,21 @@ struct BlockPython : Block
//NOP
}
- bool start(void)
+ void notify_active(void)
{
PyGILPhondler phil;
- return this->_Py_start();
+ return this->_Py_notify_active();
}
- virtual bool _Py_start(void) = 0;
+ virtual void _Py_notify_active(void) = 0;
- bool stop(void)
+ void notify_inactive(void)
{
PyGILPhondler phil;
- return this->_Py_stop();
+ return this->_Py_notify_inactive();
}
- virtual bool _Py_stop(void) = 0;
+ virtual void _Py_notify_inactive(void) = 0;
void notify_topology(const size_t num_inputs, const size_t num_outputs)
{
@@ -257,17 +257,17 @@ class Block(BlockPython):
def notify_topology(self, *args): return
- def _Py_start(self):
- try: return self.start()
+ def _Py_notify_active(self):
+ try: return self.notify_active()
except: traceback.print_exc(); raise
- def start(self): return True
+ def notify_active(self): pass
- def _Py_stop(self):
- try: return self.stop()
+ def _Py_notify_inactive(self):
+ try: return self.notify_inactive()
except: traceback.print_exc(); raise
- def stop(self): return True
+ def notify_inactive(self): pass
def _Py_propagate_tags(self, which_input, iter):
try: return self.propagate_tags(which_input, iter)