VMware GemFire Native Client C++ API Reference
|
VMware VMware GemFire Native C++ Reference 10.4.3
|
Since C++ enums cannot be directly passed as a parameter to PdxWriter's writeObject and PdxReader's readObject api, wrap C++ enums with an immutable wrapper CacheableEnum class type by specifying enum class name, enum value name and its ordinal. More...
#include <CacheableEnum.hpp>
Inherits internal::DataSerializablePrimitive, and apache::geode::client::CacheableKey.
Public Member Functions | |
| const std::string & | getEnumClassName () const |
| const std::string & | getEnumName () const |
| int32_t | getEnumOrdinal () const |
| virtual int32_t | hashcode () const override |
| virtual size_t | objectSize () const override |
| return the size in bytes of the instance being serialized. | |
| virtual bool | operator== (const CacheableKey &other) const override |
| virtual std::string | toString () const override |
| Display this object as c string. | |
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. | |
| static std::shared_ptr< CacheableEnum > | create (std::string enumClassName, std::string enumName, int32_t ordinal) |
| Factory method for creating an instance of CacheableEnum. | |
| static std::shared_ptr< Serializable > | createDeserializable () |
| creation function for enum. | |
Detailed Description
Since C++ enums cannot be directly passed as a parameter to PdxWriter's writeObject and PdxReader's readObject api, wrap C++ enums with an immutable wrapper CacheableEnum class type by specifying enum class name, enum value name and its ordinal.
C++ enum allows explicit setting of ordinal number, but it is up to the user to map java enumName with that of C++ enumName. Currently this wrapper only works as part of PdxSerializable member object and cannot be directly used in Region operations.
Member Function Documentation
◆ create() [1/2]
|
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]
|
inlinestatic |
Factory method for creating an instance of CacheableEnum.
- Parameters
-
enumClassName the name of the enum class that maps to the java enum type. enumName the name of the enum constant that maps to the java enum type. ordinal the ordinal value of the enum constant that maps to the java enum type.
- Returns
- a
CacheableEnumrepresenting C++ enum.
◆ createDeserializable()
|
inlinestatic |
creation function for enum.
◆ getEnumClassName()
|
inline |
- Returns
- enum class name.
◆ getEnumName()
|
inline |
- Returns
- enum name.
◆ getEnumOrdinal()
|
inline |
- Returns
- enum ordinal.
◆ hashcode()
|
inlineoverridevirtual |
- Returns
- the hashcode for this key.
Implements apache::geode::client::CacheableKey.
◆ objectSize()
|
inlineoverridevirtual |
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 from apache::geode::client::Serializable.
◆ operator==()
|
overridevirtual |
- Returns
- true if this key matches other.
Implements apache::geode::client::CacheableKey.
◆ toString()
|
inlineoverridevirtual |
Display this object as c string.
Reimplemented from apache::geode::client::Serializable.
Apache Geode C++ Cache API Documentation