sl@0: // sl@0: //======================================================================= sl@0: // Copyright 1997, 1998, 1999, 2000 University of Notre Dame. sl@0: // Authors: Andrew Lumsdaine, Lie-Quan Lee, Jeremy G. Siek sl@0: // sl@0: // Distributed under the Boost Software License, Version 1.0. (See sl@0: // accompanying file LICENSE_1_0.txt or copy at sl@0: // http://www.boost.org/LICENSE_1_0.txt) sl@0: //======================================================================= sl@0: sl@0: #ifndef BOOST_GRAPH_DETAIL_EDGE_HPP sl@0: #define BOOST_GRAPH_DETAIL_EDGE_HPP sl@0: sl@0: #if __GNUC__ < 3 sl@0: #include sl@0: #else sl@0: #include sl@0: #endif sl@0: sl@0: namespace boost { sl@0: sl@0: namespace detail { sl@0: sl@0: template sl@0: struct edge_base sl@0: { sl@0: inline edge_base() {} sl@0: inline edge_base(Vertex s, Vertex d) sl@0: : m_source(s), m_target(d) { } sl@0: Vertex m_source; sl@0: Vertex m_target; sl@0: }; sl@0: sl@0: template sl@0: class edge_desc_impl : public edge_base { sl@0: typedef edge_desc_impl self; sl@0: typedef edge_base Base; sl@0: public: sl@0: typedef void property_type; sl@0: sl@0: inline edge_desc_impl() : m_eproperty(0) {} sl@0: sl@0: inline edge_desc_impl(Vertex s, Vertex d, const property_type* eplug) sl@0: : Base(s,d), m_eproperty(const_cast(eplug)) { } sl@0: sl@0: property_type* get_property() { return m_eproperty; } sl@0: const property_type* get_property() const { return m_eproperty; } sl@0: sl@0: // protected: sl@0: property_type* m_eproperty; sl@0: }; sl@0: sl@0: template sl@0: inline bool sl@0: operator==(const detail::edge_desc_impl& a, sl@0: const detail::edge_desc_impl& b) sl@0: { sl@0: return a.get_property() == b.get_property(); sl@0: } sl@0: template sl@0: inline bool sl@0: operator!=(const detail::edge_desc_impl& a, sl@0: const detail::edge_desc_impl& b) sl@0: { sl@0: return ! (a.get_property() == b.get_property()); sl@0: } sl@0: sl@0: } //namespace detail sl@0: sl@0: } // namespace boost sl@0: sl@0: namespace std { sl@0: sl@0: #if __GNUC__ < 3 sl@0: template sl@0: std::ostream& sl@0: operator<<(std::ostream& os, const boost::detail::edge_desc_impl& e) sl@0: { sl@0: return os << "(" << e.m_source << "," << e.m_target << ")"; sl@0: } sl@0: #else sl@0: template sl@0: std::basic_ostream& sl@0: operator<<(std::basic_ostream& os, sl@0: const boost::detail::edge_desc_impl& e) sl@0: { sl@0: return os << "(" << e.m_source << "," << e.m_target << ")"; sl@0: } sl@0: #endif sl@0: sl@0: } sl@0: sl@0: sl@0: #endif // BOOST_GRAPH_DETAIL_DETAIL_EDGE_HPP