VMware GemFire Native Client Cache Reference  9.0.6
PdxWrapper.hpp
1 #ifndef _PDXWRAPPER_HPP_
2 #define _PDXWRAPPER_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 
12 #include "PdxSerializer.hpp"
13 #include "PdxSerializable.hpp"
14 
15 namespace gemfire {
16 
17 class CPPCACHE_EXPORT PdxWrapper : public PdxSerializable {
18 
25 public:
26 
32  PdxWrapper(void * userObject, const char * className);
33 
39  void * getObject(bool detach = false);
40 
44  const char * getClassName() const;
45 
47  bool operator==( const CacheableKey& other ) const;
48 
50  uint32_t hashcode( ) const;
51 
56  void toData( PdxWriterPtr output );
61  void fromData( PdxReaderPtr input );
65  void toData( DataOutput& output ) const;
70  Serializable* fromData( DataInput& input );
76  int32_t classId( ) const { return 0; }
85  uint32_t objectSize() const;
95  CacheableStringPtr toString( ) const;
96 
97  virtual ~PdxWrapper();
98 
99 private:
100 
102  PdxWrapper();
103  PdxWrapper(const char * className);
104 
105  void * m_userObject;
106  PdxSerializerPtr m_serializer;
107  UserDeallocator m_deallocator;
108  UserObjectSizer m_sizer;
109  char * m_className;
110 
111  friend class SerializationRegistry;
112 
113  PdxWrapper( const PdxWrapper& );
114 
115  const PdxWrapper& operator=( const PdxWrapper& );
116 };
117 
118 } /* namespace gemfire */
119 #endif /* _PDXWRAPPER_HPP_ */
void(* UserDeallocator)(void *, const char *)
Function pointer type which takes a void pointer to an instance of a user object to delete and class ...
Definition: PdxSerializer.hpp:20
This namespace contains all the GemFire C++ API classes, enumerations and globals.
Definition: Assert.hpp:19
uint32_t(* UserObjectSizer)(void *, const char *)
Function pointer type which takes a void pointer to an instance of a user object and class name to re...
Definition: PdxSerializer.hpp:25
#define CPPCACHE_EXPORT
Defines a GemFire CPPCACHE export.
Definition: gf_base.hpp:51

GemFire C++ Cache API Documentation