40 #ifndef PCL_POINT_TRAITS_H_
41 #define PCL_POINT_TRAITS_H_
44 #include <boost/type_traits/remove_all_extents.hpp>
45 #include <boost/type_traits/is_same.hpp>
46 #include <boost/mpl/assert.hpp>
47 #include <boost/mpl/bool.hpp>
51 #ifdef BUILD_Maintainer
53 # include <features.h>
54 # if __GNUC_PREREQ(4, 3)
55 # pragma GCC diagnostic ignored "-Weffc++"
56 # pragma GCC diagnostic ignored "-pedantic"
58 # pragma GCC system_header
60 # elif defined _MSC_VER
61 # pragma warning(push, 1)
76 template<
typename T>
struct asEnum {};
88 template<>
struct asType<sensor_msgs::PointField::INT8> {
typedef int8_t
type; };
89 template<>
struct asType<sensor_msgs::PointField::UINT8> {
typedef uint8_t
type; };
90 template<>
struct asType<sensor_msgs::PointField::INT16> {
typedef int16_t
type; };
91 template<>
struct asType<sensor_msgs::PointField::UINT16> {
typedef uint16_t
type; };
92 template<>
struct asType<sensor_msgs::PointField::INT32> {
typedef int32_t
type; };
93 template<>
struct asType<sensor_msgs::PointField::UINT32> {
typedef uint32_t
type; };
94 template<>
struct asType<sensor_msgs::PointField::FLOAT32> {
typedef float type; };
95 template<>
struct asType<sensor_msgs::PointField::FLOAT64> {
typedef double type; };
101 typedef typename boost::remove_all_extents<T>::type
type;
106 template<
typename Po
intT>
122 template<
class Po
intT,
typename Tag,
int dummy = 0>
123 struct name :
name<typename POD<PointT>::type, Tag, dummy>
130 POINT_TYPE_NOT_PROPERLY_REGISTERED, (
PointT&));
134 template<
class Po
intT,
typename Tag>
142 POINT_TYPE_NOT_PROPERLY_REGISTERED, (
PointT&));
146 template<
class Po
intT,
typename Tag>
156 POINT_TYPE_NOT_PROPERLY_REGISTERED, (
PointT&));
160 template<
typename Po
intT>
168 POINT_TYPE_NOT_PROPERLY_REGISTERED, (
PointT&));
184 template<
typename Po
intT,
typename Tag>
196 template <
typename Po
intInT,
typename OutT>
208 const std::string &field,
211 : pt_ (reinterpret_cast<const
Pod&>(pt)), name_ (field), exists_ (exists), value_ (value)
222 const std::string &field,
224 : pt_ (reinterpret_cast<const
Pod&>(pt)), name_ (field), exists_ (exists_tmp_), value_ (value)
229 template <
typename Key>
inline void
237 value_ =
static_cast<OutT
> (*
reinterpret_cast<const T*
>(data_ptr));
243 const std::string &name_;
251 template <
typename Po
intOutT,
typename InT>
262 const std::string &field,
264 : pt_ (reinterpret_cast<
Pod&>(pt)), name_ (field), value_ (value)
269 template <
typename Key>
inline void
276 *
reinterpret_cast<T*
>(data_ptr) = static_cast<T> (value_);
282 const std::string &name_;
287 #ifdef BUILD_Maintainer
288 # if defined __GNUC__
289 # if __GNUC_PREREQ(4, 3)
290 # pragma GCC diagnostic warning "-Weffc++"
291 # pragma GCC diagnostic warning "-pedantic"
293 # elif defined _MSC_VER
294 # pragma warning(pop)
298 #endif //#ifndef PCL_POINT_TRAITS_H_