saveObject
|
Use the saveObject function to serialize objects or immediate data types for
storage into a bytevector, external buffer or file. Also use the function to return just the
size of the serialized data. The serialized data consists of a record header followed
by the uncompressed serialzed representation an object and all of the objects it depends
on. This object serialization is called an Object Closure and together with the record
header is the Object Closure Record. Immediate data types can also be serialized, along
with the obligatory record header. Immediate data serialized in this way is also called
an Object Closure Record.
Use the loadObject function to instantiate the contents of an Object Closure
into memory. The saveObject takes a variety of argument signatures. Use caution when
constructing an expression involving saveObject to ensure you get the behavior you
desire. This function has the following forms: (saveObject fileID target true) and (saveObject fileId target)- Use these form to save
the target, as an object closure record inot the open binary file specified by fileID. The object
closure record will be written at the current position in the specified file. (saveObject #void target false) - Use this form to get the size of an object closure record
size. The "target" argument can be of immediate or object type. (saveObject target) - Use this form to return a bytevector containing the object
closure record. The "target" argument can be of immemdiate or object type. (saveObject target buflen bufptr) - Use this form to write an object closure record into
a buffer. The buflen argument is the length of the target buffer an should be the exact result of a
(sizeof target) call. The bufptr argument should of type POINTER and should point to
the beginning of the buffer. Use this form of the saveObject function to pass
object closure records to external applications or internal C/C++ code. Usage The saveObject function is used to generate a serialization of an immediate or
object type along with a record header to create a Object Closure Record. These records
can be returned as a bytevector, saved to an open file or written into a external buffer.
Use the saveObject function with the loadObject function to save and load any type of
data in the AIS system.
(saveObject fileID target saveFlag ) (saveObject fileID target) (saveObject target) (saveObject target bufferLen bufferPtr) (saveObject fileId target false) -- returns sizeof object closure record. This is the
same as the result returned from a (sizeof target) call. (saveObject fileId target) or (saveObject fileId true) -- returns size of object
closure record written to file. (saveObject target) -- returns a bytevector containing object closure record. (saveObject target bufferLen bufferPtr) -- returns size of object closure record
written into specified buffer.
Expression:
Arguments
Name
Type
Description Argument: target Character String Symbol Vector BitVector ByteVector IntVector Void
FltVector ObjVector Structure Dictionary Directory Brick Pair List
Matrix NumMatrix Integer Float Number Complex Boolean Date Function
Any value of immediate or object type. Argument: fileID Integer
Optional argument. If present, must be an Integer representing the
fileID of the file previously opened by fileOpen. The file must be a binary file. Argument: saveFlag Boolean
Optional argument. If present, and if equal to false, the saveObject will compute
and return only the size of the Object Closure Record.
Returns:
Here are a number of links to Lambda coding examples which contain this instruction in various use cases.
Here are the links to the data types of the function arguments.
Here are also a number of links to functions having arguments with any of these data types.
Analytic Information Server (AIS)AIS Component Systems
|