gemfire::WritablePdxInstance Class Reference

Inherits gemfire::PdxInstance.


Detailed Description

WritablePdxInstance is a PdxInstance that also supports field modification using the setField method.

To get a WritablePdxInstance call PdxInstance#createWriter.

Public Member Functions

virtual
WritablePdxInstancePtr 
createWriter ()=0
 Creates and returns a WritablePdxInstance whose initial values are those of this PdxInstance.
virtual void fromData (PdxReaderPtr input)=0
virtual SerializablefromData (DataInput &input)
virtual const char * getClassName () const =0
 Return the full name of the class that this pdx instance represents.
virtual void getField (const char *fieldname, CacheableObjectArrayPtr &value) const =0
 Reads the named field and set its value in CacheableObjectArrayPtr type out param.
virtual void getField (const char *fieldName, int8_t ***value, int32_t &arrayLength, int32_t *&elementLength) const =0
 Reads the named field and set its value in array of byte arrays type out param.
virtual void getField (const char *fieldname, CacheableDatePtr &value) const =0
 Reads the named field and set its value in CacheableDatePtr type out param.
virtual void getField (const char *fieldname, char ***value, int32_t &length) const =0
 Reads the named field and set its value in char* array type out param.
virtual void getField (const char *fieldname, wchar_t ***value, int32_t &length) const =0
 Reads the named field and set its value in wchar_t* array type out param.
virtual void getField (const char *fieldname, char **value) const =0
 Reads the named field and set its value in char* type out param.
virtual void getField (const char *fieldname, wchar_t **value) const =0
 Reads the named field and set its value in wchar_t* type out param.
virtual void getField (const char *fieldName, char **value, int32_t &length) const =0
 Reads the named field and set its value in char array type out param.
virtual void getField (const char *fieldName, wchar_t **value, int32_t &length) const =0
 Reads the named field and set its value in wchar_t array type out param.
virtual void getField (const char *fieldname, double **value, int32_t &length) const =0
 Reads the named field and set its value in double array type out param.
virtual void getField (const char *fieldname, float **value, int32_t &length) const =0
 Reads the named field and set its value in float array type out param.
virtual void getField (const char *fieldname, int64_t **value, int32_t &length) const =0
 Reads the named field and set its value in int64_t array type out param.
virtual void getField (const char *fieldname, int32_t **value, int32_t &length) const =0
 Reads the named field and set its value in int32_t array type out param.
virtual void getField (const char *fieldname, int16_t **value, int32_t &length) const =0
 Reads the named field and set its value in int16_t array type out param.
virtual void getField (const char *fieldname, unsigned char **value, int32_t &length) const =0
 Reads the named field and set its value in unsigned char array type out param.
virtual void getField (const char *fieldname, signed char **value, int32_t &length) const =0
 Reads the named field and set its value in signed char array type out param.
virtual void getField (const char *fieldname, bool **value, int32_t &length) const =0
 Reads the named field and set its value in bool array type out param.
virtual void getField (const char *fieldName, char &value) const =0
 Reads the named field and set its value in char type out param.
virtual void getField (const char *fieldName, wchar_t &value) const =0
 Reads the named field and set its value in wchar_t type out param.
virtual void getField (const char *fieldname, double &value) const =0
 Reads the named field and set its value in double type out param.
virtual void getField (const char *fieldname, float &value) const =0
 Reads the named field and set its value in float type out param.
virtual void getField (const char *fieldname, int64_t &value) const =0
 Reads the named field and set its value in int64_t type out param.
virtual void getField (const char *fieldname, int32_t &value) const =0
 Reads the named field and set its value in int32_t type out param.
virtual void getField (const char *fieldname, int16_t &value) const =0
 Reads the named field and set its value in int16_t type out param.
virtual void getField (const char *fieldname, unsigned char &value) const =0
 Reads the named field and set its value in unsigned char type out param.
virtual void getField (const char *fieldname, signed char &value) const =0
 Reads the named field and set its value in signed char type out param.
virtual void getField (const char *fieldname, bool &value) const =0
 Reads the named field and set its value in bool type out param.
virtual void getField (const char *fieldname, CacheablePtr &value) const =0
 Reads the named field and set its value in CacheablePtr type out param.
virtual
CacheableStringArrayPtr 
getFieldNames ()=0
 Return an unmodifiable list of the field names on this PdxInstance.
virtual
PdxSerializablePtr 
getObject ()=0
 Deserializes and returns the domain object that this instance represents.
virtual bool hasField (const char *fieldname)=0
 Checks if the named field exists and returns the result.
virtual uint32_t hashcode () const =0
 Generates a hashcode based on the identity fields of this PdxInstance.
virtual bool isIdentityField (const char *fieldname)=0
 Checks if the named field was PdxWriter#markIdentityFieldmarked as an identity field.
virtual uint32_t objectSize () const =0
 
Returns:
the size of the object in bytes This is an internal method.

virtual bool operator== (const CacheableKey &other) const =0
 Returns true if the given CacheableKey derived object is equals to this instance.
virtual void setField (const char *fieldName, CacheableObjectArrayPtr value)=0
 Set the existing named field to the given value.
virtual void setField (const char *fieldName, int8_t **value, int32_t arrayLength, int32_t *elementLength)=0
 Set the existing named field to the given value.
virtual void setField (const char *fieldName, char **value, int32_t length)=0
 Set the existing named field to the given value.
virtual void setField (const char *fieldName, wchar_t **value, int32_t length)=0
 Set the existing named field to the given value.
virtual void setField (const char *fieldName, char *value, int32_t length)=0
 Set the existing named field to the given value.
virtual void setField (const char *fieldName, wchar_t *value, int32_t length)=0
 Set the existing named field to the given value.
virtual void setField (const char *fieldName, const char *value)=0
 Set the existing named field to the given value.
virtual void setField (const char *fieldName, const wchar_t *value)=0
 Set the existing named field to the given value.
virtual void setField (const char *fieldName, double *value, int32_t length)=0
 Set the existing named field to the given value.
virtual void setField (const char *fieldName, float *value, int32_t length)=0
 Set the existing named field to the given value.
virtual void setField (const char *fieldName, int64_t *value, int32_t length)=0
 Set the existing named field to the given value.
virtual void setField (const char *fieldName, int32_t *value, int32_t length)=0
 Set the existing named field to the given value.
virtual void setField (const char *fieldName, int16_t *value, int32_t length)=0
 Set the existing named field to the given value.
virtual void setField (const char *fieldName, unsigned char *value, int32_t length)=0
 Set the existing named field to the given value.
virtual void setField (const char *fieldName, signed char *value, int32_t length)=0
 Set the existing named field to the given value.
virtual void setField (const char *fieldName, bool *value, int32_t length)=0
 Set the existing named field to the given value.
virtual void setField (const char *fieldName, CacheableDatePtr value)=0
 Set the existing named field to the given value.
virtual void setField (const char *fieldName, char value)=0
 Set the existing named field to the given value.
virtual void setField (const char *fieldName, wchar_t value)=0
 Set the existing named field to the given value.
virtual void setField (const char *fieldName, double value)=0
 Set the existing named field to the given value.
virtual void setField (const char *fieldName, float value)=0
 Set the existing named field to the given value.
virtual void setField (const char *fieldName, int64_t value)=0
 Set the existing named field to the given value.
virtual void setField (const char *fieldName, int32_t value)=0
 Set the existing named field to the given value.
virtual void setField (const char *fieldName, int16_t value)=0
 Set the existing named field to the given value.
virtual void setField (const char *fieldName, unsigned char value)=0
 Set the existing named field to the given value.
virtual void setField (const char *fieldName, signed char value)=0
 Set the existing named field to the given value.
virtual void setField (const char *fieldName, bool value)=0
 Set the existing named field to the given value.
virtual void setField (const char *fieldName, CacheablePtr value)=0
 Set the existing named field to the given value.
virtual void toData (PdxWriterPtr output)=0
virtual void toData (DataOutput &output) const
virtual
CacheableStringPtr 
toString () const =0
 Prints out all of the identity fields of this PdxInstance.
virtual ~WritablePdxInstance ()

Protected Member Functions

 WritablePdxInstance ()


Constructor & Destructor Documentation

virtual gemfire::WritablePdxInstance::~WritablePdxInstance (  )  [inline, virtual]

public methods destructor

gemfire::WritablePdxInstance::WritablePdxInstance (  )  [inline, protected]

constructors


Member Function Documentation

virtual WritablePdxInstancePtr gemfire::PdxInstance::createWriter (  )  [pure virtual, inherited]

Creates and returns a WritablePdxInstance whose initial values are those of this PdxInstance.

This call returns a copy of the current field values so modifications made to the returned value will not modify this PdxInstance.

Returns:
a WritablePdxInstance

virtual void gemfire::PdxInstance::fromData ( PdxReaderPtr  input  )  [pure virtual, inherited]

Deserialize this object. This is an internal method.

Parameters:
PdxReader to Deserialize the PDX object

virtual Serializable* gemfire::PdxInstance::fromData ( DataInput input  )  [inline, virtual, inherited]

deserialize this object, typical implementation should return the 'this' pointer. This is an internal method.

virtual const char* gemfire::PdxInstance::getClassName (  )  const [pure virtual, inherited]

Return the full name of the class that this pdx instance represents.

Returns:
the name of the class that this pdx instance represents.
Exceptions:
IllegalStateException if the PdxInstance typeid is not defined yet, to get classname or if PdxType is not defined for PdxInstance.

virtual void gemfire::PdxInstance::getField ( const char *  fieldname,
CacheableObjectArrayPtr value 
) const [pure virtual, inherited]

Reads the named field and set its value in CacheableObjectArrayPtr type out param.

For deserialization C++ Native Client requires the domain class to be registered. CacheableObjectArrayPtr type is corresponding to java Object[] type.

Parameters:
fieldname name of the field to read.
value value of the field to be set with CacheableObjectArrayPtr type.
Exceptions:
IllegalStateException if PdxInstance doesn't has the named field.
See also:
Serializable::registerPdxType

PdxInstance::hasField

virtual void gemfire::PdxInstance::getField ( const char *  fieldName,
int8_t ***  value,
int32_t &  arrayLength,
int32_t *&  elementLength 
) const [pure virtual, inherited]

Reads the named field and set its value in array of byte arrays type out param.

int8_t** type is corresponding to java byte[][] type.

Parameters:
fieldname name of the field to read.
value value of the field to be set with array of byte arrays type.
arrayLength arrayLength is set to the number of byte arrays.
elementLength elementLength is set to individual byte array lengths.
Exceptions:
IllegalStateException if PdxInstance doesn't has the named field.
See also:
PdxInstance::hasField

virtual void gemfire::PdxInstance::getField ( const char *  fieldname,
CacheableDatePtr value 
) const [pure virtual, inherited]

Reads the named field and set its value in CacheableDatePtr type out param.

CacheableDatePtr type is corresponding to java Java.util.date type.

Parameters:
fieldname name of the field to read
value value of the field to be set with CacheableDatePtr type.
Exceptions:
IllegalStateException if PdxInstance doesn't has the named field.
See also:
PdxInstance::hasField

virtual void gemfire::PdxInstance::getField ( const char *  fieldname,
char ***  value,
int32_t &  length 
) const [pure virtual, inherited]

Reads the named field and set its value in char* array type out param.

char** type is corresponding to java String[] type.

Parameters:
fieldname name of the field to read
value value of the field to be set with char* array type.
length length is set with number of char** elements.
Exceptions:
IllegalStateException if PdxInstance doesn't has the named field.
See also:
PdxInstance::hasField

virtual void gemfire::PdxInstance::getField ( const char *  fieldname,
wchar_t ***  value,
int32_t &  length 
) const [pure virtual, inherited]

Reads the named field and set its value in wchar_t* array type out param.

wchar_t** type is corresponding to java String[] type.

Parameters:
fieldname name of the field to read
value value of the field to be set with wchar_t* array type.
length length is set with number of wchar_t** elements.
Exceptions:
IllegalStateException if PdxInstance doesn't has the named field.
See also:
PdxInstance::hasField

virtual void gemfire::PdxInstance::getField ( const char *  fieldname,
char **  value 
) const [pure virtual, inherited]

Reads the named field and set its value in char* type out param.

char* type is corresponding to java String type.

Parameters:
fieldname name of the field to read
value value of the field to be set with char* type.
Exceptions:
IllegalStateException if PdxInstance doesn't has the named field.
See also:
PdxInstance::hasField

virtual void gemfire::PdxInstance::getField ( const char *  fieldname,
wchar_t **  value 
) const [pure virtual, inherited]

Reads the named field and set its value in wchar_t* type out param.

wchar_t* type is corresponding to java String type.

Parameters:
fieldname name of the field to read
value value of the field to be set with wchar_t type.
Exceptions:
IllegalStateException if PdxInstance doesn't has the named field.
See also:
PdxInstance::hasField

virtual void gemfire::PdxInstance::getField ( const char *  fieldName,
char **  value,
int32_t &  length 
) const [pure virtual, inherited]

Reads the named field and set its value in char array type out param.

char* type is corresponding to java String type.

Parameters:
fieldname name of the field to read
value value of the field to be set with char array type.
length length is set with number of char* elements.
Exceptions:
IllegalStateException if PdxInstance doesn't has the named field.
See also:
PdxInstance::hasField

virtual void gemfire::PdxInstance::getField ( const char *  fieldName,
wchar_t **  value,
int32_t &  length 
) const [pure virtual, inherited]

Reads the named field and set its value in wchar_t array type out param.

wchar_t* type is corresponding to java String type.

Parameters:
fieldname name of the field to read
value value of the field to be set with wchar_t array type.
length length is set with number of wchar_t* elements.
Exceptions:
IllegalStateException if PdxInstance doesn't has the named field.
See also:
PdxInstance::hasField

virtual void gemfire::PdxInstance::getField ( const char *  fieldname,
double **  value,
int32_t &  length 
) const [pure virtual, inherited]

Reads the named field and set its value in double array type out param.

double* type is corresponding to java double[] type.

Parameters:
fieldname name of the field to read
value value of the field to be set with double array type.
length length is set with number of double elements.
Exceptions:
IllegalStateException if PdxInstance doesn't has the named field.
See also:
PdxInstance::hasField

virtual void gemfire::PdxInstance::getField ( const char *  fieldname,
float **  value,
int32_t &  length 
) const [pure virtual, inherited]

Reads the named field and set its value in float array type out param.

float* type is corresponding to java float[] type.

Parameters:
fieldname name of the field to read
value value of the field to be set with float array type.
length length is set with number of float elements.
Exceptions:
IllegalStateException if PdxInstance doesn't has the named field.
See also:
PdxInstance::hasField

virtual void gemfire::PdxInstance::getField ( const char *  fieldname,
int64_t **  value,
int32_t &  length 
) const [pure virtual, inherited]

Reads the named field and set its value in int64_t array type out param.

int64_t* type is corresponding to java long[] type.

Parameters:
fieldname name of the field to read
value value of the field to be set with int64_t array type.
length length is set with number of int64_t elements.
Exceptions:
IllegalStateException if PdxInstance doesn't has the named field.
See also:
PdxInstance::hasField

virtual void gemfire::PdxInstance::getField ( const char *  fieldname,
int32_t **  value,
int32_t &  length 
) const [pure virtual, inherited]

Reads the named field and set its value in int32_t array type out param.

int32_t* type is corresponding to java int[] type.

Parameters:
fieldname name of the field to read
value value of the field to be set with int32_t array type.
length length is set with number of int32_t elements.
Exceptions:
IllegalStateException if PdxInstance doesn't has the named field.
See also:
PdxInstance::hasField

virtual void gemfire::PdxInstance::getField ( const char *  fieldname,
int16_t **  value,
int32_t &  length 
) const [pure virtual, inherited]

Reads the named field and set its value in int16_t array type out param.

int16_t* type is corresponding to java short[] type.

Parameters:
fieldname name of the field to read
value value of the field to be set with int16_t array type.
length length is set with number of int16_t elements.
Exceptions:
IllegalStateException if PdxInstance doesn't has the named field.
See also:
PdxInstance::hasField

virtual void gemfire::PdxInstance::getField ( const char *  fieldname,
unsigned char **  value,
int32_t &  length 
) const [pure virtual, inherited]

Reads the named field and set its value in unsigned char array type out param.

unsigned char* type is corresponding to java byte[] type. For C++ on Windows and Linux, unsigned char* type is corresponding to int8_t* type. However C++ users on Solaris should always use this api after casting int8_t* to unsigned char*.

Parameters:
fieldname name of the field to read
value value of the field to be set with unsigned char array type.
length length is set with number of unsigned char elements.
Exceptions:
IllegalStateException if PdxInstance doesn't has the named field.
See also:
PdxInstance::hasField

virtual void gemfire::PdxInstance::getField ( const char *  fieldname,
signed char **  value,
int32_t &  length 
) const [pure virtual, inherited]

Reads the named field and set its value in signed char array type out param.

signed char* type is corresponding to java byte[] type. For C++ on Windows and Linux, signed char* type is corresponding to int8_t* type. However C++ users on Solaris should always use this api after casting int8_t* to signed char*.

Parameters:
fieldname name of the field to read
value value of the field to be set with signed char array type.
length length is set with number of signed char elements.
Exceptions:
IllegalStateException if PdxInstance doesn't has the named field.
See also:
PdxInstance::hasField

virtual void gemfire::PdxInstance::getField ( const char *  fieldname,
bool **  value,
int32_t &  length 
) const [pure virtual, inherited]

Reads the named field and set its value in bool array type out param.

bool* type is corresponding to java boolean[] type.

Parameters:
fieldname name of the field to read
value value of the field to be set with bool array type.
length length is set with number of bool elements.
Exceptions:
IllegalStateException if PdxInstance doesn't has the named field.
See also:
PdxInstance::hasField

virtual void gemfire::PdxInstance::getField ( const char *  fieldName,
char &  value 
) const [pure virtual, inherited]

Reads the named field and set its value in char type out param.

char type is corresponding to java char type.

Parameters:
fieldname name of the field to read
value value of the field to be set with char type.
Exceptions:
IllegalStateException if PdxInstance doesn't has the named field.
See also:
PdxInstance::hasField

virtual void gemfire::PdxInstance::getField ( const char *  fieldName,
wchar_t &  value 
) const [pure virtual, inherited]

Reads the named field and set its value in wchar_t type out param.

wchar_t type is corresponding to java char type.

Parameters:
fieldname name of the field to read
value value of the field to be set with wchar_t type.
Exceptions:
IllegalStateException if PdxInstance doesn't has the named field.
See also:
PdxInstance::hasField

virtual void gemfire::PdxInstance::getField ( const char *  fieldname,
double &  value 
) const [pure virtual, inherited]

Reads the named field and set its value in double type out param.

double type is corresponding to java double type.

Parameters:
fieldname name of the field to read
value value of the field to be set with double type.
Exceptions:
IllegalStateException if PdxInstance doesn't has the named field.
See also:
PdxInstance::hasField

virtual void gemfire::PdxInstance::getField ( const char *  fieldname,
float &  value 
) const [pure virtual, inherited]

Reads the named field and set its value in float type out param.

float type is corresponding to java float type.

Parameters:
fieldname name of the field to read
value value of the field to be set with float type.
Exceptions:
IllegalStateException if PdxInstance doesn't has the named field.
See also:
PdxInstance::hasField

virtual void gemfire::PdxInstance::getField ( const char *  fieldname,
int64_t &  value 
) const [pure virtual, inherited]

Reads the named field and set its value in int64_t type out param.

int64_t type is corresponding to java long type.

Parameters:
fieldname name of the field to read
value value of the field to be set with int64_t type.
Exceptions:
IllegalStateException if PdxInstance doesn't has the named field.
See also:
PdxInstance::hasField

virtual void gemfire::PdxInstance::getField ( const char *  fieldname,
int32_t &  value 
) const [pure virtual, inherited]

Reads the named field and set its value in int32_t type out param.

int32_t type is corresponding to java int type.

Parameters:
fieldname name of the field to read
value value of the field to be set with int32_t type.
Exceptions:
IllegalStateException if PdxInstance doesn't has the named field.

virtual void gemfire::PdxInstance::getField ( const char *  fieldname,
int16_t &  value 
) const [pure virtual, inherited]

Reads the named field and set its value in int16_t type out param.

int16_t type is corresponding to java short type.

Parameters:
fieldname name of the field to read
value value of the field to be set with int16_t type.
Exceptions:
IllegalStateException if PdxInstance doesn't has the named field.
See also:
PdxInstance::hasField

virtual void gemfire::PdxInstance::getField ( const char *  fieldname,
unsigned char &  value 
) const [pure virtual, inherited]

Reads the named field and set its value in unsigned char type out param.

unsigned char type is corresponding to java byte type. For C++ on Windows and Linux, unsigned char type is corresponding to int8_t type. However C++ users on Solaris should always use this api after casting int8_t to unsigned char.

Parameters:
fieldname name of the field to read
value value of the field to be set with unsigned char type.
Exceptions:
IllegalStateException if PdxInstance doesn't has the named field.
See also:
PdxInstance::hasField

virtual void gemfire::PdxInstance::getField ( const char *  fieldname,
signed char &  value 
) const [pure virtual, inherited]

Reads the named field and set its value in signed char type out param.

signed char type is corresponding to java byte type. For C++ on Windows and Linux, signed char type is corresponding to int8_t type. However C++ users on Solaris should always use this api after casting int8_t to signed char.

Parameters:
fieldname name of the field to read
value value of the field to be set with signed char type.
Exceptions:
IllegalStateException if PdxInstance doesn't has the named field.
See also:
PdxInstance::hasField

virtual void gemfire::PdxInstance::getField ( const char *  fieldname,
bool &  value 
) const [pure virtual, inherited]

Reads the named field and set its value in bool type out param.

bool type is corresponding to java boolean type.

Parameters:
fieldname name of the field to read
value value of the field to be set with bool type.
Exceptions:
IllegalStateException if PdxInstance doesn't has the named field.
See also:
PdxInstance::hasField

virtual void gemfire::PdxInstance::getField ( const char *  fieldname,
CacheablePtr value 
) const [pure virtual, inherited]

Reads the named field and set its value in CacheablePtr type out param.

CacheablePtr type is corresponding to java object type.

Parameters:
fieldname name of the field to read
value value of the field to be set with CacheablePtr type.
Exceptions:
IllegalStateException if PdxInstance doesn't has the named field. For deserialization C++ Native Client requires the domain class to be registered.
See also:
Serializable::registerPdxType

PdxInstance::hasField

virtual CacheableStringArrayPtr gemfire::PdxInstance::getFieldNames (  )  [pure virtual, inherited]

Return an unmodifiable list of the field names on this PdxInstance.

Returns:
an unmodifiable list of the field names on this PdxInstance

virtual PdxSerializablePtr gemfire::PdxInstance::getObject (  )  [pure virtual, inherited]

Deserializes and returns the domain object that this instance represents.

For deserialization C++ Native Client requires the domain class to be registered.

Returns:
the deserialized domain object.
See also:
Serializable::registerPdxType

virtual bool gemfire::PdxInstance::hasField ( const char *  fieldname  )  [pure virtual, inherited]

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:
true if the named field exists; otherwise false

virtual uint32_t gemfire::PdxInstance::hashcode (  )  const [pure virtual, inherited]

Generates a hashcode based on the identity fields of this PdxInstance.

If a PdxInstance has marked identity fields using PdxWriter#markIdentityField then only the marked identity fields are its identity fields. Otherwise all its fields are identity fields. For deserialization C++ Native Client requires the domain class to be registered. If the field is an array then all array elements are used for hashcode computation. Otherwise the raw bytes of its value are used to compute the hash code.

Exceptions:
IllegalStateException if the field contains an element that is not of CacheableKey derived type.
See also:
Serializable::registerPdxType

virtual bool gemfire::PdxInstance::isIdentityField ( const char *  fieldname  )  [pure virtual, inherited]

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:
true if the named field exists and was marked as an identify field; otherwise false

virtual uint32_t gemfire::PdxInstance::objectSize (  )  const [pure virtual, inherited]

Returns:
the size of the object in bytes This is an internal method.

It is used in case of heap LRU property is set.

virtual bool gemfire::PdxInstance::operator== ( const CacheableKey other  )  const [pure virtual, inherited]

Returns true if the given CacheableKey derived object is equals to this instance.

If other is not a PdxInstance then it is not equal to this instance. NOTE: Even if other is the result of calling getObject() it will not be equal to this instance.

Otherwise equality of two PdxInstances is determined as follows:

  1. The domain class name must be equal for both PdxInstances
  2. Each identity field must be equal.
If one of the instances does not have a field that the other one does then equals will assume it has the field with a default value. If a PdxInstance has marked identity fields using markIdentityField then only the marked identity fields are its identity fields. Otherwise all its fields are identity fields.

An identity field is equal if all the following are true:

  1. The field name is equal.
  2. The field type is equal.
  3. The field value is equal.
If an identity field is of type derived from Cacheable then it is deserialized. For deserialization C++ Native Client requires the domain class to be registered. If the deserialized object is an array then all array elements are used to determine equality. If an identity field is of type CacheableObjectArray then it is deserialized and all array elements are used to determine equality. For all other field types the value does not need to be deserialized. Instead the serialized raw bytes are compared and used to determine equality.
Parameters:
other the other instance to compare to this.
Returns:
true if this instance is equal to other.
Exceptions:
IllegalStateException if the field contains an element that is not of CacheableKey derived type.
See also:
Serializable::registerPdxType

virtual void gemfire::WritablePdxInstance::setField ( const char *  fieldName,
CacheableObjectArrayPtr  value 
) [pure virtual]

Set the existing named field to the given value.

The setField method has copy-on-write semantics. So for the modifications to be stored in the cache the WritablePdxInstance must be put into a region after setField has been called one or more times. CacheableObjectArrayPtr type is corresponding to java Object[] type.

Parameters:
fieldName name of the field whose value will be set
value value that will be set to the field of type CacheableObjectArrayPtr
Exceptions:
IllegalStateException if the named field does not exist or if the type of the value is not compatible with the field.

virtual void gemfire::WritablePdxInstance::setField ( const char *  fieldName,
int8_t **  value,
int32_t  arrayLength,
int32_t *  elementLength 
) [pure virtual]

Set the existing named field to the given value.

The setField method has copy-on-write semantics. So for the modifications to be stored in the cache the WritablePdxInstance must be put into a region after setField has been called one or more times. int8_t** type is corresponding to java byte[][] type.

Parameters:
fieldName name of the field whose value will be set
value value that will be set to the field of type array of byte arrays
arrayLength The number of byte arrays.
elementLength The lengths of individual byte arrays.
Exceptions:
IllegalStateException if the named field does not exist or if the type of the value is not compatible with the field.

virtual void gemfire::WritablePdxInstance::setField ( const char *  fieldName,
char **  value,
int32_t  length 
) [pure virtual]

Set the existing named field to the given value.

The setField method has copy-on-write semantics. So for the modifications to be stored in the cache the WritablePdxInstance must be put into a region after setField has been called one or more times. char** type is corresponding to java String[] type.

Parameters:
fieldName name of the field whose value will be set
value value that will be set to the field of type char* array
length The number of elements in CString array type.
Exceptions:
IllegalStateException if the named field does not exist or if the type of the value is not compatible with the field.

virtual void gemfire::WritablePdxInstance::setField ( const char *  fieldName,
wchar_t **  value,
int32_t  length 
) [pure virtual]

Set the existing named field to the given value.

The setField method has copy-on-write semantics. So for the modifications to be stored in the cache the WritablePdxInstance must be put into a region after setField has been called one or more times. wchar_t** type is corresponding to java String[] type.

Parameters:
fieldName name of the field whose value will be set
value value that will be set to the field of type wchar_t* array
length The number of elements in WCString array type.
Exceptions:
IllegalStateException if the named field does not exist or if the type of the value is not compatible with the field.

virtual void gemfire::WritablePdxInstance::setField ( const char *  fieldName,
char *  value,
int32_t  length 
) [pure virtual]

Set the existing named field to the given value.

The setField method has copy-on-write semantics. So for the modifications to be stored in the cache the WritablePdxInstance must be put into a region after setField has been called one or more times. char* type is corresponding to java char[] type.

Parameters:
fieldName name of the field whose value will be set
value value that will be set to the field of type char array
length The number of elements in char array type.
Exceptions:
IllegalStateException if the named field does not exist or if the type of the value is not compatible with the field.

virtual void gemfire::WritablePdxInstance::setField ( const char *  fieldName,
wchar_t *  value,
int32_t  length 
) [pure virtual]

Set the existing named field to the given value.

The setField method has copy-on-write semantics. So for the modifications to be stored in the cache the WritablePdxInstance must be put into a region after setField has been called one or more times. wchar_t* type is corresponding to java char[] type.

Parameters:
fieldName name of the field whose value will be set
value value that will be set to the field of type wchar_t array
length The number of elements in wchar_t array type.
Exceptions:
IllegalStateException if the named field does not exist or if the type of the value is not compatible with the field.

virtual void gemfire::WritablePdxInstance::setField ( const char *  fieldName,
const char *  value 
) [pure virtual]

Set the existing named field to the given value.

The setField method has copy-on-write semantics. So for the modifications to be stored in the cache the WritablePdxInstance must be put into a region after setField has been called one or more times. char* type is corresponding to java String type.

Parameters:
fieldName name of the field whose value will be set
value value that will be set to the field of type char*
Exceptions:
IllegalStateException if the named field does not exist or if the type of the value is not compatible with the field.

virtual void gemfire::WritablePdxInstance::setField ( const char *  fieldName,
const wchar_t *  value 
) [pure virtual]

Set the existing named field to the given value.

The setField method has copy-on-write semantics. So for the modifications to be stored in the cache the WritablePdxInstance must be put into a region after setField has been called one or more times. wchar_t* type is corresponding to java String type.

Parameters:
fieldName name of the field whose value will be set
value value that will be set to the field of type wchar_t*
Exceptions:
IllegalStateException if the named field does not exist or if the type of the value is not compatible with the field.

virtual void gemfire::WritablePdxInstance::setField ( const char *  fieldName,
double *  value,
int32_t  length 
) [pure virtual]

Set the existing named field to the given value.

The setField method has copy-on-write semantics. So for the modifications to be stored in the cache the WritablePdxInstance must be put into a region after setField has been called one or more times. double* type is corresponding to java double[] type.

Parameters:
fieldName name of the field whose value will be set
value value that will be set to the field of type double array
length The number of elements in double array type.
Exceptions:
IllegalStateException if the named field does not exist or if the type of the value is not compatible with the field.

virtual void gemfire::WritablePdxInstance::setField ( const char *  fieldName,
float *  value,
int32_t  length 
) [pure virtual]

Set the existing named field to the given value.

The setField method has copy-on-write semantics. So for the modifications to be stored in the cache the WritablePdxInstance must be put into a region after setField has been called one or more times. float* type is corresponding to java float[] type.

Parameters:
fieldName name of the field whose value will be set
value value that will be set to the field of type float array
length The number of elements in float array type.
Exceptions:
IllegalStateException if the named field does not exist or if the type of the value is not compatible with the field.

virtual void gemfire::WritablePdxInstance::setField ( const char *  fieldName,
int64_t *  value,
int32_t  length 
) [pure virtual]

Set the existing named field to the given value.

The setField method has copy-on-write semantics. So for the modifications to be stored in the cache the WritablePdxInstance must be put into a region after setField has been called one or more times. int64_t* type is corresponding to java long[] type.

Parameters:
fieldName name of the field whose value will be set
value value that will be set to the field of type int64_t array
length The number of elements in int64_t array type.
Exceptions:
IllegalStateException if the named field does not exist or if the type of the value is not compatible with the field.

virtual void gemfire::WritablePdxInstance::setField ( const char *  fieldName,
int32_t *  value,
int32_t  length 
) [pure virtual]

Set the existing named field to the given value.

The setField method has copy-on-write semantics. So for the modifications to be stored in the cache the WritablePdxInstance must be put into a region after setField has been called one or more times. int32_t* type is corresponding to java int[] type.

Parameters:
fieldName name of the field whose value will be set
value value that will be set to the field of type int32_t array
length The number of elements in int32_t array type.
Exceptions:
IllegalStateException if the named field does not exist or if the type of the value is not compatible with the field.

virtual void gemfire::WritablePdxInstance::setField ( const char *  fieldName,
int16_t *  value,
int32_t  length 
) [pure virtual]

Set the existing named field to the given value.

The setField method has copy-on-write semantics. So for the modifications to be stored in the cache the WritablePdxInstance must be put into a region after setField has been called one or more times. int16_t* type is corresponding to java short[] type.

Parameters:
fieldName name of the field whose value will be set
value value that will be set to the field of type int16_t array
length The number of elements in int16_t array type.
Exceptions:
IllegalStateException if the named field does not exist or if the type of the value is not compatible with the field.

virtual void gemfire::WritablePdxInstance::setField ( const char *  fieldName,
unsigned char *  value,
int32_t  length 
) [pure virtual]

Set the existing named field to the given value.

The setField method has copy-on-write semantics. So for the modifications to be stored in the cache the WritablePdxInstance must be put into a region after setField has been called one or more times. unsigned char* type is corresponding to java byte[] type. For C++ on Windows and Linux, unsigned char* type is corresponding to int8_t* type. However C++ users on Solaris should always use this api after casting int8_t* to unsigned char*.

Parameters:
fieldName name of the field whose value will be set
value value that will be set to the field of type unsigned char array
length The number of elements in unsigned char array type.
Exceptions:
IllegalStateException if the named field does not exist or if the type of the value is not compatible with the field.

virtual void gemfire::WritablePdxInstance::setField ( const char *  fieldName,
signed char *  value,
int32_t  length 
) [pure virtual]

Set the existing named field to the given value.

The setField method has copy-on-write semantics. So for the modifications to be stored in the cache the WritablePdxInstance must be put into a region after setField has been called one or more times. signed char* type is corresponding to java byte[] type. For C++ on Windows and Linux, signed char* type is corresponding to int8_t* type. However C++ users on Solaris should always use this api after casting int8_t* to signed char*.

Parameters:
fieldName name of the field whose value will be set
value value that will be set to the field of type signed char array
length The number of elements in signed char array type.
Exceptions:
IllegalStateException if the named field does not exist or if the type of the value is not compatible with the field.

virtual void gemfire::WritablePdxInstance::setField ( const char *  fieldName,
bool *  value,
int32_t  length 
) [pure virtual]

Set the existing named field to the given value.

The setField method has copy-on-write semantics. So for the modifications to be stored in the cache the WritablePdxInstance must be put into a region after setField has been called one or more times. bool* type is corresponding to java boolean[] type.

Parameters:
fieldName name of the field whose value will be set
value value that will be set to the field of type bool array
length The number of elements in bool array type.
Exceptions:
IllegalStateException if the named field does not exist or if the type of the value is not compatible with the field.

virtual void gemfire::WritablePdxInstance::setField ( const char *  fieldName,
CacheableDatePtr  value 
) [pure virtual]

Set the existing named field to the given value.

The setField method has copy-on-write semantics. So for the modifications to be stored in the cache the WritablePdxInstance must be put into a region after setField has been called one or more times. CacheableDatePtr type is corresponding to java Java.util.date type.

Parameters:
fieldName name of the field whose value will be set
value value that will be set to the field of type CacheableDatePtr
Exceptions:
IllegalStateException if the named field does not exist or if the type of the value is not compatible with the field.

virtual void gemfire::WritablePdxInstance::setField ( const char *  fieldName,
char  value 
) [pure virtual]

Set the existing named field to the given value.

The setField method has copy-on-write semantics. So for the modifications to be stored in the cache the WritablePdxInstance must be put into a region after setField has been called one or more times. char type is corresponding to java char type.

Parameters:
fieldName name of the field whose value will be set
value value that will be set to the field of type char
Exceptions:
IllegalStateException if the named field does not exist or if the type of the value is not compatible with the field.

virtual void gemfire::WritablePdxInstance::setField ( const char *  fieldName,
wchar_t  value 
) [pure virtual]

Set the existing named field to the given value.

The setField method has copy-on-write semantics. So for the modifications to be stored in the cache the WritablePdxInstance must be put into a region after setField has been called one or more times. wchar_t type is corresponding to java char type.

Parameters:
fieldName name of the field whose value will be set
value value that will be set to the field of type wchar_t
Exceptions:
IllegalStateException if the named field does not exist or if the type of the value is not compatible with the field.

virtual void gemfire::WritablePdxInstance::setField ( const char *  fieldName,
double  value 
) [pure virtual]

Set the existing named field to the given value.

The setField method has copy-on-write semantics. So for the modifications to be stored in the cache the WritablePdxInstance must be put into a region after setField has been called one or more times. double type is corresponding to java double type.

Parameters:
fieldName name of the field whose value will be set
value value that will be set to the field of type double
Exceptions:
IllegalStateException if the named field does not exist or if the type of the value is not compatible with the field.

virtual void gemfire::WritablePdxInstance::setField ( const char *  fieldName,
float  value 
) [pure virtual]

Set the existing named field to the given value.

The setField method has copy-on-write semantics. So for the modifications to be stored in the cache the WritablePdxInstance must be put into a region after setField has been called one or more times. float type is corresponding to java float type.

Parameters:
fieldName name of the field whose value will be set
value value that will be set to the field of type float
Exceptions:
IllegalStateException if the named field does not exist or if the type of the value is not compatible with the field.

virtual void gemfire::WritablePdxInstance::setField ( const char *  fieldName,
int64_t  value 
) [pure virtual]

Set the existing named field to the given value.

The setField method has copy-on-write semantics. So for the modifications to be stored in the cache the WritablePdxInstance must be put into a region after setField has been called one or more times. int64_t type is corresponding to java long type.

Parameters:
fieldName name of the field whose value will be set
value value that will be set to the field of type int64_t
Exceptions:
IllegalStateException if the named field does not exist or if the type of the value is not compatible with the field.

virtual void gemfire::WritablePdxInstance::setField ( const char *  fieldName,
int32_t  value 
) [pure virtual]

Set the existing named field to the given value.

The setField method has copy-on-write semantics. So for the modifications to be stored in the cache the WritablePdxInstance must be put into a region after setField has been called one or more times. int32_t type is corresponding to java int type.

Parameters:
fieldName name of the field whose value will be set
value value that will be set to the field of type int32_t
Exceptions:
IllegalStateException if the named field does not exist or if the type of the value is not compatible with the field.

virtual void gemfire::WritablePdxInstance::setField ( const char *  fieldName,
int16_t  value 
) [pure virtual]

Set the existing named field to the given value.

The setField method has copy-on-write semantics. So for the modifications to be stored in the cache the WritablePdxInstance must be put into a region after setField has been called one or more times. int16_t type is corresponding to java short type.

Parameters:
fieldName name of the field whose value will be set
value value that will be set to the field of type int16_t
Exceptions:
IllegalStateException if the named field does not exist or if the type of the value is not compatible with the field.

virtual void gemfire::WritablePdxInstance::setField ( const char *  fieldName,
unsigned char  value 
) [pure virtual]

Set the existing named field to the given value.

The setField method has copy-on-write semantics. So for the modifications to be stored in the cache the WritablePdxInstance must be put into a region after setField has been called one or more times. unsigned char type is corresponding to java byte type. For C++ on Windows and Linux, unsigned char type is corresponding to int8_t type. However C++ users on Solaris should always use this api after casting int8_t to unsigned char.

Parameters:
fieldName name of the field whose value will be set
value value that will be set to the field of type unsigned char
Exceptions:
IllegalStateException if the named field does not exist or if the type of the value is not compatible with the field.

virtual void gemfire::WritablePdxInstance::setField ( const char *  fieldName,
signed char  value 
) [pure virtual]

Set the existing named field to the given value.

The setField method has copy-on-write semantics. So for the modifications to be stored in the cache the WritablePdxInstance must be put into a region after setField has been called one or more times. signed char type is corresponding to java byte type. For C++ on Windows and Linux, signed char type is corresponding to int8_t type. However C++ users on Solaris should always use this api after casting int8_t to signed char.

Parameters:
fieldName name of the field whose value will be set
value value that will be set to the field of type signed char
Exceptions:
IllegalStateException if the named field does not exist or if the type of the value is not compatible with the field.

virtual void gemfire::WritablePdxInstance::setField ( const char *  fieldName,
bool  value 
) [pure virtual]

Set the existing named field to the given value.

The setField method has copy-on-write semantics. So for the modifications to be stored in the cache the WritablePdxInstance must be put into a region after setField has been called one or more times. bool type is corresponding to java boolean type.

Parameters:
fieldName name of the field whose value will be set
value value that will be set to the field of type bool
Exceptions:
IllegalStateException if the named field does not exist or if the type of the value is not compatible with the field.

virtual void gemfire::WritablePdxInstance::setField ( const char *  fieldName,
CacheablePtr  value 
) [pure virtual]

Set the existing named field to the given value.

The setField method has copy-on-write semantics. So for the modifications to be stored in the cache the WritablePdxInstance must be put into a region after setField has been called one or more times. CacheablePtr type is corresponding to java object type.

Parameters:
fieldName name of the field whose value will be set
value value that will be set to the field of type CacheablePtr
Exceptions:
IllegalStateException if the named field does not exist or if the type of the value is not compatible with the field.

virtual void gemfire::PdxInstance::toData ( PdxWriterPtr  output  )  [pure virtual, inherited]

serialize this object in gemfire PDX format. This is an internal method.

Parameters:
PdxWriter to serialize the PDX object

virtual void gemfire::PdxInstance::toData ( DataOutput output  )  const [inline, virtual, inherited]

serialize this object. This is an internal method.

virtual CacheableStringPtr gemfire::PdxInstance::toString (  )  const [pure virtual, inherited]

Prints out all of the identity fields of this PdxInstance.

If a PdxInstance has marked identity fields using PdxWriter#markIdentityField then only the marked identity fields are its identity fields. Otherwise all its fields are identity fields. For deserialization C++ Native Client requires the domain class to be registered.

See also:
Serializable::registerPdxType


GemFire C++ Cache API Documentation