ppap4lmp  0.7.2
AddChildIDs Class Reference

AddChildIDs adds id property of a child Element object to a parent Element object. More...

#include <add_child_ids.h>

Inheritance diagram for AddChildIDs:
Collaboration diagram for AddChildIDs:

Public Member Functions

 AddChildIDs (const ElPtr &elem, const Str &child_name_, const Str &key_for_parent_id_)
 Constructor of AddChildIDs class. More...
 
- Public Member Functions inherited from Adder
 Updater ()=default
 Constructor of Updater class. More...
 
- Public Member Functions inherited from Updater
 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. More...
 
- Protected Member Functions inherited from Adder
virtual void compute_body (const ElPtr &elem, Json &data) override
 Compute properties and add them to Element::data given as a mutable reference. More...
 
- Protected Member Functions inherited from Updater
virtual void compute_common (const ElPtr &elem, Json &data)
 Common part of compute_body. More...
 

Private Attributes

Str child_name
 
Str key_for_parent_id
 

Additional Inherited Members

- Protected Attributes inherited from Updater
ShPtr< Generatorext_generator
 

Detailed Description

AddChildIDs adds id property of a child Element object to a parent Element object.

An object of this class owns a child Element object as ext_generator, and is appended to a parent object using its Element::append_updater. The object of this class appends values for id property of the child object to an array belonging to the parent object. An example of child is an Element object containing data for atoms, and an example of parent* is an Element object containing data for molecules.

The terms child and parent are used because a parent object consists of a child object. In terms of time series, however, the child is created earlier than the parent.

About usage in Python, please see pybind::py_add_child_ids.

Definition at line 33 of file add_child_ids.h.

Constructor & Destructor Documentation

◆ AddChildIDs()

AddChildIDs::AddChildIDs ( const ElPtr elem,
const Str child_name_,
const Str key_for_parent_id_ 
)

Constructor of AddChildIDs class.

Parameters
elem

A child Element object. This parameter is assigned to ext_generator.

Required property
  • id : integer
  • [key_for_parent_id] : integer

child_name_A string for naming the child object. This parameter is assigned to child_name.
key_for_parent_id_A string for key in the child object corresponding to id of parent object. This parameter is assigned to key_for_parent_id.

Definition at line 17 of file add_child_ids.cpp.

Member Function Documentation

◆ compute_impl()

void AddChildIDs::compute_impl ( Json data,
JsonToVoidFunc  check_required_keys,
JsonToBoolFunc  check_optional_keys 
)
overrideprotectedvirtual

This method overrides Updater::compute_impl.

Property to be added
  • [child_name]-ids : array of integers
Required property
  • id : integer

Implements Updater.

Definition at line 29 of file add_child_ids.cpp.

Here is the call graph for this function:

Member Data Documentation

◆ child_name

Str AddChildIDs::child_name
private

Name of child object stored as ext_generator. Key for property added by this class is named as [child_name]-ids.

Definition at line 38 of file add_child_ids.h.

◆ key_for_parent_id

Str AddChildIDs::key_for_parent_id
private

Key in ext_generator corresponding to id of parent object.

Definition at line 42 of file add_child_ids.h.


The documentation for this class was generated from the following files: