ppap4lmp
0.7.2
|
AddRename renames an existing property. More...
#include <add_rename.h>
Public Member Functions | |
AddRename (const Str &key_old_, const Str &key_new_) | |
Constructor of AddRename class. More... | |
ShPtr< AddRename > | overwrite (bool do_overwrite_=true) |
Allow overwriting an existing property by a renamed property with the same name. More... | |
![]() | |
Updater ()=default | |
Constructor of Updater class. More... | |
![]() | |
Updater ()=default | |
Constructor of Updater class. More... | |
void | compute (const ElPtr &elem, const int elementid, Json &data) |
Managing computation to update Element::data. More... | |
void | remove_from_skippable_elementids (const int elementid) |
Remove Element::elementid from skippable_elementids. More... | |
const ShPtr< Generator > & | get_ext_generator () |
Get ext_generator of this object. More... | |
Protected Member Functions | |
virtual void | compute_impl (Json &data, JsonToVoidFunc check_required_keys, JsonToBoolFunc check_optional_keys) override |
This method overrides Updater::compute_impl. | |
![]() | |
virtual void | compute_body (const ElPtr &elem, Json &data) override |
Compute properties and add them to Element::data given as a mutable reference. More... | |
![]() | |
virtual void | compute_common (const ElPtr &elem, Json &data) |
Common part of compute_body. More... | |
Private Attributes | |
bool | do_overwrite = false |
Str | key_old |
Str | key_new |
Additional Inherited Members | |
![]() | |
ShPtr< Generator > | ext_generator |
AddRename renames an existing property.
An object of this class simply renames an existing property of an Element object; that is, copies values for the existing property, store the values with a new user-defined name, and then deletes the old property.
About usage in Python, please see pybind::py_add_rename.
Definition at line 25 of file add_rename.h.
Constructor of AddRename class.
key_old_ | A string key for an existing property to be renamed. This parameter is assigned to key_old. |
key_new_ | A string key by which the old key for the existing property is renamed. This parameter is assigned to key_new. |
Definition at line 16 of file add_rename.cpp.
Allow overwriting an existing property by a renamed property with the same name.
do_overwrite_ | A boolean, whether an existing property can be overwritten by a renamed property (default is true ). This parameter is assigned to do_overwrite. |
Please be careful not to call this method in a multithreading context because it is thread-unsafe.
Definition at line 57 of file add_rename.cpp.
|
private |
Whether overwriting an existing property whose name is the same as key_new (default is false
).
Definition at line 30 of file add_rename.h.
|
private |
New key by which the existing property is renamed.
Definition at line 38 of file add_rename.h.
|
private |
Key for an existing property to be renamed.
Definition at line 34 of file add_rename.h.