Class: Rbind::RReference

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
lib/rbind/core/rreference.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type) ⇒ RReference

Returns a new instance of RReference.



7
8
9
# File 'lib/rbind/core/rreference.rb', line 7

def initialize(type)
    super(type)
end

Instance Attribute Details

#constObject

Returns the value of attribute const.



5
6
7
# File 'lib/rbind/core/rreference.rb', line 5

def const
  @const
end

Instance Method Details

#csignature(sig = nil) ⇒ Object



44
45
46
# File 'lib/rbind/core/rreference.rb', line 44

def csignature(sig=nil)
    generate_signatures[1]
end

#generate_signaturesObject



48
49
50
51
52
# File 'lib/rbind/core/rreference.rb', line 48

def generate_signatures
    __getobj__.generate_signatures.map do |s|
        s + "&"
    end
end

#ptr?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/rbind/core/rreference.rb', line 15

def ptr?
    false
end

#raw?Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/rbind/core/rreference.rb', line 19

def raw?
    false
end

#ref?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/rbind/core/rreference.rb', line 11

def ref?
    true
end

#remove_constObject



36
37
38
# File 'lib/rbind/core/rreference.rb', line 36

def remove_const
    RReference.new __getobj__.remove_const
end

#signature(sig = nil) ⇒ Object



40
41
42
# File 'lib/rbind/core/rreference.rb', line 40

def signature(sig=nil)
    generate_signatures[0]
end

#to_constObject



31
32
33
34
# File 'lib/rbind/core/rreference.rb', line 31

def to_const
    return self if const?
    RTypeQualifier.new(self,:const => true)
end

#to_ptrObject



23
24
25
# File 'lib/rbind/core/rreference.rb', line 23

def to_ptr
    RPointer.new(self)
end

#to_refObject



27
28
29
# File 'lib/rbind/core/rreference.rb', line 27

def to_ref
    RReference.new(self)
end