E:/gfcppsancout/product/include/gfcpp/PdxSerializable.hpp

00001 #ifndef __GEMFIRE_PDXSERIALIZABLE_H__
00002 #define __GEMFIRE_PDXSERIALIZABLE_H__
00003 
00004 /*=========================================================================
00005 * (c) Copyright 2002-2007, GemStone Systems, Inc. All Rights Reserved.
00006 * 1260 NW Waterhouse Ave., Suite 200,  Beaverton, OR 97006
00007 *========================================================================
00008 */
00009 
00010 #include "CacheableKey.hpp"
00011 
00012 namespace gemfire
00013 {
00014 
00015 typedef PdxSerializable* ( *PdxTypeFactoryMethod ) ();
00016 
00017 class CPPCACHE_EXPORT  PdxSerializable : public CacheableKey
00018 {
00019 
00020 public:
00021 
00022   PdxSerializable();
00023   virtual ~PdxSerializable();
00024 
00029   virtual void toData( PdxWriterPtr output ) /*const*/ = 0;
00030 
00035   virtual void fromData( PdxReaderPtr input ) = 0;
00036 
00045   virtual int8_t typeId( ) const;
00046 
00048   virtual bool operator==( const CacheableKey& other ) const;
00049 
00051   virtual uint32_t hashcode( ) const;
00052 
00056   virtual void toData( DataOutput& output ) const;
00057 
00062   virtual Serializable* fromData( DataInput& input );
00063 
00069   virtual int32_t classId( ) const { return 0x10; }
00070 
00080   virtual CacheableStringPtr toString() const;
00081 
00085   virtual const char* getClassName()const = 0;
00086 };
00087 }
00088 
00089 #endif /* PDXSERIALIZABLE_HPP_ */

GemFire C++ Cache API Documentation