5 #ifndef __pinocchio_parsers_urdf_types_hpp__
6 #define __pinocchio_parsers_urdf_types_hpp__
8 #include <urdf_model/model.h>
12 #ifdef PINOCCHIO_URDFDOM_USE_STD_SHARED_PTR
14 #define PINOCCHIO_URDF_SHARED_PTR(type) std::shared_ptr<type>
15 #define PINOCCHIO_URDF_WEAK_PTR(type) std::weak_ptr<type>
17 #include <boost/shared_ptr.hpp>
18 #define PINOCCHIO_URDF_SHARED_PTR(type) std::shared_ptr<type>
19 #define PINOCCHIO_URDF_WEAK_PTR(type) boost::weak_ptr<type>
22 #ifndef PINOCCHIO_URDFDOM_TYPEDEF_SHARED_PTR
24 #define PINOCCHIO_URDF_TYPEDEF_CLASS_POINTER(Class) \
25 typedef PINOCCHIO_URDF_SHARED_PTR(Class) Class##SharedPtr; \
26 typedef PINOCCHIO_URDF_SHARED_PTR(const Class) Class##ConstSharedPtr; \
27 typedef PINOCCHIO_URDF_WEAK_PTR(Class) Class##WeakPtr
44 template<
class T,
class U>
48 #ifdef PINOCCHIO_URDFDOM_USE_STD_SHARED_PTR
49 return std::const_pointer_cast<T>(
r);
51 return boost::const_pointer_cast<T>(
r);
55 template<
class T,
class U>
59 #ifdef PINOCCHIO_URDFDOM_USE_STD_SHARED_PTR
60 return std::dynamic_pointer_cast<T>(
r);
62 return boost::dynamic_pointer_cast<T>(
r);
66 template<
class T,
class U>
70 #ifdef PINOCCHIO_URDFDOM_USE_STD_SHARED_PTR
71 return std::static_pointer_cast<T>(
r);
73 return boost::static_pointer_cast<T>(
r);
78 #undef PINOCCHIO_URDF_TYPEDEF_CLASS_POINTER
80 #else // PINOCCHIO_URDFDOM_TYPEDEF_SHARED_PTR
82 #include <urdf_world/types.h>
84 #endif // PINOCCHIO_URDFDOM_TYPEDEF_SHARED_PTR
86 #endif // ifndef __pinocchio_parsers_urdf_types_hpp__