Chris@16: // Boost.Geometry (aka GGL, Generic Geometry Library) Chris@16: Chris@16: // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. Chris@16: Chris@16: // Use, modification and distribution is subject to the Boost Software License, Chris@16: // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at Chris@16: // http://www.boost.org/LICENSE_1_0.txt) Chris@16: Chris@16: #ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_RING_IDENTIFIER_HPP Chris@16: #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_RING_IDENTIFIER_HPP Chris@16: Chris@16: Chris@101: #if defined(BOOST_GEOMETRY_DEBUG_IDENTIFIER) Chris@101: #include Chris@101: #endif Chris@101: Chris@101: Chris@101: #include Chris@101: Chris@101: Chris@16: namespace boost { namespace geometry Chris@16: { Chris@16: Chris@16: Chris@16: // Ring Identifier. It is currently: source,multi,ring Chris@16: struct ring_identifier Chris@16: { Chris@16: Chris@16: inline ring_identifier() Chris@16: : source_index(-1) Chris@16: , multi_index(-1) Chris@16: , ring_index(-1) Chris@16: {} Chris@16: Chris@101: inline ring_identifier(signed_index_type src, Chris@101: signed_index_type mul, Chris@101: signed_index_type rin) Chris@16: : source_index(src) Chris@16: , multi_index(mul) Chris@16: , ring_index(rin) Chris@16: {} Chris@16: Chris@16: inline bool operator<(ring_identifier const& other) const Chris@16: { Chris@16: return source_index != other.source_index ? source_index < other.source_index Chris@16: : multi_index !=other.multi_index ? multi_index < other.multi_index Chris@16: : ring_index < other.ring_index Chris@16: ; Chris@16: } Chris@16: Chris@16: inline bool operator==(ring_identifier const& other) const Chris@16: { Chris@16: return source_index == other.source_index Chris@16: && ring_index == other.ring_index Chris@16: && multi_index == other.multi_index Chris@16: ; Chris@16: } Chris@16: Chris@16: #if defined(BOOST_GEOMETRY_DEBUG_IDENTIFIER) Chris@16: friend std::ostream& operator<<(std::ostream &os, ring_identifier const& ring_id) Chris@16: { Chris@16: os << "(s:" << ring_id.source_index; Chris@16: if (ring_id.ring_index >= 0) os << ", r:" << ring_id.ring_index; Chris@16: if (ring_id.multi_index >= 0) os << ", m:" << ring_id.multi_index; Chris@16: os << ")"; Chris@16: return os; Chris@16: } Chris@16: #endif Chris@16: Chris@16: Chris@101: signed_index_type source_index; Chris@101: signed_index_type multi_index; Chris@101: signed_index_type ring_index; Chris@16: }; Chris@16: Chris@16: Chris@16: }} // namespace boost::geometry Chris@16: Chris@16: Chris@16: #endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_RING_IDENTIFIER_HPP