VMware GemFire Native .NET Reference  9.2.4
Apache::Geode::Client::ICacheableKey Interface Reference

This interface class is the superclass of all user objects in the cache that can be used as a key. More...

Inherits Apache::Geode::Client::IGeodeSerializable.

Inherited by Apache::Geode::Client::CacheableDate, Apache::Geode::Client::CacheableFileName, and Apache::Geode::Client::CacheableKey.

Public Member Functions

bool Equals (ICacheableKey^ other)
 Returns true if this ICacheableKey matches the other. More...
 
IGeodeSerializableFromData (DataInput^ input)
 Deserialize this object, typical implementation should return the 'this' pointer. More...
 
System::Int32 GetHashCode ()
 Get the hash code for this object. More...
 
void ToData (DataOutput^ output)
 Serializes this object. More...
 
String ^ ToString ()
 Return a string representation of the object. More...
 

Properties

System::UInt32 ClassId [get]
 Returns the classId of the instance being serialized. More...
 
System::UInt32 ObjectSize [get]
 Get the size of this object in bytes. More...
 

Detailed Description

This interface class is the superclass of all user objects in the cache that can be used as a key.

If an implementation is required to act as a key in the cache, then it must implement this interface and preferably override System.Object.ToString to obtain proper string representation. Note that this interface requires that the class overrides Object.GetHashCode. Though this is not enforced, the default implementation in System.Object is almost certainly incorrect and will not work correctly.

Member Function Documentation

◆ Equals()

◆ FromData()

IGeodeSerializable ^ Apache::Geode::Client::IGeodeSerializable::FromData ( DataInput input)
inherited

Deserialize this object, typical implementation should return the 'this' pointer.

Parameters
inputthe DataInput stream to use for reading the object data
Returns
the deserialized object

Implemented in Apache::Geode::Client::CacheableBuiltinArray< TNative, TNativePtr, TManaged, TYPEID >, Apache::Geode::Client::CacheableBuiltinArray< apache::geode::client::CacheableInt32Array, apache::geode::client::CacheableInt32ArrayPtr, System::Int32, GeodeClassIds::CacheableInt32Array >, Apache::Geode::Client::CacheableBuiltinArray< apache::geode::client::CacheableDoubleArray, apache::geode::client::CacheableDoubleArrayPtr, Double, GeodeClassIds::CacheableDoubleArray >, Apache::Geode::Client::CacheableBuiltinArray< apache::geode::client::CacheableInt16Array, apache::geode::client::CacheableInt16ArrayPtr, System::Int16, GeodeClassIds::CacheableInt16Array >, Apache::Geode::Client::CacheableBuiltinArray< apache::geode::client::CacheableBytes, apache::geode::client::CacheableBytesPtr, Byte, GeodeClassIds::CacheableBytes >, Apache::Geode::Client::CacheableBuiltinArray< apache::geode::client::CharArray, apache::geode::client::CharArrayPtr, Char, GeodeClassIds::CharArray >, Apache::Geode::Client::CacheableBuiltinArray< apache::geode::client::CacheableFloatArray, apache::geode::client::CacheableFloatArrayPtr, Single, GeodeClassIds::CacheableFloatArray >, Apache::Geode::Client::CacheableBuiltinArray< apache::geode::client::BooleanArray, apache::geode::client::BooleanArrayPtr, bool, GeodeClassIds::BooleanArray >, Apache::Geode::Client::CacheableBuiltinArray< apache::geode::client::CacheableInt64Array, apache::geode::client::CacheableInt64ArrayPtr, System::Int64, GeodeClassIds::CacheableInt64Array >, Apache::Geode::Client::CacheableHashTable, Apache::Geode::Client::CacheableString, Apache::Geode::Client::CacheableStringArray, Apache::Geode::Client::Internal::CacheableHashSetType< TYPEID, HSTYPE >, Apache::Geode::Client::Internal::CacheableHashSetType< Apache::Geode::Client::GeodeClassIds::CacheableLinkedHashSet, apache::geode::client::CacheableLinkedHashSet >, Apache::Geode::Client::Internal::CacheableHashSetType< Apache::Geode::Client::GeodeClassIds::CacheableHashSet, apache::geode::client::CacheableHashSet >, Apache::Geode::Client::RegionAttributes< TKey, TValue >, Apache::Geode::Client::Properties< TPropKey, TPropValue >, Apache::Geode::Client::Properties< String^, String^>, Apache::Geode::Client::CacheableObjectArray, Apache::Geode::Client::CacheableHashMap, Apache::Geode::Client::CacheableLinkedList, Apache::Geode::Client::CacheableDate, Apache::Geode::Client::CacheableObjectXml, Apache::Geode::Client::CacheableVector, Apache::Geode::Client::CacheableObject, Apache::Geode::Client::CacheableStack, Apache::Geode::Client::CacheableFileName, Apache::Geode::Client::CacheableUndefined, Apache::Geode::Client::UserFunctionExecutionException, and Apache::Geode::Client::Serializable.

◆ GetHashCode()

System::Int32 Apache::Geode::Client::ICacheableKey::GetHashCode ( )

Get the hash code for this object.

This is used in the internal hash tables and so must have a nice distribution pattern.

Returns
The hashcode for this object.

Implemented in Apache::Geode::Client::CacheableString, Apache::Geode::Client::CacheableDate, Apache::Geode::Client::CacheableFileName, and Apache::Geode::Client::CacheableKey.

◆ ToData()

void Apache::Geode::Client::IGeodeSerializable::ToData ( DataOutput output)
inherited

Serializes this object.

Parameters
outputthe DataOutput object to use for serializing the object

Implemented in Apache::Geode::Client::CacheableBuiltinArray< TNative, TNativePtr, TManaged, TYPEID >, Apache::Geode::Client::CacheableBuiltinArray< apache::geode::client::CacheableInt32Array, apache::geode::client::CacheableInt32ArrayPtr, System::Int32, GeodeClassIds::CacheableInt32Array >, Apache::Geode::Client::CacheableBuiltinArray< apache::geode::client::CacheableDoubleArray, apache::geode::client::CacheableDoubleArrayPtr, Double, GeodeClassIds::CacheableDoubleArray >, Apache::Geode::Client::CacheableBuiltinArray< apache::geode::client::CacheableInt16Array, apache::geode::client::CacheableInt16ArrayPtr, System::Int16, GeodeClassIds::CacheableInt16Array >, Apache::Geode::Client::CacheableBuiltinArray< apache::geode::client::CacheableBytes, apache::geode::client::CacheableBytesPtr, Byte, GeodeClassIds::CacheableBytes >, Apache::Geode::Client::CacheableBuiltinArray< apache::geode::client::CharArray, apache::geode::client::CharArrayPtr, Char, GeodeClassIds::CharArray >, Apache::Geode::Client::CacheableBuiltinArray< apache::geode::client::CacheableFloatArray, apache::geode::client::CacheableFloatArrayPtr, Single, GeodeClassIds::CacheableFloatArray >, Apache::Geode::Client::CacheableBuiltinArray< apache::geode::client::BooleanArray, apache::geode::client::BooleanArrayPtr, bool, GeodeClassIds::BooleanArray >, Apache::Geode::Client::CacheableBuiltinArray< apache::geode::client::CacheableInt64Array, apache::geode::client::CacheableInt64ArrayPtr, System::Int64, GeodeClassIds::CacheableInt64Array >, Apache::Geode::Client::CacheableString, Apache::Geode::Client::CacheableStringArray, Apache::Geode::Client::Internal::CacheableHashSetType< TYPEID, HSTYPE >, Apache::Geode::Client::Internal::CacheableHashSetType< Apache::Geode::Client::GeodeClassIds::CacheableLinkedHashSet, apache::geode::client::CacheableLinkedHashSet >, Apache::Geode::Client::Internal::CacheableHashSetType< Apache::Geode::Client::GeodeClassIds::CacheableHashSet, apache::geode::client::CacheableHashSet >, Apache::Geode::Client::RegionAttributes< TKey, TValue >, Apache::Geode::Client::Properties< TPropKey, TPropValue >, Apache::Geode::Client::Properties< String^, String^>, Apache::Geode::Client::CacheableObjectArray, Apache::Geode::Client::CacheableHashMap, Apache::Geode::Client::CacheableLinkedList, Apache::Geode::Client::CacheableDate, Apache::Geode::Client::CacheableObjectXml, Apache::Geode::Client::CacheableVector, Apache::Geode::Client::CacheableObject, Apache::Geode::Client::CacheableStack, Apache::Geode::Client::CacheableFileName, Apache::Geode::Client::CacheableUndefined, Apache::Geode::Client::UserFunctionExecutionException, and Apache::Geode::Client::Serializable.

◆ ToString()

String ^ Apache::Geode::Client::IGeodeSerializable::ToString ( )
inherited

Return a string representation of the object.

Implemented in Apache::Geode::Client::CacheableBuiltinArray< TNative, TNativePtr, TManaged, TYPEID >, Apache::Geode::Client::CacheableBuiltinArray< apache::geode::client::CacheableInt32Array, apache::geode::client::CacheableInt32ArrayPtr, System::Int32, GeodeClassIds::CacheableInt32Array >, Apache::Geode::Client::CacheableBuiltinArray< apache::geode::client::CacheableDoubleArray, apache::geode::client::CacheableDoubleArrayPtr, Double, GeodeClassIds::CacheableDoubleArray >, Apache::Geode::Client::CacheableBuiltinArray< apache::geode::client::CacheableInt16Array, apache::geode::client::CacheableInt16ArrayPtr, System::Int16, GeodeClassIds::CacheableInt16Array >, Apache::Geode::Client::CacheableBuiltinArray< apache::geode::client::CacheableBytes, apache::geode::client::CacheableBytesPtr, Byte, GeodeClassIds::CacheableBytes >, Apache::Geode::Client::CacheableBuiltinArray< apache::geode::client::CharArray, apache::geode::client::CharArrayPtr, Char, GeodeClassIds::CharArray >, Apache::Geode::Client::CacheableBuiltinArray< apache::geode::client::CacheableFloatArray, apache::geode::client::CacheableFloatArrayPtr, Single, GeodeClassIds::CacheableFloatArray >, Apache::Geode::Client::CacheableBuiltinArray< apache::geode::client::BooleanArray, apache::geode::client::BooleanArrayPtr, bool, GeodeClassIds::BooleanArray >, Apache::Geode::Client::CacheableBuiltinArray< apache::geode::client::CacheableInt64Array, apache::geode::client::CacheableInt64ArrayPtr, System::Int64, GeodeClassIds::CacheableInt64Array >, Apache::Geode::Client::Properties< TPropKey, TPropValue >, Apache::Geode::Client::Properties< String^, String^>, Apache::Geode::Client::CacheableString, Apache::Geode::Client::CacheableStringArray, Apache::Geode::Client::Serializable, Apache::Geode::Client::CacheableObjectXml, Apache::Geode::Client::CacheableObject, Apache::Geode::Client::CacheableDate, Apache::Geode::Client::CacheableFileName, Apache::Geode::Client::CacheableBuiltinKey< TNative, TManaged, TYPEID >, Apache::Geode::Client::CacheableBuiltinKey< apache::geode::client::CacheableFloat, Single, GeodeClassIds::CacheableFloat >, Apache::Geode::Client::CacheableBuiltinKey< apache::geode::client::CacheableInt32, System::Int32, GeodeClassIds::CacheableInt32 >, Apache::Geode::Client::CacheableBuiltinKey< apache::geode::client::CacheableDouble, Double, GeodeClassIds::CacheableDouble >, Apache::Geode::Client::CacheableBuiltinKey< apache::geode::client::CacheableBoolean, bool, GeodeClassIds::CacheableBoolean >, Apache::Geode::Client::CacheableBuiltinKey< apache::geode::client::CacheableInt64, System::Int64, GeodeClassIds::CacheableInt64 >, Apache::Geode::Client::CacheableBuiltinKey< apache::geode::client::CacheableInt16, System::Int16, GeodeClassIds::CacheableInt16 >, Apache::Geode::Client::CacheableBuiltinKey< apache::geode::client::CacheableWideChar, Char, GeodeClassIds::CacheableCharacter >, and Apache::Geode::Client::CacheableBuiltinKey< apache::geode::client::CacheableByte, Byte, GeodeClassIds::CacheableByte >.

Property Documentation

◆ ClassId

System:: UInt32 Apache::Geode::Client::IGeodeSerializable::ClassId
getinherited

Returns the classId of the instance being serialized.

This is used by deserialization to determine what instance type to create and deserialize into.

The classId must be unique within an application suite and in the range 0 to ((2^31)-1) both inclusive. An application can thus define upto 2^31 custom IGeodeSerializable classes. Returning a value greater than ((2^31)-1) may result in undefined behaviour.

Returns
the classId

◆ ObjectSize

System:: UInt32 Apache::Geode::Client::IGeodeSerializable::ObjectSize
getinherited

Get the size of this object in bytes.

This is only needed if you use the HeapLRU feature.

Note that you can simply return zero if you are not using the HeapLRU feature.

Returns
the size of this object in bytes.

VMware GemFire .NET Cache API Documentation