ppap4lmp  0.7.2
py_element.h
Go to the documentation of this file.
1 
8 #ifndef PYBIND_ELEMENT_H
9 #define PYBIND_ELEMENT_H
10 
11 #include <alias/pybind.h>
12 #include <core/element.h>
13 
20 class PyElement : public Element {
21  public:
22  using Element::Element;
24  const Json &name) override
25  {
26  PYBIND11_OVERLOAD(
27  ElPtr, Element, get_element, name);
28  }
30  const Json &name) override
31  {
32  PYBIND11_OVERLOAD(
34  }
36  const Str &classname) override
37  {
38  PYBIND11_OVERLOAD(
39  void, Element, accessed_by_instance_of, classname);
40  }
41 };
42 
44 namespace pybind
45 {
193  void py_element(py::module &m);
194 }
195 
196 #endif
This file has a definition of Element class, which is one of the cores of this program.
ShPtr< Element > ElPtr
An alias for a shared pointer of Element class.
Definition: element.h:378
Namespace for functions to bind C++ classes to Python.
ElPtr get_element(const Json &name) override
Get this object as a shared pointer of Element class.
Definition: py_element.h:23
void py_element(py::module &m)
Bind Element class to Python.
Definition: py_element.cpp:13
std::string Str
Str is an alias for string.
Definition: std.h:21
Element()
Constructor of Element class.
Definition: element.cpp:22
nlohmann::json Json
Json is an alias for nlohmann::json.
Definition: json.h:22
Element inherits Generator class and contains data element (or entity) as a Json object.
Definition: element.h:42
ShPtr< Generator > get_generator(const Json &name) override
Get this object as a shared pointer of Generator class.
Definition: py_element.h:29
Trampoline class to bind Element class to Python.
Definition: py_element.h:20
void accessed_by_instance_of(const Str &classname) override
Set class name of an instance calling Element::check_required_keys.
Definition: py_element.h:35
std::shared_ptr< T > ShPtr
ShPtr is an alias for shared pointer.
Definition: std.h:16
This file includes pybind11 and defines an alias for the namespace pybind11.