Class: Rbind::GeneratorC::OperationsHelper

Inherits:
HelperBase
  • Object
show all
Defined in:
lib/rbind/generator_c.rb

Defined Under Namespace

Classes: OperationHelper

Instance Attribute Summary

Attributes inherited from HelperBase

#extern_types, #includes, #name

Instance Method Summary collapse

Methods inherited from HelperBase

#binding, #wrap_includes

Constructor Details

#initialize(name, root, extern_types) ⇒ OperationsHelper

Returns a new instance of OperationsHelper.



284
285
286
287
# File 'lib/rbind/generator_c.rb', line 284

def initialize(name,root,extern_types)
    super
    @operation_wrapper = ERB.new(File.open(File.join(File.dirname(__FILE__),"templates","c","operation_wrapper.cc")).read,nil,"-")
end

Instance Method Details

#operation_wrapper(op) ⇒ Object



289
290
291
292
293
# File 'lib/rbind/generator_c.rb', line 289

def operation_wrapper(op)
    raise unless op
    op2 = OperationHelper.new(op)
    @operation_wrapper.result(op2.binding)
end

#wrap_operationsObject



295
296
297
298
299
300
301
302
303
# File 'lib/rbind/generator_c.rb', line 295

def wrap_operations
    str = ""
    @root.each_container do |type|
        type.each_operation do |op|
            str += operation_wrapper(op)
        end
    end
    str
end