Move function pointer type defs down next to their related members

This commit is contained in:
Justin C. Miller
2020-02-23 20:09:53 -08:00
parent 9c1dfc92b9
commit c317058f02

View File

@@ -25,18 +25,9 @@ namespace uefi {
namespace protos { namespace protos {
struct {{ name }}; struct {{ name }};
namespace {{ name }}_impl {
{%- for method in methods %}
using {{ method.name }} = uefi::status (*)(
{%- if not method.get("skip_this", false) -%}uefi::protos::{{ name }} *{%- endif -%}
{%- if not method.get("skip_this", false) and method.args %}, {% endif -%}
{{ method.args|join(', ', attribute='type') }});
{%- endfor %}
} // namespace {{ name }}_impl
struct {{ name }} struct {{ name }}
{ {
static constexpr uefi::guid guid{ {{ guid }} }; {% if guid %}static constexpr uefi::guid guid{ {{ guid }} };{% endif %}
{% for method in methods %} {% for method in methods %}
inline uefi::status {{ method.name }}( inline uefi::status {{ method.name }}(
{%- for arg in method.args -%} {%- for arg in method.args -%}
@@ -55,9 +46,12 @@ struct {{ name }}
protected: protected:
{%- for method in methods %} {%- for method in methods %}
{{ name }}_impl::{{ method.name }} _{{ method.name }}; using _{{ method.name }}_def = uefi::status (*)(
{%- endfor %} {%- if not method.get("skip_this", false) -%}uefi::protos::{{ name }} *{%- endif -%}
{%- if not method.get("skip_this", false) and method.args %}, {% endif -%}
{{ method.args|join(', ', attribute='type') }});
_{{ method.name }}_def _{{ method.name }};
{% endfor %}
public: public:
{%- for datum in post_data %} {%- for datum in post_data %}
{{ datum.type }} {{ datum.name }}; {{ datum.type }} {{ datum.name }};