1.1 --- a/lemon/graph_utils.h Wed Nov 02 15:28:37 2005 +0000
1.2 +++ b/lemon/graph_utils.h Wed Nov 02 16:32:29 2005 +0000
1.3 @@ -40,6 +40,46 @@
1.4 /// \addtogroup gutils
1.5 /// @{
1.6
1.7 + ///Creates convenience typedefs for the graph types and iterators
1.8 +
1.9 + ///This \c \#define creates convenience typedefs for the following types
1.10 + ///of \c Graph: \c Node, \c NodeIt, \c Edge, \c EdgeIt, \c InEdgeIt,
1.11 + ///\c OutEdgeIt.
1.12 + ///\note If \c G it a template parameter, it should be used in this way.
1.13 + ///\code
1.14 + /// GRAPH_TYPEDEFS(typename G)
1.15 + ///\endcode
1.16 + ///
1.17 + ///\warning There are no typedefs for the graph maps because of the lack of
1.18 + ///template typedefs in C++.
1.19 +#define GRAPH_TYPEDEFS(Graph) \
1.20 + typedef Graph:: Node Node; \
1.21 + typedef Graph:: NodeIt NodeIt; \
1.22 + typedef Graph:: Edge Edge; \
1.23 + typedef Graph:: EdgeIt EdgeIt; \
1.24 + typedef Graph:: InEdgeIt InEdgeIt; \
1.25 + typedef Graph::OutEdgeIt OutEdgeIt;
1.26 +
1.27 + ///Creates convenience typedefs for the undirected graph types and iterators
1.28 +
1.29 + ///This \c \#define creates the same convenience typedefs as defined by
1.30 + ///\ref GRAPH_TYPEDEFS(Graph) and three more, namely it creates
1.31 + ///\c UndirEdge, \c UndirEdgeIt, \c IncEdgeIt,
1.32 + ///
1.33 + ///\note If \c G it a template parameter, it should be used in this way.
1.34 + ///\code
1.35 + /// UNDIRGRAPH_TYPEDEFS(typename G)
1.36 + ///\endcode
1.37 + ///
1.38 + ///\warning There are no typedefs for the graph maps because of the lack of
1.39 + ///template typedefs in C++.
1.40 +#define UNDIRGRAPH_TYPEDEFS(Graph) \
1.41 + GRAPH_TYPEDEFS(Graph) \
1.42 + typedef Graph:: UndirEdge UndirEdge; \
1.43 + typedef Graph:: UndirEdgeIt UndirEdgeIt; \
1.44 + typedef Graph:: IncEdgeIt IncEdgeIt;
1.45 +
1.46 +
1.47 /// \brief Function to count the items in the graph.
1.48 ///
1.49 /// This function counts the items (nodes, edges etc) in the graph.