Main Page | Class Hierarchy | Class List | File List | Class Members | File Members | Related Pages | Examples

rdaDataCodec Class Reference

This utility class allows to convert rdaData objects to byte arrays and reconstruct them from the binary representation. More...

List of all members.

Static Public Member Functions

char * encode (const rdaData &data, unsigned long &size)
 Converts the specified data object into its bynary representation.

rdaDatadecode (const char *buffer, unsigned long bufferSize)
 Constructs an rdaData object from its binary representation in buffer.


Detailed Description

This utility class allows to convert rdaData objects to byte arrays and reconstruct them from the binary representation.

This is similar to the Java object serialization (which can also be applied to the Java Data objects), but the DataCodec uses a language independent format (Common Data Representation, or CDR) to serialize objects. The CDR encoded Data objects can be stored in a file or a database, and can be passed between C++ and Java applications.

See also:
Java version of this class


Member Function Documentation

rdaData* rdaDataCodec::decode const char *  buffer,
unsigned long  bufferSize
[static]
 

Constructs an rdaData object from its binary representation in buffer.

Returns:
a pointer to the constructed object, or NULL if the conversion fails (contents of the buffer cannot be interpreted as a binary representation of a data object). The object is constructed on heap and must be deleted by the caller when it is not needed anymore.
Examples:
Decode.cpp.

char* rdaDataCodec::encode const rdaData data,
unsigned long &  size
[static]
 

Converts the specified data object into its bynary representation.

Parameters:
data the data object to encode
size on return, contains the size of the result in bytes.
Returns:
a pointer to the dynamically allocated byte array that contains the binary representation of the specified data. The array must be deallocated by the caller.
Examples:
Encode.cpp.


The documentation for this class was generated from the following file:
RDA-2.3 documentation - 27 Jun 2007 - N.Trofimov