| Overview | Group | Tree | Graph | Deprecated | Index | Concepts |

This class is a utility class to serialize data. When your application transfers data to a remote worker, this data should be serialized in a way that does not depend on host-specific characteristics, such as big-end or little-end byte-order, for example. This kind of serialization is achieved by this class.
To serialize data, first instantiate this class; then add data
by means of one of the various add methods.
To access the serialized data, use the method getRawData.
To learn the length of serialized data, use the
method getRawLength.
The serialization performed by this class is compatible with the
de-serialization done by the class Deserializer
as well as serializers and de-serializers
created by the Callable Library (C API)
routines CPXXserializercreate
and CPXXdeserializercreate. For documentation of those
routines, see the reference manual of the Callable Library (C API).
The memory required to serialize an element of type T is
always sizeof(T).
See Also:
| Method Summary | |
|---|---|
public void | add(double const * d, CPXLONG cnt) |
public void | add(double d) |
public void | add(float const * f, CPXLONG cnt) |
public void | add(float f) |
public void | add(CPXLONG const * l, CPXLONG cnt) |
public void | add(CPXLONG l) |
public void | add(CPXINT const * i, CPXLONG cnt) |
public void | add(CPXINT i) |
public void | add(CPXSHORT const * s, CPXLONG cnt) |
public void | add(CPXSHORT s) |
public void | add(CPXBYTE const * b, CPXLONG cnt) |
public void | add(CPXBYTE b) |
public void const * | getRawData() const |
public CPXLONG | getRawLength() const |
public | Serializer() |
public | ~Serializer() |
| Method Detail |
|---|
Creates a new serializer.
Destroys this deserializer.
Any pointers returned by the method getRawData
will be invalid after the destruction.
Serializes cnt IEEE double-precision floating-point
numbers from the source specified by b.
Serializes a single IEEE double-precision floating-point number.
Serializes cnt IEEE single-precision floating-point
numbers from the source specified by b.
Serializes a single IEEE single-precision floating-point number.
Serializes cnt 64-bit, signed integers
from the source specified by b.
Serializes a single, 64-bit, signed integer.
Serializes cnt 32-bit, signed integers
from the source specified by b.
Serializes a single, 32-bit, signed integer.
Serializes cnt 16-bit, signed integers
from the source specified by b.
Serializes a single, 16-bit, signed integer.
Serializes cnt 8-bit, signed integers
from the source specified by b.
Serializes a single, 8-bit, signed integer.
Accesses a pointer to the raw serialized data.
The returned pointer is valid until the next call to any of the
add methods or to the destructor.
See Also:
Accesses the length of the serialized data.
See Also:
The number of bytes stored at the pointer returned by the method getRawData.