7 #ifndef TURI_FLEXIBLE_TYPE_HPP 8 #define TURI_FLEXIBLE_TYPE_HPP 15 #include <core/parallel/atomic.hpp> 17 #include <core/data/flexible_type/flexible_type_base_types.hpp> 19 void flexible_type_fail(
bool);
25 #define FLEX_TYPE_ASSERT(param) flexible_type_fail(param); 30 #define FLEX_ALWAYS_INLINE __attribute__((always_inline)) 31 #define FLEX_ALWAYS_INLINE_FLATTEN __attribute__((always_inline,flatten)) 32 #define FLEX_TYPE_DASSERT(param) 37 #define FLEX_ALWAYS_INLINE 38 #define FLEX_ALWAYS_INLINE_FLATTEN 39 #define FLEX_TYPE_DASSERT(param) FLEX_TYPE_ASSERT(param) 264 template <
typename T>
300 template <
typename T>
319 template <
typename T>
332 flexible_type&
soft_assign(
const flexible_type& other);
339 flexible_type&
operator=(
const flexible_type& other) noexcept;
345 flexible_type&
operator=(flexible_type& other) noexcept;
351 flexible_type&
operator=(flexible_type&& other) noexcept;
358 flexible_type&
operator=(
const flexible_type&& other) noexcept;
370 template <
typename T>
371 typename std::enable_if<
377 flexible_type&
operator=(
const char v[N]) {
382 flexible_type&
operator=(
const char* c) {
402 template <
typename T>
404 typename std::remove_reference<T>::type>::value,
426 const int32_t microsecond=0);
446 void swap(flexible_type& b);
456 template <
typename T>
466 template <
typename T>
467 const T&
get()
const;
480 template <
typename T>
493 template <
typename T>
531 template <
typename T>
532 typename std::enable_if<!std::is_integral<T>::value && !std::is_floating_point<T>::value, T>
::type 536 typename std::enable_if<std::is_integral<T>::value, T>
::type 540 typename std::enable_if<std::is_floating_point<T>::value, T>
::type 554 std::type_index
type()
const;
560 size_t which()
const;
581 inline bool is_na()
const;
634 template <
typename Visitor>
664 template <
typename Visitor>
665 auto apply_visitor(Visitor visitor)
const -> decltype(visitor(prototype_flex_int));
693 template <
typename Visitor>
720 template <
typename Visitor>
721 auto apply_visitor(Visitor visitor,
const flexible_type& other)
const -> decltype(visitor(prototype_flex_int,
flex_int()));
729 typename std::enable_if<std::is_integral<T>::value>
::type* = (
void*)NULL>
730 inline FLEX_ALWAYS_INLINE_FLATTEN
operator T()
const {
737 typename std::enable_if<std::is_floating_point<T>::value>::type* = (
void*)NULL>
738 inline FLEX_ALWAYS_INLINE_FLATTEN
operator T()
const {
799 flexible_type&
operator+=(
const flexible_type& other) ;
810 flexible_type&
operator-=(
const flexible_type& other) ;
821 flexible_type&
operator/=(
const flexible_type& other) ;
832 flexible_type&
operator%=(
const flexible_type& other) ;
841 flexible_type&
operator*=(
const flexible_type& other) ;
856 flexible_type
operator+(
const flexible_type& other)
const;
871 flexible_type
operator-(
const flexible_type& other)
const;
887 flexible_type
operator*(
const flexible_type& other)
const;
904 flexible_type
operator/(
const flexible_type& other)
const;
920 flexible_type
operator%(
const flexible_type& other)
const;
929 bool operator==(
const flexible_type& other)
const;
937 bool operator!=(
const flexible_type& other)
const;
949 bool identical(
const flexible_type& other)
const;
958 bool operator<(
const flexible_type& other)
const;
965 bool operator>(
const flexible_type& other)
const;
972 bool operator<=(
const flexible_type& other)
const;
979 bool operator>=(
const flexible_type& other)
const;
1005 template <
typename T>
1006 flexible_type
operator-(
const T& other)
const;
1011 template <
typename T>
1012 flexible_type
operator+(
const T& other)
const;
1017 template <
typename T>
1018 flexible_type
operator/(
const T& other)
const;
1023 template <
typename T>
1024 flexible_type
operator%(
const T& other)
const;
1029 template <
typename T>
1030 flexible_type
operator*(
const T& other)
const;
1035 template <
typename T>
1041 template <
typename T>
1047 template <
typename T>
1053 template <
typename T>
1059 template <
typename T>
1065 template <
typename T>
1100 flexible_type&
array_at(
size_t index) ;
1109 const flexible_type&
array_at(
size_t index)
const ;
1117 flexible_type&
dict_at(
const flexible_type& index) ;
1126 const flexible_type&
dict_at(
const flexible_type& index)
const ;
1145 const flexible_type&
operator()(
size_t index)
const ;
1153 flexible_type&
operator()(
const flexible_type& index) ;
1162 const flexible_type&
operator()(
const flexible_type& index)
const ;
1173 size_t size()
const;
1198 void erase(
const flexible_type& index);
1242 std::pair<atomic<size_t>, flex_string>* strval;
1243 std::pair<atomic<size_t>,
flex_vec>* vecval;
1245 std::pair<atomic<size_t>,
flex_list>* recval;
1246 std::pair<atomic<size_t>,
flex_dict>* dictval;
1247 std::pair<atomic<size_t>,
flex_image>* imgval;
1256 void clear_memory_internal();
1258 inline FLEX_ALWAYS_INLINE_FLATTEN
void ensure_unique() {
1259 switch(val.stored_type){
1261 if (val.strval->first.value == 1)
return;
1265 val.strval =
new std::pair<atomic<size_t>, flex_string>(*(val.strval));
1266 val.strval->first.value = 1;
1271 if (val.vecval->first.value == 1)
return;
1275 val.vecval =
new std::pair<atomic<size_t>,
flex_vec>(*(val.vecval));
1276 val.vecval->first.value = 1;
1281 if (val.ndvecval->first.value == 1)
return;
1285 val.ndvecval =
new std::pair<atomic<size_t>,
flex_nd_vec>(*(val.ndvecval));
1286 val.ndvecval->first.value = 1;
1291 if (val.recval->first.value == 1)
return;
1295 val.recval =
new std::pair<atomic<size_t>,
flex_list>(*(val.recval));
1296 val.recval->first.value = 1;
1301 if (val.dictval->first.value == 1)
return;
1305 val.dictval =
new std::pair<atomic<size_t>,
flex_dict>(*(val.dictval));
1306 val.dictval->first.value = 1;
1311 if (val.imgval->first.value == 1)
return;
1315 val.imgval =
new std::pair<atomic<size_t>,
flex_image>(*(val.imgval));
1316 val.imgval->first.value = 1;
1326 static inline FLEX_ALWAYS_INLINE_FLATTEN
void decref(union_type& v,
flex_type_enum type) noexcept {
1329 if (v.strval->first.dec() == 0) {
1335 if (v.vecval->first.dec() == 0) {
1341 if (v.ndvecval->first.dec() == 0) {
1347 if (v.recval->first.dec() == 0) {
1353 if (v.dictval->first.dec() == 0) {
1359 if (v.imgval->first.dec() == 0) {
1370 static inline FLEX_ALWAYS_INLINE_FLATTEN
void incref(union_type& v,
flex_type_enum type) noexcept {
1373 v.strval->first.inc();
1376 v.vecval->first.inc();
1379 v.ndvecval->first.inc();
1382 v.recval->first.inc();
1385 v.dictval->first.inc();
1388 v.imgval->first.inc();
1415 #pragma clang diagnostic push 1416 #pragma clang diagnostic ignored "-Wmismatched-tags" 1420 struct hash<
turi::flexible_type> {
1427 #pragma clang diagnostic pop 1447 #include <core/data/flexible_type/flexible_type_detail.hpp> 1453 std::pair<flex_int,int32_t> ret;
1454 ret.first = val.dtval.posix_timestamp();
1455 ret.second = val.dtval.time_zone_offset();
1460 return val.dtval.microsecond();
1466 val.dtval.set_posix_timestamp(datetime.first);
1467 val.dtval.set_time_zone_offset(datetime.second);
1468 val.dtval.set_microsecond(microseconds);
1483 inline FLEX_ALWAYS_INLINE
flex_date_time& flexible_type::mutable_get<flex_date_time>() {
1489 inline FLEX_ALWAYS_INLINE
const flex_date_time& flexible_type::get<flex_date_time>()
const {
1496 inline FLEX_ALWAYS_INLINE
flex_int& flexible_type::mutable_get<flex_int>() {
1502 inline FLEX_ALWAYS_INLINE
const flex_int& flexible_type::get<flex_int>()
const {
1508 inline FLEX_ALWAYS_INLINE
flex_int& flexible_type::reinterpret_mutable_get<flex_int>() {
1513 inline FLEX_ALWAYS_INLINE
const flex_int& flexible_type::reinterpret_get<flex_int>()
const {
1519 inline FLEX_ALWAYS_INLINE
flex_float& flexible_type::mutable_get<flex_float>() {
1526 inline FLEX_ALWAYS_INLINE
const flex_float& flexible_type::get<flex_float>()
const {
1532 inline FLEX_ALWAYS_INLINE
flex_float& flexible_type::reinterpret_mutable_get<flex_float>() {
1537 inline FLEX_ALWAYS_INLINE
const flex_float& flexible_type::reinterpret_get<flex_float>()
const {
1544 inline FLEX_ALWAYS_INLINE
flex_string& flexible_type::mutable_get<flex_string>() {
1547 return val.strval->second;
1551 inline FLEX_ALWAYS_INLINE
const flex_string& flexible_type::get<flex_string>()
const {
1553 return val.strval->second;
1559 inline FLEX_ALWAYS_INLINE
flex_vec& flexible_type::mutable_get<flex_vec>() {
1562 return val.vecval->second;
1567 inline FLEX_ALWAYS_INLINE
const flex_vec& flexible_type::get<flex_vec>()
const {
1569 return val.vecval->second;
1575 inline FLEX_ALWAYS_INLINE
flex_nd_vec& flexible_type::mutable_get<flex_nd_vec>() {
1578 return val.ndvecval->second;
1583 inline FLEX_ALWAYS_INLINE
const flex_nd_vec& flexible_type::get<flex_nd_vec>()
const {
1585 return val.ndvecval->second;
1591 inline FLEX_ALWAYS_INLINE
flex_list& flexible_type::mutable_get<flex_list>() {
1594 return val.recval->second;
1599 inline FLEX_ALWAYS_INLINE
const flex_list& flexible_type::get<flex_list>()
const {
1601 return val.recval->second;
1607 inline FLEX_ALWAYS_INLINE
flex_dict& flexible_type::mutable_get<flex_dict>() {
1610 return val.dictval->second;
1615 inline FLEX_ALWAYS_INLINE
const flex_dict& flexible_type::get<flex_dict>()
const {
1617 return val.dictval->second;
1623 inline FLEX_ALWAYS_INLINE
flex_image& flexible_type::mutable_get<flex_image>() {
1626 return val.imgval->second;
1630 inline FLEX_ALWAYS_INLINE
const flex_image& flexible_type::get<flex_image>()
const {
1632 return val.imgval->second;
1637 inline FLEX_ALWAYS_INLINE
void flexible_type::clear_memory_internal() {
1638 static_assert(
sizeof(
flex_date_time) == 12,
"sizeof(flex_date_time)");
1639 static_assert(
sizeof(flexible_type::union_type) ==
sizeof(
flex_date_time) + 4,
1640 "sizeof(flexible_type::union_type)");
1642 "value of flex_type_enum::INTEGER");
1645 val.dtval.m_microsecond = 0;
1651 clear_memory_internal();
1654 template <
typename T>
1658 val.vecval->second =
flex_vec(list);
1679 template <
typename T>
1687 val.stored_type = other.get_type();
1693 val.stored_type = other.get_type();
1694 incref(val, val.stored_type);
1697 template <
typename T>
1699 this->
operator=(std::forward<T>(other));
1704 if (&other ==
this)
return *
this;
1711 if (&other ==
this)
return *
this;
1712 decref(val, val.stored_type);
1714 val.stored_type = other.get_type();
1715 incref(val, val.stored_type);
1720 if (__builtin_expect(&other ==
this, 0))
return *
this;
1721 decref(val, val.stored_type);
1723 val.stored_type = other.get_type();
1724 incref(val, val.stored_type);
1729 if (__builtin_expect(&other ==
this, 0))
return *
this;
1730 decref(val, val.stored_type);
1732 val.stored_type = other.get_type();
1733 incref(val, val.stored_type);
1739 if (__builtin_expect(&other ==
this, 0))
return *
this;
1740 decref(val, val.stored_type);
1742 val.stored_type = other.get_type();
1747 template <
typename T>
1748 inline FLEX_ALWAYS_INLINE_FLATTEN
1749 typename std::enable_if<has_direct_conversion_to_flexible_type<T>::value,
1750 flexible_type&>::type
1754 reset(desired_type);
1756 mutable_get<typename enum_to_type<desired_type>::type>() = other;
1767 template <
typename T>
1768 inline FLEX_ALWAYS_INLINE_FLATTEN
1770 typename std::remove_reference<T>::type>::value,
1771 flexible_type&>::type
1773 typedef typename std::remove_reference<T>::type BASE_T;
1776 reset(desired_type);
1778 mutable_get<typename enum_to_type<desired_type>::type>() = std::forward<T>(other);
1784 decref(val, val.stored_type);
1785 clear_memory_internal();
1788 val.stored_type = target_type;
1793 val.strval =
new std::pair<atomic<size_t>,
flex_string>;
1794 val.strval->first.value = 1;
1797 val.vecval =
new std::pair<atomic<size_t>,
flex_vec>;
1798 val.vecval->first.value = 1;
1801 val.ndvecval =
new std::pair<atomic<size_t>,
flex_nd_vec>;
1802 val.ndvecval->first.value = 1;
1805 val.recval =
new std::pair<atomic<size_t>,
flex_list>;
1806 val.recval->first.value = 1;
1809 val.dictval =
new std::pair<atomic<size_t>,
flex_dict>;
1810 val.dictval->first.value = 1;
1816 val.imgval =
new std::pair<atomic<size_t>,
flex_image>;
1817 val.imgval->first.value = 1;
1826 decref(val, val.stored_type);
1827 clear_memory_internal();
1834 std::swap(val, b.val);
1837 template <
typename T>
1839 __attribute__((unused))
1841 __builtin_unreachable();
1844 template <
typename T>
1846 __attribute__((unused))
1848 __builtin_unreachable();
1852 template <
typename T>
1854 __attribute__((unused))
1856 __builtin_unreachable();
1859 template <
typename T>
1861 __attribute__((unused))
1863 __builtin_unreachable();
1868 return val.stored_type;
1895 template <
typename Visitor>
1899 return visitor(mutable_get<flex_int>());
1901 return visitor(mutable_get<flex_float>());
1903 return visitor(mutable_get<flex_string>());
1905 return visitor(mutable_get<flex_vec>());
1907 return visitor(mutable_get<flex_nd_vec>());
1909 return visitor(mutable_get<flex_list>());
1911 return visitor(mutable_get<flex_dict>());
1913 return visitor(mutable_get<flex_date_time>());
1915 return visitor(mutable_get<flex_image>());
1918 return visitor(undef);
1920 FLEX_TYPE_ASSERT(
false);
1922 __builtin_unreachable();
1927 template <
typename Visitor>
1931 return visitor(get<flex_int>());
1933 return visitor(get<flex_float>());
1935 return visitor(get<flex_string>());
1937 return visitor(get<flex_vec>());
1939 return visitor(get<flex_nd_vec>());
1941 return visitor(get<flex_list>());
1943 return visitor(get<flex_dict>());
1945 return visitor(get<flex_date_time>());
1947 return visitor(get<flex_image>());
1950 return visitor(undef);
1952 FLEX_TYPE_ASSERT(
false);
1954 __builtin_unreachable();
1957 template <
typename Visitor>
1995 FLEX_TYPE_ASSERT(
false);
1997 __builtin_unreachable();
2001 template <
typename Visitor>
2037 FLEX_TYPE_ASSERT(
false);
2039 __builtin_unreachable();
2046 template<
typename T>
2047 inline FLEX_ALWAYS_INLINE_FLATTEN
2048 typename std::enable_if<std::is_integral<T>::value, T>::type
2053 template<
typename T>
2054 inline FLEX_ALWAYS_INLINE_FLATTEN
2055 typename std::enable_if<std::is_floating_point<T>::value, T>::type
2061 inline FLEX_ALWAYS_INLINE_FLATTEN
flex_string flexible_type::to<flex_string>()
const {
2066 inline FLEX_ALWAYS_INLINE_FLATTEN
flex_vec flexible_type::to<flex_vec>()
const {
2071 inline FLEX_ALWAYS_INLINE_FLATTEN
flex_nd_vec flexible_type::to<flex_nd_vec>()
const {
2076 inline FLEX_ALWAYS_INLINE_FLATTEN
flex_list flexible_type::to<flex_list>()
const {
2081 inline FLEX_ALWAYS_INLINE_FLATTEN
flex_dict flexible_type::to<flex_dict>()
const {
2086 inline FLEX_ALWAYS_INLINE_FLATTEN
flex_date_time flexible_type::to<flex_date_time>()
const {
2091 inline FLEX_ALWAYS_INLINE_FLATTEN
flex_image flexible_type::to<flex_image>()
const {
2101 inline FLEX_ALWAYS_INLINE_FLATTEN flexible_type::operator
flex_string()
const {
2102 return to<flex_string>();
2105 inline FLEX_ALWAYS_INLINE_FLATTEN flexible_type::operator
flex_vec()
const {
2106 return to<flex_vec>();
2109 inline FLEX_ALWAYS_INLINE_FLATTEN flexible_type::operator
flex_nd_vec()
const {
2110 return to<flex_nd_vec>();
2113 inline FLEX_ALWAYS_INLINE_FLATTEN flexible_type::operator
flex_list()
const {
2114 return to<flex_list>();
2117 inline FLEX_ALWAYS_INLINE_FLATTEN flexible_type::operator
flex_dict()
const {
2118 return to<flex_dict>();
2122 return to<flex_date_time>();
2125 inline FLEX_ALWAYS_INLINE_FLATTEN flexible_type::operator
flex_image()
const {
2126 return to<flex_image>();
2130 flexible_type
copy(*
this);
2168 flexible_type ret(*
this);
2174 flexible_type ret(*
this);
2181 flexible_type ret(*
this);
2189 flexible_type ret(*
this);
2196 flexible_type ret(*
this);
2245 flexible_type ret(*
this);
2261 flexible_type ret(*
this);
2270 template <
typename T>
2272 template <
typename T>
2274 template <
typename T>
2276 template <
typename T>
2278 template <
typename T>
2280 template <
typename T>
2282 template <
typename T>
2284 template <
typename T>
2286 template <
typename T>
2288 template <
typename T>
2290 template <
typename T>
2297 return val.vecval->second[index];
2299 return val.ndvecval->second[index];
2301 if (index == 0)
return val.dblval;
2303 FLEX_TYPE_ASSERT(
false);
2305 __builtin_unreachable();
2311 return val.vecval->second[index];
2313 return val.ndvecval->second[index];
2315 if (index == 0)
return val.dblval;
2317 FLEX_TYPE_ASSERT(
false);
2319 __builtin_unreachable();
2325 return val.recval->second[index];
2330 return val.recval->second[index];
2337 for(
auto& pair : value) {
2338 if (pair.first == s) {
2344 log_and_throw(
"key does not exist in the dictionary");
2345 __builtin_unreachable();
2350 const flex_dict& value = val.dictval->second;
2351 for(
auto& pair : value) {
2352 if (pair.first == s) {
2356 FLEX_TYPE_ASSERT(
false);
2357 __builtin_unreachable();
2367 FLEX_TYPE_ASSERT(
false);
2369 __builtin_unreachable();
2378 FLEX_TYPE_ASSERT(
false);
2380 __builtin_unreachable();
2389 FLEX_TYPE_ASSERT(
false);
2391 __builtin_unreachable();
2400 FLEX_TYPE_ASSERT(
false);
2402 __builtin_unreachable();
2409 return val.vecval->second.size();
2411 return val.ndvecval->second.num_elem();
2413 return val.recval->second.size();
2415 return val.dictval->second.size();
2425 val.vecval->second.resize(s);
2428 val.recval->second.resize(s);
2431 FLEX_TYPE_ASSERT(
false);
2444 FLEX_TYPE_ASSERT(
false);
2452 val.vecval->second.push_back(i);
2458 FLEX_TYPE_ASSERT(
false);
2470 val.recval->second.push_back(i);
2473 FLEX_TYPE_ASSERT(
false);
2484 unsigned char c = (128 + (
unsigned char)(
get_type()));
2520 #define EXT_ENABLE_IF(x) \ 2521 typename std::enable_if<has_direct_conversion_to_flexible_type<T>::value && std::is_same<S, flexible_type>::value, x>::type 2528 template <
typename T>
2529 inline FLEX_ALWAYS_INLINE
2530 typename std::enable_if<std::is_same<T, flexible_type>::value, std::ostream&>::type
2531 operator<<(std::ostream& os,
const T& f) {
2532 os << (std::string)(f);
2542 template <
typename T,
typename S>
2543 inline FLEX_ALWAYS_INLINE_FLATTEN EXT_ENABLE_IF(flexible_type)
operator+(
const T& other,
const S& f) {
2553 template <
typename T,
typename S>
2554 inline FLEX_ALWAYS_INLINE_FLATTEN EXT_ENABLE_IF(flexible_type)
operator-(
const T& other,
const S& f) {
2564 template <
typename T,
typename S>
2565 inline FLEX_ALWAYS_INLINE_FLATTEN EXT_ENABLE_IF(flexible_type)
operator*(
const T& other,
const S& f) {
2566 return f.operator*(other);
2575 template <
typename T,
typename S>
2576 inline FLEX_ALWAYS_INLINE_FLATTEN EXT_ENABLE_IF(flexible_type)
operator/(
const T& other,
const S& f) {
2577 flexible_type ret(f.get_type());
2590 template <
typename T,
typename S>
2591 inline FLEX_ALWAYS_INLINE_FLATTEN EXT_ENABLE_IF(flexible_type)
operator%(
const T& other,
const S& f) {
2592 flexible_type ret(f.get_type());
2603 template <
typename T,
typename S>
2604 inline FLEX_ALWAYS_INLINE_FLATTEN EXT_ENABLE_IF(
bool)
operator==(
const T& other,
const S& f) {
2613 template <
typename T,
typename S>
2614 inline FLEX_ALWAYS_INLINE_FLATTEN EXT_ENABLE_IF(
bool)
operator<(
const T& other,
const S& f) {
return (f > other); }
2621 template <
typename T,
typename S>
2622 inline FLEX_ALWAYS_INLINE_FLATTEN EXT_ENABLE_IF(
bool)
operator>(
const T& other,
const S& f) {
return (f < other); }
2629 template <
typename T,
typename S>
2630 inline FLEX_ALWAYS_INLINE_FLATTEN EXT_ENABLE_IF(
bool)
operator<=(
const T& other,
const S& f) {
return (f >= other); }
2637 template <
typename T,
typename S>
2638 inline FLEX_ALWAYS_INLINE_FLATTEN EXT_ENABLE_IF(
bool)
operator>=(
const T& other,
const S& f) {
return (f <= other); }
2650 return get<flex_int>() == 0;
2652 return get<flex_float>() == 0.0;
2654 return get<flex_string>().empty();
2656 return get<flex_vec>().empty();
2658 return get<flex_list>().empty();
2660 return get<flex_dict>().empty();
2666 log_and_throw(
"Unexpected type!");
2668 __builtin_unreachable();
2674 #undef EXT_ENABLE_IF 2675 #undef FLEX_ALWAYS_INLINE 2676 #undef FLEX_ALWAYS_INLINE_FLATTEN
int32_t get_date_time_microsecond() const
std::vector< double > flex_vec
std::pair< flex_int, int32_t > get_date_time_as_timestamp_and_offset() const
flexible_type & operator=(const flexible_type &other) noexcept
The serialization input archive object which, provided with a reference to an istream, will read from the istream, providing deserialization capabilities.
bool operator>=(const flexible_type &other) const
flexible_type & operator%=(const flexible_type &other)
void load(iarchive &iarc)
bool approx_equal(const flexible_type &other) const
flexible_type & array_at(size_t index)
bool operator<=(const flexible_type &other) const
flex_float & operator[](size_t index)
auto apply_visitor(Visitor visitor) const -> decltype(visitor(prototype_flex_int))
flexible_type & soft_assign(const flexible_type &other)
flexible_type & operator/=(const flexible_type &other)
void erase(const flexible_type &index)
bool operator!=(const flexible_type &other) const
flexible_type_impl::ndarray< double > flex_nd_vec
std::enable_if<!std::is_integral< T >::value &&!std::is_floating_point< T >::value, T >::type to() const
const T & reinterpret_get() const
auto apply_mutating_visitor(Visitor visitor) -> decltype(visitor(prototype_flex_int))
void push_back(flex_float i)
flexible_type operator/(const flexible_type &other) const
flexible_type & operator*=(const flexible_type &other)
flex_type_enum get_type() const
flexible_type operator%(const flexible_type &other) const
flexible_type & dict_at(const flexible_type &index)
bool operator<(const flexible_type &other) const
bool operator==(const flexible_type &other) const
flexible_type & operator+=(const flexible_type &other)
bool identical(const flexible_type &other) const
flexible_type & operator()(size_t index)
flexible_type operator+(const flexible_type &other) const
void copy(Iterator begin, Iterator end, SWriter &&writer)
std::type_index type() const
flexible_type & operator--()
Preincrement. Equivalent to (*this)-=1.
flexible_type operator-() const
void save(oarchive &oarc) const
The serialization output archive object which, provided with a reference to an ostream, will write to the ostream, providing serialization capabilities.
uint128_t hash128() const
bool operator>(const flexible_type &other) const
flexible_type operator*(const flexible_type &other) const
std::vector< std::pair< flexible_type, flexible_type > > flex_dict
flexible_type & operator-=(const flexible_type &other)
static flexible_type FLEX_UNDEFINED
flexible_type & set_date_time_from_timestamp_and_offset(const std::pair< flex_int, int32_t > &datetime, const int32_t microsecond=0)
std::vector< flexible_type > flex_list
T & reinterpret_mutable_get()
flexible_type & operator++()
Preincrement. Equivalent to (*this)+=1.
void swap(flexible_type &b)