not_implemented.hpp 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. // Boost.Geometry (aka GGL, Generic Geometry Library)
  2. // Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
  3. // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
  4. // Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
  5. // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
  6. // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
  7. // Use, modification and distribution is subject to the Boost Software License,
  8. // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  9. // http://www.boost.org/LICENSE_1_0.txt)
  10. #ifndef BOOST_GEOMETRY_ALGORITHMS_NOT_IMPLEMENTED_HPP
  11. #define BOOST_GEOMETRY_ALGORITHMS_NOT_IMPLEMENTED_HPP
  12. #include <boost/mpl/assert.hpp>
  13. #include <boost/geometry/core/tags.hpp>
  14. #include <boost/geometry/multi/core/tags.hpp>
  15. namespace boost { namespace geometry
  16. {
  17. namespace info
  18. {
  19. struct UNRECOGNIZED_GEOMETRY_TYPE {};
  20. struct POINT {};
  21. struct LINESTRING {};
  22. struct POLYGON {};
  23. struct RING {};
  24. struct BOX {};
  25. struct SEGMENT {};
  26. struct MULTI_POINT {};
  27. struct MULTI_LINESTRING {};
  28. struct MULTI_POLYGON {};
  29. struct GEOMETRY_COLLECTION {};
  30. template <size_t D> struct DIMENSION {};
  31. }
  32. namespace nyi
  33. {
  34. struct not_implemented_tag {};
  35. template
  36. <
  37. typename Term1,
  38. typename Term2,
  39. typename Term3
  40. >
  41. struct not_implemented_error
  42. {
  43. #ifndef BOOST_GEOMETRY_IMPLEMENTATION_STATUS_BUILD
  44. # define BOOST_GEOMETRY_IMPLEMENTATION_STATUS_BUILD false
  45. #endif
  46. BOOST_MPL_ASSERT_MSG
  47. (
  48. BOOST_GEOMETRY_IMPLEMENTATION_STATUS_BUILD,
  49. THIS_OPERATION_IS_NOT_OR_NOT_YET_IMPLEMENTED,
  50. (
  51. types<Term1, Term2, Term3>
  52. )
  53. );
  54. };
  55. template <typename Tag>
  56. struct tag_to_term
  57. {
  58. typedef Tag type;
  59. };
  60. template <> struct tag_to_term<geometry_not_recognized_tag> { typedef info::UNRECOGNIZED_GEOMETRY_TYPE type; };
  61. template <> struct tag_to_term<point_tag> { typedef info::POINT type; };
  62. template <> struct tag_to_term<linestring_tag> { typedef info::LINESTRING type; };
  63. template <> struct tag_to_term<polygon_tag> { typedef info::POLYGON type; };
  64. template <> struct tag_to_term<ring_tag> { typedef info::RING type; };
  65. template <> struct tag_to_term<box_tag> { typedef info::BOX type; };
  66. template <> struct tag_to_term<segment_tag> { typedef info::SEGMENT type; };
  67. template <> struct tag_to_term<multi_point_tag> { typedef info::MULTI_POINT type; };
  68. template <> struct tag_to_term<multi_linestring_tag> { typedef info::MULTI_LINESTRING type; };
  69. template <> struct tag_to_term<multi_polygon_tag> { typedef info::MULTI_POLYGON type; };
  70. template <> struct tag_to_term<geometry_collection_tag> { typedef info::GEOMETRY_COLLECTION type; };
  71. template <int D> struct tag_to_term<mpl::int_<D> > { typedef info::DIMENSION<D> type; };
  72. }
  73. template
  74. <
  75. typename Term1 = void,
  76. typename Term2 = void,
  77. typename Term3 = void
  78. >
  79. struct not_implemented
  80. : nyi::not_implemented_tag,
  81. nyi::not_implemented_error
  82. <
  83. typename mpl::identity<typename nyi::tag_to_term<Term1>::type>::type,
  84. typename mpl::identity<typename nyi::tag_to_term<Term2>::type>::type,
  85. typename mpl::identity<typename nyi::tag_to_term<Term3>::type>::type
  86. >
  87. {};
  88. }} // namespace boost::geometry
  89. #endif // BOOST_GEOMETRY_ALGORITHMS_NOT_IMPLEMENTED_HPP