VMware Tanzu GemFire Native C++ Reference
10.1.5
|
The PdxWrapper class allows domain classes to be used in Region operations. More...
Inherits apache::geode::client::PdxSerializable.
Public Member Functions | |
void | fromData (PdxReader &input) override |
Deserialize this object. More... | |
const std::string & | getClassName () const override |
Get the Type for the Object. More... | |
std::shared_ptr< void > | getObject () |
Returns the pointer to the user object which is deserialized with a PdxSerializer. 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... | |
PdxWrapper (std::shared_ptr< void > userObject, std::string className) | |
Constructor which takes the address of the user object to contain for PDX serialization. More... | |
void | toData (PdxWriter &output) const override |
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< CacheableKey > | create (_T value) |
Factory method that creates the key type that matches the type of value. More... | |
template<class _T > | |
static std::shared_ptr< Serializable > | create (_T value) |
Factory method that creates the Serializable object that matches the type of value. More... | |
The PdxWrapper class allows domain classes to be used in Region operations.
A user domain object should be wrapped in an instance of a PdxWrapper with a PdxSerializer registered that can handle the user domain class.
apache::geode::client::PdxWrapper::PdxWrapper | ( | std::shared_ptr< void > | userObject, |
std::string | className | ||
) |
Constructor which takes the address of the user object to contain for PDX serialization.
userObject | the void pointer to an instance of a user object - NOTE: PdxWrapper takes ownership. |
className | the fully qualified class name to map this user object to the Java side. |
|
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.
|
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.
|
overridevirtual |
Deserialize this object.
PdxReader | to deserialize the PDX object |
Implements apache::geode::client::PdxSerializable.
|
overridevirtual |
Get the Type for the Object.
Equivalent to the C# Type->GetType() API.
Implements apache::geode::client::PdxSerializable.
std::shared_ptr<void> apache::geode::client::PdxWrapper::getObject | ( | ) |
Returns the pointer to the user object which is deserialized with a PdxSerializer.
User code (such as in PdxSerializer) should cast it to a pointer of the known user class.
detach | if set to true will release ownership of the object and future calls to getObject() return nullptr. |
|
overridevirtual |
return the hashcode for this key.
Reimplemented from apache::geode::client::PdxSerializable.
|
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::PdxInstance, apache::geode::client::CacheableString, apache::geode::client::CacheableEnum, and apache::geode::client::CacheableDate.
|
overridevirtual |
return true if this key matches other.
Reimplemented from apache::geode::client::PdxSerializable.
|
overridevirtual |
Serialize this object in Geode PDX format.
PdxWriter | to serialize the PDX object |
Implements apache::geode::client::PdxSerializable.
|
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::PdxSerializable.