ppap4lmp  0.7.2
ProData Class Reference

ProData copies Element::data from Element objects. More...

#include <pro_data.h>

Inheritance diagram for ProData:
Collaboration diagram for ProData:

Public Member Functions

 ProData (const ElPtr &elem)
 Constructor of ProData class for one Element object. More...
 
 ProData (const Vec< ElPtr > &elems)
 Constructor of ProData class for a sequence of Element objects. More...
 
virtual void prepare () override
 Clear and resize results. More...
 
void select (const py::args &args)
 Specify string keys for properties to be copied. More...
 
const Vec< Json > & get_results ()
 Get list of Json objects consisting of all or some properties of Element objects stored in this object. More...
 
- Public Member Functions inherited from Processor
 Processor ()=default
 Constructor of Processor class (default).
 
virtual void finish ()
 Finish analysis. More...
 
virtual bool run ()
 Run analysis using i th Generator object in generators, where i = i_generator. More...
 
void startup ()
 Startup this Processor object. More...
 

Protected Member Functions

virtual void run_impl (const int index) override
 Implementation of analysis using an element of generators. More...
 
- Protected Member Functions inherited from Processor
template<class GEN >
void register_generator (const ShPtr< GEN > &gen)
 
template<class GEN >
void register_generators (const Vec< ShPtr< GEN >> &gens)
 
virtual void use_generator_at (const int i)
 Call Generator::generate_data of i th Generator object in generators. More...
 
virtual void finish_using_generator_at (const int i)
 Call Generator::finish_using_generated_data of i* th Generator object in generators. More...
 

Private Attributes

Vec< Strselected_keys
 
Vec< Jsonresults
 

Additional Inherited Members

- Protected Attributes inherited from Processor
int n_generators
 
Vec< ShPtr< Generator > > generators
 

Detailed Description

ProData copies Element::data from Element objects.

An object of this class makes a list of Json objects by copying all or some properties of Element objects stored in generators.

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

Definition at line 23 of file pro_data.h.

Constructor & Destructor Documentation

◆ ProData() [1/2]

ProData::ProData ( const ElPtr elem)

Constructor of ProData class for one Element object.

Parameters
elemAn Element object to be copied. The parameter is put into generators by register_generator.

Definition at line 18 of file pro_data.cpp.

Here is the call graph for this function:

◆ ProData() [2/2]

ProData::ProData ( const Vec< ElPtr > &  elems)

Constructor of ProData class for a sequence of Element objects.

Parameters
elemsList of Element objects to be copied. Elements of this parameter is put into generators by register_generators.

Definition at line 26 of file pro_data.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ get_results()

const Vec< Json > & ProData::get_results ( )

Get list of Json objects consisting of all or some properties of Element objects stored in this object.

Returns
results.

Definition at line 88 of file pro_data.cpp.

Here is the caller graph for this function:

◆ prepare()

void ProData::prepare ( )
overridevirtual

Clear and resize results.

Returns
None.

Reimplemented from Processor.

Definition at line 72 of file pro_data.cpp.

◆ run_impl()

void ProData::run_impl ( const int  index)
overrideprotectedvirtual

Implementation of analysis using an element of generators.

Parameters
indexAn index in generators for a Generator object to be analyzed.
Returns
None.

To be compatible with multithreading computation, class members should not be modified in this method. If modification of some members is necessary, please consider defining them as Vec, and modifying only their i th element, where i = index.

I am sorry to say that the best documentation for this method is its source code...

Implements Processor.

Definition at line 34 of file pro_data.cpp.

◆ select()

void ProData::select ( const py::args &  args)

Specify string keys for properties to be copied.

Parameters
*argsAn ordered list of string keys for properties to be copied (Python's variable number arguments). This parameter is converted to be stored as selected_keys.
Returns
None.

Definition at line 80 of file pro_data.cpp.

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

Member Data Documentation

◆ results

Vec<Json> ProData::results
private

List in which Json objects consisting of copied properties are stored. Indices in this list corresponds to those in generators.

Definition at line 34 of file pro_data.h.

◆ selected_keys

Vec<Str> ProData::selected_keys
private

List of string keys for properties to be copied. If this member is empty, all properties of Element objects are copied.

Definition at line 28 of file pro_data.h.


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