Gromacs
2018.1
|
#include <gromacs/utility/keyvaluetreebuilder.h>
Builder for KeyValueTreeObject objects.
The builder does not own the object being constructed, but instead holds a reference to an object within a tree rooted in KeyValueTreeBuilder or KeyValueTreeValueBuilder.
Public Member Functions | |
void | addRawValue (const std::string &key, KeyValueTreeValue &&value) |
Adds a property with given key from a KeyValueTreeValue. | |
void | addRawValue (const std::string &key, Variant &&value) |
Adds a property with given key from a Variant value. | |
template<typename T > | |
void | addValue (const std::string &key, const T &value) |
Adds a scalar property with given key, type, and value. | |
KeyValueTreeObjectBuilder | addObject (const std::string &key) |
Adds an object-valued property with given key. More... | |
KeyValueTreeArrayBuilder | addArray (const std::string &key) |
Adds a generic array-valued property with given key. More... | |
template<typename T > | |
KeyValueTreeUniformArrayBuilder < T > | addUniformArray (const std::string &key) |
Adds an array-valued property with uniform value types with given key. More... | |
template<typename T > | |
void | addUniformArray (const std::string &key, std::initializer_list< T > values) |
Adds an array-valued property with uniform value types with given key and values. More... | |
KeyValueTreeObjectArrayBuilder | addObjectArray (const std::string &key) |
Adds an array-valued property with objects in the array with given key. More... | |
bool | keyExists (const std::string &key) const |
Whether a property with given key exists. | |
const KeyValueTreeValue & | operator[] (const std::string &key) const |
Returns value for a given key. | |
KeyValueTreeObjectBuilder | getObjectBuilder (const std::string &key) |
Returns an object builder for an existing object. | |
bool | objectHasDistinctProperties (const KeyValueTreeObject &obj) const |
Returns whether the given object shares any keys with this . | |
void | mergeObject (KeyValueTreeObject &&obj) |
Merges properties from a given object to this . More... | |
Friends | |
class | KeyValueTreeBuilder |
class | KeyValueTreeValueBuilder |
class | KeyValueTreeObjectArrayBuilder |
|
inline |
Adds a generic array-valued property with given key.
The array is created empty and can be built using the returned builder.
|
inline |
Adds an object-valued property with given key.
The object is created empty and can be built using the returned builder.
|
inline |
Adds an array-valued property with objects in the array with given key.
The array is created empty and can be built using the returned builder.
|
inline |
Adds an array-valued property with uniform value types with given key.
T | Type for all values in the array. |
The array is created empty and can be built using the returned builder.
|
inline |
Adds an array-valued property with uniform value types with given key and values.
T | Type for all values in the array. |
The array is created to contain the values from values
.
|
inline |
Merges properties from a given object to this
.
The objects should not share any keys, i.e., objectHasDistinctProperties() should return true
.