summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJosh Blum2013-09-09 00:01:07 -0700
committerJosh Blum2013-09-09 00:01:07 -0700
commitf9c0d4c2e39aa28cc501ceb6479afc32f7849b11 (patch)
tree63a6677b3d4051c8a7776515ec733f6d475d1a15 /include
parent7c4911c28c28305ed4d1aab9b5ea82f96b49f404 (diff)
downloadsandhi-f9c0d4c2e39aa28cc501ceb6479afc32f7849b11.tar.gz
sandhi-f9c0d4c2e39aa28cc501ceb6479afc32f7849b11.tar.bz2
sandhi-f9c0d4c2e39aa28cc501ceb6479afc32f7849b11.zip
gras: work on global config that works on hier
Diffstat (limited to 'include')
-rw-r--r--include/gras/block.hpp6
-rw-r--r--include/gras/block_config.hpp7
-rw-r--r--include/gras/element.hpp11
-rw-r--r--include/gras/element.i1
-rw-r--r--include/gras/hier_block.hpp6
-rw-r--r--include/gras/hier_block.i1
-rw-r--r--include/gras/top_block.hpp7
-rw-r--r--include/gras/top_block.i1
8 files changed, 26 insertions, 14 deletions
diff --git a/include/gras/block.hpp b/include/gras/block.hpp
index 05809a1..cb38e95 100644
--- a/include/gras/block.hpp
+++ b/include/gras/block.hpp
@@ -38,12 +38,6 @@ struct GRAS_API Block : Element
*/
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_config.hpp b/include/gras/block_config.hpp
index 5e5c0cb..c90731b 100644
--- a/include/gras/block_config.hpp
+++ b/include/gras/block_config.hpp
@@ -15,6 +15,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.
*
diff --git a/include/gras/element.hpp b/include/gras/element.hpp
index df47bef..ce5d658 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,16 @@ 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);
+
+ /*******************************************************************
* identification interface
******************************************************************/
diff --git a/include/gras/element.i b/include/gras/element.i
index d462370..1380a97 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/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..4a020be 100644
--- a/include/gras/hier_block.hpp
+++ b/include/gras/hier_block.hpp
@@ -16,6 +16,12 @@ struct GRAS_API HierBlock : Element
virtual ~HierBlock(void);
+ /*!
+ * Commit changes to the global configuration.
+ * 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..3dcf23f 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,12 +16,6 @@ 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 overall flow graph.
* Call this after modifying connections.
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>