Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:35:37

0001 // Boost.Geometry (aka GGL, Generic Geometry Library)
0002 
0003 // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
0004 
0005 // This file was modified by Oracle on 2017, 2018, 2019.
0006 // Modifications copyright (c) 2017-2019, Oracle and/or its affiliates.
0007 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
0008 
0009 // Use, modification and distribution is subject to the Boost Software License,
0010 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
0011 // http://www.boost.org/LICENSE_1_0.txt)
0012 
0013 #ifndef BOOST_GEOMETRY_PROJECTIONS_IMPL_FACTORY_ENTRY_HPP
0014 #define BOOST_GEOMETRY_PROJECTIONS_IMPL_FACTORY_ENTRY_HPP
0015 
0016 #include <string>
0017 
0018 #include <boost/geometry/srs/projections/impl/base_dynamic.hpp>
0019 
0020 namespace boost { namespace geometry { namespace projections
0021 {
0022 
0023 namespace detail
0024 {
0025 
0026 // forward declaration needed by some projections
0027 template <typename Params, typename CT, typename Parameters>
0028 class factory;
0029 
0030 template <typename Params, typename CT, typename Parameters>
0031 struct factory_entry
0032 {
0033     virtual ~factory_entry() {}
0034     virtual dynamic_wrapper_b<CT, Parameters>* create_new(Params const& , Parameters const& ) const = 0;
0035 };
0036 
0037 // Macros for entries definition
0038 
0039 #define BOOST_GEOMETRY_PROJECTIONS_DETAIL_FACTORY_ENTRY_BEGIN(ENTRY) \
0040 template <typename Params, typename T, typename Parameters> \
0041 struct ENTRY : projections::detail::factory_entry<Params, T, Parameters> \
0042 { \
0043     projections::detail::dynamic_wrapper_b<T, Parameters>* create_new(Params const& params, \
0044                                                                       Parameters const& parameters) const
0045 
0046 #define BOOST_GEOMETRY_PROJECTIONS_DETAIL_FACTORY_ENTRY_END };
0047 
0048 #define BOOST_GEOMETRY_PROJECTIONS_DETAIL_FACTORY_ENTRY_F(ENTRY, PROJ) \
0049 BOOST_GEOMETRY_PROJECTIONS_DETAIL_FACTORY_ENTRY_BEGIN(ENTRY) \
0050 { \
0051     return new projections::detail::dynamic_wrapper_f<PROJ<T, Parameters>, T, Parameters>(params, parameters); \
0052 } \
0053 BOOST_GEOMETRY_PROJECTIONS_DETAIL_FACTORY_ENTRY_END
0054 
0055 #define BOOST_GEOMETRY_PROJECTIONS_DETAIL_FACTORY_ENTRY_FI(ENTRY, PROJ) \
0056 BOOST_GEOMETRY_PROJECTIONS_DETAIL_FACTORY_ENTRY_BEGIN(ENTRY) \
0057 { \
0058     return new projections::detail::dynamic_wrapper_fi<PROJ<T, Parameters>, T, Parameters>(params, parameters); \
0059 } \
0060 BOOST_GEOMETRY_PROJECTIONS_DETAIL_FACTORY_ENTRY_END
0061 
0062 #define BOOST_GEOMETRY_PROJECTIONS_DETAIL_FACTORY_ENTRY_FI2(ENTRY, PROJ_S, PROJ_E) \
0063 BOOST_GEOMETRY_PROJECTIONS_DETAIL_FACTORY_ENTRY_BEGIN(ENTRY) \
0064 { \
0065     if (parameters.es != 0.0) \
0066         return new projections::detail::dynamic_wrapper_fi<PROJ_E<T, Parameters>, T, Parameters>(params, parameters); \
0067     else \
0068         return new projections::detail::dynamic_wrapper_fi<PROJ_S<T, Parameters>, T, Parameters>(params, parameters); \
0069 } \
0070 BOOST_GEOMETRY_PROJECTIONS_DETAIL_FACTORY_ENTRY_END
0071 
0072 // Macros for factory initialization
0073 #define BOOST_GEOMETRY_PROJECTIONS_DETAIL_FACTORY_INIT_BEGIN(FUN_NAME) \
0074 template <typename Params, typename T, typename Parameters> \
0075 inline void FUN_NAME(projections::detail::factory<Params, T, Parameters>& factory)
0076 
0077 #define BOOST_GEOMETRY_PROJECTIONS_DETAIL_FACTORY_INIT_ENTRY(PROJ_NAME, ENTRY) \
0078     factory.add_to_factory(#PROJ_NAME, \
0079                            srs::dpar::proj_##PROJ_NAME, \
0080                            new ENTRY<Params, T, Parameters>);
0081 
0082 } // namespace detail
0083 }}} // namespace boost::geometry::projections
0084 
0085 #endif // BOOST_GEOMETRY_PROJECTIONS_IMPL_FACTORY_ENTRY_HPP