Pivotal GemFire Native C++ Reference  10.1.3
PdxWriter.hpp
1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements. See the NOTICE file distributed with
4  * this work for additional information regarding copyright ownership.
5  * The ASF licenses this file to You under the Apache License, Version 2.0
6  * (the "License"); you may not use this file except in compliance with
7  * the License. You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
18 #pragma once
19 
20 #ifndef GEODE_PDXWRITER_H_
21 #define GEODE_PDXWRITER_H_
22 
23 #include "CacheableBuiltins.hpp"
24 #include "CacheableDate.hpp"
25 #include "internal/geode_globals.hpp"
26 
27 namespace apache {
28 namespace geode {
29 namespace client {
30 
31 class CacheableObjectArray;
32 class PdxSerializer;
33 class PdxUnreadFields;
34 
41 class APACHE_GEODE_EXPORT PdxWriter {
42  public:
46  PdxWriter() = default;
47 
48  PdxWriter(PdxWriter&& move) = default;
49 
53  virtual ~PdxWriter() = default;
54 
65  virtual PdxWriter& writeChar(const std::string& fieldName,
66  char16_t value) = 0;
67 
78  virtual PdxWriter& writeBoolean(const std::string& fieldName, bool value) = 0;
79 
90  virtual PdxWriter& writeByte(const std::string& fieldName, int8_t value) = 0;
91 
102  virtual PdxWriter& writeShort(const std::string& fieldName,
103  int16_t value) = 0;
104 
115  virtual PdxWriter& writeInt(const std::string& fieldName, int32_t value) = 0;
116 
127  virtual PdxWriter& writeLong(const std::string& fieldName, int64_t value) = 0;
128 
139  virtual PdxWriter& writeFloat(const std::string& fieldName, float value) = 0;
140 
151  virtual PdxWriter& writeDouble(const std::string& fieldName,
152  double value) = 0;
153 
164  virtual PdxWriter& writeDate(const std::string& fieldName,
165  std::shared_ptr<CacheableDate> date) = 0;
166 
177  virtual PdxWriter& writeString(const std::string& fieldName,
178  const std::string& value) = 0;
179 
197  virtual PdxWriter& writeObject(const std::string& fieldName,
198  std::shared_ptr<Cacheable> value) = 0;
199 
211  virtual PdxWriter& writeBooleanArray(const std::string& fieldName,
212  const std::vector<bool>& array) = 0;
213 
225  virtual PdxWriter& writeCharArray(const std::string& fieldName,
226  const std::vector<char16_t>& array) = 0;
227 
239  virtual PdxWriter& writeByteArray(const std::string& fieldName,
240  const std::vector<int8_t>& array) = 0;
241 
253  virtual PdxWriter& writeShortArray(const std::string& fieldName,
254  const std::vector<int16_t>& array) = 0;
255 
267  virtual PdxWriter& writeIntArray(const std::string& fieldName,
268  const std::vector<int32_t>& array) = 0;
269 
281  virtual PdxWriter& writeLongArray(const std::string& fieldName,
282  const std::vector<int64_t>& array) = 0;
283 
295  virtual PdxWriter& writeFloatArray(const std::string& fieldName,
296  const std::vector<float>& array) = 0;
297 
309  virtual PdxWriter& writeDoubleArray(const std::string& fieldName,
310  const std::vector<double>& array) = 0;
311 
323  virtual PdxWriter& writeStringArray(
324  const std::string& fieldName, const std::vector<std::string>& array) = 0;
325 
340  virtual PdxWriter& writeObjectArray(
341  const std::string& fieldName,
342  std::shared_ptr<CacheableObjectArray> array) = 0;
343 
357  virtual PdxWriter& writeArrayOfByteArrays(const std::string& fieldName,
358  int8_t* const* const array,
359  int arrayLength,
360  const int* elementLength) = 0;
361 
385  virtual PdxWriter& markIdentityField(const std::string& fieldName) = 0;
386 
399  virtual PdxWriter& writeUnreadFields(
400  std::shared_ptr<PdxUnreadFields> unread) = 0;
401 
402  virtual std::shared_ptr<PdxSerializer> getPdxSerializer() const = 0;
403 };
404 } // namespace client
405 } // namespace geode
406 } // namespace apache
407 
408 #endif // GEODE_PDXWRITER_H_
apache::geode::client::PdxWriter
A PdxWriter will be passed to PdxSerializable.toData when it is serializing the domain class.
Definition: PdxWriter.hpp:41
CacheableDate.hpp
CacheableBuiltins.hpp
Contains generic template definitions for Cacheable types and instantiations for built-in types.

Apache Geode C++ Cache API Documentation