34 #ifndef RIEGL_RDB_POINTCLOUD_DATATYPES_HPP 35 #define RIEGL_RDB_POINTCLOUD_DATATYPES_HPP 43 #include <type_traits> 49 namespace pointcloud {
78 template <
typename ValueType>
82 template <
bool Integer,
bool Signed,
size_t Size,
typename dummy =
void>
struct data_type_of { };
83 template <
typename dummy>
struct data_type_of<true, false, 1, dummy> {
static const auto type =
UINT8; };
84 template <
typename dummy>
struct data_type_of<true, true, 1, dummy> {
static const auto type =
INT8; };
85 template <
typename dummy>
struct data_type_of<true, false, 2, dummy> {
static const auto type =
UINT16; };
86 template <
typename dummy>
struct data_type_of<true, true, 2, dummy> {
static const auto type =
INT16; };
87 template <
typename dummy>
struct data_type_of<true, false, 4, dummy> {
static const auto type =
UINT32; };
88 template <
typename dummy>
struct data_type_of<true, true, 4, dummy> {
static const auto type =
INT32; };
89 template <
typename dummy>
struct data_type_of<true, false, 8, dummy> {
static const auto type =
UINT64; };
90 template <
typename dummy>
struct data_type_of<true, true, 8, dummy> {
static const auto type =
INT64; };
91 template <
typename dummy>
struct data_type_of<false, true, 4, dummy> {
static const auto type =
FLOAT32; };
92 template <
typename dummy>
struct data_type_of<false, true, 8, dummy> {
static const auto type =
FLOAT64; };
95 template <
typename SomeType>
96 struct remove_container
98 typedef SomeType
type;
101 template <
typename SomeType,
size_t Size>
102 struct remove_container< SomeType[Size] >
104 typedef SomeType
type;
107 template <
typename SomeType,
size_t Size>
108 struct remove_container< std::array<SomeType, Size> >
110 typedef SomeType
type;
113 template <
typename SomeType,
class Allocator>
114 struct remove_container< std::vector<SomeType, Allocator> >
116 typedef SomeType
type;
120 typedef typename std::remove_cv <ValueType>::type TempType1;
121 typedef typename std::remove_pointer<TempType1>::type TempType2;
122 typedef typename std::remove_cv <TempType2>::type TempType3;
123 typedef typename remove_container <TempType3>::type TempType4;
124 typedef typename remove_container <TempType4>::type CoreType;
129 std::numeric_limits<CoreType>::is_integer,
130 std::numeric_limits<CoreType>::is_signed,
145 template <
typename ValueType>
163 template <
typename ValueType>
174 template <
typename ValueType>
180 template <
typename ValueType>
186 template <
typename ValueType>
192 template <
typename ValueType>
198 template <
typename ValueType,
size_t Size>
204 template <
typename ValueType,
size_t Size>
210 template <
typename ValueType,
class Allocator>
216 template <
typename ValueType,
class Allocator>
217 const ValueType*
dataPointerOf(
const std::vector<ValueType, Allocator>& value)
224 #endif // RIEGL_RDB_POINTCLOUD_DATATYPES_HPP
DataType
Point attribute access data type.
Get RDB data type enumerator from data type.
ValueType * dataPointerOf(ValueType *const value)
Get pointer to variable or to data in a std::array or vector container.
32 bit single precision floating point value
64 bit double precision floating point value
RIEGL Laser Measurement Systems GmbH, Austria.
DataType dataTypeOf()
Convenience wrapper for DataTypeOf class.
64 bit double precision floating point value
32 bit single precision floating point value
static const DataType type
Result RDB data type enumerator for given ValueType.