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_type, pointee_name, depth) ⇒ PointerType

Returns a new instance of PointerType.



250
251
252
253
254
# File 'lib/ffi_gen.rb', line 250

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

Instance Attribute Details

#depthObject (readonly)

Returns the value of attribute depth.



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

def depth
  @depth
end

#pointee_nameObject (readonly)

Returns the value of attribute pointee_name.



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

def pointee_name
  @pointee_name
end

#pointee_typeObject (readonly)

Returns the value of attribute pointee_type.



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

def pointee_type
  @pointee_type
end

Instance Method Details

#java_descriptionObject



359
360
361
# File 'lib/ffi_gen/java_output.rb', line 359

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

#java_jna_typeObject



355
356
357
# File 'lib/ffi_gen/java_output.rb', line 355

def java_jna_type
  "Pointer"
end

#java_nameObject



351
352
353
# File 'lib/ffi_gen/java_output.rb', line 351

def java_name
  @pointee_name.to_java_downcase
end

#nameObject



256
257
258
# File 'lib/ffi_gen.rb', line 256

def name
  @pointee_name
end

#ruby_descriptionObject



286
287
288
# File 'lib/ffi_gen/ruby_output.rb', line 286

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

#ruby_ffi_typeObject



282
283
284
# File 'lib/ffi_gen/ruby_output.rb', line 282

def ruby_ffi_type
  ":pointer"
end

#ruby_nameObject



278
279
280
# File 'lib/ffi_gen/ruby_output.rb', line 278

def ruby_name
  @pointee_name.to_ruby_downcase
end