Class: Rbind::RTypeQualifier
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- Rbind::RTypeQualifier
- Defined in:
- lib/rbind/core/rtype_qualifier.rb
Instance Attribute Summary collapse
-
#const ⇒ Object
Returns the value of attribute const.
Instance Method Summary collapse
- #const? ⇒ Boolean
- #csignature(sig = nil) ⇒ Object
- #generate_signatures ⇒ Object
-
#initialize(type, options = Hash.new) ⇒ RTypeQualifier
constructor
A new instance of RTypeQualifier.
- #raw? ⇒ Boolean
- #remove_const ⇒ Object
- #signature(sig = nil) ⇒ Object
- #to_const ⇒ Object
- #to_ptr ⇒ Object
- #to_ref ⇒ Object
- #to_single_ptr ⇒ Object
Constructor Details
#initialize(type, options = Hash.new) ⇒ RTypeQualifier
Returns a new instance of RTypeQualifier.
7 8 9 10 |
# File 'lib/rbind/core/rtype_qualifier.rb', line 7 def initialize(type,=Hash.new) super(type) @const = [:const] end |
Instance Attribute Details
#const ⇒ Object
Returns the value of attribute const.
5 6 7 |
# File 'lib/rbind/core/rtype_qualifier.rb', line 5 def const @const end |
Instance Method Details
#const? ⇒ Boolean
12 13 14 |
# File 'lib/rbind/core/rtype_qualifier.rb', line 12 def const? !!@const end |
#csignature(sig = nil) ⇒ Object
47 48 49 |
# File 'lib/rbind/core/rtype_qualifier.rb', line 47 def csignature(sig=nil) generate_signatures[1] end |
#generate_signatures ⇒ Object
51 52 53 54 55 56 57 58 |
# File 'lib/rbind/core/rtype_qualifier.rb', line 51 def generate_signatures str = if const? "const " end __getobj__.generate_signatures.map do |s| str + s end end |
#raw? ⇒ Boolean
39 40 41 |
# File 'lib/rbind/core/rtype_qualifier.rb', line 39 def raw? false end |
#remove_const ⇒ Object
35 36 37 |
# File 'lib/rbind/core/rtype_qualifier.rb', line 35 def remove_const __getobj__ end |
#signature(sig = nil) ⇒ Object
43 44 45 |
# File 'lib/rbind/core/rtype_qualifier.rb', line 43 def signature(sig=nil) generate_signatures[0] end |
#to_const ⇒ Object
30 31 32 33 |
# File 'lib/rbind/core/rtype_qualifier.rb', line 30 def to_const return self if const? RTypeQualifier.new(self,:const => true) end |
#to_ptr ⇒ Object
22 23 24 |
# File 'lib/rbind/core/rtype_qualifier.rb', line 22 def to_ptr RPointer.new(self) end |
#to_ref ⇒ Object
26 27 28 |
# File 'lib/rbind/core/rtype_qualifier.rb', line 26 def to_ref RReference.new(self) end |
#to_single_ptr ⇒ Object
16 17 18 19 20 |
# File 'lib/rbind/core/rtype_qualifier.rb', line 16 def to_single_ptr t = to_raw t = t.to_const if const? t.to_ptr end |