Pivotal GemFire® v8.1

Interoperability of C++ Types When Using PDX Serialization

Interoperability of C++ Types When Using PDX Serialization

This topic table lists the mapping between C++ types and other language types when using PDX serialization.

In addition, the table lists which PdxReader and PdxWriter C++ APIs to use when serializing and deserializing the types.

C++ Type .NET Type Java Type PdxReader/PdxWriter API
CacheableHashTable System::Collections::Hashtable java.util.Hashtable readObject/writeObject
CacheableHashMap System::Collections ::Generic::IDictionary<Object, Object> java.util.HashMap readObject/writeObject
CacheableVector System::Collections::ArrayList java.util.Vector readObject/writeObject
CacheableArrayList System::Collections:: Generic::IList<Object> java.util.ArrayList readObject/writeObject
bool bool boolean readBoolean/writeBoolean
int8_t sbyte Byte readByte/writeByte
wchar_t/char1 Char Char readChar/writeChar
wchar_t*/char*1 string string readString/writeString
double Double double readDouble/writeDouble
float float float readFloat/writeFloat
int16_t short short readShort/writeShort
int32_t Int32/int int readInt/writeInt
int64_t Int64/long long readLong/writeLong
int8_t* System.Byte[](System.SByte[]??) Byte[]2 readByteArray/writeByteArray
double* System.Double[] Double[] readDoubleArray/writeDoubleArray
float* System.float[] Float[] readFloatArray/writeFloatArray
CacheableHashSet CacheableHashSet java.util.HashSet readObject/writeObject
CacheableLinkedHashSet CacheableLinkedHashSet java.util.LinkedHashSet readObject/writeObject
int16_t* System.Int16[] Short[] readShortArray/writeShortArray
int32_t* System.Int32[] Int[] readIntArray/writeIntArray
int64_t* System.Int64[] Long[] readLongArray/writeLongArray
bool* System.Boolean[] Boolean[] readBooleanArray/writeBooleanArray
wchar_t*/char*1 System.Char[] char[] readCharArray/writeCharArray
enum3 enum Enum readObject/writeObject
int8_t** byte[][]/Sbyte[][] Byte[][] readArrayOfByteArrays/writeArrayOfByteArrays
wchar_t**/char**1 System.String[] String[] readStringArray/writeStringArray
CacheableDate System.DateTime4 readDate/writeDate
CacheableObjectArray object[]/System.Object[] Object[] readObjectArray/writeObjectArray
Cacheable/Serializable object/System.Object Object readObject/writeObject

1C++ allows unicode and non-unicode characters, so C++ PDX will support both wchar_t/char and wchar_t*/char*.

2 Using Pdx we use sByte only as java byte is signed. But for DataSerializable we have kept Byte[] array only as this is use as data container.

3C++ allows explicit setting of ordinal number, but it is up to the user to map java enumName with that of C++ enumName. See Using C++ Enum Type with PDX Serialization.

4Now we put UTC time from .NET .