BitShares-Core  4.0.0
BitShares blockchain implementation and command-line interface 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

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

Definition at line 45 of file variant_object.hpp.

Constructor & Destructor Documentation

fc::variant_object::variant_object ( )

Definition at line 98 of file variant_object.cpp.

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.

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

Definition at line 70 of file variant_object.hpp.

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

Definition at line 109 of file variant_object.cpp.

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

Definition at line 115 of file variant_object.cpp.

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

Definition at line 122 of file variant_object.cpp.

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

Definition at line 127 of file variant_object.cpp.

Member Function Documentation

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

Definition at line 53 of file variant_object.cpp.

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

Definition at line 61 of file variant_object.hpp.

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

Definition at line 59 of file variant_object.cpp.

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

Definition at line 64 of file variant_object.cpp.

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

Definition at line 69 of file variant_object.cpp.

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

Definition at line 133 of file variant_object.cpp.

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

Definition at line 143 of file variant_object.cpp.

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

Definition at line 152 of file variant_object.cpp.

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

Definition at line 159 of file variant_object.cpp.

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

Definition at line 81 of file variant_object.cpp.

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

Definition at line 86 of file variant_object.cpp.

size_t fc::variant_object::size ( ) const

Definition at line 93 of file variant_object.cpp.

Friends And Related Function Documentation

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: