6 #ifndef TURI_FLEXIBLE_TYPE_DETAIL_HPP 7 #define TURI_FLEXIBLE_TYPE_DETAIL_HPP 12 #include <core/logging/assertions.hpp> 13 #include <core/util/stl_util.hpp> 14 #include <core/util/cityhash_tc.hpp> 15 #include <core/storage/serialization/serialization_includes.hpp> 16 #include <core/data/flexible_type/flexible_type_base_types.hpp> 17 namespace boost {
namespace posix_time {
23 namespace flexible_type_impl {
29 boost::posix_time::ptime ptime_from_time_t(std::time_t offset, int32_t microseconds = 0);
35 flex_int ptime_to_time_t(
const boost::posix_time::ptime & time);
40 flex_int ptime_to_fractional_microseconds(
const boost::posix_time::ptime & time);
62 std::istringstream stream_;
72 static_assert(b,
"Invalid Type");
82 template <
typename Visitor,
typename U>
88 inline FLEX_ALWAYS_INLINE_FLATTEN
auto operator()(T& t)
const -> decltype(v(t, u)) {
107 template <
typename T,
typename U>
108 inline FLEX_ALWAYS_INLINE_FLATTEN
bool operator()(T& t,
const U& u)
const { FLEX_TYPE_ASSERT(
false);
return false; }
109 inline FLEX_ALWAYS_INLINE_FLATTEN
bool operator()(
const flex_float t,
const flex_float u)
const {
return t < u; }
110 inline FLEX_ALWAYS_INLINE_FLATTEN
bool operator()(
const flex_int t,
const flex_int u)
const {
return t < u; }
116 inline FLEX_ALWAYS_INLINE_FLATTEN
bool operator()(
const flex_int t,
const flex_float u)
const {
return t < u; }
117 inline FLEX_ALWAYS_INLINE_FLATTEN
bool operator()(
const flex_float t,
const flex_int u)
const {
return t < u; }
118 inline FLEX_ALWAYS_INLINE_FLATTEN
bool operator()(
const std::string& t,
const std::string& u)
const {
return t < u; }
119 inline FLEX_ALWAYS_INLINE_FLATTEN
bool operator()(
const flex_vec& t,
const flex_vec& u)
const {
123 for(
size_t i = 0; i < t.size(); i++) {
124 if (u.size() <= i || t[i] > u[i])
return false;
125 if (t[i] < u[i])
return true;
127 return t.size() < u.size();
131 for(
size_t i = 0; i < t.size(); i++) {
132 if (u.size() <= i || t[i] > u[i])
return false;
133 if (t[i] < u[i])
return true;
135 return t.size() < u.size();
147 template <
typename T,
typename U>
148 inline FLEX_ALWAYS_INLINE_FLATTEN
bool operator()(T& t,
const U& u)
const { FLEX_TYPE_ASSERT(
false);
return false; }
149 inline FLEX_ALWAYS_INLINE_FLATTEN
bool operator()(
const flex_float t,
const flex_float u)
const {
return t > u; }
155 inline FLEX_ALWAYS_INLINE_FLATTEN
bool operator()(
const flex_int t,
const flex_int u)
const {
return t > u; }
156 inline FLEX_ALWAYS_INLINE_FLATTEN
bool operator()(
const flex_int t,
const flex_float u)
const {
return t > u; }
157 inline FLEX_ALWAYS_INLINE_FLATTEN
bool operator()(
const flex_float t,
const flex_int u)
const {
return t > u; }
158 inline FLEX_ALWAYS_INLINE_FLATTEN
bool operator()(
const std::string& t,
const std::string& u)
const {
return t > u; }
159 inline FLEX_ALWAYS_INLINE_FLATTEN
bool operator()(
const flex_vec& t,
const flex_vec& u)
const {
160 for(
size_t i = 0; i < t.size(); i++) {
161 if (u.size() <= i || t[i] > u[i])
return true;
162 if (t[i] < u[i])
return false;
165 return t.size() > u.size();
169 for(
size_t i = 0; i < t.size(); i++) {
170 if (u.size() <= i || t[i] > u[i])
return true;
171 if (t[i] < u[i])
return false;
173 return t.size() > u.size();
186 template <
typename T,
typename U>
187 inline FLEX_ALWAYS_INLINE_FLATTEN
bool operator()(T& t,
const U& u)
const {
return false; }
197 inline FLEX_ALWAYS_INLINE_FLATTEN
bool operator()(
const flex_int t,
const flex_int u)
const {
return t == u; }
198 inline FLEX_ALWAYS_INLINE_FLATTEN
bool operator()(
const flex_float t,
const flex_float u)
const {
return t == u; }
199 inline FLEX_ALWAYS_INLINE_FLATTEN
bool operator()(
const flex_string& t,
const flex_string& u)
const {
return t == u; }
200 inline FLEX_ALWAYS_INLINE_FLATTEN
bool operator()(
const flex_image& t,
const flex_image& u)
const {
return t == u; }
201 inline FLEX_ALWAYS_INLINE_FLATTEN
bool operator()(
const flex_vec& t,
const flex_vec& u)
const {
202 if (t.size() != u.size())
return false;
203 for (
size_t i = 0;i < t.size(); ++i)
if (t[i] != u[i])
return false;
207 inline FLEX_ALWAYS_INLINE_FLATTEN
bool operator()(
const flex_dict& t,
const flex_dict& u)
const {
210 inline FLEX_ALWAYS_INLINE_FLATTEN
bool operator()(
const flex_list& t,
const flex_list& u)
const {
230 template <
typename T,
typename U>
231 inline FLEX_ALWAYS_INLINE_FLATTEN
bool operator()(T& t,
const U& u)
const {
return false; }
242 inline FLEX_ALWAYS_INLINE_FLATTEN
bool operator()(
const flex_int t,
const flex_int u)
const {
return t == u; }
243 inline FLEX_ALWAYS_INLINE_FLATTEN
bool operator()(
const flex_float t,
const flex_float u)
const {
244 return (std::isnan(t) && std::isnan(u)) || (t == u);
246 inline FLEX_ALWAYS_INLINE_FLATTEN
bool operator()(
const flex_int t,
const flex_float u)
const {
return t == u; }
247 inline FLEX_ALWAYS_INLINE_FLATTEN
bool operator()(
const flex_float t,
const flex_int u)
const {
return t == u; }
248 inline FLEX_ALWAYS_INLINE_FLATTEN
bool operator()(
const flex_string& t,
const flex_string& u)
const {
return t == u; }
249 inline FLEX_ALWAYS_INLINE_FLATTEN
bool operator()(
const flex_image& t,
const flex_image& u)
const {
return t == u; }
250 inline FLEX_ALWAYS_INLINE_FLATTEN
bool operator()(
const flex_vec& t,
const flex_vec& u)
const {
251 if (t.size() != u.size())
return false;
252 for (
size_t i = 0;i < t.size(); ++i)
if (t[i] != u[i])
return false;
270 template <
typename T>
271 inline FLEX_ALWAYS_INLINE_FLATTEN
void operator()(T& t)
const {
272 FLEX_TYPE_ASSERT(
false);
274 inline FLEX_ALWAYS_INLINE_FLATTEN
void operator()(
flex_int& t)
const { t = -t; }
275 inline FLEX_ALWAYS_INLINE_FLATTEN
void operator()(
flex_float& t)
const { t = -t; }
276 inline FLEX_ALWAYS_INLINE_FLATTEN
void operator()(
flex_vec& t)
const {
277 for (
size_t i = 0;i < t.size(); ++i) t[i] = -t[i];
279 inline FLEX_ALWAYS_INLINE_FLATTEN
void operator()(
flex_nd_vec& t)
const {
292 template <
typename T>
293 inline FLEX_ALWAYS_INLINE_FLATTEN
void operator()(T& t)
const {
294 FLEX_TYPE_ASSERT(
false);
296 inline FLEX_ALWAYS_INLINE_FLATTEN
void operator()(
flex_int& t)
const { t++; }
297 inline FLEX_ALWAYS_INLINE_FLATTEN
void operator()(
flex_float& t)
const { t++; }
307 template <
typename T>
308 inline FLEX_ALWAYS_INLINE_FLATTEN
void operator()(T& t)
const {
309 FLEX_TYPE_ASSERT(
false);
311 inline FLEX_ALWAYS_INLINE_FLATTEN
void operator()(
flex_int& t)
const { t--; }
312 inline FLEX_ALWAYS_INLINE_FLATTEN
void operator()(
flex_float& t)
const { t--; }
323 template <
typename T,
typename U>
324 inline FLEX_ALWAYS_INLINE_FLATTEN
void operator()(T& t,
const U& u)
const { FLEX_TYPE_ASSERT(
false); }
325 inline FLEX_ALWAYS_INLINE_FLATTEN
void operator()(
flex_int& t,
const flex_int u)
const { t += u; }
328 int64_t integral_part = std::floor(u);
329 int64_t us_part = (u - integral_part) * flex_date_time::MICROSECONDS_PER_SECOND;
332 if (microsecond >= flex_date_time::MICROSECONDS_PER_SECOND) {
334 microsecond -= flex_date_time::MICROSECONDS_PER_SECOND;
338 inline FLEX_ALWAYS_INLINE_FLATTEN
void operator()(
flex_int& t,
const flex_float u)
const { t += u; }
339 inline FLEX_ALWAYS_INLINE_FLATTEN
void operator()(
flex_float& t,
const flex_int u)
const { t += u; }
340 inline FLEX_ALWAYS_INLINE_FLATTEN
void operator()(
flex_float& t,
const flex_float u)
const { t += u; }
341 inline FLEX_ALWAYS_INLINE_FLATTEN
void operator()(std::string& t,
const std::string& u)
const { t += u; }
342 inline FLEX_ALWAYS_INLINE_FLATTEN
void operator()(
flex_vec& t,
const flex_vec& u)
const {
343 FLEX_TYPE_ASSERT(t.size() == u.size());
344 for (
size_t i = 0;i < t.size(); ++i) t[i] += u[i];
347 inline FLEX_ALWAYS_INLINE_FLATTEN
void operator()(
flex_vec& t,
const flex_int u)
const {
348 for (
size_t i = 0;i < t.size(); ++i) t[i] += u;
351 inline FLEX_ALWAYS_INLINE_FLATTEN
void operator()(
flex_vec& t,
const flex_float u)
const {
352 for (
size_t i = 0;i < t.size(); ++i) t[i] += u;
354 inline FLEX_ALWAYS_INLINE_FLATTEN
void operator()(
flex_nd_vec& t,
const flex_int u)
const {
372 template <
typename T,
typename U>
373 inline FLEX_ALWAYS_INLINE_FLATTEN
void operator()(T& t,
const U& u)
const { FLEX_TYPE_ASSERT(
false); }
376 int64_t integral_part = std::floor(u);
377 int64_t us_part = (u - integral_part) * flex_date_time::MICROSECONDS_PER_SECOND;
380 if (microsecond < 0) {
382 microsecond += flex_date_time::MICROSECONDS_PER_SECOND;
386 inline FLEX_ALWAYS_INLINE_FLATTEN
void operator()(
flex_int& t,
const flex_int& u)
const { t -= u; }
387 inline FLEX_ALWAYS_INLINE_FLATTEN
void operator()(
flex_int& t,
const flex_float& u)
const { t -= u; }
388 inline FLEX_ALWAYS_INLINE_FLATTEN
void operator()(
flex_float& t,
const flex_int& u)
const { t -= u; }
389 inline FLEX_ALWAYS_INLINE_FLATTEN
void operator()(
flex_float& t,
const flex_float& u)
const { t -= u; }
390 inline FLEX_ALWAYS_INLINE_FLATTEN
void operator()(
flex_vec& t,
const flex_vec& u)
const {
391 FLEX_TYPE_ASSERT(t.size() == u.size());
392 for (
size_t i = 0;i < t.size(); ++i) t[i] -= u[i];
395 inline FLEX_ALWAYS_INLINE_FLATTEN
void operator()(
flex_vec& t,
const flex_int u)
const {
396 for (
size_t i = 0;i < t.size(); ++i) t[i] -= u;
399 inline FLEX_ALWAYS_INLINE_FLATTEN
void operator()(
flex_vec& t,
const flex_float u)
const {
400 for (
size_t i = 0;i < t.size(); ++i) t[i] -= u;
402 inline FLEX_ALWAYS_INLINE_FLATTEN
void operator()(
flex_nd_vec& t,
const flex_int u)
const {
420 template <
typename T,
typename U>
421 inline FLEX_ALWAYS_INLINE_FLATTEN
void operator()(T& t,
const U& u)
const { FLEX_TYPE_ASSERT(
false); }
423 inline FLEX_ALWAYS_INLINE_FLATTEN
void operator()(
flex_int& t,
const flex_int& u)
const { t /= u; }
424 inline FLEX_ALWAYS_INLINE_FLATTEN
void operator()(
flex_int& t,
const flex_float& u)
const { t /= u; }
425 inline FLEX_ALWAYS_INLINE_FLATTEN
void operator()(
flex_float& t,
const flex_int& u)
const { t /= u; }
426 inline FLEX_ALWAYS_INLINE_FLATTEN
void operator()(
flex_float& t,
const flex_float& u)
const { t /= u; }
428 inline FLEX_ALWAYS_INLINE_FLATTEN
void operator()(
flex_vec& t,
const flex_vec& u)
const {
429 FLEX_TYPE_ASSERT(t.size() == u.size());
430 for (
size_t i = 0;i < t.size(); ++i) t[i] /= u[i];
432 inline FLEX_ALWAYS_INLINE_FLATTEN
void operator()(
flex_vec& t,
const flex_int u)
const {
433 for (
size_t i = 0;i < t.size(); ++i) t[i] /= u;
436 inline FLEX_ALWAYS_INLINE_FLATTEN
void operator()(
flex_vec& t,
const flex_float u)
const {
437 for (
size_t i = 0;i < t.size(); ++i) t[i] /= u;
439 inline FLEX_ALWAYS_INLINE_FLATTEN
void operator()(
flex_nd_vec& t,
const flex_int u)
const {
458 template <
typename T,
typename U>
459 inline FLEX_ALWAYS_INLINE_FLATTEN
void operator()(T& t,
const U& u)
const { FLEX_TYPE_ASSERT(
false); }
461 inline FLEX_ALWAYS_INLINE_FLATTEN
void operator()(
flex_int& t,
const flex_int& u)
const { t %= u; }
463 inline FLEX_ALWAYS_INLINE_FLATTEN
void operator()(
flex_float& t,
const flex_int& u)
const { t = fmod(t, u); }
464 inline FLEX_ALWAYS_INLINE_FLATTEN
void operator()(
flex_float& t,
const flex_float& u)
const { t = fmod(t, u); }
465 inline FLEX_ALWAYS_INLINE_FLATTEN
void operator()(
flex_vec& t,
const flex_vec& u)
const {
466 FLEX_TYPE_ASSERT(t.size() == u.size());
467 for (
size_t i = 0;i < t.size(); ++i) t[i] = fmod(t[i], u[i]);
470 inline FLEX_ALWAYS_INLINE_FLATTEN
void operator()(
flex_vec& t,
const flex_int u)
const {
471 for (
size_t i = 0;i < t.size(); ++i) t[i] = fmod(t[i], u);
473 inline FLEX_ALWAYS_INLINE_FLATTEN
void operator()(
flex_vec& t,
const flex_float u)
const {
474 for (
size_t i = 0;i < t.size(); ++i) t[i] = fmod(t[i], u);
480 inline FLEX_ALWAYS_INLINE_FLATTEN
void operator()(
flex_nd_vec& t,
const flex_int u)
const {
495 template <
typename T,
typename U>
496 inline FLEX_ALWAYS_INLINE_FLATTEN
void operator()(T& t,
const U& u)
const { FLEX_TYPE_ASSERT(
false); }
498 inline FLEX_ALWAYS_INLINE_FLATTEN
void operator()(
flex_int& t,
const flex_int& u)
const { t *= u; }
499 inline FLEX_ALWAYS_INLINE_FLATTEN
void operator()(
flex_int& t,
const flex_float& u)
const { t *= u; }
500 inline FLEX_ALWAYS_INLINE_FLATTEN
void operator()(
flex_float& t,
const flex_int& u)
const { t *= u; }
501 inline FLEX_ALWAYS_INLINE_FLATTEN
void operator()(
flex_float& t,
const flex_float& u)
const { t *= u; }
502 inline FLEX_ALWAYS_INLINE_FLATTEN
void operator()(
flex_vec& t,
const flex_vec& u)
const {
503 FLEX_TYPE_ASSERT(t.size() == u.size());
504 for (
size_t i = 0;i < t.size(); ++i) t[i] *= u[i];
507 inline FLEX_ALWAYS_INLINE_FLATTEN
void operator()(
flex_vec& t,
const flex_int u)
const {
508 for (
size_t i = 0;i < t.size(); ++i) t[i] *= u;
511 inline FLEX_ALWAYS_INLINE_FLATTEN
void operator()(
flex_vec& t,
const flex_float u)
const {
512 for (
size_t i = 0;i < t.size(); ++i) t[i] *= u;
514 inline FLEX_ALWAYS_INLINE_FLATTEN
void operator()(
flex_nd_vec& t,
const flex_int u)
const {
532 template <
typename T>
556 template <
typename T>
557 inline FLEX_ALWAYS_INLINE_FLATTEN
flex_int operator()(T t)
const { FLEX_TYPE_ASSERT(
false);
return 0; }
559 inline FLEX_ALWAYS_INLINE_FLATTEN
flex_int operator()(
flex_int i)
const {
return i; }
563 inline FLEX_ALWAYS_INLINE_FLATTEN
flex_int operator()(
flex_float i)
const {
return i; }
566 long long int converted = std::stoll(t.data(), &end_index);
567 if (end_index != t.length()) {
569 throw std::runtime_error(
"Invalid conversion: " + t +
" cannot be interpreted as an integer");
582 template <
typename T>
583 inline FLEX_ALWAYS_INLINE_FLATTEN
flex_float operator()(T t)
const { FLEX_TYPE_ASSERT(
false);
return 0.0; }
588 inline FLEX_ALWAYS_INLINE_FLATTEN
flex_float operator()(
flex_int i)
const {
return i; }
592 double converted = std::stod(t.data(), &end_index);
593 if (end_index != t.length()) {
595 throw std::runtime_error(
"Invalid conversion: " + t +
" cannot be interpreted as a float");
597 return (
float)converted;
630 template <
typename T>
631 inline FLEX_ALWAYS_INLINE_FLATTEN
flex_vec operator()(T t)
const { FLEX_TYPE_ASSERT(
false);
return flex_vec(); }
635 inline FLEX_ALWAYS_INLINE_FLATTEN
flex_vec operator()(
const flex_vec& i)
const {
return i; }
656 template <
typename T>
657 inline FLEX_ALWAYS_INLINE_FLATTEN
flex_nd_vec operator()(T t)
const { FLEX_TYPE_ASSERT(
false);
return flex_vec(); }
674 template <
typename T>
675 inline FLEX_ALWAYS_INLINE_FLATTEN
flex_list operator()(T t)
const { FLEX_TYPE_ASSERT(
false);
return flex_list(); }
685 inline FLEX_ALWAYS_INLINE_FLATTEN
flex_list operator()(
const flex_vec& v)
const {
687 for(
size_t i = 0; i < v.size(); ++i)
702 template <
typename T>
703 inline FLEX_ALWAYS_INLINE_FLATTEN
flex_dict operator()(T t)
const { FLEX_TYPE_ASSERT(
false);
return flex_dict(); }
705 inline FLEX_ALWAYS_INLINE_FLATTEN
flex_dict operator()(
const flex_dict& v)
const {
return v; }
714 template <
typename T>
715 inline FLEX_ALWAYS_INLINE_FLATTEN
flex_image operator()(T t)
const { FLEX_TYPE_ASSERT(
false);
return flex_image(); }
717 inline FLEX_ALWAYS_INLINE_FLATTEN
flex_image operator()(
const flex_image& v)
const {
return v; }
730 template <
typename T,
typename U>
731 inline FLEX_ALWAYS_INLINE_FLATTEN
void operator()(T& t,
const U& u)
const { FLEX_TYPE_ASSERT(
false); }
745 inline FLEX_ALWAYS_INLINE_FLATTEN
void operator()(
flex_int& t,
const flex_int u)
const { t = u; }
746 inline FLEX_ALWAYS_INLINE_FLATTEN
void operator()(
flex_float& t,
const flex_float u)
const { t = u; }
747 inline FLEX_ALWAYS_INLINE_FLATTEN
void operator()(
flex_int& t,
const flex_float u)
const { t = u; }
748 inline FLEX_ALWAYS_INLINE_FLATTEN
void operator()(
flex_float& t,
const flex_int u)
const { t = u; }
749 template <
typename U>
751 inline FLEX_ALWAYS_INLINE_FLATTEN
void operator()(
flex_vec& t,
const flex_vec& u)
const { t = u; }
752 inline FLEX_ALWAYS_INLINE_FLATTEN
void operator()(
flex_list& t,
const flex_list& u)
const { t = u; }
753 inline FLEX_ALWAYS_INLINE_FLATTEN
void operator()(
flex_list& t,
const flex_vec& u)
const { t.assign(u.begin(), u.end()); }
754 inline FLEX_ALWAYS_INLINE_FLATTEN
void operator()(
flex_dict& t,
const flex_dict& u)
const { t = u; }
763 inline FLEX_ALWAYS_INLINE_FLATTEN
void operator()(
flex_vec& t,
const flex_nd_vec& u)
const {
783 template <
typename T>
784 inline FLEX_ALWAYS_INLINE_FLATTEN
void operator()(
const T& i)
const { oarc << i; }
795 template <
typename T>
796 inline FLEX_ALWAYS_INLINE_FLATTEN
void operator()(T& i)
const { iarc >> i; }
807 template <
typename T>
808 inline FLEX_ALWAYS_INLINE_FLATTEN std::type_index operator()(T& i)
const {
return typeid(i); }
848 template <
typename T>
849 inline FLEX_ALWAYS_INLINE_FLATTEN
size_t operator()(T t)
const {
852 inline FLEX_ALWAYS_INLINE_FLATTEN
size_t operator()(
flex_int t)
const {
855 inline FLEX_ALWAYS_INLINE_FLATTEN
size_t operator()(
flex_date_time t)
const {
861 inline FLEX_ALWAYS_INLINE_FLATTEN
size_t operator()(
const flex_float& t)
const {
864 static_assert(
sizeof(
flex_float) ==
sizeof(
size_t),
"sizeof(flex_float) == sizeof(size_t)");
865 memcpy(&t2_int, &t2,
sizeof(
size_t));
868 inline FLEX_ALWAYS_INLINE_FLATTEN
size_t operator()(
const flex_string& t)
const {
871 inline FLEX_ALWAYS_INLINE_FLATTEN
size_t operator()(
const flex_vec& t)
const {
872 return turi::hash64(reinterpret_cast<const char*>(t.data()),
873 t.size() *
sizeof(flex_vec::value_type));
875 inline FLEX_ALWAYS_INLINE_FLATTEN
size_t operator()(
const flex_nd_vec& t)
const {
877 t.
raw_elements().size() *
sizeof(flex_nd_vec::value_type));
880 size_t operator()(
const flex_list& t)
const;
881 size_t operator()(
const flex_dict& t)
const;
890 template <
typename T>
891 inline FLEX_ALWAYS_INLINE_FLATTEN uint128_t operator()(T t)
const {
894 inline FLEX_ALWAYS_INLINE_FLATTEN uint128_t operator()(
flex_date_time t)
const {
900 inline FLEX_ALWAYS_INLINE_FLATTEN uint128_t operator()(
flex_int t)
const {
903 inline FLEX_ALWAYS_INLINE_FLATTEN uint128_t operator()(
const flex_float& t)
const {
906 static_assert(
sizeof(
flex_float) ==
sizeof(
size_t),
"sizeof(flex_float) == sizeof(size_t)");
907 memcpy(&t2_int, &t2,
sizeof(
size_t));
910 inline FLEX_ALWAYS_INLINE_FLATTEN uint128_t operator()(
const flex_string& t)
const {
913 inline FLEX_ALWAYS_INLINE_FLATTEN uint128_t operator()(
const flex_vec& t)
const {
914 return turi::hash128(reinterpret_cast<const char*>(t.data()),
915 t.size() *
sizeof(flex_vec::value_type));
917 inline FLEX_ALWAYS_INLINE_FLATTEN uint128_t operator()(
const flex_nd_vec& t)
const {
919 t.
raw_elements().size() *
sizeof(flex_nd_vec::value_type));
923 uint128_t operator()(
const flex_list& t)
const;
924 uint128_t operator()(
const flex_dict& t)
const;
void set_microsecond_res_timestamp(double d)
std::vector< double > flex_vec
void set_microsecond(int32_t microsecond)
static uint128_t hash128(const char *s, size_t len)
The serialization input archive object which, provided with a reference to an istream, will read from the istream, providing deserialization capabilities.
int32_t microsecond() const
static uint64_t hash64_combine(uint64_t h1, uint64_t h2)
container_type & elements()
ndarray< T > compact() const
flexible_type_impl::ndarray< double > flex_nd_vec
static uint128_t hash128_combine(uint128_t h1, uint128_t h2)
container_type & raw_elements()
int64_t posix_timestamp() const
void set_posix_timestamp(int64_t ts)
static uint64_t hash64(const char *s, size_t len)
ndarray< T > & negate()
negation
std::string tostr(const T &t)
double microsecond_res_timestamp() const
The serialization output archive object which, provided with a reference to an ostream, will write to the ostream, providing serialization capabilities.
std::vector< std::pair< flexible_type, flexible_type > > flex_dict
std::vector< flexible_type > flex_list
int32_t time_zone_offset() const