Inherited by gemfire::CacheableFileName.
Public Member Functions | |
| const char * | asChar () const |
| Return the string that backs this CacheableString as a char *. | |
| const wchar_t * | asWChar () const |
| Return the string that backs this CacheableString as a wchar_t *. | |
| virtual int32_t | classId () const |
| virtual const char * | className () const |
| get the name of the class of this object for logging purpose | |
| virtual int8_t | DSFID () const |
| virtual Serializable * | fromData (DataInput &input) |
| virtual uint32_t | hashcode () const |
| return the hashcode for this key. | |
| bool | isCString () const |
| Returns true if the underlying string is a normal C string. | |
| bool | isWideString () const |
| Returns true if the underlying string is a wide-character string. | |
| uint32_t | length () const |
| Return the length of the contained string. | |
| virtual int32_t | logString (char *buffer, int32_t maxLength) const |
| used to render as a string for logging. | |
| virtual uint32_t | objectSize () const |
| virtual bool | operator== (const CacheableKey &other) const |
| return true if this key matches other. | |
| void | preserveSB () const |
| Atomically increment reference count. | |
| int32_t | refCount () |
| |
| void | releaseSB () const |
| Atomically decrement reference count, the SharedBase object is automatically deleted when its reference count goes to zero. | |
| virtual void | toData (DataOutput &output) const |
| virtual CacheableStringPtr | toString () const |
| Display this object as 'string', which depends on the implementation in the subclasses. | |
| const char * | toString () |
| Display this object as c string. | |
| virtual int8_t | typeId () const |
| Return the typeId byte of the instance being serialized. | |
| virtual | ~CacheableString () |
| Destructor. | |
Static Public Member Functions | |
| template<class PRIM> | |
| static CacheableKeyPtr | create (const PRIM value) |
| Factory method that creates the key type that matches the type of value. | |
| static CacheableStringPtr | create (const wchar_t *value, int32_t len=0) |
| Factory method for creating an instance of CacheableString from a wide-character null terminated C string optionally giving the length. | |
| static CacheableStringPtr | create (const char *value, int32_t len=0) |
| Factory method for creating an instance of CacheableString from a null terminated C string optionally giving the length. | |
| static Serializable * | createDeserializable () |
| creation function for strings | |
| static Serializable * | createDeserializableHuge () |
| creation function for strings > 64K length | |
| static CacheableStringPtr | createNoCopy (wchar_t *value, int32_t len=0) |
| Factory method for creating an instance of CacheableString from a wide-character C string of given length by taking ownership of the string without making a copy. | |
| static CacheableStringPtr | createNoCopy (char *value, int32_t len=0) |
| Factory method for creating an instance of CacheableString from a C string of given length by taking ownership of the string without making a copy. | |
| static Serializable * | createUTFDeserializable () |
| creation function for wide strings | |
| static Serializable * | createUTFDeserializableHuge () |
| creation function for wide strings > 64K length in UTF8 encoding | |
| static void | registerPdxSerializer (PdxSerializerPtr pdxSerializer) |
| Register the PDX serializer which can handle serialization for instances of user domain classes. | |
| static void | registerPdxType (TypeFactoryMethodPdx creationFunction) |
| static void | registerType (TypeFactoryMethod creationFunction) |
Protected Member Functions | |
| CacheableString (int8_t type=(int8_t) GemfireTypeIds::CacheableASCIIString) | |
| Default constructor. | |
| void | copyString (const wchar_t *value, int32_t len) |
Private method to populate the CacheableString. | |
| void | copyString (const char *value, int32_t len) |
Private method to populate the CacheableString. | |
| char * | getASCIIString (const wchar_t *value, int32_t &len, int32_t &encodedLen) |
| Private method to get ASCII string for wide-string if possible. | |
| void | initString (const wchar_t *value, int32_t len) |
| initialize the string, given a wide-char string and length. | |
| void | initString (const char *value, int32_t len) |
| initialize the string, given a value and length. | |
| void | initStringNoCopy (wchar_t *value, int32_t len) |
| Initialize the string without making a copy, given a wide-char string and length. | |
| void | initStringNoCopy (char *value, int32_t len) |
| Initialize the string without making a copy, given a C string and length. | |
| virtual gemfire::CacheableString::~CacheableString | ( | ) | [virtual] |
Destructor.
| gemfire::CacheableString::CacheableString | ( | int8_t | type = (int8_t)GemfireTypeIds::CacheableASCIIString |
) | [inline, protected] |
Default constructor.
| const char* gemfire::CacheableString::asChar | ( | ) | const [inline] |
Return the string that backs this CacheableString as a char *.
This shall throw an exception if the underlying string is a wchar_t* -- the caller should use typeId to determine the actual type, or isWideString to find whether this is a wide-character string.
| IllegalStateException | if the underlying string is a wchar_t * |
| const wchar_t* gemfire::CacheableString::asWChar | ( | ) | const [inline] |
Return the string that backs this CacheableString as a wchar_t *.
This shall throw an exception if the underlying string is a char* -- the caller should use typeId to determine the actual type, or isWideString to find whether this is indeed a wide-character string.
| IllegalStateException | if the underlying string is a char * |
| virtual int32_t gemfire::CacheableString::classId | ( | ) | const [virtual] |
Return the classId of the instance being serialized. This is used by deserialization to determine what instance type to create and deserialize into.
Implements gemfire::Serializable.
Reimplemented in gemfire::CacheableFileName.
| virtual const char* gemfire::CacheableString::className | ( | ) | const [inline, virtual] |
get the name of the class of this object for logging purpose
Reimplemented in gemfire::CacheableFileName.
| void gemfire::CacheableString::copyString | ( | const wchar_t * | value, | |
| int32_t | len | |||
| ) | [protected] |
Private method to populate the CacheableString.
| void gemfire::CacheableString::copyString | ( | const char * | value, | |
| int32_t | len | |||
| ) | [protected] |
Private method to populate the CacheableString.
| static CacheableKeyPtr gemfire::CacheableKey::create | ( | const PRIM | value | ) | [inline, static, inherited] |
Factory method that creates the key type that matches the type of value.
For customer defined derivations of CacheableKey, the method gemfire::createKey may be overloaded. For pointer types (e.g. char*) the method gemfire::createKeyArr may be overloaded.
Reimplemented from gemfire::Serializable.
| static CacheableStringPtr gemfire::CacheableString::create | ( | const wchar_t * | value, | |
| int32_t | len = 0 | |||
| ) | [inline, static] |
Factory method for creating an instance of CacheableString from a wide-character null terminated C string optionally giving the length.
This should be used for non-ASCII strings.
Reimplemented in gemfire::CacheableFileName.
| static CacheableStringPtr gemfire::CacheableString::create | ( | const char * | value, | |
| int32_t | len = 0 | |||
| ) | [inline, static] |
Factory method for creating an instance of CacheableString from a null terminated C string optionally giving the length.
This should be used only for ASCII strings.
Reimplemented in gemfire::CacheableFileName.
| static Serializable* gemfire::CacheableString::createDeserializable | ( | ) | [static] |
| static Serializable* gemfire::CacheableString::createDeserializableHuge | ( | ) | [static] |
creation function for strings > 64K length
| static CacheableStringPtr gemfire::CacheableString::createNoCopy | ( | wchar_t * | value, | |
| int32_t | len = 0 | |||
| ) | [inline, static] |
Factory method for creating an instance of CacheableString from a wide-character C string of given length by taking ownership of the string without making a copy.
The string should have been allocated using the standard C++ new operator.
This should be used for non-ASCII strings.
CAUTION: use this only when you really know what you are doing.
| static CacheableStringPtr gemfire::CacheableString::createNoCopy | ( | char * | value, | |
| int32_t | len = 0 | |||
| ) | [inline, static] |
Factory method for creating an instance of CacheableString from a C string of given length by taking ownership of the string without making a copy.
The string should have been allocated using the standard C++ new operator.
This should be used only for ASCII strings.
CAUTION: use this only when you really know what you are doing.
| static Serializable* gemfire::CacheableString::createUTFDeserializable | ( | ) | [static] |
creation function for wide strings
| static Serializable* gemfire::CacheableString::createUTFDeserializableHuge | ( | ) | [static] |
creation function for wide strings > 64K length in UTF8 encoding
| virtual int8_t gemfire::Serializable::DSFID | ( | ) | const [virtual, inherited] |
return the Data Serialization Fixed ID type. This is used to determine what instance type to create and deserialize into.
Note that this should not be overridden by custom implementations and is reserved only for builtin types.
Reimplemented in gemfire::CacheableUndefined, and gemfire::Struct.
| virtual Serializable* gemfire::CacheableString::fromData | ( | DataInput & | input | ) | [virtual] |
deserialize this object Throw IllegalArgumentException if the packed CacheableString is not less than 64K bytes.
Implements gemfire::Serializable.
Reimplemented in gemfire::CacheableFileName.
| char* gemfire::CacheableString::getASCIIString | ( | const wchar_t * | value, | |
| int32_t & | len, | |||
| int32_t & | encodedLen | |||
| ) | [protected] |
Private method to get ASCII string for wide-string if possible.
| virtual uint32_t gemfire::CacheableString::hashcode | ( | ) | const [virtual] |
return the hashcode for this key.
Implements gemfire::CacheableKey.
Reimplemented in gemfire::CacheableFileName.
| void gemfire::CacheableString::initString | ( | const wchar_t * | value, | |
| int32_t | len | |||
| ) | [protected] |
initialize the string, given a wide-char string and length.
| void gemfire::CacheableString::initString | ( | const char * | value, | |
| int32_t | len | |||
| ) | [protected] |
initialize the string, given a value and length.
| void gemfire::CacheableString::initStringNoCopy | ( | wchar_t * | value, | |
| int32_t | len | |||
| ) | [protected] |
Initialize the string without making a copy, given a wide-char string and length.
| void gemfire::CacheableString::initStringNoCopy | ( | char * | value, | |
| int32_t | len | |||
| ) | [protected] |
Initialize the string without making a copy, given a C string and length.
| bool gemfire::CacheableString::isCString | ( | ) | const [inline] |
Returns true if the underlying string is a normal C string.
| bool gemfire::CacheableString::isWideString | ( | ) | const [inline] |
Returns true if the underlying string is a wide-character string.
| uint32_t gemfire::CacheableString::length | ( | ) | const [inline] |
Return the length of the contained string.
| virtual int32_t gemfire::CacheableString::logString | ( | char * | buffer, | |
| int32_t | maxLength | |||
| ) | const [virtual] |
| virtual uint32_t gemfire::CacheableString::objectSize | ( | ) | const [virtual] |
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 gemfire::Serializable.
| virtual bool gemfire::CacheableString::operator== | ( | const CacheableKey & | other | ) | const [virtual] |
| void gemfire::SharedBase::preserveSB | ( | ) | const [inherited] |
Atomically increment reference count.
| int32_t gemfire::SharedBase::refCount | ( | ) | [inline, inherited] |
| static void gemfire::Serializable::registerPdxSerializer | ( | PdxSerializerPtr | pdxSerializer | ) | [static, inherited] |
Register the PDX serializer which can handle serialization for instances of user domain classes.
| static void gemfire::Serializable::registerPdxType | ( | TypeFactoryMethodPdx | creationFunction | ) | [static, inherited] |
register an Pdx instance factory method for a given type.
| IllegalStateException | if the typeName has already been registered, or there is an error in registering the type; check errno for more information in the latter case. |
| static void gemfire::Serializable::registerType | ( | TypeFactoryMethod | creationFunction | ) | [static, inherited] |
register an instance factory method for a given type. During registration the factory will be invoked to extract the typeId to associate with this function.
| IllegalStateException | if the typeId has already been registered, or there is an error in registering the type; check errno for more information in the latter case. |
| void gemfire::SharedBase::releaseSB | ( | ) | const [inherited] |
Atomically decrement reference count, the SharedBase object is automatically deleted when its reference count goes to zero.
| virtual void gemfire::CacheableString::toData | ( | DataOutput & | output | ) | const [virtual] |
serialize this object
Implements gemfire::Serializable.
Reimplemented in gemfire::CacheableFileName.
| virtual CacheableStringPtr gemfire::CacheableString::toString | ( | ) | const [inline, virtual] |
Display this object as 'string', which depends on the implementation in the subclasses.
The default implementation renders the classname.
The return value may be a temporary, so the caller has to ensure that the SharedPtr count does not go down to zero by storing the result in a variable or otherwise.
Reimplemented from gemfire::Serializable.
| const char* gemfire::CacheableString::toString | ( | ) | [inline] |
Display this object as c string.
In this case, it returns the same value as asChar() when underlying type is a char* and returns the same value as asWChar() cast to char* when the underlying type is a wchar_t*. To handle this correctly the user should find the actual type by calling typeId() or isWideString() and cast to the correct type accordingly. Note: this is a debugging API, not intended for getting the exact value of the CacheableString. In a future release this may return a more summary representation. This is historical. It is preferred that the user call logString or asChar/asWChar, depending on the need.
| virtual int8_t gemfire::CacheableString::typeId | ( | ) | const [virtual] |
Return the typeId byte of the instance being serialized.
This is used by deserialization to determine what instance type to create and deserialize into.
For a CacheableString this shall return GemfireTypeIds::CacheableNullString if the underlying string is null, GemfireTypeIds::CacheableASCIIString if the underlying string is a char*, and GemfireTypeIds::CacheableString if it is a wchar_t*. For strings larger than 64K it will return GemfireTypeIds::CacheableASCIIStringHuge and GemfireTypeIds::CacheableStringHuge for char* and wchar_t* respectively.
Reimplemented from gemfire::Serializable.
Reimplemented in gemfire::CacheableFileName.