build-artifacts/win/product/include/gfcpp/PdxWrapper.hpp

00001 #ifndef _PDXWRAPPER_HPP_
00002 #define _PDXWRAPPER_HPP_
00003 
00004 /*=========================================================================
00005 * Copyright (c) 2002-2014 Pivotal Software, Inc. All Rights Reserved.
00006  * This product is protected by U.S. and international copyright
00007  * and intellectual property laws. Pivotal products are covered by
00008  * more patents listed at http://www.pivotal.io/patents.
00009 *========================================================================
00010 */
00011 
00012 #include "PdxSerializer.hpp"
00013 #include "PdxSerializable.hpp"
00014 
00015 namespace gemfire {
00016 
00017 class CPPCACHE_EXPORT PdxWrapper : public PdxSerializable {
00018 
00025 public:
00026 
00032   PdxWrapper(void * userObject, const char * className);
00033 
00039   void * getObject(bool detach = false);
00040 
00044   const char * getClassName() const;
00045 
00047   bool operator==( const CacheableKey& other ) const;
00048 
00050   uint32_t hashcode( ) const;
00051 
00056   void toData( PdxWriterPtr output );
00061   void fromData( PdxReaderPtr input );
00065   void toData( DataOutput& output ) const;
00070   Serializable* fromData( DataInput& input );
00076   int32_t classId( ) const { return 0; }
00085   uint32_t objectSize() const;
00095   CacheableStringPtr toString( ) const;
00096 
00097   virtual ~PdxWrapper();
00098 
00099 private:
00100 
00102   PdxWrapper();
00103   PdxWrapper(const char * className);
00104 
00105   void * m_userObject;
00106   PdxSerializerPtr m_serializer;
00107   UserDeallocator m_deallocator;
00108   UserObjectSizer m_sizer;
00109   char * m_className;
00110 
00111   friend class SerializationRegistry;
00112 
00113   PdxWrapper( const PdxWrapper& );
00114   
00115   const PdxWrapper& operator=( const PdxWrapper& );
00116 };
00117 
00118 } /* namespace gemfire */
00119 #endif /* _PDXWRAPPER_HPP_ */

GemFire C++ Cache API Documentation