ppap4lmp  0.7.2
gen_list.h
Go to the documentation of this file.
1 
8 #ifndef GEN_LIST_H
9 #define GEN_LIST_H
10 
11 #include <core/element.h>
12 
20 class GenList : public Generator {
27  public:
39  GenList(
40  const Vec<ShPtr<Generator>> &generator_list_);
41  virtual ~GenList() = default;
54  virtual ElPtr get_element(
55  const Json &name = nullptr) override;
69  const Json &name = nullptr) override;
71  virtual void accessed_by_instance_of(
72  const Str &classname) override;
78  int get_length();
79 };
80 
81 #endif
This file has a definition of Element class, which is one of the cores of this program.
virtual void accessed_by_instance_of(const Str &classname) override
Set class name of an instance calling Element::check_required_keys.
Definition: gen_list.cpp:55
ShPtr< Element > ElPtr
An alias for a shared pointer of Element class.
Definition: element.h:378
GenList is a list (or vector) of Generator objects.
Definition: gen_list.h:20
Vec< ShPtr< Generator > > generator_list
Definition: gen_list.h:26
std::string Str
Str is an alias for string.
Definition: std.h:21
GenList(const Vec< ShPtr< Generator >> &generator_list_)
Constructor of GenList class.
Definition: gen_list.cpp:15
nlohmann::json Json
Json is an alias for nlohmann::json.
Definition: json.h:22
std::vector< T > Vec
Vec is an alias for vector (same as list in Python).
Definition: std.h:27
virtual ShPtr< Generator > get_generator(const Json &name=nullptr) override
Get an element of generator_list as a shared pointer of Generator class.
Definition: gen_list.cpp:42
Generator is an abstract class to generate data.
Definition: generator.h:41
virtual ElPtr get_element(const Json &name=nullptr) override
Get an element of generator_list as a shared pointer of Element class.
Definition: gen_list.cpp:28
std::shared_ptr< T > ShPtr
ShPtr is an alias for shared pointer.
Definition: std.h:16
int get_length()
Get a length of generator_list.
Definition: gen_list.cpp:66