Pivotal GemFire Native Client Cache Reference  9.0.6
gemfire::PdxReader Class Referenceabstract

A PdxReader will be passed to PdxSerializable.fromData or during deserialization of a PDX. More...

Inherits gemfire::SharedBase.

Public Member Functions

virtual bool hasField (const char *fieldName)=0
 Checks if the named field exists and returns the result. More...
 
virtual bool isIdentityField (const char *fieldName)=0
 Checks if the named field was PdxWriter#markIdentityFieldmarked as an identity field. More...
 
 PdxReader ()
 constructors More...
 
void preserveSB () const
 Atomically increment reference count. More...
 
virtual int8_t ** readArrayOfByteArrays (const char *fieldName, int32_t &arrayLength, int32_t **elementLength)=0
 Read a int8_t** value from the PdxReader and sets ArrayOfByteArray's length and individual ByteArray's length. More...
 
virtual bool readBoolean (const char *fieldName)=0
 Read a bool value from the PdxReader. More...
 
virtual bool * readBooleanArray (const char *fieldName, int32_t &length)=0
 Read a bool* value from the PdxReader and sets array length. More...
 
virtual int8_t readByte (const char *fieldName)=0
 Read a int8_t value from the PdxReader. More...
 
virtual int8_t * readByteArray (const char *fieldName, int32_t &length)=0
 Read a int8_t* value from the PdxReader and sets array length. More...
 
virtual char readChar (const char *fieldName)=0
 Read a char value from the PdxReader. More...
 
virtual char * readCharArray (const char *fieldName, int32_t &length)=0
 Read a char* value from the PdxReader and sets array length. More...
 
virtual CacheableDatePtr readDate (const char *fieldName)=0
 Read a CacheableDatePtr value from the PdxReader. More...
 
virtual double readDouble (const char *fieldName)=0
 Read a double value from the PdxReader. More...
 
virtual double * readDoubleArray (const char *fieldName, int32_t &length)=0
 Read a double* value from the PdxReader and sets array length. More...
 
virtual float readFloat (const char *fieldName)=0
 Read a float value from the PdxReader. More...
 
virtual float * readFloatArray (const char *fieldName, int32_t &length)=0
 Read a float* value from the PdxReader and sets array length. More...
 
virtual int32_t readInt (const char *fieldName)=0
 Read a int32_t value from the PdxReader. More...
 
virtual int32_t * readIntArray (const char *fieldName, int32_t &length)=0
 Read a int32_t* value from the PdxReader and sets array length. More...
 
virtual int64_t readLong (const char *fieldName)=0
 Read a int64_t value from the PdxReader. More...
 
virtual int64_t * readLongArray (const char *fieldName, int32_t &length)=0
 Read a int64_t* value from the PdxReader and sets array length. More...
 
virtual CacheablePtr readObject (const char *fieldName)=0
 Read a CacheablePtr value from the PdxReader. More...
 
virtual CacheableObjectArrayPtr readObjectArray (const char *fieldName)=0
 Read a CacheableObjectArrayPtr value from the PdxReader. More...
 
virtual int16_t readShort (const char *fieldName)=0
 Read a int16_t value from the PdxReader. More...
 
virtual int16_t * readShortArray (const char *fieldName, int32_t &length)=0
 Read a int16_t* value from the PdxReader and sets array length. More...
 
virtual char * readString (const char *fieldName)=0
 Read a char* value from the PdxReader. More...
 
virtual char ** readStringArray (const char *fieldName, int32_t &length)=0
 Read a char** value from the PdxReader and sets array length. More...
 
virtual PdxUnreadFieldsPtr readUnreadFields ()=0
 This method returns an object that represents all the unread fields which must be passed to PdxWriter#writeUnreadFields in the toData code. More...
 
virtual wchar_t readWideChar (const char *fieldName)=0
 Read a wide char value from the PdxReader. More...
 
virtual wchar_t * readWideCharArray (const char *fieldName, int32_t &length)=0
 Read a wchar_t* value from the PdxReader and sets array length. More...
 
virtual wchar_t * readWideString (const char *fieldName)=0
 Read a wchar_t* value from the PdxReader. More...
 
virtual wchar_t ** readWideStringArray (const char *fieldName, int32_t &length)=0
 Read a wchar_t** value from the PdxReader and sets array length. More...
 
int32_t refCount ()
 
void releaseSB () const
 Atomically decrement reference count, the SharedBase object is automatically deleted when its reference count goes to zero. More...
 
virtual ~PdxReader ()
 destructor More...
 

Detailed Description

A PdxReader will be passed to PdxSerializable.fromData or during deserialization of a PDX.

The domain class needs to deserialize field members using this abstract class. This class is implemented by Native Client. Each readXXX call will return the field's value. If the serialized PDX does not contain the named field then a default value will be returned. Standard Java defaults are used. For Objects this is null and for primitives it is 0 or 0.0.

Constructor & Destructor Documentation

gemfire::PdxReader::PdxReader ( )
inline

constructors

virtual gemfire::PdxReader::~PdxReader ( )
inlinevirtual

destructor

Member Function Documentation

virtual bool gemfire::PdxReader::hasField ( const char *  fieldName)
pure virtual

Checks if the named field exists and returns the result.

This can be useful when writing code that handles more than one version of a PDX class.

Parameters
fieldnamethe name of the field to check
Returns
true if the named field exists; otherwise false
virtual bool gemfire::PdxReader::isIdentityField ( const char *  fieldName)
pure virtual

Checks if the named field was PdxWriter#markIdentityFieldmarked as an identity field.

Note that if no fields have been marked then all the fields are used as identity fields even though this method will return false since none of them have been marked.

Parameters
fieldnamethe name of the field to check
Returns
true if the named field exists and was marked as an identify field; otherwise false
void gemfire::SharedBase::preserveSB ( ) const
inherited

Atomically increment reference count.

virtual int8_t** gemfire::PdxReader::readArrayOfByteArrays ( const char *  fieldName,
int32_t &  arrayLength,
int32_t **  elementLength 
)
pure virtual

Read a int8_t** value from the PdxReader and sets ArrayOfByteArray's length and individual ByteArray's length.

C++ int8_t** is mapped to Java byte[][].

Parameters
fieldNamename of the field to read
arrayLengthlength is set with number of int8_t* elements
elementLengthelementLength is set with the length value of individual byte arrays.
Returns
value of type int8_t**.
Exceptions
IllegalStateExceptionif PdxReader doesn't has the named field.
See also
PdxReader::hasField
virtual bool gemfire::PdxReader::readBoolean ( const char *  fieldName)
pure virtual

Read a bool value from the PdxReader.

C++ bool is mapped to Java boolean

Parameters
fieldNamename of the field to read
Returns
value of type bool.
Exceptions
IllegalStateExceptionif PdxReader doesn't has the named field.
See also
PdxReader::hasField
virtual bool* gemfire::PdxReader::readBooleanArray ( const char *  fieldName,
int32_t &  length 
)
pure virtual

Read a bool* value from the PdxReader and sets array length.

C++ bool* is mapped to Java boolean[]

Parameters
fieldNamename of the field to read
lengthlength is set with number of bool elements.
Exceptions
IllegalStateExceptionif PdxReader doesn't has the named field.
See also
PdxReader::hasField
virtual int8_t gemfire::PdxReader::readByte ( const char *  fieldName)
pure virtual

Read a int8_t value from the PdxReader.

C++ int8_t is mapped to Java byte

Parameters
fieldNamename of the field to read
Returns
value of type int8_t.
Exceptions
IllegalStateExceptionif PdxReader doesn't has the named field.
See also
PdxReader::hasField
virtual int8_t* gemfire::PdxReader::readByteArray ( const char *  fieldName,
int32_t &  length 
)
pure virtual

Read a int8_t* value from the PdxReader and sets array length.

C++ int8_t* is mapped to Java byte[].

Parameters
fieldNamename of the field to read
lengthlength is set with number of int8_t elements
Returns
value of type int8_t*.
Exceptions
IllegalStateExceptionif PdxReader doesn't has the named field.
See also
PdxReader::hasField
virtual char gemfire::PdxReader::readChar ( const char *  fieldName)
pure virtual

Read a char value from the PdxReader.

C++ char is mapped to Java char

Parameters
fieldNamename of the field to read.
Returns
value of type char.
Exceptions
IllegalStateExceptionif PdxReader doesn't has the named field.
See also
PdxReader::hasField
virtual char* gemfire::PdxReader::readCharArray ( const char *  fieldName,
int32_t &  length 
)
pure virtual

Read a char* value from the PdxReader and sets array length.

C++ char* is mapped to Java char[].

Parameters
fieldNamename of the field to read
lengthlength is set with number of wchar_t elements.
Returns
value of type char*.
Exceptions
IllegalStateExceptionif PdxReader doesn't has the named field.
See also
PdxReader::hasField
virtual CacheableDatePtr gemfire::PdxReader::readDate ( const char *  fieldName)
pure virtual

Read a CacheableDatePtr value from the PdxReader.

C++ CacheableDatePtr is mapped to Java Date

Parameters
fieldNamename of the field to read
Returns
value of type CacheableDatePtr.
Exceptions
IllegalStateExceptionif PdxReader doesn't has the named field.
See also
PdxReader::hasField
virtual double gemfire::PdxReader::readDouble ( const char *  fieldName)
pure virtual

Read a double value from the PdxReader.

C++ double is mapped to Java double

Parameters
fieldNamename of the field to read
Returns
value of type double.
Exceptions
IllegalStateExceptionif PdxReader doesn't has the named field.
See also
PdxReader::hasField
virtual double* gemfire::PdxReader::readDoubleArray ( const char *  fieldName,
int32_t &  length 
)
pure virtual

Read a double* value from the PdxReader and sets array length.

C++ double* is mapped to Java double[].

Parameters
fieldNamename of the field to read
lengthlength is set with number of double elements
Returns
value of type double*.
Exceptions
IllegalStateExceptionif PdxReader doesn't has the named field.
See also
PdxReader::hasField
virtual float gemfire::PdxReader::readFloat ( const char *  fieldName)
pure virtual

Read a float value from the PdxReader.

C++ float is mapped to Java float

Parameters
fieldNamename of the field to read
Returns
value of type float.
Exceptions
IllegalStateExceptionif PdxReader doesn't has the named field.
See also
PdxReader::hasField
virtual float* gemfire::PdxReader::readFloatArray ( const char *  fieldName,
int32_t &  length 
)
pure virtual

Read a float* value from the PdxReader and sets array length.

C++ float* is mapped to Java float[].

Parameters
fieldNamename of the field to read
lengthlength is set with number of float elements
Returns
value of type float*.
Exceptions
IllegalStateExceptionif PdxReader doesn't has the named field.
See also
PdxReader::hasField
virtual int32_t gemfire::PdxReader::readInt ( const char *  fieldName)
pure virtual

Read a int32_t value from the PdxReader.

C++ int32_t is mapped to Java int

Parameters
fieldNamename of the field to read
Returns
value of type int32_t.
Exceptions
IllegalStateExceptionif PdxReader doesn't has the named field.
See also
PdxReader::hasField
virtual int32_t* gemfire::PdxReader::readIntArray ( const char *  fieldName,
int32_t &  length 
)
pure virtual

Read a int32_t* value from the PdxReader and sets array length.

C++ int32_t* is mapped to Java int[].

Parameters
fieldNamename of the field to read
lengthlength is set with number of int32_t elements
Returns
value of type int32_t*.
Exceptions
IllegalStateExceptionif PdxReader doesn't has the named field.
See also
PdxReader::hasField
virtual int64_t gemfire::PdxReader::readLong ( const char *  fieldName)
pure virtual

Read a int64_t value from the PdxReader.

C++ int64_t is mapped to Java long

Parameters
fieldNamename of the field to read
Returns
value of type int64_t.
Exceptions
IllegalStateExceptionif PdxReader doesn't has the named field.
See also
PdxReader::hasField
virtual int64_t* gemfire::PdxReader::readLongArray ( const char *  fieldName,
int32_t &  length 
)
pure virtual

Read a int64_t* value from the PdxReader and sets array length.

C++ int64_t* is mapped to Java long[].

Parameters
fieldNamename of the field to read
lengthlength is set with number of int64_t elements
Returns
value of type int64_t*.
Exceptions
IllegalStateExceptionif PdxReader doesn't has the named field.
See also
PdxReader::hasField
virtual CacheablePtr gemfire::PdxReader::readObject ( const char *  fieldName)
pure virtual

Read a CacheablePtr value from the PdxReader.

C++ CacheablePtr is mapped to Java object

Parameters
fieldNamename of the field to read
Returns
value of type CacheablePtr.
Exceptions
IllegalStateExceptionif PdxReader doesn't has the named field.
See also
PdxReader::hasField
virtual CacheableObjectArrayPtr gemfire::PdxReader::readObjectArray ( const char *  fieldName)
pure virtual

Read a CacheableObjectArrayPtr value from the PdxReader.

C++ CacheableObjectArrayPtr is mapped to Java Object[].

Parameters
fieldNamename of the field to read
Returns
value of type CacheableObjectArrayPtr.
Exceptions
IllegalStateExceptionif PdxReader doesn't has the named field.
See also
PdxReader::hasField
virtual int16_t gemfire::PdxReader::readShort ( const char *  fieldName)
pure virtual

Read a int16_t value from the PdxReader.

C++ int16_t is mapped to Java short

Parameters
fieldNamename of the field to read
Returns
value of type int16_t.
Exceptions
IllegalStateExceptionif PdxReader doesn't has the named field.
See also
PdxReader::hasField
virtual int16_t* gemfire::PdxReader::readShortArray ( const char *  fieldName,
int32_t &  length 
)
pure virtual

Read a int16_t* value from the PdxReader and sets array length.

C++ int16_t* is mapped to Java short[].

Parameters
fieldNamename of the field to read
lengthlength is set with number of int16_t elements
Returns
value of type int16_t*.
Exceptions
IllegalStateExceptionif PdxReader doesn't has the named field.
See also
PdxReader::hasField
virtual char* gemfire::PdxReader::readString ( const char *  fieldName)
pure virtual

Read a char* value from the PdxReader.

C++ char* is mapped to Java String

Parameters
fieldNamename of the field to read
Returns
value of type char*.
Exceptions
IllegalStateExceptionif PdxReader doesn't has the named field.
See also
PdxReader::hasField
virtual char** gemfire::PdxReader::readStringArray ( const char *  fieldName,
int32_t &  length 
)
pure virtual

Read a char** value from the PdxReader and sets array length.

C++ char** is mapped to Java String[].

Parameters
fieldNamename of the field to read
lengthlength is set with number of char* elements
Returns
value of type char**.
Exceptions
IllegalStateExceptionif PdxReader doesn't has the named field.
See also
PdxReader::hasField
virtual PdxUnreadFieldsPtr gemfire::PdxReader::readUnreadFields ( )
pure virtual

This method returns an object that represents all the unread fields which must be passed to PdxWriter#writeUnreadFields in the toData code.

Note that if CacheFactory#setPdxIgnoreUnreadFields is set to true then this method will always return an object that has no unread fields.

Returns
an object that represents the unread fields.
virtual wchar_t gemfire::PdxReader::readWideChar ( const char *  fieldName)
pure virtual

Read a wide char value from the PdxReader.

C++ wchar_t is mapped to Java char

Parameters
fieldNamename of the field to read.
Returns
value of type wchar_t.
Exceptions
IllegalStateExceptionif PdxReader doesn't has the named field.
See also
PdxReader::hasField
virtual wchar_t* gemfire::PdxReader::readWideCharArray ( const char *  fieldName,
int32_t &  length 
)
pure virtual

Read a wchar_t* value from the PdxReader and sets array length.

C++ wchar_t* is mapped to Java char[].

Parameters
fieldNamename of the field to read
lengthlength is set with number of wchar_t elements.
Returns
value of type wchar_t*.
Exceptions
IllegalStateExceptionif PdxReader doesn't has the named field.
See also
PdxReader::hasField
virtual wchar_t* gemfire::PdxReader::readWideString ( const char *  fieldName)
pure virtual

Read a wchar_t* value from the PdxReader.

C++ wchar_t* is mapped to Java String

Parameters
fieldNamename of the field to read
Returns
value of type wchar_t*.
Exceptions
IllegalStateExceptionif PdxReader doesn't has the named field.
See also
PdxReader::hasField
virtual wchar_t** gemfire::PdxReader::readWideStringArray ( const char *  fieldName,
int32_t &  length 
)
pure virtual

Read a wchar_t** value from the PdxReader and sets array length.

C++ wchar_t** is mapped to Java String[].

Parameters
fieldNamename of the field to read
lengthlength is set with number of wchar_t* elements
Returns
value of type wchar_t**.
Exceptions
IllegalStateExceptionif PdxReader doesn't has the named field.
See also
PdxReader::hasField
int32_t gemfire::SharedBase::refCount ( )
inlineinherited
Returns
the reference count
void gemfire::SharedBase::releaseSB ( ) const
inherited

Atomically decrement reference count, the SharedBase object is automatically deleted when its reference count goes to zero.


GemFire C++ Cache API Documentation