1 // Boost.Geometry (aka GGL, Generic Geometry Library)
3 // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
5 // Use, modification and distribution is subject to the Boost Software License,
6 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
7 // http://www.boost.org/LICENSE_1_0.txt)
9 #ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_RING_IDENTIFIER_HPP
10 #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_RING_IDENTIFIER_HPP
13 #if defined(BOOST_GEOMETRY_DEBUG_IDENTIFIER)
18 #include <boost/geometry/algorithms/detail/signed_size_type.hpp>
21 namespace boost { namespace geometry
25 // Ring Identifier. It is currently: source,multi,ring
26 struct ring_identifier
29 inline ring_identifier()
35 inline ring_identifier(signed_size_type src,
43 inline bool operator<(ring_identifier const& other) const
45 return source_index != other.source_index ? source_index < other.source_index
46 : multi_index !=other.multi_index ? multi_index < other.multi_index
47 : ring_index < other.ring_index
51 inline bool operator==(ring_identifier const& other) const
53 return source_index == other.source_index
54 && ring_index == other.ring_index
55 && multi_index == other.multi_index
59 inline bool operator!=(ring_identifier const& other) const
61 return ! operator==(other);
64 #if defined(BOOST_GEOMETRY_DEBUG_IDENTIFIER)
65 friend std::ostream& operator<<(std::ostream &os, ring_identifier const& ring_id)
67 os << "(s:" << ring_id.source_index;
68 if (ring_id.ring_index >= 0) os << ", r:" << ring_id.ring_index;
69 if (ring_id.multi_index >= 0) os << ", m:" << ring_id.multi_index;
76 signed_size_type source_index;
77 signed_size_type multi_index;
78 signed_size_type ring_index;
82 }} // namespace boost::geometry
85 #endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_RING_IDENTIFIER_HPP