29 value_.d =
static_cast<double>(v);
33 value_.d =
static_cast<double>(v);
37 value_.i =
static_cast<int64_t
>(v);
41 value_.i =
static_cast<int64_t
>(v);
45 value_.i =
static_cast<int64_t
>(v);
49 value_.i =
static_cast<int64_t
>(v);
57 template <
typename T =
int64_t>
59 typename std::enable_if<!std::is_same<T, long>::value>::
type* = 0) {
61 value_.i =
static_cast<int64_t
>(v);
65 value_.i =
static_cast<int64_t
>(v);
69 value_.i =
static_cast<int64_t
>(v);
73 value_.i =
static_cast<int64_t
>(v);
79 if (v <=
static_cast<uint64_t>(std::numeric_limits<int64_t>::max())) {
80 value_.i =
static_cast<int64_t
>(v);
86 value_.i = -
static_cast<int64_t
>(
87 std::numeric_limits<uint64_t>::max() - v) -
93 value_.b =
static_cast<bool>(v);
126 template <
typename T>
129 return static_cast<T
>(value_.d);
131 return static_cast<T
>(value_.i);
133 return static_cast<T
>(value_.b);
140 const std::string& error_msg)
const {
141 if (scalar_type_ != other.scalar_type_) {
142 if (error_msg.empty()) {
153 std::string scalar_type_str;
154 std::string value_str;
156 scalar_type_str =
"Double";
157 value_str = std::to_string(value_.d);
159 scalar_type_str =
"Int64";
160 value_str = std::to_string(value_.i);
162 scalar_type_str =
"Bool";
163 value_str = value_.b ?
"true" :
"false";
167 return scalar_type_str +
":" + value_str;
170 template <
typename T>
173 return value_.d == value;
175 return value_.i == value;
194 value_.b == other.value_.b;
#define LogError(...)
Definition: Logging.h:51
bool IsInt64() const
Definition: Scalar.h:97
bool GetBool() const
Definition: Scalar.h:118
Scalar(double v)
Definition: Scalar.h:31
Scalar(int32_t v)
Definition: Scalar.h:43
int64_t GetInt64() const
Definition: Scalar.h:110
bool IsBool() const
Definition: Scalar.h:98
Scalar(int64_t v)
Definition: Scalar.h:47
Scalar(int16_t v)
Definition: Scalar.h:39
Scalar(bool v)
Definition: Scalar.h:91
bool Equal(bool value) const
Definition: Scalar.h:183
Scalar(float v)
Definition: Scalar.h:27
Scalar(long v, typename std::enable_if<!std::is_same< T, long >::value >::type *=0)
Definition: Scalar.h:58
Scalar(uint32_t v)
Definition: Scalar.h:71
ScalarType
Definition: Scalar.h:25
bool Equal(T value) const
Definition: Scalar.h:171
void AssertSameScalarType(Scalar other, const std::string &error_msg) const
Definition: Scalar.h:139
double GetDouble() const
Definition: Scalar.h:102
bool IsDouble() const
Definition: Scalar.h:96
Scalar(uint16_t v)
Definition: Scalar.h:67
T To() const
To<T>() does not check for scalar type and overflows.
Definition: Scalar.h:127
Scalar(uint8_t v)
Definition: Scalar.h:63
Scalar(uint64_t v)
Definition: Scalar.h:75
Scalar(int8_t v)
Definition: Scalar.h:35
std::string ToString() const
Definition: Scalar.h:152
bool Equal(Scalar other) const
Definition: Scalar.h:187
const char const char value recording_handle imu_sample recording_handle uint8_t size_t data_size k4a_record_configuration_t config target_format k4a_capture_t capture_handle k4a_imu_sample_t imu_sample playback_handle k4a_logging_message_cb_t void min_level device_handle k4a_imu_sample_t timeout_in_ms capture_handle capture_handle capture_handle image_handle temperature_c k4a_image_t image_handle uint8_t image_handle image_handle image_handle image_handle uint32_t
Definition: K4aPlugin.cpp:548
const char const char value recording_handle imu_sample recording_handle uint8_t size_t data_size k4a_record_configuration_t config target_format k4a_capture_t capture_handle k4a_imu_sample_t imu_sample uint64_t
Definition: K4aPlugin.cpp:343
const char const char value recording_handle imu_sample recording_handle uint8_t size_t data_size k4a_record_configuration_t config target_format k4a_capture_t capture_handle k4a_imu_sample_t imu_sample playback_handle k4a_logging_message_cb_t void min_level device_handle k4a_imu_sample_t int32_t
Definition: K4aPlugin.cpp:395
Definition: PinholeCameraIntrinsic.cpp:16