Used by Deserializer
to find already deserialized objects by their reference.
serialization :: DeserializerCache :: has_id
Is there an object associated toid
?
serialization :: DeserializerCache :: object_for
Get the object associated toid
serialization :: DeserializerCache :: received
Map of references to already deserialized objects.serialization :: DeserializerCache :: received=
Map of references to already deserialized objects.serialization $ DeserializerCache :: SELF
Type of this instance, automatically specialized in every classcore :: Object :: class_factory
Implementation used byget_class
to create the specific class.
core :: Object :: defaultinit
serialization :: DeserializerCache :: has_id
Is there an object associated toid
?
core :: Object :: is_same_instance
Return true ifself
and other
are the same instance (i.e. same identity).
core :: Object :: is_same_serialized
Isself
the same as other
in a serialization context?
core :: Object :: is_same_type
Return true ifself
and other
have the same dynamic type.
serialization :: DeserializerCache :: object_for
Get the object associated toid
core :: Object :: output_class_name
Display class name on stdout (debug only).serialization :: DeserializerCache :: received
Map of references to already deserialized objects.serialization :: DeserializerCache :: received=
Map of references to already deserialized objects.
# Cache of received objects sorted by there reference id
#
# Used by `Deserializer` to find already deserialized objects by their reference.
class DeserializerCache
# Map of references to already deserialized objects.
protected var received: Map[Int, Object] = new StrictHashMap[Int, Object]
# Is there an object associated to `id`?
fun has_id(id: Int): Bool do return received.keys.has(id)
# Get the object associated to `id`
fun object_for(id: Int): nullable Object do return received[id]
# Associate `object` to `id`
fun []=(id: Int, object: Object) do received[id] = object
end
lib/serialization/caching.nit:86,1--101,3