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

#includes, #name

Instance Method Summary collapse

Methods inherited from HelperBase

#binding, #wrap_includes

Constructor Details

#initialize(name, root) ⇒ OperationsHelper

Returns a new instance of OperationsHelper.



238
239
240
241
# File 'lib/rbind/generator_c.rb', line 238

def initialize(name,root)
    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



243
244
245
246
247
# File 'lib/rbind/generator_c.rb', line 243

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

#wrap_operationsObject



249
250
251
252
253
254
255
256
257
# File 'lib/rbind/generator_c.rb', line 249

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