ppap4lmp  0.7.2
Starter Class Reference

Starter sets some properties to an empty Element object. More...

#include <starter.h>

Inheritance diagram for Starter:
Collaboration diagram for Starter:

Public Member Functions

 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_body (const ElPtr &elem, Json &data) override
 Compute or parse properties and set 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...
 
virtual void compute_impl (Json &data, JsonToVoidFunc check_required_keys, JsonToBoolFunc check_optional_keys)=0
 Implementation of computation updating Element::data. More...
 

Static Protected Attributes

static const bool do_sorting_by_id = true
 

Private Member Functions

void sort_by_id (Json &data)
 

Additional Inherited Members

- Protected Attributes inherited from Updater
ShPtr< Generatorext_generator
 

Detailed Description

Starter sets some properties to an empty Element object.

This class inherits Updater class and overrides Updater::compute. This class is an abstract class and has a pure virtual function, Starter::compute_impl.

Name of subclass of this class should be prefixed by Sta. Unlike Adder, Starter accepts only empty Element::data.

Definition at line 24 of file starter.h.

Member Function Documentation

◆ compute_body()

void Starter::compute_body ( const ElPtr elem,
Json data 
)
overrideprotectedvirtual

Compute or parse properties and set them to Element::data given as a mutable reference.

Parameters
elemShared pointer to an Element object where computed properties are set to.
dataMutable reference to Element::data where computed properties are set to.
Returns
None.

This method sorts elements of the data by id property, if the data is array and id property exists.

Implements Updater.

Definition at line 38 of file starter.cpp.

Here is the call graph for this function:

◆ sort_by_id()

void Starter::sort_by_id ( Json data)
private

Sort elements of a array Json object by its id property.

Parameters
dataMutable reference to a Json object.
Returns
None.

Definition at line 17 of file starter.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Updater()

Updater::Updater
default

Constructor of Updater class.

This constructor is thread-unsafe because it accesses its members thread-globally. Ensure this constructor is not called in a multithreading context. Please be careful that constructors of subclasses of this class are also thread-unsafe.

Member Data Documentation

◆ do_sorting_by_id

const bool Starter::do_sorting_by_id = true
staticprotected

Whether to call sort_by_id after setting data.

Definition at line 39 of file starter.h.


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