Expand description
Valuetypes on the rorb_out and rorb_in streams.
The caller marshals the state of its own instances; these functions write and read what surrounds it (the value tag, the repository ids, chunks, end tags) and keep what sharing needs: an instance written twice in a message is sent as an indirection the second time (the caller names instances by a key), and the instances read are kept by slot, so that an indirection to one gives the same instance back.
Structs§
- Held
- An instance of the caller kept by an input stream.
Constants§
- VALUE_
INDIRECTION - VALUE_
NEW - VALUE_
NULL RORB_VALUE_NULL,RORB_VALUE_INDIRECTION,RORB_VALUE_NEW.
Functions§
- rorb_
in_ ⚠end_ value - Ends the value whose header was read last, skipping the state not read (of a truncated derived type).
- rorb_
in_ ⚠get_ value - The instance kept for
slot, or NULL (an indirection to a value the caller did not read, say). - rorb_
in_ ⚠keeps_ hosts - Whether the stream gives the caller’s instances it reads to the core
(
rorb_in_set_host_value): 1 for the stream ofrorb_any_extract. - rorb_
in_ ⚠read_ value_ header - Reads what stands where a value is expected. For an indirection,
*slotis the slot of the value it refers to; for a new value, its own slot and*id_countthe number of repository ids sent (read withrorb_in_value_id). After an error, returnsRORB_VALUE_NULL. - rorb_
in_ ⚠set_ host_ value - Like
rorb_in_set_value, with the caller’s key of the instance (as it writes it withrorb_out_begin_host_value): the stream ofrorb_any_extractthen givesptrto the any’s core instance, which keeps it instead of the stream. - rorb_
in_ ⚠set_ value - Keeps
ptr, the caller’s instance of the value atslot, until the stream ends;release(ptr)is then called (unless it is NULL). - rorb_
in_ ⚠value_ id - The repository id
indexof the last value header read (UTF-8, valid until the next value header). - rorb_
out_ ⚠begin_ host_ value - Like
rorb_out_begin_value, and takeshost, a reference to the caller’s instance (released withreleasewhen not kept): an any whose value is read back from the stream keeps it, so that extracting gives the same instance, and inserting the instance (the same key) again reuses the core’s instance. - rorb_
out_ ⚠begin_ value - Starts a value: returns 1 when the caller writes its state (then
calls
rorb_out_end_value), 0 when an indirection was written or the stream failed. - rorb_
out_ ⚠end_ value - rorb_
out_ ⚠keeps_ hosts - Whether the stream keeps the caller’s instances written
(
rorb_out_begin_host_value): 1 for the stream ofrorb_any_insert. - rorb_
out_ ⚠write_ null_ value - rorb_
register_ ⚠value_ type - Makes the valuetype
tcknown to the core, which reads the values in anys (seerustorb_core::register_value_type). - rorb_
set_ ⚠value_ type_ resolver - Asks
resolve(context, id, len)for the valuetypes the core reads that are not registered (NULL removes it).