VMware GemFire Native C++ Reference  9.1
apache::geode::client::PdxInstanceFactory Class Referenceabstract

PdxInstanceFactory gives you a way to create PdxInstances. More...

Inherits apache::geode::client::SharedBase.

Public Member Functions

virtual PdxInstancePtr create ()=0
 Create a PdxInstance. More...
 
virtual PdxInstanceFactoryPtr markIdentityField (const char *fieldName)=0
 Indicate that the named field should be included in hashCode and equals (operator==()) checks of this object on a server that is accessing PdxInstance or when a client executes a query on a server. More...
 
void preserveSB () const
 Atomically increment reference count. More...
 
int32_t refCount ()
 
void releaseSB () const
 Atomically decrement reference count, the SharedBase object is automatically deleted when its reference count goes to zero. More...
 
virtual PdxInstanceFactoryPtr writeArrayOfByteArrays (const char *fieldName, int8_t **value, int32_t arrayLength, int32_t *elementLength)=0
 Writes the named field with the given value to the serialized form. More...
 
virtual PdxInstanceFactoryPtr writeBoolean (const char *fieldName, bool value)=0
 Writes the named field with the given value to the serialized form. More...
 
virtual PdxInstanceFactoryPtr writeBooleanArray (const char *fieldName, bool *value, int32_t length)=0
 Writes the named field with the given value to the serialized form. More...
 
virtual PdxInstanceFactoryPtr writeByte (const char *fieldName, int8_t value)=0
 Writes the named field with the given value to the serialized form. More...
 
virtual PdxInstanceFactoryPtr writeByteArray (const char *fieldName, int8_t *value, int32_t length)=0
 Writes the named field with the given value to the serialized form. More...
 
virtual PdxInstanceFactoryPtr writeChar (const char *fieldName, char value)=0
 Writes the named field with the given value to the serialized form. More...
 
virtual PdxInstanceFactoryPtr writeCharArray (const char *fieldName, char *value, int32_t length)=0
 Writes the named field with the given value to the serialized form. More...
 
virtual PdxInstanceFactoryPtr writeDate (const char *fieldName, CacheableDatePtr value)=0
 Writes the named field with the given value to the serialized form. More...
 
virtual PdxInstanceFactoryPtr writeDouble (const char *fieldName, double value)=0
 Writes the named field with the given value to the serialized form. More...
 
virtual PdxInstanceFactoryPtr writeDoubleArray (const char *fieldName, double *value, int32_t length)=0
 Writes the named field with the given value to the serialized form. More...
 
virtual PdxInstanceFactoryPtr writeFloat (const char *fieldName, float value)=0
 Writes the named field with the given value to the serialized form. More...
 
virtual PdxInstanceFactoryPtr writeFloatArray (const char *fieldName, float *value, int32_t length)=0
 Writes the named field with the given value to the serialized form. More...
 
virtual PdxInstanceFactoryPtr writeInt (const char *fieldName, int32_t value)=0
 Writes the named field with the given value to the serialized form. More...
 
virtual PdxInstanceFactoryPtr writeIntArray (const char *fieldName, int32_t *value, int32_t length)=0
 Writes the named field with the given value to the serialized form. More...
 
virtual PdxInstanceFactoryPtr writeLong (const char *fieldName, int64_t value)=0
 Writes the named field with the given value to the serialized form. More...
 
virtual PdxInstanceFactoryPtr writeLongArray (const char *fieldName, int64_t *value, int32_t length)=0
 Writes the named field with the given value to the serialized form. More...
 
virtual PdxInstanceFactoryPtr writeObject (const char *fieldName, CacheablePtr value)=0
 Writes the named field with the given value to the serialized form. More...
 
virtual PdxInstanceFactoryPtr writeObjectArray (const char *fieldName, CacheableObjectArrayPtr value)=0
 Writes the named field with the given value to the serialized form. More...
 
virtual PdxInstanceFactoryPtr writeShort (const char *fieldName, int16_t value)=0
 Writes the named field with the given value to the serialized form. More...
 
virtual PdxInstanceFactoryPtr writeShortArray (const char *fieldName, int16_t *value, int32_t length)=0
 Writes the named field with the given value to the serialized form. More...
 
virtual PdxInstanceFactoryPtr writeString (const char *fieldName, const char *value)=0
 Writes the named field with the given value to the serialized form. More...
 
virtual PdxInstanceFactoryPtr writeStringArray (const char *fieldName, char **value, int32_t length)=0
 Writes the named field with the given value to the serialized form. More...
 
virtual PdxInstanceFactoryPtr writeWideChar (const char *fieldName, wchar_t value)=0
 Writes the named field with the given value to the serialized form. More...
 
virtual PdxInstanceFactoryPtr writeWideCharArray (const char *fieldName, wchar_t *value, int32_t length)=0
 Writes the named field with the given value to the serialized form. More...
 
virtual PdxInstanceFactoryPtr writeWideString (const char *fieldName, const wchar_t *value)=0
 Writes the named field with the given value to the serialized form. More...
 
virtual PdxInstanceFactoryPtr writeWideStringArray (const char *fieldName, wchar_t **value, int32_t length)=0
 Writes the named field with the given value to the serialized form. More...
 
virtual ~PdxInstanceFactory ()
 destructor More...
 

Protected Member Functions

 PdxInstanceFactory ()
 constructors More...
 

Detailed Description

PdxInstanceFactory gives you a way to create PdxInstances.

Call the write methods to populate the field data and then call create to produce an actual instance that contains the data. To create a factory call Cache#createPdxInstanceFactory A factory can only create a single instance. To create multiple instances create multiple factories or use PdxInstance#createWriter to create subsequent instances.

Constructor & Destructor Documentation

virtual apache::geode::client::PdxInstanceFactory::~PdxInstanceFactory ( )
inlinevirtual

destructor

apache::geode::client::PdxInstanceFactory::PdxInstanceFactory ( )
inlineprotected

constructors

Member Function Documentation

virtual PdxInstancePtr apache::geode::client::PdxInstanceFactory::create ( )
pure virtual

Create a PdxInstance.

The instance will contain any data written to this factory using the write methods.

Returns
the created Pdxinstance
Exceptions
IllegalStateExceptionif called more than once
virtual PdxInstanceFactoryPtr apache::geode::client::PdxInstanceFactory::markIdentityField ( const char *  fieldName)
pure virtual

Indicate that the named field should be included in hashCode and equals (operator==()) checks of this object on a server that is accessing PdxInstance or when a client executes a query on a server.

The fields that are marked as identity fields are used to generate the hashCode and equals (operator==()) methods of PdxInstance. Because of this, the identity fields should themselves either be primitives, or implement hashCode and equals (operator==()).

If no fields are set as identity fields, then all fields will be used in hashCode and equals (operator==()) checks.

The identity fields should make marked after they are written using a write* method.

Parameters
fieldNamethe name of the field to mark as an identity field.
Returns
this PdxInstanceFactory
Exceptions
IllegalStateExceptionif the named field does not exist.
void apache::geode::client::SharedBase::preserveSB ( ) const
inherited

Atomically increment reference count.

int32_t apache::geode::client::SharedBase::refCount ( )
inlineinherited
Returns
the reference count
void apache::geode::client::SharedBase::releaseSB ( ) const
inherited

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

virtual PdxInstanceFactoryPtr apache::geode::client::PdxInstanceFactory::writeArrayOfByteArrays ( const char *  fieldName,
int8_t **  value,
int32_t  arrayLength,
int32_t *  elementLength 
)
pure virtual

Writes the named field with the given value to the serialized form.

The fields type is int8_t**.

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

Parameters
fieldNamethe name of the field to write
valuethe value of the field to write
arrayLengththe length of the actual byte array field holding individual byte arrays to write
elementLengththe length of the individual byte arrays to write
Returns
this PdxInstanceFactory
Exceptions
IllegalStateExceptionif the named field has already been written or fieldName is NULL or empty.
virtual PdxInstanceFactoryPtr apache::geode::client::PdxInstanceFactory::writeBoolean ( const char *  fieldName,
bool  value 
)
pure virtual

Writes the named field with the given value to the serialized form.

The fields type is bool.

Java boolean is mapped to C++ bool.

Parameters
fieldNamethe name of the field to write
valuethe value of the field to write
Returns
this PdxInstanceFactory
Exceptions
IllegalStateExceptionif the named field has already been written or fieldName is NULL or empty.
virtual PdxInstanceFactoryPtr apache::geode::client::PdxInstanceFactory::writeBooleanArray ( const char *  fieldName,
bool *  value,
int32_t  length 
)
pure virtual

Writes the named field with the given value to the serialized form.

The fields type is bool*.

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

Parameters
fieldNamethe name of the field to write
valuethe value of the field to write
lengththe length of the array field to write
Returns
this PdxInstanceFactory
Exceptions
IllegalStateExceptionif the named field has already been written or fieldName is NULL or empty.
virtual PdxInstanceFactoryPtr apache::geode::client::PdxInstanceFactory::writeByte ( const char *  fieldName,
int8_t  value 
)
pure virtual

Writes the named field with the given value to the serialized form.

The fields type is int8_t.

Java byte is mapped to C++ int8_t

Parameters
fieldNamethe name of the field to write
valuethe value of the field to write
Returns
this PdxInstanceFactory
Exceptions
IllegalStateExceptionif the named field has already been written or fieldName is NULL or empty.
virtual PdxInstanceFactoryPtr apache::geode::client::PdxInstanceFactory::writeByteArray ( const char *  fieldName,
int8_t *  value,
int32_t  length 
)
pure virtual

Writes the named field with the given value to the serialized form.

The fields type is int8_t*.

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

Parameters
fieldNamethe name of the field to write
valuethe value of the field to write
lengththe length of the array field to write
Returns
this PdxInstanceFactory
Exceptions
IllegalStateExceptionif the named field has already been written or fieldName is NULL or empty.
virtual PdxInstanceFactoryPtr apache::geode::client::PdxInstanceFactory::writeChar ( const char *  fieldName,
char  value 
)
pure virtual

Writes the named field with the given value to the serialized form.

The fields type is char.

Java char is mapped to C++ char.

Parameters
fieldNamethe name of the field to write
valuethe value of the field to write
Returns
this PdxInstanceFactory
Exceptions
IllegalStateExceptionif the named field has already been written or fieldName is NULL or empty.
virtual PdxInstanceFactoryPtr apache::geode::client::PdxInstanceFactory::writeCharArray ( const char *  fieldName,
char *  value,
int32_t  length 
)
pure virtual

Writes the named field with the given value to the serialized form.

The fields type is char*.

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

Parameters
fieldNamethe name of the field to write
valuethe value of the field to write
lengththe length of the array field to write
Returns
this PdxInstanceFactory
Exceptions
IllegalStateExceptionif the named field has already been written or fieldName is NULL or empty.
virtual PdxInstanceFactoryPtr apache::geode::client::PdxInstanceFactory::writeDate ( const char *  fieldName,
CacheableDatePtr  value 
)
pure virtual

Writes the named field with the given value to the serialized form.

The fields type is CacheableDatePtr.

Java Date is mapped to C++ CacheableDatePtr.

Parameters
fieldNamethe name of the field to write
valuethe value of the field to write
Returns
this PdxInstanceFactory
Exceptions
IllegalStateExceptionif the named field has already been written or fieldName is NULL or empty.
virtual PdxInstanceFactoryPtr apache::geode::client::PdxInstanceFactory::writeDouble ( const char *  fieldName,
double  value 
)
pure virtual

Writes the named field with the given value to the serialized form.

The fields type is double.

Java double is mapped to C++ double.

Parameters
fieldNamethe name of the field to write
valuethe value of the field to write
Returns
this PdxInstanceFactory
Exceptions
IllegalStateExceptionif the named field has already been written or fieldName is NULL or empty.
virtual PdxInstanceFactoryPtr apache::geode::client::PdxInstanceFactory::writeDoubleArray ( const char *  fieldName,
double *  value,
int32_t  length 
)
pure virtual

Writes the named field with the given value to the serialized form.

The fields type is double*.

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

Parameters
fieldNamethe name of the field to write
valuethe value of the field to write
lengththe length of the array field to write
Returns
this PdxInstanceFactory
Exceptions
IllegalStateExceptionif the named field has already been written or fieldName is NULL or empty.
virtual PdxInstanceFactoryPtr apache::geode::client::PdxInstanceFactory::writeFloat ( const char *  fieldName,
float  value 
)
pure virtual

Writes the named field with the given value to the serialized form.

The fields type is float.

Java float is mapped to C++ float.

Parameters
fieldNamethe name of the field to write
valuethe value of the field to write
Returns
this PdxInstanceFactory
Exceptions
IllegalStateExceptionif the named field has already been written or fieldName is NULL or empty.
virtual PdxInstanceFactoryPtr apache::geode::client::PdxInstanceFactory::writeFloatArray ( const char *  fieldName,
float *  value,
int32_t  length 
)
pure virtual

Writes the named field with the given value to the serialized form.

The fields type is float*.

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

Parameters
fieldNamethe name of the field to write
valuethe value of the field to write
lengththe length of the array field to write
Returns
this PdxInstanceFactory
Exceptions
IllegalStateExceptionif the named field has already been written or fieldName is NULL or empty.
virtual PdxInstanceFactoryPtr apache::geode::client::PdxInstanceFactory::writeInt ( const char *  fieldName,
int32_t  value 
)
pure virtual

Writes the named field with the given value to the serialized form.

The fields type is int32_t.

Java int is mapped to C++ int32_t.

Parameters
fieldNamethe name of the field to write
valuethe value of the field to write
Returns
this PdxInstanceFactory
Exceptions
IllegalStateExceptionif the named field has already been written or fieldName is NULL or empty.
virtual PdxInstanceFactoryPtr apache::geode::client::PdxInstanceFactory::writeIntArray ( const char *  fieldName,
int32_t *  value,
int32_t  length 
)
pure virtual

Writes the named field with the given value to the serialized form.

The fields type is int32_t*.

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

Parameters
fieldNamethe name of the field to write
valuethe value of the field to write
lengththe length of the array field to write
Returns
this PdxInstanceFactory
Exceptions
IllegalStateExceptionif the named field has already been written or fieldName is NULL or empty.
virtual PdxInstanceFactoryPtr apache::geode::client::PdxInstanceFactory::writeLong ( const char *  fieldName,
int64_t  value 
)
pure virtual

Writes the named field with the given value to the serialized form.

The fields type is int64_t.

Java long is mapped to C++ int64_t.

Parameters
fieldNamethe name of the field to write
valuethe value of the field to write
Returns
this PdxInstanceFactory
Exceptions
IllegalStateExceptionif the named field has already been written or fieldName is NULL or empty.
virtual PdxInstanceFactoryPtr apache::geode::client::PdxInstanceFactory::writeLongArray ( const char *  fieldName,
int64_t *  value,
int32_t  length 
)
pure virtual

Writes the named field with the given value to the serialized form.

The fields type is int64_t*.

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

Parameters
fieldNamethe name of the field to write
valuethe value of the field to write
lengththe length of the array field to write
Returns
this PdxInstanceFactory
Exceptions
IllegalStateExceptionif the named field has already been written or fieldName is NULL or empty.
virtual PdxInstanceFactoryPtr apache::geode::client::PdxInstanceFactory::writeObject ( const char *  fieldName,
CacheablePtr  value 
)
pure virtual

Writes the named field with the given value to the serialized form.

The fields type is CacheablePtr.

Java object is mapped to C++ CacheablePtr.

It is best to use one of the other writeXXX methods if your field type will always be XXX. This method allows the field value to be anything that is an instance of Object. This gives you more flexibility but more space is used to store the serialized field.

Note that some Java objects serialized with this method may not be compatible with non-java languages.

Parameters
fieldNamethe name of the field to write
valuethe value of the field to write
Returns
this PdxInstanceFactory
Exceptions
IllegalStateExceptionif the named field has already been written or fieldName is NULL or empty.
virtual PdxInstanceFactoryPtr apache::geode::client::PdxInstanceFactory::writeObjectArray ( const char *  fieldName,
CacheableObjectArrayPtr  value 
)
pure virtual

Writes the named field with the given value to the serialized form.

The fields type is CacheableObjectArrayPtr. Java Object[] is mapped to C++ CacheableObjectArrayPtr. For how each element of the array is a mapped to C++ see writeObject. Note that this call may serialize elements that are not compatible with non-java languages.

Parameters
fieldNamethe name of the field to write
valuethe value of the field to write
Returns
this PdxInstanceFactory
Exceptions
IllegalStateExceptionif the named field has already been written or fieldName is NULL or empty.
virtual PdxInstanceFactoryPtr apache::geode::client::PdxInstanceFactory::writeShort ( const char *  fieldName,
int16_t  value 
)
pure virtual

Writes the named field with the given value to the serialized form.

The fields type is int16_t.

Java short is mapped to C++ int16_t.

Parameters
fieldNamethe name of the field to write
valuethe value of the field to write
Returns
this PdxInstanceFactory
Exceptions
IllegalStateExceptionif the named field has already been written or fieldName is NULL or empty.
virtual PdxInstanceFactoryPtr apache::geode::client::PdxInstanceFactory::writeShortArray ( const char *  fieldName,
int16_t *  value,
int32_t  length 
)
pure virtual

Writes the named field with the given value to the serialized form.

The fields type is int16_t*.

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

Parameters
fieldNamethe name of the field to write
valuethe value of the field to write
lengththe length of the array field to write
Returns
this PdxInstanceFactory
Exceptions
IllegalStateExceptionif the named field has already been written or fieldName is NULL or empty.
virtual PdxInstanceFactoryPtr apache::geode::client::PdxInstanceFactory::writeString ( const char *  fieldName,
const char *  value 
)
pure virtual

Writes the named field with the given value to the serialized form.

The fields type is char*.

Java String is mapped to C++ char*.

Parameters
fieldNamethe name of the field to write
valuethe value of the field to write
Returns
this PdxInstanceFactory
Exceptions
IllegalStateExceptionif the named field has already been written or fieldName is NULL or empty.
virtual PdxInstanceFactoryPtr apache::geode::client::PdxInstanceFactory::writeStringArray ( const char *  fieldName,
char **  value,
int32_t  length 
)
pure virtual

Writes the named field with the given value to the serialized form.

The fields type is char**.

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

Parameters
fieldNamethe name of the field to write
valuethe value of the field to write
lengththe length of the array field to write
Returns
this PdxInstanceFactory
Exceptions
IllegalStateExceptionif the named field has already been written or fieldName is NULL or empty.
virtual PdxInstanceFactoryPtr apache::geode::client::PdxInstanceFactory::writeWideChar ( const char *  fieldName,
wchar_t  value 
)
pure virtual

Writes the named field with the given value to the serialized form.

The fields type is wchar_t.

Java char is mapped to C++ wchar_t.

Parameters
fieldNamethe name of the field to write
valuethe value of the field to write
Returns
this PdxInstanceFactory
Exceptions
IllegalStateExceptionif the named field has already been written or fieldName is NULL or empty.
virtual PdxInstanceFactoryPtr apache::geode::client::PdxInstanceFactory::writeWideCharArray ( const char *  fieldName,
wchar_t *  value,
int32_t  length 
)
pure virtual

Writes the named field with the given value to the serialized form.

The fields type is wchar_t*.

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

Parameters
fieldNamethe name of the field to write
valuethe value of the field to write
lengththe length of the array field to write
Returns
this PdxInstanceFactory
Exceptions
IllegalStateExceptionif the named field has already been written or fieldName is NULL or empty.
virtual PdxInstanceFactoryPtr apache::geode::client::PdxInstanceFactory::writeWideString ( const char *  fieldName,
const wchar_t *  value 
)
pure virtual

Writes the named field with the given value to the serialized form.

The fields type is wchar_t*.

Java String is mapped to C++ wchar_t*.

Parameters
fieldNamethe name of the field to write
valuethe value of the field to write
Returns
this PdxInstanceFactory
Exceptions
IllegalStateExceptionif the named field has already been written or fieldName is NULL or empty.
virtual PdxInstanceFactoryPtr apache::geode::client::PdxInstanceFactory::writeWideStringArray ( const char *  fieldName,
wchar_t **  value,
int32_t  length 
)
pure virtual

Writes the named field with the given value to the serialized form.

The fields type is wchar_t**.

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

Parameters
fieldNamethe name of the field to write
valuethe value of the field to write
lengththe length of the array field to write
Returns
this PdxInstanceFactory
Exceptions
IllegalStateExceptionif the named field has already been written or fieldName is NULL or empty.

Pivotal GemFire C++ Cache API Documentation