summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosh Blum2012-11-01 00:24:49 -0700
committerJosh Blum2012-11-01 00:24:49 -0700
commitbbd292bdf0c8b7e3c582e0d9766f51f108a17172 (patch)
tree79b678184793f0bac15207180128e9f23f9059cb
parentaf7a69de61ee641d9faaf5215eb68e0980ff1ead (diff)
downloadsandhi-bbd292bdf0c8b7e3c582e0d9766f51f108a17172.tar.gz
sandhi-bbd292bdf0c8b7e3c582e0d9766f51f108a17172.tar.bz2
sandhi-bbd292bdf0c8b7e3c582e0d9766f51f108a17172.zip
added deprecated max items interface to tb
-rw-r--r--include/gras/top_block.hpp12
-rw-r--r--lib/top_block.cpp26
2 files changed, 38 insertions, 0 deletions
diff --git a/include/gras/top_block.hpp b/include/gras/top_block.hpp
index 8bf366f..f74b7a3 100644
--- a/include/gras/top_block.hpp
+++ b/include/gras/top_block.hpp
@@ -91,6 +91,18 @@ 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/top_block.cpp b/lib/top_block.cpp
index b82f603..c321612 100644
--- a/lib/top_block.cpp
+++ b/lib/top_block.cpp
@@ -144,3 +144,29 @@ 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->global_config().maximum_output_items;
+}
+
+void TopBlock::set_max_noutput_items(int max_items)
+{
+ gras::GlobalBlockConfig config = this->global_config();
+ config.maximum_output_items = max_items;
+ this->set_global_config(config);
+}