Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:36:44

0001 // Boost.Geometry (aka GGL, Generic Geometry Library)
0002 
0003 // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
0004 // Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
0005 // Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
0006 // Copyright (c) 2017 Adam Wulkiewicz, Lodz, Poland.
0007 
0008 // This file was modified by Oracle on 2018.
0009 // Modifications copyright (c) 2018 Oracle and/or its affiliates.
0010 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
0011 
0012 // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
0013 // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
0014 
0015 // Use, modification and distribution is subject to the Boost Software License,
0016 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
0017 // http://www.boost.org/LICENSE_1_0.txt)
0018 
0019 #ifndef BOOST_GEOMETRY_STRATEGIES_CONCEPTS_AREA_CONCEPT_HPP
0020 #define BOOST_GEOMETRY_STRATEGIES_CONCEPTS_AREA_CONCEPT_HPP
0021 
0022 
0023 #include <boost/concept_check.hpp>
0024 #include <boost/core/ignore_unused.hpp>
0025 
0026 #include <boost/geometry/geometries/point.hpp>
0027 
0028 
0029 namespace boost { namespace geometry { namespace concepts
0030 {
0031 
0032 
0033 /*!
0034     \brief Checks strategy for area
0035     \ingroup area
0036 */
0037 template <typename Geometry, typename Strategy>
0038 class AreaStrategy
0039 {
0040 #ifndef DOXYGEN_NO_CONCEPT_MEMBERS
0041 
0042     // 1) must define state template,
0043     typedef typename Strategy::template state<Geometry> state_type;
0044 
0045     // 2) must define result_type template,
0046     typedef typename Strategy::template result_type<Geometry>::type return_type;
0047 
0048     struct check_methods
0049     {
0050         static void apply()
0051         {
0052             Strategy const* str = 0;
0053             state_type *st = 0;
0054 
0055             // 3) must implement a method apply with the following signature
0056             typename geometry::point_type<Geometry>::type const* sp = 0;
0057             str->apply(*sp, *sp, *st);
0058 
0059             // 4) must implement a static method result with the following signature
0060             return_type r = str->result(*st);
0061 
0062             boost::ignore_unused(r, str);
0063         }
0064     };
0065 
0066 public :
0067     BOOST_CONCEPT_USAGE(AreaStrategy)
0068     {
0069         check_methods::apply();
0070     }
0071 
0072 #endif
0073 };
0074 
0075 
0076 }}} // namespace boost::geometry::concepts
0077 
0078 
0079 #endif // BOOST_GEOMETRY_STRATEGIES_CONCEPTS_AREA_CONCEPT_HPP