BitShares-Core
7.0.2
BitShares blockchain node software and command-line wallet software
|
An order-perserving dictionary of variant's.
More...
#include <variant_object.hpp>
Public Types | |
typedef variant_object::entry | entry |
a key/value pair More... | |
typedef std::vector< entry >::iterator | iterator |
typedef std::vector< entry >::const_iterator | const_iterator |
Public Member Functions | |
variant & | operator[] (const string &key) |
variant & | operator[] (const char *key) |
template<typename T > | |
mutable_variant_object (T &&v) | |
mutable_variant_object () | |
mutable_variant_object (string key, variant val) | |
template<typename T > | |
mutable_variant_object (string key, T &&val) | |
mutable_variant_object (mutable_variant_object &&) | |
mutable_variant_object (const mutable_variant_object &) | |
mutable_variant_object (const variant_object &) | |
mutable_variant_object & | operator= (mutable_variant_object &&) |
mutable_variant_object & | operator= (const mutable_variant_object &) |
mutable_variant_object & | operator= (const 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 variant & | operator[] (const string &key) const |
const variant & | operator[] (const char *key) const |
size_t | size () const |
mutable Interface | |
Calling these methods will result in a copy of the underlying type being created if there is more than one reference to this object. | |
void | reserve (size_t s) |
iterator | begin () |
iterator | end () |
void | erase (const string &key) |
iterator | find (const string &key) |
iterator | find (const char *key) |
mutable_variant_object & | set (string key, variant var) |
mutable_variant_object & | operator() (string key, variant var, uint32_t max_depth=1) |
template<typename T > | |
mutable_variant_object & | operator() (string key, T &&var, uint32_t max_depth) |
mutable_variant_object & | operator() (const variant_object &vo) |
mutable_variant_object & | operator() (const mutable_variant_object &mvo) |
Friends | |
class | variant_object |
An order-perserving dictionary of variant's.
Keys are kept in the order they are inserted. This dictionary implements copy-on-write
Definition at line 108 of file variant_object.hpp.
typedef std::vector< entry >::const_iterator fc::mutable_variant_object::const_iterator |
Definition at line 115 of file variant_object.hpp.
a key/value pair
Definition at line 112 of file variant_object.hpp.
typedef std::vector< entry >::iterator fc::mutable_variant_object::iterator |
Definition at line 114 of file variant_object.hpp.
|
inlineexplicit |
Definition at line 191 of file variant_object.hpp.
fc::mutable_variant_object::mutable_variant_object | ( | ) |
Definition at line 261 of file variant_object.cpp.
fc::mutable_variant_object::mutable_variant_object | ( | string | key, |
variant | val | ||
) |
initializes the first key/value pair in the object
Definition at line 266 of file variant_object.cpp.
|
inline |
Definition at line 202 of file variant_object.hpp.
fc::mutable_variant_object::mutable_variant_object | ( | mutable_variant_object && | obj | ) |
Definition at line 282 of file variant_object.cpp.
fc::mutable_variant_object::mutable_variant_object | ( | const mutable_variant_object & | obj | ) |
Definition at line 277 of file variant_object.cpp.
fc::mutable_variant_object::mutable_variant_object | ( | const variant_object & | obj | ) |
Definition at line 272 of file variant_object.cpp.
iterator fc::mutable_variant_object::begin | ( | ) |
mutable_variant_object::iterator fc::mutable_variant_object::begin | ( | ) | const |
Definition at line 178 of file variant_object.cpp.
iterator fc::mutable_variant_object::end | ( | ) |
mutable_variant_object::iterator fc::mutable_variant_object::end | ( | ) | const |
Definition at line 183 of file variant_object.cpp.
void fc::mutable_variant_object::erase | ( | const string & | key | ) |
Definition at line 316 of file variant_object.cpp.
mutable_variant_object::iterator fc::mutable_variant_object::find | ( | const char * | key | ) |
Definition at line 220 of file variant_object.cpp.
mutable_variant_object::iterator fc::mutable_variant_object::find | ( | const char * | key | ) | const |
Definition at line 203 of file variant_object.cpp.
mutable_variant_object::iterator fc::mutable_variant_object::find | ( | const string & | key | ) |
Definition at line 215 of file variant_object.cpp.
mutable_variant_object::iterator fc::mutable_variant_object::find | ( | const string & | key | ) | const |
Definition at line 198 of file variant_object.cpp.
mutable_variant_object & fc::mutable_variant_object::operator() | ( | const mutable_variant_object & | mvo | ) |
Copy another mutable_variant_object into this mutable_variant_object.
Definition at line 359 of file variant_object.cpp.
mutable_variant_object & fc::mutable_variant_object::operator() | ( | const variant_object & | vo | ) |
Copy a variant_object into this mutable_variant_object.
Definition at line 352 of file variant_object.cpp.
|
inline |
Definition at line 173 of file variant_object.hpp.
mutable_variant_object & fc::mutable_variant_object::operator() | ( | string | key, |
variant | var, | ||
uint32_t | max_depth = 1 |
||
) |
Appends key and var without checking for duplicates, designed to simplify construction of dictionaries using (key,val)(key2,val2) syntax Convenience method to simplify the manual construction of variant_object's
Instead of: mutable_variant_object("c",c).set("a",a).set("b",b);
You can use: mutable_variant_object( "c", c )( "b", b)( "c",c )
Appends key and var without checking for duplicates, designed to simplify construction of dictionaries using (key,val)(key2,val2) syntax
Definition at line 346 of file variant_object.cpp.
mutable_variant_object & fc::mutable_variant_object::operator= | ( | const mutable_variant_object & | obj | ) |
Definition at line 302 of file variant_object.cpp.
mutable_variant_object & fc::mutable_variant_object::operator= | ( | const variant_object & | obj | ) |
Definition at line 287 of file variant_object.cpp.
mutable_variant_object & fc::mutable_variant_object::operator= | ( | mutable_variant_object && | obj | ) |
Definition at line 293 of file variant_object.cpp.
variant & fc::mutable_variant_object::operator[] | ( | const char * | key | ) |
Definition at line 248 of file variant_object.cpp.
const variant & fc::mutable_variant_object::operator[] | ( | const char * | key | ) | const |
Definition at line 237 of file variant_object.cpp.
variant & fc::mutable_variant_object::operator[] | ( | const string & | key | ) |
Definition at line 243 of file variant_object.cpp.
const variant & fc::mutable_variant_object::operator[] | ( | const string & | key | ) | const |
Definition at line 232 of file variant_object.cpp.
void fc::mutable_variant_object::reserve | ( | size_t | s | ) |
Definition at line 311 of file variant_object.cpp.
mutable_variant_object & fc::mutable_variant_object::set | ( | string | key, |
variant | var | ||
) |
replaces the value at key with var or insert's key if not found
Definition at line 329 of file variant_object.cpp.
size_t fc::mutable_variant_object::size | ( | ) | const |
Definition at line 256 of file variant_object.cpp.
|
friend |
Definition at line 217 of file variant_object.hpp.