VMware Tanzu GemFire Native C++ Reference  10.1.5
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 
26 namespace apache {
27 namespace geode {
28 namespace client {
29 
30 class CacheableDate;
31 class CacheableObjectArray;
32 class PdxReader;
33 class PdxSerializer;
34 
58 class APACHE_GEODE_EXPORT PdxReader {
59  public:
63  PdxReader() {}
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 
192  virtual std::vector<char16_t> readCharArray(const std::string& fieldName) = 0;
193 
203  virtual std::vector<bool> readBooleanArray(const std::string& fieldName) = 0;
204 
215  virtual std::vector<int8_t> readByteArray(const std::string& fieldName) = 0;
216 
228  virtual std::vector<int16_t> readShortArray(const std::string& fieldName) = 0;
229 
241  virtual std::vector<int32_t> readIntArray(const std::string& fieldName) = 0;
242 
254  virtual std::vector<int64_t> readLongArray(const std::string& fieldName) = 0;
255 
266  virtual std::vector<float> readFloatArray(const std::string& fieldName) = 0;
267 
278  virtual std::vector<double> readDoubleArray(const std::string& fieldName) = 0;
279 
290  virtual std::vector<std::string> readStringArray(
291  const std::string& fieldName) = 0;
292 
303  virtual std::shared_ptr<CacheableObjectArray> readObjectArray(
304  const std::string& fieldName) = 0;
305 
319  virtual int8_t** readArrayOfByteArrays(const std::string& fieldName,
320  int32_t& arrayLength,
321  int32_t** elementLength) = 0;
322 
333  virtual std::shared_ptr<CacheableDate> readDate(
334  const std::string& fieldName) = 0;
335 
344  virtual bool hasField(const std::string& fieldName) = 0;
345 
357  virtual bool isIdentityField(const std::string& fieldName) = 0;
358 
369  virtual std::shared_ptr<PdxUnreadFields> readUnreadFields() = 0;
370 
371  virtual std::shared_ptr<PdxSerializer> getPdxSerializer() const = 0;
372 };
373 } // namespace client
374 } // namespace geode
375 } // namespace apache
376 
377 #endif // GEODE_PDXREADER_H_
apache::geode::client::PdxReader::readShort
virtual int16_t readShort(const std::string &fieldName)=0
Read a int16_t value from the PdxReader.
apache::geode::client::PdxReader::readBoolean
virtual bool readBoolean(const std::string &fieldName)=0
Read a bool value from the PdxReader.
apache::geode::client::PdxReader::readCharArray
virtual std::vector< char16_t > readCharArray(const std::string &fieldName)=0
Read a char16_t* value from the PdxReader and sets array length.
apache::geode::client::PdxReader::readDate
virtual std::shared_ptr< CacheableDate > readDate(const std::string &fieldName)=0
Read a std::shared_ptr<CacheableDate> value from the PdxReader.
apache::geode::client::PdxReader::readDoubleArray
virtual std::vector< double > readDoubleArray(const std::string &fieldName)=0
Read a double* value from the PdxReader and sets array length.
apache::geode::client::PdxReader::PdxReader
PdxReader()
constructors
Definition: PdxReader.hpp:63
apache::geode::client::PdxReader::readObjectArray
virtual std::shared_ptr< CacheableObjectArray > readObjectArray(const std::string &fieldName)=0
Read a std::shared_ptr<CacheableObjectArray> value from the PdxReader.
apache::geode::client::PdxReader::isIdentityField
virtual bool isIdentityField(const std::string &fieldName)=0
Checks if the named field was PdxWriter#markIdentityFieldmarked as an identity field.
apache::geode::client::PdxReader::readChar
virtual char16_t readChar(const std::string &fieldName)=0
Read a wide char value from the PdxReader.
apache::geode::client::PdxReader
A PdxReader will be passed to PdxSerializable.fromData or during deserialization of a PDX.
Definition: PdxReader.hpp:58
apache::geode::client::PdxReader::readFloat
virtual float readFloat(const std::string &fieldName)=0
Read a float value from the PdxReader.
apache::geode::client::PdxReader::readUnreadFields
virtual std::shared_ptr< PdxUnreadFields > readUnreadFields()=0
This method returns an object that represents all the unread fields which must be passed to PdxWriter...
apache::geode::client::PdxReader::readObject
virtual std::shared_ptr< Cacheable > readObject(const std::string &fieldName)=0
Read a std::shared_ptr<Cacheable> value from the PdxReader.
apache::geode::client::PdxReader::readDouble
virtual double readDouble(const std::string &fieldName)=0
Read a double value from the PdxReader.
apache::geode::client::PdxReader::readInt
virtual int32_t readInt(const std::string &fieldName)=0
Read a int32_t value from the PdxReader.
CacheableBuiltins.hpp
Contains generic template definitions for Cacheable types and instantiations for built-in types.
apache::geode::client::PdxReader::readShortArray
virtual std::vector< int16_t > readShortArray(const std::string &fieldName)=0
Read a int16_t* value from the PdxReader and sets array length.
apache::geode::client::PdxReader::readLongArray
virtual std::vector< int64_t > readLongArray(const std::string &fieldName)=0
Read a int64_t* value from the PdxReader and sets array length.
apache::geode::client::PdxReader::readIntArray
virtual std::vector< int32_t > readIntArray(const std::string &fieldName)=0
Read a int32_t* value from the PdxReader and sets array length.
apache::geode::client::PdxReader::readArrayOfByteArrays
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::client::PdxReader::readBooleanArray
virtual std::vector< bool > readBooleanArray(const std::string &fieldName)=0
Read a bool* value from the PdxReader and sets array length.
apache::geode::client::PdxReader::readFloatArray
virtual std::vector< float > readFloatArray(const std::string &fieldName)=0
Read a float* value from the PdxReader and sets array length.
apache::geode::client::PdxReader::hasField
virtual bool hasField(const std::string &fieldName)=0
Checks if the named field exists and returns the result.
apache::geode::client::PdxReader::readByteArray
virtual std::vector< int8_t > readByteArray(const std::string &fieldName)=0
Read a int8_t* value from the PdxReader and sets array length.
apache::geode::client::PdxReader::readLong
virtual int64_t readLong(const std::string &fieldName)=0
Read a int64_t value from the PdxReader.
apache::geode::client::PdxReader::readByte
virtual int8_t readByte(const std::string &fieldName)=0
Read a int8_t value from the PdxReader.
apache::geode::client::PdxReader::~PdxReader
virtual ~PdxReader()
destructor
Definition: PdxReader.hpp:68
apache::geode::client::PdxReader::readString
virtual std::string readString(const std::string &fieldName)=0
Read a std::string value from the PdxReader.
apache::geode::client::PdxReader::readStringArray
virtual std::vector< std::string > readStringArray(const std::string &fieldName)=0
Read a array of strings from the PdxReader.

Apache Geode C++ Cache API Documentation