Changeset 209:765619b7cbb2 in lemon for lemon/bits/traits.h
 Timestamp:
 07/13/08 20:51:02 (14 years ago)
 Branch:
 default
 Phase:
 public
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

lemon/bits/traits.h
r184 r209 1 2 /* * C++ * 3 * 4 * This file is a part of LEMON, a generic C++ optimization library 1 /* * mode: C++; indenttabsmode: nil; * 2 * 3 * This file is a part of LEMON, a generic C++ optimization library. 5 4 * 6 5 * Copyright (C) 20032008 … … 30 29 template <typename _Graph, typename _Item> 31 30 class ItemSetTraits {}; 32 31 33 32 34 33 template <typename Graph, typename Enable = void> … … 38 37 template <typename Graph> 39 38 struct NodeNotifierIndicator< 40 Graph, 39 Graph, 41 40 typename enable_if<typename Graph::NodeNotifier::Notifier, void>::type 42 > { 41 > { 43 42 typedef typename Graph::NodeNotifier Type; 44 43 }; … … 47 46 class ItemSetTraits<_Graph, typename _Graph::Node> { 48 47 public: 49 48 50 49 typedef _Graph Graph; 51 50 … … 58 57 class Map : public Graph::template NodeMap<_Value> { 59 58 public: 60 typedef typename Graph::template NodeMap<_Value> Parent; 61 typedef typename Graph::template NodeMap<_Value> Type; 59 typedef typename Graph::template NodeMap<_Value> Parent; 60 typedef typename Graph::template NodeMap<_Value> Type; 62 61 typedef typename Parent::Value Value; 63 62 64 63 Map(const Graph& _digraph) : Parent(_digraph) {} 65 Map(const Graph& _digraph, const Value& _value) 66 64 Map(const Graph& _digraph, const Value& _value) 65 : Parent(_digraph, _value) {} 67 66 68 67 }; … … 76 75 template <typename Graph> 77 76 struct ArcNotifierIndicator< 78 Graph, 77 Graph, 79 78 typename enable_if<typename Graph::ArcNotifier::Notifier, void>::type 80 > { 79 > { 81 80 typedef typename Graph::ArcNotifier Type; 82 81 }; … … 85 84 class ItemSetTraits<_Graph, typename _Graph::Arc> { 86 85 public: 87 86 88 87 typedef _Graph Graph; 89 88 … … 96 95 class Map : public Graph::template ArcMap<_Value> { 97 96 public: 98 typedef typename Graph::template ArcMap<_Value> Parent; 99 typedef typename Graph::template ArcMap<_Value> Type; 97 typedef typename Graph::template ArcMap<_Value> Parent; 98 typedef typename Graph::template ArcMap<_Value> Type; 100 99 typedef typename Parent::Value Value; 101 100 102 101 Map(const Graph& _digraph) : Parent(_digraph) {} 103 Map(const Graph& _digraph, const Value& _value) 104 102 Map(const Graph& _digraph, const Value& _value) 103 : Parent(_digraph, _value) {} 105 104 }; 106 105 … … 113 112 template <typename Graph> 114 113 struct EdgeNotifierIndicator< 115 Graph, 114 Graph, 116 115 typename enable_if<typename Graph::EdgeNotifier::Notifier, void>::type 117 > { 116 > { 118 117 typedef typename Graph::EdgeNotifier Type; 119 118 }; … … 122 121 class ItemSetTraits<_Graph, typename _Graph::Edge> { 123 122 public: 124 123 125 124 typedef _Graph Graph; 126 125 … … 133 132 class Map : public Graph::template EdgeMap<_Value> { 134 133 public: 135 typedef typename Graph::template EdgeMap<_Value> Parent; 136 typedef typename Graph::template EdgeMap<_Value> Type; 134 typedef typename Graph::template EdgeMap<_Value> Parent; 135 typedef typename Graph::template EdgeMap<_Value> Type; 137 136 typedef typename Parent::Value Value; 138 137 139 138 Map(const Graph& _digraph) : Parent(_digraph) {} 140 Map(const Graph& _digraph, const Value& _value) 141 139 Map(const Graph& _digraph, const Value& _value) 140 : Parent(_digraph, _value) {} 142 141 }; 143 142 … … 157 156 template <typename Map> 158 157 struct MapTraits< 159 Map, typename enable_if<typename Map::ReferenceMapTag, void>::type > 158 Map, typename enable_if<typename Map::ReferenceMapTag, void>::type > 160 159 { 161 160 typedef True ReferenceMapTag; 162 161 163 162 typedef typename Map::Key Key; 164 163 typedef typename Map::Value Value; … … 167 166 typedef typename Map::Reference ReturnValue; 168 167 169 typedef typename Map::ConstReference ConstReference; 168 typedef typename Map::ConstReference ConstReference; 170 169 typedef typename Map::Reference Reference; 171 170 }; … … 185 184 template <typename MatrixMap> 186 185 struct MatrixMapTraits< 187 MatrixMap, typename enable_if<typename MatrixMap::ReferenceMapTag, 188 void>::type > 186 MatrixMap, typename enable_if<typename MatrixMap::ReferenceMapTag, 187 void>::type > 189 188 { 190 189 typedef True ReferenceMapTag; 191 190 192 191 typedef typename MatrixMap::FirstKey FirstKey; 193 192 typedef typename MatrixMap::SecondKey SecondKey; … … 197 196 typedef typename MatrixMap::Reference ReturnValue; 198 197 199 typedef typename MatrixMap::ConstReference ConstReference; 198 typedef typename MatrixMap::ConstReference ConstReference; 200 199 typedef typename MatrixMap::Reference Reference; 201 200 }; … … 210 209 template <typename Graph> 211 210 struct NodeNumTagIndicator< 212 Graph, 211 Graph, 213 212 typename enable_if<typename Graph::NodeNumTag, void>::type 214 213 > { … … 223 222 template <typename Graph> 224 223 struct EdgeNumTagIndicator< 225 Graph, 224 Graph, 226 225 typename enable_if<typename Graph::EdgeNumTag, void>::type 227 226 > { … … 236 235 template <typename Graph> 237 236 struct FindEdgeTagIndicator< 238 Graph, 237 Graph, 239 238 typename enable_if<typename Graph::FindEdgeTag, void>::type 240 239 > { … … 249 248 template <typename Graph> 250 249 struct UndirectedTagIndicator< 251 Graph, 250 Graph, 252 251 typename enable_if<typename Graph::UndirectedTag, void>::type 253 252 > { … … 262 261 template <typename Graph> 263 262 struct BuildTagIndicator< 264 Graph, 263 Graph, 265 264 typename enable_if<typename Graph::BuildTag, void>::type 266 265 > {
Note: See TracChangeset
for help on using the changeset viewer.