summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJosh Blum2013-09-15 22:18:03 -0700
committerJosh Blum2013-09-15 22:18:03 -0700
commit4f50f9d0c52b1efd09d1f7ed7aadbfef94949eb2 (patch)
tree9de5be6ce362241ba53aec8d393dc24f13f69252 /include
parent4f00d9b66ff6813da0e9fc986fb6fe5d7c693e52 (diff)
parentadfedc68b7f4348a0aad7e5e63a74b0c412ec128 (diff)
downloadsandhi-4f50f9d0c52b1efd09d1f7ed7aadbfef94949eb2.tar.gz
sandhi-4f50f9d0c52b1efd09d1f7ed7aadbfef94949eb2.tar.bz2
sandhi-4f50f9d0c52b1efd09d1f7ed7aadbfef94949eb2.zip
Merge branch 'gr_update'
Diffstat (limited to 'include')
-rw-r--r--include/gras/block.hpp13
-rw-r--r--include/gras/block.i1
-rw-r--r--include/gras/block_config.hpp16
-rw-r--r--include/gras/element.hpp18
-rw-r--r--include/gras/element.i2
-rw-r--r--include/gras/hier_block.hpp7
-rw-r--r--include/gras/hier_block.i1
-rw-r--r--include/gras/top_block.hpp12
-rw-r--r--include/gras/top_block.i1
9 files changed, 50 insertions, 21 deletions
diff --git a/include/gras/block.hpp b/include/gras/block.hpp
index 05809a1..1adc4c3 100644
--- a/include/gras/block.hpp
+++ b/include/gras/block.hpp
@@ -31,19 +31,6 @@ struct GRAS_API Block : Element
* Deal with block configuration configuration
******************************************************************/
- /*!
- * Set the thread pool of this block.
- * Every block is created in the default active thread pool.
- * This call will migrate the block to a new specified pool.
- */
- void set_thread_pool(const ThreadPool &thread_pool);
-
- //! Get the global block config settings
- const GlobalBlockConfig &global_config(void) const;
-
- //! Get the global block config settings
- GlobalBlockConfig &global_config(void);
-
//! Get the configuration rules of an input port
const InputPortConfig &input_config(const size_t which_input) const;
diff --git a/include/gras/block.i b/include/gras/block.i
index 8daa55a..1804c34 100644
--- a/include/gras/block.i
+++ b/include/gras/block.i
@@ -14,7 +14,6 @@
%include <gras/tag_iter.i>
%import <gras/sbuffer.i>
%include <gras/buffer_queue.hpp>
-%include <gras/thread_pool.hpp>
%include <gras/block_config.hpp>
%include <gras/block.hpp>
diff --git a/include/gras/block_config.hpp b/include/gras/block_config.hpp
index 5e5c0cb..17ff182 100644
--- a/include/gras/block_config.hpp
+++ b/include/gras/block_config.hpp
@@ -4,6 +4,7 @@
#define INCLUDED_GRAS_BLOCK_CONFIG_HPP
#include <gras/gras.hpp>
+#include <gras/thread_pool.hpp>
#include <cstddef>
namespace gras
@@ -15,6 +16,13 @@ struct GRAS_API GlobalBlockConfig
GlobalBlockConfig(void);
/*!
+ * Merge the settings from another config.
+ * Non-defaults on this config stay,
+ * defaults will be overwritten.
+ */
+ void merge(const GlobalBlockConfig &config);
+
+ /*!
* Constrain the maximum number of items that
* work can be called with for all output ports.
*
@@ -46,6 +54,14 @@ struct GRAS_API GlobalBlockConfig
* Default = false.
*/
bool interruptible_work;
+
+ /*!
+ * This member sets the thread pool for the block.
+ * The block's actor will migrate to the new pool.
+ *
+ * Default = null thread pool.
+ */
+ ThreadPool thread_pool;
};
//! Configuration parameters for an input port
diff --git a/include/gras/element.hpp b/include/gras/element.hpp
index df47bef..84f7062 100644
--- a/include/gras/element.hpp
+++ b/include/gras/element.hpp
@@ -10,6 +10,7 @@
#include <gras/gras.hpp>
#include <gras/callable.hpp>
+#include <gras/block_config.hpp>
#include <gras/weak_container.hpp>
#include <boost/shared_ptr.hpp>
@@ -66,6 +67,23 @@ struct GRAS_API Element : Callable, boost::shared_ptr<ElementImpl>
std::string to_string(void) const;
/*******************************************************************
+ * config interface
+ ******************************************************************/
+
+ //! Get the global block config settings
+ const GlobalBlockConfig &global_config(void) const;
+
+ //! Get the global block config settings
+ GlobalBlockConfig &global_config(void);
+
+ /*!
+ * Commit changes to the global configuration.
+ * Call this after modifying the global config.
+ * Must be call to apply changes to the global config.
+ */
+ virtual void commit_config(void);
+
+ /*******************************************************************
* identification interface
******************************************************************/
diff --git a/include/gras/element.i b/include/gras/element.i
index d462370..e577e9d 100644
--- a/include/gras/element.i
+++ b/include/gras/element.i
@@ -27,6 +27,8 @@ namespace gras
%include <std_string.i>
%import <PMC/PMC.i>
%include <gras/gras.hpp>
+%include <gras/thread_pool.hpp>
+%include <gras/block_config.hpp>
%include <gras/callable.hpp>
%include <gras/element.hpp>
diff --git a/include/gras/hier_block.hpp b/include/gras/hier_block.hpp
index 73eeabd..b2da9be 100644
--- a/include/gras/hier_block.hpp
+++ b/include/gras/hier_block.hpp
@@ -16,6 +16,13 @@ struct GRAS_API HierBlock : Element
virtual ~HierBlock(void);
+ /*!
+ * Commit changes to the global configuration.
+ * Call this after modifying the global config.
+ * Must be call to apply changes to the global config.
+ */
+ void commit_config(void);
+
/*******************************************************************
* connection flow interface
******************************************************************/
diff --git a/include/gras/hier_block.i b/include/gras/hier_block.i
index f89252e..4b617c2 100644
--- a/include/gras/hier_block.i
+++ b/include/gras/hier_block.i
@@ -9,6 +9,7 @@
#include <gras/hier_block.hpp>
%}
+%include <gras/gras.hpp>
%import <gras/element.i>
%include <gras/hier_block.hpp>
diff --git a/include/gras/top_block.hpp b/include/gras/top_block.hpp
index 415c03e..3a1b9e5 100644
--- a/include/gras/top_block.hpp
+++ b/include/gras/top_block.hpp
@@ -3,7 +3,6 @@
#ifndef INCLUDED_GRAS_TOP_BLOCK_HPP
#define INCLUDED_GRAS_TOP_BLOCK_HPP
-#include <gras/block_config.hpp>
#include <gras/hier_block.hpp>
namespace gras
@@ -17,11 +16,12 @@ struct GRAS_API TopBlock : HierBlock
virtual ~TopBlock(void);
- //! Get the global block config settings
- const GlobalBlockConfig &global_config(void) const;
-
- //! Get the global block config settings
- GlobalBlockConfig &global_config(void);
+ /*!
+ * Commit changes to the global configuration.
+ * Call this after modifying the global config.
+ * Commit config is called automatically by start/stop/run.
+ */
+ void commit_config(void);
/*!
* Commit changes to the overall flow graph.
diff --git a/include/gras/top_block.i b/include/gras/top_block.i
index 23a4275..07d2482 100644
--- a/include/gras/top_block.i
+++ b/include/gras/top_block.i
@@ -10,7 +10,6 @@
%}
%include <gras/gras.hpp>
-%include <gras/block_config.hpp>
%import <gras/element.i>
%import <gras/hier_block.i>
%include <gras/top_block.hpp>