30 #ifndef __CLAW_MULTI_TYPE_MAP_HPP__
31 #define __CLAW_MULTI_TYPE_MAP_HPP__
59 template<
typename ValueType,
typename Map>
60 class multi_type_map_wrapper;
67 template<
typename Map>
68 class multi_type_map_helper;
89 template<
typename Key,
typename TypeList>
95 template<
typename Key>
96 class multi_type_map<Key, meta::no_type>
105 template<
typename Key,
typename Head,
typename Tail>
106 class multi_type_map< Key, meta::type_list<Head, Tail> >:
107 public multi_type_map<Key, Tail>
110 typedef Key key_type;
111 typedef Head value_type;
113 typedef multi_type_map< Key, meta::type_list<Head, Tail> >
self_type;
114 typedef std::map<key_type, value_type> container_type;
115 typedef multi_type_map<Key, Tail> super;
117 friend struct multi_type_map_wrapper<value_type, self_type>;
118 friend struct multi_type_map_helper<self_type>;
122 template<
typename ValueType>
126 typedef typename std::map<key_type, ValueType>::iterator
type;
130 typename std::map<key_type, ValueType>::const_iterator
const_type;
138 template<
typename ValueType>
141 template<
typename ValueType>
142 std::size_t erase(
const key_type& k );
144 template<
typename ValueType>
145 const ValueType&
get(
const key_type& k )
const;
147 template<
typename ValueType>
148 ValueType&
get(
const key_type& k );
150 template<
typename ValueType>
151 void set(
const key_type& k,
const ValueType& v );
153 void set(
const self_type& m );
155 template<
typename ValueType>
156 bool exists(
const key_type& k )
const;
158 std::size_t size()
const;
160 template<
typename ValueType>
163 template<
typename ValueType>
166 template<
typename ValueType>
169 template<
typename ValueType>
174 container_type m_data;
182 #endif // __CLAW_MULTI_TYPE_MAP_HPP__