1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/epoc32/include/stdapis/boost/graph/detail/edge.hpp Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -0,0 +1,94 @@
1.4 +//
1.5 +//=======================================================================
1.6 +// Copyright 1997, 1998, 1999, 2000 University of Notre Dame.
1.7 +// Authors: Andrew Lumsdaine, Lie-Quan Lee, Jeremy G. Siek
1.8 +//
1.9 +// Distributed under the Boost Software License, Version 1.0. (See
1.10 +// accompanying file LICENSE_1_0.txt or copy at
1.11 +// http://www.boost.org/LICENSE_1_0.txt)
1.12 +//=======================================================================
1.13 +
1.14 +#ifndef BOOST_GRAPH_DETAIL_EDGE_HPP
1.15 +#define BOOST_GRAPH_DETAIL_EDGE_HPP
1.16 +
1.17 +#if __GNUC__ < 3
1.18 +#include <iostream>
1.19 +#else
1.20 +#include <iosfwd>
1.21 +#endif
1.22 +
1.23 +namespace boost {
1.24 +
1.25 + namespace detail {
1.26 +
1.27 + template <typename Directed, typename Vertex>
1.28 + struct edge_base
1.29 + {
1.30 + inline edge_base() {}
1.31 + inline edge_base(Vertex s, Vertex d)
1.32 + : m_source(s), m_target(d) { }
1.33 + Vertex m_source;
1.34 + Vertex m_target;
1.35 + };
1.36 +
1.37 + template <typename Directed, typename Vertex>
1.38 + class edge_desc_impl : public edge_base<Directed,Vertex> {
1.39 + typedef edge_desc_impl self;
1.40 + typedef edge_base<Directed,Vertex> Base;
1.41 + public:
1.42 + typedef void property_type;
1.43 +
1.44 + inline edge_desc_impl() : m_eproperty(0) {}
1.45 +
1.46 + inline edge_desc_impl(Vertex s, Vertex d, const property_type* eplug)
1.47 + : Base(s,d), m_eproperty(const_cast<property_type*>(eplug)) { }
1.48 +
1.49 + property_type* get_property() { return m_eproperty; }
1.50 + const property_type* get_property() const { return m_eproperty; }
1.51 +
1.52 + // protected:
1.53 + property_type* m_eproperty;
1.54 + };
1.55 +
1.56 + template <class D, class V>
1.57 + inline bool
1.58 + operator==(const detail::edge_desc_impl<D,V>& a,
1.59 + const detail::edge_desc_impl<D,V>& b)
1.60 + {
1.61 + return a.get_property() == b.get_property();
1.62 + }
1.63 + template <class D, class V>
1.64 + inline bool
1.65 + operator!=(const detail::edge_desc_impl<D,V>& a,
1.66 + const detail::edge_desc_impl<D,V>& b)
1.67 + {
1.68 + return ! (a.get_property() == b.get_property());
1.69 + }
1.70 +
1.71 + } //namespace detail
1.72 +
1.73 +} // namespace boost
1.74 +
1.75 +namespace std {
1.76 +
1.77 +#if __GNUC__ < 3
1.78 + template <class D, class V>
1.79 + std::ostream&
1.80 + operator<<(std::ostream& os, const boost::detail::edge_desc_impl<D,V>& e)
1.81 + {
1.82 + return os << "(" << e.m_source << "," << e.m_target << ")";
1.83 + }
1.84 +#else
1.85 + template <class Char, class Traits, class D, class V>
1.86 + std::basic_ostream<Char, Traits>&
1.87 + operator<<(std::basic_ostream<Char, Traits>& os,
1.88 + const boost::detail::edge_desc_impl<D,V>& e)
1.89 + {
1.90 + return os << "(" << e.m_source << "," << e.m_target << ")";
1.91 + }
1.92 +#endif
1.93 +
1.94 +}
1.95 +
1.96 +
1.97 +#endif // BOOST_GRAPH_DETAIL_DETAIL_EDGE_HPP