VMware VMware GemFire Native C++ Reference 10.4.3
Loading...
Searching...
No Matches
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
27namespace apache {
28namespace geode {
29namespace client {
30
31class CacheableObjectArray;
32class PdxSerializer;
33class PdxUnreadFields;
34
41class 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
163 virtual PdxWriter& writeDate(const std::string& fieldName,
164 std::shared_ptr<CacheableDate> date) = 0;
165
176 virtual PdxWriter& writeString(const std::string& fieldName,
177 const std::string& value) = 0;
178
196 virtual PdxWriter& writeObject(const std::string& fieldName,
197 std::shared_ptr<Cacheable> value) = 0;
198
209 virtual PdxWriter& writeBooleanArray(const std::string& fieldName,
210 const std::vector<bool>& array) = 0;
211
222 virtual PdxWriter& writeCharArray(const std::string& fieldName,
223 const std::vector<char16_t>& array) = 0;
224
235 virtual PdxWriter& writeByteArray(const std::string& fieldName,
236 const std::vector<int8_t>& array) = 0;
237
248 virtual PdxWriter& writeShortArray(const std::string& fieldName,
249 const std::vector<int16_t>& array) = 0;
250
261 virtual PdxWriter& writeIntArray(const std::string& fieldName,
262 const std::vector<int32_t>& array) = 0;
263
274 virtual PdxWriter& writeLongArray(const std::string& fieldName,
275 const std::vector<int64_t>& array) = 0;
276
287 virtual PdxWriter& writeFloatArray(const std::string& fieldName,
288 const std::vector<float>& array) = 0;
289
300 virtual PdxWriter& writeDoubleArray(const std::string& fieldName,
301 const std::vector<double>& array) = 0;
302
314 const std::string& fieldName, const std::vector<std::string>& array) = 0;
315
331 const std::string& fieldName,
332 std::shared_ptr<CacheableObjectArray> array) = 0;
333
347 virtual PdxWriter& writeArrayOfByteArrays(const std::string& fieldName,
348 int8_t* const* const array,
349 int arrayLength,
350 const int* elementLength) = 0;
351
375 virtual PdxWriter& markIdentityField(const std::string& fieldName) = 0;
376
390 std::shared_ptr<PdxUnreadFields> unread) = 0;
391
392 virtual std::shared_ptr<PdxSerializer> getPdxSerializer() const = 0;
393};
394} // namespace client
395} // namespace geode
396} // namespace apache
397
398#endif // GEODE_PDXWRITER_H_
Contains generic template definitions for Cacheable types and instantiations for built-in types.
A PdxWriter will be passed to PdxSerializable.toData when it is serializing the domain class.
Definition PdxWriter.hpp:41
virtual PdxWriter & writeBoolean(const std::string &fieldName, bool value)=0
Writes the named field with the given value to the serialized form.
virtual PdxWriter & writeShortArray(const std::string &fieldName, const std::vector< int16_t > &array)=0
Writes the named field with the given value to the serialized form.
virtual PdxWriter & writeLongArray(const std::string &fieldName, const std::vector< int64_t > &array)=0
Writes the named field with the given value to the serialized form.
virtual PdxWriter & writeFloat(const std::string &fieldName, float value)=0
Writes the named field with the given value to the serialized form.
virtual PdxWriter & writeDoubleArray(const std::string &fieldName, const std::vector< double > &array)=0
Writes the named field with the given value to the serialized form.
virtual PdxWriter & writeFloatArray(const std::string &fieldName, const std::vector< float > &array)=0
Writes the named field with the given value to the serialized form.
virtual PdxWriter & writeObject(const std::string &fieldName, std::shared_ptr< Cacheable > value)=0
Writes the named field with the given value to the serialized form.
virtual PdxWriter & writeUnreadFields(std::shared_ptr< PdxUnreadFields > unread)=0
Writes the given unread fields to the serialized form.
virtual PdxWriter & writeDouble(const std::string &fieldName, double value)=0
Writes the named field with the given value to the serialized form.
virtual PdxWriter & writeLong(const std::string &fieldName, int64_t value)=0
Writes the named field with the given value to the serialized form.
virtual PdxWriter & writeString(const std::string &fieldName, const std::string &value)=0
Writes the named field with the given value to the serialized form.
virtual PdxWriter & writeShort(const std::string &fieldName, int16_t value)=0
Writes the named field with the given value to the serialized form.
virtual PdxWriter & writeCharArray(const std::string &fieldName, const std::vector< char16_t > &array)=0
Writes the named field with the given value to the serialized form.
virtual PdxWriter & writeStringArray(const std::string &fieldName, const std::vector< std::string > &array)=0
Writes the named field with the given value to the serialized form.
virtual PdxWriter & writeBooleanArray(const std::string &fieldName, const std::vector< bool > &array)=0
Writes the named field with the given value to the serialized form.
virtual PdxWriter & writeInt(const std::string &fieldName, int32_t value)=0
Writes the named field with the given value to the serialized form.
PdxWriter()=default
constructors
virtual PdxWriter & writeDate(const std::string &fieldName, std::shared_ptr< CacheableDate > date)=0
Writes the named field with the given value to the serialized form.
virtual ~PdxWriter()=default
destructor
virtual PdxWriter & writeObjectArray(const std::string &fieldName, std::shared_ptr< CacheableObjectArray > array)=0
Writes the named field with the given value to the serialized form.
virtual PdxWriter & writeArrayOfByteArrays(const std::string &fieldName, int8_t *const *const array, int arrayLength, const int *elementLength)=0
Writes the named field with the given value to the serialized form.
virtual PdxWriter & writeByteArray(const std::string &fieldName, const std::vector< int8_t > &array)=0
Writes the named field with the given value to the serialized form.
virtual PdxWriter & writeByte(const std::string &fieldName, int8_t value)=0
Writes the named field with the given value to the serialized form.
virtual PdxWriter & writeChar(const std::string &fieldName, char16_t value)=0
Writes the named field with the given value to the serialized form The fields type is char16_t
virtual PdxWriter & markIdentityField(const std::string &fieldName)=0
Indicate that the given field name should be included in hashCode and equals checks of this object on...
virtual PdxWriter & writeIntArray(const std::string &fieldName, const std::vector< int32_t > &array)=0
Writes the named field with the given value to the serialized form.

Apache Geode C++ Cache API Documentation