Implement the device error callback.

This adds support for "natively defined" API types like callbacks that
will have to be implemented manually for each target language. Also this
splits the concept of "native method" into a set of native methods per
language.

Removes the "Synchronous error" concept that was used to make builders
work in the maybe Monad, this will have to be reinroduced with builder
callbacks.
This commit is contained in:
Corentin Wallez
2017-04-20 14:42:36 -04:00
committed by Corentin Wallez
parent 682a8250b3
commit 4b410a33ca
15 changed files with 219 additions and 55 deletions

View File

@@ -64,7 +64,7 @@ namespace nxt {
{{as_varName(arg.name)}}.Get()
{%- elif arg.type.category == "enum" or arg.type.category == "bitmask" -%}
static_cast<{{as_cType(arg.type.name)}}>({{as_varName(arg.name)}})
{%- elif arg.type.category == "native" -%}
{%- elif arg.type.category in ["native", "natively defined"] -%}
{{as_varName(arg.name)}}
{%- else -%}
UNHANDLED
@@ -76,7 +76,7 @@ namespace nxt {
)
{%- endmacro %}
{% for method in type.methods %}
{% for method in native_methods(type) %}
{{render_cpp_method_declaration(type, method)}} {
{% if method.return_type.name.concatcase() == "void" %}
{{render_cpp_to_c_method_call(type, method)}};