summaryrefslogtreecommitdiff
path: root/utils/lvalue_pmap.h
diff options
context:
space:
mode:
authorgraehl <graehl@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-08-21 03:07:42 +0000
committergraehl <graehl@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-08-21 03:07:42 +0000
commitca9c1f40cad1f99f00beb2871dc50bf7222d44d4 (patch)
tree183f19411904bb2a23cc5f916f1887a484c6574b /utils/lvalue_pmap.h
parentd8dbfdcc460754bd5f45182495ff14b39b94b24d (diff)
agenda for fsa
git-svn-id: https://ws10smt.googlecode.com/svn/trunk@612 ec762483-ff6d-05da-a07a-a48fb63a330f
Diffstat (limited to 'utils/lvalue_pmap.h')
-rwxr-xr-xutils/lvalue_pmap.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/utils/lvalue_pmap.h b/utils/lvalue_pmap.h
new file mode 100755
index 00000000..03ddf5e7
--- /dev/null
+++ b/utils/lvalue_pmap.h
@@ -0,0 +1,25 @@
+#ifndef LVALUE_PMAP_H
+#define LVALUE_PMAP_H
+
+#include <boost/property_map/property_map.hpp>
+
+// i checked: boost provides get and put given []
+
+// lvalue property map pmapname<P> that is: P p; valtype &v=p->name;
+#define PMAP_MEMBER_INDIRECT(pmapname,valtype,name) template <class P> struct pmapname { \
+ typedef P key_type; \
+ typedef valtype value_type; \
+ typedef value_type & reference; \
+ typedef boost::lvalue_property_map_tag category; \
+ reference operator[](key_type p) const { return p->name; } \
+};
+
+#define PMAP_MEMBER_INDIRECT_2(pmapname,name) template <class P,class R> struct pmapname { \
+ typedef P key_type; \
+ typedef R value_type; \
+ typedef value_type & reference; \
+ typedef boost::lvalue_property_map_tag category; \
+ reference operator[](key_type p) const { return p->name; } \
+};
+
+#endif