Gromacs
2024.3
|
#include <gromacs/utility/include/gromacs/utility/keyvaluetreetransform.h>
Provides methods to specify one transformation rule.
The builder is implemented as a set of nested objects, each of which is provides methods for setting a particular property of the rule. Setting a property returns another object that has relevant methods for the context. This provides some structure to the methods, and catches at least some types of incorrect rules already at compile time. Additionally, if you use an IDE with completion facilities, it can nicely guide you through which values you need to specify. All values are stored within the main builder object, and the rule is created at the end of the statement.
Classes | |
class | AfterFrom |
Properties that can be specified after from(). More... | |
class | Base |
Base class used for implementing parameter provider objects. More... | |
class | ToObject |
Properties that can be specified after from().toObject(). More... | |
class | ToValue |
Properties that can be specified after from().to(). More... | |
Public Member Functions | |
KeyValueTreeTransformRuleBuilder (internal::KeyValueTreeTransformerImpl *impl, const KeyValueTreePath &prefix) | |
Internal constructor for creating a builder. | |
KeyValueTreeTransformRuleBuilder (KeyValueTreeTransformRuleBuilder &&)=default | |
Supports returning the builder from IKeyValueTreeTransformRules::addRule(). | |
KeyValueTreeTransformRuleBuilder & | operator= (KeyValueTreeTransformRuleBuilder &&)=default |
Supports returning the builder from IKeyValueTreeTransformRules::addRule(). | |
template<typename FromType > | |
AfterFrom< FromType > | from (const KeyValueTreePath &path) |
Specifies a rule that maps a value at given path. More... | |
void | keyMatchType (const KeyValueTreePath &path, StringCompareType keyMatchType) |
Specifies how strings are matched when matching rules against a path. More... | |
|
inline |
Specifies a rule that maps a value at given path.
FromType | Type of value expected at path . |
[in] | path | Path to map in this rule. |
If the input tree has path
, but it is not of type FromType
, the transform will produce an error.
It is an error to use the same path in two from() rules. Similarly, it is an error to use a child path of a path used in a different from() rule.
|
inline |
Specifies how strings are matched when matching rules against a path.
For properties of the object at path
, keyMatchType
is used for string comparison.
This rule must be specified first for a path, before any other from() rule specifies the path or a subpath. The rule only applies to immediate properties at the given path, not recursively. It is an error to specify the match type multiple times for a path.