VMware Tanzu GemFire Native C++ Reference 10.3.0
PdxReader.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_PDXREADER_H_
21#define GEODE_PDXREADER_H_
22
23#include "CacheableBuiltins.hpp"
24#include "PdxUnreadFields.hpp"
25
26namespace apache {
27namespace geode {
28namespace client {
29
30class CacheableDate;
31class CacheableObjectArray;
32class PdxReader;
33class PdxSerializer;
34
58class APACHE_GEODE_EXPORT PdxReader {
59 public:
64
68 virtual ~PdxReader() {}
69
79 virtual char16_t readChar(const std::string& fieldName) = 0;
80
90 virtual bool readBoolean(const std::string& fieldName) = 0;
91
101 virtual int8_t readByte(const std::string& fieldName) = 0;
102
112 virtual int16_t readShort(const std::string& fieldName) = 0;
113
123 virtual int32_t readInt(const std::string& fieldName) = 0;
124
134 virtual int64_t readLong(const std::string& fieldName) = 0;
135
145 virtual float readFloat(const std::string& fieldName) = 0;
146
156 virtual double readDouble(const std::string& fieldName) = 0;
157
168 virtual std::string readString(const std::string& fieldName) = 0;
169
179 virtual std::shared_ptr<Cacheable> readObject(
180 const std::string& fieldName) = 0;
181
191 virtual std::vector<char16_t> readCharArray(const std::string& fieldName) = 0;
192
201 virtual std::vector<bool> readBooleanArray(const std::string& fieldName) = 0;
202
212 virtual std::vector<int8_t> readByteArray(const std::string& fieldName) = 0;
213
224 virtual std::vector<int16_t> readShortArray(const std::string& fieldName) = 0;
225
236 virtual std::vector<int32_t> readIntArray(const std::string& fieldName) = 0;
237
248 virtual std::vector<int64_t> readLongArray(const std::string& fieldName) = 0;
249
259 virtual std::vector<float> readFloatArray(const std::string& fieldName) = 0;
260
270 virtual std::vector<double> readDoubleArray(const std::string& fieldName) = 0;
271
282 virtual std::vector<std::string> readStringArray(
283 const std::string& fieldName) = 0;
284
295 virtual std::shared_ptr<CacheableObjectArray> readObjectArray(
296 const std::string& fieldName) = 0;
297
311 virtual int8_t** readArrayOfByteArrays(const std::string& fieldName,
312 int32_t& arrayLength,
313 int32_t** elementLength) = 0;
314
325 virtual std::shared_ptr<CacheableDate> readDate(
326 const std::string& fieldName) = 0;
327
336 virtual bool hasField(const std::string& fieldName) = 0;
337
349 virtual bool isIdentityField(const std::string& fieldName) = 0;
350
361 virtual std::shared_ptr<PdxUnreadFields> readUnreadFields() = 0;
362
363 virtual std::shared_ptr<PdxSerializer> getPdxSerializer() const = 0;
364};
365} // namespace client
366} // namespace geode
367} // namespace apache
368
369#endif // GEODE_PDXREADER_H_
Contains generic template definitions for Cacheable types and instantiations for built-in types.
A PdxReader will be passed to PdxSerializable.fromData or during deserialization of a PDX.
Definition: PdxReader.hpp:58
virtual std::vector< float > readFloatArray(const std::string &fieldName)=0
Read a float* value from the PdxReader and sets array length.
virtual std::vector< std::string > readStringArray(const std::string &fieldName)=0
Read a array of strings from the PdxReader.
PdxReader()
constructors
Definition: PdxReader.hpp:63
virtual int8_t readByte(const std::string &fieldName)=0
Read a int8_t value from the PdxReader.
virtual bool hasField(const std::string &fieldName)=0
Checks if the named field exists and returns the result.
virtual std::vector< double > readDoubleArray(const std::string &fieldName)=0
Read a double* value from the PdxReader and sets array length.
virtual char16_t readChar(const std::string &fieldName)=0
Read a wide char value from the PdxReader.
virtual bool readBoolean(const std::string &fieldName)=0
Read a bool value from the PdxReader.
virtual int16_t readShort(const std::string &fieldName)=0
Read a int16_t value from the PdxReader.
virtual std::vector< char16_t > readCharArray(const std::string &fieldName)=0
Read a char16_t* value from the PdxReader and sets array length.
virtual std::vector< int32_t > readIntArray(const std::string &fieldName)=0
Read a int32_t* value from the PdxReader and sets array length.
virtual std::vector< int8_t > readByteArray(const std::string &fieldName)=0
Read a int8_t* value from the PdxReader and sets array length.
virtual std::vector< int16_t > readShortArray(const std::string &fieldName)=0
Read a int16_t* value from the PdxReader and sets array length.
virtual double readDouble(const std::string &fieldName)=0
Read a double value from the PdxReader.
virtual float readFloat(const std::string &fieldName)=0
Read a float value from the PdxReader.
virtual ~PdxReader()
destructor
Definition: PdxReader.hpp:68
virtual std::shared_ptr< CacheableObjectArray > readObjectArray(const std::string &fieldName)=0
Read a std::shared_ptr<CacheableObjectArray> value from the PdxReader.
virtual std::vector< int64_t > readLongArray(const std::string &fieldName)=0
Read a int64_t* value from the PdxReader and sets array length.
virtual std::string readString(const std::string &fieldName)=0
Read a std::string value from the PdxReader.
virtual std::shared_ptr< PdxUnreadFields > readUnreadFields()=0
This method returns an object that represents all the unread fields which must be passed to PdxWriter...
virtual bool isIdentityField(const std::string &fieldName)=0
Checks if the named field was PdxWriter#markIdentityFieldmarked as an identity field.
virtual std::shared_ptr< CacheableDate > readDate(const std::string &fieldName)=0
Read a std::shared_ptr<CacheableDate> value from the PdxReader.
virtual int32_t readInt(const std::string &fieldName)=0
Read a int32_t value from the PdxReader.
virtual std::vector< bool > readBooleanArray(const std::string &fieldName)=0
Read a bool* value from the PdxReader and sets array length.
virtual std::shared_ptr< Cacheable > readObject(const std::string &fieldName)=0
Read a std::shared_ptr<Cacheable> value from the PdxReader.
virtual int64_t readLong(const std::string &fieldName)=0
Read a int64_t value from the PdxReader.
virtual int8_t ** readArrayOfByteArrays(const std::string &fieldName, int32_t &arrayLength, int32_t **elementLength)=0
Read a int8_t** value from the PdxReader and sets ArrayOfByteArray's length and individual ByteArray'...

Apache Geode C++ Cache API Documentation