File indexing completed on 2025-01-18 09:35:37
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
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
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
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
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 }
0083 }}}
0084
0085 #endif