VMware GemFire Native Client C++ API Reference
|
VMware VMware GemFire Native C++ Reference 10.4.3
|
A PdxReader will be passed to PdxSerializable.fromData or during deserialization of a PDX. More...
#include <PdxReader.hpp>
Public Member Functions | |
| virtual bool | hasField (const std::string &fieldName)=0 |
| Checks if the named field exists and returns the result. | |
| virtual bool | isIdentityField (const std::string &fieldName)=0 |
Checks if the named field was PdxWriter#markIdentityFieldmarked as an identity field. | |
| PdxReader () | |
| constructors | |
| virtual int8_t ** | readArrayOfByteArrays (const std::string &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. | |
| virtual bool | readBoolean (const std::string &fieldName)=0 |
Read a bool value from the PdxReader. | |
| virtual std::vector< bool > | readBooleanArray (const std::string &fieldName)=0 |
Read a bool* value from the PdxReader and sets array length. | |
| virtual int8_t | readByte (const std::string &fieldName)=0 |
Read a int8_t value from the PdxReader. | |
| virtual std::vector< int8_t > | readByteArray (const std::string &fieldName)=0 |
Read a int8_t* value from the PdxReader and sets array length. | |
| virtual char16_t | readChar (const std::string &fieldName)=0 |
Read a wide char value from the PdxReader. | |
| virtual std::vector< char16_t > | readCharArray (const std::string &fieldName)=0 |
Read a char16_t* value from the PdxReader and sets array length. | |
| virtual std::shared_ptr< CacheableDate > | readDate (const std::string &fieldName)=0 |
Read a std::shared_ptr<CacheableDate> value from the PdxReader. | |
| virtual double | readDouble (const std::string &fieldName)=0 |
Read a double value from the PdxReader. | |
| virtual std::vector< double > | readDoubleArray (const std::string &fieldName)=0 |
Read a double* value from the PdxReader and sets array length. | |
| virtual float | readFloat (const std::string &fieldName)=0 |
Read a float value from the PdxReader. | |
| virtual std::vector< float > | readFloatArray (const std::string &fieldName)=0 |
Read a float* value from the PdxReader and sets array length. | |
| virtual int32_t | readInt (const std::string &fieldName)=0 |
Read a int32_t value from the PdxReader. | |
| virtual std::vector< int32_t > | readIntArray (const std::string &fieldName)=0 |
Read a int32_t* value from the PdxReader and sets array length. | |
| virtual int64_t | readLong (const std::string &fieldName)=0 |
Read a int64_t value from the PdxReader. | |
| virtual std::vector< int64_t > | readLongArray (const std::string &fieldName)=0 |
Read a int64_t* value from the PdxReader and sets array length. | |
| virtual std::shared_ptr< Cacheable > | readObject (const std::string &fieldName)=0 |
Read a std::shared_ptr<Cacheable> value from the PdxReader. | |
| virtual std::shared_ptr< CacheableObjectArray > | readObjectArray (const std::string &fieldName)=0 |
Read a std::shared_ptr<CacheableObjectArray> value from the PdxReader. | |
| virtual int16_t | readShort (const std::string &fieldName)=0 |
Read a int16_t value from the PdxReader. | |
| virtual std::vector< int16_t > | readShortArray (const std::string &fieldName)=0 |
Read a int16_t* value from the PdxReader and sets array length. | |
| virtual std::string | readString (const std::string &fieldName)=0 |
Read a std::string value from the PdxReader. | |
| virtual std::vector< std::string > | readStringArray (const std::string &fieldName)=0 |
Read a array of strings from the PdxReader. | |
| virtual std::shared_ptr< PdxUnreadFields > | readUnreadFields ()=0 |
This method returns an object that represents all the unread fields which must be passed to PdxWriter#writeUnreadFields in the toData code. | |
| virtual | ~PdxReader () |
| destructor | |
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.
- Note
- Implementations of PdxReader that are internal to the Native Client library may be returned to clients via instances of PdxReader&. For those implementations, any non-
nullptr, non-empty strings returned from PdxReader::readString() or PdxReader::readWideString() must be freed with DataInput::freeUTFMemory(). Arrays returned from PdxReader::readStringArray() or PdxReader::readWideStringArray() must be freed withGF_SAFE_DELETE_ARRAYonce their constituent strings have been freed with DataInput::freeUTFMemory(). - Custom implementations of PdxReader are not subject to this restriction.
Constructor & Destructor Documentation
◆ PdxReader()
|
inline |
constructors
◆ ~PdxReader()
|
inlinevirtual |
destructor
Member Function Documentation
◆ hasField()
|
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
-
fieldName the name of the field to check
- Returns
trueif the named field exists; otherwisefalse
◆ isIdentityField()
|
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
-
fieldname the name of the field to check
- Returns
trueif the named field exists and was marked as an identify field; otherwisefalse
◆ readArrayOfByteArrays()
|
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
-
fieldName name of the field to read arrayLength length is set with number of int8_t* elements elementLength elementLength is set with the length value of individual byte arrays.
- Returns
- value of type int8_t**.
- Exceptions
-
IllegalStateException if PdxReader doesn't have the named field.
- See also
- PdxReader::hasField
◆ readBoolean()
|
pure virtual |
Read a bool value from the PdxReader.
C++ bool is mapped to Java boolean
- Parameters
-
fieldName name of the field to read
- Returns
- value of type bool.
- Exceptions
-
IllegalStateException if PdxReader doesn't have the named field.
- See also
- PdxReader::hasField
◆ readBooleanArray()
|
pure virtual |
Read a bool* value from the PdxReader and sets array length.
C++ bool* is mapped to Java boolean[]
- Parameters
-
fieldName name of the field to read
- Exceptions
-
IllegalStateException if PdxReader doesn't have the named field.
- See also
- PdxReader::hasField
◆ readByte()
|
pure virtual |
Read a int8_t value from the PdxReader.
C++ int8_t is mapped to Java byte
- Parameters
-
fieldName name of the field to read
- Returns
- value of type int8_t.
- Exceptions
-
IllegalStateException if PdxReader doesn't have the named field.
- See also
- PdxReader::hasField
◆ readByteArray()
|
pure virtual |
Read a int8_t* value from the PdxReader and sets array length.
C++ int8_t* is mapped to Java byte[].
- Parameters
-
fieldName name of the field to read
- Returns
- value of type int8_t*.
- Exceptions
-
IllegalStateException if PdxReader doesn't have the named field.
- See also
- PdxReader::hasField
◆ readChar()
|
pure virtual |
Read a wide char value from the PdxReader.
C++ char16_t is mapped to Java char
- Parameters
-
fieldName name of the field to read.
- Returns
- value of type wchar_t.
- Exceptions
-
IllegalStateException if PdxReader doesn't have the named field.
- See also
- PdxReader::hasField
◆ readCharArray()
|
pure virtual |
Read a char16_t* value from the PdxReader and sets array length.
C++ char16_t* is mapped to Java char[].
- Parameters
-
fieldName name of the field to read
- Returns
- value of type char16_t*.
- Exceptions
-
IllegalStateException if PdxReader doesn't have the named field.
- See also
- PdxReader::hasField
◆ readDate()
|
pure virtual |
Read a std::shared_ptr<CacheableDate> value from the PdxReader.
C++ std::shared_ptr<CacheableDate> is mapped to Java Date
- Parameters
-
fieldName name of the field to read
- Returns
- value of type std::shared_ptr<CacheableDate>.
- Exceptions
-
IllegalStateException if PdxReader doesn't have the named field.
- See also
- PdxReader::hasField
◆ readDouble()
|
pure virtual |
Read a double value from the PdxReader.
C++ double is mapped to Java double
- Parameters
-
fieldName name of the field to read
- Returns
- value of type double.
- Exceptions
-
IllegalStateException if PdxReader doesn't have the named field.
- See also
- PdxReader::hasField
◆ readDoubleArray()
|
pure virtual |
Read a double* value from the PdxReader and sets array length.
C++ double* is mapped to Java double[].
- Parameters
-
fieldName name of the field to read
- Returns
- value of type double*.
- Exceptions
-
IllegalStateException if PdxReader doesn't have the named field.
- See also
- PdxReader::hasField
◆ readFloat()
|
pure virtual |
Read a float value from the PdxReader.
C++ float is mapped to Java float
- Parameters
-
fieldName name of the field to read
- Returns
- value of type float.
- Exceptions
-
IllegalStateException if PdxReader doesn't have the named field.
- See also
- PdxReader::hasField
◆ readFloatArray()
|
pure virtual |
Read a float* value from the PdxReader and sets array length.
C++ float* is mapped to Java float[].
- Parameters
-
fieldName name of the field to read
- Returns
- value of type float*.
- Exceptions
-
IllegalStateException if PdxReader doesn't have the named field.
- See also
- PdxReader::hasField
◆ readInt()
|
pure virtual |
Read a int32_t value from the PdxReader.
C++ int32_t is mapped to Java int
- Parameters
-
fieldName name of the field to read
- Returns
- value of type int32_t.
- Exceptions
-
IllegalStateException if PdxReader doesn't have the named field.
- See also
- PdxReader::hasField
◆ readIntArray()
|
pure virtual |
Read a int32_t* value from the PdxReader and sets array length.
C++ int32_t* is mapped to Java int[].
- Parameters
-
fieldName name of the field to read
- Returns
- value of type int32_t*.
- Exceptions
-
IllegalStateException if PdxReader doesn't have the named field.
- See also
- PdxReader::hasField
◆ readLong()
|
pure virtual |
Read a int64_t value from the PdxReader.
C++ int64_t is mapped to Java long
- Parameters
-
fieldName name of the field to read
- Returns
- value of type int64_t.
- Exceptions
-
IllegalStateException if PdxReader doesn't have the named field.
- See also
- PdxReader::hasField
◆ readLongArray()
|
pure virtual |
Read a int64_t* value from the PdxReader and sets array length.
C++ int64_t* is mapped to Java long[].
- Parameters
-
fieldName name of the field to read
- Returns
- value of type int64_t*.
- Exceptions
-
IllegalStateException if PdxReader doesn't have the named field.
- See also
- PdxReader::hasField
◆ readObject()
|
pure virtual |
Read a std::shared_ptr<Cacheable> value from the PdxReader.
C++ std::shared_ptr<Cacheable> is mapped to Java object
- Parameters
-
fieldName name of the field to read
- Returns
- value of type std::shared_ptr<Cacheable>.
- Exceptions
-
IllegalStateException if PdxReader doesn't have the named field.
- See also
- PdxReader::hasField
◆ readObjectArray()
|
pure virtual |
Read a std::shared_ptr<CacheableObjectArray> value from the PdxReader.
C++ std::shared_ptr<CacheableObjectArray> is mapped to Java Object[].
- Parameters
-
fieldName name of the field to read
- Returns
- value of type std::shared_ptr<CacheableObjectArray>.
- Exceptions
-
IllegalStateException if PdxReader doesn't have the named field.
- See also
- PdxReader::hasField
◆ readShort()
|
pure virtual |
Read a int16_t value from the PdxReader.
C++ int16_t is mapped to Java short
- Parameters
-
fieldName name of the field to read
- Returns
- value of type int16_t.
- Exceptions
-
IllegalStateException if PdxReader doesn't have the named field.
- See also
- PdxReader::hasField
◆ readShortArray()
|
pure virtual |
Read a int16_t* value from the PdxReader and sets array length.
C++ int16_t* is mapped to Java short[].
- Parameters
-
fieldName name of the field to read
- Returns
- value of type int16_t*.
- Exceptions
-
IllegalStateException if PdxReader doesn't have the named field.
- See also
- PdxReader::hasField
◆ readString()
|
pure virtual |
Read a std::string value from the PdxReader.
C++ std::string is mapped to Java String
- Parameters
-
fieldName name of the field to read
- Returns
- value of type std::string*. Refer to the class description for how to free the return value.
- Exceptions
-
IllegalStateException if PdxReader doesn't have the named field.
- See also
- PdxReader::hasField
◆ readStringArray()
|
pure virtual |
Read a array of strings from the PdxReader.
C++ std::vector<std::string> is mapped to Java String[].
- Parameters
-
fieldName name of the field to read
- Returns
- value of type std::vector<std::string>. Refer to the class description for how to free the return value.
- Exceptions
-
IllegalStateException if PdxReader doesn't have the named field.
- See also
- PdxReader::hasField
◆ 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.
Apache Geode C++ Cache API Documentation