BitShares-Core  7.0.2
BitShares blockchain node software and command-line wallet software
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Friends | List of all members
fc::static_variant< Types > Class Template Reference

#include <raw_fwd.hpp>

Classes

struct  import_helper
 
struct  import_helper< T, type_in_typelist< T > >
 
struct  tag
 
struct  type_eq
 
struct  type_lt
 

Public Types

using tag_type = int64_t
 
using list = typelist::list< Types... >
 
using flat_set_type = flat_set< static_variant, type_lt >
 

Public Member Functions

 static_variant ()
 
template<typename... Other>
 static_variant (const static_variant< Other... > &cpy)
 
 static_variant (const static_variant &cpy)
 
 static_variant (static_variant &&mv)
 
template<typename... Other>
 static_variant (static_variant< Other... > &&mv)
 
template<typename X , typename = type_in_typelist<X>>
 static_variant (const X &v)
 
template<typename X , typename = type_in_typelist<X>>
 static_variant (X &&v)
 
 ~static_variant ()
 
template<typename X , typename = type_in_typelist<X>>
static_variantoperator= (const X &v)
 
static_variantoperator= (const static_variant &v)
 
static_variantoperator= (static_variant &&v)
 
template<typename X , typename = type_in_typelist<X>>
X & get ()
 
template<typename X , typename = type_in_typelist<X>>
const X & get () const
 
template<typename visitor >
visitor::result_type visit (visitor &v)
 
template<typename visitor >
visitor::result_type visit (const visitor &v)
 
template<typename visitor >
visitor::result_type visit (visitor &v) const
 
template<typename visitor >
visitor::result_type visit (const visitor &v) const
 
void set_which (tag_type tag)
 
tag_type which () const
 
template<typename T >
bool is_type () const
 

Static Public Member Functions

template<typename... Other>
static static_variant import_from (const static_variant< Other... > &other)
 
template<typename... Other>
static static_variant import_from (static_variant< Other... > &&other)
 
template<typename visitor >
static visitor::result_type visit (tag_type tag, visitor &v, void *data)
 
template<typename visitor >
static visitor::result_type visit (tag_type tag, const visitor &v, void *data)
 
template<typename visitor >
static visitor::result_type visit (tag_type tag, visitor &v, const void *data)
 
template<typename visitor >
static visitor::result_type visit (tag_type tag, const visitor &v, const void *data)
 
static constexpr size_t count ()
 

Protected Types

template<typename X >
using type_in_typelist = std::enable_if_t< typelist::index_of< list, X >() !=-1 >
 

Protected Member Functions

template<typename X , typename = type_in_typelist<X>>
void init (const X &x)
 
template<typename X , typename = type_in_typelist<X>>
void init (X &&x)
 
void init_from_tag (tag_type tag)
 
void clean ()
 

Protected Attributes

tag_type _tag
 
impl::dynamic_storage storage
 

Friends

bool operator== (const static_variant &a, const static_variant &b)
 

Detailed Description

template<typename... Types>
class fc::static_variant< Types >

Definition at line 27 of file raw_fwd.hpp.

Member Typedef Documentation

◆ flat_set_type

template<typename... Types>
using fc::static_variant< Types >::flat_set_type = flat_set<static_variant, type_lt>

Definition at line 132 of file static_variant.hpp.

◆ list

template<typename... Types>
using fc::static_variant< Types >::list = typelist::list<Types...>

Definition at line 47 of file static_variant.hpp.

◆ tag_type

template<typename... Types>
using fc::static_variant< Types >::tag_type = int64_t

Definition at line 46 of file static_variant.hpp.

◆ type_in_typelist

template<typename... Types>
template<typename X >
using fc::static_variant< Types >::type_in_typelist = std::enable_if_t<typelist::index_of<list, X>() != -1>
protected

Definition at line 56 of file static_variant.hpp.

Constructor & Destructor Documentation

◆ static_variant() [1/7]

template<typename... Types>
fc::static_variant< Types >::static_variant ( )
inline

Definition at line 153 of file static_variant.hpp.

◆ static_variant() [2/7]

template<typename... Types>
template<typename... Other>
fc::static_variant< Types >::static_variant ( const static_variant< Other... > &  cpy)
inline

Definition at line 159 of file static_variant.hpp.

◆ static_variant() [3/7]

template<typename... Types>
fc::static_variant< Types >::static_variant ( const static_variant< Types > &  cpy)
inline

Definition at line 166 of file static_variant.hpp.

◆ static_variant() [4/7]

template<typename... Types>
fc::static_variant< Types >::static_variant ( static_variant< Types > &&  mv)
inline

Definition at line 173 of file static_variant.hpp.

◆ static_variant() [5/7]

template<typename... Types>
template<typename... Other>
fc::static_variant< Types >::static_variant ( static_variant< Other... > &&  mv)
inline

Definition at line 181 of file static_variant.hpp.

◆ static_variant() [6/7]

template<typename... Types>
template<typename X , typename = type_in_typelist<X>>
fc::static_variant< Types >::static_variant ( const X &  v)
inline

Definition at line 189 of file static_variant.hpp.

◆ static_variant() [7/7]

template<typename... Types>
template<typename X , typename = type_in_typelist<X>>
fc::static_variant< Types >::static_variant ( X &&  v)
inline

Definition at line 193 of file static_variant.hpp.

◆ ~static_variant()

template<typename... Types>
fc::static_variant< Types >::~static_variant ( )
inline

Definition at line 197 of file static_variant.hpp.

Member Function Documentation

◆ clean()

template<typename... Types>
void fc::static_variant< Types >::clean ( )
inlineprotected

Definition at line 89 of file static_variant.hpp.

◆ count()

template<typename... Types>
static constexpr size_t fc::static_variant< Types >::count ( )
inlinestaticconstexpr

Definition at line 319 of file static_variant.hpp.

◆ get() [1/2]

template<typename... Types>
template<typename X , typename = type_in_typelist<X>>
X& fc::static_variant< Types >::get ( )
inline

Definition at line 236 of file static_variant.hpp.

◆ get() [2/2]

template<typename... Types>
template<typename X , typename = type_in_typelist<X>>
const X& fc::static_variant< Types >::get ( ) const
inline

Definition at line 246 of file static_variant.hpp.

◆ import_from() [1/2]

template<typename... Types>
template<typename... Other>
static static_variant fc::static_variant< Types >::import_from ( const static_variant< Other... > &  other)
inlinestatic

Import the value from a foreign static_variant with types not in this one, and throw if the value is an incompatible type

Definition at line 137 of file static_variant.hpp.

◆ import_from() [2/2]

template<typename... Types>
template<typename... Other>
static static_variant fc::static_variant< Types >::import_from ( static_variant< Other... > &&  other)
inlinestatic

Import the value from a foreign static_variant with types not in this one, and throw if the value is an incompatible type

Definition at line 146 of file static_variant.hpp.

◆ init() [1/2]

template<typename... Types>
template<typename X , typename = type_in_typelist<X>>
void fc::static_variant< Types >::init ( const X &  x)
inlineprotected

Definition at line 62 of file static_variant.hpp.

◆ init() [2/2]

template<typename... Types>
template<typename X , typename = type_in_typelist<X>>
void fc::static_variant< Types >::init ( X &&  x)
inlineprotected

Definition at line 69 of file static_variant.hpp.

◆ init_from_tag()

template<typename... Types>
void fc::static_variant< Types >::init_from_tag ( tag_type  tag)
inlineprotected

Definition at line 75 of file static_variant.hpp.

◆ is_type()

template<typename... Types>
template<typename T >
bool fc::static_variant< Types >::is_type ( ) const
inline

Definition at line 332 of file static_variant.hpp.

◆ operator=() [1/3]

template<typename... Types>
static_variant& fc::static_variant< Types >::operator= ( const static_variant< Types > &  v)
inline

Definition at line 207 of file static_variant.hpp.

◆ operator=() [2/3]

template<typename... Types>
template<typename X , typename = type_in_typelist<X>>
static_variant& fc::static_variant< Types >::operator= ( const X &  v)
inline

Definition at line 202 of file static_variant.hpp.

◆ operator=() [3/3]

template<typename... Types>
static_variant& fc::static_variant< Types >::operator= ( static_variant< Types > &&  v)
inline

Definition at line 216 of file static_variant.hpp.

◆ set_which()

template<typename... Types>
void fc::static_variant< Types >::set_which ( tag_type  tag)
inline

Definition at line 320 of file static_variant.hpp.

◆ visit() [1/8]

template<typename... Types>
template<typename visitor >
visitor::result_type fc::static_variant< Types >::visit ( const visitor &  v)
inline

Definition at line 261 of file static_variant.hpp.

◆ visit() [2/8]

template<typename... Types>
template<typename visitor >
visitor::result_type fc::static_variant< Types >::visit ( const visitor &  v) const
inline

Definition at line 271 of file static_variant.hpp.

◆ visit() [3/8]

template<typename... Types>
template<typename visitor >
static visitor::result_type fc::static_variant< Types >::visit ( tag_type  tag,
const visitor &  v,
const void *  data 
)
inlinestatic

Definition at line 309 of file static_variant.hpp.

◆ visit() [4/8]

template<typename... Types>
template<typename visitor >
static visitor::result_type fc::static_variant< Types >::visit ( tag_type  tag,
const visitor &  v,
void *  data 
)
inlinestatic

Definition at line 287 of file static_variant.hpp.

◆ visit() [5/8]

template<typename... Types>
template<typename visitor >
static visitor::result_type fc::static_variant< Types >::visit ( tag_type  tag,
visitor &  v,
const void *  data 
)
inlinestatic

Definition at line 298 of file static_variant.hpp.

◆ visit() [6/8]

template<typename... Types>
template<typename visitor >
static visitor::result_type fc::static_variant< Types >::visit ( tag_type  tag,
visitor &  v,
void *  data 
)
inlinestatic

Definition at line 276 of file static_variant.hpp.

◆ visit() [7/8]

template<typename... Types>
template<typename visitor >
visitor::result_type fc::static_variant< Types >::visit ( visitor &  v)
inline

Definition at line 256 of file static_variant.hpp.

◆ visit() [8/8]

template<typename... Types>
template<typename visitor >
visitor::result_type fc::static_variant< Types >::visit ( visitor &  v) const
inline

Definition at line 266 of file static_variant.hpp.

◆ which()

template<typename... Types>
tag_type fc::static_variant< Types >::which ( ) const
inline

Definition at line 329 of file static_variant.hpp.

Friends And Related Function Documentation

◆ operator==

template<typename... Types>
bool operator== ( const static_variant< Types > &  a,
const static_variant< Types > &  b 
)
friend

Definition at line 226 of file static_variant.hpp.

Member Data Documentation

◆ _tag

template<typename... Types>
tag_type fc::static_variant< Types >::_tag
protected

Definition at line 58 of file static_variant.hpp.

◆ storage

template<typename... Types>
impl::dynamic_storage fc::static_variant< Types >::storage
protected

Definition at line 59 of file static_variant.hpp.


The documentation for this class was generated from the following files: