BWAPI
Classes | Namespaces | Defines | Enumerations
SPAR/AIModule/BWTA/vendors/CGAL/CGAL/Coercion_traits.h File Reference
#include <CGAL/number_type_basic.h>
#include <iterator>
#include <boost/iterator/transform_iterator.hpp>
#include <boost/type_traits/is_same.hpp>
Include dependency graph for Coercion_traits.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  INTERN_CT::Cast_from_to< FROM, TO >
struct  INTERN_CT::Cast_from_to< TO, TO >
struct  Coercion_traits< A, A >
 Specialization for equal types. More...
struct  Coercion_traits< A, A >::Cast
struct  Coercion_traits_for_level< A, B, i >
struct  Coercion_traits_for_level< A, B, 0 >
struct  Coercion_traits< A, B >

Namespaces

namespace  INTERN_CT

Defines

#define CGAL_IMPLICIT_INTEROPERABLE_BINARY_OPERATOR_WITH_RT(NT, Result_type)
#define CGAL_IMPLICIT_INTEROPERABLE_BINARY_OPERATOR(NT)   CGAL_IMPLICIT_INTEROPERABLE_BINARY_OPERATOR_WITH_RT( NT, NT )
#define CGAL_DEFINE_COERCION_TRAITS_FROM_TO(FROM, TO)
#define CGAL_DEFINE_COERCION_TRAITS_FROM_TO_TEM(FROM, TO, TEM)
#define CGAL_DEFINE_COERCION_TRAITS_FOR_SELF(A)
#define CGAL_DEFINE_COERCION_TRAITS_FOR_SELF_TEM(A, TEM)

Enumerations

enum  COERCION_TRAITS_LEVEL {
  CTL_TOP = 4, CTL_POLYNOMIAL = 4, CTL_COMPLEX = 3, CTL_INTERVAL = 2,
  CTL_SQRT_EXT = 1
}

Define Documentation

Value:
template <>                                                         \
    struct Coercion_traits< A , A >{                                    \
        typedef Tag_true  Are_explicit_interoperable;                   \
        typedef Tag_true  Are_implicit_interoperable;                   \
        typedef A Type;                                        \
        struct Cast{                                                    \
            typedef Type result_type;                          \
            Type operator()(const A& x) const { return x;}     \
        };                                                              \
    };
#define CGAL_DEFINE_COERCION_TRAITS_FOR_SELF_TEM (   A,
  TEM 
)
Value:
template <TEM>                                                      \
    struct Coercion_traits< A , A >{                                    \
        typedef Tag_true  Are_explicit_interoperable;                   \
        typedef Tag_true  Are_implicit_interoperable;                   \
        typedef A Type;                                        \
        struct Cast{                                                    \
            typedef Type result_type;                          \
            Type operator()(const A& x) const {return x;}      \
        };                                                              \
    };
#define CGAL_DEFINE_COERCION_TRAITS_FROM_TO (   FROM,
  TO 
)
Value:
template <>                                                         \
    struct Coercion_traits< FROM , TO >{                                \
        typedef Tag_true  Are_explicit_interoperable;                   \
        typedef Tag_true  Are_implicit_interoperable;                   \
        typedef TO Type;                                       \
        struct Cast{                                                    \
            typedef Type result_type;                          \
            Type operator()(const TO& x)   const { return x;}  \
            Type operator()(const FROM& x) const {             \
                return Type(x);}                               \
        };                                                              \
    };                                                                  \
    template <>                                                         \
    struct Coercion_traits< TO , FROM >{                                \
        typedef Tag_true  Are_explicit_interoperable;                   \
        typedef Tag_true  Are_implicit_interoperable;                   \
        typedef TO Type;                                       \
        struct Cast{                                                    \
            typedef Type result_type;                          \
            Type operator()(const TO& x)   const { return x;}  \
            Type operator()(const FROM& x) const {             \
                return Type(x);}                               \
        };                                                              \
    };
#define CGAL_DEFINE_COERCION_TRAITS_FROM_TO_TEM (   FROM,
  TO,
  TEM 
)
Value:
template <TEM>                                                      \
    struct Coercion_traits< FROM , TO >{                                \
        typedef Tag_true  Are_explicit_interoperable;                   \
        typedef Tag_true  Are_implicit_interoperable;                   \
        typedef TO Type;                                       \
        struct Cast{                                                    \
            typedef Type result_type;                          \
            Type operator()(const TO& x)   const { return x;}  \
            Type operator()(const FROM& x) const {             \
                return Type(x);}                               \
        };                                                              \
    };                                                                  \
    template <TEM>                                                      \
    struct Coercion_traits< TO , FROM >{                                \
        typedef Tag_true  Are_explicit_interoperable;                   \
        typedef Tag_true  Are_implicit_interoperable;                   \
        typedef TO Type;                                       \
        struct Cast{                                                    \
            typedef Type result_type;                          \
            Type operator()(const TO& x)   const { return x;}  \
            Type operator()(const FROM& x) const {             \
                return Type(x);}                               \
        };                                                              \
    };
#define CGAL_IMPLICIT_INTEROPERABLE_BINARY_OPERATOR_WITH_RT (   NT,
  Result_type 
)
Value:
template < class CT_Type_1, class CT_Type_2 >                         \
  Result_type operator()( const CT_Type_1& x, const CT_Type_2& y ) const { \
    BOOST_STATIC_ASSERT((::boost::is_same<                              \
            typename Coercion_traits< CT_Type_1, CT_Type_2 >::Type, NT  \
            >::value));                                                 \
                                                                        \
    typename Coercion_traits< CT_Type_1, CT_Type_2 >::Cast cast;        \
    return operator()( cast(x), cast(y) );                              \
  }

Enumeration Type Documentation

Enumerator:
CTL_TOP 
CTL_POLYNOMIAL 
CTL_COMPLEX 
CTL_INTERVAL 
CTL_SQRT_EXT 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines