# Changeset 1346:639dadf8c00d in lemon-0.x for src/lemon

Ignore:
Timestamp:
04/12/05 19:38:16 (15 years ago)
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1785
Message:

Source and Target EdgeMap?.

File:
1 edited

Unmodified
Removed
• ## src/lemon/maps.h

 r1317 ///\param _v is the convert value ConvertMap(const M &_m) : m(_m) {}; /// \brief The subscript operator. /// /// The subscript operator. /// \param edge The edge /// \return The target of the edge Value operator[](Key k) const {return m[k];} }; { return ConvertMap(m); } /// \brief Returns the source of the given edge. /// /// The SourceMap gives back the source Node of the given edge. /// \author Balazs Dezso template class SourceMap { public: typedef typename Graph::Node Value; typedef typename Graph::Edge Key; /// \brief Constructor /// /// Constructor /// \param _graph The graph that the map belongs to. SourceMap(const Graph& _graph) : graph(_graph) {} /// \brief The subscript operator. /// /// The subscript operator. /// \param edge The edge /// \return The source of the edge Value operator[](const Key& edge) { return graph.source(edge); } private: const Graph& graph; }; /// \brief Returns a \ref SourceMap class /// This function just returns an \ref SourceMap class. /// \relates SourceMap template inline SourceMap sourceMap(const Graph&) { return SourceMap(graph); } /// \brief Returns the target of the given edge. /// /// The TargetMap gives back the target Node of the given edge. /// \author Balazs Dezso template class TargetMap { public: typedef typename Graph::Node Value; typedef typename Graph::Edge Key; /// \brief Constructor /// /// Constructor /// \param _graph The graph that the map belongs to. TargetMap(const Graph& _graph) : graph(_graph) {} /// \brief The subscript operator. /// /// The subscript operator. /// \param edge The edge /// \return The target of the edge Value operator[](const Key& key) { return graph.target(key); } private: const Graph& graph; }; /// \brief Returns a \ref TargetMap class /// This function just returns an \ref TargetMap class. /// \relates TargetMap template inline TargetMap targetMap(const Graph&) { return TargetMap(graph); }
Note: See TracChangeset for help on using the changeset viewer.