Class: RedShift::Component::FunctionWrapper
- Inherits:
-
SingletonShadowClass
- Object
- SingletonShadowClass
- RedShift::Component::FunctionWrapper
- Defined in:
- lib/redshift/target/c/component-gen.rb
Overview
FunctionWrappers wrap function pointers for access from ruby.
Direct Known Subclasses
Class Attribute Summary collapse
-
.constructor ⇒ Object
Returns the value of attribute constructor.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ FunctionWrapper
constructor
A new instance of FunctionWrapper.
Methods inherited from SingletonShadowClass
Constructor Details
#initialize ⇒ FunctionWrapper
Returns a new instance of FunctionWrapper.
118 119 120 |
# File 'lib/redshift/target/c/component-gen.rb', line 118 def initialize calc_function_pointer end |
Class Attribute Details
.constructor ⇒ Object
Returns the value of attribute constructor.
123 124 125 |
# File 'lib/redshift/target/c/component-gen.rb', line 123 def constructor @constructor end |
Class Method Details
.construct ⇒ Object
125 126 127 128 129 130 |
# File 'lib/redshift/target/c/component-gen.rb', line 125 def construct class_eval &constructor rescue => ex ex. << " While defining #{inspect_str}." raise end |
.make_subclass(file_name, &bl) ⇒ Object
132 133 134 135 136 137 138 139 140 141 142 143 |
# File 'lib/redshift/target/c/component-gen.rb', line 132 def make_subclass(file_name, &bl) cl = Class.new(self) cl.constructor = bl cl.shadow_library_file file_name clname = file_name.sub /^#{@tag}/i, @tag Object.const_set clname, cl ## maybe put in other namespace? before_commit {cl.construct} # this is deferred to commit time to resolve forward refs ## this would be more elegant with defer.rb ## maybe precommit should be used for this now? cl end |