summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJosh Blum2013-09-12 23:06:12 -0700
committerJosh Blum2013-09-12 23:06:12 -0700
commit1494e66b4b448132030c233ef75dd9210b90e9ef (patch)
tree7420af1cff1b0d31ef24fb0d366d8e6f198c4c0d /include
parentf9c0d4c2e39aa28cc501ceb6479afc32f7849b11 (diff)
downloadsandhi-1494e66b4b448132030c233ef75dd9210b90e9ef.tar.gz
sandhi-1494e66b4b448132030c233ef75dd9210b90e9ef.tar.bz2
sandhi-1494e66b4b448132030c233ef75dd9210b90e9ef.zip
gras: added thread pool to global config
Diffstat (limited to 'include')
-rw-r--r--include/gras/block.i1
-rw-r--r--include/gras/block_config.hpp9
-rw-r--r--include/gras/element.hpp7
-rw-r--r--include/gras/element.i1
-rw-r--r--include/gras/hier_block.hpp1
-rw-r--r--include/gras/top_block.hpp7
6 files changed, 25 insertions, 1 deletions
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 c90731b..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
@@ -53,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 ce5d658..84f7062 100644
--- a/include/gras/element.hpp
+++ b/include/gras/element.hpp
@@ -76,6 +76,13 @@ struct GRAS_API Element : Callable, boost::shared_ptr<ElementImpl>
//! 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 1380a97..e577e9d 100644
--- a/include/gras/element.i
+++ b/include/gras/element.i
@@ -27,6 +27,7 @@ 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 4a020be..b2da9be 100644
--- a/include/gras/hier_block.hpp
+++ b/include/gras/hier_block.hpp
@@ -18,6 +18,7 @@ struct GRAS_API HierBlock : Element
/*!
* 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);
diff --git a/include/gras/top_block.hpp b/include/gras/top_block.hpp
index 3dcf23f..3a1b9e5 100644
--- a/include/gras/top_block.hpp
+++ b/include/gras/top_block.hpp
@@ -17,6 +17,13 @@ struct GRAS_API TopBlock : HierBlock
virtual ~TopBlock(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.
* Call this after modifying connections.
* Commit is called automatically by start/stop/run.