not_implemented.hpp 3.7 KB

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