Class: Capnp::Message
- Inherits:
-
Object
show all
- Extended by:
- T::Helpers, T::Sig
- Defined in:
- lib/capnp/runtime/message/message.rb
Instance Method Summary
collapse
Instance Method Details
#dereference_pointer(pointer_ref) ⇒ Object
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
# File 'lib/capnp/runtime/message/message.rb', line 43
def dereference_pointer(pointer_ref)
target_ref, single_far_pointer = dereference_far_pointer(pointer_ref)
return pointer_ref, nil if target_ref.nil?
return target_ref, nil if single_far_pointer
content_ref, single_far_pointer = dereference_far_pointer(target_ref)
raise Capnp::Error.new("First word of double far pointer is not a far pointer") if content_ref.nil?
raise Capnp::Error.new("Double far pointer pointing to another double far pointer") unless single_far_pointer
target_ref = target_ref.offset_position(Capnp::WORD_SIZE)
[target_ref, content_ref]
end
|
#root ⇒ Object
16
17
18
|
# File 'lib/capnp/runtime/message/message.rb', line 16
def root
segment(0).to_reference
end
|
#segment(id) ⇒ Object
12
13
|
# File 'lib/capnp/runtime/message/message.rb', line 12
def segment(id)
end
|