ppap4lmp  0.7.2
FilSet Class Reference

FilSet applies a filter defined by sets of acceptable values. More...

#include <fil_set.h>

Inheritance diagram for FilSet:
Collaboration diagram for FilSet:

Public Member Functions

 FilSet (const Map< Str, Set< Json >> &acceptable_value_sets_)
 Constructor of FilSet class. More...
 
- Public Member Functions inherited from Filter
 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.
 
- Protected Member Functions inherited from Filter
virtual void compute_body (const ElPtr &elem, Json &data) override
 Filter elements from array 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 Member Functions

const bool check_if_pass_data_elem (const Json &elem_in_data)
 Check if an element in data array can pass this filter. More...
 

Private Attributes

Map< Str, Set< Json > > acceptable_value_sets
 

Additional Inherited Members

- Protected Attributes inherited from Updater
ShPtr< Generatorext_generator
 

Detailed Description

FilSet applies a filter defined by sets of acceptable values.

An object of this class has a filter defined by acceptable_value_sets, which is a dictionary consisting of pairs of a string key and a set of values which can pass the filter.

An element of array Element::data can pass this filter only if its value for every key in acceptable_value_sets is included in the corresponding set (a value of acceptable_value_sets).

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

Definition at line 28 of file fil_set.h.

Constructor & Destructor Documentation

◆ FilSet()

FilSet::FilSet ( const Map< Str, Set< Json >> &  acceptable_value_sets_)

Constructor of FilSet class.

Parameters
acceptable_value_sets_Dictionary from a string key for property to acceptable values of that property. Note that an Element object, where the constructed object is appended to, must has properties corresponding to keys in this parameter. This parameter is assigned to acceptable_value_sets.

Definition at line 13 of file fil_set.cpp.

Member Function Documentation

◆ check_if_pass_data_elem()

const bool FilSet::check_if_pass_data_elem ( const Json elem_in_data)
private

Check if an element in data array can pass this filter.

Parameters
elem_in_dataAn element in data array.
Returns
If elem_in_data can pass this filter.

Definition at line 21 of file fil_set.cpp.

Here is the caller graph for this function:

Member Data Documentation

◆ acceptable_value_sets

Map<Str,Set<Json> > FilSet::acceptable_value_sets
private

Criteria of this filter stored in a Map (dictionary) object. Note that keys of this dictionary must be contained in an Element object where this object appended to.

Definition at line 34 of file fil_set.h.


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