Class: Rserve::REXP::Reference

Inherits:
Rserve::REXP show all
Extended by:
Forwardable
Defined in:
lib/rserve/rexp/reference.rb

Constant Summary

Constants inherited from Rserve::REXP

MaxDebugItems, MismatchError

Instance Attribute Summary collapse

Attributes inherited from Rserve::REXP

#attr

Instance Method Summary collapse

Methods inherited from Rserve::REXP

#as_bytes, #as_double, #as_double_matrix, #as_doubles, #as_factor, #as_float, #as_floats, #as_integer, #as_integers, #as_list, #as_matrix, #as_nested_array, #as_string, #as_strings, #complex?, create_data_frame, #dim, #environment?, #expression?, #factor?, #get_attribute, #has_attribute?, #inherits?, #integer?, #language?, #length, #list?, #logical?, #na?, #null?, #numeric?, #pair_list?, #raw?, #recursive?, #split_array, #string?, #symbol?, #to_debug_string, #to_f, #to_i, #to_ruby, #to_ruby_internal, #vector?

Constructor Details

#initialize(e, h) ⇒ Reference

Returns a new instance of Reference.



10
11
12
13
14
15
# File 'lib/rserve/rexp/reference.rb', line 10

def initialize(e,h)
  super()
  @eng=e
  @handle=h
  @resolved_value=nil
end

Instance Attribute Details

#engObject (readonly)

Returns the value of attribute eng.



6
7
8
# File 'lib/rserve/rexp/reference.rb', line 6

def eng
  @eng
end

#handleObject (readonly)

Returns the value of attribute handle.



7
8
9
# File 'lib/rserve/rexp/reference.rb', line 7

def handle
  @handle
end

#resolved_valueObject (readonly)

Returns the value of attribute resolved_value.



8
9
10
# File 'lib/rserve/rexp/reference.rb', line 8

def resolved_value
  @resolved_value
end

Instance Method Details

#finalizeObject



33
34
35
36
37
38
39
# File 'lib/rserve/rexp/reference.rb', line 33

def finalize
  begin
    @eng.finalize_reference(self)
  ensure
    super.finalize()
  end
end

#invalidateObject



30
31
32
# File 'lib/rserve/rexp/reference.rb', line 30

def invalidate
  @resolved_value=nil
end

#reference?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/rserve/rexp/reference.rb', line 24

def reference?
  true
end

#resolveObject



27
28
29
# File 'lib/rserve/rexp/reference.rb', line 27

def resolve
  @resolved_value||= @eng.resolve_reference(self)
end