Apache Geode Native C++ Reference 1.15.0
apache::geode::client::PdxSerializable Class Referenceabstract

An interface for objects whose contents can be serialized as PDX types. More...

#include <PdxSerializable.hpp>

Inherits apache::geode::client::Serializable, and apache::geode::client::CacheableKey.

Inherited by apache::geode::client::PdxInstance, and apache::geode::client::PdxWrapper.

Public Member Functions

virtual void fromData (PdxReader &input)=0
 Deserialize this object. More...
 
virtual const std::string & getClassName () const =0
 Get the Type for the Object. More...
 
int32_t hashcode () const override
 return the hashcode for this key. More...
 
virtual size_t objectSize () const
 return the size in bytes of the instance being serialized. More...
 
bool operator== (const CacheableKey &other) const override
 return true if this key matches other. More...
 
virtual void toData (PdxWriter &output) const =0
 Serialize this object in Geode PDX format. More...
 
std::string toString () const override
 Display this object as 'string', which depends on the implementation in the subclasses. 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...
 

Detailed Description

An interface for objects whose contents can be serialized as PDX types.

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.

◆ fromData()

virtual void apache::geode::client::PdxSerializable::fromData ( PdxReader input)
pure virtual

Deserialize this object.

Parameters
inputto deserialize the PDX object

Implemented in apache::geode::client::PdxWrapper, and apache::geode::client::PdxInstance.

◆ getClassName()

virtual const std::string & apache::geode::client::PdxSerializable::getClassName ( ) const
pure virtual

Get the Type for the Object.

Equivalent to the C# Type->GetType() API.

Implemented in apache::geode::client::PdxWrapper, and apache::geode::client::PdxInstance.

◆ hashcode()

int32_t apache::geode::client::PdxSerializable::hashcode ( ) const
overridevirtual

return the hashcode for this key.

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

Reimplemented in apache::geode::client::PdxWrapper.

◆ objectSize()

virtual size_t apache::geode::client::Serializable::objectSize ( ) const
virtualinherited

return the size in bytes of the instance being serialized.

This is used to determine whether the cache is using up more physical memory than it has been configured to use. The method can return zero if the user does not require the ability to control cache memory utilization. Note that you must implement this only if you use the HeapLRU feature.

Reimplemented in apache::geode::client::CacheableDate, apache::geode::client::CacheableEnum, apache::geode::client::CacheableString, and apache::geode::client::PdxInstance.

◆ operator==()

bool apache::geode::client::PdxSerializable::operator== ( const CacheableKey other) const
overridevirtual

return true if this key matches other.

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

Reimplemented in apache::geode::client::PdxWrapper.

◆ toData()

virtual void apache::geode::client::PdxSerializable::toData ( PdxWriter output) const
pure virtual

Serialize this object in Geode PDX format.

Parameters
outputto serialize the PDX object

Implemented in apache::geode::client::PdxWrapper, and apache::geode::client::PdxInstance.

◆ toString()

std::string apache::geode::client::PdxSerializable::toString ( ) const
overridevirtual

Display this object as 'string', which depends on the implementation in the subclasses.

The default implementation renders the classname.

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

Reimplemented in apache::geode::client::PdxWrapper.


Apache Geode C++ Cache API Documentation