view release on metacpan or search on metacpan
271272273274275276277278279280281282283284285286287288289290291src/boost/detail/allocator_utilities.hpp
src/boost/detail/atomic_count.hpp
src/boost/detail/binary_search.hpp
src/boost/detail/call_traits.hpp
src/boost/detail/compressed_pair.hpp
src/boost/detail/container_fwd.hpp
src/boost/detail/dynamic_bitset.hpp
src/boost/detail/endian.hpp
src/boost/detail/fenv.hpp
src/boost/detail/indirect_traits.hpp
src/boost/detail/interlocked.hpp
src/boost/detail/is_function_ref_tester.hpp
src/boost/detail/is_incrementable.hpp
src/boost/detail/is_xxx.hpp
src/boost/detail/iterator.hpp
src/boost/detail/lcast_precision.hpp
src/boost/detail/lightweight_mutex.hpp
src/boost/detail/limits.hpp
src/boost/detail/no_exceptions_support.hpp
src/boost/detail/numeric_traits.hpp
src/boost/detail/ob_call_traits.hpp
src/boost/detail/interlocked.hpp view on Meta::CPAN
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180#ifndef BOOST_DETAIL_INTERLOCKED_HPP_INCLUDED
#define BOOST_DETAIL_INTERLOCKED_HPP_INCLUDED
// MS compatible compilers support
#pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif
//
// boost/detail/interlocked.hpp
//
// Copyright 2005 Peter Dimov
//
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
//
#include <boost/config.hpp>
#if defined( BOOST_USE_WINDOWS_H )
# include <windows.h>
# define BOOST_INTERLOCKED_INCREMENT InterlockedIncrement
# define BOOST_INTERLOCKED_DECREMENT InterlockedDecrement
# define BOOST_INTERLOCKED_COMPARE_EXCHANGE InterlockedCompareExchange
# define BOOST_INTERLOCKED_EXCHANGE InterlockedExchange
# define BOOST_INTERLOCKED_EXCHANGE_ADD InterlockedExchangeAdd
# define BOOST_INTERLOCKED_COMPARE_EXCHANGE_POINTER InterlockedCompareExchangePointer
# define BOOST_INTERLOCKED_EXCHANGE_POINTER InterlockedExchangePointer
#elif defined(_WIN32_WCE)
#if _WIN32_WCE >= 0x600
extern
"C"
long __cdecl _InterlockedIncrement( long volatile * );
extern
"C"
long __cdecl _InterlockedDecrement( long volatile * );
extern
"C"
long __cdecl _InterlockedCompareExchange( long volatile *, long, long );
extern
"C"
long __cdecl _InterlockedExchange( long volatile *, long );
extern
"C"
long __cdecl _InterlockedExchangeAdd( long volatile *, long );
# define BOOST_INTERLOCKED_INCREMENT _InterlockedIncrement
# define BOOST_INTERLOCKED_DECREMENT _InterlockedDecrement
# define BOOST_INTERLOCKED_COMPARE_EXCHANGE _InterlockedCompareExchange
# define BOOST_INTERLOCKED_EXCHANGE _InterlockedExchange
# define BOOST_INTERLOCKED_EXCHANGE_ADD _InterlockedExchangeAdd
#else
// under Windows CE we still have old-style Interlocked* functions
extern
"C"
long __cdecl InterlockedIncrement( long* );
extern
"C"
long __cdecl InterlockedDecrement( long* );
extern
"C"
long __cdecl InterlockedCompareExchange( long*, long, long );
extern
"C"
long __cdecl InterlockedExchange( long*, long );
extern
"C"
long __cdecl InterlockedExchangeAdd( long*, long );
# define BOOST_INTERLOCKED_INCREMENT InterlockedIncrement
# define BOOST_INTERLOCKED_DECREMENT InterlockedDecrement
# define BOOST_INTERLOCKED_COMPARE_EXCHANGE InterlockedCompareExchange
# define BOOST_INTERLOCKED_EXCHANGE InterlockedExchange
# define BOOST_INTERLOCKED_EXCHANGE_ADD InterlockedExchangeAdd
#endif
# define BOOST_INTERLOCKED_COMPARE_EXCHANGE_POINTER(dest,exchange,compare) \
((void*)BOOST_INTERLOCKED_COMPARE_EXCHANGE((long*)(dest),(long)(exchange),(long)(compare)))
# define BOOST_INTERLOCKED_EXCHANGE_POINTER(dest,exchange) \
((void*)BOOST_INTERLOCKED_EXCHANGE((long*)(dest),(long)(exchange)))
#elif defined( BOOST_MSVC ) || defined( BOOST_INTEL_WIN )
#if defined( BOOST_MSVC ) && BOOST_MSVC >= 1600
#include <intrin.h>
#elif defined( __CLRCALL_PURE_OR_CDECL )
extern
"C"
long __CLRCALL_PURE_OR_CDECL _InterlockedIncrement( long volatile * );
extern
"C"
long __CLRCALL_PURE_OR_CDECL _InterlockedDecrement( long volatile * );
extern
"C"
long __CLRCALL_PURE_OR_CDECL _InterlockedCompareExchange( long volatile *, long, long );
extern
"C"
long __CLRCALL_PURE_OR_CDECL _InterlockedExchange( long volatile *, long );
extern
"C"
long __CLRCALL_PURE_OR_CDECL _InterlockedExchangeAdd( long volatile *, long );
#else
extern
"C"
long __cdecl _InterlockedIncrement( long volatile * );
extern
"C"
long __cdecl _InterlockedDecrement( long volatile * );
extern
"C"
long __cdecl _InterlockedCompareExchange( long volatile *, long, long );
extern
"C"
long __cdecl _InterlockedExchange( long volatile *, long );
extern
"C"
long __cdecl _InterlockedExchangeAdd( long volatile *, long );
#endif
# pragma intrinsic( _InterlockedIncrement )
# pragma intrinsic( _InterlockedDecrement )
# pragma intrinsic( _InterlockedCompareExchange )
# pragma intrinsic( _InterlockedExchange )
# pragma intrinsic( _InterlockedExchangeAdd )
# if defined(_M_IA64) || defined(_M_AMD64)
extern
"C"
void* __cdecl _InterlockedCompareExchangePointer( void* volatile *, void*, void* );
extern
"C"
void* __cdecl _InterlockedExchangePointer( void* volatile *, void* );
# pragma intrinsic( _InterlockedCompareExchangePointer )
# pragma intrinsic( _InterlockedExchangePointer )
# define BOOST_INTERLOCKED_COMPARE_EXCHANGE_POINTER _InterlockedCompareExchangePointer
# define BOOST_INTERLOCKED_EXCHANGE_POINTER _InterlockedExchangePointer
# else
# define BOOST_INTERLOCKED_COMPARE_EXCHANGE_POINTER(dest,exchange,compare) \
((void*)BOOST_INTERLOCKED_COMPARE_EXCHANGE((long volatile*)(dest),(long)(exchange),(long)(compare)))
# define BOOST_INTERLOCKED_EXCHANGE_POINTER(dest,exchange) \
((void*)BOOST_INTERLOCKED_EXCHANGE((long volatile*)(dest),(long)(exchange)))
# endif
# define BOOST_INTERLOCKED_INCREMENT _InterlockedIncrement
# define BOOST_INTERLOCKED_DECREMENT _InterlockedDecrement
# define BOOST_INTERLOCKED_COMPARE_EXCHANGE _InterlockedCompareExchange
# define BOOST_INTERLOCKED_EXCHANGE _InterlockedExchange
# define BOOST_INTERLOCKED_EXCHANGE_ADD _InterlockedExchangeAdd
#elif defined( WIN32 ) || defined( _WIN32 ) || defined( __WIN32__ ) || defined( __CYGWIN__ )
#if defined(__MINGW64__)
#define BOOST_INTERLOCKED_IMPORT
#else
#define BOOST_INTERLOCKED_IMPORT __declspec(dllimport)
#endif
namespace boost
{
namespace detail
{
extern
"C"
BOOST_INTERLOCKED_IMPORT long __stdcall InterlockedIncrement( long volatile * );
extern
"C"
BOOST_INTERLOCKED_IMPORT long __stdcall InterlockedDecrement( long volatile * );
extern
"C"
BOOST_INTERLOCKED_IMPORT long __stdcall InterlockedCompareExchange( long volatile *, long, long );
extern
"C"
BOOST_INTERLOCKED_IMPORT long __stdcall InterlockedExchange( long volatile *, long );
extern
"C"
BOOST_INTERLOCKED_IMPORT long __stdcall InterlockedExchangeAdd( long volatile *, long );
# if defined(_M_IA64) || defined(_M_AMD64)
extern
"C"
BOOST_INTERLOCKED_IMPORT void* __stdcall InterlockedCompareExchangePointer( void* volatile *, void*, void* );
extern
"C"
BOOST_INTERLOCKED_IMPORT void* __stdcall InterlockedExchangePointer( void* volatile *, void* );
# endif
} // namespace detail
} // namespace boost
# define BOOST_INTERLOCKED_INCREMENT ::boost::detail::InterlockedIncrement
# define BOOST_INTERLOCKED_DECREMENT ::boost::detail::InterlockedDecrement
# define BOOST_INTERLOCKED_COMPARE_EXCHANGE ::boost::detail::InterlockedCompareExchange
# define BOOST_INTERLOCKED_EXCHANGE ::boost::detail::InterlockedExchange
# define BOOST_INTERLOCKED_EXCHANGE_ADD ::boost::detail::InterlockedExchangeAdd
# if defined(_M_IA64) || defined(_M_AMD64)
# define BOOST_INTERLOCKED_COMPARE_EXCHANGE_POINTER ::boost::detail::InterlockedCompareExchangePointer
# define BOOST_INTERLOCKED_EXCHANGE_POINTER ::boost::detail::InterlockedExchangePointer
# else
# define BOOST_INTERLOCKED_COMPARE_EXCHANGE_POINTER(dest,exchange,compare) \
((void*)BOOST_INTERLOCKED_COMPARE_EXCHANGE((long volatile*)(dest),(long)(exchange),(long)(compare)))
# define BOOST_INTERLOCKED_EXCHANGE_POINTER(dest,exchange) \
((void*)BOOST_INTERLOCKED_EXCHANGE((long volatile*)(dest),(long)(exchange)))
# endif
#else
# error "Interlocked intrinsics not available"
#endif
#endif // #ifndef BOOST_DETAIL_INTERLOCKED_HPP_INCLUDED
src/boost/geometry/algorithms/detail/overlay/check_enrich.hpp view on Meta::CPAN
130131132133134135136137138139140141142143144145146147148149150
{
meta_turns.push_back(meta_turn<turn_point_type>(
index
,
*it
));
}
int
cycle = 0;
for
(typename boost::range_iterator<std::vector<meta_turn<turn_point_type> > > ::type
it = boost::begin(meta_turns);
it != boost::end(meta_turns);
++it)
{
if
(! (it->turn->blocked() || it->turn->is_discarded()))
{
for
(
int
i = 0 ; i < 2; i++)
{
if
(! it->handled[i]
&& it->turn->operations[i].operation == for_operation)
{
#ifdef BOOST_GEOMETRY_DEBUG_ENRICH
std::cout <<
"CYCLE "
<< cycle << std::endl;
#endif
it->handled[i] = true;
src/boost/geometry/algorithms/detail/overlay/debug_turn_info.hpp view on Meta::CPAN
343536373839404142434445464748495051525354}
inline char operation_char(detail::overlay::operation_type const& operation)
{
using namespace detail::overlay;
switch(operation)
{
case operation_none :
return
'-'
;
case operation_union :
return
'u'
;
case operation_intersection :
return
'i'
;
case operation_blocked :
return
'x'
;
case operation_continue :
return
'c'
;
case operation_opposite :
return
'o'
;
default
:
return
'?'
;
}
}
inline char visited_char(detail::overlay::visit_info const& v)
{
if
(v.rejected())
return
'R'
;
if
(v.started())
return
's'
;
src/boost/geometry/algorithms/detail/overlay/enrich_intersection_points.hpp view on Meta::CPAN
378379380381382383384385386387388389390391392393394395396397398399400{
// Add operations on this ring, but skip discarded ones
if
(! it->discarded)
{
int
op_index = 0;
for
(typename boost::range_iterator<container_type const>::type
op_it = boost::begin(it->operations);
op_it != boost::end(it->operations);
++op_it, ++op_index)
{
// We should NOT skip blocked operations here
// because they can be relevant
for
"the other side"
// NOT
if
(op_it->operation != operation_blocked)
ring_identifier ring_id
(
op_it->seg_id.source_index,
op_it->seg_id.multi_index,
op_it->seg_id.ring_index
);
mapped_vector[ring_id].push_back
(
IndexedType(
index
, op_index,
*op_it
)
src/boost/geometry/algorithms/detail/overlay/follow.hpp view on Meta::CPAN
29303132333435363738394041424344454647484950515253#ifndef DOXYGEN_NO_DETAIL
namespace detail { namespace overlay
{
namespace following
{
template <typename Turn, typename Operation>
static inline bool is_entering(Turn const& /* TODO remove this parameter */, Operation const& op)
{
// (Blocked means: blocked
for
polygon/polygon intersection, because
// they are reversed. But
for
polygon/line it is similar to
continue
)
return
op.operation == operation_intersection
|| op.operation == operation_continue
|| op.operation == operation_blocked
;
}
template
<
typename Turn,
typename Operation,
typename LineString,
typename Polygon
>
src/boost/geometry/algorithms/detail/overlay/follow.hpp view on Meta::CPAN
270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301
typename LineString,
typename Polygon,
overlay_type OverlayType
>
class follow
{
template<typename Turn>
struct sort_on_segment
{
// In case of turn point at the same location, we want to have
continue
/blocked LAST
// because that should be followed (intersection) or skipped (difference).
inline
int
operation_order(Turn const& turn) const
{
operation_type const& operation = turn.operations[0].operation;
switch(operation)
{
case operation_opposite :
return
0;
case operation_none :
return
0;
case operation_union :
return
1;
case operation_intersection :
return
2;
case operation_blocked :
return
3;
case operation_continue :
return
4;
}
return
-1;
};
inline bool use_operation(Turn const& left, Turn const& right) const
{
// If they are the same, OK.
return
operation_order(left) < operation_order(right);
}
src/boost/geometry/algorithms/detail/overlay/get_turn_info.hpp view on Meta::CPAN
182183184185186187188189190191192193194195196197198199200201
both(ti, operation_continue);
}
else
{
// Opposite direction, which is never travelled.
// If Q turns left, P continues
for
intersection
// If Q turns right, P continues
for
union
ti.operations[Index].operation = side_qk_q == 1
? operation_intersection
: operation_union;
ti.operations[1 - Index].operation = operation_blocked;
}
}
else
{
// Should not occur!
ti.method = method_error;
}
}
};
src/boost/geometry/algorithms/detail/overlay/get_turn_info.hpp view on Meta::CPAN
210211212213214215216217218219220221222223224225226227228229230{
static inline bool between(
int
side1,
int
side2,
int
turn)
{
return
side1 == side2 && ! opposite(side1, turn);
}
/
*static
inline void block_second(bool block, TurnInfo& ti)
{
if
(block)
{
ti.operations[1].operation = operation_blocked;
}
}*/
template
<
typename Point1,
typename Point2,
typename IntersectionInfo,
typename DirInfo
src/boost/geometry/algorithms/detail/overlay/get_turn_info.hpp view on Meta::CPAN
276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349
return
;
}
int
const side_pk_q1 = SideStrategy::apply(qi, qj, pk);
// Collinear opposite case -> block P
// (
#BRL4, #BLR8)
if
(side_pk_q1 == 0)
{
ti.operations[0].operation = operation_blocked;
// Q turns right -> union (both independent),
// Q turns left -> intersection
ti.operations[1].operation = block_q ? operation_blocked
: q_turns_left ? operation_intersection
: operation_union;
return
;
}
// Pk between Qi and Qk
// (
#BRL3, #BRL7)
if
(between(side_pk_q1, side_pk_q2, side_qk_q))
{
ui_else_iu(q_turns_left, ti);
if
(block_q)
{
ti.operations[1].operation = operation_blocked;
}
//block_second(block_q, ti);
return
;
}
// Pk between Qk and P, so left of Qk (
if
Q turns right) and vv
// (
#BRL1)
if
(side_pk_q2 == -side_qk_q)
{
ui_else_iu(! q_turns_left, ti);
return
;
}
//
// (
#BRL5, #BRL9)
if
(side_pk_q1 == -side_qk_q)
{
uu_else_ii(! q_turns_left, ti);
if
(block_q)
{
ti.operations[1].operation = operation_blocked;
}
//block_second(block_q, ti);
return
;
}
}
else
{
// Pk at other side than Qi/Pk
int
const side_qk_q = SideStrategy::apply(qi, qj, qk);
bool const q_turns_left = side_qk_q == 1;
ti.operations[0].operation = q_turns_left
? operation_intersection
: operation_union;
ti.operations[1].operation = block_q
? operation_blocked
: side_qi_p1 == 1 || side_qk_p1 == 1
? operation_union
: operation_intersection;
return
;
}
}
else
{
// From left to right or from right to left
src/boost/geometry/algorithms/detail/overlay/get_turn_info.hpp view on Meta::CPAN
351352353354355356357358359360361362363364365366367368369370371bool const right_to_left = side_qk_p1 == 1;
// If p turns into direction of qi (1,2)
if
(side_pk_p == side_qi_p1)
{
int
const side_pk_q1 = SideStrategy::apply(qi, qj, pk);
// Collinear opposite case -> block P
if
(side_pk_q1 == 0)
{
ti.operations[0].operation = operation_blocked;
ti.operations[1].operation = right_to_left
? operation_union : operation_intersection;
return
;
}
if
(side_pk_q1 == side_qk_p1)
{
uu_else_ii(right_to_left, ti);
return
;
}
src/boost/geometry/algorithms/detail/overlay/get_turn_info.hpp view on Meta::CPAN
674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725
template
<
int
Index,
typename Point,
typename IntersectionInfo
>
static inline bool set_tp(Point const& ri, Point const& rj, Point const& rk,
TurnInfo& tp, IntersectionInfo const& intersection_info)
{
int
const side_rk_r = SideStrategy::apply(ri, rj, rk);
operation_type blocked = operation_blocked;
switch(side_rk_r)
{
case 1 :
// Turning left on opposite collinear: intersection
tp.operations[Index].operation = operation_intersection;
break;
case -1 :
// Turning right on opposite collinear: union
tp.operations[Index].operation = operation_union;
break;
case 0 :
// No turn on opposite collinear: block,
do
not traverse
// But this
"xx"
is usually ignored, it is useless to include
// two operations blocked, so the whole point does not need
// to be generated.
// So
return
false to indicate nothing is to be done.
if
(AssignPolicy::include_opposite)
{
tp.operations[Index].operation = operation_opposite;
blocked = operation_opposite;
}
else
{
return
false;
}
break;
}
// The other direction is always blocked
when
collinear opposite
tp.operations[1 - Index].operation = blocked;
// If P arrives within Q, set info on P (which is done above,
index
=0),
// this turn-info belongs to the second intersection point,
index
=1
// (see e.g. figure CLO1)
geometry::convert(intersection_info.intersections[1 - Index], tp.point);
return
true;
}
public:
template
src/boost/geometry/algorithms/detail/overlay/handle_tangencies.hpp view on Meta::CPAN
162163164165166167168169170171172173174175176177178179180181182183184185186187188189
// ux/ux
inline bool consider_ux_ux(Indexed const& left,
Indexed const& right
, std::string const& // header
) const
{
bool ret = left.
index
< right.
index
;
// In combination of u/x, x/u: take first union, then blocked.
// Solves
#88, #61, #56, #80
if
(left.subject.operation == operation_union
&& right.subject.operation == operation_blocked)
{
ret = true;
}
else
if
(left.subject.operation == operation_blocked
&& right.subject.operation == operation_union)
{
ret = false;
}
else
{
#ifdef BOOST_GEOMETRY_DEBUG_ENRICH
std::cout <<
"ux/ux unhandled"
<< std::endl;
#endif
}
src/boost/geometry/algorithms/detail/overlay/handle_tangencies.hpp view on Meta::CPAN
200201202203204205206207208209210211212213214215216217218219220221222223224225
) const
{
bool ret = false;
if
(left.subject.operation == operation_union
&& right.subject.operation == operation_union)
{
ret = order == 1;
}
else
if
(left.subject.operation == operation_union
&& right.subject.operation == operation_blocked)
{
ret = true;
}
else
if
(right.subject.operation == operation_union
&& left.subject.operation == operation_blocked)
{
ret = false;
}
else
if
(left.subject.operation == operation_union)
{
ret = true;
}
else
if
(right.subject.operation == operation_union)
{
ret = false;
src/boost/geometry/algorithms/detail/overlay/handle_tangencies.hpp view on Meta::CPAN
249250251252253254255256257258259260261262263264265266267268269270271272273274275
&& right.subject.operation == operation_intersection ? order == 1
: left.subject.operation == operation_intersection ? false
: right.subject.operation == operation_intersection ? true
: order == 1;
}
inline bool consider_ix_ix(Indexed const& left, Indexed const& right
, std::string const& // header
) const
{
// Take first intersection, then blocked.
if
(left.subject.operation == operation_intersection
&& right.subject.operation == operation_blocked)
{
return
true;
}
else
if
(left.subject.operation == operation_blocked
&& right.subject.operation == operation_intersection)
{
return
false;
}
// Default case, should not occur
#ifdef BOOST_GEOMETRY_DEBUG_ENRICH
std::cout <<
"ix/ix unhandled"
<< std::endl;
#endif
src/boost/geometry/algorithms/detail/overlay/handle_tangencies.hpp view on Meta::CPAN
446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511{
// Be careful to
sort
discarded first, then all others
return
true;
}
else
if
(m_turn_points[right.
index
].discarded || right.discarded)
{
// See above so
return
false here such that right (discarded)
// is sorted
before
left (not discarded)
return
false;
}
else
if
(m_turn_points[left.
index
].combination(operation_blocked, operation_union)
&& m_turn_points[right.
index
].combination(operation_blocked, operation_union))
{
// ux/ux
return
consider_ux_ux(left, right,
"ux/ux"
);
}
else
if
(m_turn_points[left.
index
].both(operation_union)
&& m_turn_points[right.
index
].both(operation_union))
{
// uu/uu, Order is arbitrary
// Note: uu/uu is discarded now
before
so this point will
// not be reached.
return
default_order;
}
else
if
(m_turn_points[left.
index
].combination(operation_intersection, operation_union)
&& m_turn_points[right.
index
].combination(operation_intersection, operation_union))
{
return
consider_iu_iu(left, right,
"iu/iu"
);
}
else
if
(m_turn_points[left.
index
].combination(operation_intersection, operation_blocked)
&& m_turn_points[right.
index
].combination(operation_intersection, operation_blocked))
{
return
consider_ix_ix(left, right,
"ix/ix"
);
}
else
if
(m_turn_points[left.
index
].both(operation_intersection)
&& m_turn_points[right.
index
].both(operation_intersection))
{
return
consider_ii(left, right,
"ii/ii"
);
}
else
if
(m_turn_points[left.
index
].combination(operation_union, operation_blocked)
&& m_turn_points[right.
index
].combination(operation_intersection, operation_union))
{
return
consider_iu_ux(left, right, -1,
"ux/iu"
);
}
else
if
(m_turn_points[left.
index
].combination(operation_intersection, operation_union)
&& m_turn_points[right.
index
].combination(operation_union, operation_blocked))
{
return
consider_iu_ux(left, right, 1,
"iu/ux"
);
}
else
if
(m_turn_points[left.
index
].combination(operation_intersection, operation_blocked)
&& m_turn_points[right.
index
].combination(operation_intersection, operation_union))
{
return
consider_iu_ix(left, right, 1,
"ix/iu"
);
}
else
if
(m_turn_points[left.
index
].combination(operation_intersection, operation_union)
&& m_turn_points[right.
index
].combination(operation_intersection, operation_blocked))
{
return
consider_iu_ix(left, right, -1,
"iu/ix"
);
}
else
if
(m_turn_points[left.
index
].method != method_equal
&& m_turn_points[right.
index
].method == method_equal
)
{
// If one of them was EQUAL or CONTINUES, it should always come first
return
false;
}
src/boost/geometry/algorithms/detail/overlay/overlay.hpp view on Meta::CPAN
474849505152535455565758596061626364656667#ifndef DOXYGEN_NO_DETAIL
namespace detail { namespace overlay
{
// Skip
for
assemble process
template <typename TurnInfo>
inline bool skip(TurnInfo const& turn_info)
{
return
(turn_info.discarded || turn_info.both(operation_union))
&& ! turn_info.any_blocked()
&& ! turn_info.both(operation_intersection)
;
}
template <typename TurnPoints, typename Map>
inline void map_turns(Map&
map
, TurnPoints const& turn_points)
{
typedef typename boost::range_value<TurnPoints>::type turn_point_type;
typedef typename turn_point_type::container_type container_type;
src/boost/geometry/algorithms/detail/overlay/traverse.hpp view on Meta::CPAN
255256257258259260261262263264265266267268269270271272273274275do
{
state.
reset
();
// Iterate through all unvisited points
for
(turn_iterator it = boost::begin(turns);
state.good() && it != boost::end(turns);
++it)
{
// Skip discarded ones
if
(! (it->is_discarded() || it->blocked()))
{
for
(turn_operation_iterator_type iit = boost::begin(it->operations);
state.good() && iit != boost::end(it->operations);
++iit)
{
if
(iit->visited.none()
&& ! iit->visited.rejected()
&& (iit->operation == operation
|| iit->operation == detail::overlay::operation_continue)
)
src/boost/geometry/algorithms/detail/overlay/turn_info.hpp view on Meta::CPAN
202122232425262728293031323334353637383940#ifndef DOXYGEN_NO_DETAIL
namespace detail { namespace overlay
{
enum operation_type
{
operation_none,
operation_union,
operation_intersection,
operation_blocked,
operation_continue,
operation_opposite
};
enum method_type
{
method_none,
method_disjoint,
method_crosses,
src/boost/geometry/algorithms/detail/overlay/turn_info.hpp view on Meta::CPAN
110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
|| this->operations[1].operation == type;
}
inline bool combination(operation_type type1, operation_type type2) const
{
return
has12(type1, type2) || has12(type2, type1);
}
inline bool is_discarded() const {
return
discarded; }
inline bool blocked() const
{
return
both(operation_blocked);
}
inline bool opposite() const
{
return
both(operation_opposite);
}
inline bool any_blocked() const
{
return
has
(operation_blocked);
}
private :
inline bool has12(operation_type type1, operation_type type2) const
{
return
this->operations[0].operation == type1
&& this->operations[1].operation == type2
;
}
src/boost/geometry/algorithms/touches.hpp view on Meta::CPAN
28293031323334353637383940414243444546474849namespace boost { namespace geometry
{
namespace detail { namespace touches
{
template <typename Turn>
inline bool ok_for_touch(Turn const& turn)
{
return
turn.both(detail::overlay::operation_union)
|| turn.both(detail::overlay::operation_blocked)
|| turn.combination(detail::overlay::operation_union, detail::overlay::operation_blocked)
;
}
template <typename Turns>
inline bool has_only_turns(Turns const& turns)
{
bool has_touch = false;
typedef typename boost::range_iterator<Turns const>::type iterator_type;
for
(iterator_type it = boost::begin(turns); it != boost::end(turns); ++it)
{
src/boost/lexical_cast.hpp view on Meta::CPAN
141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441
// String representation of Source
has
an upper limit.
template< class CharT // a result of widest_char transformation
, class Traits // usually char_traits<CharT>
, bool RequiresStringbuffer
>
class lexical_stream_limited_src
{
#if defined(BOOST_NO_STRINGSTREAM)
typedef std::ostrstream out_stream_t;
typedef stl_buf_unlocker<std::strstreambuf, char> unlocked_but_t;
#elif defined(BOOST_NO_STD_LOCALE)
typedef std::ostringstream out_stream_t;
typedef stl_buf_unlocker<std::stringbuf, char> unlocked_but_t;
#else
typedef std::basic_ostringstream<CharT, Traits> out_stream_t;
typedef stl_buf_unlocker<std::basic_stringbuf<CharT, Traits>, CharT> unlocked_but_t;
#endif
typedef BOOST_DEDUCED_TYPENAME boost::mpl::if_c<
RequiresStringbuffer,
out_stream_t,
do_not_construct_out_stream_t
>::type deduced_out_stream_t;
// A string representation of Source is written to [start, finish).
CharT* start;
CharT* finish;
src/boost/lexical_cast.hpp view on Meta::CPAN
1504150515061507150815091510151115121513151415151516151715181519152015211522152315241525
template<typename InputStreamable>
bool shl_input_streamable(InputStreamable& input)
{
#if defined(BOOST_NO_STRINGSTREAM) || defined(BOOST_NO_STD_LOCALE)
// If you have compilation error at this point, than your STL library
// does not support such conversions. Try updating it.
BOOST_STATIC_ASSERT((boost::is_same<char, CharT>::value));
#endif
bool const result = !(out_stream << input).fail();
const unlocked_but_t* const p
= static_cast<unlocked_but_t*>(out_stream.rdbuf()) ;
start = p->pbase();
finish = p->pptr();
return
result;
}
template <class T>
inline bool shl_signed(T n)
{
start = lcast_put_unsigned<Traits>(lcast_to_unsigned(n), finish);
if
(n < 0)
src/boost/lexical_cast.hpp view on Meta::CPAN
187218731874187518761877187818791880188118821883188418851886188718881889189018911892
BOOST_STATIC_ASSERT((boost::is_same<char, CharT>::value));
#endif
#if defined(BOOST_NO_STRINGSTREAM)
std::istrstream stream(start, finish - start);
#elif defined(BOOST_NO_STD_LOCALE)
std::istringstream stream;
#else
std::basic_istringstream<CharT, Traits> stream;
#endif
static_cast<unlocked_but_t*>(stream.rdbuf())
->setg(start, start, finish);
stream.unsetf(std::ios::skipws);
lcast_set_precision(stream, static_cast<InputStreamable*>(0));
#if (defined _MSC_VER)
# pragma warning( pop )
#endif
return
stream >> output &&
stream.get() ==
#if defined(__GNUC__) && (__GNUC__<3) && defined(BOOST_NO_STD_WSTRING)
src/boost/serialization/singleton.hpp view on Meta::CPAN
676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108// turns out to be necessary and sufficient to implement the tables
// used by serialization library.
// Second, it provides a mechanism to detect
when
a non-const function
// is called
after
initialization.
// make a singleton to
lock
/unlock all singletons
for
alteration.
// The intent is that all singletons created/used by this code
// are to be initialized
before
main is called. A test program
// can
lock
all the singletons
when
main is entereed. This any
// attempt to retieve a mutable instances
while
locked will
// generate a assertion
if
compiled
for
debug.
class singleton_module :
public boost::noncopyable
{
private:
static bool & get_lock(){
static bool
lock
= false;
return
lock
;
}
public:
// static const void * get_module_handle(){
//
return
static_cast<const void *>(get_module_handle);
// }
static void
lock
(){
get_lock() = true;
}
static void unlock(){
get_lock() = false;
}
static bool is_locked() {
return
get_lock();
}
};
namespace detail {
template<class T>
class singleton_wrapper : public T
{
public:
src/boost/serialization/singleton.hpp view on Meta::CPAN
127128129130131132133134135136137138139140141142143144145146
BOOST_DLLEXPORT static T & get_instance() {
static detail::singleton_wrapper< T > t;
// refer to instance, causing it to be instantiated (and
// initialized at startup on working compilers)
BOOST_ASSERT(! detail::singleton_wrapper< T >::m_is_destroyed);
use
(instance);
return
static_cast<T &>(t);
}
public:
BOOST_DLLEXPORT static T & get_mutable_instance(){
BOOST_ASSERT(! is_locked());
return
get_instance();
}
BOOST_DLLEXPORT static const T & get_const_instance(){
return
get_instance();
}
BOOST_DLLEXPORT static bool is_destroyed(){
return
detail::singleton_wrapper< T >::m_is_destroyed;
}
};
src/boost/smart_ptr/detail/atomic_count_win32.hpp view on Meta::CPAN
101112131415161718192021222324252627282930//
// boost/detail/atomic_count_win32.hpp
//
// Copyright (c) 2001-2005 Peter Dimov
//
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
//
#include <boost/detail/interlocked.hpp>
namespace boost
{
namespace detail
{
class atomic_count
{
public:
src/boost/smart_ptr/detail/sp_counted_base_w32.hpp view on Meta::CPAN
171819202122232425262728293031323334353637// accompanying file LICENSE_1_0.txt or copy at
//
//
// Lock-free algorithm by Alexander Terekhov
//
// Thanks to Ben Hitchings
for
the
#weak + (#shared != 0)
// formulation
//
#include <boost/detail/interlocked.hpp>
#include <boost/detail/workaround.hpp>
#include <boost/detail/sp_typeinfo.hpp>
namespace boost
{
namespace detail
{
class sp_counted_base
src/boost/smart_ptr/detail/spinlock_nt.hpp view on Meta::CPAN
20212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465namespace boost
{
namespace detail
{
class spinlock
{
public:
bool locked_;
public:
inline bool try_lock()
{
if
( locked_ )
{
return
false;
}
else
{
locked_ = true;
return
true;
}
}
inline void
lock
()
{
BOOST_ASSERT( !locked_ );
locked_ = true;
}
inline void unlock()
{
BOOST_ASSERT( locked_ );
locked_ = false;
}
public:
class scoped_lock
{
private:
spinlock & sp_;
src/boost/smart_ptr/detail/spinlock_w32.hpp view on Meta::CPAN
89101112131415161718192021222324252627#endif
//
// Copyright (c) 2008 Peter Dimov
//
// Distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE_1_0.txt or copy at
//
#include <boost/detail/interlocked.hpp>
#include <boost/smart_ptr/detail/yield_k.hpp>
// BOOST_COMPILER_FENCE
#if defined(__INTEL_COMPILER)
#define BOOST_COMPILER_FENCE __memory_barrier();
#elif defined( _MSC_VER ) && _MSC_VER >= 1310