S = serialize(Obj);
A = serialize(Obj,’m’) |
Description
The Serial data type is useful to serialize any nsp object in order for example to transmit it
through communication networks as an array of characters. For example, it can be used with pvm or
mpi to transmit any nsp object. The function serialize is used to produce a serialized object. For
some applications it can be useful to hide the serialized object in a numerical matrix, this can be
done with the extra argument ’m’. Note that an object serialized in a numeric matrix can be
corrupted if the matrix is changed. Thus this version, which is mainly used in scicos
which transmit block parameters through int or double array, should be used with care.
Operations on serialized objects
function y=f(x);y=sin(x);endfunction; L = list(1,2,"c",%f, %t, rand(2,1), f); S = serialize(L); L1=unserialize(S); A = serialize(L,'m'); L1=unserialize(A); ok = exec('unserialize(rand(1,10))',errcatch=%t);