BitShares-Core  7.0.2
BitShares blockchain node software and command-line wallet software
Classes | Public Types | Public Member Functions | Friends | List of all members
fc::variant_object Class Reference

An order-perserving dictionary of variant's.
More...

#include <variant_object.hpp>

Classes

class  entry
 a key/value pair More...
 

Public Types

typedef std::vector< entry >::const_iterator iterator
 

Public Member Functions

 variant_object ()
 
 variant_object (string key, variant val)
 
template<typename T >
 variant_object (string key, T &&val)
 
 variant_object (const variant_object &)
 
 variant_object (variant_object &&)
 
 variant_object (const mutable_variant_object &)
 
 variant_object (mutable_variant_object &&)
 
variant_objectoperator= (variant_object &&)
 
variant_objectoperator= (const variant_object &)
 
variant_objectoperator= (mutable_variant_object &&)
 
variant_objectoperator= (const mutable_variant_object &)
 
Immutable Interface

Calling these methods will not result in copies of the underlying type.

iterator begin () const
 
iterator end () const
 
iterator find (const string &key) const
 
iterator find (const char *key) const
 
const variantoperator[] (const string &key) const
 
const variantoperator[] (const char *key) const
 
size_t size () const
 
bool contains (const char *key) const
 

Friends

class mutable_variant_object
 

Detailed Description

An order-perserving dictionary of variant's.

Keys are kept in the order they are inserted. This dictionary implements copy-on-write

Note
This class is not optimized for random-access on large sets of key-value pairs.

Definition at line 20 of file variant_object.hpp.

Member Typedef Documentation

◆ iterator

typedef std::vector< entry >::const_iterator fc::variant_object::iterator

Definition at line 45 of file variant_object.hpp.

Constructor & Destructor Documentation

◆ variant_object() [1/7]

fc::variant_object::variant_object ( )

Definition at line 98 of file variant_object.cpp.

◆ variant_object() [2/7]

fc::variant_object::variant_object ( string  key,
variant  val 
)

initializes the first key/value pair in the object

Definition at line 103 of file variant_object.cpp.

◆ variant_object() [3/7]

template<typename T >
fc::variant_object::variant_object ( string  key,
T &&  val 
)
inline

Definition at line 70 of file variant_object.hpp.

◆ variant_object() [4/7]

fc::variant_object::variant_object ( const variant_object obj)

Definition at line 109 of file variant_object.cpp.

◆ variant_object() [5/7]

fc::variant_object::variant_object ( variant_object &&  obj)

Definition at line 115 of file variant_object.cpp.

◆ variant_object() [6/7]

fc::variant_object::variant_object ( const mutable_variant_object obj)

Definition at line 122 of file variant_object.cpp.

◆ variant_object() [7/7]

fc::variant_object::variant_object ( mutable_variant_object &&  obj)

Definition at line 127 of file variant_object.cpp.

Member Function Documentation

◆ begin()

variant_object::iterator fc::variant_object::begin ( ) const

Definition at line 53 of file variant_object.cpp.

◆ contains()

bool fc::variant_object::contains ( const char *  key) const
inline

Definition at line 61 of file variant_object.hpp.

◆ end()

variant_object::iterator fc::variant_object::end ( ) const

Definition at line 59 of file variant_object.cpp.

◆ find() [1/2]

variant_object::iterator fc::variant_object::find ( const char *  key) const

Definition at line 69 of file variant_object.cpp.

◆ find() [2/2]

variant_object::iterator fc::variant_object::find ( const string &  key) const

Definition at line 64 of file variant_object.cpp.

◆ operator=() [1/4]

variant_object & fc::variant_object::operator= ( const mutable_variant_object obj)

Definition at line 159 of file variant_object.cpp.

◆ operator=() [2/4]

variant_object & fc::variant_object::operator= ( const variant_object obj)

Definition at line 143 of file variant_object.cpp.

◆ operator=() [3/4]

variant_object & fc::variant_object::operator= ( mutable_variant_object &&  obj)

Definition at line 152 of file variant_object.cpp.

◆ operator=() [4/4]

variant_object & fc::variant_object::operator= ( variant_object &&  obj)

Definition at line 133 of file variant_object.cpp.

◆ operator[]() [1/2]

const variant & fc::variant_object::operator[] ( const char *  key) const

Definition at line 86 of file variant_object.cpp.

◆ operator[]() [2/2]

const variant & fc::variant_object::operator[] ( const string &  key) const

Definition at line 81 of file variant_object.cpp.

◆ size()

size_t fc::variant_object::size ( ) const

Definition at line 93 of file variant_object.cpp.

Friends And Related Function Documentation

◆ mutable_variant_object

friend class mutable_variant_object
friend

Definition at line 89 of file variant_object.hpp.


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