1
// Generic Geometry Library
3
// Copyright Bruno Lalande 2008, 2009
4
// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. 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)
10
#ifndef GGL_CORE_CONCEPTS_BOX_CONCEPT_HPP
11
#define GGL_CORE_CONCEPTS_BOX_CONCEPT_HPP
14
#include <boost/concept_check.hpp>
17
#include <ggl/core/access.hpp>
18
#include <ggl/core/point_type.hpp>
22
namespace ggl { namespace concept {
26
\brief Checks box concept, using Boost Concept Check Library and metafunctions
33
typedef typename point_type<B>::type P;
35
/// Internal structure to check if access is OK for all dimensions
36
template <size_t C, size_t D, size_t N>
37
struct dimension_checker
42
ggl::set<C, D>(*b, ggl::get<C, D>(*b));
43
dimension_checker<C, D + 1, N>::check();
47
template <size_t C, size_t N>
48
struct dimension_checker<C, N, N>
50
static void check() {}
54
/// BCCL macro to check the Box concept
55
BOOST_CONCEPT_USAGE(Box)
57
static const size_t N = dimension<B>::value;
58
dimension_checker<min_corner, 0, N>::check();
59
dimension_checker<max_corner, 0, N>::check();
65
\brief Checks Box concept (const version)
67
\details The ConstBox concept check the same as the Box concept,
68
but does not check write access.
74
typedef typename point_type<B>::type P;
75
typedef typename coordinate_type<B>::type T;
77
/// Internal structure to check if access is OK for all dimensions
78
template <size_t C, size_t D, size_t N>
79
struct dimension_checker
84
T coord(ggl::get<C, D>(*b));
85
boost::ignore_unused_variable_warning(coord);
86
dimension_checker<C, D + 1, N>::check();
90
template <size_t C, size_t N>
91
struct dimension_checker<C, N, N>
93
static void check() {}
97
/// BCCL macro to check the ConstBox concept
98
BOOST_CONCEPT_USAGE(ConstBox)
100
static const size_t N = dimension<B>::value;
101
dimension_checker<min_corner, 0, N>::check();
102
dimension_checker<max_corner, 0, N>::check();
106
}} // namespace ggl::concept
109
#endif // GGL_CORE_CONCEPTS_BOX_CONCEPT_HPP