VMware GemFire Native C++ Reference  9.1
CacheableBuiltins.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #ifndef GEODE_CACHEABLEBUILTINS_H_
4 #define GEODE_CACHEABLEBUILTINS_H_
5 
6 /*
7  * Licensed to the Apache Software Foundation (ASF) under one or more
8  * contributor license agreements. See the NOTICE file distributed with
9  * this work for additional information regarding copyright ownership.
10  * The ASF licenses this file to You under the Apache License, Version 2.0
11  * (the "License"); you may not use this file except in compliance with
12  * the License. You may obtain a copy of the License at
13  *
14  * http://www.apache.org/licenses/LICENSE-2.0
15  *
16  * Unless required by applicable law or agreed to in writing, software
17  * distributed under the License is distributed on an "AS IS" BASIS,
18  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19  * See the License for the specific language governing permissions and
20  * limitations under the License.
21  */
22 
28 #include <cstring>
29 
30 #include "Cacheable.hpp"
31 #include "CacheableKey.hpp"
32 #include "Serializer.hpp"
33 #include "CacheableKeys.hpp"
34 #include "CacheableString.hpp"
35 
36 namespace apache {
37 namespace geode {
38 namespace client {
39 
41 extern int gf_sprintf(char* buffer, const char* fmt, ...);
42 
44 extern int gf_snprintf(char* buffer, int32_t maxLength, const char* fmt, ...);
45 
47 template <typename TObj, int8_t TYPEID, const char* TYPENAME,
48  const char* SPRINTFSYM, int32_t STRSIZE>
50  protected:
51  TObj m_value;
52 
53  inline CacheableKeyType()
54  : m_value(apache::geode::client::serializer::zeroObject<TObj>()) {}
55 
56  inline CacheableKeyType(const TObj value) : m_value(value) {}
57 
58  public:
60  inline TObj value() const { return m_value; }
61 
62  // Cacheable methods
63 
65  virtual void toData(DataOutput& output) const {
66  apache::geode::client::serializer::writeObject(output, m_value);
67  }
68 
70  virtual Serializable* fromData(DataInput& input) {
71  apache::geode::client::serializer::readObject(input, m_value);
72  return this;
73  }
74 
81  virtual int32_t classId() const { return 0; }
82 
89  virtual int8_t typeId() const { return TYPEID; }
90 
92  virtual CacheableStringPtr toString() const {
93  char buffer[STRSIZE + 1];
94  gf_sprintf(buffer, SPRINTFSYM, m_value);
95  return CacheableString::create(buffer);
96  }
97 
98  // CacheableKey methods
99 
101  virtual int32_t hashcode() const {
102  return apache::geode::client::serializer::hashcode(m_value);
103  }
104 
106  virtual bool operator==(const CacheableKey& other) const {
107  if (other.typeId() != TYPEID) {
108  return false;
109  }
110  const CacheableKeyType& otherValue =
111  static_cast<const CacheableKeyType&>(other);
112  return apache::geode::client::serializer::equals(m_value,
113  otherValue.m_value);
114  }
115 
117  inline bool operator==(const TObj other) const {
118  return apache::geode::client::serializer::equals(m_value, other);
119  }
120 
125  virtual int32_t logString(char* buffer, int32_t maxLength) const {
126  char fmt[64];
127  gf_sprintf(fmt, "%s( %s )", TYPENAME, SPRINTFSYM);
128  return gf_snprintf(buffer, maxLength, fmt, m_value);
129  }
130 
139  virtual uint32_t objectSize() const { return sizeof(CacheableKeyType); }
140 };
141 
142 // Forward declaration for SharedArrayPtr
143 template <typename TObj, int8_t TYPEID>
145 
147 template <typename TObj>
148 inline void copyArray(TObj* dest, const TObj* src, int32_t length) {
149  std::memcpy(dest, src, length * sizeof(TObj));
150 }
151 
156 template <typename TObj>
157 inline void copyArray(SharedPtr<TObj>* dest, const SharedPtr<TObj>* src,
158  int32_t length) {
159  for (int32_t index = 0; index < length; index++) {
160  dest[index] = src[index];
161  }
162 }
163 
168 template <typename TObj, int8_t TYPEID>
170  const SharedArrayPtr<TObj, TYPEID>* src, int32_t length) {
171  for (int32_t index = 0; index < length; index++) {
172  dest[index] = src[index];
173  }
174 }
175 
177 template <typename TObj, int8_t TYPEID>
179  protected:
180  TObj* m_value;
181  int32_t m_length;
182 
183  inline CacheableArrayType() : m_value(NULL), m_length(0) {}
184 
185  inline CacheableArrayType(int32_t length) : m_length(length) {
186  if (length > 0) {
187  GF_NEW(m_value, TObj[length]);
188  }
189  }
190 
191  inline CacheableArrayType(TObj* value, int32_t length)
192  : m_value(value), m_length(length) {}
193 
194  inline CacheableArrayType(const TObj* value, int32_t length, bool copy)
195  : m_value(NULL), m_length(length) {
196  if (length > 0) {
197  GF_NEW(m_value, TObj[length]);
198  copyArray(m_value, value, length);
199  }
200  }
201 
202  virtual ~CacheableArrayType() { GF_SAFE_DELETE_ARRAY(m_value); }
203 
204  private:
205  // Private to disable copy constructor and assignment operator.
207  : m_value(other.m_value), m_length(other.m_length) {}
208 
209  CacheableArrayType& operator=(const CacheableArrayType& other) {
210  return *this;
211  }
212 
213  public:
215  inline const TObj* value() const { return m_value; }
216 
218  inline int32_t length() const { return m_length; }
219 
221  inline TObj operator[](uint32_t index) const {
222  if (static_cast<int32_t>(index) >= m_length) {
223  throw OutOfRangeException(
224  "CacheableArray::operator[]: Index out of range.");
225  }
226  return m_value[index];
227  }
228 
229  // Cacheable methods
230 
232  virtual void toData(DataOutput& output) const {
233  apache::geode::client::serializer::writeObject(output, m_value, m_length);
234  }
235 
237  virtual Serializable* fromData(DataInput& input) {
238  GF_SAFE_DELETE_ARRAY(m_value);
239  apache::geode::client::serializer::readObject(input, m_value, m_length);
240  return this;
241  }
242 
249  virtual int32_t classId() const { return 0; }
250 
257  virtual int8_t typeId() const { return TYPEID; }
258 
267  virtual uint32_t objectSize() const {
268  return static_cast<uint32_t>(
269  sizeof(CacheableArrayType) +
270  apache::geode::client::serializer::objectSize(m_value, m_length));
271  }
272 };
273 
277 template <typename TObj, int8_t TYPEID>
278 class SharedArrayPtr : public SharedPtr<CacheableArrayType<TObj, TYPEID> > {
279  private:
280  typedef CacheableArrayType<TObj, TYPEID> TArray;
281 
282  public:
284  inline SharedArrayPtr() : SharedPtr<CacheableArrayType<TObj, TYPEID> >() {}
285 
287  inline SharedArrayPtr(const TArray* ptr)
288  : SharedPtr<CacheableArrayType<TObj, TYPEID> >(ptr) {}
289 
291  inline SharedArrayPtr(const NullSharedBase* ptr)
292  : SharedPtr<CacheableArrayType<TObj, TYPEID> >(ptr) {}
293 
295  inline SharedArrayPtr(const SharedArrayPtr& other)
296  : SharedPtr<CacheableArrayType<TObj, TYPEID> >(other) {}
297 
299  template <typename TOther, int8_t OTHERID>
301  : SharedPtr<CacheableArrayType<TObj, TYPEID> >(other) {}
302 
304  template <typename TOther>
305  inline SharedArrayPtr(const SharedPtr<TOther>& other)
306  : SharedPtr<CacheableArrayType<TObj, TYPEID> >(other) {}
307 
309  inline TObj operator[](uint32_t index) const {
310  return SharedPtr<CacheableArrayType<TObj, TYPEID> >::ptr()->operator[](
311  index);
312  }
313 
315  inline Serializable* fromData(DataInput& input) {
316  return SharedPtr<CacheableArrayType<TObj, TYPEID> >::ptr()->fromData(input);
317  }
318 };
319 
321 template <typename TBase, int8_t TYPEID>
322 class CacheableContainerType : public Cacheable, public TBase {
323  protected:
324  inline CacheableContainerType() : TBase() {}
325 
326  inline CacheableContainerType(const int32_t n) : TBase(n) {}
327 
328  public:
329  // Cacheable methods
330 
332  virtual void toData(DataOutput& output) const {
333  apache::geode::client::serializer::writeObject(output, *this);
334  }
335 
337  virtual Serializable* fromData(DataInput& input) {
338  apache::geode::client::serializer::readObject(input, *this);
339  return this;
340  }
341 
348  virtual int32_t classId() const { return 0; }
349 
356  virtual int8_t typeId() const { return TYPEID; }
357 
366  virtual uint32_t objectSize() const {
367  return static_cast<uint32_t>(
368  sizeof(CacheableContainerType) +
369  apache::geode::client::serializer::objectSize(*this));
370  }
371 };
372 
373 #ifdef _SOLARIS
374 #define TEMPLATE_EXPORT template class
375 #else
376 #ifdef BUILD_CPPCACHE
377 #define TEMPLATE_EXPORT template class CPPCACHE_EXPORT
378 #else
379 #define TEMPLATE_EXPORT extern template class CPPCACHE_EXPORT
380 #endif
381 #endif
382 
383 // Disable extern template warning on MSVC compiler
384 #ifdef _MSC_VER
385 #pragma warning(disable : 4231)
386 #endif
387 
388 #define _GF_CACHEABLE_KEY_TYPE_DEF_(p, k, sz) \
389  extern const char tName_##k[]; \
390  extern const char tStr_##k[]; \
391  TEMPLATE_EXPORT \
392  CacheableKeyType<p, GeodeTypeIds::k, tName_##k, tStr_##k, sz>; \
393  typedef CacheableKeyType<p, GeodeTypeIds::k, tName_##k, tStr_##k, sz> _##k; \
394  class CPPCACHE_EXPORT k; \
395  typedef SharedPtr<k> k##Ptr;
396 
397 // use a class instead of typedef for bug #283
398 #define _GF_CACHEABLE_KEY_TYPE_(p, k, sz) \
399  class CPPCACHE_EXPORT k : public _##k { \
400  protected: \
401  inline k() : _##k() {} \
402  inline k(const p value) : _##k(value) {} \
403  \
404  public: \
405  \
406  static Serializable* createDeserializable() { return new k(); } \
407  \
408  inline static k##Ptr create() { return k##Ptr(new k()); } \
409  \
410  inline static k##Ptr create(const p value) { \
411  return k##Ptr(new k(value)); \
412  } \
413  }; \
414  inline CacheableKeyPtr createKey(const p value) { return k::create(value); } \
415  inline CacheablePtr createValue(const p value) { return k::create(value); }
416 
417 #define _GF_CACHEABLE_ARRAY_TYPE_DEF_(p, c) \
418  TEMPLATE_EXPORT CacheableArrayType<p, GeodeTypeIds::c>; \
419  typedef CacheableArrayType<p, GeodeTypeIds::c> _##c; \
420  class CPPCACHE_EXPORT c; \
421  typedef SharedArrayPtr<p, GeodeTypeIds::c> c##Ptr;
422 
423 // use a class instead of typedef for bug #283
424 #define _GF_CACHEABLE_ARRAY_TYPE_(p, c) \
425  class CPPCACHE_EXPORT c : public _##c { \
426  protected: \
427  inline c() : _##c() {} \
428  inline c(int32_t length) : _##c(length) {} \
429  inline c(p* value, int32_t length) : _##c(value, length) {} \
430  inline c(const p* value, int32_t length, bool copy) \
431  : _##c(value, length, true) {} \
432  \
433  private: \
434  /* Private to disable copy constructor and assignment operator. */ \
435  c(const c& other); \
436  c& operator=(const c& other); \
437  \
438  public: \
439  \
440  static Serializable* createDeserializable() { return new c(); } \
441  \
442  inline static c##Ptr create() { return c##Ptr(new c()); } \
443  \
444  inline static c##Ptr create(int32_t length) { \
445  return c##Ptr(new c(length)); \
446  } \
447  \
448  inline static c##Ptr create(const p* value, int32_t length) { \
449  return (value != NULL ? c##Ptr(new c(value, length, true)) : NULLPTR); \
450  } \
451  \
473  inline static c##Ptr createNoCopy(p* value, int32_t length) { \
474  return (value != NULL ? c##Ptr(new c(value, length)) : NULLPTR); \
475  } \
476  };
477 
478 #define _GF_CACHEABLE_CONTAINER_TYPE_DEF_(p, c) \
479  TEMPLATE_EXPORT CacheableContainerType<p, GeodeTypeIds::c>; \
480  typedef CacheableContainerType<p, GeodeTypeIds::c> _##c; \
481  class CPPCACHE_EXPORT c; \
482  typedef SharedPtr<c> c##Ptr;
483 
484 // use a class instead of typedef for bug #283
485 #define _GF_CACHEABLE_CONTAINER_TYPE_(p, c) \
486  class CPPCACHE_EXPORT c : public _##c { \
487  protected: \
488  inline c() : _##c() {} \
489  inline c(const int32_t n) : _##c(n) {} \
490  \
491  public: \
492  \
493  typedef p::Iterator Iterator; \
494  \
495  static Serializable* createDeserializable() { return new c(); } \
496  \
497  inline static c##Ptr create() { return c##Ptr(new c()); } \
498  \
499  inline static c##Ptr create(const int32_t n) { return c##Ptr(new c(n)); } \
500  };
501 
502 // Instantiations for the built-in CacheableKeys
503 
504 _GF_CACHEABLE_KEY_TYPE_DEF_(bool, CacheableBoolean, 3);
509 _GF_CACHEABLE_KEY_TYPE_(bool, CacheableBoolean, 3);
510 
511 _GF_CACHEABLE_ARRAY_TYPE_DEF_(bool, BooleanArray);
516 _GF_CACHEABLE_ARRAY_TYPE_(bool, BooleanArray);
517 
518 _GF_CACHEABLE_KEY_TYPE_DEF_(uint8_t, CacheableByte, 15);
523 _GF_CACHEABLE_KEY_TYPE_(uint8_t, CacheableByte, 15);
524 
525 _GF_CACHEABLE_KEY_TYPE_DEF_(double, CacheableDouble, 63);
530 _GF_CACHEABLE_KEY_TYPE_(double, CacheableDouble, 63);
531 
532 _GF_CACHEABLE_KEY_TYPE_DEF_(float, CacheableFloat, 63);
537 _GF_CACHEABLE_KEY_TYPE_(float, CacheableFloat, 63);
538 
539 _GF_CACHEABLE_KEY_TYPE_DEF_(int16_t, CacheableInt16, 15);
544 _GF_CACHEABLE_KEY_TYPE_(int16_t, CacheableInt16, 15);
545 
546 _GF_CACHEABLE_KEY_TYPE_DEF_(int32_t, CacheableInt32, 15);
551 _GF_CACHEABLE_KEY_TYPE_(int32_t, CacheableInt32, 15);
552 
553 _GF_CACHEABLE_KEY_TYPE_DEF_(int64_t, CacheableInt64, 31);
558 _GF_CACHEABLE_KEY_TYPE_(int64_t, CacheableInt64, 31);
559 
560 _GF_CACHEABLE_KEY_TYPE_DEF_(wchar_t, CacheableWideChar, 3);
565 _GF_CACHEABLE_KEY_TYPE_(wchar_t, CacheableWideChar, 3);
566 
567 _GF_CACHEABLE_ARRAY_TYPE_DEF_(wchar_t, CharArray);
572 _GF_CACHEABLE_ARRAY_TYPE_(wchar_t, CharArray);
573 
574 // Instantiations for array built-in Cacheables
575 
576 _GF_CACHEABLE_ARRAY_TYPE_DEF_(uint8_t, CacheableBytes);
581 _GF_CACHEABLE_ARRAY_TYPE_(uint8_t, CacheableBytes);
582 
583 _GF_CACHEABLE_ARRAY_TYPE_DEF_(double, CacheableDoubleArray);
588 _GF_CACHEABLE_ARRAY_TYPE_(double, CacheableDoubleArray);
589 
590 _GF_CACHEABLE_ARRAY_TYPE_DEF_(float, CacheableFloatArray);
595 _GF_CACHEABLE_ARRAY_TYPE_(float, CacheableFloatArray);
596 
597 _GF_CACHEABLE_ARRAY_TYPE_DEF_(int16_t, CacheableInt16Array);
602 _GF_CACHEABLE_ARRAY_TYPE_(int16_t, CacheableInt16Array);
603 
604 _GF_CACHEABLE_ARRAY_TYPE_DEF_(int32_t, CacheableInt32Array);
609 _GF_CACHEABLE_ARRAY_TYPE_(int32_t, CacheableInt32Array);
610 
611 _GF_CACHEABLE_ARRAY_TYPE_DEF_(int64_t, CacheableInt64Array);
616 _GF_CACHEABLE_ARRAY_TYPE_(int64_t, CacheableInt64Array);
617 
618 _GF_CACHEABLE_ARRAY_TYPE_DEF_(CacheableStringPtr, CacheableStringArray);
623 _GF_CACHEABLE_ARRAY_TYPE_(CacheableStringPtr, CacheableStringArray);
624 
625 // Instantiations for container types (Vector/HashMap/HashSet) Cacheables
626 
627 _GF_CACHEABLE_CONTAINER_TYPE_DEF_(_VectorOfCacheable, CacheableVector);
632 _GF_CACHEABLE_CONTAINER_TYPE_(_VectorOfCacheable, CacheableVector);
633 
634 _GF_CACHEABLE_CONTAINER_TYPE_DEF_(_HashMapOfCacheable, CacheableHashMap);
639 _GF_CACHEABLE_CONTAINER_TYPE_(_HashMapOfCacheable, CacheableHashMap);
640 
641 _GF_CACHEABLE_CONTAINER_TYPE_DEF_(_HashSetOfCacheableKey, CacheableHashSet);
646 _GF_CACHEABLE_CONTAINER_TYPE_(_HashSetOfCacheableKey, CacheableHashSet);
647 
648 _GF_CACHEABLE_CONTAINER_TYPE_DEF_(_VectorOfCacheable, CacheableArrayList);
653 _GF_CACHEABLE_CONTAINER_TYPE_(_VectorOfCacheable, CacheableArrayList);
654 
655 // linketlist for JSON formattor issue
656 _GF_CACHEABLE_CONTAINER_TYPE_DEF_(_VectorOfCacheable, CacheableLinkedList);
661 _GF_CACHEABLE_CONTAINER_TYPE_(_VectorOfCacheable, CacheableLinkedList);
662 
663 _GF_CACHEABLE_CONTAINER_TYPE_DEF_(_VectorOfCacheable, CacheableStack);
668 _GF_CACHEABLE_CONTAINER_TYPE_(_VectorOfCacheable, CacheableStack);
669 
670 _GF_CACHEABLE_CONTAINER_TYPE_DEF_(_HashMapOfCacheable, CacheableHashTable);
675 _GF_CACHEABLE_CONTAINER_TYPE_(_HashMapOfCacheable, CacheableHashTable);
676 
677 _GF_CACHEABLE_CONTAINER_TYPE_DEF_(_HashMapOfCacheable,
686 _GF_CACHEABLE_CONTAINER_TYPE_(_HashMapOfCacheable, CacheableIdentityHashMap);
687 
688 _GF_CACHEABLE_CONTAINER_TYPE_DEF_(_HashSetOfCacheableKey,
697 _GF_CACHEABLE_CONTAINER_TYPE_(_HashSetOfCacheableKey, CacheableLinkedHashSet);
698 } // namespace client
699 } // namespace geode
700 } // namespace apache
701 
702 #endif // GEODE_CACHEABLEBUILTINS_H_
A mutable CacheableKey to Serializable hash map that can serve as a distributable object for caching...
Definition: CacheableBuiltins.hpp:686
int gf_snprintf(char *buffer, int32_t maxLength, const char *fmt,...)
snprintf implementation.
A mutable CacheableKey hash set wrapper that can serve as a distributable object for caching...
Definition: CacheableBuiltins.hpp:646
virtual int32_t hashcode() const
Return the hashcode for this key.
Definition: CacheableBuiltins.hpp:101
const TObj * value() const
Get the underlying array.
Definition: CacheableBuiltins.hpp:215
An immutable wrapper for booleans that can serve as a distributable key object for caching...
Definition: CacheableBuiltins.hpp:509
SharedArrayPtr(const NullSharedBase *ptr)
Constructor, given a null SharedBase.
Definition: CacheableBuiltins.hpp:291
virtual uint32_t objectSize() const
Return the size in bytes of the instance being serialized.
Definition: CacheableBuiltins.hpp:366
An immutable wrapper for 32-bit integers that can serve as a distributable key object for caching...
Definition: CacheableBuiltins.hpp:551
An immutable wrapper for doubles that can serve as a distributable key object for caching...
Definition: CacheableBuiltins.hpp:530
SharedArrayPtr(const SharedArrayPtr< TOther, OTHERID > &other)
Constructor, given another kind of SharedArrayPtr.
Definition: CacheableBuiltins.hpp:300
Each enum represents a predefined RegionAttributes in a Cache.
Definition: Assert.hpp:31
An immutable wrapper for array of 64-bit integers that can serve as a distributable object for cachin...
Definition: CacheableBuiltins.hpp:616
virtual int8_t typeId() const
return the typeId byte of the instance being serialized.
TObj operator[](uint32_t index) const
Get the element at given index.
Definition: CacheableBuiltins.hpp:309
virtual int8_t typeId() const
Return the typeId byte of the instance being serialized.
Definition: CacheableBuiltins.hpp:89
virtual int8_t typeId() const
Return the typeId byte of the instance being serialized.
Definition: CacheableBuiltins.hpp:257
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...
Definition: CacheableString.hpp:113
SharedArrayPtr(const TArray *ptr)
Constructor, given a pointer to array.
Definition: CacheableBuiltins.hpp:287
A mutable CacheableKey to Serializable hash map that can serve as a distributable object for caching...
Definition: CacheableBuiltins.hpp:675
virtual CacheableStringPtr toString() const
Return a string representation of the object.
Definition: CacheableBuiltins.hpp:92
A mutable CacheableKey to Serializable hash map that can serve as a distributable object for caching...
Definition: CacheableBuiltins.hpp:639
int32_t length() const
Get the length of the array.
Definition: CacheableBuiltins.hpp:218
virtual int32_t classId() const
Return the classId of the instance being serialized.
Definition: CacheableBuiltins.hpp:348
An immutable wrapper for wide-characters that can serve as a distributable key object for caching...
Definition: CacheableBuiltins.hpp:565
An immutable wrapper for array of booleans that can serve as a distributable object for caching...
Definition: CacheableBuiltins.hpp:516
virtual int32_t classId() const
Return the classId of the instance being serialized.
Definition: CacheableBuiltins.hpp:249
Class encapsulating a NULL SharedBase smart pointer.
Definition: SharedBase.hpp:73
HashMap of TKEY to TVAL.
Definition: HashMapT.hpp:38
bool operator==(const TObj other) const
Return true if this key matches other key value.
Definition: CacheableBuiltins.hpp:117
An immutable wrapper for array of strings that can serve as a distributable object for caching...
Definition: CacheableBuiltins.hpp:623
Template class for array of primitive types.
Definition: CacheableBuiltins.hpp:178
Provide operations for writing primitive data values, byte arrays, strings, Serializable objects to a...
Definition: DataOutput.hpp:74
An immutable wrapper for array of 16-bit integers that can serve as a distributable object for cachin...
Definition: CacheableBuiltins.hpp:602
virtual void toData(DataOutput &output) const
Serialize this object to given DataOutput.
Definition: CacheableBuiltins.hpp:65
#define GF_SAFE_DELETE_ARRAY(x)
Deletes array x only if it exists.
Definition: geode_base.hpp:311
An immutable wrapper for byte arrays that can serve as a distributable object for caching...
Definition: CacheableBuiltins.hpp:581
Template class for CacheableArrayType SharedPtr&#39;s that adds [] operator.
Definition: CacheableBuiltins.hpp:144
int gf_sprintf(char *buffer, const char *fmt,...)
sprintf implementation.
An immutable wrapper for 64-bit integers that can serve as a distributable key object for caching...
Definition: CacheableBuiltins.hpp:558
virtual Serializable * fromData(DataInput &input)
Deserialize this object from the given DataInput.
Definition: CacheableBuiltins.hpp:237
A mutable Cacheable array list wrapper that can serve as a distributable object for caching...
Definition: CacheableBuiltins.hpp:661
TObj operator[](uint32_t index) const
Get the element at given index.
Definition: CacheableBuiltins.hpp:221
virtual uint32_t objectSize() const
Return the size in bytes of the instance being serialized.
Definition: CacheableBuiltins.hpp:139
Template CacheableKey class for primitive types.
Definition: CacheableBuiltins.hpp:49
virtual int32_t logString(char *buffer, int32_t maxLength) const
Copy the string form of the object into a char* buffer for logging purposes.
Definition: CacheableBuiltins.hpp:125
An immutable wrapper for array of floats that can serve as a distributable object for caching...
Definition: CacheableBuiltins.hpp:595
HashSet of TKEY.
Definition: HashSetT.hpp:36
TObj value() const
Gets the contained value.
Definition: CacheableBuiltins.hpp:60
void copyArray(TObj *dest, const TObj *src, int32_t length)
Function to copy an array from source to destination.
Definition: CacheableBuiltins.hpp:148
virtual Serializable * fromData(DataInput &input)
Deserialize this object from given DataInput.
Definition: CacheableBuiltins.hpp:70
An immutable wrapper for 16-bit integers that can serve as a distributable key object for caching...
Definition: CacheableBuiltins.hpp:544
Template class for container Cacheable types.
Definition: CacheableBuiltins.hpp:322
virtual void toData(DataOutput &output) const
Serialize this object to the given DataOutput.
Definition: CacheableBuiltins.hpp:232
A mutable Cacheable vector wrapper that can serve as a distributable object for caching.
Definition: CacheableBuiltins.hpp:632
An immutable wrapper for bytes that can serve as a distributable key object for caching.
Definition: CacheableBuiltins.hpp:523
This abstract base class is the superclass of all user objects in the cache that can be serialized...
Definition: Serializable.hpp:53
Serializable * fromData(DataInput &input)
Deserialize self.
Definition: CacheableBuiltins.hpp:315
SharedArrayPtr(const SharedPtr< TOther > &other)
Constructor, given another SharedPtr.
Definition: CacheableBuiltins.hpp:305
virtual Serializable * fromData(DataInput &input)
Deserialize this object from the given DataInput.
Definition: CacheableBuiltins.hpp:337
A mutable CacheableKey hash set wrapper that can serve as a distributable object for caching...
Definition: CacheableBuiltins.hpp:697
A mutable Cacheable array list wrapper that can serve as a distributable object for caching...
Definition: CacheableBuiltins.hpp:653
Vector template type class.
Definition: VectorT.hpp:37
Provide operations for reading primitive data values, byte arrays, strings, Serializable objects from...
Definition: DataInput.hpp:56
Represents a cacheable key.
Definition: CacheableKey.hpp:36
virtual uint32_t objectSize() const
Return the size in bytes of the instance being serialized.
Definition: CacheableBuiltins.hpp:267
An immutable wrapper for array of 32-bit integers that can serve as a distributable object for cachin...
Definition: CacheableBuiltins.hpp:609
An immutable wrapper for array of doubles that can serve as a distributable object for caching...
Definition: CacheableBuiltins.hpp:588
#define GF_NEW(v, stmt)
Allocates x and throws OutOfMemoryException if it fails.
Definition: geode_base.hpp:293
virtual int8_t typeId() const
Return the typeId byte of the instance being serialized.
Definition: CacheableBuiltins.hpp:356
virtual void toData(DataOutput &output) const
Serialize this object to the given DataOutput.
Definition: CacheableBuiltins.hpp:332
SharedArrayPtr()
Default constructor.
Definition: CacheableBuiltins.hpp:284
virtual bool operator==(const CacheableKey &other) const
Return true if this key matches other.
Definition: CacheableBuiltins.hpp:106
virtual int32_t classId() const
Return the classId of the instance being serialized.
Definition: CacheableBuiltins.hpp:81
An immutable wrapper for array of wide-characters that can serve as a distributable object for cachin...
Definition: CacheableBuiltins.hpp:572
An immutable wrapper for floats that can serve as a distributable key object for caching.
Definition: CacheableBuiltins.hpp:537
This namespace contains all the Geode C++ API classes, enumerations and globals.
A mutable Cacheable stack wrapper that can serve as a distributable object for caching.
Definition: CacheableBuiltins.hpp:668
SharedArrayPtr(const SharedArrayPtr &other)
Constructor, given another SharedArrayPtr.
Definition: CacheableBuiltins.hpp:295

Pivotal GemFire C++ Cache API Documentation