Pivotal GemFire Native C++ Reference  10.2.0
apache::geode::client::WritablePdxInstance Class Referenceabstract

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

Inherits apache::geode::client::PdxInstance.

Public Member Functions

virtual std::shared_ptr< WritablePdxInstancecreateWriter ()=0
 Creates and returns a WritablePdxInstance whose initial values are those of this PdxInstance. More...
 
virtual void fromData (PdxReader &input) override=0
 Deserialize this object. More...
 
virtual std::vector< bool > getBooleanArrayField (const std::string &fieldname) const =0
 Reads the named field and sets its value in bool array type out param. More...
 
virtual bool getBooleanField (const std::string &fieldname) const =0
 Reads the named field and sets its value in bool type out param. More...
 
virtual std::vector< int8_t > getByteArrayField (const std::string &fieldname) const =0
 Reads the named field and sets its value in signed char array type out param. More...
 
virtual int8_t getByteField (const std::string &fieldname) const =0
 Reads the named field and sets its value in signed char type out param. More...
 
virtual std::shared_ptr< CacheableDategetCacheableDateField (const std::string &fieldname) const =0
 Reads the named field and sets its value in std::shared_ptr<CacheableDate> type out param. More...
 
virtual std::shared_ptr< CacheablegetCacheableField (const std::string &fieldname) const =0
 Reads the named field and sets its value in std::shared_ptr<Cacheable> type out param. More...
 
virtual std::shared_ptr< CacheableObjectArraygetCacheableObjectArrayField (const std::string &fieldname) const =0
 Reads the named field and sets its value in std::shared_ptr<CacheableObjectArray> type out param. More...
 
virtual std::vector< char16_t > getCharArrayField (const std::string &fieldName) const =0
 Reads the named field and sets its value in char array type out param. More...
 
virtual char16_t getCharField (const std::string &fieldName) const =0
 Reads the named field and sets its value in char type out param. More...
 
virtual const std::string & getClassName () const override=0
 Return the full name of the class that this pdx instance represents. More...
 
virtual std::vector< double > getDoubleArrayField (const std::string &fieldname) const =0
 Reads the named field and sets its value in double array type out param. More...
 
virtual double getDoubleField (const std::string &fieldname) const =0
 Reads the named field and sets its value in double type out param. More...
 
virtual void getField (const std::string &fieldName, int8_t ***value, int32_t &arrayLength, int32_t *&elementLength) const =0
 Reads the named field and sets its value in array of byte arrays type out param. More...
 
virtual std::shared_ptr< CacheableStringArraygetFieldNames ()=0
 Return an unmodifiable list of the field names on this PdxInstance. More...
 
virtual PdxFieldTypes getFieldType (const std::string &fieldname) const =0
 Return the type. More...
 
virtual std::vector< float > getFloatArrayField (const std::string &fieldname) const =0
 Reads the named field and sets its value in float array type out param. More...
 
virtual float getFloatField (const std::string &fieldname) const =0
 Reads the named field and sets its value in float type out param. More...
 
virtual std::vector< int32_t > getIntArrayField (const std::string &fieldname) const =0
 Reads the named field and sets its value in int32_t array type out param. More...
 
virtual int32_t getIntField (const std::string &fieldname) const =0
 Reads the named field and sets its value in int32_t type out param. More...
 
virtual std::vector< int64_t > getLongArrayField (const std::string &fieldname) const =0
 Reads the named field and sets its value in int64_t array type out param. More...
 
virtual int64_t getLongField (const std::string &fieldname) const =0
 Reads the named field and sets its value in int64_t type out param. More...
 
virtual std::shared_ptr< PdxSerializablegetObject ()=0
 Deserializes and returns the domain object that this instance represents. More...
 
virtual std::vector< int16_t > getShortArrayField (const std::string &fieldname) const =0
 Reads the named field and sets its value in int16_t array type out param. More...
 
virtual int16_t getShortField (const std::string &fieldname) const =0
 Reads the named field and sets its value in int16_t type out param. More...
 
virtual std::vector< std::string > getStringArrayField (const std::string &fieldname) const =0
 Reads the named field as a string array. More...
 
virtual std::string getStringField (const std::string &fieldname) const =0
 Reads the named field and sets its value in std::string type out param. More...
 
virtual bool hasField (const std::string &fieldname)=0
 Checks if the named field exists and returns the result. More...
 
virtual int32_t hashcode () const override=0
 Generates a hashcode based on the identity fields of this PdxInstance. More...
 
virtual bool isIdentityField (const std::string &fieldname)=0
 Checks if the named field was PdxWriter#markIdentityFieldmarked as an identity field. More...
 
virtual size_t objectSize () const override=0
 
virtual bool operator== (const CacheableKey &other) const override=0
 Returns true if the given CacheableKey derived object is equals to this instance. More...
 
virtual void setField (const std::string &fieldName, bool value)=0
 Set the existing named field to the given value. More...
 
virtual void setField (const std::string &fieldName, char16_t value)=0
 Set the existing named field to the given value. More...
 
virtual void setField (const std::string &fieldName, const std::string &value)=0
 Set the existing named field to the given value. More...
 
virtual void setField (const std::string &fieldName, const std::vector< bool > &value)=0
 Set the existing named field to the given value. More...
 
virtual void setField (const std::string &fieldName, const std::vector< char16_t > &value)=0
 Set the existing named field to the given value. More...
 
virtual void setField (const std::string &fieldName, const std::vector< double > &value)=0
 Set the existing named field to the given value. More...
 
virtual void setField (const std::string &fieldName, const std::vector< float > &value)=0
 Set the existing named field to the given value. More...
 
virtual void setField (const std::string &fieldName, const std::vector< int16_t > &value)=0
 Set the existing named field to the given value. More...
 
virtual void setField (const std::string &fieldName, const std::vector< int32_t > &value)=0
 Set the existing named field to the given value. More...
 
virtual void setField (const std::string &fieldName, const std::vector< int64_t > &value)=0
 Set the existing named field to the given value. More...
 
virtual void setField (const std::string &fieldName, const std::vector< int8_t > &value)=0
 Set the existing named field to the given value. More...
 
virtual void setField (const std::string &fieldName, double value)=0
 Set the existing named field to the given value. More...
 
virtual void setField (const std::string &fieldName, float value)=0
 Set the existing named field to the given value. More...
 
virtual void setField (const std::string &fieldName, int16_t value)=0
 Set the existing named field to the given value. More...
 
virtual void setField (const std::string &fieldName, int32_t value)=0
 Set the existing named field to the given value. More...
 
virtual void setField (const std::string &fieldName, int64_t value)=0
 Set the existing named field to the given value. More...
 
virtual void setField (const std::string &fieldName, int8_t **value, int32_t arrayLength, int32_t *elementLength)=0
 Set the existing named field to the given value. More...
 
virtual void setField (const std::string &fieldName, signed char value)=0
 Set the existing named field to the given value. More...
 
virtual void setField (const std::string &fieldName, std::shared_ptr< Cacheable > value)=0
 Set the existing named field to the given value. More...
 
virtual void setField (const std::string &fieldName, std::shared_ptr< CacheableDate > value)=0
 Set the existing named field to the given value. More...
 
virtual void setField (const std::string &fieldName, std::shared_ptr< CacheableObjectArray > value)=0
 Set the existing named field to the given value. More...
 
virtual void setField (const std::string &fieldName, std::string *value, int32_t length)=0
 Set the existing named field to the given value. More...
 
virtual void setField (const std::string &fieldName, unsigned char value)=0
 Set the existing named field to the given value. More...
 
virtual void toData (PdxWriter &output) const override=0
 serialize this object in geode PDX format. More...
 
virtual std::string toString () const override=0
 Prints out all of the identity fields of this PdxInstance. More...
 
virtual ~WritablePdxInstance ()=default
 destructor More...
 

Static Public Member Functions

template<class _T >
static std::shared_ptr< CacheableKeycreate (_T value)
 Factory method that creates the key type that matches the type of value. More...
 
template<class _T >
static std::shared_ptr< Serializablecreate (_T value)
 Factory method that creates the Serializable object that matches the type of value. More...
 

Protected Member Functions

 WritablePdxInstance ()=default
 constructors More...
 

Detailed Description

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

To get a WritablePdxInstance call PdxInstance#createWriter.

Constructor & Destructor Documentation

◆ ~WritablePdxInstance()

virtual apache::geode::client::WritablePdxInstance::~WritablePdxInstance ( )
virtualdefault

destructor

◆ WritablePdxInstance()

apache::geode::client::WritablePdxInstance::WritablePdxInstance ( )
protecteddefault

constructors

Member Function Documentation

◆ create() [1/2]

template<class _T >
static std::shared_ptr<CacheableKey> apache::geode::client::CacheableKey::create ( _T  value)
staticinherited

Factory method that creates the key type that matches the type of value.

For user defined derivations of CacheableKey, the method apache::geode::client::CacheableKey::create may be overloaded.

◆ create() [2/2]

template<class _T >
static std::shared_ptr<Serializable> apache::geode::client::Serializable::create ( _T  value)
staticinherited

Factory method that creates the Serializable object that matches the type of value.

For user defined derivations of Serializable, the method apache::geode::client::Serializable::create may be overloaded.

◆ createWriter()

virtual std::shared_ptr<WritablePdxInstance> apache::geode::client::PdxInstance::createWriter ( )
pure virtualinherited

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

◆ fromData()

virtual void apache::geode::client::PdxInstance::fromData ( PdxReader input)
overridepure virtualinherited

Deserialize this object.

This is an internal method.

Parameters
inputto deserialize the PDX object

Implements apache::geode::client::PdxSerializable.

◆ getBooleanArrayField()

virtual std::vector<bool> apache::geode::client::PdxInstance::getBooleanArrayField ( const std::string &  fieldname) const
pure virtualinherited

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

bool* type corresponds to the Java boolean[] type.

Parameters
fieldnamename of the field to read
Exceptions
IllegalStateExceptionif PdxInstance doesn't have the named field.
See also
PdxInstance::hasField

◆ getBooleanField()

virtual bool apache::geode::client::PdxInstance::getBooleanField ( const std::string &  fieldname) const
pure virtualinherited

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

bool type corresponds to the Java boolean type.

Parameters
fieldnamename of the field to read
Exceptions
IllegalStateExceptionif PdxInstance doesn't have the named field.
See also
PdxInstance::hasField

◆ getByteArrayField()

virtual std::vector<int8_t> apache::geode::client::PdxInstance::getByteArrayField ( const std::string &  fieldname) const
pure virtualinherited

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

int8_t* type corresponds to the Java byte[] type.

Parameters
fieldnamename of the field to read
Exceptions
IllegalStateExceptionif PdxInstance doesn't have the named field.
See also
PdxInstance::hasField

◆ getByteField()

virtual int8_t apache::geode::client::PdxInstance::getByteField ( const std::string &  fieldname) const
pure virtualinherited

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

signed char type corresponds to the Java byte type.

Parameters
fieldnamename of the field to read
Exceptions
IllegalStateExceptionif PdxInstance doesn't have the named field.
See also
PdxInstance::hasField

◆ getCacheableDateField()

virtual std::shared_ptr<CacheableDate> apache::geode::client::PdxInstance::getCacheableDateField ( const std::string &  fieldname) const
pure virtualinherited

Reads the named field and sets its value in std::shared_ptr<CacheableDate> type out param.

std::shared_ptr<CacheableDate> type is corresponding to java Java.util.date type.

Parameters
fieldnamename of the field to read std::shared_ptr<CacheableDate> type.
Exceptions
IllegalStateExceptionif PdxInstance doesn't have the named field.
See also
PdxInstance::hasField

◆ getCacheableField()

virtual std::shared_ptr<Cacheable> apache::geode::client::PdxInstance::getCacheableField ( const std::string &  fieldname) const
pure virtualinherited

Reads the named field and sets its value in std::shared_ptr<Cacheable> type out param.

std::shared_ptr<Cacheable> type corresponds to the Java object type.

Parameters
fieldnamename of the field to read
Exceptions
IllegalStateExceptionif PdxInstance doesn't have the named field. For deserialization C++ Native Client requires the domain class to be registered.
See also
serializationRegistry->addPdxType
PdxInstance::hasField

◆ getCacheableObjectArrayField()

virtual std::shared_ptr<CacheableObjectArray> apache::geode::client::PdxInstance::getCacheableObjectArrayField ( const std::string &  fieldname) const
pure virtualinherited

Reads the named field and sets its value in std::shared_ptr<CacheableObjectArray> type out param.

For deserialization C++ Native Client requires the domain class to be registered. std::shared_ptr<CacheableObjectArray> type corresponds to the Java Object[] type.

Parameters
fieldnamename of the field to read. std::shared_ptr<CacheableObjectArray> type.
Exceptions
IllegalStateExceptionif PdxInstance doesn't have the named field.
See also
serializationRegistry->addPdxType
PdxInstance::hasField

◆ getCharArrayField()

virtual std::vector<char16_t> apache::geode::client::PdxInstance::getCharArrayField ( const std::string &  fieldName) const
pure virtualinherited

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

char16_t* type corresponds to the Java char[] type.

Parameters
fieldNamename of the field to read
Exceptions
IllegalStateExceptionif PdxInstance doesn't have the named field.
See also
PdxInstance::hasField

◆ getCharField()

virtual char16_t apache::geode::client::PdxInstance::getCharField ( const std::string &  fieldName) const
pure virtualinherited

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

char type corresponds to the Java char type.

Exceptions
IllegalStateExceptionif PdxInstance doesn't have the named field.
See also
PdxInstance::hasField

◆ getClassName()

virtual const std::string& apache::geode::client::PdxInstance::getClassName ( ) const
overridepure virtualinherited

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

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

Implements apache::geode::client::PdxSerializable.

◆ getDoubleArrayField()

virtual std::vector<double> apache::geode::client::PdxInstance::getDoubleArrayField ( const std::string &  fieldname) const
pure virtualinherited

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

double* type corresponds to the Java double[] type.

Parameters
fieldnamename of the field to read
Exceptions
IllegalStateExceptionif PdxInstance doesn't have the named field.
See also
PdxInstance::hasField

◆ getDoubleField()

virtual double apache::geode::client::PdxInstance::getDoubleField ( const std::string &  fieldname) const
pure virtualinherited

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

double type corresponds to the Java double type.

Parameters
fieldnamename of the field to read
Exceptions
IllegalStateExceptionif PdxInstance doesn't have the named field.
See also
PdxInstance::hasField

◆ getField()

virtual void apache::geode::client::PdxInstance::getField ( const std::string &  fieldName,
int8_t ***  value,
int32_t &  arrayLength,
int32_t *&  elementLength 
) const
pure virtualinherited

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

int8_t** type corresponds to the Java byte[][] type.

Parameters
fieldNamename of the field to read.
valuevalue of the field to be set with array of byte arrays type.
arrayLengtharrayLength is set to the number of byte arrays.
elementLengthelementLength is set to individual byte array lengths.
Exceptions
IllegalStateExceptionif PdxInstance doesn't have the named field.
See also
PdxInstance::hasField

◆ getFieldNames()

virtual std::shared_ptr<CacheableStringArray> apache::geode::client::PdxInstance::getFieldNames ( )
pure virtualinherited

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

Returns
an unmodifiable list of the field names on this PdxInstance

◆ getFieldType()

virtual PdxFieldTypes apache::geode::client::PdxInstance::getFieldType ( const std::string &  fieldname) const
pure virtualinherited

Return the type.

See also
PdxInstance::PdxFieldTypes of the field in the pdx instance.
Returns
the type
See also
PdxInstance::PdxFieldTypes of the field in the pdx instance.
Exceptions
IllegalStateExceptionif the PdxInstance typeid is not defined yet, to get classname or if PdxType is not defined for PdxInstance.

◆ getFloatArrayField()

virtual std::vector<float> apache::geode::client::PdxInstance::getFloatArrayField ( const std::string &  fieldname) const
pure virtualinherited

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

float* type corresponds to the Java float[] type.

Parameters
fieldnamename of the field to read
Exceptions
IllegalStateExceptionif PdxInstance doesn't have the named field.
See also
PdxInstance::hasField

◆ getFloatField()

virtual float apache::geode::client::PdxInstance::getFloatField ( const std::string &  fieldname) const
pure virtualinherited

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

float type corresponds to the Java float type.

Parameters
fieldnamename of the field to read
Exceptions
IllegalStateExceptionif PdxInstance doesn't have the named field.
See also
PdxInstance::hasField

◆ getIntArrayField()

virtual std::vector<int32_t> apache::geode::client::PdxInstance::getIntArrayField ( const std::string &  fieldname) const
pure virtualinherited

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

int32_t* type corresponds to the Java int[] type.

Parameters
fieldnamename of the field to read
Exceptions
IllegalStateExceptionif PdxInstance doesn't have the named field.
See also
PdxInstance::hasField

◆ getIntField()

virtual int32_t apache::geode::client::PdxInstance::getIntField ( const std::string &  fieldname) const
pure virtualinherited

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

int32_t type corresponds to the Java int type.

Parameters
fieldnamename of the field to read
Exceptions
IllegalStateExceptionif PdxInstance doesn't have the named field.

◆ getLongArrayField()

virtual std::vector<int64_t> apache::geode::client::PdxInstance::getLongArrayField ( const std::string &  fieldname) const
pure virtualinherited

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

int64_t* type corresponds to the Java long[] type.

Parameters
fieldnamename of the field to read
Exceptions
IllegalStateExceptionif PdxInstance doesn't have the named field.
See also
PdxInstance::hasField

◆ getLongField()

virtual int64_t apache::geode::client::PdxInstance::getLongField ( const std::string &  fieldname) const
pure virtualinherited

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

int64_t type corresponds to the Java long type.

Parameters
fieldnamename of the field to read
Exceptions
IllegalStateExceptionif PdxInstance doesn't have the named field.
See also
PdxInstance::hasField

◆ getObject()

virtual std::shared_ptr<PdxSerializable> apache::geode::client::PdxInstance::getObject ( )
pure virtualinherited

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
serializationRegistry->addPdxType

◆ getShortArrayField()

virtual std::vector<int16_t> apache::geode::client::PdxInstance::getShortArrayField ( const std::string &  fieldname) const
pure virtualinherited

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

int16_t* type corresponds to the Java short[] type.

Parameters
fieldnamename of the field to read
Exceptions
IllegalStateExceptionif PdxInstance doesn't have the named field.
See also
PdxInstance::hasField

◆ getShortField()

virtual int16_t apache::geode::client::PdxInstance::getShortField ( const std::string &  fieldname) const
pure virtualinherited

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

int16_t type corresponds to the Java short type.

Parameters
fieldnamename of the field to read
Exceptions
IllegalStateExceptionif PdxInstance doesn't have the named field.
See also
PdxInstance::hasField

◆ getStringArrayField()

virtual std::vector<std::string> apache::geode::client::PdxInstance::getStringArrayField ( const std::string &  fieldname) const
pure virtualinherited

Reads the named field as a string array.

std::vector<std::string> type corresponds to the Java String[] type.

Parameters
fieldnamename of the field to read
Exceptions
IllegalStateExceptionif PdxInstance doesn't have the named field.
See also
PdxInstance::hasField

◆ getStringField()

virtual std::string apache::geode::client::PdxInstance::getStringField ( const std::string &  fieldname) const
pure virtualinherited

Reads the named field and sets its value in std::string type out param.

std::string type corresponds to the Java String type.

Parameters
fieldnamename of the field to read
Returns
string value for field.
Exceptions
IllegalStateExceptionif PdxInstance doesn't have the named field.
See also
PdxInstance::hasField

◆ hasField()

virtual bool apache::geode::client::PdxInstance::hasField ( const std::string &  fieldname)
pure virtualinherited

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

◆ hashcode()

virtual int32_t apache::geode::client::PdxInstance::hashcode ( ) const
overridepure virtualinherited

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

If a PdxInstance has marked identity fields using {} 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
IllegalStateExceptionif the field contains an element that is not of CacheableKey derived type.
See also
serializationRegistry->addPdxType

Implements apache::geode::client::CacheableKey.

◆ isIdentityField()

virtual bool apache::geode::client::PdxInstance::isIdentityField ( const std::string &  fieldname)
pure virtualinherited

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

◆ objectSize()

virtual size_t apache::geode::client::PdxInstance::objectSize ( ) const
overridepure virtualinherited
Returns
the size of the object in bytes This is an internal method. It is used in case of heap LRU property is set.

Reimplemented from apache::geode::client::Serializable.

◆ operator==()

virtual bool apache::geode::client::PdxInstance::operator== ( const CacheableKey other) const
overridepure virtualinherited

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 {} 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
otherthe other instance to compare to this.
Returns
true if this instance is equal to other.
Exceptions
IllegalStateExceptionif the field contains an element that is not of CacheableKey derived type.
See also
serializationRegistry->addPdxType

Implements apache::geode::client::CacheableKey.

◆ setField() [1/23]

virtual void apache::geode::client::WritablePdxInstance::setField ( const std::string &  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
fieldNamename of the field whose value will be set
valuevalue that will be set to the field of type bool
Exceptions
IllegalStateExceptionif the named field does not exist or if the type of the value is not compatible with the field.

◆ setField() [2/23]

virtual void apache::geode::client::WritablePdxInstance::setField ( const std::string &  fieldName,
char16_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. char type is corresponding to java char type.

Parameters
fieldNamename of the field whose value will be set
valuevalue that will be set to the field of type char
Exceptions
IllegalStateExceptionif the named field does not exist or if the type of the value is not compatible with the field.

◆ setField() [3/23]

virtual void apache::geode::client::WritablePdxInstance::setField ( const std::string &  fieldName,
const std::string &  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
fieldNamename of the field whose value will be set
valuevalue that will be set to the field of type char*
Exceptions
IllegalStateExceptionif the named field does not exist or if the type of the value is not compatible with the field.

◆ setField() [4/23]

virtual void apache::geode::client::WritablePdxInstance::setField ( const std::string &  fieldName,
const std::vector< 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
fieldNamename of the field whose value will be set
valuevalue that will be set to the field of type bool array
Exceptions
IllegalStateExceptionif the named field does not exist or if the type of the value is not compatible with the field.

◆ setField() [5/23]

virtual void apache::geode::client::WritablePdxInstance::setField ( const std::string &  fieldName,
const std::vector< char16_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. char16_t* type is corresponding to java char[] type.

Parameters
fieldNamename of the field whose value will be set
valuevalue that will be set to the field of type char16_t array
Exceptions
IllegalStateExceptionif the named field does not exist or if the type of the value is not compatible with the field.

◆ setField() [6/23]

virtual void apache::geode::client::WritablePdxInstance::setField ( const std::string &  fieldName,
const std::vector< 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
fieldNamename of the field whose value will be set
valuevalue that will be set to the field of type double array
Exceptions
IllegalStateExceptionif the named field does not exist or if the type of the value is not compatible with the field.

◆ setField() [7/23]

virtual void apache::geode::client::WritablePdxInstance::setField ( const std::string &  fieldName,
const std::vector< 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
fieldNamename of the field whose value will be set
valuevalue that will be set to the field of type float array
Exceptions
IllegalStateExceptionif the named field does not exist or if the type of the value is not compatible with the field.

◆ setField() [8/23]

virtual void apache::geode::client::WritablePdxInstance::setField ( const std::string &  fieldName,
const std::vector< 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
fieldNamename of the field whose value will be set
valuevalue that will be set to the field of type int16_t array
Exceptions
IllegalStateExceptionif the named field does not exist or if the type of the value is not compatible with the field.

◆ setField() [9/23]

virtual void apache::geode::client::WritablePdxInstance::setField ( const std::string &  fieldName,
const std::vector< 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
fieldNamename of the field whose value will be set
valuevalue that will be set to the field of type int32_t array
Exceptions
IllegalStateExceptionif the named field does not exist or if the type of the value is not compatible with the field.

◆ setField() [10/23]

virtual void apache::geode::client::WritablePdxInstance::setField ( const std::string &  fieldName,
const std::vector< 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
fieldNamename of the field whose value will be set
valuevalue that will be set to the field of type int64_t array
Exceptions
IllegalStateExceptionif the named field does not exist or if the type of the value is not compatible with the field.

◆ setField() [11/23]

virtual void apache::geode::client::WritablePdxInstance::setField ( const std::string &  fieldName,
const std::vector< int8_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. int8_t* type is corresponding to java byte[] type.

Parameters
fieldNamename of the field whose value will be set
valuevalue that will be set to the field of type int8_t array
Exceptions
IllegalStateExceptionif the named field does not exist or if the type of the value is not compatible with the field.

◆ setField() [12/23]

virtual void apache::geode::client::WritablePdxInstance::setField ( const std::string &  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
fieldNamename of the field whose value will be set
valuevalue that will be set to the field of type double
Exceptions
IllegalStateExceptionif the named field does not exist or if the type of the value is not compatible with the field.

◆ setField() [13/23]

virtual void apache::geode::client::WritablePdxInstance::setField ( const std::string &  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
fieldNamename of the field whose value will be set
valuevalue that will be set to the field of type float
Exceptions
IllegalStateExceptionif the named field does not exist or if the type of the value is not compatible with the field.

◆ setField() [14/23]

virtual void apache::geode::client::WritablePdxInstance::setField ( const std::string &  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
fieldNamename of the field whose value will be set
valuevalue that will be set to the field of type int16_t
Exceptions
IllegalStateExceptionif the named field does not exist or if the type of the value is not compatible with the field.

◆ setField() [15/23]

virtual void apache::geode::client::WritablePdxInstance::setField ( const std::string &  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
fieldNamename of the field whose value will be set
valuevalue that will be set to the field of type int32_t
Exceptions
IllegalStateExceptionif the named field does not exist or if the type of the value is not compatible with the field.

◆ setField() [16/23]

virtual void apache::geode::client::WritablePdxInstance::setField ( const std::string &  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
fieldNamename of the field whose value will be set
valuevalue that will be set to the field of type int64_t
Exceptions
IllegalStateExceptionif the named field does not exist or if the type of the value is not compatible with the field.

◆ setField() [17/23]

virtual void apache::geode::client::WritablePdxInstance::setField ( const std::string &  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
fieldNamename of the field whose value will be set
valuevalue that will be set to the field of type array of byte arrays
arrayLengthThe number of byte arrays.
elementLengthThe lengths of individual byte arrays.
Exceptions
IllegalStateExceptionif the named field does not exist or if the type of the value is not compatible with the field.

◆ setField() [18/23]

virtual void apache::geode::client::WritablePdxInstance::setField ( const std::string &  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
fieldNamename of the field whose value will be set
valuevalue that will be set to the field of type signed char
Exceptions
IllegalStateExceptionif the named field does not exist or if the type of the value is not compatible with the field.

◆ setField() [19/23]

virtual void apache::geode::client::WritablePdxInstance::setField ( const std::string &  fieldName,
std::shared_ptr< Cacheable 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. std::shared_ptr<Cacheable> type is corresponding to java object type.

Parameters
fieldNamename of the field whose value will be set
valuevalue that will be set to the field of type std::shared_ptr<Cacheable>
Exceptions
IllegalStateExceptionif the named field does not exist or if the type of the value is not compatible with the field.

◆ setField() [20/23]

virtual void apache::geode::client::WritablePdxInstance::setField ( const std::string &  fieldName,
std::shared_ptr< CacheableDate 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. std::shared_ptr<CacheableDate> type is corresponding to java Java.util.date type.

Parameters
fieldNamename of the field whose value will be set
valuevalue that will be set to the field of type std::shared_ptr<CacheableDate>
Exceptions
IllegalStateExceptionif the named field does not exist or if the type of the value is not compatible with the field.

◆ setField() [21/23]

virtual void apache::geode::client::WritablePdxInstance::setField ( const std::string &  fieldName,
std::shared_ptr< CacheableObjectArray 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. std::shared_ptr<CacheableObjectArray> type is corresponding to java Object[] type.

Parameters
fieldNamename of the field whose value will be set
valuevalue that will be set to the field of type std::shared_ptr<CacheableObjectArray>
Exceptions
IllegalStateExceptionif the named field does not exist or if the type of the value is not compatible with the field.

◆ setField() [22/23]

virtual void apache::geode::client::WritablePdxInstance::setField ( const std::string &  fieldName,
std::string *  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
fieldNamename of the field whose value will be set
valuevalue that will be set to the field of type char* array
lengthThe number of elements in CString array type.
Exceptions
IllegalStateExceptionif the named field does not exist or if the type of the value is not compatible with the field.

◆ setField() [23/23]

virtual void apache::geode::client::WritablePdxInstance::setField ( const std::string &  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
fieldNamename of the field whose value will be set
valuevalue that will be set to the field of type unsigned char
Exceptions
IllegalStateExceptionif the named field does not exist or if the type of the value is not compatible with the field.

◆ toData()

virtual void apache::geode::client::PdxInstance::toData ( PdxWriter output) const
overridepure virtualinherited

serialize this object in geode PDX format.

This is an internal method.

Parameters
outputto serialize the PDX object

Implements apache::geode::client::PdxSerializable.

◆ toString()

virtual std::string apache::geode::client::PdxInstance::toString ( ) const
overridepure virtualinherited

Prints out all of the identity fields of this PdxInstance.

If a PdxInstance has marked identity fields using {} 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
serializationRegistry->addPdxType

Reimplemented from apache::geode::client::Serializable.


Apache Geode C++ Cache API Documentation