/**
    This file is autogenerated
*/

{% macro genmethod(cls, fn) %}
  {% if fn.constructor %}
    .def(py::init<{{ fn.parameters | join(', ', attribute='x_type') }}>(), {{ fn.x_in_params | join(', ', attribute='x_pyarg') }}, release_gil())
  {% else %}
    .def("{{ fn.x_name }}", {% if 'overload' in fn.data %}({{ fn.x_returns }} ({{ cls.namespace }}::{{ cls.name }}::*)({{ fn.x_in_params | join(', ', attribute='x_type')}})){% endif -%}
	     &{{ fn.namespace }}{{ cls.name }}::{{ fn.name }}{% if fn.x_in_params %}, {{ fn.x_in_params | join(', ', attribute='x_pyarg') }}{% endif %}, release_gil())
  {% endif %}
{% endmacro -%}

{% for header in headers %}
{% for cls in header.classes if 'ignore' not in cls.data %}
  py::class_<{{ cls.namespace }}::{{ cls.name }}{% if 'cpp_inherits' in cls.data %}, {{ cls.data.cpp_inherits }}{% endif %}> {{ cls.name.lower() }}(m, "{{ cls.name }}");
  {{ cls.name.lower() }}
  {% for fn in cls.methods.public if 'ignore' not in fn.data and 'forward_declare' not in fn %}
  {{ genmethod(cls, fn) }}
  {%- endfor %}
  ;
{% endfor %}
{% endfor %}
{% for header in headers %}
{% for cls in header.classes if 'has_fwd_declare' in cls %}
  {{ cls.name.lower() }}
  {% for fn in cls.methods.public if 'forward_declare' in fn %}
  {{ genmethod(cls, fn) }}
  {%- endfor %}
  ;
{% endfor %}
{% endfor %}
