40 * will belong to and the Value. |
40 * will belong to and the Value. |
41 */ |
41 */ |
42 |
42 |
43 |
43 |
44 |
44 |
45 template <typename _Graph, typename _Item, typename _ItemIt, typename _Value> |
45 template <typename _Graph, typename _Item, typename _Value> |
46 struct DefaultMapSelector { |
46 struct DefaultMapSelector { |
47 typedef ArrayMap<_Graph, _Item, _ItemIt, _Value> Map; |
47 typedef ArrayMap<_Graph, _Item, _Value> Map; |
48 }; |
48 }; |
49 |
49 |
50 // bool |
50 // bool |
51 template <typename _Graph, typename _Item, typename _ItemIt> |
51 template <typename _Graph, typename _Item> |
52 struct DefaultMapSelector<_Graph, _Item, _ItemIt, bool> { |
52 struct DefaultMapSelector<_Graph, _Item, bool> { |
53 typedef VectorMap<_Graph, _Item, bool> Map; |
53 typedef VectorMap<_Graph, _Item, bool> Map; |
54 }; |
54 }; |
55 |
55 |
56 // char |
56 // char |
57 template <typename _Graph, typename _Item, typename _ItemIt> |
57 template <typename _Graph, typename _Item> |
58 struct DefaultMapSelector<_Graph, _Item, _ItemIt, char> { |
58 struct DefaultMapSelector<_Graph, _Item, char> { |
59 typedef VectorMap<_Graph, _Item, char> Map; |
59 typedef VectorMap<_Graph, _Item, char> Map; |
60 }; |
60 }; |
61 |
61 |
62 template <typename _Graph, typename _Item, typename _ItemIt> |
62 template <typename _Graph, typename _Item> |
63 struct DefaultMapSelector<_Graph, _Item, _ItemIt, signed char> { |
63 struct DefaultMapSelector<_Graph, _Item, signed char> { |
64 typedef VectorMap<_Graph, _Item, signed char> Map; |
64 typedef VectorMap<_Graph, _Item, signed char> Map; |
65 }; |
65 }; |
66 |
66 |
67 template <typename _Graph, typename _Item, typename _ItemIt> |
67 template <typename _Graph, typename _Item> |
68 struct DefaultMapSelector<_Graph, _Item, _ItemIt, unsigned char> { |
68 struct DefaultMapSelector<_Graph, _Item, unsigned char> { |
69 typedef VectorMap<_Graph, _Item, unsigned char> Map; |
69 typedef VectorMap<_Graph, _Item, unsigned char> Map; |
70 }; |
70 }; |
71 |
71 |
72 |
72 |
73 // int |
73 // int |
74 template <typename _Graph, typename _Item, typename _ItemIt> |
74 template <typename _Graph, typename _Item> |
75 struct DefaultMapSelector<_Graph, _Item, _ItemIt, signed int> { |
75 struct DefaultMapSelector<_Graph, _Item, signed int> { |
76 typedef VectorMap<_Graph, _Item, signed int> Map; |
76 typedef VectorMap<_Graph, _Item, signed int> Map; |
77 }; |
77 }; |
78 |
78 |
79 template <typename _Graph, typename _Item, typename _ItemIt> |
79 template <typename _Graph, typename _Item> |
80 struct DefaultMapSelector<_Graph, _Item, _ItemIt, unsigned int> { |
80 struct DefaultMapSelector<_Graph, _Item, unsigned int> { |
81 typedef VectorMap<_Graph, _Item, unsigned int> Map; |
81 typedef VectorMap<_Graph, _Item, unsigned int> Map; |
82 }; |
82 }; |
83 |
83 |
84 |
84 |
85 // short |
85 // short |
86 template <typename _Graph, typename _Item, typename _ItemIt> |
86 template <typename _Graph, typename _Item> |
87 struct DefaultMapSelector<_Graph, _Item, _ItemIt, signed short> { |
87 struct DefaultMapSelector<_Graph, _Item, signed short> { |
88 typedef VectorMap<_Graph, _Item, signed short> Map; |
88 typedef VectorMap<_Graph, _Item, signed short> Map; |
89 }; |
89 }; |
90 |
90 |
91 template <typename _Graph, typename _Item, typename _ItemIt> |
91 template <typename _Graph, typename _Item> |
92 struct DefaultMapSelector<_Graph, _Item, _ItemIt, unsigned short> { |
92 struct DefaultMapSelector<_Graph, _Item, unsigned short> { |
93 typedef VectorMap<_Graph, _Item, unsigned short> Map; |
93 typedef VectorMap<_Graph, _Item, unsigned short> Map; |
94 }; |
94 }; |
95 |
95 |
96 |
96 |
97 // long |
97 // long |
98 template <typename _Graph, typename _Item, typename _ItemIt> |
98 template <typename _Graph, typename _Item> |
99 struct DefaultMapSelector<_Graph, _Item, _ItemIt, signed long> { |
99 struct DefaultMapSelector<_Graph, _Item, signed long> { |
100 typedef VectorMap<_Graph, _Item, signed long> Map; |
100 typedef VectorMap<_Graph, _Item, signed long> Map; |
101 }; |
101 }; |
102 |
102 |
103 template <typename _Graph, typename _Item, typename _ItemIt> |
103 template <typename _Graph, typename _Item> |
104 struct DefaultMapSelector<_Graph, _Item, _ItemIt, unsigned long> { |
104 struct DefaultMapSelector<_Graph, _Item, unsigned long> { |
105 typedef VectorMap<_Graph, _Item, unsigned long> Map; |
105 typedef VectorMap<_Graph, _Item, unsigned long> Map; |
106 }; |
106 }; |
107 |
107 |
108 // \todo handling long long type |
108 // \todo handling long long type |
109 |
109 |
110 |
110 |
111 // float |
111 // float |
112 template <typename _Graph, typename _Item, typename _ItemIt> |
112 template <typename _Graph, typename _Item> |
113 struct DefaultMapSelector<_Graph, _Item, _ItemIt, float> { |
113 struct DefaultMapSelector<_Graph, _Item, float> { |
114 typedef VectorMap<_Graph, _Item, float> Map; |
114 typedef VectorMap<_Graph, _Item, float> Map; |
115 }; |
115 }; |
116 |
116 |
117 |
117 |
118 // double |
118 // double |
119 template <typename _Graph, typename _Item, typename _ItemIt> |
119 template <typename _Graph, typename _Item> |
120 struct DefaultMapSelector<_Graph, _Item, _ItemIt, double> { |
120 struct DefaultMapSelector<_Graph, _Item, double> { |
121 typedef VectorMap<_Graph, _Item, double> Map; |
121 typedef VectorMap<_Graph, _Item, double> Map; |
122 }; |
122 }; |
123 |
123 |
124 |
124 |
125 // long double |
125 // long double |
126 template <typename _Graph, typename _Item, typename _ItemIt> |
126 template <typename _Graph, typename _Item> |
127 struct DefaultMapSelector<_Graph, _Item, _ItemIt, long double> { |
127 struct DefaultMapSelector<_Graph, _Item, long double> { |
128 typedef VectorMap<_Graph, _Item, long double> Map; |
128 typedef VectorMap<_Graph, _Item, long double> Map; |
129 }; |
129 }; |
130 |
130 |
131 |
131 |
132 // pointer |
132 // pointer |
133 template <typename _Graph, typename _Item, typename _ItemIt, typename _Ptr> |
133 template <typename _Graph, typename _Item, typename _Ptr> |
134 struct DefaultMapSelector<_Graph, _Item, _ItemIt, _Ptr*> { |
134 struct DefaultMapSelector<_Graph, _Item, _Ptr*> { |
135 typedef VectorMap<_Graph, _Item, _Ptr*> Map; |
135 typedef VectorMap<_Graph, _Item, _Ptr*> Map; |
136 }; |
136 }; |
137 |
137 |
138 |
138 |
139 |
139 |
140 template <typename _Graph, |
140 template < |
141 typename _Item, |
141 typename _Graph, |
142 typename _ItemIt, |
142 typename _Item, |
143 typename _Value> |
143 typename _Value> |
144 class DefaultMap : public DefaultMapSelector<_Graph, _Item, _ItemIt, _Value>::Map { |
144 class DefaultMap |
|
145 : public DefaultMapSelector<_Graph, _Item, _Value>::Map { |
145 public: |
146 public: |
146 typedef typename DefaultMapSelector<_Graph, _Item, _ItemIt, _Value>::Map Parent; |
147 typedef typename DefaultMapSelector<_Graph, _Item, _Value>::Map Parent; |
147 typedef DefaultMap<_Graph, _Item, _ItemIt, _Value> Map; |
148 typedef DefaultMap<_Graph, _Item, _Value> Map; |
148 |
149 |
149 typedef typename Parent::Graph Graph; |
150 typedef typename Parent::Graph Graph; |
150 typedef typename Parent::Value Value; |
151 typedef typename Parent::Value Value; |
151 |
152 |
152 DefaultMap(const Graph& _g) : Parent(_g) {} |
153 DefaultMap(const Graph& _g) : Parent(_g) {} |