serialize_handleT_serialize_handleSerializeHandleSerializeHandleserialize_handle (Operator)
Name
serialize_handleT_serialize_handleSerializeHandleSerializeHandleserialize_handle
— Serialize the content of a handle.
Signature
def serialize_handle(handle: HHandle) -> HHandle
Description
serialize_handleserialize_handleSerializeHandleSerializeHandleSerializeHandleserialize_handle
serializes the content of HandleHandleHandleHandlehandlehandle
and
returns the serialized item in SerializedItemSerializedItemSerializedItemSerializedItemserializedItemserialized_item
(see fwrite_serialized_itemfwrite_serialized_itemFwriteSerializedItemFwriteSerializedItemFwriteSerializedItemfwrite_serialized_item
for an introduction of the basic
principle of serialization).
The serialized item can later be deserialized with
deserialize_handledeserialize_handleDeserializeHandleDeserializeHandleDeserializeHandledeserialize_handle
.
Note that not all handle types support serialization.
To check if a handle can be serializes, use tuple_is_serializabletuple_is_serializableTupleIsSerializableTupleIsSerializableTupleIsSerializabletuple_is_serializable
or tuple_is_serializable_elemtuple_is_serializable_elemTupleIsSerializableElemTupleIsSerializableElemTupleIsSerializableElemtuple_is_serializable_elem
.
Handles that have already been cleared cannot be serialized.
Also note that the serialized item created by this operator is compatible
with the type specific deserialization operators, such as
deserialize_matrixdeserialize_matrixDeserializeMatrixDeserializeMatrixDeserializeMatrixdeserialize_matrix
or deserialize_shape_modeldeserialize_shape_modelDeserializeShapeModelDeserializeShapeModelDeserializeShapeModeldeserialize_shape_model
.
Execution Information
- Multithreading type: reentrant (runs in parallel with non-exclusive operators).
- Multithreading scope: global (may be called from any thread).
- Processed without parallelization.
Parameters
HandleHandleHandleHandlehandlehandle
(input_control) handle →
HHandle, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)
Handle that should be serialized.
SerializedItemSerializedItemSerializedItemSerializedItemserializedItemserialized_item
(output_control) serialized_item →
HSerializedItem, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)
Handle containing the serialized item.
Example (HDevelop)
create_matrix (3, 3, 0, MatrixID)
serialize_handle (MatrixID, SerializedMatrix)
deserialize_handle (SerializedMatrix, MatrixID2)
Result
If the parameters are valid, the operator serialize_handleserialize_handleSerializeHandleSerializeHandleSerializeHandleserialize_handle
returns the value 2 (
H_MSG_TRUE)
. Otherwise, an exception is raised.
Possible Predecessors
tuple_is_serializabletuple_is_serializableTupleIsSerializableTupleIsSerializableTupleIsSerializabletuple_is_serializable
,
tuple_is_serializable_elemtuple_is_serializable_elemTupleIsSerializableElemTupleIsSerializableElemTupleIsSerializableElemtuple_is_serializable_elem
Possible Successors
deserialize_handledeserialize_handleDeserializeHandleDeserializeHandleDeserializeHandledeserialize_handle
,
fwrite_serialized_itemfwrite_serialized_itemFwriteSerializedItemFwriteSerializedItemFwriteSerializedItemfwrite_serialized_item
,
send_serialized_itemsend_serialized_itemSendSerializedItemSendSerializedItemSendSerializedItemsend_serialized_item
Module
Foundation