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.
|
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.
|
|
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.
- See also
- PdxWriter::writeObject
-
PdxReader::readObject
◆ create() [1/2]
template<class _T >
static std::shared_ptr< CacheableKey > apache::geode::client::CacheableKey::create |
( |
_T |
value | ) |
|
|
staticinherited |
◆ create() [2/2]
static std::shared_ptr< CacheableEnum > apache::geode::client::CacheableEnum::create |
( |
std::string |
enumClassName, |
|
|
std::string |
enumName, |
|
|
int32_t |
ordinal |
|
) |
| |
|
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
CacheableEnum
representing C++ enum.
◆ createDeserializable()
static std::shared_ptr< Serializable > apache::geode::client::CacheableEnum::createDeserializable |
( |
| ) |
|
|
inlinestatic |
creation function for enum.
◆ getEnumClassName()
const std::string & apache::geode::client::CacheableEnum::getEnumClassName |
( |
| ) |
const |
|
inline |
◆ getEnumName()
const std::string & apache::geode::client::CacheableEnum::getEnumName |
( |
| ) |
const |
|
inline |
◆ getEnumOrdinal()
int32_t apache::geode::client::CacheableEnum::getEnumOrdinal |
( |
| ) |
const |
|
inline |
◆ hashcode()
virtual int32_t apache::geode::client::CacheableEnum::hashcode |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ objectSize()
virtual size_t apache::geode::client::CacheableEnum::objectSize |
( |
| ) |
const |
|
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==()
virtual bool apache::geode::client::CacheableEnum::operator== |
( |
const CacheableKey & |
other | ) |
const |
|
overridevirtual |
◆ toString()
virtual std::string apache::geode::client::CacheableEnum::toString |
( |
| ) |
const |
|
inlineoverridevirtual |