Module: Cplus2Ruby

Defined in:
lib/cplus2ruby.rb,
lib/cplus2ruby/model.rb

Defined Under Namespace

Modules: Entity Classes: CodeGenerator, Compiler, CppCodeGenerator, Method, Model, Property, Typing, WrapperCodeGenerator

Class Method Summary collapse

Class Method Details

.<<(code) ⇒ Object

Global code



102
103
104
105
106
# File 'lib/cplus2ruby/model.rb', line 102

def self.<<(code)
  model.code << "\n"
  model.code << code
  model.code << "\n"
end

.add_type_alias(h) ⇒ Object



120
121
122
# File 'lib/cplus2ruby/model.rb', line 120

def self.add_type_alias(h)
  h.each {|from, to| model.typing.alias_entry(from, to)}
end

.commit(*args, &block) ⇒ Object



124
125
126
127
# File 'lib/cplus2ruby/model.rb', line 124

def self.commit(*args, &block)
  self.model.finish!
  Cplus2Ruby::Compiler.new(self.model).commit(*args, &block)
end

.compile(*args) ⇒ Object



133
134
135
136
# File 'lib/cplus2ruby/model.rb', line 133

def self.compile(*args)
  self.model.finish!
  Cplus2Ruby::Compiler.new(self.model).compile(*args)
end

.include(header) ⇒ Object



108
109
110
# File 'lib/cplus2ruby/model.rb', line 108

def self.include(header)
  model.includes << header
end

.modelObject



116
117
118
# File 'lib/cplus2ruby/model.rb', line 116

def self.model
  @model ||= Cplus2Ruby::Model.new
end

.settings(h = {}) ⇒ Object



112
113
114
# File 'lib/cplus2ruby/model.rb', line 112

def self.settings(h={})
  model.settings(h)
end

.startup(*args, &block) ⇒ Object



129
130
131
# File 'lib/cplus2ruby/model.rb', line 129

def self.startup(*args, &block)
  commit(*args, &block)
end