Class: Rbind::RDataType
- Inherits:
-
RBase
- Object
- RBase
- Rbind::RDataType
show all
- Defined in:
- lib/rbind/core/rdata_type.rb
Instance Attribute Summary collapse
Attributes inherited from RBase
#alias, #auto_alias, #csignature, #doc, #extern_package_name, #ignore, #name, #namespace, #owner, #signature, #version
Instance Method Summary
collapse
Methods inherited from RBase
basename, #binding, #delete!, #doc?, #extern?, #full_name, #generate_signatures, #ignore?, #map_to_namespace, namespace, #namespace?, normalize, #overwrite_c, #overwrite_ruby, #pretty_print, #rename, #specialize_ruby, split_name, to_cname, #to_s
Constructor Details
#initialize(name) ⇒ RDataType
Returns a new instance of RDataType.
9
10
11
12
13
|
# File 'lib/rbind/core/rdata_type.rb', line 9
def initialize(name)
super
@invalid_value = 0
@check_type = true
end
|
Instance Attribute Details
#cdelete_method ⇒ Object
Returns the value of attribute cdelete_method.
6
7
8
|
# File 'lib/rbind/core/rdata_type.rb', line 6
def cdelete_method
@cdelete_method
end
|
#check_type ⇒ Object
Returns the value of attribute check_type.
7
8
9
|
# File 'lib/rbind/core/rdata_type.rb', line 7
def check_type
@check_type
end
|
#invalid_value ⇒ Object
Returns the value of attribute invalid_value.
5
6
7
|
# File 'lib/rbind/core/rdata_type.rb', line 5
def invalid_value
@invalid_value
end
|
#typedef(value = nil) ⇒ Object
Returns the value of attribute typedef.
4
5
6
|
# File 'lib/rbind/core/rdata_type.rb', line 4
def typedef
@typedef
end
|
Instance Method Details
#==(other) ⇒ Object
15
16
17
|
# File 'lib/rbind/core/rdata_type.rb', line 15
def ==(other)
other.generate_signatures[0] == generate_signatures[0]
end
|
#basic_type? ⇒ Boolean
53
54
55
|
# File 'lib/rbind/core/rdata_type.rb', line 53
def basic_type?
true
end
|
#check_type? ⇒ Boolean
indicates of the type shall be checked before casting
21
22
23
|
# File 'lib/rbind/core/rdata_type.rb', line 21
def check_type?
@check_type
end
|
#cname(value = nil) ⇒ Object
25
26
27
28
29
30
31
32
33
34
35
36
|
# File 'lib/rbind/core/rdata_type.rb', line 25
def cname(value=nil)
if !value
if basic_type? && !@cname
full_name
else
super
end
else
super
self
end
end
|
#const? ⇒ Boolean
115
116
117
|
# File 'lib/rbind/core/rdata_type.rb', line 115
def const?
false
end
|
#container? ⇒ Boolean
holds other operations, types or consts
58
59
60
|
# File 'lib/rbind/core/rdata_type.rb', line 58
def container?
false
end
|
#ownership? ⇒ Boolean
returns true if the type is owner of its memory
103
104
105
106
107
108
109
|
# File 'lib/rbind/core/rdata_type.rb', line 103
def ownership?
if ref?
false
else
true
end
end
|
#ptr? ⇒ Boolean
119
120
121
|
# File 'lib/rbind/core/rdata_type.rb', line 119
def ptr?
false
end
|
#raw? ⇒ Boolean
111
112
113
|
# File 'lib/rbind/core/rdata_type.rb', line 111
def raw?
true
end
|
#ref? ⇒ Boolean
123
124
125
|
# File 'lib/rbind/core/rdata_type.rb', line 123
def ref?
false
end
|
#remove_const ⇒ Object
86
87
88
|
# File 'lib/rbind/core/rdata_type.rb', line 86
def remove_const
self
end
|
#remove_ownership ⇒ Object
90
91
92
|
# File 'lib/rbind/core/rdata_type.rb', line 90
def remove_ownership
self
end
|
#remove_ptr ⇒ Object
98
99
100
|
# File 'lib/rbind/core/rdata_type.rb', line 98
def remove_ptr
self
end
|
#remove_ref ⇒ Object
94
95
96
|
# File 'lib/rbind/core/rdata_type.rb', line 94
def remove_ref
self
end
|
#template? ⇒ Boolean
48
49
50
|
# File 'lib/rbind/core/rdata_type.rb', line 48
def template?
false
end
|
#to_const ⇒ Object
78
79
80
|
# File 'lib/rbind/core/rdata_type.rb', line 78
def to_const
RTypeAnnotation.new(self,:const => true)
end
|
#to_ownership(val) ⇒ Object
82
83
84
|
# File 'lib/rbind/core/rdata_type.rb', line 82
def to_ownership(val)
raise "Cannot set memory owner for none pointer types!"
end
|
#to_ptr ⇒ Object
70
71
72
|
# File 'lib/rbind/core/rdata_type.rb', line 70
def to_ptr
RTypeAnnotation.new(self,:ptr => 1)
end
|
#to_raw ⇒ Object
62
63
64
|
# File 'lib/rbind/core/rdata_type.rb', line 62
def to_raw
self
end
|
#to_ref ⇒ Object
74
75
76
|
# File 'lib/rbind/core/rdata_type.rb', line 74
def to_ref
RTypeAnnotation.new(self,:ref => true)
end
|
#to_single_ptr ⇒ Object
66
67
68
|
# File 'lib/rbind/core/rdata_type.rb', line 66
def to_single_ptr
self.to_ptr
end
|
#typedef? ⇒ Boolean
44
45
46
|
# File 'lib/rbind/core/rdata_type.rb', line 44
def typedef?
!!@typedef
end
|