Class: FFIGen::PointerType

Inherits:
Type
  • Object
show all
Defined in:
lib/ffi_gen.rb,
lib/ffi_gen/java_output.rb,
lib/ffi_gen/ruby_output.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(pointee_name, depth) ⇒ PointerType

Returns a new instance of PointerType.



235
236
237
238
# File 'lib/ffi_gen.rb', line 235

def initialize(pointee_name, depth)
  @pointee_name = pointee_name
  @depth = depth
end

Instance Attribute Details

#depthObject (readonly)

Returns the value of attribute depth.



233
234
235
# File 'lib/ffi_gen.rb', line 233

def depth
  @depth
end

#pointee_nameObject (readonly)

Returns the value of attribute pointee_name.



233
234
235
# File 'lib/ffi_gen.rb', line 233

def pointee_name
  @pointee_name
end

Instance Method Details

#java_descriptionObject



248
249
250
# File 'lib/ffi_gen/java_output.rb', line 248

def java_description
  "FFI::Pointer(#{'*' * @depth}#{@pointee_name ? @pointee_name.to_java_classname : ''})"
end

#java_jna_typeObject



244
245
246
# File 'lib/ffi_gen/java_output.rb', line 244

def java_jna_type
  "Pointer"
end

#java_nameObject



240
241
242
# File 'lib/ffi_gen/java_output.rb', line 240

def java_name
  @pointee_name.to_java_downcase
end

#nameObject



240
241
242
# File 'lib/ffi_gen.rb', line 240

def name
  @pointee_name
end

#ruby_descriptionObject



269
270
271
# File 'lib/ffi_gen/ruby_output.rb', line 269

def ruby_description
  "FFI::Pointer(#{'*' * @depth}#{@pointee_name ? @pointee_name.to_ruby_classname : ''})"
end

#ruby_ffi_typeObject



265
266
267
# File 'lib/ffi_gen/ruby_output.rb', line 265

def ruby_ffi_type
  ":pointer"
end

#ruby_nameObject



261
262
263
# File 'lib/ffi_gen/ruby_output.rb', line 261

def ruby_name
  @pointee_name.to_ruby_downcase
end