5 #ifndef AIKIDO_PLANNER_OMPL_BACKWARDCOMPATIBILITY_HPP_
6 #define AIKIDO_PLANNER_OMPL_BACKWARDCOMPATIBILITY_HPP_
8 #include <ompl/config.h>
12 #define OMPL_VERSION_AT_LEAST(x,y,z) \
13 (OMPL_MAJOR_VERSION > x || (OMPL_MAJOR_VERSION >= x && \
14 (OMPL_MINOR_VERSION > y || (OMPL_MINOR_VERSION >= y && \
15 OMPL_PATCH_VERSION >= z))))
17 #define OMPL_MAJOR_MINOR_VERSION_AT_LEAST(x,y) \
18 (OMPL_MAJOR_VERSION > x || (OMPL_MAJOR_VERSION >= x && \
19 (OMPL_MINOR_VERSION > y || (OMPL_MINOR_VERSION >= y))))
21 #define OMPL_VERSION_AT_MOST(x,y,z) \
22 (OMPL_MAJOR_VERSION < x || (OMPL_MAJOR_VERSION <= x && \
23 (OMPL_MINOR_VERSION < y || (OMPL_MINOR_VERSION <= y && \
24 OMPL_PATCH_VERSION <= z))))
26 #define OMPL_MAJOR_MINOR_VERSION_AT_MOST(x,y) \
27 (OMPL_MAJOR_VERSION < x || (OMPL_MAJOR_VERSION <= x && \
28 (OMPL_MINOR_VERSION < y || (OMPL_MINOR_VERSION <= y))))
32 #if OMPL_VERSION_AT_LEAST(1, 2, 0)
35 #include <boost/smart_ptr.hpp>
36 #include <boost/bind.hpp>
43 #if OMPL_VERSION_AT_LEAST(1, 2, 0)
45 #define OMPL_PLACEHOLDER(ph) std::placeholders::ph
53 template <
class T,
class... Args>
56 return std::make_shared<T>(std::forward<Args>(args)...);
59 template <
class T,
class U>
62 return std::dynamic_pointer_cast<T>(r);
65 template <
class T,
class U>
68 return std::static_pointer_cast<T>(r);
71 template <
class F,
class... Args>
73 -> decltype(std::bind(std::forward<F>(f), std::forward<Args>(args)...))
75 return std::bind(std::forward<F>(f), std::forward<Args>(args)...);
78 #else // OMPL_VERSION_AT_LEAST(1,2,0)
80 #define OMPL_PLACEHOLDER(ph) ph
88 template <
class T,
class... Args>
91 return boost::make_shared<T>(std::forward<Args>(args)...);
94 template <
class T,
class U>
97 return boost::dynamic_pointer_cast<T>(r);
100 template <
class T,
class U>
103 return boost::static_pointer_cast<T>(r);
106 template <
class F,
class... Args>
108 -> decltype(boost::bind(std::forward<F>(f), std::forward<Args>(args)...))
110 return boost::bind(std::forward<F>(f), std::forward<Args>(args)...);
113 #endif // OMPL_VERSION_AT_LEAST(1,2,0)
119 #endif // AIKIDO_PLANNER_OMPL_BACKWARDCOMPATIBILITY_HPP_