VMware GemFire Native Client Cache Reference  9.0.6
PdxInstance.hpp
1 #ifndef __GEMFIRE_PDXINSTANCE_HPP_
2 #define __GEMFIRE_PDXINSTANCE_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 "PdxSerializable.hpp"
13 #include "CacheableBuiltins.hpp"
14 #include "PdxFieldTypes.hpp"
15 
16 namespace gemfire {
17 
34  class CPPCACHE_EXPORT PdxInstance : public PdxSerializable
35  {
36 
37  public:
41  virtual ~PdxInstance(){
42  }
43 
51  virtual PdxSerializablePtr getObject() = 0;
52 
60  virtual bool hasField(const char *fieldname) = 0;
61 
73  virtual void getField(const char *fieldname, CacheablePtr& value) const = 0;
74 
84  virtual void getField(const char *fieldname, bool& value)const = 0;
85 
97  virtual void getField(const char *fieldname, signed char& value)const = 0;
98 
110  virtual void getField(const char *fieldname, unsigned char& value)const = 0;
111 
121  virtual void getField (const char *fieldname, int16_t& value)const = 0;
122 
130  virtual void getField (const char *fieldname, int32_t& value)const = 0;
131 
141  virtual void getField (const char *fieldname, int64_t& value)const = 0;
142 
152  virtual void getField (const char *fieldname, float& value)const = 0;
153 
163  virtual void getField (const char *fieldname, double& value)const = 0;
164 
174  virtual void getField (const char* fieldName, wchar_t& value)const = 0;
175 
185  virtual void getField (const char* fieldName, char& value)const = 0;
186 
197  virtual void getField (const char *fieldname, bool** value, int32_t& length)const = 0;
198 
211  virtual void getField (const char *fieldname, signed char** value, int32_t& length)const = 0;
212 
225  virtual void getField (const char *fieldname, unsigned char** value, int32_t& length)const = 0;
226 
237  virtual void getField (const char *fieldname, int16_t** value, int32_t& length)const = 0;
238 
249  virtual void getField (const char *fieldname, int32_t** value, int32_t& length)const = 0;
250 
261  virtual void getField (const char *fieldname, int64_t** value, int32_t& length)const = 0;
262 
273  virtual void getField (const char *fieldname, float** value, int32_t& length)const = 0;
274 
285  virtual void getField (const char *fieldname, double** value, int32_t& length)const = 0;
286 
287  //charArray
298  virtual void getField(const char* fieldName, wchar_t** value, int32_t& length)const = 0;
299 
310  virtual void getField(const char* fieldName, char** value, int32_t& length)const = 0;
311 
312  //String
322  virtual void getField (const char *fieldname, wchar_t** value)const = 0;
323 
333  virtual void getField (const char *fieldname, char** value)const = 0;
334 
335  //StringArray
346  virtual void getField (const char *fieldname, wchar_t*** value, int32_t& length)const = 0;
347 
358  virtual void getField (const char *fieldname, char*** value, int32_t& length)const = 0;
359 
369  virtual void getField(const char *fieldname, CacheableDatePtr& value)const = 0;
370 
382  virtual void getField(const char* fieldName, int8_t*** value, int32_t& arrayLength, int32_t*& elementLength)const = 0;
383 
395  virtual void getField(const char *fieldname, CacheableObjectArrayPtr& value)const = 0;
396 
404  virtual bool isIdentityField(const char * fieldname) = 0;
405 
413  virtual WritablePdxInstancePtr createWriter() = 0;
414 
430  virtual uint32_t hashcode( ) const = 0;
431 
432 
442  virtual CacheableStringPtr toString() const = 0;
443 
447  virtual void toData( DataOutput& output ) const {
448  PdxSerializable::toData(output);
449  }
450 
455  virtual Serializable* fromData( DataInput& input ) {
456  return PdxSerializable::fromData(input);
457  }
458 
491  virtual bool operator==(const CacheableKey& other) const = 0;
492 
497  virtual uint32_t objectSize() const = 0;
498 
503  virtual CacheableStringArrayPtr getFieldNames() = 0;
504 
505  //From PdxSerializable
510  virtual void toData( PdxWriterPtr output ) = 0;
511 
516  virtual void fromData( PdxReaderPtr input ) = 0;
517 
524  virtual const char* getClassName()const = 0;
525 
532  virtual PdxFieldTypes::PdxFieldType getFieldType(const char *fieldname) const = 0;
533 
534  protected:
539  }
540 
541  private:
542  // never implemented.
543  PdxInstance(const PdxInstance& other);
544  void operator =(const PdxInstance& other);
545  };
546 
547 }
548 #endif /* __GEMFIRE_PDXINSTANCE_HPP_ */
virtual void toData(DataOutput &output) const
serialize this object.
Definition: PdxInstance.hpp:447
Provide operations for writing primitive data values, byte arrays, strings, Serializable objects to a...
Definition: DataOutput.hpp:62
virtual Serializable * fromData(DataInput &input)
deserialize this object, typical implementation should return the 'this' pointer. ...
Definition: PdxInstance.hpp:455
Contains generic template definitions for Cacheable types and instantiations for built-in types...
PdxInstance()
constructors
Definition: PdxInstance.hpp:538
Represents a cacheable key.
Definition: CacheableKey.hpp:23
Template class for CacheableArrayType SharedPtr's that adds [] operator.
Definition: CacheableBuiltins.hpp:154
This namespace contains all the GemFire C++ API classes, enumerations and globals.
Definition: Assert.hpp:19
PdxInstance provides run time access to the fields of a PDX without deserializing the PDX...
Definition: PdxInstance.hpp:34
This abstract base class is the superclass of all user objects in the cache that can be serialized...
Definition: Serializable.hpp:39
Provide operations for reading primitive data values, byte arrays, strings, Serializable objects from...
Definition: DataInput.hpp:44
virtual ~PdxInstance()
destructor
Definition: PdxInstance.hpp:41
#define CPPCACHE_EXPORT
Defines a GemFire CPPCACHE export.
Definition: gf_base.hpp:51
Defines a reference counted shared pointer.
Definition: SharedPtr.hpp:35

GemFire C++ Cache API Documentation