summaryrefslogtreecommitdiff
path: root/src/bin/eolian_mono/eolian/mono/async_function_definition.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/eolian_mono/eolian/mono/async_function_definition.hh')
-rw-r--r--src/bin/eolian_mono/eolian/mono/async_function_definition.hh21
1 files changed, 18 insertions, 3 deletions
diff --git a/src/bin/eolian_mono/eolian/mono/async_function_definition.hh b/src/bin/eolian_mono/eolian/mono/async_function_definition.hh
index 8ca3c5c..bf00dda 100644
--- a/src/bin/eolian_mono/eolian/mono/async_function_definition.hh
+++ b/src/bin/eolian_mono/eolian/mono/async_function_definition.hh
@@ -1,3 +1,18 @@
1/*
2 * Copyright 2019 by its authors. See AUTHORS.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
1#ifndef EOLIAN_MONO_ASYNC_FUNCTION_DEFINITION_HH 16#ifndef EOLIAN_MONO_ASYNC_FUNCTION_DEFINITION_HH
2#define EOLIAN_MONO_ASYNC_FUNCTION_DEFINITION_HH 17#define EOLIAN_MONO_ASYNC_FUNCTION_DEFINITION_HH
3 18
@@ -80,7 +95,7 @@ struct async_function_declaration_generator
80 if (!as_generator( 95 if (!as_generator(
81 scope_tab << "/// <param name=\"token\">Token to notify the async operation of external request to cancel.</param>\n" 96 scope_tab << "/// <param name=\"token\">Token to notify the async operation of external request to cancel.</param>\n"
82 << scope_tab << "/// <returns>An async task wrapping the result of the operation.</returns>\n" 97 << scope_tab << "/// <returns>An async task wrapping the result of the operation.</returns>\n"
83 << scope_tab << "System.Threading.Tasks.Task<Eina.Value> " << name_helpers::managed_async_method_name(f) << "(" << *(parameter << ",") << 98 << scope_tab << "System.Threading.Tasks.Task<Eina.Value> " << name_helpers::managed_async_method_name(f) << "(" << *(parameter << ", ") <<
84 " System.Threading.CancellationToken token = default(System.Threading.CancellationToken));\n\n" 99 " System.Threading.CancellationToken token = default(System.Threading.CancellationToken));\n\n"
85 ).generate(sink, f.parameters, context)) 100 ).generate(sink, f.parameters, context))
86 return false; 101 return false;
@@ -138,9 +153,9 @@ struct async_function_definition_generator
138 if(!as_generator( 153 if(!as_generator(
139 scope_tab << "/// <param name=\"token\">Token to notify the async operation of external request to cancel.</param>\n" 154 scope_tab << "/// <param name=\"token\">Token to notify the async operation of external request to cancel.</param>\n"
140 << scope_tab << "/// <returns>An async task wrapping the result of the operation.</returns>\n" 155 << scope_tab << "/// <returns>An async task wrapping the result of the operation.</returns>\n"
141 << scope_tab << "public System.Threading.Tasks.Task<Eina.Value> " << name_helpers::managed_async_method_name(f) << "(" << *(parameter << ",") << " System.Threading.CancellationToken token = default(System.Threading.CancellationToken))\n" 156 << scope_tab << "public System.Threading.Tasks.Task<Eina.Value> " << name_helpers::managed_async_method_name(f) << "(" << *(parameter << ", ") << " System.Threading.CancellationToken token = default(System.Threading.CancellationToken))\n"
142 << scope_tab << "{\n" 157 << scope_tab << "{\n"
143 << scope_tab << scope_tab << "Eina.Future future = " << name_helpers::managed_method_name(f) << "(" << (string % ",") << ");\n" 158 << scope_tab << scope_tab << "Eina.Future future = " << name_helpers::managed_method_name(f) << "(" << (string % ", ") << ");\n"
144 << scope_tab << scope_tab << "return Efl.Eo.Globals.WrapAsync(future, token);\n" 159 << scope_tab << scope_tab << "return Efl.Eo.Globals.WrapAsync(future, token);\n"
145 << scope_tab << "}\n\n" 160 << scope_tab << "}\n\n"
146 ).generate(sink, std::make_tuple(f.parameters, param_forwarding), context)) 161 ).generate(sink, std::make_tuple(f.parameters, param_forwarding), context))