Class: AutoC::Primitive
- Inherits:
-
Type
- Object
- Type
- AutoC::Primitive
show all
- Defined in:
- lib/autoc/primitive.rb
Instance Attribute Summary
Attributes inherited from Type
#signature
Instance Method Summary
collapse
Methods inherited from Type
abstract, #comparable?, #constructible?, #copyable?, #custom_constructible?, #default_constructible?, #destroy, #destructible?, #hashable?, #initialize, #inspect, #orderable?, #to_s, #to_type
Constructor Details
This class inherits a constructor from AutoC::Type
Instance Method Details
#compare ⇒ Object
20
|
# File 'lib/autoc/primitive.rb', line 20
def compare = @compare ||= -> (lt, rt) { "(#{lt} == #{rt} ? 0 : (#{lt} > #{rt} ? +1 : -1))" }
|
#copy ⇒ Object
16
|
# File 'lib/autoc/primitive.rb', line 16
def copy = @copy ||= -> (target, source) { "#{target} = #{source}" }
|
#custom_create ⇒ Object
14
|
# File 'lib/autoc/primitive.rb', line 14
def custom_create = @custom_create ||= -> (target, source) { copy.(target, source) }
|
#default_create ⇒ Object
12
|
# File 'lib/autoc/primitive.rb', line 12
def default_create = @default_create ||= -> (target) { copy.(target, 0) }
|
#equal ⇒ Object
18
|
# File 'lib/autoc/primitive.rb', line 18
def equal = @equal ||= -> (lt, rt) { "#{lt} == #{rt}" }
|
#hash_code ⇒ Object
22
|
# File 'lib/autoc/primitive.rb', line 22
def hash_code = @hash_code ||= -> (target) { "(size_t)(#{target})" }
|