Apache Geode Native C++ Reference  1.14.0
apache::geode::client::PdxSerializer Class Referenceabstract

The PdxSerializer class allows domain classes to be serialized and deserialized as PDXs without modification of the domain class. More...

Public Member Functions

virtual std::shared_ptr< void > fromData (const std::string &className, PdxReader &pdxReader)=0
 Deserialize this object. More...
 
virtual UserObjectSizer getObjectSizer (const std::string &className)
 Get the function pointer to the user function that returns the size of an instance of a user domain object. More...
 
virtual bool toData (const std::shared_ptr< const void > &userObject, const std::string &className, PdxWriter &pdxWriter)=0
 Serializes this object in Geode PDX format. More...
 

Detailed Description

The PdxSerializer class allows domain classes to be serialized and deserialized as PDXs without modification of the domain class.

A domain class should register function {} to create a new instance of type for de-serialization.

Member Function Documentation

◆ fromData()

virtual std::shared_ptr<void> apache::geode::client::PdxSerializer::fromData ( const std::string &  className,
PdxReader pdxReader 
)
pure virtual

Deserialize this object.

Parameters
classNamethe class name whose object needs to be de-serialized
pdxReaderthe PdxReader stream to use for reading the object data

◆ getObjectSizer()

virtual UserObjectSizer apache::geode::client::PdxSerializer::getObjectSizer ( const std::string &  className)
virtual

Get the function pointer to the user function that returns the size of an instance of a user domain object.

Parameters
classNameto help select an object sizer for the correct class

◆ toData()

virtual bool apache::geode::client::PdxSerializer::toData ( const std::shared_ptr< const void > &  userObject,
const std::string &  className,
PdxWriter pdxWriter 
)
pure virtual

Serializes this object in Geode PDX format.

Parameters
userObjectthe object which needs to be serialized
pdxWriterthe PdxWriter object to use for serializing the object

Apache Geode C++ Cache API Documentation