Class: GirFFI::Builders::CallbackReturnValueBuilder
Overview
Implements building post-processing statements for return values of callbacks.
Constant Summary
BaseArgumentBuilder::KEYWORDS
Instance Attribute Summary
#arginfo, #array_arg, #length_arg
Instance Method Summary
collapse
#argument_class_name, #array_length_idx, #call_argument_name, #closure=, #closure?, #direction, #initialize, #name, #new_variable, #safe, #specialized_type_tag, #type_info
Instance Method Details
#capture_variable_name ⇒ Object
13
14
15
|
# File 'lib/gir_ffi/builders/callback_return_value_builder.rb', line 13
def capture_variable_name
@capture_variable_name ||= new_variable if relevant?
end
|
#post_conversion ⇒ Object
29
30
31
32
33
34
35
36
37
38
39
|
# File 'lib/gir_ffi/builders/callback_return_value_builder.rb', line 29
def post_conversion
if has_post_conversion?
if type_info.flattened_tag == :object
["#{post_converted_name} = #{post_convertor.conversion}.to_ptr"]
else
["#{post_converted_name} = #{post_convertor.conversion}"]
end
else
[]
end
end
|
#post_converted_name ⇒ Object
17
18
19
20
21
22
23
|
# File 'lib/gir_ffi/builders/callback_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/callback_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/callback_return_value_builder.rb', line 25
def return_value_name
post_converted_name if has_return_value_name?
end
|