VMware GemFire Native C++ Reference  9.1
Struct.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #ifndef GEODE_STRUCT_H_
4 #define GEODE_STRUCT_H_
5 
6 /*
7  * Licensed to the Apache Software Foundation (ASF) under one or more
8  * contributor license agreements. See the NOTICE file distributed with
9  * this work for additional information regarding copyright ownership.
10  * The ASF licenses this file to You under the Apache License, Version 2.0
11  * (the "License"); you may not use this file except in compliance with
12  * the License. You may obtain a copy of the License at
13  *
14  * http://www.apache.org/licenses/LICENSE-2.0
15  *
16  * Unless required by applicable law or agreed to in writing, software
17  * distributed under the License is distributed on an "AS IS" BASIS,
18  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19  * See the License for the specific language governing permissions and
20  * limitations under the License.
21  */
22 
23 #include "geode_globals.hpp"
24 #include "geode_types.hpp"
25 #include "CacheableBuiltins.hpp"
26 #include "StructSet.hpp"
27 #include "SelectResults.hpp"
28 #include "Serializable.hpp"
29 #include "VectorT.hpp"
30 #include "HashMapT.hpp"
31 
36 namespace apache {
37 namespace geode {
38 namespace client {
39 
40 class StructSet;
41 
49  public:
53  Struct(StructSet* ssPtr, VectorT<SerializablePtr>& fieldValues);
54 
58  static Serializable* createDeserializable();
59 
67  const SerializablePtr operator[](int32_t index) const;
68 
76  const SerializablePtr operator[](const char* fieldName) const;
77 
83  const StructSetPtr getStructSet() const;
84 
91  bool hasNext() const;
92 
98  int32_t length() const;
99 
106  const SerializablePtr next();
107 
111  virtual Serializable* fromData(DataInput& input);
112 
116  virtual void toData(DataOutput& output) const;
117 
121  virtual int32_t classId() const;
122 
126  virtual int8_t typeId() const;
127 
132  virtual int8_t DSFID() const;
133 
138  virtual const char* getFieldName(int32_t index);
139 
143  virtual uint32_t objectSize() const {
144  return 0; // does not get cached, so no need to account for it
145  }
146 
147  private:
148  void skipClassName(DataInput& input);
149 
150  Struct();
151 
153  VectorT<SerializablePtr> m_fieldValues;
154 
155  StructSet* m_parent;
156 
157  int32_t m_lastAccessIndex;
158 };
159 } // namespace client
160 } // namespace geode
161 } // namespace apache
162 
163 #endif // GEODE_STRUCT_H_
Each enum represents a predefined RegionAttributes in a Cache.
Definition: Assert.hpp:31
#define CPPCACHE_EXPORT
Defines a Geode CPPCACHE export.
Definition: geode_base.hpp:58
A StructSet may be obtained after executing a Query which is obtained from a QueryService which in tu...
Definition: StructSet.hpp:45
Contains generic template definitions for Cacheable types and instantiations for built-in types...
HashMap of TKEY to TVAL.
Definition: HashMapT.hpp:38
Provide operations for writing primitive data values, byte arrays, strings, Serializable objects to a...
Definition: DataOutput.hpp:74
Defines a reference counted shared pointer.
Definition: SharedPtr.hpp:52
A Struct has a StructSet as its parent.
Definition: Struct.hpp:48
This abstract base class is the superclass of all user objects in the cache that can be serialized...
Definition: Serializable.hpp:53
virtual uint32_t objectSize() const
always returns 0
Definition: Struct.hpp:143
Vector template type class.
Definition: VectorT.hpp:37
Provide operations for reading primitive data values, byte arrays, strings, Serializable objects from...
Definition: DataInput.hpp:56
This namespace contains all the Geode C++ API classes, enumerations and globals.

Pivotal GemFire C++ Cache API Documentation