Class: GirFFI::Builders::BaseReturnValueBuilder
- Inherits:
-
BaseArgumentBuilder
- Object
- BaseArgumentBuilder
- GirFFI::Builders::BaseReturnValueBuilder
- Defined in:
- lib/gir_ffi/builders/base_return_value_builder.rb
Overview
Implements building post-processing statements for return values of callbacks.
Direct Known Subclasses
CallbackReturnValueBuilder, InitializerReturnValueBuilder, ReturnValueBuilder
Constant Summary
Constants inherited from BaseArgumentBuilder
GirFFI::Builders::BaseArgumentBuilder::KEYWORDS
Instance Attribute Summary
Attributes inherited from BaseArgumentBuilder
#arginfo, #array_arg, #length_arg
Instance Method Summary collapse
- #capture_variable_name ⇒ Object
- #has_return_value_name? ⇒ Boolean
- #post_converted_name ⇒ Object
- #relevant? ⇒ Boolean
- #return_value_name ⇒ Object
- #void_return_value? ⇒ Boolean
Methods inherited from BaseArgumentBuilder
#argument_class_name, #array_length_idx, #array_length_parameter?, #call_argument_name, #closure=, #closure?, #closure_idx, #destroy_idx, #destroy_notifier?, #direction, #helper_argument?, #initialize, #mark_as_destroy_notifier, #name, #new_variable, #ownership_transfer, #safe, #specialized_type_tag, #type_info
Constructor Details
This class inherits a constructor from GirFFI::Builders::BaseArgumentBuilder
Instance Method Details
#capture_variable_name ⇒ Object
13 14 15 |
# File 'lib/gir_ffi/builders/base_return_value_builder.rb', line 13 def capture_variable_name @capture_variable_name ||= new_variable if relevant? end |
#has_return_value_name? ⇒ Boolean
33 34 35 |
# File 'lib/gir_ffi/builders/base_return_value_builder.rb', line 33 def has_return_value_name? relevant? && !array_arg end |
#post_converted_name ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/gir_ffi/builders/base_return_value_builder.rb', line 17 def post_converted_name @post_converted_name ||= if has_post_conversion? new_variable else capture_variable_name end end |
#relevant? ⇒ Boolean
9 10 11 |
# File 'lib/gir_ffi/builders/base_return_value_builder.rb', line 9 def relevant? !void_return_value? && !arginfo.skip? end |
#return_value_name ⇒ Object
25 26 27 |
# File 'lib/gir_ffi/builders/base_return_value_builder.rb', line 25 def return_value_name post_converted_name if has_return_value_name? end |
#void_return_value? ⇒ Boolean
29 30 31 |
# File 'lib/gir_ffi/builders/base_return_value_builder.rb', line 29 def void_return_value? specialized_type_tag == :void && !type_info.pointer? end |