ppap4lmp  0.7.2
GenList Class Reference

GenList is a list (or vector) of Generator objects. More...

#include <gen_list.h>

Inheritance diagram for GenList:
Collaboration diagram for GenList:

Public Member Functions

 GenList (const Vec< ShPtr< Generator >> &generator_list_)
 Constructor of GenList class. More...
 
virtual ElPtr get_element (const Json &name=nullptr) override
 Get an element of generator_list as a shared pointer of Element class. More...
 
virtual ShPtr< Generatorget_generator (const Json &name=nullptr) override
 Get an element of generator_list as a shared pointer of Generator class. More...
 
virtual void accessed_by_instance_of (const Str &classname) override
 Set class name of an instance calling Element::check_required_keys. More...
 
int get_length ()
 Get a length of generator_list. More...
 
- Public Member Functions inherited from Generator
void book_to_generate_data ()
 Appoint to this Generator object. More...
 
void generate_data ()
 Hello to this Generator object. More...
 
void finish_using_generated_data ()
 Goodbye to this object. More...
 
const Vec< UpdatePair > & get_update_chain ()
 Get update_chain of this object. More...
 

Private Attributes

Vec< ShPtr< Generator > > generator_list
 

Additional Inherited Members

- Protected Member Functions inherited from Generator
void merge_update_chain (const Vec< UpdatePair > &new_chain)
 
- Protected Attributes inherited from Generator
Vec< UpdatePairupdate_chain
 

Detailed Description

GenList is a list (or vector) of Generator objects.

This class is a subclass of Generator class and stores an arbitrary number of Generator object as a list (vector) of shared pointers of Generator class.

Definition at line 20 of file gen_list.h.

Constructor & Destructor Documentation

◆ GenList()

GenList::GenList ( const Vec< ShPtr< Generator >> &  generator_list_)

Constructor of GenList class.

Parameters
generator_list_List of shared pointers of Generator class. This parameter is assigned to generator_list.

This constructor is thread-unsafe because it accesses its members thread-globally. Ensure this constructor is not called in a multithreading context.

Definition at line 15 of file gen_list.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ accessed_by_instance_of()

void GenList::accessed_by_instance_of ( const Str classname)
overridevirtual

Set class name of an instance calling Element::check_required_keys.

Parameters
classnameA string to be assigned to Element::accessing_classname.
Returns
None.

Implements Generator.

Definition at line 55 of file gen_list.cpp.

◆ get_element()

ElPtr GenList::get_element ( const Json name = nullptr)
overridevirtual

Get an element of generator_list as a shared pointer of Element class.

Parameters
nameAn index in generator_list.
Returns
An element of generator_list up-casted to Element class.

One needs to get an element of generator_list as Element when using its Element::data.

Implements Generator.

Definition at line 28 of file gen_list.cpp.

Here is the call graph for this function:

◆ get_generator()

ShPtr< Generator > GenList::get_generator ( const Json name = nullptr)
overridevirtual

Get an element of generator_list as a shared pointer of Generator class.

Parameters
nameAn index in generator_list.
Returns
An element of generator_list.

One needs to get an element of generator_list as Generator when storing that object.

Implements Generator.

Definition at line 42 of file gen_list.cpp.

Here is the call graph for this function:

◆ get_length()

int GenList::get_length ( )

Get a length of generator_list.

Returns
An integer.

Definition at line 66 of file gen_list.cpp.

Member Data Documentation

◆ generator_list

Vec<ShPtr<Generator> > GenList::generator_list
private

List of shared pointers of Generator class. The element can be a pointer of Element, GenDict or GenList class up-casted to a shared pointer of Generator class.

Definition at line 26 of file gen_list.h.


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