Boost-Geometry-Utils

 view release on metacpan or  search on metacpan

MANIFEST  view on Meta::CPAN

271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
src/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

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
#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

130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
    {
        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

34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
}
 
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

378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
{
    // 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

29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#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

270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
    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

182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
                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

210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
{
    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

276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
            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

351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
bool 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

674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
    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

162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
 
    // 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

200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
    ) 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

249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
                && 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

446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
{
    // 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

47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#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

255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
do
{
    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

20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#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

110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
            || 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

28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
namespace 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

1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
        // 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

1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
            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

1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
                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

67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
// 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

127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
    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

10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
//
//  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

17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
//  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

20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
namespace 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

8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#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



( run in 0.524 second using v1.01-cache-2.11-cpan-87723dcf8b7 )