summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2016-11-03 19:41:59 -0200
committerFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2016-11-03 19:41:59 -0200
commitb14d69983f0a4e1741582765294623c850547bd5 (patch)
treeac0dfe74919824ee249021fefde0d9f98ff5a4e0
parent446ec7ffb21de5da3ef35ed62856228e314b6030 (diff)
mono: Add out parameters
-rw-r--r--src/bin/eolian_mono/eolian_mono/parameter.hh7
-rw-r--r--src/bin/eolian_mono/eolian_mono/type_impl.hh5
2 files changed, 7 insertions, 5 deletions
diff --git a/src/bin/eolian_mono/eolian_mono/parameter.hh b/src/bin/eolian_mono/eolian_mono/parameter.hh
index 97a1987b19..f68a914930 100644
--- a/src/bin/eolian_mono/eolian_mono/parameter.hh
+++ b/src/bin/eolian_mono/eolian_mono/parameter.hh
@@ -17,7 +17,7 @@ struct parameter_generator
17 template <typename OutputIterator, typename Context> 17 template <typename OutputIterator, typename Context>
18 bool generate(OutputIterator sink, attributes::parameter_def const& param, Context const& context) const 18 bool generate(OutputIterator sink, attributes::parameter_def const& param, Context const& context) const
19 { 19 {
20 return as_generator(type << " " << string).generate(sink, std::make_tuple(param.type, param.param_name), context); 20 return as_generator(type << " " << string).generate(sink, std::make_tuple(param, param.param_name), context);
21 } 21 }
22} const parameter {}; 22} const parameter {};
23 23
@@ -26,7 +26,7 @@ struct marshall_parameter_generator
26 template <typename OutputIterator, typename Context> 26 template <typename OutputIterator, typename Context>
27 bool generate(OutputIterator sink, attributes::parameter_def const& param, Context const& context) const 27 bool generate(OutputIterator sink, attributes::parameter_def const& param, Context const& context) const
28 { 28 {
29 return as_generator(marshall_type << " " << string).generate(sink, std::make_tuple(param.type, param.param_name), context); 29 return as_generator(marshall_type << " " << string).generate(sink, std::make_tuple(param, param.param_name), context);
30 } 30 }
31} const marshall_parameter {}; 31} const marshall_parameter {};
32 32
@@ -35,7 +35,8 @@ struct argument_generator
35 template <typename OutputIterator, typename Context> 35 template <typename OutputIterator, typename Context>
36 bool generate(OutputIterator sink, attributes::parameter_def const& param, Context const& context) const 36 bool generate(OutputIterator sink, attributes::parameter_def const& param, Context const& context) const
37 { 37 {
38 return as_generator(param.param_name).generate(sink, attributes::unused, context); 38 return as_generator((param.direction != attributes::parameter_direction::in ? " out " : "")
39 << param.param_name).generate(sink, attributes::unused, context);
39 } 40 }
40 41
41} const argument {}; 42} const argument {};
diff --git a/src/bin/eolian_mono/eolian_mono/type_impl.hh b/src/bin/eolian_mono/eolian_mono/type_impl.hh
index c8c466c77a..5b76d77539 100644
--- a/src/bin/eolian_mono/eolian_mono/type_impl.hh
+++ b/src/bin/eolian_mono/eolian_mono/type_impl.hh
@@ -218,7 +218,8 @@ struct visitor_generate
218 // .generate(std::ostream_iterator<char>(std::cerr), std::make_tuple(eolian_mono::escape_namespace(regular.namespaces), regular.base_type), *context); 218 // .generate(std::ostream_iterator<char>(std::cerr), std::make_tuple(eolian_mono::escape_namespace(regular.namespaces), regular.base_type), *context);
219 if(as_generator 219 if(as_generator
220 ( 220 (
221 *(lower_case[string] << ".") 221 (is_out ? " out " : "")
222 << *(lower_case[string] << ".")
222 << string 223 << string
223 // << (regular.base_qualifier & qualifier_info::is_const 224 // << (regular.base_qualifier & qualifier_info::is_const
224 // || (regular.base_qualifier & qualifier_info::is_ref 225 // || (regular.base_qualifier & qualifier_info::is_ref
@@ -243,7 +244,7 @@ struct visitor_generate
243 // as_generator(" System.IntPtr") 244 // as_generator(" System.IntPtr")
244 // .generate(sink, attributes::unused, *context); 245 // .generate(sink, attributes::unused, *context);
245 return 246 return
246 as_generator(" " << *(lower_case[string] << ".") << string) 247 as_generator((is_out ? " out " : " ") << *(lower_case[string] << ".") << string)
247 .generate(sink, std::make_tuple(eolian_mono::escape_namespace(klass.namespaces), klass.eolian_name), *context) 248 .generate(sink, std::make_tuple(eolian_mono::escape_namespace(klass.namespaces), klass.eolian_name), *context)
248 // && (!(klass.base_qualifier & qualifier_info::is_ref) 249 // && (!(klass.base_qualifier & qualifier_info::is_ref)
249 // || as_generator("&").generate(sink, attributes::unused, *context)) 250 // || as_generator("&").generate(sink, attributes::unused, *context))