Line data Source code
1 : //
2 : // Author: Vladimir Migashko <migashko@gmail.com>, (C) 2012
3 : //
4 : // Copyright: See COPYING file that comes with this distribution
5 : //
6 :
7 : #ifndef VSET_VTREE_ASPECT_ASPECT_TREE_HPP
8 : #define VSET_VTREE_ASPECT_ASPECT_TREE_HPP
9 :
10 : #include <vset/vtree/aspect/tags.hpp>
11 : #include <fas/type_list/type_list_n.hpp>
12 : #include <fas/aop.hpp>
13 : #include <map>
14 :
15 : namespace vset{ namespace vtree{
16 :
17 29 : struct ad_multimap
18 : {
19 : template<typename K, typename V, typename C>
20 : struct apply
21 : {
22 : typedef std::multimap<K, V, C> type;
23 : };
24 : };
25 :
26 29 : struct ad_get_key
27 : {
28 : template<typename T>
29 74018 : const typename T::key_type& operator()(T&, const typename T::value_type& value) const
30 : {
31 74018 : return value;
32 : }
33 : };
34 :
35 : template<typename V, typename Compare >
36 : struct aspect_tree: fas::aspect< typename fas::type_list_n<
37 : fas::type< _value_type_, V >,
38 : fas::advice< _get_key_, ad_get_key>,
39 : fas::alias< _key_type_, _value_type_ >,
40 : fas::value< _compare_, Compare >,
41 : fas::alias< _key_compare_, _compare_ >,
42 : fas::alias< _value_compare_, _compare_ >,
43 : fas::advice< _container_, ad_multimap >
44 : >::type> {};
45 :
46 :
47 : }}
48 :
49 : #endif
|