Pivotal GemFire Native Client Cache Reference  9.0.6
CacheableBuiltins.hpp
Go to the documentation of this file.
1 #ifndef _GEMFIRE_CACHEABLE_BUILTINS_HPP_
2 #define _GEMFIRE_CACHEABLE_BUILTINS_HPP_
3 
4 /*=========================================================================
5  * Copyright (c) 2002-2014 Pivotal Software, Inc. All Rights Reserved.
6  * This product is protected by U.S. and international copyright
7  * and intellectual property laws. Pivotal products are covered by
8  * more patents listed at http://www.pivotal.io/patents.
9  *=========================================================================
10  */
11 
17 #include "Cacheable.hpp"
18 #include "CacheableKey.hpp"
19 #include "Serializer.hpp"
20 #include "CacheableKeys.hpp"
21 #include "CacheableString.hpp"
22 
23 
24 namespace gemfire
25 {
26 
28  extern int gf_sprintf(char* buffer, const char* fmt, ...);
29 
31  extern int gf_snprintf(char* buffer, int32_t maxLength, const char* fmt, ...);
32 
34  template<typename TObj, int8_t TYPEID, const char* TYPENAME,
35  const char* SPRINTFSYM, int32_t STRSIZE>
37  {
38  protected:
39  TObj m_value;
40 
41  inline CacheableKeyType() :
42  m_value(gemfire::serializer::zeroObject<TObj>())
43  {
44  }
45 
46  inline CacheableKeyType(const TObj value) :
47  m_value(value)
48  {
49  }
50 
51  public:
53  inline TObj value() const
54  {
55  return m_value;
56  }
57 
58  // Cacheable methods
59 
61  virtual void toData(DataOutput& output) const
62  {
63  gemfire::serializer::writeObject(output, m_value);
64  }
65 
67  virtual Serializable* fromData(DataInput& input)
68  {
69  gemfire::serializer::readObject(input, m_value);
70  return this;
71  }
72 
79  virtual int32_t classId() const
80  {
81  return 0;
82  }
83 
90  virtual int8_t typeId() const
91  {
92  return TYPEID;
93  }
94 
96  virtual CacheableStringPtr toString() const
97  {
98  char buffer[STRSIZE + 1];
99  gf_sprintf(buffer, SPRINTFSYM, m_value);
100  return CacheableString::create(buffer);
101  }
102 
103  // CacheableKey methods
104 
106  virtual uint32_t hashcode() const
107  {
108  return gemfire::serializer::hashcode(m_value);
109  }
110 
112  virtual bool operator ==(const CacheableKey& other) const
113  {
114  if (other.typeId() != TYPEID) {
115  return false;
116  }
117  const CacheableKeyType& otherValue =
118  static_cast<const CacheableKeyType&> (other);
119  return gemfire::serializer::equals(m_value, otherValue.m_value);
120  }
121 
123  inline bool operator ==(const TObj other) const
124  {
125  return gemfire::serializer::equals(m_value, other);
126  }
127 
132  virtual int32_t logString(char* buffer, int32_t maxLength) const
133  {
134  char fmt[64];
135  gf_sprintf(fmt, "%s( %s )", TYPENAME, SPRINTFSYM);
136  return gf_snprintf(buffer, maxLength, fmt, m_value);
137  }
138 
147  virtual uint32_t objectSize() const
148  {
149  return sizeof(CacheableKeyType);
150  }
151  };
152 
153  // Forward declaration for SharedArrayPtr
154  template<typename TObj, int8_t TYPEID> class SharedArrayPtr;
155 
157  template<typename TObj>
158  inline void copyArray(TObj* dest, const TObj* src, int32_t length)
159  {
160  memcpy(dest, src, length * sizeof(TObj));
161  }
162 
167  template<typename TObj>
168  inline void copyArray(SharedPtr<TObj>* dest, const SharedPtr<TObj>* src,
169  int32_t length)
170  {
171  for (int32_t index = 0; index < length; index++) {
172  dest[index] = src[index];
173  }
174  }
175 
180  template<typename TObj, int8_t TYPEID>
182  const SharedArrayPtr<TObj, TYPEID>* src, int32_t length)
183  {
184  for (int32_t index = 0; index < length; index++) {
185  dest[index] = src[index];
186  }
187  }
188 
190  template<typename TObj, int8_t TYPEID>
192  {
193  protected:
194 
195  TObj* m_value;
196  int32_t m_length;
197 
198  inline CacheableArrayType() :
199  m_value(NULL), m_length(0)
200  {
201  }
202 
203  inline CacheableArrayType(int32_t length) :
204  m_length(length)
205  {
206  if (length > 0) {
207  GF_NEW(m_value, TObj[length]);
208  }
209  }
210 
211  inline CacheableArrayType(TObj* value, int32_t length) :
212  m_value(value), m_length(length)
213  {
214  }
215 
216  inline CacheableArrayType(const TObj* value, int32_t length, bool copy) :
217  m_value(NULL), m_length(length)
218  {
219  if (length > 0) {
220  GF_NEW(m_value, TObj[length]);
221  copyArray(m_value, value, length);
222  }
223  }
224 
225  virtual ~CacheableArrayType()
226  {
227  GF_SAFE_DELETE_ARRAY(m_value);
228  }
229 
230  private:
231 
232  // Private to disable copy constructor and assignment operator.
233  CacheableArrayType(const CacheableArrayType& other) :
234  m_value(other.m_value), m_length(other.m_length)
235  {
236  }
237 
238  CacheableArrayType& operator =(const CacheableArrayType& other)
239  {
240  return *this;
241  }
242 
243  public:
244 
246  inline const TObj* value() const
247  {
248  return m_value;
249  }
250 
252  inline int32_t length() const
253  {
254  return m_length;
255  }
256 
258  inline TObj operator [](uint32_t index) const
259  {
260  if ((int32_t) index >= m_length) {
261  throw OutOfRangeException(
262  "CacheableArray::operator[]: Index out of range.");
263  }
264  return m_value[index];
265  }
266 
267  // Cacheable methods
268 
270  virtual void toData(DataOutput& output) const
271  {
272  gemfire::serializer::writeObject(output, m_value, m_length);
273  }
274 
276  virtual Serializable* fromData(DataInput& input)
277  {
278  GF_SAFE_DELETE_ARRAY(m_value);
279  gemfire::serializer::readObject(input, m_value, m_length);
280  return this;
281  }
282 
289  virtual int32_t classId() const
290  {
291  return 0;
292  }
293 
300  virtual int8_t typeId() const
301  {
302  return TYPEID;
303  }
304 
313  virtual uint32_t objectSize() const
314  {
315  return (uint32_t)(sizeof(CacheableArrayType)
316  + gemfire::serializer::objectSize(m_value, m_length));
317  }
318 
319  };
320 
324  template<typename TObj, int8_t TYPEID>
325  class SharedArrayPtr: public SharedPtr<CacheableArrayType<TObj, TYPEID> >
326  {
327  private:
328 
329  typedef CacheableArrayType<TObj, TYPEID> TArray;
330 
331  public:
332 
334  inline SharedArrayPtr() :
335  SharedPtr<CacheableArrayType<TObj, TYPEID> > ()
336  {
337  }
338 
340  inline SharedArrayPtr(const TArray* ptr) :
341  SharedPtr<CacheableArrayType<TObj, TYPEID> > (ptr)
342  {
343  }
344 
346  inline SharedArrayPtr(const NullSharedBase* ptr) :
347  SharedPtr<CacheableArrayType<TObj, TYPEID> > (ptr)
348  {
349  }
350 
352  inline SharedArrayPtr(const SharedArrayPtr& other) :
353  SharedPtr<CacheableArrayType<TObj, TYPEID> > (other)
354  {
355  }
356 
358  template<typename TOther, int8_t OTHERID>
360  SharedPtr<CacheableArrayType<TObj, TYPEID> > (other)
361  {
362  }
363 
365  template<typename TOther>
366  inline SharedArrayPtr(const SharedPtr<TOther>& other) :
367  SharedPtr<CacheableArrayType<TObj, TYPEID> > (other)
368  {
369  }
370 
372  inline TObj operator [](uint32_t index) const
373  {
374  return SharedPtr<CacheableArrayType<TObj, TYPEID> >::ptr()-> operator [](
375  index);
376  }
377 
379  inline Serializable * fromData(DataInput & input)
380  {
381  return SharedPtr<CacheableArrayType<TObj, TYPEID> >::ptr()->fromData(input);
382  }
383  };
384 
386  template<typename TBase, int8_t TYPEID>
387  class CacheableContainerType: public Cacheable, public TBase
388  {
389  protected:
390 
391  inline CacheableContainerType() :
392  TBase()
393  {
394  }
395 
396  inline CacheableContainerType(const int32_t n) :
397  TBase(n)
398  {
399  }
400 
401  public:
402 
403  // Cacheable methods
404 
406  virtual void toData(DataOutput& output) const
407  {
408  gemfire::serializer::writeObject(output, *this);
409  }
410 
412  virtual Serializable* fromData(DataInput& input)
413  {
414  gemfire::serializer::readObject(input, *this);
415  return this;
416  }
417 
424  virtual int32_t classId() const
425  {
426  return 0;
427  }
428 
435  virtual int8_t typeId() const
436  {
437  return TYPEID;
438  }
439 
448  virtual uint32_t objectSize() const
449  {
450  return (uint32_t)(sizeof(CacheableContainerType) +
451  gemfire::serializer::objectSize(*this));
452  }
453  };
454 
455 
456 #ifdef _SOLARIS
457 #define TEMPLATE_EXPORT template class
458 #else
459 #ifdef BUILD_CPPCACHE
460 #define TEMPLATE_EXPORT template class CPPCACHE_EXPORT
461 #else
462 #define TEMPLATE_EXPORT extern template class CPPCACHE_EXPORT
463 #endif
464 #endif
465 
466 
467 // Disable extern template warning on MSVC compiler
468 #ifdef _MSC_VER
469 #pragma warning(disable: 4231)
470 #endif
471 
472 #define _GF_CACHEABLE_KEY_TYPE_DEF_(p, k, sz) \
473  extern const char tName_##k []; \
474  extern const char tStr_##k []; \
475  TEMPLATE_EXPORT CacheableKeyType<p, GemfireTypeIds::k, \
476  tName_##k, tStr_##k, sz>; \
477  typedef CacheableKeyType<p, GemfireTypeIds::k, \
478  tName_##k, tStr_##k, sz> _##k; \
479  class CPPCACHE_EXPORT k; \
480  typedef SharedPtr<k> k##Ptr;
481 
482 // use a class instead of typedef for bug #283
483 #define _GF_CACHEABLE_KEY_TYPE_(p, k, sz) \
484  class CPPCACHE_EXPORT k: public _##k \
485  { \
486  protected: \
487  inline k() : _##k() { } \
488  inline k(const p value) : _##k(value) { } \
489  public: \
490  \
491  static Serializable* createDeserializable() { \
492  return new k(); \
493  } \
494  \
495  inline static k##Ptr create() { \
496  return k##Ptr(new k()); \
497  } \
498  \
499  inline static k##Ptr create(const p value) { \
500  return k##Ptr(new k(value)); \
501  } \
502  }; \
503  inline CacheableKeyPtr createKey(const p value) { \
504  return k::create(value); \
505  } \
506  inline CacheablePtr createValue(const p value) { \
507  return k::create(value); \
508  } \
509 
510 
511 #define _GF_CACHEABLE_ARRAY_TYPE_DEF_(p, c) \
512  TEMPLATE_EXPORT CacheableArrayType<p, GemfireTypeIds::c>; \
513  typedef CacheableArrayType<p, GemfireTypeIds::c> _##c; \
514  class CPPCACHE_EXPORT c; \
515  typedef SharedArrayPtr<p, GemfireTypeIds::c> c##Ptr;
516 
517 // use a class instead of typedef for bug #283
518 #define _GF_CACHEABLE_ARRAY_TYPE_(p, c) \
519  class CPPCACHE_EXPORT c: public _##c \
520  { \
521  protected: \
522  inline c() : _##c() { } \
523  inline c(int32_t length) : _##c(length) { } \
524  inline c(p* value, int32_t length) : _##c(value, length) { } \
525  inline c(const p* value, int32_t length, bool copy) : \
526  _##c(value, length, true) { } \
527  private: \
528  /* Private to disable copy constructor and assignment operator. */ \
529  c(const c& other); \
530  c& operator =(const c& other); \
531  public: \
532  \
533  static Serializable* createDeserializable() { \
534  return new c(); \
535  } \
536  \
537  inline static c##Ptr create() { \
538  return c##Ptr(new c()); \
539  } \
540  \
541  inline static c##Ptr create(int32_t length) { \
542  return c##Ptr(new c(length)); \
543  } \
544  \
545  inline static c##Ptr create(const p* value, int32_t length) { \
546  return (value != NULL ? c##Ptr(new c(value, length, true)) : \
547  NULLPTR); \
548  } \
549  \
557  inline static c##Ptr createNoCopy(p* value, int32_t length) { \
558  return (value != NULL ? c##Ptr(new c(value, length)) : \
559  NULLPTR); \
560  } \
561  };
562 
563 
564 #define _GF_CACHEABLE_CONTAINER_TYPE_DEF_(p, c) \
565  TEMPLATE_EXPORT CacheableContainerType<p, GemfireTypeIds::c>; \
566  typedef CacheableContainerType<p, GemfireTypeIds::c> _##c; \
567  class CPPCACHE_EXPORT c; \
568  typedef SharedPtr<c> c##Ptr;
569 
570 // use a class instead of typedef for bug #283
571 #define _GF_CACHEABLE_CONTAINER_TYPE_(p, c) \
572  class CPPCACHE_EXPORT c: public _##c \
573  { \
574  protected: \
575  inline c() : _##c() { } \
576  inline c(const int32_t n) : _##c(n) { } \
577  public: \
578  \
579  typedef p::Iterator Iterator; \
580  \
581  static Serializable* createDeserializable() { \
582  return new c(); \
583  } \
584  \
585  inline static c##Ptr create() { \
586  return c##Ptr(new c()); \
587  } \
588  \
589  inline static c##Ptr create(const int32_t n) { \
590  return c##Ptr(new c(n)); \
591  } \
592  };
593 
594 
595 
596  // Instantiations for the built-in CacheableKeys
597 
598  _GF_CACHEABLE_KEY_TYPE_DEF_(bool, CacheableBoolean, 3);
603  _GF_CACHEABLE_KEY_TYPE_(bool, CacheableBoolean, 3);
604 
605  _GF_CACHEABLE_ARRAY_TYPE_DEF_(bool, BooleanArray);
610  _GF_CACHEABLE_ARRAY_TYPE_(bool, BooleanArray);
611 
612  _GF_CACHEABLE_KEY_TYPE_DEF_(uint8_t, CacheableByte, 15);
617  _GF_CACHEABLE_KEY_TYPE_(uint8_t, CacheableByte, 15);
618 
619  _GF_CACHEABLE_KEY_TYPE_DEF_(double, CacheableDouble, 63);
624  _GF_CACHEABLE_KEY_TYPE_(double, CacheableDouble, 63);
625 
626  _GF_CACHEABLE_KEY_TYPE_DEF_(float, CacheableFloat, 63);
631  _GF_CACHEABLE_KEY_TYPE_(float, CacheableFloat, 63);
632 
633  _GF_CACHEABLE_KEY_TYPE_DEF_(int16_t, CacheableInt16, 15);
638  _GF_CACHEABLE_KEY_TYPE_(int16_t, CacheableInt16, 15);
639 
640  _GF_CACHEABLE_KEY_TYPE_DEF_(int32_t, CacheableInt32, 15);
645  _GF_CACHEABLE_KEY_TYPE_(int32_t, CacheableInt32, 15);
646 
647  _GF_CACHEABLE_KEY_TYPE_DEF_(int64_t, CacheableInt64, 31);
652  _GF_CACHEABLE_KEY_TYPE_(int64_t, CacheableInt64, 31);
653 
654  _GF_CACHEABLE_KEY_TYPE_DEF_(wchar_t, CacheableWideChar, 3);
659  _GF_CACHEABLE_KEY_TYPE_(wchar_t, CacheableWideChar, 3);
660 
661 
662  _GF_CACHEABLE_ARRAY_TYPE_DEF_(wchar_t, CharArray);
667  _GF_CACHEABLE_ARRAY_TYPE_(wchar_t, CharArray);
668 
669  // Instantiations for array built-in Cacheables
670 
671  _GF_CACHEABLE_ARRAY_TYPE_DEF_(uint8_t, CacheableBytes);
676  _GF_CACHEABLE_ARRAY_TYPE_(uint8_t, CacheableBytes);
677 
678  _GF_CACHEABLE_ARRAY_TYPE_DEF_(double, CacheableDoubleArray);
683  _GF_CACHEABLE_ARRAY_TYPE_(double, CacheableDoubleArray);
684 
685  _GF_CACHEABLE_ARRAY_TYPE_DEF_(float, CacheableFloatArray);
690  _GF_CACHEABLE_ARRAY_TYPE_(float, CacheableFloatArray);
691 
692  _GF_CACHEABLE_ARRAY_TYPE_DEF_(int16_t, CacheableInt16Array);
697  _GF_CACHEABLE_ARRAY_TYPE_(int16_t, CacheableInt16Array);
698 
699  _GF_CACHEABLE_ARRAY_TYPE_DEF_(int32_t, CacheableInt32Array);
704  _GF_CACHEABLE_ARRAY_TYPE_(int32_t, CacheableInt32Array);
705 
706  _GF_CACHEABLE_ARRAY_TYPE_DEF_(int64_t, CacheableInt64Array);
711  _GF_CACHEABLE_ARRAY_TYPE_(int64_t, CacheableInt64Array);
712 
713  _GF_CACHEABLE_ARRAY_TYPE_DEF_(CacheableStringPtr, CacheableStringArray);
718  _GF_CACHEABLE_ARRAY_TYPE_(CacheableStringPtr, CacheableStringArray);
719 
720 
721  // Instantiations for container types (Vector/HashMap/HashSet) Cacheables
722 
723  _GF_CACHEABLE_CONTAINER_TYPE_DEF_(_VectorOfCacheable, CacheableVector);
728  _GF_CACHEABLE_CONTAINER_TYPE_(_VectorOfCacheable, CacheableVector);
729 
730  _GF_CACHEABLE_CONTAINER_TYPE_DEF_(_HashMapOfCacheable, CacheableHashMap);
735  _GF_CACHEABLE_CONTAINER_TYPE_(_HashMapOfCacheable, CacheableHashMap);
736 
737  _GF_CACHEABLE_CONTAINER_TYPE_DEF_(_HashSetOfCacheableKey, CacheableHashSet);
742  _GF_CACHEABLE_CONTAINER_TYPE_(_HashSetOfCacheableKey, CacheableHashSet);
743 
744  _GF_CACHEABLE_CONTAINER_TYPE_DEF_(_VectorOfCacheable, CacheableArrayList);
749  _GF_CACHEABLE_CONTAINER_TYPE_(_VectorOfCacheable, CacheableArrayList);
750 
751  //linketlist for JSON formattor issue
752  _GF_CACHEABLE_CONTAINER_TYPE_DEF_(_VectorOfCacheable, CacheableLinkedList);
757  _GF_CACHEABLE_CONTAINER_TYPE_(_VectorOfCacheable, CacheableLinkedList);
758 
759  _GF_CACHEABLE_CONTAINER_TYPE_DEF_(_VectorOfCacheable, CacheableStack);
764  _GF_CACHEABLE_CONTAINER_TYPE_(_VectorOfCacheable, CacheableStack);
765 
766  _GF_CACHEABLE_CONTAINER_TYPE_DEF_(_HashMapOfCacheable, CacheableHashTable);
771  _GF_CACHEABLE_CONTAINER_TYPE_(_HashMapOfCacheable, CacheableHashTable);
772 
773  _GF_CACHEABLE_CONTAINER_TYPE_DEF_(_HashMapOfCacheable,
782  _GF_CACHEABLE_CONTAINER_TYPE_(_HashMapOfCacheable,
784 
785  _GF_CACHEABLE_CONTAINER_TYPE_DEF_(_HashSetOfCacheableKey,
794  _GF_CACHEABLE_CONTAINER_TYPE_(_HashSetOfCacheableKey,
796 }
797 
798 
799 #endif // _GEMFIRE_CACHEABLE_BUILTINS_HPP_
A mutable CacheableKey to Serializable hash map that can serve as a distributable object for caching...
Definition: CacheableBuiltins.hpp:783
An immutable wrapper for array of booleans that can serve as a distributable object for caching...
Definition: CacheableBuiltins.hpp:610
virtual void toData(DataOutput &output) const
Serialize this object to the given DataOutput.
Definition: CacheableBuiltins.hpp:406
Vector template type class.
Definition: VectorT.hpp:24
Class encapsulating a NULL SharedBase smart pointer.
Definition: SharedBase.hpp:78
Provide operations for writing primitive data values, byte arrays, strings, Serializable objects to a...
Definition: DataOutput.hpp:62
virtual uint32_t objectSize() const
Return the size in bytes of the instance being serialized.
Definition: CacheableBuiltins.hpp:313
A mutable Cacheable stack wrapper that can serve as a distributable object for caching.
Definition: CacheableBuiltins.hpp:764
TObj value() const
Gets the contained value.
Definition: CacheableBuiltins.hpp:53
An immutable wrapper for 16-bit integers that can serve as a distributable key object for caching...
Definition: CacheableBuiltins.hpp:638
SharedArrayPtr()
Default constructor.
Definition: CacheableBuiltins.hpp:334
void copyArray(TObj *dest, const TObj *src, int32_t length)
Function to copy an array from source to destination.
Definition: CacheableBuiltins.hpp:158
An immutable wrapper for bytes that can serve as a distributable key object for caching.
Definition: CacheableBuiltins.hpp:617
Represents a cacheable key.
Definition: CacheableKey.hpp:23
A mutable CacheableKey hash set wrapper that can serve as a distributable object for caching...
Definition: CacheableBuiltins.hpp:795
Template class for CacheableArrayType SharedPtr&#39;s that adds [] operator.
Definition: CacheableBuiltins.hpp:154
An immutable wrapper for array of 64-bit integers that can serve as a distributable object for cachin...
Definition: CacheableBuiltins.hpp:711
virtual uint32_t objectSize() const
Return the size in bytes of the instance being serialized.
Definition: CacheableBuiltins.hpp:147
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:102
virtual int32_t classId() const
Return the classId of the instance being serialized.
Definition: CacheableBuiltins.hpp:289
Serializable * fromData(DataInput &input)
Deserialize self.
Definition: CacheableBuiltins.hpp:379
An immutable wrapper for array of floats that can serve as a distributable object for caching...
Definition: CacheableBuiltins.hpp:690
An immutable wrapper for 32-bit integers that can serve as a distributable key object for caching...
Definition: CacheableBuiltins.hpp:645
virtual bool operator==(const CacheableKey &other) const
Return true if this key matches other.
Definition: CacheableBuiltins.hpp:112
virtual int8_t typeId() const
Return the typeId byte of the instance being serialized.
Definition: CacheableBuiltins.hpp:90
An immutable wrapper for array of doubles that can serve as a distributable object for caching...
Definition: CacheableBuiltins.hpp:683
A mutable CacheableKey hash set wrapper that can serve as a distributable object for caching...
Definition: CacheableBuiltins.hpp:742
A mutable CacheableKey to Serializable hash map that can serve as a distributable object for caching...
Definition: CacheableBuiltins.hpp:771
Template class for array of primitive types.
Definition: CacheableBuiltins.hpp:191
virtual uint32_t hashcode() const
Return the hashcode for this key.
Definition: CacheableBuiltins.hpp:106
This namespace contains all the GemFire C++ API classes, enumerations and globals.
Definition: Assert.hpp:19
SharedArrayPtr(const TArray *ptr)
Constructor, given a pointer to array.
Definition: CacheableBuiltins.hpp:340
HashMap of TKEY to TVAL.
Definition: HashMapT.hpp:26
An immutable wrapper for array of 32-bit integers that can serve as a distributable object for cachin...
Definition: CacheableBuiltins.hpp:704
SharedArrayPtr(const SharedArrayPtr &other)
Constructor, given another SharedArrayPtr.
Definition: CacheableBuiltins.hpp:352
virtual Serializable * fromData(DataInput &input)
Deserialize this object from given DataInput.
Definition: CacheableBuiltins.hpp:67
#define GF_SAFE_DELETE_ARRAY(x)
Deletes array x only if it exists.
Definition: gf_base.hpp:334
An immutable wrapper for array of 16-bit integers that can serve as a distributable object for cachin...
Definition: CacheableBuiltins.hpp:697
Template class for container Cacheable types.
Definition: CacheableBuiltins.hpp:387
virtual Serializable * fromData(DataInput &input)
Deserialize this object from the given DataInput.
Definition: CacheableBuiltins.hpp:276
An immutable wrapper for array of wide-characters that can serve as a distributable object for cachin...
Definition: CacheableBuiltins.hpp:667
An immutable wrapper for booleans that can serve as a distributable key object for caching...
Definition: CacheableBuiltins.hpp:603
An immutable wrapper for 64-bit integers that can serve as a distributable key object for caching...
Definition: CacheableBuiltins.hpp:652
virtual int32_t classId() const
Return the classId of the instance being serialized.
Definition: CacheableBuiltins.hpp:424
virtual int8_t typeId() const
Return the typeId byte of the instance being serialized.
Definition: CacheableBuiltins.hpp:300
A mutable Cacheable array list wrapper that can serve as a distributable object for caching...
Definition: CacheableBuiltins.hpp:757
An immutable wrapper for floats that can serve as a distributable key object for caching.
Definition: CacheableBuiltins.hpp:631
virtual Serializable * fromData(DataInput &input)
Deserialize this object from the given DataInput.
Definition: CacheableBuiltins.hpp:412
A mutable CacheableKey to Serializable hash map that can serve as a distributable object for caching...
Definition: CacheableBuiltins.hpp:735
This abstract base class is the superclass of all user objects in the cache that can be serialized...
Definition: Serializable.hpp:39
An immutable wrapper for byte arrays that can serve as a distributable object for caching...
Definition: CacheableBuiltins.hpp:676
virtual int8_t typeId() const
return the typeId byte of the instance being serialized.
virtual void toData(DataOutput &output) const
Serialize this object to given DataOutput.
Definition: CacheableBuiltins.hpp:61
Provide operations for reading primitive data values, byte arrays, strings, Serializable objects from...
Definition: DataInput.hpp:44
virtual CacheableStringPtr toString() const
Return a string representation of the object.
Definition: CacheableBuiltins.hpp:96
SharedArrayPtr(const SharedArrayPtr< TOther, OTHERID > &other)
Constructor, given another kind of SharedArrayPtr.
Definition: CacheableBuiltins.hpp:359
virtual int32_t classId() const
Return the classId of the instance being serialized.
Definition: CacheableBuiltins.hpp:79
virtual uint32_t objectSize() const
Return the size in bytes of the instance being serialized.
Definition: CacheableBuiltins.hpp:448
virtual int8_t typeId() const
Return the typeId byte of the instance being serialized.
Definition: CacheableBuiltins.hpp:435
An immutable wrapper for array of strings that can serve as a distributable object for caching...
Definition: CacheableBuiltins.hpp:718
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:132
A mutable Cacheable array list wrapper that can serve as a distributable object for caching...
Definition: CacheableBuiltins.hpp:749
SharedArrayPtr(const SharedPtr< TOther > &other)
Constructor, given another SharedPtr.
Definition: CacheableBuiltins.hpp:366
An immutable wrapper for wide-characters that can serve as a distributable key object for caching...
Definition: CacheableBuiltins.hpp:659
A mutable Cacheable vector wrapper that can serve as a distributable object for caching.
Definition: CacheableBuiltins.hpp:728
int gf_snprintf(char *buffer, int32_t maxLength, const char *fmt,...)
snprintf implementation.
An immutable wrapper for doubles that can serve as a distributable key object for caching...
Definition: CacheableBuiltins.hpp:624
virtual void toData(DataOutput &output) const
Serialize this object to the given DataOutput.
Definition: CacheableBuiltins.hpp:270
#define GF_NEW(v, stmt)
Allocates x and throws OutOfMemoryException if it fails.
Definition: gf_base.hpp:315
SharedArrayPtr(const NullSharedBase *ptr)
Constructor, given a null SharedBase.
Definition: CacheableBuiltins.hpp:346
int gf_sprintf(char *buffer, const char *fmt,...)
sprintf implementation.
Template CacheableKey class for primitive types.
Definition: CacheableBuiltins.hpp:36
const TObj * value() const
Get the underlying array.
Definition: CacheableBuiltins.hpp:246
HashSet of TKEY.
Definition: HashSetT.hpp:24
int32_t length() const
Get the length of the array.
Definition: CacheableBuiltins.hpp:252

GemFire C++ Cache API Documentation