diff --git a/lemon/graph_utils.h b/lemon/graph_utils.h --- a/lemon/graph_utils.h +++ b/lemon/graph_utils.h @@ -42,6 +42,82 @@ /// \addtogroup gutils /// @{ + namespace _graph_utils_bits { + template + struct Node { typedef typename Graph::Node type; }; + + template + struct NodeIt { typedef typename Graph::NodeIt type; }; + + template + struct Arc { typedef typename Graph::Arc type; }; + + template + struct ArcIt { typedef typename Graph::ArcIt type; }; + + template + struct Edge { typedef typename Graph::Edge type; }; + + template + struct EdgeIt { typedef typename Graph::EdgeIt type; }; + + template + struct OutArcIt { typedef typename Graph::OutArcIt type; }; + + template + struct InArcIt { typedef typename Graph::InArcIt type; }; + + template + struct IncEdgeIt { typedef typename Graph::IncEdgeIt type; }; + + template + struct BoolNodeMap { + typedef typename Graph::template NodeMap type; + }; + + template + struct IntNodeMap { + typedef typename Graph::template NodeMap type; + }; + + template + struct DoubleNodeMap { + typedef typename Graph::template NodeMap type; + }; + + template + struct BoolArcMap { + typedef typename Graph::template ArcMap type; + }; + + template + struct IntArcMap { + typedef typename Graph::template ArcMap type; + }; + + template + struct DoubleArcMap { + typedef typename Graph::template ArcMap type; + }; + + template + struct BoolEdgeMap { + typedef typename Graph::template EdgeMap type; + }; + + template + struct IntEdgeMap { + typedef typename Graph::template EdgeMap type; + }; + + template + struct DoubleEdgeMap { + typedef typename Graph::template EdgeMap type; + }; + + + } + ///Creates convenience typedefs for the digraph types and iterators ///This \c \#define creates convenience typedefs for the following types @@ -49,12 +125,31 @@ ///\c OutArcIt, \c BoolNodeMap, \c IntNodeMap, \c DoubleNodeMap, ///\c BoolArcMap, \c IntArcMap, \c DoubleArcMap. #define DIGRAPH_TYPEDEFS(Digraph) \ - typedef Digraph::Node Node; \ - typedef Digraph::NodeIt NodeIt; \ - typedef Digraph::Arc Arc; \ - typedef Digraph::ArcIt ArcIt; \ - typedef Digraph::InArcIt InArcIt; \ - typedef Digraph::OutArcIt OutArcIt + typedef typename ::lemon::_graph_utils_bits:: \ + Node::type Node; \ + typedef typename ::lemon::_graph_utils_bits:: \ + NodeIt::type NodeIt; \ + typedef typename ::lemon::_graph_utils_bits:: \ + Arc::type Arc; \ + typedef typename ::lemon::_graph_utils_bits:: \ + ArcIt::type ArcIt; \ + typedef typename ::lemon::_graph_utils_bits:: \ + OutArcIt::type OutArcIt; \ + typedef typename ::lemon::_graph_utils_bits:: \ + InArcIt::type InArcIt; \ + typedef typename ::lemon::_graph_utils_bits:: \ + BoolNodeMap::type BoolNodeMap; \ + typedef typename ::lemon::_graph_utils_bits:: \ + IntNodeMap::type IntNodeMap; \ + typedef typename ::lemon::_graph_utils_bits:: \ + DoubleNodeMap::type DoubleNodeMap; \ + typedef typename ::lemon::_graph_utils_bits:: \ + BoolArcMap::type BoolArcMap; \ + typedef typename ::lemon::_graph_utils_bits:: \ + IntArcMap::type IntArcMap; \ + typedef typename ::lemon::_graph_utils_bits:: \ + DoubleArcMap::type DoubleArcMap + ///Creates convenience typedefs for the graph types and iterators @@ -64,9 +159,19 @@ ///\c DoubleEdgeMap. #define GRAPH_TYPEDEFS(Graph) \ DIGRAPH_TYPEDEFS(Graph); \ - typedef Graph::Edge Edge; \ - typedef Graph::EdgeIt EdgeIt; \ - typedef Graph::IncEdgeIt IncEdgeIt + typedef typename ::lemon::_graph_utils_bits:: \ + Edge::type Edge; \ + typedef typename ::lemon::_graph_utils_bits:: \ + EdgeIt::type EdgeIt; \ + typedef typename ::lemon::_graph_utils_bits:: \ + IncEdgeIt::type IncEdgeIt \ + typedef typename ::lemon::_graph_utils_bits:: \ + BoolEdgeMap::type BoolEdgeMap; \ + typedef typename ::lemon::_graph_utils_bits:: \ + IntEdgeMap::type IntEdgeMap; \ + typedef typename ::lemon::_graph_utils_bits:: \ + DoubleEdgeMap::type DoubleEdgeMap + /// \brief Function to count the items in the graph. /// @@ -2056,7 +2161,7 @@ typedef typename ItemSetTraits ::ItemNotifier::ObserverBase Parent; - DIGRAPH_TYPEDEFS(typename G); + DIGRAPH_TYPEDEFS(G); typedef G Digraph; protected: @@ -2493,7 +2598,7 @@ class ArcLookUp { public: - DIGRAPH_TYPEDEFS(typename G); + DIGRAPH_TYPEDEFS(G); typedef G Digraph; protected: @@ -2610,7 +2715,7 @@ using ArcLookUp::_left; using ArcLookUp::_head; - DIGRAPH_TYPEDEFS(typename G); + DIGRAPH_TYPEDEFS(G); typedef G Digraph; typename Digraph::template ArcMap _next; diff --git a/lemon/lgf_reader.h b/lemon/lgf_reader.h --- a/lemon/lgf_reader.h +++ b/lemon/lgf_reader.h @@ -302,7 +302,7 @@ public: typedef _Digraph Digraph; - DIGRAPH_TYPEDEFS(typename Digraph); + DIGRAPH_TYPEDEFS(Digraph); private: diff --git a/lemon/lgf_writer.h b/lemon/lgf_writer.h --- a/lemon/lgf_writer.h +++ b/lemon/lgf_writer.h @@ -237,7 +237,7 @@ public: typedef _Digraph Digraph; - DIGRAPH_TYPEDEFS(typename Digraph); + DIGRAPH_TYPEDEFS(Digraph); private: