BitShares-Core  5.0.0
BitShares blockchain implementation and command-line interface software
Classes | Namespaces | Macros | Typedefs | Functions
variant.hpp File Reference
#include <array>
#include <cstddef>
#include <deque>
#include <map>
#include <memory>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include <string.h>
#include <fc/optional.hpp>
#include <fc/uint128.hpp>
#include <fc/container/flat_fwd.hpp>
#include <fc/crypto/hex.hpp>
#include <boost/endian/buffers.hpp>
#include <boost/multi_index_container_fwd.hpp>
#include <fc/reflect/reflect.hpp>

Go to the source code of this file.

Classes

struct  fc::safe< T >
 
class  fc::static_variant< Types >
 
struct  fc::blob
 
class  fc::variant
 stores null, int64, uint64, double, bool, string, std::vector<variant>, and variant_object's. More...
 
class  fc::variant::visitor
 

Namespaces

 fc
 

Macros

#define _FC_ASSERT(cond, msg)   { if( !(cond) ) { char t[] = #cond ": " msg; fc::throw_assertion_failure( t ); } }
 

Typedefs

typedef std::vector< variant > fc::variants
 
typedef optional< variant > fc::ovariant
 

Functions

void fc::throw_assertion_failure (const std::string &message)
 
void fc::to_variant (const blob &var, variant &vo, uint32_t max_depth=1)
 
void fc::from_variant (const variant &var, blob &vo, uint32_t max_depth=1)
 
template<typename T , typename... Args>
void fc::to_variant (const boost::multi_index_container< T, Args... > &s, variant &v, uint32_t max_depth)
 
template<typename T , typename... Args>
void fc::from_variant (const variant &v, boost::multi_index_container< T, Args... > &s, uint32_t max_depth)
 
template<typename T >
void fc::to_variant (const safe< T > &s, variant &v, uint32_t max_depth)
 
template<typename T >
void fc::from_variant (const variant &v, safe< T > &s, uint32_t max_depth)
 
template<typename T >
void fc::to_variant (const std::unique_ptr< T > &s, variant &v, uint32_t max_depth)
 
template<typename T >
void fc::from_variant (const variant &v, std::unique_ptr< T > &s, uint32_t max_depth)
 
template<typename... T>
void fc::to_variant (const fc::static_variant< T... > &s, fc::variant &v, uint32_t max_depth)
 
template<typename... T>
void fc::from_variant (const fc::variant &v, fc::static_variant< T... > &s, uint32_t max_depth)
 
void fc::to_variant (const uint8_t &var, variant &vo, uint32_t max_depth=1)
 
void fc::from_variant (const variant &var, uint8_t &vo, uint32_t max_depth=1)
 
void fc::to_variant (const int8_t &var, variant &vo, uint32_t max_depth=1)
 
void fc::from_variant (const variant &var, int8_t &vo, uint32_t max_depth=1)
 
void fc::to_variant (const uint16_t &var, variant &vo, uint32_t max_depth=1)
 
void fc::from_variant (const variant &var, uint16_t &vo, uint32_t max_depth=1)
 
void fc::to_variant (const int16_t &var, variant &vo, uint32_t max_depth=1)
 
void fc::from_variant (const variant &var, int16_t &vo, uint32_t max_depth=1)
 
void fc::to_variant (const uint32_t &var, variant &vo, uint32_t max_depth=1)
 
void fc::from_variant (const variant &var, uint32_t &vo, uint32_t max_depth=1)
 
void fc::to_variant (const int32_t &var, variant &vo, uint32_t max_depth=1)
 
void fc::from_variant (const variant &var, int32_t &vo, uint32_t max_depth=1)
 
void fc::to_variant (const uint64_t &var, variant &vo, uint32_t max_depth=1)
 
void fc::to_variant (const int64_t &var, variant &vo, uint32_t max_depth=1)
 
void fc::to_variant (const bool &var, variant &vo, uint32_t max_depth=1)
 
void fc::to_variant (const variant_object &var, variant &vo, uint32_t max_depth)
 
void fc::from_variant (const variant &var, variant_object &vo, uint32_t max_depth)
 
void fc::to_variant (const mutable_variant_object &var, variant &vo, uint32_t max_depth)
 
void fc::from_variant (const variant &var, mutable_variant_object &vo, uint32_t max_depth)
 
void fc::to_variant (const std::vector< char > &var, variant &vo, uint32_t max_depth=1)
 
void fc::from_variant (const variant &var, std::vector< char > &vo, uint32_t max_depth=1)
 
template<typename K , typename T >
void fc::to_variant (const std::unordered_map< K, T > &var, variant &vo, uint32_t max_depth)
 
template<typename K , typename T >
void fc::from_variant (const variant &var, std::unordered_map< K, T > &vo, uint32_t max_depth)
 
template<typename K , typename... T>
void fc::to_variant (const flat_map< K, T... > &var, variant &vo, uint32_t _max_depth)
 
template<typename K , typename T , typename... A>
void fc::from_variant (const variant &var, flat_map< K, T, A... > &vo, uint32_t _max_depth)
 
template<typename K , typename T >
void fc::to_variant (const std::map< K, T > &var, variant &vo, uint32_t max_depth)
 
template<typename K , typename T >
void fc::from_variant (const variant &var, std::map< K, T > &vo, uint32_t max_depth)
 
template<typename K , typename T >
void fc::to_variant (const std::multimap< K, T > &var, variant &vo, uint32_t max_depth)
 
template<typename K , typename T >
void fc::from_variant (const variant &var, std::multimap< K, T > &vo, uint32_t max_depth)
 
template<typename T >
void fc::to_variant (const std::unordered_set< T > &var, variant &vo, uint32_t max_depth)
 
template<typename T >
void fc::from_variant (const variant &var, std::unordered_set< T > &vo, uint32_t max_depth)
 
template<typename T >
void fc::to_variant (const std::deque< T > &var, variant &vo, uint32_t max_depth)
 
template<typename T >
void fc::from_variant (const variant &var, std::deque< T > &vo, uint32_t max_depth)
 
template<typename T , typename... A>
void fc::to_variant (const flat_set< T, A... > &var, variant &vo, uint32_t _max_depth)
 
template<typename T , typename... A>
void fc::from_variant (const variant &var, flat_set< T, A... > &vo, uint32_t _max_depth)
 
template<typename T >
void fc::to_variant (const std::set< T > &var, variant &vo, uint32_t max_depth)
 
template<typename T >
void fc::from_variant (const variant &var, std::set< T > &vo, uint32_t max_depth)
 
void fc::to_variant (const time_point &var, variant &vo, uint32_t max_depth)
 
void fc::from_variant (const variant &var, time_point &vo, uint32_t max_depth)
 
void fc::to_variant (const time_point_sec &var, variant &vo, uint32_t max_depth)
 
void fc::from_variant (const variant &var, time_point_sec &vo, uint32_t max_depth)
 
void fc::to_variant (const fc::microseconds &, fc::variant &, uint32_t max_depth=1)
 
void fc::from_variant (const fc::variant &, fc::microseconds &, uint32_t max_depth=1)
 
void fc::to_variant (const uint128_t &var, variant &vo, uint32_t max_depth=1)
 
void fc::from_variant (const variant &var, uint128_t &vo, uint32_t max_depth=1)
 
void fc::to_variant (long long int s, variant &v, uint32_t max_depth=1)
 
void fc::to_variant (unsigned long long int s, variant &v, uint32_t max_depth=1)
 
void fc::to_variant (const std::string &s, variant &v, uint32_t max_depth=1)
 
template<typename T >
void fc::to_variant (const std::shared_ptr< T > &var, variant &vo, uint32_t max_depth)
 
template<typename T >
void fc::from_variant (const variant &var, std::shared_ptr< T > &vo, uint32_t max_depth)
 
template<typename A , typename B >
void fc::to_variant (const std::pair< A, B > &t, variant &v, uint32_t max_depth)
 
template<typename A , typename B >
void fc::from_variant (const variant &v, std::pair< A, B > &p, uint32_t max_depth)
 
template<boost::endian::order O, class T , std::size_t N, boost::endian::align A>
void fc::to_variant (const boost::endian::endian_buffer< O, T, N, A > &var, variant &vo, uint32_t max_depth)
 
template<boost::endian::order O, class T , std::size_t N, boost::endian::align A>
void fc::from_variant (const variant &var, boost::endian::endian_buffer< O, T, N, A > &vo, uint32_t max_depth)
 
void fc::from_variant (const variant &var, std::string &vo, uint32_t max_depth=1)
 
void fc::from_variant (const variant &var, variants &vo, uint32_t max_depth)
 
void fc::from_variant (const variant &var, variant &vo, uint32_t max_depth)
 
void fc::from_variant (const variant &var, int64_t &vo, uint32_t max_depth=1)
 
void fc::from_variant (const variant &var, uint64_t &vo, uint32_t max_depth=1)
 
void fc::from_variant (const variant &var, bool &vo, uint32_t max_depth=1)
 
void fc::from_variant (const variant &var, double &vo, uint32_t max_depth=1)
 
void fc::from_variant (const variant &var, float &vo, uint32_t max_depth=1)
 
template<typename T >
void fc::from_variant (const variant &var, optional< T > &vo, uint32_t max_depth)
 
template<typename T >
void fc::from_variant (const variant &var, std::vector< T > &dest, uint32_t max_depth)
 
template<typename T >
void fc::to_variant (const std::vector< T > &t, variant &v, uint32_t max_depth)
 
template<size_t N>
void fc::to_variant (const std::array< char, N > &bi, variant &v, uint32_t max_depth=1)
 
template<size_t N>
void fc::from_variant (const variant &v, std::array< char, N > &bi, uint32_t max_depth=1)
 
template<size_t N>
void fc::to_variant (const std::array< unsigned char, N > &bi, variant &v, uint32_t max_depth=1)
 
template<size_t N>
void fc::from_variant (const variant &v, std::array< unsigned char, N > &bi, uint32_t max_depth=1)
 
variant fc::operator+ (const variant &a, const variant &b)
 
variant fc::operator- (const variant &a, const variant &b)
 
variant fc::operator* (const variant &a, const variant &b)
 
variant fc::operator/ (const variant &a, const variant &b)
 
bool fc::operator== (const variant &a, const variant &b)
 
bool fc::operator!= (const variant &a, const variant &b)
 
bool fc::operator< (const variant &a, const variant &b)
 
bool fc::operator> (const variant &a, const variant &b)
 
bool fc::operator! (const variant &a)
 

Macro Definition Documentation

#define _FC_ASSERT (   cond,
  msg 
)    { if( !(cond) ) { char t[] = #cond ": " msg; fc::throw_assertion_failure( t ); } }

Definition at line 30 of file variant.hpp.