Class: CallStruct
- Inherits:
-
Object
- Object
- CallStruct
- Defined in:
- ext/generate_gvl_code.rb
Overview
the struct that holds the call args for zoo_fn_name
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#typed_args ⇒ Object
readonly
Returns the value of attribute typed_args.
-
#zoo_fn_name ⇒ Object
readonly
Returns the value of attribute zoo_fn_name.
Instance Method Summary collapse
- #body ⇒ Object
-
#initialize(zoo_fn_name, typed_args) ⇒ CallStruct
constructor
A new instance of CallStruct.
Constructor Details
#initialize(zoo_fn_name, typed_args) ⇒ CallStruct
Returns a new instance of CallStruct.
71 72 73 74 |
# File 'ext/generate_gvl_code.rb', line 71 def initialize(zoo_fn_name, typed_args) @zoo_fn_name, @typed_args = zoo_fn_name, typed_args @name = "zkrb_#{zoo_fn_name}_args_t" end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
69 70 71 |
# File 'ext/generate_gvl_code.rb', line 69 def name @name end |
#typed_args ⇒ Object (readonly)
Returns the value of attribute typed_args.
69 70 71 |
# File 'ext/generate_gvl_code.rb', line 69 def typed_args @typed_args end |
#zoo_fn_name ⇒ Object (readonly)
Returns the value of attribute zoo_fn_name.
69 70 71 |
# File 'ext/generate_gvl_code.rb', line 69 def zoo_fn_name @zoo_fn_name end |
Instance Method Details
#body ⇒ Object
76 77 78 79 80 81 82 83 84 |
# File 'ext/generate_gvl_code.rb', line 76 def body @body ||= ( lines = ["typedef struct {"] lines += typed_args.map{|n| " #{n};"} lines << " int rc;" lines << "} #{name};" lines.join("\n") ) end |