Pivotal GemFire Native Client Cache Reference  9.0.6
PdxSerializable.hpp
1 #ifndef __GEMFIRE_PDXSERIALIZABLE_H__
2 #define __GEMFIRE_PDXSERIALIZABLE_H__
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 "CacheableKey.hpp"
13 
14 namespace gemfire
15 {
16 
17 typedef PdxSerializable* ( *PdxTypeFactoryMethod ) ();
18 
19 class CPPCACHE_EXPORT PdxSerializable : public CacheableKey
20 {
21 
22 public:
23 
24  PdxSerializable();
25  virtual ~PdxSerializable();
26 
27  // for virtual overloads bring base toData/fromData in scope otherwise
28  // child classes won't be able to override as desired
29  // Solaris compiler gives "hides the virtual function" warnings when
30  // compiling child classes while other compilers silently
31  // accept but will cause problems with overloaded calls (in this case
32  // no implicit conversion from PdxWriterPtr to DataOutput etc exists
33  // so no imminent danger)
34  // see http://www.parashift.com/c++-faq-lite/hiding-rule.html
35  // http://www.oracle.com/technetwork/server-storage/solarisstudio/documentation/cplusplus-faq-355066.html#Coding1
36  //using Serializable::toData;
37  //using Serializable::fromData;
38 
43  virtual void toData( PdxWriterPtr output ) /*const*/ = 0;
44 
49  virtual void fromData( PdxReaderPtr input ) = 0;
50 
59  virtual int8_t typeId( ) const;
60 
62  virtual bool operator==( const CacheableKey& other ) const;
63 
65  virtual uint32_t hashcode( ) const;
66 
70  virtual void toData( DataOutput& output ) const;
71 
76  virtual Serializable* fromData( DataInput& input );
77 
83  virtual int32_t classId( ) const { return 0x10; }
84 
94  virtual CacheableStringPtr toString() const;
95 
99  virtual const char* getClassName()const = 0;
100 };
101 }
102 
103 #endif /* PDXSERIALIZABLE_HPP_ */
This namespace contains all the GemFire C++ API classes, enumerations and globals.
Definition: Assert.hpp:19
#define CPPCACHE_EXPORT
Defines a GemFire CPPCACHE export.
Definition: gf_base.hpp:51

GemFire C++ Cache API Documentation