ClassesClasses | | Operators

fwrite_serialized_itemT_fwrite_serialized_itemFwriteSerializedItemFwriteSerializedItem (Operator)

Name

fwrite_serialized_itemT_fwrite_serialized_itemFwriteSerializedItemFwriteSerializedItem — Write a serialized item to a file.

Signature

fwrite_serialized_item( : : FileHandle, SerializedItemHandle : )

Herror T_fwrite_serialized_item(const Htuple FileHandle, const Htuple SerializedItemHandle)

void FwriteSerializedItem(const HTuple& FileHandle, const HTuple& SerializedItemHandle)

void HSerializedItem::FwriteSerializedItem(const HFile& FileHandle) const

static void HOperatorSet.FwriteSerializedItem(HTuple fileHandle, HTuple serializedItemHandle)

void HSerializedItem.FwriteSerializedItem(HFile fileHandle)

Description

fwrite_serialized_itemfwrite_serialized_itemFwriteSerializedItemFwriteSerializedItemFwriteSerializedItem writes a serialized item to the output file with the handle FileHandleFileHandleFileHandleFileHandlefileHandle. The serialized item is defined by the handle SerializedItemHandleSerializedItemHandleSerializedItemHandleSerializedItemHandleserializedItemHandle. The file can be opened by the operator open_fileopen_fileOpenFileOpenFileOpenFile. Note that the file must be open in binary format. For writing more than one item in one file, the operator fwrite_serialized_itemfwrite_serialized_itemFwriteSerializedItemFwriteSerializedItemFwriteSerializedItem must be called several times. A serialized item can be read with fread_serialized_itemfread_serialized_itemFreadSerializedItemFreadSerializedItemFreadSerializedItem.

Basics of the serialization and deserialization

For writing or sending iconic objects, data, or models to a file or to another HALCON process over a socket connection, first, the iconic objects, data, or models must be converted to serialized items. For this purpose, a lot of operators are available. E.g., the operator serialize_shape_modelserialize_shape_modelSerializeShapeModelSerializeShapeModelSerializeShapeModel performs the serialization for the shape model . After this, a serialized item can be written by fwrite_serialized_itemfwrite_serialized_itemFwriteSerializedItemFwriteSerializedItemFwriteSerializedItem in a file or can be transferred by send_serialized_itemsend_serialized_itemSendSerializedItemSendSerializedItemSendSerializedItem to another HALCON process over a socket connection.

To deserialize a serialized item, first a serialized item is read from a file (see fread_serialized_itemfread_serialized_itemFreadSerializedItemFreadSerializedItemFreadSerializedItem) or is received over the socket connection from another HALCON process (see receive_serialized_itemreceive_serialized_itemReceiveSerializedItemReceiveSerializedItemReceiveSerializedItem). There are also operators to convert the serialized item to the original format, i.e., to the iconic object, the data, or the model. These operators deserialize the iconic object, the data, or the model. E.g., the operator deserialize_shape_modeldeserialize_shape_modelDeserializeShapeModelDeserializeShapeModelDeserializeShapeModel deserializes the item for a serialized shape model .

Execution Information

Parameters

FileHandleFileHandleFileHandleFileHandlefileHandle (input_control)  file HFile, HTupleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

File handle.

SerializedItemHandleSerializedItemHandleSerializedItemHandleSerializedItemHandleserializedItemHandle (input_control)  serialized_item HSerializedItem, HTupleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

Handle of the serialized item.

Result

If the parameters are valid, the operator fwrite_serialized_itemfwrite_serialized_itemFwriteSerializedItemFwriteSerializedItemFwriteSerializedItem returns the value 2 (H_MSG_TRUE). If necessary, an exception is raised.

Possible Predecessors

open_fileopen_fileOpenFileOpenFileOpenFile, serialize_shape_modelserialize_shape_modelSerializeShapeModelSerializeShapeModelSerializeShapeModel, serialize_ncc_modelserialize_ncc_modelSerializeNccModelSerializeNccModelSerializeNccModel

Possible Successors

close_fileclose_fileCloseFileCloseFileCloseFile, fread_serialized_itemfread_serialized_itemFreadSerializedItemFreadSerializedItemFreadSerializedItem

Module

Foundation


ClassesClasses | | Operators