From dbbcf4c1ff9582eea18d0da7956fab5bd7b32290 Mon Sep 17 00:00:00 2001 From: Menelaos Karavelas Date: Wed, 18 Jun 2014 14:04:50 +0300 Subject: [PATCH] [algorithms][is_simple] implement the new directory/file structure --- .../detail/is_simple/implementation.hpp | 18 +++++ .../algorithms/detail/is_simple/interface.hpp | 71 +++++++++++++++++++ .../boost/geometry/algorithms/is_simple.hpp | 63 +--------------- 3 files changed, 91 insertions(+), 61 deletions(-) create mode 100644 include/boost/geometry/algorithms/detail/is_simple/implementation.hpp create mode 100644 include/boost/geometry/algorithms/detail/is_simple/interface.hpp diff --git a/include/boost/geometry/algorithms/detail/is_simple/implementation.hpp b/include/boost/geometry/algorithms/detail/is_simple/implementation.hpp new file mode 100644 index 000000000..e69b273ce --- /dev/null +++ b/include/boost/geometry/algorithms/detail/is_simple/implementation.hpp @@ -0,0 +1,18 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) + +// Copyright (c) 2014, Oracle and/or its affiliates. + +// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle + +// Licensed under the Boost Software License version 1.0. +// http://www.boost.org/users/license.html + +#ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_IS_SIMPLE_IMPLEMENTATION_HPP +#define BOOST_GEOMETRY_ALGORITHMS_DETAIL_IS_SIMPLE_IMPLEMENTATION_HPP + +#include +#include +#include +#include + +#endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_IS_SIMPLE_IMPLEMENTATION_HPP diff --git a/include/boost/geometry/algorithms/detail/is_simple/interface.hpp b/include/boost/geometry/algorithms/detail/is_simple/interface.hpp new file mode 100644 index 000000000..739b8ead5 --- /dev/null +++ b/include/boost/geometry/algorithms/detail/is_simple/interface.hpp @@ -0,0 +1,71 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) + +// Copyright (c) 2014, Oracle and/or its affiliates. + +// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle + +// Licensed under the Boost Software License version 1.0. +// http://www.boost.org/users/license.html + +#ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_IS_SIMPLE_INTERFACE_HPP +#define BOOST_GEOMETRY_ALGORITHMS_DETAIL_IS_SIMPLE_INTERFACE_HPP + +#include +#include +#include + +#include + +#include + + +namespace boost { namespace geometry +{ + + +namespace resolve_variant { + +template +struct is_simple +{ + static inline bool apply(Geometry const& geometry) + { + concept::check(); + return dispatch::is_simple::apply(geometry); + } +}; + +template +struct is_simple > +{ + struct visitor : boost::static_visitor + { + template + bool operator()(Geometry const& geometry) const + { + return is_simple::apply(geometry); + } + }; + + static inline bool + apply(boost::variant const& geometry) + { + return boost::apply_visitor(visitor(), geometry); + } +}; + +} // namespace resolve_variant + + + +template +inline bool is_simple(Geometry const& g) +{ + return resolve_variant::is_simple::apply(g); +} + + +}} // namespace boost::geometry + + +#endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_IS_SIMPLE_INTERFACE_HPP diff --git a/include/boost/geometry/algorithms/is_simple.hpp b/include/boost/geometry/algorithms/is_simple.hpp index ad3f48e5b..f48c957df 100644 --- a/include/boost/geometry/algorithms/is_simple.hpp +++ b/include/boost/geometry/algorithms/is_simple.hpp @@ -10,66 +10,7 @@ #ifndef BOOST_GEOMETRY_ALGORITHMS_IS_SIMPLE_HPP #define BOOST_GEOMETRY_ALGORITHMS_IS_SIMPLE_HPP -#include -#include -#include - -#include -#include -#include -#include - -#include - - -namespace boost { namespace geometry -{ - - -namespace resolve_variant { - -template -struct is_simple -{ - static inline bool apply(Geometry const& geometry) - { - concept::check(); - return dispatch::is_simple::apply(geometry); - } -}; - -template -struct is_simple > -{ - struct visitor : boost::static_visitor - { - template - bool operator()(Geometry const& geometry) const - { - return is_simple::apply(geometry); - } - }; - - static inline bool - apply(boost::variant const& geometry) - { - return boost::apply_visitor(visitor(), geometry); - } -}; - -} // namespace resolve_variant - - - -template -inline bool is_simple(Geometry const& g) -{ - return resolve_variant::is_simple::apply(g); -} - - -}} // namespace boost::geometry - - +#include +#include #endif // BOOST_GEOMETRY_ALGORITHMS_IS_SIMPLE_HPP