summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
m---------PMC0
m---------grextras0
-rw-r--r--include/gras/CMakeLists.txt2
-rw-r--r--include/gras/block.hpp2
-rw-r--r--include/gras/block.i1
-rw-r--r--include/gras/tag_iter.hpp18
-rw-r--r--include/gras/tag_iter.i45
-rw-r--r--include/gras/tags.hpp16
-rw-r--r--include/gras/tags.i23
-rw-r--r--python/gras/GRAS_HierBlock.i6
-rw-r--r--python/gras/__init__.py2
11 files changed, 69 insertions, 46 deletions
diff --git a/PMC b/PMC
-Subproject a812e6f21f8bc754659716f333b51c77a271a0b
+Subproject 0ae6434beba728d28a44ebb1b6f0d5f72356af8
diff --git a/grextras b/grextras
-Subproject 071a69be41fd6b6c1e38e601b1ed2637419cfea
+Subproject f2fbbd5131458e40b65ce4bc7751a95dae9a071
diff --git a/include/gras/CMakeLists.txt b/include/gras/CMakeLists.txt
index fe11faf..e8fb85e 100644
--- a/include/gras/CMakeLists.txt
+++ b/include/gras/CMakeLists.txt
@@ -16,6 +16,8 @@ install(FILES
sbuffer.i
tags.hpp
tags.i
+ tag_iter.hpp
+ tag_iter.i
thread_pool.hpp
top_block.hpp
work_buffer.hpp
diff --git a/include/gras/block.hpp b/include/gras/block.hpp
index acdcda1..70654bf 100644
--- a/include/gras/block.hpp
+++ b/include/gras/block.hpp
@@ -5,7 +5,7 @@
#include <gras/element.hpp>
#include <gras/sbuffer.hpp>
-#include <gras/tags.hpp>
+#include <gras/tag_iter.hpp>
#include <gras/work_buffer.hpp>
#include <vector>
#include <string>
diff --git a/include/gras/block.i b/include/gras/block.i
index 53458eb..80c3905 100644
--- a/include/gras/block.i
+++ b/include/gras/block.i
@@ -9,6 +9,7 @@
%include <gras/element.i>
%import <gras/tags.i>
+%include <gras/tag_iter.i>
%import <gras/sbuffer.i>
%include <gras/block.hpp>
diff --git a/include/gras/tag_iter.hpp b/include/gras/tag_iter.hpp
new file mode 100644
index 0000000..81e3c8a
--- /dev/null
+++ b/include/gras/tag_iter.hpp
@@ -0,0 +1,18 @@
+// Copyright (C) by Josh Blum. See LICENSE.txt for licensing information.
+
+#ifndef INCLUDED_GRAS_TAG_ITER_HPP
+#define INCLUDED_GRAS_TAG_ITER_HPP
+
+#include <gras/gras.hpp>
+#include <gras/tags.hpp>
+#include <boost/range.hpp> //iterator range
+#include <vector>
+
+namespace gras
+{
+ //! Iterator return type stl and boost compliant
+ typedef boost::iterator_range<std::vector<Tag>::const_iterator> TagIter;
+
+} //namespace gras
+
+#endif /*INCLUDED_GRAS_TAG_ITER_HPP*/
diff --git a/include/gras/tag_iter.i b/include/gras/tag_iter.i
new file mode 100644
index 0000000..91d9054
--- /dev/null
+++ b/include/gras/tag_iter.i
@@ -0,0 +1,45 @@
+// Copyright (C) by Josh Blum. See LICENSE.txt for licensing information.
+
+#ifndef INCLUDED_GRAS_TAG_ITER_I
+#define INCLUDED_GRAS_TAG_ITER_I
+
+%{
+#include <gras/tag_iter.hpp>
+%}
+
+%include <gras/gras.hpp>
+%import <gras/tags.i>
+%include <gras/tag_iter.hpp>
+
+////////////////////////////////////////////////////////////////////////
+// Turn TagIter into a python iterable object
+////////////////////////////////////////////////////////////////////////
+namespace gras
+{
+ struct TagIter
+ {
+ //empty
+ };
+}
+
+%extend gras::TagIter
+{
+ %insert("python")
+ %{
+ def __iter__(self):
+ for i in range(len(self)):
+ yield self[i]
+ %}
+
+ size_t __len__(void) const
+ {
+ return ($self)->size();
+ }
+
+ const Tag & __getitem__(const size_t i) const
+ {
+ return (*($self))[i];
+ }
+}
+
+#endif /*INCLUDED_GRAS_TAG_ITER_I*/
diff --git a/include/gras/tags.hpp b/include/gras/tags.hpp
index 58eb058..e3c8982 100644
--- a/include/gras/tags.hpp
+++ b/include/gras/tags.hpp
@@ -94,20 +94,4 @@ GRAS_API bool operator==(const PacketMsg &lhs, const PacketMsg &rhs);
} //namespace gras
-#include <boost/range.hpp> //iterator range
-#include <vector>
-
-namespace gras
-{
- //! Iterator return type stl and boost compliant
- //typedef boost::iterator_range<std::vector<Tag>::const_iterator> TagIter;
- struct TagIter : boost::iterator_range<std::vector<Tag>::const_iterator>
- {
- TagIter(void){}
- template <typename T>
- TagIter(const T &t0, const T &t1): boost::iterator_range<std::vector<Tag>::const_iterator>(t0, t1){}
- };
-
-} //namespace gras
-
#endif /*INCLUDED_GRAS_TAGS_HPP*/
diff --git a/include/gras/tags.i b/include/gras/tags.i
index 18b3932..33838e2 100644
--- a/include/gras/tags.i
+++ b/include/gras/tags.i
@@ -12,27 +12,4 @@
%import <gras/sbuffer.i>
%import <PMC/PMC.i>
-////////////////////////////////////////////////////////////////////////
-// Turn TagIter into a python iterable object
-////////////////////////////////////////////////////////////////////////
-%extend gras::TagIter
-{
- %insert("python")
- %{
- def __iter__(self):
- for i in range(len(self)):
- yield self[i]
- %}
-
- size_t __len__(void) const
- {
- return ($self)->size();
- }
-
- const Tag & __getitem__(const size_t i) const
- {
- return (*($self))[i];
- }
-}
-
#endif /*INCLUDED_GRAS_TAGS_I*/
diff --git a/python/gras/GRAS_HierBlock.i b/python/gras/GRAS_HierBlock.i
index ed41d39..9cd705e 100644
--- a/python/gras/GRAS_HierBlock.i
+++ b/python/gras/GRAS_HierBlock.i
@@ -43,14 +43,10 @@ struct PyTSPhondler
#include <gras/top_block.hpp>
%}
-%include <gras/gras.hpp>
-%include <gras/element.i>
-%include <gras/io_signature.i>
-
////////////////////////////////////////////////////////////////////////
// pull in hier and top interface
////////////////////////////////////////////////////////////////////////
-%include <gras/hier_block.hpp>
+%include <gras/hier_block.i>
%include <gras/top_block.hpp>
////////////////////////////////////////////////////////////////////////
diff --git a/python/gras/__init__.py b/python/gras/__init__.py
index e99d246..2bdbc3a 100644
--- a/python/gras/__init__.py
+++ b/python/gras/__init__.py
@@ -2,7 +2,7 @@
from PMC import *
from GRAS_SBuffer import SBufferConfig, SBuffer
-from GRAS_Tags import Tag, TagIter, StreamTag, PacketMsg
+from GRAS_Tags import Tag, StreamTag, PacketMsg
from GRAS_IOSignature import IOSignature
from GRAS_Block import Block
from GRAS_HierBlock import HierBlock, TopBlock