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

00001 #ifndef __GEMFIRE_PDXINSTANCE_HPP_
00002 #define __GEMFIRE_PDXINSTANCE_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 "PdxSerializable.hpp"
00013 #include "CacheableBuiltins.hpp"
00014 #include "PdxFieldTypes.hpp"
00015 
00016 namespace gemfire {
00017 
00034   class CPPCACHE_EXPORT PdxInstance : public PdxSerializable
00035   {
00036 
00037   public:    
00041     virtual ~PdxInstance(){      
00042     }
00043 
00051     virtual PdxSerializablePtr getObject() = 0;
00052 
00060     virtual bool hasField(const char *fieldname) = 0;
00061 
00073     virtual void getField(const char *fieldname, CacheablePtr& value) const = 0;
00074 
00084     virtual void getField(const char *fieldname, bool& value)const = 0;
00085 
00097     virtual void getField(const char *fieldname, signed char& value)const = 0;
00098 
00110     virtual void getField(const char *fieldname, unsigned char& value)const = 0;
00111 
00121     virtual void getField (const char *fieldname, int16_t& value)const = 0;
00122 
00130     virtual void getField (const char *fieldname, int32_t& value)const = 0;
00131 
00141     virtual void getField (const char *fieldname, int64_t& value)const = 0;
00142 
00152     virtual void getField (const char *fieldname, float& value)const = 0;
00153 
00163     virtual void getField (const char *fieldname, double& value)const = 0;
00164 
00174     virtual void getField (const char* fieldName, wchar_t& value)const = 0; 
00175 
00185     virtual void getField (const char* fieldName, char& value)const = 0; 
00186 
00197     virtual void getField (const char *fieldname, bool** value, int32_t& length)const = 0;
00198 
00211     virtual void getField (const char *fieldname, signed char** value, int32_t& length)const = 0;
00212 
00225     virtual void getField (const char *fieldname, unsigned char** value, int32_t& length)const = 0;
00226 
00237     virtual void getField (const char *fieldname, int16_t** value, int32_t& length)const = 0;
00238 
00249     virtual void getField (const char *fieldname, int32_t** value, int32_t& length)const = 0;
00250 
00261     virtual void getField (const char *fieldname, int64_t** value, int32_t& length)const = 0;
00262 
00273     virtual void getField (const char *fieldname, float** value, int32_t& length)const = 0;
00274 
00285     virtual void getField (const char *fieldname, double** value, int32_t& length)const = 0;
00286 
00287     //charArray
00298     virtual void getField(const char* fieldName, wchar_t** value, int32_t& length)const = 0;
00299 
00310     virtual void getField(const char* fieldName, char** value, int32_t& length)const = 0;
00311 
00312     //String
00322     virtual void getField (const char *fieldname, wchar_t** value)const = 0;
00323 
00333     virtual void getField (const char *fieldname, char** value)const = 0;
00334 
00335     //StringArray
00346     virtual void getField (const char *fieldname, wchar_t*** value, int32_t& length)const = 0;
00347 
00358     virtual void getField (const char *fieldname, char*** value, int32_t& length)const = 0;
00359 
00369     virtual void getField(const char *fieldname, CacheableDatePtr& value)const = 0;
00370 
00382     virtual void getField(const char* fieldName, int8_t*** value, int32_t& arrayLength, int32_t*& elementLength)const = 0;
00383 
00395     virtual void getField(const char *fieldname, CacheableObjectArrayPtr& value)const = 0;
00396 
00404     virtual bool isIdentityField(const char * fieldname) = 0;
00405 
00413     virtual WritablePdxInstancePtr createWriter() = 0;
00414 
00430     virtual uint32_t hashcode( ) const = 0;
00431 
00432 
00442     virtual CacheableStringPtr toString() const = 0;
00443 
00447     virtual void toData( DataOutput& output ) const {
00448       PdxSerializable::toData(output);
00449     }
00450 
00455     virtual Serializable* fromData( DataInput& input ) {
00456       return PdxSerializable::fromData(input);
00457     }
00458 
00491     virtual bool operator==(const CacheableKey& other) const = 0;
00492 
00497     virtual uint32_t objectSize() const = 0;
00498 
00503     virtual CacheableStringArrayPtr getFieldNames() = 0; 
00504 
00505     //From PdxSerializable
00510     virtual void toData( PdxWriterPtr output ) = 0;
00511 
00516     virtual void fromData( PdxReaderPtr input ) = 0;
00517 
00524     virtual const char* getClassName()const = 0;        
00525 
00532         virtual PdxFieldTypes::PdxFieldType getFieldType(const char *fieldname) const = 0;
00533 
00534   protected:
00538     PdxInstance(){
00539     }
00540 
00541   private:
00542     // never implemented.
00543     PdxInstance(const PdxInstance& other);
00544     void operator =(const PdxInstance& other);
00545   };
00546 
00547 }
00548 #endif /* __GEMFIRE_PDXINSTANCE_HPP_ */

GemFire C++ Cache API Documentation