/export/rook2/users/build/gfcppsancout64/product/include/gfcpp/Struct.hpp

Go to the documentation of this file.
00001 #ifndef __GEMFIRE_STRUCT_H__
00002 #define __GEMFIRE_STRUCT_H__
00003 /*=========================================================================
00004  * (c) Copyright 2002-2006, GemStone Systems, Inc. All Rights Reserved.
00005  * 1260 NW Waterhouse Ave., Suite 200,  Beaverton, OR 97006
00006  *========================================================================
00007  */
00008 
00009 #include "gfcpp_globals.hpp"
00010 #include "gf_types.hpp"
00011 #include "CacheableBuiltins.hpp"
00012 #include "StructSet.hpp"
00013 #include "SelectResults.hpp"
00014 #include "Serializable.hpp"
00015 #include "VectorT.hpp"
00016 #include "HashMapT.hpp"
00017 
00022 namespace gemfire
00023 {
00024 
00025 class StructSet;
00026 
00033 class CPPCACHE_EXPORT Struct : public Serializable
00034 {
00035 
00036 public:
00037 
00041   Struct(StructSet * ssPtr, VectorT<SerializablePtr> & fieldValues);
00042 
00046   static Serializable* createDeserializable( );
00047 
00054   const SerializablePtr operator [] (int32_t index) const;
00055   
00063   const SerializablePtr operator [] (const char * fieldName) const;
00064 
00070   const StructSetPtr getStructSet() const;
00071 
00077   bool hasNext() const;
00078 
00084   int32_t length() const;
00085 
00091   const SerializablePtr next();
00092 
00096   virtual Serializable* fromData( DataInput& input );
00097 
00101   virtual void toData( DataOutput& output ) const;
00102 
00106   virtual int32_t classId( ) const;
00107 
00111   virtual int8_t typeId( ) const;
00112   
00117   virtual int8_t DSFID( ) const;
00118 
00122   virtual const char * getFieldName(int32_t index);
00123 
00127   virtual uint32_t objectSize() const {
00128     return 0;  //does not get cached, so no need to account for it
00129   }
00130   
00131 
00132 private:
00133 
00134    void skipClassName( DataInput& input );
00135 
00136    Struct( );
00137 
00138    HashMapT< CacheableStringPtr, CacheableInt32Ptr > m_fieldNames;
00139    VectorT<SerializablePtr> m_fieldValues;
00140 
00141    StructSet * m_parent;
00142 
00143    int32_t m_lastAccessIndex;
00144 };
00145 
00146 } //namespace gemfire
00147 
00148 #endif //ifndef __GEMFIRE_STRUCT_H__

GemFire C++ Cache API Documentation