Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
variant.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <deque>
4#include <map>
5#include <memory>
6#include <set>
7#include <unordered_map>
8#include <unordered_set>
9#include <vector>
10
11#include <string.h> // memset
12
13#include <fc/string.hpp>
14#include <fc/time.hpp>
17#include <boost/multi_index_container_fwd.hpp>
18#include <boost/multiprecision/cpp_int.hpp>
19#include <variant>
20
21namespace fc
22{
36 class variant;
37 class variant_object;
38 class mutable_variant_object;
39 class time_point;
40 class time_point_sec;
41 class microseconds;
42 template<typename T> struct safe;
43
44 struct blob { std::vector<char> data; };
45
46 void to_variant( const blob& var, fc::variant& vo );
47 void from_variant( const fc::variant& var, blob& vo );
48
49
50 template<typename T, typename... Args> void to_variant( const boost::multi_index_container<T,Args...>& s, fc::variant& v );
51 template<typename T, typename... Args> void from_variant( const fc::variant& v, boost::multi_index_container<T,Args...>& s );
52
53 template<size_t Size>
54 using UInt = boost::multiprecision::number<
55 boost::multiprecision::cpp_int_backend<Size, Size, boost::multiprecision::unsigned_magnitude, boost::multiprecision::unchecked, void> >;
56 template<size_t Size>
57 using Int = boost::multiprecision::number<
58 boost::multiprecision::cpp_int_backend<Size, Size, boost::multiprecision::signed_magnitude, boost::multiprecision::unchecked, void> >;
59
60 void to_variant( const UInt<8>& n, fc::variant& v );
61 void from_variant( const fc::variant& v, UInt<8>& n );
62
63 void to_variant( const UInt<16>& n, fc::variant& v );
64 void from_variant( const fc::variant& v, UInt<16>& n );
65
66 void to_variant( const UInt<32>& n, fc::variant& v );
67 void from_variant( const fc::variant& v, UInt<32>& n );
68
69 void to_variant( const UInt<64>& n, fc::variant& v );
70 void from_variant( const fc::variant& v, UInt<64>& n );
71
72 template<typename T> void to_variant( const boost::multiprecision::number<T>& n, fc::variant& v );
73 template<typename T> void from_variant( const fc::variant& v, boost::multiprecision::number<T>& n );
74
75 template<typename T> void to_variant( const safe<T>& s, fc::variant& v );
76 template<typename T> void from_variant( const fc::variant& v, safe<T>& s );
77 template<typename T> void to_variant( const std::unique_ptr<T>& s, fc::variant& v );
78 template<typename T> void from_variant( const fc::variant& v, std::unique_ptr<T>& s );
79
80 template<typename... T> void to_variant( const std::variant<T...>& s, fc::variant& v );
81 template<typename... T> void from_variant( const fc::variant& v, std::variant<T...>& s );
82
83 void to_variant( const uint8_t& var, fc::variant& vo );
84 void from_variant( const fc::variant& var, uint8_t& vo );
85 void to_variant( const int8_t& var, fc::variant& vo );
86 void from_variant( const fc::variant& var, int8_t& vo );
87
88 void to_variant( const uint16_t& var, fc::variant& vo );
89 void from_variant( const fc::variant& var, uint16_t& vo );
90 void to_variant( const int16_t& var, fc::variant& vo );
91 void from_variant( const fc::variant& var, int16_t& vo );
92
93 void to_variant( const uint32_t& var, fc::variant& vo );
94 void from_variant( const fc::variant& var, uint32_t& vo );
95 void to_variant( const int32_t& var, fc::variant& vo );
96 void from_variant( const fc::variant& var, int32_t& vo );
97
98 void to_variant( const unsigned __int128& var, fc::variant& vo );
99 void from_variant( const fc::variant& var, unsigned __int128& vo );
100 void to_variant( const __int128& var, fc::variant& vo );
101 void from_variant( const fc::variant& var, __int128& vo );
102
103 void to_variant( const variant_object& var, fc::variant& vo );
104 void from_variant( const fc::variant& var, variant_object& vo );
105 void to_variant( const mutable_variant_object& var, fc::variant& vo );
106 void from_variant( const fc::variant& var, mutable_variant_object& vo );
107 void to_variant( const std::vector<char>& var, fc::variant& vo );
108 void from_variant( const fc::variant& var, std::vector<char>& vo );
109
110 template<typename K, typename T>
111 void to_variant( const std::unordered_map<K,T>& var, fc::variant& vo );
112 template<typename K, typename T>
113 void from_variant( const fc::variant& var, std::unordered_map<K,T>& vo );
114
115 template<typename K, typename T>
116 void to_variant( const std::map<K,T>& var, fc::variant& vo );
117 template<typename K, typename T>
118 void from_variant( const fc::variant& var, std::map<K,T>& vo );
119 template<typename K, typename T>
120 void to_variant( const std::multimap<K,T>& var, fc::variant& vo );
121 template<typename K, typename T>
122 void from_variant( const fc::variant& var, std::multimap<K,T>& vo );
123
124
125 template<typename T>
126 void to_variant( const std::unordered_set<T>& var, fc::variant& vo );
127 template<typename T>
128 void from_variant( const fc::variant& var, std::unordered_set<T>& vo );
129
130 template<typename T>
131 void to_variant( const std::deque<T>& var, fc::variant& vo );
132 template<typename T>
133 void from_variant( const fc::variant& var, std::deque<T>& vo );
134
135 template<typename T, typename... U>
136 void to_variant( const boost::container::deque<T, U...>& d, fc::variant& vo );
137 template<typename T, typename... U>
138 void from_variant( const fc::variant& v, boost::container::deque<T, U...>& d );
139
140 template<typename T>
141 void to_variant( const std::set<T>& var, fc::variant& vo );
142 template<typename T>
143 void from_variant( const fc::variant& var, std::set<T>& vo );
144
145 template<typename T, std::size_t S>
146 void to_variant( const std::array<T,S>& var, fc::variant& vo );
147 template<typename T, std::size_t S>
148 void from_variant( const fc::variant& var, std::array<T,S>& vo );
149
150 void to_variant( const time_point& var, fc::variant& vo );
151 void from_variant( const fc::variant& var, time_point& vo );
152
153 void to_variant( const time_point_sec& var, fc::variant& vo );
154 void from_variant( const fc::variant& var, time_point_sec& vo );
155
156 void to_variant( const microseconds& input_microseconds, fc::variant& output_variant );
157 void from_variant( const fc::variant& input_variant, microseconds& output_microseconds );
158
159 #ifdef __APPLE__
160 void to_variant( size_t s, fc::variant& v );
161 #elif !defined(_MSC_VER)
162 void to_variant( long long int s, fc::variant& v );
163 void to_variant( unsigned long long int s, fc::variant& v );
164 #endif
165 void to_variant( const std::string& s, fc::variant& v );
166
167 template<typename T>
168 void to_variant( const std::shared_ptr<T>& var, fc::variant& vo );
169
170 template<typename T>
171 void from_variant( const fc::variant& var, std::shared_ptr<T>& vo );
172
173 typedef std::vector<fc::variant> variants;
174 template<typename A, typename B>
175 void to_variant( const std::pair<A,B>& t, fc::variant& v );
176 template<typename A, typename B>
177 void from_variant( const fc::variant& v, std::pair<A,B>& p );
178
179
180
191 {
192 public:
205
207 variant();
210
212 variant( const char* str );
213 variant( char* str );
214 variant( wchar_t* str );
215 variant( const wchar_t* str );
216 variant( float val );
217 variant( uint8_t val );
218 variant( int8_t val );
219 variant( uint16_t val );
220 variant( int16_t val );
221 variant( uint32_t val );
222 variant( int32_t val );
223 variant( uint64_t val );
224 variant( int64_t val );
225 variant( double val );
226 variant( bool val );
227 variant( blob val );
228 variant( fc::string val );
231 variant( variants );
232 variant( const variant& );
233 variant( variant&& );
234 ~variant();
235
240 {
241 public:
242 virtual ~visitor(){}
244 virtual void handle()const = 0;
245 virtual void handle( const int64_t& v )const = 0;
246 virtual void handle( const uint64_t& v )const = 0;
247 virtual void handle( const double& v )const = 0;
248 virtual void handle( const bool& v )const = 0;
249 virtual void handle( const string& v )const = 0;
250 virtual void handle( const variant_object& v)const = 0;
251 virtual void handle( const variants& v)const = 0;
252 virtual void handle( const blob& v)const = 0;
253 };
254
255 void visit( const visitor& v )const;
256
257 type_id get_type()const;
258
259 bool is_null()const;
260 bool is_string()const;
261 bool is_bool()const;
262 bool is_int64()const;
263 bool is_uint64()const;
264 bool is_double()const;
265 bool is_object()const;
266 bool is_array()const;
267 bool is_blob()const;
271 bool is_numeric()const;
275 bool is_integer()const;
276
277 int64_t as_int64()const;
278 uint64_t as_uint64()const;
279 bool as_bool()const;
280 double as_double()const;
281
282 blob& get_blob();
283 const blob& get_blob()const;
284 blob as_blob()const;
285
289 string as_string()const;
290
292 const string& get_string()const;
293
296
298 const variants& get_array()const;
299
302
304 const variant_object& get_object()const;
305
307 const variant& operator[]( const char* )const;
309 const variant& operator[]( size_t pos )const;
311 size_t size()const;
312
313 size_t estimated_size()const;
326 template<typename T>
327 T as()const
328 {
329 T tmp;
330 from_variant( *this, tmp );
331 return tmp;
332 }
333
334 template<typename T>
335 void as( T& v )const
336 {
337 from_variant( *this, v );
338 }
339
340 variant& operator=( variant&& v );
341 variant& operator=( const variant& v );
342
343 template<typename T>
345 {
346 return *this = variant( fc::forward<T>(v) );
347 }
348
349 template<typename T>
350 explicit variant( const std::optional<T>& v )
351 {
352 memset( this, 0, sizeof(*this) );
353 if( v.has_value() ) *this = variant(*v);
354 }
355
356 template<typename T>
357 explicit variant( const T& val );
358
359 template<typename T>
360 explicit variant( const T& val, const fc::yield_function_t& yield );
361
362 void clear();
363 private:
364 void init();
365 double _data;
366 char _type[sizeof(void*)];
367 };
368
369 typedef std::optional<variant> ovariant;
370
372 void from_variant( const fc::variant& var, string& vo );
374 void from_variant( const fc::variant& var, fc::variants& vo );
375 void from_variant( const fc::variant& var, fc::variant& vo );
377 void from_variant( const fc::variant& var, int64_t& vo );
379 void from_variant( const fc::variant& var, uint64_t& vo );
381 void from_variant( const fc::variant& var, bool& vo );
383 void from_variant( const fc::variant& var, double& vo );
385 void from_variant( const fc::variant& var, float& vo );
387 void from_variant( const fc::variant& var, int32_t& vo );
389 void from_variant( const fc::variant& var, uint32_t& vo );
391 template<typename T>
392 void from_variant( const variant& var, std::optional<T>& vo )
393 {
394 if( var.is_null() ) vo = std::optional<T>();
395 else
396 {
397 vo = T();
398 from_variant( var, *vo );
399 }
400 }
401 template<typename T>
402 void to_variant( const std::unordered_set<T>& var, fc::variant& vo )
403 {
404 if( var.size() > MAX_NUM_ARRAY_ELEMENTS ) throw std::range_error( "too large" );
405 std::vector<fc::variant> vars(var.size());
406 size_t i = 0;
407 for( auto itr = var.begin(); itr != var.end(); ++itr, ++i )
408 vars[i] = fc::variant(*itr);
409 vo = vars;
410 }
411 template<typename T>
412 void from_variant( const fc::variant& var, std::unordered_set<T>& vo )
413 {
414 const variants& vars = var.get_array();
415 if( vars.size() > MAX_NUM_ARRAY_ELEMENTS ) throw std::range_error( "too large" );
416 vo.clear();
417 vo.reserve( vars.size() );
418 for( auto itr = vars.begin(); itr != vars.end(); ++itr )
419 vo.insert( itr->as<T>() );
420 }
421
422
423 template<typename K, typename T>
424 void to_variant( const std::unordered_map<K, T>& var, fc::variant& vo )
425 {
426 if( var.size() > MAX_NUM_ARRAY_ELEMENTS ) throw std::range_error( "too large" );
427 std::vector< fc::variant > vars(var.size());
428 size_t i = 0;
429 for( auto itr = var.begin(); itr != var.end(); ++itr, ++i )
430 vars[i] = fc::variant(*itr);
431 vo = vars;
432 }
433 template<typename K, typename T>
434 void from_variant( const fc::variant& var, std::unordered_map<K, T>& vo )
435 {
436 const variants& vars = var.get_array();
437 if( vars.size() > MAX_NUM_ARRAY_ELEMENTS ) throw std::range_error( "too large" );
438 vo.clear();
439 for( auto itr = vars.begin(); itr != vars.end(); ++itr )
440 vo.insert( itr->as< std::pair<K,T> >() );
441
442 }
443 template<typename K, typename T>
444 void to_variant( const std::map<K, T>& var, fc::variant& vo )
445 {
446 if( var.size() > MAX_NUM_ARRAY_ELEMENTS ) throw std::range_error( "too large" );
447 std::vector< fc::variant > vars(var.size());
448 size_t i = 0;
449 for( auto itr = var.begin(); itr != var.end(); ++itr, ++i )
450 vars[i] = fc::variant(*itr);
451 vo = vars;
452 }
453 template<typename K, typename T>
454 void from_variant( const fc::variant& var, std::map<K, T>& vo )
455 {
456 const variants& vars = var.get_array();
457 if( vars.size() > MAX_NUM_ARRAY_ELEMENTS ) throw std::range_error( "too large" );
458 vo.clear();
459 for( auto itr = vars.begin(); itr != vars.end(); ++itr )
460 vo.insert( itr->as< std::pair<K,T> >() );
461 }
462
463 template<typename K, typename T>
464 void to_variant( const std::multimap<K, T>& var, fc::variant& vo )
465 {
466 if( var.size() > MAX_NUM_ARRAY_ELEMENTS ) throw std::range_error( "too large" );
467 std::vector< fc::variant > vars(var.size());
468 size_t i = 0;
469 for( auto itr = var.begin(); itr != var.end(); ++itr, ++i )
470 vars[i] = fc::variant(*itr);
471 vo = vars;
472 }
473 template<typename K, typename T>
474 void from_variant( const fc::variant& var, std::multimap<K, T>& vo )
475 {
476 const variants& vars = var.get_array();
477 if( vars.size() > MAX_NUM_ARRAY_ELEMENTS ) throw std::range_error( "too large" );
478 vo.clear();
479 for( auto itr = vars.begin(); itr != vars.end(); ++itr )
480 vo.insert( itr->as< std::pair<K,T> >() );
481 }
482
483
484 template<typename T>
485 void to_variant( const std::set<T>& var, fc::variant& vo )
486 {
487 if( var.size() > MAX_NUM_ARRAY_ELEMENTS ) throw std::range_error( "too large" );
488 std::vector<fc::variant> vars(var.size());
489 size_t i = 0;
490 for( auto itr = var.begin(); itr != var.end(); ++itr, ++i )
491 vars[i] = fc::variant(*itr);
492 vo = vars;
493 }
494 template<typename T>
495 void from_variant( const fc::variant& var, std::set<T>& vo )
496 {
497 const variants& vars = var.get_array();
498 if( vars.size() > MAX_NUM_ARRAY_ELEMENTS ) throw std::range_error( "too large" );
499 vo.clear();
500 //vo.reserve( vars.size() );
501 for( auto itr = vars.begin(); itr != vars.end(); ++itr )
502 vo.insert( itr->as<T>() );
503 }
504
506 template<typename T>
507 void from_variant( const fc::variant& var, std::deque<T>& tmp )
508 {
509 const variants& vars = var.get_array();
510 if( vars.size() > MAX_NUM_ARRAY_ELEMENTS ) throw std::range_error( "too large" );
511 tmp.clear();
512 for( auto itr = vars.begin(); itr != vars.end(); ++itr )
513 tmp.push_back( itr->as<T>() );
514 }
515
517 template<typename T>
518 void to_variant( const std::deque<T>& t, fc::variant& v )
519 {
520 if( t.size() > MAX_NUM_ARRAY_ELEMENTS ) throw std::range_error( "too large" );
521 std::vector<fc::variant> vars(t.size());
522 for( size_t i = 0; i < t.size(); ++i )
523 vars[i] = fc::variant(t[i]);
524 v = std::move(vars);
525 }
526
528 template<typename T, typename... U>
529 void from_variant( const fc::variant& v, boost::container::deque<T, U...>& d )
530 {
531 const variants& vars = v.get_array();
532 if( vars.size() > MAX_NUM_ARRAY_ELEMENTS ) throw std::range_error( "too large" );
533 d.clear();
534 d.resize( vars.size() );
535 for( uint32_t i = 0; i < vars.size(); ++i ) {
536 from_variant( vars[i], d[i] );
537 }
538 }
539
541 template<typename T, typename... U>
542 void to_variant( const boost::container::deque<T, U...>& d, fc::variant& vo )
543 {
544 if( d.size() > MAX_NUM_ARRAY_ELEMENTS ) throw std::range_error( "too large" );
545 variants vars(d.size());
546 for( size_t i = 0; i < d.size(); ++i ) {
547 vars[i] = fc::variant( d[i] );
548 }
549 vo = std::move( vars );
550 }
551
553 template<typename T>
554 void from_variant( const fc::variant& var, std::vector<T>& tmp )
555 {
556 const variants& vars = var.get_array();
557 if( vars.size() > MAX_NUM_ARRAY_ELEMENTS ) throw std::range_error( "too large" );
558 tmp.clear();
559 tmp.reserve( vars.size() );
560 for( auto itr = vars.begin(); itr != vars.end(); ++itr )
561 tmp.push_back( itr->as<T>() );
562 }
563
565 template<typename T>
566 void to_variant( const std::vector<T>& t, fc::variant& v )
567 {
568 if( t.size() > MAX_NUM_ARRAY_ELEMENTS ) throw std::range_error( "too large" );
569 std::vector<fc::variant> vars(t.size());
570 for( size_t i = 0; i < t.size(); ++i )
571 vars[i] = fc::variant(t[i]);
572 v = std::move(vars);
573 }
574
576 template<typename T, std::size_t S>
577 void from_variant( const fc::variant& var, std::array<T,S>& tmp )
578 {
579 const variants& vars = var.get_array();
580 for( std::size_t i = 0; i < S; ++i )
581 tmp[i] = vars.at(i).as<T>();
582 }
583
585 template<typename T, std::size_t S>
586 void to_variant( const std::array<T,S>& t, fc::variant& v )
587 {
588 std::vector<fc::variant> vars(S);
589 for( std::size_t i = 0; i < S; ++i )
590 vars[i] = fc::variant(t[i]);
591 v = std::move(vars);
592 }
593
595 template<typename A, typename B>
596 void to_variant( const std::pair<A,B>& t, fc::variant& v )
597 {
598 std::vector<fc::variant> vars(2);
599 vars[0] = fc::variant(t.first);
600 vars[1] = fc::variant(t.second);
601 v = vars;
602 }
603
605 template<typename A, typename B>
606 void from_variant( const fc::variant& v, std::pair<A,B>& p )
607 {
608 const variants& vars = v.get_array();
609 if( vars.size() > 0 )
610 vars[0].as<A>( p.first );
611 if( vars.size() > 1 )
612 vars[1].as<B>( p.second );
613 }
614
615 template<typename T>
616 variant::variant( const T& val )
617 {
618 memset( this, 0, sizeof(*this) );
619 to_variant( val, *this );
620 }
621
622 template<typename T>
623 variant::variant( const T& val, const fc::yield_function_t& yield )
624 {
625 memset( this, 0, sizeof(*this) );
626 to_variant( val, *this, yield );
627 }
628
629 #ifdef __APPLE__
630 inline void to_variant( size_t s, fc::variant& v ) { v = fc::variant(uint64_t(s)); }
631 #endif
632 template<typename T>
633 void to_variant( const std::shared_ptr<T>& var, fc::variant& vo )
634 {
635 if( var ) to_variant( *var, vo );
636 else vo = nullptr;
637 }
638
639 template<typename T>
640 void from_variant( const fc::variant& var, std::shared_ptr<T>& vo )
641 {
642 if( var.is_null() ) vo = nullptr;
643 else if( vo ) from_variant( var, *vo );
644 else {
645 vo = std::make_shared<T>();
646 from_variant( var, *vo );
647 }
648 }
649 template<typename T>
650 void to_variant( const std::unique_ptr<T>& var, fc::variant& vo )
651 {
652 if( var ) to_variant( *var, vo );
653 else vo = nullptr;
654 }
655
656 template<typename T>
657 void from_variant( const fc::variant& var, std::unique_ptr<T>& vo )
658 {
659 if( var.is_null() ) vo.reset();
660 else if( vo ) from_variant( var, *vo );
661 else {
662 vo.reset( new T() );
663 from_variant( var, *vo );
664 }
665 }
666
667
668 template<typename T>
669 void to_variant( const safe<T>& s, fc::variant& v ) { v = s.value; }
670
671 template<typename T>
672 void from_variant( const fc::variant& v, safe<T>& s ) { s.value = v.as_uint64(); }
673
674 template<typename T, typename... Args> void to_variant( const boost::multi_index_container<T,Args...>& c, fc::variant& v )
675 {
676 std::vector<fc::variant> vars;
677 vars.reserve( c.size() );
678 for( const auto& item : c )
679 vars.emplace_back( fc::variant(item) );
680 v = std::move(vars);
681 }
682
683 template<typename T, typename... Args> void from_variant( const fc::variant& v, boost::multi_index_container<T,Args...>& c )
684 {
685 const variants& vars = v.get_array();
686 c.clear();
687 for( const auto& item : vars )
688 c.insert( item.as<T>() );
689 }
690 template<typename T> void to_variant( const boost::multiprecision::number<T>& n, fc::variant& v ) {
691 v = n.str();
692 }
693 template<typename T> void from_variant( const fc::variant& v, boost::multiprecision::number<T>& n ) {
694 n = boost::multiprecision::number<T>(v.get_string());
695 }
696
697 fc::variant operator + ( const fc::variant& a, const fc::variant& b );
698 fc::variant operator - ( const fc::variant& a, const fc::variant& b );
699 fc::variant operator * ( const fc::variant& a, const fc::variant& b );
700 fc::variant operator / ( const fc::variant& a, const fc::variant& b );
701
702 bool operator == ( const fc::variant& a, const fc::variant& b );
703 bool operator != ( const fc::variant& a, const fc::variant& b );
704 bool operator < ( const fc::variant& a, const fc::variant& b );
705 bool operator > ( const fc::variant& a, const fc::variant& b );
706 bool operator ! ( const fc::variant& a );
707} // namespace fc
708
709#include <fc/reflect/reflect.hpp>
711FC_REFLECT_ENUM( fc::variant::type_id, (null_type)(int64_type)(uint64_type)(double_type)(bool_type)(string_type)(array_type)(object_type)(blob_type) )
712FC_REFLECT( fc::blob, (data) );
const mie::Vuint & p
Definition bn.cpp:27
An order-preserving dictionary of variants.
virtual void handle(const blob &v) const =0
virtual void handle(const int64_t &v) const =0
virtual void handle(const string &v) const =0
virtual void handle(const bool &v) const =0
virtual void handle() const =0
handles null_type variants
virtual void handle(const double &v) const =0
virtual void handle(const variant_object &v) const =0
virtual void handle(const uint64_t &v) const =0
virtual void handle(const variants &v) const =0
An order-preserving dictionary of variants.
stores null, int64, uint64, double, bool, string, std::vector<variant>, and variant_object's.
Definition variant.hpp:191
blob as_blob() const
Definition variant.cpp:518
variant & operator=(variant &&v)
Definition variant.cpp:230
bool is_array() const
Definition variant.cpp:368
variant_object & get_object()
Definition variant.cpp:554
variant & operator=(T &&v)
Definition variant.hpp:344
void clear()
Definition variant.cpp:168
const string & get_string() const
Definition variant.cpp:606
bool is_int64() const
Definition variant.cpp:330
void visit(const visitor &v) const
Definition variant.cpp:268
void as(T &v) const
Definition variant.hpp:335
uint64_t as_uint64() const
Definition variant.cpp:398
variant(const std::optional< T > &v)
Definition variant.hpp:350
bool is_null() const
Definition variant.cpp:309
bool is_integer() const
Definition variant.cpp:335
bool is_numeric() const
Definition variant.cpp:348
double as_double() const
Definition variant.cpp:420
size_t size() const
Definition variant.cpp:570
T as() const
Definition variant.hpp:327
bool as_bool() const
Definition variant.cpp:441
bool is_bool() const
Definition variant.cpp:318
blob & get_blob()
Definition variant.cpp:503
bool is_object() const
Definition variant.cpp:363
variant()
Constructs a null_type variant.
Definition variant.cpp:24
int64_t as_int64() const
Definition variant.cpp:377
size_t estimated_size() const
Definition variant.cpp:575
bool is_uint64() const
Definition variant.cpp:326
bool is_string() const
Definition variant.cpp:314
string as_string() const
Definition variant.cpp:469
bool is_double() const
Definition variant.cpp:322
bool is_blob() const
Definition variant.cpp:372
variants & get_array()
Definition variant.cpp:496
type_id get_type() const
Definition variant.cpp:304
const variant & operator[](const char *) const
Definition variant.cpp:561
namespace sysio::chain
Definition authority.cpp:3
std::string string
Definition string.hpp:10
bool operator<(const array< T, N > &a, const array< T, N > &b)
Definition array.hpp:94
auto operator+(const fwd< T, S, A > &x, U &&u) -> typename detail::add< T, U >::type
Definition fwd_impl.hpp:42
auto operator-(const fwd< T, S, A > &x, U &&u) -> typename detail::sub< T, U >::type
Definition fwd_impl.hpp:45
bool operator!(const fc::variant &a)
Definition variant.cpp:890
bool operator>(const array< T, N > &a, const array< T, N > &b)
Definition array.hpp:98
bool operator!=(const array< T, N > &a, const array< T, N > &b)
Definition array.hpp:102
bool operator==(const array< T, N > &a, const array< T, N > &b)
Definition array.hpp:91
std::vector< fc::variant > variants
Definition variant.hpp:173
fc::variant operator*(const fc::variant &a, const fc::variant &b)
Definition variant.cpp:976
boost::multiprecision::number< boost::multiprecision::cpp_int_backend< Size, Size, boost::multiprecision::unsigned_magnitude, boost::multiprecision::unchecked, void > > UInt
Definition variant.hpp:54
boost::multiprecision::number< boost::multiprecision::cpp_int_backend< Size, Size, boost::multiprecision::signed_magnitude, boost::multiprecision::unchecked, void > > Int
Definition variant.hpp:57
fc::variant operator/(const fc::variant &a, const fc::variant &b)
Definition variant.cpp:1001
std::optional< variant > ovariant
Definition variant.hpp:369
void from_variant(const fc::variant &v, sysio::chain::chain_id_type &cid)
void to_variant(const sysio::chain::shared_public_key &var, fc::variant &vo)
Definition authority.cpp:4
decltype(nullptr) nullptr_t
Definition utility.hpp:28
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
Definition pointer.h:1181
#define S(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p)
#define T(meth, val, expected)
#define FC_REFLECT_TYPENAME(TYPE)
Definition reflect.hpp:320
#define FC_REFLECT(TYPE, MEMBERS)
Specializes fc::reflector for TYPE.
Definition reflect.hpp:311
#define FC_REFLECT_ENUM(ENUM, FIELDS)
Definition reflect.hpp:194
signed short int16_t
Definition stdint.h:122
unsigned short uint16_t
Definition stdint.h:125
signed __int64 int64_t
Definition stdint.h:135
unsigned int uint32_t
Definition stdint.h:126
signed int int32_t
Definition stdint.h:123
unsigned char uint8_t
Definition stdint.h:124
unsigned __int64 uint64_t
Definition stdint.h:136
signed char int8_t
Definition stdint.h:121
std::vector< char > data
Definition variant.hpp:44
Definition dtoa.c:306
#define MAX_NUM_ARRAY_ELEMENTS
Definition utility.hpp:18
CK_ULONG d
char * s
memset(pInfo->slotDescription, ' ', 64)