ppap4lmp  0.7.2
add_child_ids.h
Go to the documentation of this file.
1 
9 #ifndef ADD_CHILD_IDS_H
10 #define ADD_CHILD_IDS_H
11 
12 #include <adders/adder.h>
13 
33 class AddChildIDs : public Adder {
43  protected:
61  virtual void compute_impl(
62  Json &data,
63  JsonToVoidFunc check_required_keys,
64  JsonToBoolFunc check_optional_keys) override;
65  public:
98  const ElPtr &elem,
99  const Str &child_name_,
100  const Str &key_for_parent_id_);
101  virtual ~AddChildIDs() = default;
102 };
103 
104 #endif
ShPtr< Element > ElPtr
An alias for a shared pointer of Element class.
Definition: element.h:378
AddChildIDs adds id property of a child Element object to a parent Element object.
Definition: add_child_ids.h:33
Adder adds new properties to a non-empty Element object.
Definition: adder.h:24
std::function< bool(const Json &)> JsonToBoolFunc
An alias for a function accepts a Json object and returns a bool.
Definition: updater.h:20
std::string Str
Str is an alias for string.
Definition: std.h:21
nlohmann::json Json
Json is an alias for nlohmann::json.
Definition: json.h:22
This file has a definition of Adder class, which is a subclass of Updater class.
virtual void compute_impl(Json &data, JsonToVoidFunc check_required_keys, JsonToBoolFunc check_optional_keys) override
This method overrides Updater::compute_impl.
Str key_for_parent_id
Definition: add_child_ids.h:42
std::function< void(const Json &)> JsonToVoidFunc
An alias for a function accepts a Json object.
Definition: updater.h:18
AddChildIDs(const ElPtr &elem, const Str &child_name_, const Str &key_for_parent_id_)
Constructor of AddChildIDs class.