geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbarr...@apache.org
Subject [geode-native] branch develop updated: GEODE-4248: Converts to/fromData params to ref from shared_ptr. (#181)
Date Tue, 09 Jan 2018 01:29:20 GMT
This is an automated email from the ASF dual-hosted git repository.

jbarrett pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode-native.git


The following commit(s) were added to refs/heads/develop by this push:
     new ea157df  GEODE-4248: Converts to/fromData params to ref from shared_ptr. (#181)
ea157df is described below

commit ea157dfbf9587b466ab18bac318bfd766c8e8f4f
Author: Jacob Barrett <jbarrett@pivotal.io>
AuthorDate: Mon Jan 8 17:29:18 2018 -0800

    GEODE-4248: Converts to/fromData params to ref from shared_ptr. (#181)
---
 cppcache/include/geode/PdxInstance.hpp             |   4 +-
 cppcache/include/geode/PdxReader.hpp               |   2 +-
 cppcache/include/geode/PdxSerializable.hpp         |   4 +-
 cppcache/include/geode/PdxSerializer.hpp           |   4 +-
 cppcache/include/geode/PdxWrapper.hpp              |   4 +-
 cppcache/include/geode/PdxWriter.hpp               |  97 +++---
 cppcache/integration-test/DeltaEx.hpp              |   8 +-
 .../integration-test/ThinClientPdxSerializers.hpp  | 271 ++++++++--------
 cppcache/src/CacheFactory.cpp                      |   4 +-
 cppcache/src/PdxHelper.cpp                         |  85 +++--
 cppcache/src/PdxInstanceImpl.cpp                   |  66 ++--
 cppcache/src/PdxInstanceImpl.hpp                   |  11 +-
 cppcache/src/PdxLocalReader.cpp                    |   2 +-
 cppcache/src/PdxLocalReader.hpp                    |   2 +-
 cppcache/src/PdxLocalWriter.cpp                    | 125 ++++----
 cppcache/src/PdxLocalWriter.hpp                    |  88 ++---
 cppcache/src/PdxRemoteWriter.cpp                   | 120 +++----
 cppcache/src/PdxRemoteWriter.hpp                   |  52 +--
 cppcache/src/PdxWrapper.cpp                        |   4 +-
 cppcache/src/PdxWriterWithTypeCollector.cpp        | 106 +++---
 cppcache/src/PdxWriterWithTypeCollector.hpp        |  49 ++-
 quickstart/cpp/PdxSerializer.cpp                   |  17 +-
 quickstart/cpp/queryobjects/PortfolioPdx.cpp       |  75 ++---
 quickstart/cpp/queryobjects/PortfolioPdx.hpp       |   4 +-
 quickstart/cpp/queryobjects/PortfolioPdxAuto.hpp   |   4 +-
 quickstart/cpp/queryobjects/PositionPdx.cpp        | 100 +++---
 quickstart/cpp/queryobjects/PositionPdx.hpp        |   4 +-
 quickstart/cpp/queryobjects/PositionPdxAuto.hpp    |   4 +-
 tests/cpp/testobject/InvalidPdxUsage.cpp           | 252 +++++++--------
 tests/cpp/testobject/InvalidPdxUsage.hpp           |  32 +-
 tests/cpp/testobject/NestedPdxObject.cpp           |  50 +--
 tests/cpp/testobject/NestedPdxObject.hpp           |  44 +--
 tests/cpp/testobject/PdxClassV1.cpp                | 334 +++++++++----------
 tests/cpp/testobject/PdxClassV1.hpp                |  60 ++--
 tests/cpp/testobject/PdxClassV2.cpp                | 312 +++++++++---------
 tests/cpp/testobject/PdxClassV2.hpp                |  63 ++--
 tests/cpp/testobject/PdxType.cpp                   | 264 +++++++--------
 tests/cpp/testobject/PdxType.hpp                   |  60 ++--
 tests/cpp/testobject/PdxVersioned1.cpp             | 144 ++++-----
 tests/cpp/testobject/PdxVersioned1.hpp             |   4 +-
 tests/cpp/testobject/PdxVersioned2.cpp             | 144 ++++-----
 tests/cpp/testobject/PdxVersioned2.hpp             |   4 +-
 tests/cpp/testobject/PortfolioPdx.cpp              |  74 +++--
 tests/cpp/testobject/PortfolioPdx.hpp              |   4 +-
 tests/cpp/testobject/PositionPdx.cpp               | 100 +++---
 tests/cpp/testobject/PositionPdx.hpp               |   4 +-
 tests/cpp/testobject/VariousPdxTypes.cpp           | 356 ++++++++++-----------
 tests/cpp/testobject/VariousPdxTypes.hpp           |  48 +--
 48 files changed, 1828 insertions(+), 1841 deletions(-)

diff --git a/cppcache/include/geode/PdxInstance.hpp b/cppcache/include/geode/PdxInstance.hpp
index 8296679..1cb1a58 100644
--- a/cppcache/include/geode/PdxInstance.hpp
+++ b/cppcache/include/geode/PdxInstance.hpp
@@ -484,13 +484,13 @@ class CPPCACHE_EXPORT PdxInstance : public PdxSerializable {
    * method.
    * @param PdxWriter to serialize the PDX object
    */
-  virtual void toData(std::shared_ptr<PdxWriter> output) const override = 0;
+  virtual void toData(PdxWriter& output) const override = 0;
 
   /**
    * @brief Deserialize this object. This is an internal method.
    * @param PdxReader to Deserialize the PDX object
    */
-  virtual void fromData(std::shared_ptr<PdxReader> input) override = 0;
+  virtual void fromData(PdxReader& input) override = 0;
 
   /**
    * Return the full name of the class that this pdx instance represents.
diff --git a/cppcache/include/geode/PdxReader.hpp b/cppcache/include/geode/PdxReader.hpp
index c8989fb..e3e8dd0 100644
--- a/cppcache/include/geode/PdxReader.hpp
+++ b/cppcache/include/geode/PdxReader.hpp
@@ -43,7 +43,7 @@ class CacheableDate;
  *
  * @note Implementations of PdxReader that are internal to the Native
  *       Client library may be returned to clients via instances of
- *       std::shared_ptr<PdxReader>. For those implementations, any
+ *       PdxReader&. For those implementations, any
  *       non-<tt>nullptr</tt>, non-empty strings returned from
  *       PdxReader::readString() or PdxReader::readWideString() must
  *       be freed with DataInput::freeUTFMemory(). Arrays returned
diff --git a/cppcache/include/geode/PdxSerializable.hpp b/cppcache/include/geode/PdxSerializable.hpp
index a7d7ac1..624c9b1 100644
--- a/cppcache/include/geode/PdxSerializable.hpp
+++ b/cppcache/include/geode/PdxSerializable.hpp
@@ -45,13 +45,13 @@ class CPPCACHE_EXPORT PdxSerializable : public CacheableKey {
    *@brief serialize this object in geode PDX format
    *@param PdxWriter to serialize the PDX object
    **/
-  virtual void toData(std::shared_ptr<PdxWriter> output) const = 0;
+  virtual void toData(PdxWriter& output) const = 0;
 
   /**
    *@brief Deserialize this object
    *@param PdxReader to Deserialize the PDX object
    **/
-  virtual void fromData(std::shared_ptr<PdxReader> input) = 0;
+  virtual void fromData(PdxReader& input) = 0;
 
   /**
    *@brief return the typeId byte of the instance being serialized.
diff --git a/cppcache/include/geode/PdxSerializer.hpp b/cppcache/include/geode/PdxSerializer.hpp
index f38c64e..ad5cb3a 100644
--- a/cppcache/include/geode/PdxSerializer.hpp
+++ b/cppcache/include/geode/PdxSerializer.hpp
@@ -61,7 +61,7 @@ class CPPCACHE_EXPORT PdxSerializer {
    * @param pr the PdxReader stream to use for reading the object data
    */
   virtual void* fromData(const std::string& className,
-                         std::shared_ptr<PdxReader> pr) = 0;
+                         PdxReader& pdxReader) = 0;
 
   /**
    * Serializes this object in geode PDX format.
@@ -69,7 +69,7 @@ class CPPCACHE_EXPORT PdxSerializer {
    * @param pw the PdxWriter object to use for serializing the object
    */
   virtual bool toData(void* userObject, const std::string& className,
-                      std::shared_ptr<PdxWriter> pw) = 0;
+                      PdxWriter& pdxWriter) = 0;
 
   /**
    * Get the function pointer to the user deallocator
diff --git a/cppcache/include/geode/PdxWrapper.hpp b/cppcache/include/geode/PdxWrapper.hpp
index 0ab81fb..18db63e 100644
--- a/cppcache/include/geode/PdxWrapper.hpp
+++ b/cppcache/include/geode/PdxWrapper.hpp
@@ -82,12 +82,12 @@ class CPPCACHE_EXPORT PdxWrapper : public PdxSerializable {
    *@brief serialize this object in geode PDX format
    *@param PdxWriter to serialize the PDX object
    **/
-  virtual void toData(std::shared_ptr<PdxWriter> output) const override;
+  virtual void toData(PdxWriter& output) const override;
   /**
    *@brief Deserialize this object
    *@param PdxReader to Deserialize the PDX object
    **/
-  virtual void fromData(std::shared_ptr<PdxReader> input) override;
+  virtual void fromData(PdxReader& input) override;
   /**
    *@brief serialize this object
    **/
diff --git a/cppcache/include/geode/PdxWriter.hpp b/cppcache/include/geode/PdxWriter.hpp
index ce4ef2b..eb04cb0 100644
--- a/cppcache/include/geode/PdxWriter.hpp
+++ b/cppcache/include/geode/PdxWriter.hpp
@@ -1,8 +1,3 @@
-#pragma once
-
-#ifndef GEODE_PDXWRITER_H_
-#define GEODE_PDXWRITER_H_
-
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
@@ -20,6 +15,11 @@
  * limitations under the License.
  */
 
+#pragma once
+
+#ifndef GEODE_PDXWRITER_H_
+#define GEODE_PDXWRITER_H_
+
 #include "geode_globals.hpp"
 #include "CacheableBuiltins.hpp"
 #include "CacheableDate.hpp"
@@ -41,12 +41,14 @@ class CPPCACHE_EXPORT PdxWriter {
   /**
    * @brief constructors
    */
-  PdxWriter() {}
+  PdxWriter() = default;
+
+  PdxWriter(PdxWriter&& move) = default;
 
   /**
    * @brief destructor
    */
-  virtual ~PdxWriter() {}
+  virtual ~PdxWriter() = default;
 
   /**
    * Writes the named field with the given value to the serialized form
@@ -58,8 +60,8 @@ class CPPCACHE_EXPORT PdxWriter {
    * @throws IllegalStateException if the named field has already been written
    * or fieldName is nullptr or empty
    */
-  virtual std::shared_ptr<PdxWriter> writeChar(const std::string& fieldName,
-                                               char16_t value) = 0;
+  virtual PdxWriter& writeChar(const std::string& fieldName,
+                               char16_t value) = 0;
 
   /**
    * Writes the named field with the given value to the serialized form.
@@ -71,8 +73,7 @@ class CPPCACHE_EXPORT PdxWriter {
    * @throws IllegalStateException if the named field has already been written
    * or fieldName is nullptr or empty
    */
-  virtual std::shared_ptr<PdxWriter> writeBoolean(const std::string& fieldName,
-                                                  bool value) = 0;
+  virtual PdxWriter& writeBoolean(const std::string& fieldName, bool value) = 0;
 
   /**
    * Writes the named field with the given value to the serialized form.
@@ -84,8 +85,7 @@ class CPPCACHE_EXPORT PdxWriter {
    * @throws IllegalStateException if the named field has already been written
    * or fieldName is nullptr or empty
    */
-  virtual std::shared_ptr<PdxWriter> writeByte(const std::string& fieldName,
-                                               int8_t value) = 0;
+  virtual PdxWriter& writeByte(const std::string& fieldName, int8_t value) = 0;
 
   /**
    * Writes the named field with the given value to the serialized form.
@@ -97,8 +97,8 @@ class CPPCACHE_EXPORT PdxWriter {
    * @throws IllegalStateException if the named field has already been written
    * or fieldName is nullptr or empty
    */
-  virtual std::shared_ptr<PdxWriter> writeShort(const std::string& fieldName,
-                                                int16_t value) = 0;
+  virtual PdxWriter& writeShort(const std::string& fieldName,
+                                int16_t value) = 0;
 
   /**
    * Writes the named field with the given value to the serialized form.
@@ -110,8 +110,7 @@ class CPPCACHE_EXPORT PdxWriter {
    * @throws IllegalStateException if the named field has already been written
    * or fieldName is nullptr or empty
    */
-  virtual std::shared_ptr<PdxWriter> writeInt(const std::string& fieldName,
-                                              int32_t value) = 0;
+  virtual PdxWriter& writeInt(const std::string& fieldName, int32_t value) = 0;
 
   /**
    * Writes the named field with the given value to the serialized form.
@@ -123,8 +122,7 @@ class CPPCACHE_EXPORT PdxWriter {
    * @throws IllegalStateException if the named field has already been written
    * or fieldName is nullptr or empty
    */
-  virtual std::shared_ptr<PdxWriter> writeLong(const std::string& fieldName,
-                                               int64_t value) = 0;
+  virtual PdxWriter& writeLong(const std::string& fieldName, int64_t value) = 0;
 
   /**
    * Writes the named field with the given value to the serialized form.
@@ -136,8 +134,7 @@ class CPPCACHE_EXPORT PdxWriter {
    * @throws IllegalStateException if the named field has already been written
    * or fieldName is nullptr or empty
    */
-  virtual std::shared_ptr<PdxWriter> writeFloat(const std::string& fieldName,
-                                                float value) = 0;
+  virtual PdxWriter& writeFloat(const std::string& fieldName, float value) = 0;
 
   /**
    * Writes the named field with the given value to the serialized form.
@@ -149,8 +146,8 @@ class CPPCACHE_EXPORT PdxWriter {
    * @throws IllegalStateException if the named field has already been written
    * or fieldName is nullptr or empty
    */
-  virtual std::shared_ptr<PdxWriter> writeDouble(const std::string& fieldName,
-                                                 double value) = 0;
+  virtual PdxWriter& writeDouble(const std::string& fieldName,
+                                 double value) = 0;
 
   /**
    * Writes the named field with the given value to the serialized form.
@@ -162,8 +159,8 @@ class CPPCACHE_EXPORT PdxWriter {
    * @throws IllegalStateException if the named field has already been written
    * or fieldName is nullptr or empty
    */
-  virtual std::shared_ptr<PdxWriter> writeDate(
-      const std::string& fieldName, std::shared_ptr<CacheableDate> date) = 0;
+  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.
@@ -175,7 +172,7 @@ class CPPCACHE_EXPORT PdxWriter {
    * @throws IllegalStateException if the named field has already been written
    * or fieldName is nullptr or empty
    */
-  virtual std::shared_ptr<PdxWriter> writeString(const std::string& fieldName,
+  virtual PdxWriter& writeString(const std::string& fieldName,
                                                  const std::string& value) = 0;
 
   /**
@@ -195,8 +192,8 @@ class CPPCACHE_EXPORT PdxWriter {
    * @throws IllegalStateException if the named field has already been written
    * or fieldName is nullptr or empty.
    */
-  virtual std::shared_ptr<PdxWriter> writeObject(
-      const std::string& fieldName, std::shared_ptr<Cacheable> value) = 0;
+  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.
@@ -209,8 +206,8 @@ class CPPCACHE_EXPORT PdxWriter {
    * @throws IllegalStateException if the named field has already been written
    * or fieldName is nullptr or empty.
    */
-  virtual std::shared_ptr<PdxWriter> writeBooleanArray(
-      const std::string& fieldName, bool* array, int length) = 0;
+  virtual PdxWriter& writeBooleanArray(const std::string& fieldName,
+                                       bool* array, int length) = 0;
 
   /**
    * Writes the named field with the given value to the serialized form.
@@ -223,7 +220,7 @@ class CPPCACHE_EXPORT PdxWriter {
    * @throws IllegalStateException if the named field has already been written
    * or fieldName is nullptr or empty.
    */
-  virtual std::shared_ptr<PdxWriter> writeCharArray(
+  virtual PdxWriter& writeCharArray(
       const std::string& fieldName, char16_t* array, int length) = 0;
 
   /**
@@ -237,8 +234,8 @@ class CPPCACHE_EXPORT PdxWriter {
    * @throws IllegalStateException if the named field has already been written
    * or fieldName is nullptr or empty.
    */
-  virtual std::shared_ptr<PdxWriter> writeByteArray(
-      const std::string& fieldName, int8_t* array, int length) = 0;
+  virtual PdxWriter& writeByteArray(const std::string& fieldName, int8_t* array,
+                                    int length) = 0;
 
   /**
    * Writes the named field with the given value to the serialized form.
@@ -251,8 +248,8 @@ class CPPCACHE_EXPORT PdxWriter {
    * @throws IllegalStateException if the named field has already been written
    * or fieldName is nullptr or empty.
    */
-  virtual std::shared_ptr<PdxWriter> writeShortArray(
-      const std::string& fieldName, int16_t* array, int length) = 0;
+  virtual PdxWriter& writeShortArray(const std::string& fieldName,
+                                     int16_t* array, int length) = 0;
 
   /**
    * Writes the named field with the given value to the serialized form.
@@ -265,9 +262,8 @@ class CPPCACHE_EXPORT PdxWriter {
    * @throws IllegalStateException if the named field has already been written
    * or fieldName is nullptr or empty.
    */
-  virtual std::shared_ptr<PdxWriter> writeIntArray(const std::string& fieldName,
-                                                   int32_t* array,
-                                                   int length) = 0;
+  virtual PdxWriter& writeIntArray(const std::string& fieldName, int32_t* array,
+                                   int length) = 0;
 
   /**
    * Writes the named field with the given value to the serialized form.
@@ -280,8 +276,8 @@ class CPPCACHE_EXPORT PdxWriter {
    * @throws IllegalStateException if the named field has already been written
    * or fieldName is nullptr or empty.
    */
-  virtual std::shared_ptr<PdxWriter> writeLongArray(
-      const std::string& fieldName, int64_t* array, int length) = 0;
+  virtual PdxWriter& writeLongArray(const std::string& fieldName,
+                                    int64_t* array, int length) = 0;
 
   /**
    * Writes the named field with the given value to the serialized form.
@@ -294,8 +290,8 @@ class CPPCACHE_EXPORT PdxWriter {
    * @throws IllegalStateException if the named field has already been written
    * or fieldName is nullptr or empty.
    */
-  virtual std::shared_ptr<PdxWriter> writeFloatArray(
-      const std::string& fieldName, float* array, int length) = 0;
+  virtual PdxWriter& writeFloatArray(const std::string& fieldName, float* array,
+                                     int length) = 0;
 
   /**
    * Writes the named field with the given value to the serialized form.
@@ -308,8 +304,8 @@ class CPPCACHE_EXPORT PdxWriter {
    * @throws IllegalStateException if the named field has already been written
    * or fieldName is nullptr or empty.
    */
-  virtual std::shared_ptr<PdxWriter> writeDoubleArray(
-      const std::string& fieldName, double* array, int length) = 0;
+  virtual PdxWriter& writeDoubleArray(const std::string& fieldName,
+                                      double* array, int length) = 0;
 
   /**
    * Writes the named field with the given value to the serialized form.
@@ -322,7 +318,7 @@ class CPPCACHE_EXPORT PdxWriter {
    * @throws IllegalStateException if the named field has already been written
    * or fieldName is nullptr or empty.
    */
-  virtual std::shared_ptr<PdxWriter> writeStringArray(
+  virtual PdxWriter& writeStringArray(
       const std::string& fieldName, const std::vector<std::string>& array) = 0;
 
   /**
@@ -339,7 +335,7 @@ class CPPCACHE_EXPORT PdxWriter {
    * @throws IllegalStateException if the named field has already been written
    * or fieldName is nullptr or empty.
    */
-  virtual std::shared_ptr<PdxWriter> writeObjectArray(
+  virtual PdxWriter& writeObjectArray(
       const std::string& fieldName,
       std::shared_ptr<CacheableObjectArray> array) = 0;
 
@@ -356,7 +352,7 @@ class CPPCACHE_EXPORT PdxWriter {
    * @throws IllegalStateException if the named field has already been written
    * or fieldName is nullptr or empty.
    */
-  virtual std::shared_ptr<PdxWriter> writeArrayOfByteArrays(
+  virtual PdxWriter& writeArrayOfByteArrays(
       const std::string& fieldName, int8_t* const* const array, int arrayLength,
       const int* elementLength) = 0;
 
@@ -380,11 +376,10 @@ class CPPCACHE_EXPORT PdxWriter {
    * write* method.
    *
    * @param fieldName the name of the field to mark as an identity field.
-   * @returns this std::shared_ptr<PdxWriter>
+   * @returns this PdxWriter&
    * @throws IllegalStateException if the named field does not exist.
    */
-  virtual std::shared_ptr<PdxWriter> markIdentityField(
-      const std::string& fieldName) = 0;
+  virtual PdxWriter& markIdentityField(const std::string& fieldName) = 0;
 
   /**
    * Writes the given unread fields to the serialized form.
@@ -398,7 +393,7 @@ class CPPCACHE_EXPORT PdxWriter {
    * @throws IllegalStateException if one of the writeXXX methods has already
    * been called.
    */
-  virtual std::shared_ptr<PdxWriter> writeUnreadFields(
+  virtual PdxWriter& writeUnreadFields(
       std::shared_ptr<PdxUnreadFields> unread) = 0;
 };
 }  // namespace client
diff --git a/cppcache/integration-test/DeltaEx.hpp b/cppcache/integration-test/DeltaEx.hpp
index 35e90d8..2ba1a18 100644
--- a/cppcache/integration-test/DeltaEx.hpp
+++ b/cppcache/integration-test/DeltaEx.hpp
@@ -130,13 +130,13 @@ class PdxDeltaEx : public PdxSerializable, public Delta {
     return className;
   }
 
-  void toData(std::shared_ptr<PdxWriter> pw) const override {
-    pw->writeInt("counter", m_counter);
+  void toData(PdxWriter& pw) const override {
+    pw.writeInt("counter", m_counter);
     m_toDataCount++;
   }
 
-  void fromData(std::shared_ptr<PdxReader> pr) override {
-    m_counter = pr->readInt("counter");
+  void fromData(PdxReader& pr) override {
+    m_counter = pr.readInt("counter");
     m_fromDataCount++;
   }
 
diff --git a/cppcache/integration-test/ThinClientPdxSerializers.hpp b/cppcache/integration-test/ThinClientPdxSerializers.hpp
index a48db6f..468d68e 100644
--- a/cppcache/integration-test/ThinClientPdxSerializers.hpp
+++ b/cppcache/integration-test/ThinClientPdxSerializers.hpp
@@ -59,20 +59,19 @@ class TestPdxSerializer : public PdxSerializer {
     return objectSize;
   }
 
-  void *fromDataForAddress(std::shared_ptr<PdxReader> pr) {
+  void *fromDataForAddress(PdxReader &pr) {
     try {
       PdxTests::NonPdxAddress *npa = new PdxTests::NonPdxAddress;
-      npa->_aptNumber = pr->readInt("_aptNumber");
-      npa->_street = pr->readString("_street");
-      npa->_city = pr->readString("_city");
+      npa->_aptNumber = pr.readInt("_aptNumber");
+      npa->_street = pr.readString("_street");
+      npa->_city = pr.readString("_city");
       return (void *)npa;
     } catch (...) {
       return nullptr;
     }
   }
 
-  void *fromData(const std::string &className,
-                 std::shared_ptr<PdxReader> pr) override {
+  void *fromData(const std::string &className, PdxReader &pr) override {
     ASSERT(className == CLASSNAME1 || className == CLASSNAME2,
            "Unexpected classname in fromData");
 
@@ -90,83 +89,83 @@ class TestPdxSerializer : public PdxSerializer {
       GF_NEW(Lengtharr, int32_t[2]);
       int32_t arrLen = 0;
       npt->m_byteByteArray =
-          pr->readArrayOfByteArrays("m_byteByteArray", arrLen, &Lengtharr);
+          pr.readArrayOfByteArrays("m_byteByteArray", arrLen, &Lengtharr);
       // TODO::need to write compareByteByteArray() and check for
       // m_byteByteArray elements
 
-      npt->m_char = pr->readChar("m_char");
+      npt->m_char = pr.readChar("m_char");
       // GenericValCompare
 
-      npt->m_bool = pr->readBoolean("m_bool");
+      npt->m_bool = pr.readBoolean("m_bool");
       // GenericValCompare
-      npt->m_boolArray = pr->readBooleanArray("m_boolArray", npt->boolArrayLen);
+      npt->m_boolArray = pr.readBooleanArray("m_boolArray", npt->boolArrayLen);
 
-      npt->m_byte = pr->readByte("m_byte");
-      npt->m_byteArray = pr->readByteArray("m_byteArray", npt->byteArrayLen);
-      npt->m_charArray = pr->readCharArray("m_charArray", npt->charArrayLen);
+      npt->m_byte = pr.readByte("m_byte");
+      npt->m_byteArray = pr.readByteArray("m_byteArray", npt->byteArrayLen);
+      npt->m_charArray = pr.readCharArray("m_charArray", npt->charArrayLen);
 
       npt->m_arraylist = std::dynamic_pointer_cast<CacheableArrayList>(
-          pr->readObject("m_arraylist"));
+          pr.readObject("m_arraylist"));
 
       npt->m_map =
-          std::dynamic_pointer_cast<CacheableHashMap>(pr->readObject("m_map"));
+          std::dynamic_pointer_cast<CacheableHashMap>(pr.readObject("m_map"));
       // TODO:Check for the size
 
       npt->m_hashtable = std::dynamic_pointer_cast<CacheableHashTable>(
-          pr->readObject("m_hashtable"));
+          pr.readObject("m_hashtable"));
       // TODO:Check for the size
 
-      npt->m_vector = std::dynamic_pointer_cast<CacheableVector>(
-          pr->readObject("m_vector"));
+      npt->m_vector =
+          std::dynamic_pointer_cast<CacheableVector>(pr.readObject("m_vector"));
       // TODO::Check for size
 
       npt->m_chs =
-          std::dynamic_pointer_cast<CacheableHashSet>(pr->readObject("m_chs"));
+          std::dynamic_pointer_cast<CacheableHashSet>(pr.readObject("m_chs"));
       // TODO::Size check
 
       npt->m_clhs = std::dynamic_pointer_cast<CacheableLinkedHashSet>(
-          pr->readObject("m_clhs"));
+          pr.readObject("m_clhs"));
       // TODO:Size check
 
-      npt->m_string = pr->readString("m_string");  // GenericValCompare
-      npt->m_date = pr->readDate("m_dateTime");    // compareData
+      npt->m_string = pr.readString("m_string");  // GenericValCompare
+      npt->m_date = pr.readDate("m_dateTime");    // compareData
 
-      npt->m_double = pr->readDouble("m_double");
+      npt->m_double = pr.readDouble("m_double");
 
       npt->m_doubleArray =
-          pr->readDoubleArray("m_doubleArray", npt->doubleArrayLen);
-      npt->m_float = pr->readFloat("m_float");
+          pr.readDoubleArray("m_doubleArray", npt->doubleArrayLen);
+      npt->m_float = pr.readFloat("m_float");
       npt->m_floatArray =
-          pr->readFloatArray("m_floatArray", npt->floatArrayLen);
-      npt->m_int16 = pr->readShort("m_int16");
-      npt->m_int32 = pr->readInt("m_int32");
-      npt->m_long = pr->readLong("m_long");
-      npt->m_int32Array = pr->readIntArray("m_int32Array", npt->intArrayLen);
-      npt->m_longArray = pr->readLongArray("m_longArray", npt->longArrayLen);
+          pr.readFloatArray("m_floatArray", npt->floatArrayLen);
+      npt->m_int16 = pr.readShort("m_int16");
+      npt->m_int32 = pr.readInt("m_int32");
+      npt->m_long = pr.readLong("m_long");
+      npt->m_int32Array = pr.readIntArray("m_int32Array", npt->intArrayLen);
+      npt->m_longArray = pr.readLongArray("m_longArray", npt->longArrayLen);
       npt->m_int16Array =
-          pr->readShortArray("m_int16Array", npt->shortArrayLen);
-      npt->m_sbyte = pr->readByte("m_sbyte");
-      npt->m_sbyteArray = pr->readByteArray("m_sbyteArray", npt->byteArrayLen);
-      npt->m_stringArray = pr->readStringArray("m_stringArray");
-      npt->m_uint16 = pr->readShort("m_uint16");
-      npt->m_uint32 = pr->readInt("m_uint32");
-      npt->m_ulong = pr->readLong("m_ulong");
-      npt->m_uint32Array = pr->readIntArray("m_uint32Array", npt->intArrayLen);
-      npt->m_ulongArray = pr->readLongArray("m_ulongArray", npt->longArrayLen);
+          pr.readShortArray("m_int16Array", npt->shortArrayLen);
+      npt->m_sbyte = pr.readByte("m_sbyte");
+      npt->m_sbyteArray = pr.readByteArray("m_sbyteArray", npt->byteArrayLen);
+      npt->m_stringArray = pr.readStringArray("m_stringArray");
+      npt->m_uint16 = pr.readShort("m_uint16");
+      npt->m_uint32 = pr.readInt("m_uint32");
+      npt->m_ulong = pr.readLong("m_ulong");
+      npt->m_uint32Array = pr.readIntArray("m_uint32Array", npt->intArrayLen);
+      npt->m_ulongArray = pr.readLongArray("m_ulongArray", npt->longArrayLen);
       npt->m_uint16Array =
-          pr->readShortArray("m_uint16Array", npt->shortArrayLen);
+          pr.readShortArray("m_uint16Array", npt->shortArrayLen);
       // LOGINFO("PdxType::readInt() start...");
 
-      npt->m_byte252 = pr->readByteArray("m_byte252", npt->m_byte252Len);
-      npt->m_byte253 = pr->readByteArray("m_byte253", npt->m_byte253Len);
-      npt->m_byte65535 = pr->readByteArray("m_byte65535", npt->m_byte65535Len);
-      npt->m_byte65536 = pr->readByteArray("m_byte65536", npt->m_byte65536Len);
+      npt->m_byte252 = pr.readByteArray("m_byte252", npt->m_byte252Len);
+      npt->m_byte253 = pr.readByteArray("m_byte253", npt->m_byte253Len);
+      npt->m_byte65535 = pr.readByteArray("m_byte65535", npt->m_byte65535Len);
+      npt->m_byte65536 = pr.readByteArray("m_byte65536", npt->m_byte65536Len);
 
-      npt->m_pdxEnum = pr->readObject("m_pdxEnum");
+      npt->m_pdxEnum = pr.readObject("m_pdxEnum");
 
-      npt->m_address = pr->readObject("m_address");
+      npt->m_address = pr.readObject("m_address");
 
-      npt->m_objectArray = pr->readObjectArray("m_objectArray");
+      npt->m_objectArray = pr.readObjectArray("m_objectArray");
 
       LOGINFO("TestPdxSerializer: NonPdxType fromData() Done.");
     } catch (...) {
@@ -175,13 +174,13 @@ class TestPdxSerializer : public PdxSerializer {
     return (void *)npt;
   }
 
-  bool toDataForAddress(void *testObject, std::shared_ptr<PdxWriter> pw) {
+  bool toDataForAddress(void *testObject, PdxWriter &pw) {
     try {
       PdxTests::NonPdxAddress *npa =
           reinterpret_cast<PdxTests::NonPdxAddress *>(testObject);
-      pw->writeInt("_aptNumber", npa->_aptNumber);
-      pw->writeString("_street", npa->_street);
-      pw->writeString("_city", npa->_city);
+      pw.writeInt("_aptNumber", npa->_aptNumber);
+      pw.writeString("_street", npa->_street);
+      pw.writeString("_city", npa->_city);
       return true;
     } catch (...) {
       return false;
@@ -189,7 +188,7 @@ class TestPdxSerializer : public PdxSerializer {
   }
 
   bool toData(void *testObject, const std::string &className,
-              std::shared_ptr<PdxWriter> pw) override {
+              PdxWriter &pw) override {
     ASSERT(className == CLASSNAME1 || className == CLASSNAME2,
            "Unexpected classname in toData");
 
@@ -205,94 +204,94 @@ class TestPdxSerializer : public PdxSerializer {
 
       lengthArr[0] = 1;
       lengthArr[1] = 2;
-      pw->writeArrayOfByteArrays("m_byteByteArray", npt->m_byteByteArray, 2,
-                                 lengthArr);
-      pw->writeChar("m_char", npt->m_char);
-      pw->markIdentityField("m_char");
-      pw->writeBoolean("m_bool", npt->m_bool);  // 1
-      pw->markIdentityField("m_bool");
-      pw->writeBooleanArray("m_boolArray", npt->m_boolArray, 3);
-      pw->markIdentityField("m_boolArray");
-      pw->writeByte("m_byte", npt->m_byte);
-      pw->markIdentityField("m_byte");
-      pw->writeByteArray("m_byteArray", npt->m_byteArray, 2);
-      pw->markIdentityField("m_byteArray");
-      pw->writeCharArray("m_charArray", npt->m_charArray, 2);
-      pw->markIdentityField("m_charArray");
-      pw->writeObject("m_arraylist", npt->m_arraylist);
-      pw->markIdentityField("m_arraylist");
-      pw->writeObject("m_map", npt->m_map);
-      pw->markIdentityField("m_map");
-      pw->writeObject("m_hashtable", npt->m_hashtable);
-      pw->markIdentityField("m_hashtable");
-      pw->writeObject("m_vector", npt->m_vector);
-      pw->markIdentityField("m_vector");
-      pw->writeObject("m_chs", npt->m_chs);
-      pw->markIdentityField("m_chs");
-      pw->writeObject("m_clhs", npt->m_clhs);
-      pw->markIdentityField("m_clhs");
-      pw->writeString("m_string", npt->m_string);
-      pw->markIdentityField("m_string");
-      pw->writeDate("m_dateTime", npt->m_date);
-      pw->markIdentityField("m_dateTime");
-      pw->writeDouble("m_double", npt->m_double);
-      pw->markIdentityField("m_double");
-      pw->writeDoubleArray("m_doubleArray", npt->m_doubleArray, 2);
-      pw->markIdentityField("m_doubleArray");
-      pw->writeFloat("m_float", npt->m_float);
-      pw->markIdentityField("m_float");
-      pw->writeFloatArray("m_floatArray", npt->m_floatArray, 2);
-      pw->markIdentityField("m_floatArray");
-      pw->writeShort("m_int16", npt->m_int16);
-      pw->markIdentityField("m_int16");
-      pw->writeInt("m_int32", npt->m_int32);
-      pw->markIdentityField("m_int32");
-      pw->writeLong("m_long", npt->m_long);
-      pw->markIdentityField("m_long");
-      pw->writeIntArray("m_int32Array", npt->m_int32Array, 4);
-      pw->markIdentityField("m_int32Array");
-      pw->writeLongArray("m_longArray", npt->m_longArray, 2);
-      pw->markIdentityField("m_longArray");
-      pw->writeShortArray("m_int16Array", npt->m_int16Array, 2);
-      pw->markIdentityField("m_int16Array");
-      pw->writeByte("m_sbyte", npt->m_sbyte);
-      pw->markIdentityField("m_sbyte");
-      pw->writeByteArray("m_sbyteArray", npt->m_sbyteArray, 2);
-      pw->markIdentityField("m_sbyteArray");
+      pw.writeArrayOfByteArrays("m_byteByteArray", npt->m_byteByteArray, 2,
+                                lengthArr);
+      pw.writeChar("m_char", npt->m_char);
+      pw.markIdentityField("m_char");
+      pw.writeBoolean("m_bool", npt->m_bool);  // 1
+      pw.markIdentityField("m_bool");
+      pw.writeBooleanArray("m_boolArray", npt->m_boolArray, 3);
+      pw.markIdentityField("m_boolArray");
+      pw.writeByte("m_byte", npt->m_byte);
+      pw.markIdentityField("m_byte");
+      pw.writeByteArray("m_byteArray", npt->m_byteArray, 2);
+      pw.markIdentityField("m_byteArray");
+      pw.writeCharArray("m_charArray", npt->m_charArray, 2);
+      pw.markIdentityField("m_charArray");
+      pw.writeObject("m_arraylist", npt->m_arraylist);
+      pw.markIdentityField("m_arraylist");
+      pw.writeObject("m_map", npt->m_map);
+      pw.markIdentityField("m_map");
+      pw.writeObject("m_hashtable", npt->m_hashtable);
+      pw.markIdentityField("m_hashtable");
+      pw.writeObject("m_vector", npt->m_vector);
+      pw.markIdentityField("m_vector");
+      pw.writeObject("m_chs", npt->m_chs);
+      pw.markIdentityField("m_chs");
+      pw.writeObject("m_clhs", npt->m_clhs);
+      pw.markIdentityField("m_clhs");
+      pw.writeString("m_string", npt->m_string);
+      pw.markIdentityField("m_string");
+      pw.writeDate("m_dateTime", npt->m_date);
+      pw.markIdentityField("m_dateTime");
+      pw.writeDouble("m_double", npt->m_double);
+      pw.markIdentityField("m_double");
+      pw.writeDoubleArray("m_doubleArray", npt->m_doubleArray, 2);
+      pw.markIdentityField("m_doubleArray");
+      pw.writeFloat("m_float", npt->m_float);
+      pw.markIdentityField("m_float");
+      pw.writeFloatArray("m_floatArray", npt->m_floatArray, 2);
+      pw.markIdentityField("m_floatArray");
+      pw.writeShort("m_int16", npt->m_int16);
+      pw.markIdentityField("m_int16");
+      pw.writeInt("m_int32", npt->m_int32);
+      pw.markIdentityField("m_int32");
+      pw.writeLong("m_long", npt->m_long);
+      pw.markIdentityField("m_long");
+      pw.writeIntArray("m_int32Array", npt->m_int32Array, 4);
+      pw.markIdentityField("m_int32Array");
+      pw.writeLongArray("m_longArray", npt->m_longArray, 2);
+      pw.markIdentityField("m_longArray");
+      pw.writeShortArray("m_int16Array", npt->m_int16Array, 2);
+      pw.markIdentityField("m_int16Array");
+      pw.writeByte("m_sbyte", npt->m_sbyte);
+      pw.markIdentityField("m_sbyte");
+      pw.writeByteArray("m_sbyteArray", npt->m_sbyteArray, 2);
+      pw.markIdentityField("m_sbyteArray");
 
       int *strlengthArr = new int[2];
 
       strlengthArr[0] = 5;
       strlengthArr[1] = 5;
-      pw->writeStringArray("m_stringArray", npt->m_stringArray);
-      pw->markIdentityField("m_stringArray");
-      pw->writeShort("m_uint16", npt->m_uint16);
-      pw->markIdentityField("m_uint16");
-      pw->writeInt("m_uint32", npt->m_uint32);
-      pw->markIdentityField("m_uint32");
-      pw->writeLong("m_ulong", npt->m_ulong);
-      pw->markIdentityField("m_ulong");
-      pw->writeIntArray("m_uint32Array", npt->m_uint32Array, 4);
-      pw->markIdentityField("m_uint32Array");
-      pw->writeLongArray("m_ulongArray", npt->m_ulongArray, 2);
-      pw->markIdentityField("m_ulongArray");
-      pw->writeShortArray("m_uint16Array", npt->m_uint16Array, 2);
-      pw->markIdentityField("m_uint16Array");
-
-      pw->writeByteArray("m_byte252", npt->m_byte252, 252);
-      pw->markIdentityField("m_byte252");
-      pw->writeByteArray("m_byte253", npt->m_byte253, 253);
-      pw->markIdentityField("m_byte253");
-      pw->writeByteArray("m_byte65535", npt->m_byte65535, 65535);
-      pw->markIdentityField("m_byte65535");
-      pw->writeByteArray("m_byte65536", npt->m_byte65536, 65536);
-      pw->markIdentityField("m_byte65536");
-
-      pw->writeObject("m_pdxEnum", npt->m_pdxEnum);
-      pw->markIdentityField("m_pdxEnum");
-
-      pw->writeObject("m_address", npt->m_objectArray);
-      pw->writeObjectArray("m_objectArray", npt->m_objectArray);
+      pw.writeStringArray("m_stringArray", npt->m_stringArray);
+      pw.markIdentityField("m_stringArray");
+      pw.writeShort("m_uint16", npt->m_uint16);
+      pw.markIdentityField("m_uint16");
+      pw.writeInt("m_uint32", npt->m_uint32);
+      pw.markIdentityField("m_uint32");
+      pw.writeLong("m_ulong", npt->m_ulong);
+      pw.markIdentityField("m_ulong");
+      pw.writeIntArray("m_uint32Array", npt->m_uint32Array, 4);
+      pw.markIdentityField("m_uint32Array");
+      pw.writeLongArray("m_ulongArray", npt->m_ulongArray, 2);
+      pw.markIdentityField("m_ulongArray");
+      pw.writeShortArray("m_uint16Array", npt->m_uint16Array, 2);
+      pw.markIdentityField("m_uint16Array");
+
+      pw.writeByteArray("m_byte252", npt->m_byte252, 252);
+      pw.markIdentityField("m_byte252");
+      pw.writeByteArray("m_byte253", npt->m_byte253, 253);
+      pw.markIdentityField("m_byte253");
+      pw.writeByteArray("m_byte65535", npt->m_byte65535, 65535);
+      pw.markIdentityField("m_byte65535");
+      pw.writeByteArray("m_byte65536", npt->m_byte65536, 65536);
+      pw.markIdentityField("m_byte65536");
+
+      pw.writeObject("m_pdxEnum", npt->m_pdxEnum);
+      pw.markIdentityField("m_pdxEnum");
+
+      pw.writeObject("m_address", npt->m_objectArray);
+      pw.writeObjectArray("m_objectArray", npt->m_objectArray);
 
       LOG("TestPdxSerializer: NonPdxType toData() Done......");
     } catch (...) {
diff --git a/cppcache/src/CacheFactory.cpp b/cppcache/src/CacheFactory.cpp
index 162caaa..b254604 100644
--- a/cppcache/src/CacheFactory.cpp
+++ b/cppcache/src/CacheFactory.cpp
@@ -129,8 +129,8 @@ Cache CacheFactory::create() const {
 
 Cache CacheFactory::create(
     const std::shared_ptr<CacheAttributes>& attrs) const {
-  auto cache = Cache(dsProp, ignorePdxUnreadFields, pdxReadSerialized,
-                     authInitialize);
+  auto cache =
+      Cache(dsProp, ignorePdxUnreadFields, pdxReadSerialized, authInitialize);
   cache.m_cacheImpl->setAttributes(attrs);
 
   try {
diff --git a/cppcache/src/PdxHelper.cpp b/cppcache/src/PdxHelper.cpp
index a15f2ca..a73f214 100644
--- a/cppcache/src/PdxHelper.cpp
+++ b/cppcache/src/PdxHelper.cpp
@@ -77,11 +77,11 @@ void PdxHelper::serializePdx(
           piPt, DataOutputInternal::getPoolName(output).c_str());
       pdxII->setPdxId(typeId);
     }
-    auto plw = std::make_shared<PdxLocalWriter>(output, piPt, pdxTypeRegistry);
+    auto plw = PdxLocalWriter(output, piPt, pdxTypeRegistry);
     pdxII->toData(plw);
-    plw->endObjectWriting();  // now write typeid
+    plw.endObjectWriting();  // now write typeid
     int len = 0;
-    uint8_t* pdxStream = plw->getPdxStream(len);
+    uint8_t* pdxStream = plw.getPdxStream(len);
     pdxII->updatePdxStream(pdxStream, len);
 
     delete[] pdxStream;
@@ -95,10 +95,9 @@ void PdxHelper::serializePdx(
   if (localPdxType == nullptr) {
     // need to grab type info, as fromdata is not called yet
 
-    auto ptc = std::make_shared<PdxWriterWithTypeCollector>(output, className,
-                                                            pdxTypeRegistry);
-    pdxObject->toData(std::dynamic_pointer_cast<PdxWriter>(ptc));
-    auto nType = ptc->getPdxLocalType();
+    PdxWriterWithTypeCollector ptc(output, className, pdxTypeRegistry);
+    pdxObject->toData(ptc);
+    auto nType = ptc.getPdxLocalType();
 
     nType->InitializeType();
     int32_t nTypeId = pdxTypeRegistry->getPDXIdForType(
@@ -106,13 +105,13 @@ void PdxHelper::serializePdx(
         nType, true);
     nType->setTypeId(nTypeId);
 
-    ptc->endObjectWriting();
+    ptc.endObjectWriting();
     pdxTypeRegistry->addLocalPdxType(className, nType);
     pdxTypeRegistry->addPdxType(nTypeId, nType);
 
     if (cacheImpl != nullptr) {
       uint8_t* stPos = const_cast<uint8_t*>(output.getBuffer()) +
-                       ptc->getStartPositionOffset();
+                       ptc.getStartPositionOffset();
       int pdxLen = PdxHelper::readInt32(stPos);
       cachePerfStats.incPdxSerialization(
           pdxLen + 1 + 2 * 4);  // pdxLen + 93 DSID + len + typeID
@@ -122,29 +121,28 @@ void PdxHelper::serializePdx(
   {
     // if object got from server than create instance of RemoteWriter otherwise
     // local writer.
-
-    auto pd = pdxTypeRegistry->getPreserveData(pdxObject);
-
     // now always remotewriter as we have API Read/WriteUnreadFields
     // so we don't know whether user has used those or not;; Can we do some
     // trick here?
-    std::shared_ptr<PdxRemoteWriter> prw = nullptr;
 
-    if (pd != nullptr) {
-      auto mergedPdxType = pdxTypeRegistry->getPdxType(pd->getMergedTypeId());
-      prw = std::make_shared<PdxRemoteWriter>(output, mergedPdxType, pd,
-                                              pdxTypeRegistry);
-    } else {
-      prw =
-          std::make_shared<PdxRemoteWriter>(output, className, pdxTypeRegistry);
-    }
-    pdxObject->toData(std::dynamic_pointer_cast<PdxWriter>(prw));
-    prw->endObjectWriting();
+    auto createPdxRemoteWriter = [&]() -> PdxRemoteWriter {
+      if (auto pd = pdxTypeRegistry->getPreserveData(pdxObject)) {
+        auto mergedPdxType = pdxTypeRegistry->getPdxType(pd->getMergedTypeId());
+        return PdxRemoteWriter(output, mergedPdxType, pd, pdxTypeRegistry);
+      } else {
+        return PdxRemoteWriter(output, className, pdxTypeRegistry);
+      }
+    };
+
+    PdxRemoteWriter prw = createPdxRemoteWriter();
+
+    pdxObject->toData(prw);
+    prw.endObjectWriting();
 
     //[ToDo] need to write bytes for stats
     if (cacheImpl != nullptr) {
       uint8_t* stPos = const_cast<uint8_t*>(output.getBuffer()) +
-                       prw->getStartPositionOffset();
+                       prw.getStartPositionOffset();
       int pdxLen = PdxHelper::readInt32(stPos);
       cachePerfStats.incPdxSerialization(
           pdxLen + 1 + 2 * 4);  // pdxLen + 93 DSID + len + typeID
@@ -177,24 +175,22 @@ std::shared_ptr<PdxSerializable> PdxHelper::deserializePdx(
     pdxObjectptr = serializationRegistry->getPdxType(pdxClassname);
     if (pType->isLocal())  // local type no need to read Unread data
     {
-      auto plr = std::make_shared<PdxLocalReader>(dataInput, pType, length,
-                                                  pdxTypeRegistry);
-      pdxObjectptr->fromData(std::dynamic_pointer_cast<PdxReader>(plr));
-      plr->MoveStream();
+      auto plr = PdxLocalReader(dataInput, pType, length, pdxTypeRegistry);
+      pdxObjectptr->fromData(plr);
+      plr.moveStream();
     } else {
-      auto prr = std::make_shared<PdxRemoteReader>(dataInput, pType, length,
-                                                   pdxTypeRegistry);
-      pdxObjectptr->fromData(std::dynamic_pointer_cast<PdxReader>(prr));
+      auto prr = PdxRemoteReader(dataInput, pType, length, pdxTypeRegistry);
+      pdxObjectptr->fromData(prr);
       auto mergedVersion = pdxTypeRegistry->getMergedType(pType->getTypeId());
 
-      auto preserveData = prr->getPreservedData(mergedVersion, pdxObjectptr);
+      auto preserveData = prr.getPreservedData(mergedVersion, pdxObjectptr);
       if (preserveData != nullptr) {
         pdxTypeRegistry->setPreserveData(
             pdxObjectptr, preserveData,
             cacheImpl
                 ->getExpiryTaskManager());  // it will set data in weakhashmap
       }
-      prr->MoveStream();
+      prr.moveStream();
     }
   } else {
     // type not found; need to get from server
@@ -217,13 +213,13 @@ std::shared_ptr<PdxSerializable> PdxHelper::deserializePdx(
    auto pdxRealObject = pdxObjectptr;
    if (pdxLocalType == nullptr)  // need to know local type
    {
-     auto prtc = std::make_shared<PdxReaderWithTypeCollector>(
-         dataInput, pType, length, pdxTypeRegistry);
-     pdxObjectptr->fromData(std::dynamic_pointer_cast<PdxReader>(prtc));
+     auto prtc =
+         PdxReaderWithTypeCollector(dataInput, pType, length, pdxTypeRegistry);
+     pdxObjectptr->fromData(prtc);
 
      // Check for the PdxWrapper
 
-     pdxLocalType = prtc->getLocalType();
+     pdxLocalType = prtc.getLocalType();
 
      if (pType->Equals(pdxLocalType)) {
        pdxTypeRegistry->addLocalPdxType(pdxRealObject->getClassName(), pType);
@@ -250,21 +246,20 @@ std::shared_ptr<PdxSerializable> PdxHelper::deserializePdx(
 
        auto mergedVersion = pdxTypeRegistry->getMergedType(pType->getTypeId());
 
-       auto preserveData = prtc->getPreservedData(mergedVersion, pdxObjectptr);
-       if (preserveData != nullptr) {
+       if (auto preserveData =
+               prtc.getPreservedData(mergedVersion, pdxObjectptr)) {
          pdxTypeRegistry->setPreserveData(pdxObjectptr, preserveData,
                                           cacheImpl->getExpiryTaskManager());
        }
      }
-     prtc->MoveStream();
+     prtc.moveStream();
    } else {  // remote reader will come here as local type is there
      pType->InitializeType();
      LOGDEBUG("Adding type %d ", pType->getTypeId());
      pdxTypeRegistry->addPdxType(pType->getTypeId(),
                                  pType);  // adding remote type
-     auto prr = std::make_shared<PdxRemoteReader>(dataInput, pType, length,
-                                                  pdxTypeRegistry);
-     pdxObjectptr->fromData(std::dynamic_pointer_cast<PdxReader>(prr));
+     auto prr = PdxRemoteReader(dataInput, pType, length, pdxTypeRegistry);
+     pdxObjectptr->fromData(prr);
 
      // Check for PdxWrapper to getObject.
 
@@ -272,12 +267,12 @@ std::shared_ptr<PdxSerializable> PdxHelper::deserializePdx(
 
      auto mergedVersion = pdxTypeRegistry->getMergedType(pType->getTypeId());
 
-     auto preserveData = prr->getPreservedData(mergedVersion, pdxObjectptr);
+     auto preserveData = prr.getPreservedData(mergedVersion, pdxObjectptr);
      if (preserveData != nullptr) {
        pdxTypeRegistry->setPreserveData(pdxObjectptr, preserveData,
                                         cacheImpl->getExpiryTaskManager());
      }
-     prr->MoveStream();
+     prr.moveStream();
    }
   }
   return pdxObjectptr;
diff --git a/cppcache/src/PdxInstanceImpl.cpp b/cppcache/src/PdxInstanceImpl.cpp
index 185fcc9..ebf542a 100644
--- a/cppcache/src/PdxInstanceImpl.cpp
+++ b/cppcache/src/PdxInstanceImpl.cpp
@@ -90,115 +90,115 @@ PdxInstanceImpl::PdxInstanceImpl(
   m_pdxType->InitializeType();  // to generate static position map
 }
 
-void PdxInstanceImpl::writeField(std::shared_ptr<PdxWriter> writer,
+void PdxInstanceImpl::writeField(PdxWriter& writer,
                                  const std::string& fieldName, int typeId,
                                  std::shared_ptr<Cacheable> value) {
   switch (typeId) {
     case PdxFieldTypes::INT: {
       if (auto&& val = std::dynamic_pointer_cast<CacheableInt32>(value)) {
-        writer->writeInt(fieldName, val->value());
+        writer.writeInt(fieldName, val->value());
       }
       break;
     }
     case PdxFieldTypes::STRING: {
       if (auto&& val = std::dynamic_pointer_cast<CacheableString>(value)) {
-        writer->writeString(fieldName, val->value());
+        writer.writeString(fieldName, val->value());
       }
       break;
     }
     case PdxFieldTypes::BOOLEAN: {
       if (auto&& val = std::dynamic_pointer_cast<CacheableBoolean>(value)) {
-        writer->writeBoolean(fieldName, val->value());
+        writer.writeBoolean(fieldName, val->value());
       }
       break;
     }
     case PdxFieldTypes::FLOAT: {
       if (auto&& val = std::dynamic_pointer_cast<CacheableFloat>(value)) {
-        writer->writeFloat(fieldName, val->value());
+        writer.writeFloat(fieldName, val->value());
       }
       break;
     }
     case PdxFieldTypes::DOUBLE: {
       if (auto&& val = std::dynamic_pointer_cast<CacheableDouble>(value)) {
-        writer->writeDouble(fieldName, val->value());
+        writer.writeDouble(fieldName, val->value());
       }
       break;
     }
     case PdxFieldTypes::CHAR: {
       if (auto&& val = std::dynamic_pointer_cast<CacheableCharacter>(value)) {
-        writer->writeChar(fieldName, val->value());
+        writer.writeChar(fieldName, val->value());
       }
       break;
     }
     case PdxFieldTypes::BYTE: {
       if (auto&& val = std::dynamic_pointer_cast<CacheableByte>(value)) {
-        writer->writeByte(fieldName, val->value());
+        writer.writeByte(fieldName, val->value());
       }
       break;
     }
     case PdxFieldTypes::SHORT: {
       if (auto&& val = std::dynamic_pointer_cast<CacheableInt16>(value)) {
-        writer->writeShort(fieldName, val->value());
+        writer.writeShort(fieldName, val->value());
       }
       break;
     }
     case PdxFieldTypes::LONG: {
       if (auto&& val = std::dynamic_pointer_cast<CacheableInt64>(value)) {
-        writer->writeLong(fieldName, val->value());
+        writer.writeLong(fieldName, val->value());
       }
       break;
     }
     case PdxFieldTypes::BYTE_ARRAY: {
       if (auto&& val = std::dynamic_pointer_cast<CacheableBytes>(value)) {
-        writer->writeByteArray(fieldName, (int8_t*)val->value(), val->length());
+        writer.writeByteArray(fieldName, (int8_t*)val->value(), val->length());
       }
       break;
     }
     case PdxFieldTypes::DOUBLE_ARRAY: {
       if (auto&& val = std::dynamic_pointer_cast<CacheableDoubleArray>(value)) {
-        writer->writeDoubleArray(fieldName, const_cast<double*>(val->value()),
+        writer.writeDoubleArray(fieldName, const_cast<double*>(val->value()),
                                  val->length());
       }
       break;
     }
     case PdxFieldTypes::FLOAT_ARRAY: {
       if (auto&& val = std::dynamic_pointer_cast<CacheableFloatArray>(value)) {
-        writer->writeFloatArray(fieldName, const_cast<float*>(val->value()),
+        writer.writeFloatArray(fieldName, const_cast<float*>(val->value()),
                                 val->length());
       }
       break;
     }
     case PdxFieldTypes::SHORT_ARRAY: {
       if (auto&& val = std::dynamic_pointer_cast<CacheableInt16Array>(value)) {
-        writer->writeShortArray(fieldName, const_cast<int16_t*>(val->value()),
+        writer.writeShortArray(fieldName, const_cast<int16_t*>(val->value()),
                                 val->length());
       }
       break;
     }
     case PdxFieldTypes::INT_ARRAY: {
       if (auto&& val = std::dynamic_pointer_cast<CacheableInt32Array>(value)) {
-        writer->writeIntArray(fieldName, const_cast<int32_t*>(val->value()),
+        writer.writeIntArray(fieldName, const_cast<int32_t*>(val->value()),
                               val->length());
       }
       break;
     }
     case PdxFieldTypes::LONG_ARRAY: {
       if (auto&& val = std::dynamic_pointer_cast<CacheableInt64Array>(value)) {
-        writer->writeLongArray(fieldName, const_cast<int64_t*>(val->value()),
+        writer.writeLongArray(fieldName, const_cast<int64_t*>(val->value()),
                                val->length());
       }
       break;
     }
     case PdxFieldTypes::BOOLEAN_ARRAY: {
       if (auto&& val = std::dynamic_pointer_cast<BooleanArray>(value)) {
-        writer->writeBooleanArray(fieldName, const_cast<bool*>(val->value()),
+        writer.writeBooleanArray(fieldName, const_cast<bool*>(val->value()),
                                   val->length());
       }
       break;
     }
     case PdxFieldTypes::CHAR_ARRAY: {
       if (auto&& val = std::dynamic_pointer_cast<CharArray>(value)) {
-        writer->writeCharArray(fieldName, const_cast<char16_t*>(val->value()),
+        writer.writeCharArray(fieldName, const_cast<char16_t*>(val->value()),
                                val->length());
       }
       break;
@@ -211,13 +211,13 @@ void PdxInstanceImpl::writeField(std::shared_ptr<PdxWriter> writer,
         for (int item = 0; item < size; item++) {
           strings[item] = (*val)[item]->value();
         }
-        writer->writeStringArray(fieldName, strings);
+        writer.writeStringArray(fieldName, strings);
       }
       break;
     }
     case PdxFieldTypes::DATE: {
       if (auto&& date = std::dynamic_pointer_cast<CacheableDate>(value)) {
-        writer->writeDate(fieldName, date);
+        writer.writeDate(fieldName, date);
       }
       break;
     }
@@ -235,8 +235,8 @@ void PdxInstanceImpl::writeField(std::shared_ptr<PdxWriter> writer,
           }
           i++;
         }
-        writer->writeArrayOfByteArrays(fieldName, values,
-                                       static_cast<int>(size), lengths);
+        writer.writeArrayOfByteArrays(fieldName, values, static_cast<int>(size),
+                                      lengths);
         delete[] values;
         delete[] lengths;
       }
@@ -244,11 +244,11 @@ void PdxInstanceImpl::writeField(std::shared_ptr<PdxWriter> writer,
     }
     case PdxFieldTypes::OBJECT_ARRAY: {
       if (auto&& val = std::dynamic_pointer_cast<CacheableObjectArray>(value)) {
-        writer->writeObjectArray(fieldName, val);
+        writer.writeObjectArray(fieldName, val);
       }
       break;
     }
-    default: { writer->writeObject(fieldName, value); }
+    default: { writer.writeObject(fieldName, value); }
   }
 }
 std::shared_ptr<WritablePdxInstance> PdxInstanceImpl::createWriter() {
@@ -1389,20 +1389,20 @@ PdxFieldTypes::PdxFieldType PdxInstanceImpl::getFieldType(
   return static_cast<PdxFieldTypes::PdxFieldType>(pft->getTypeId());
 }
 
-void PdxInstanceImpl::writeUnmodifieldField(
-    DataInput& dataInput, int startPos, int endPos,
-    std::shared_ptr<PdxLocalWriter> localWriter) {
+void PdxInstanceImpl::writeUnmodifieldField(DataInput& dataInput, int startPos,
+                                            int endPos,
+                                            PdxLocalWriter& localWriter) {
   dataInput.reset(startPos);
   for (; startPos < endPos; startPos++) {
-    localWriter->writeByte(dataInput.read());
+    localWriter.writeByte(dataInput.read());
   }
 }
 
-void PdxInstanceImpl::toData(std::shared_ptr<PdxWriter> writer) const {
+void PdxInstanceImpl::toData(PdxWriter& writer) const {
   const_cast<PdxInstanceImpl*>(this)->toDataMutable(writer);
 }
 
-void PdxInstanceImpl::toDataMutable(std::shared_ptr<PdxWriter> writer) {
+void PdxInstanceImpl::toDataMutable(PdxWriter& writer) {
   auto pt = getPdxType();
   std::vector<std::shared_ptr<PdxFieldType>>* pdxFieldList =
       pt->getPdxFieldTypes();
@@ -1431,13 +1431,13 @@ void PdxInstanceImpl::toDataMutable(std::shared_ptr<PdxWriter> writer) {
       } else {
         if (currPf->IsVariableLengthType()) {
           // need to add offset
-          (std::static_pointer_cast<PdxLocalWriter>(writer))->addOffset();
+          (static_cast<PdxLocalWriter&>(writer)).addOffset();
         }
         // write raw byte array...
         nextFieldPosition =
             getNextFieldPosition(*dataInput, static_cast<int>(i) + 1, pt);
         writeUnmodifieldField(*dataInput, position, nextFieldPosition,
-                              std::static_pointer_cast<PdxLocalWriter>(writer));
+                              static_cast<PdxLocalWriter&>(writer));
         position = nextFieldPosition;  // mark next field;
       }
     }
@@ -1454,7 +1454,7 @@ void PdxInstanceImpl::toDataMutable(std::shared_ptr<PdxWriter> writer) {
   m_updatedFields.clear();
 }
 
-void PdxInstanceImpl::fromData(std::shared_ptr<PdxReader> input) {
+void PdxInstanceImpl::fromData(PdxReader& input) {
   throw IllegalStateException(
       "PdxInstance::FromData( .. ) shouldn't have called");
 }
diff --git a/cppcache/src/PdxInstanceImpl.hpp b/cppcache/src/PdxInstanceImpl.hpp
index 5b1b47f..d0ce4fb 100644
--- a/cppcache/src/PdxInstanceImpl.hpp
+++ b/cppcache/src/PdxInstanceImpl.hpp
@@ -198,9 +198,9 @@ class CPPCACHE_EXPORT PdxInstanceImpl : public WritablePdxInstance {
   virtual std::shared_ptr<CacheableStringArray> getFieldNames() override;
 
   // From PdxSerializable
-  virtual void toData(std::shared_ptr<PdxWriter> output) const override;
+  virtual void toData(PdxWriter& output) const override;
 
-  virtual void fromData(std::shared_ptr<PdxReader> input) override;
+  virtual void fromData(PdxReader& input) override;
 
   virtual const std::string& getClassName() const override;
 
@@ -276,12 +276,11 @@ class CPPCACHE_EXPORT PdxInstanceImpl : public WritablePdxInstance {
   bool compareDefaultBytes(DataInput& dataInput, int start, int end,
                            int8_t* defaultBytes, int32_t length) const;
 
-  void writeField(std::shared_ptr<PdxWriter> writer,
-                  const std::string& fieldName, int typeId,
+  void writeField(PdxWriter& writer, const std::string& fieldName, int typeId,
                   std::shared_ptr<Cacheable> value);
 
   void writeUnmodifieldField(DataInput& dataInput, int startPos, int endPos,
-                             std::shared_ptr<PdxLocalWriter> localWriter);
+                             PdxLocalWriter& localWriter);
 
   void setOffsetForObject(DataInput& dataInput, std::shared_ptr<PdxType> pt,
                           int sequenceId) const;
@@ -297,7 +296,7 @@ class CPPCACHE_EXPORT PdxInstanceImpl : public WritablePdxInstance {
 
   std::shared_ptr<PdxTypeRegistry> getPdxTypeRegistry() const;
 
-  void toDataMutable(std::shared_ptr<PdxWriter> output);
+  void toDataMutable(PdxWriter& output);
 
   static int deepArrayHashCode(std::shared_ptr<Cacheable> obj);
 
diff --git a/cppcache/src/PdxLocalReader.cpp b/cppcache/src/PdxLocalReader.cpp
index f18770d..e2420e0 100644
--- a/cppcache/src/PdxLocalReader.cpp
+++ b/cppcache/src/PdxLocalReader.cpp
@@ -88,7 +88,7 @@ void PdxLocalReader::initialize() {
   m_offsetsBuffer = m_startBuffer + m_serializedLength;
 }
 
-void PdxLocalReader::MoveStream() {
+void PdxLocalReader::moveStream() {
   // this will reset unmaged datainput as well
   m_dataInput->reset(m_startPosition + m_serializedLengthWithOffsets);
 }
diff --git a/cppcache/src/PdxLocalReader.hpp b/cppcache/src/PdxLocalReader.hpp
index 9d6a4c6..e7b0d24 100644
--- a/cppcache/src/PdxLocalReader.hpp
+++ b/cppcache/src/PdxLocalReader.hpp
@@ -58,7 +58,7 @@ class PdxLocalReader : public PdxReader {
 
   virtual ~PdxLocalReader();
 
-  void MoveStream();
+  void moveStream();
 
   virtual std::shared_ptr<PdxRemotePreservedData> getPreservedData(
       std::shared_ptr<PdxType> mergedVersion,
diff --git a/cppcache/src/PdxLocalWriter.cpp b/cppcache/src/PdxLocalWriter.cpp
index 588bf95..10b0ab9 100644
--- a/cppcache/src/PdxLocalWriter.cpp
+++ b/cppcache/src/PdxLocalWriter.cpp
@@ -113,7 +113,7 @@ void PdxLocalWriter::writeOffsets(int32_t len) {
     }
   }
 }
-std::shared_ptr<PdxWriter> PdxLocalWriter::writeUnreadFields(
+PdxWriter& PdxLocalWriter::writeUnreadFields(
     std::shared_ptr<PdxUnreadFields> unread) {
   if (isFieldWritingStarted()) {
     throw IllegalStateException(
@@ -137,7 +137,7 @@ std::shared_ptr<PdxWriter> PdxLocalWriter::writeUnreadFields(
           "nullptr");
     }
   }
-  return shared_from_this();
+  return *this;
 }
 
 int32_t PdxLocalWriter::calculateLenWithOffsets() {
@@ -160,75 +160,75 @@ int32_t PdxLocalWriter::calculateLenWithOffsets() {
 
 bool PdxLocalWriter::isFieldWritingStarted() { return true; }
 
-std::shared_ptr<PdxWriter> PdxLocalWriter::writeChar(
+PdxWriter& PdxLocalWriter::writeChar(
     const std::string& fieldName, char16_t value) {
   m_dataOutput->writeChar(value);
-  return shared_from_this();
+  return *this;
 }
-std::shared_ptr<PdxWriter> PdxLocalWriter::writeBoolean(
-    const std::string& fieldName, bool value) {
+PdxWriter& PdxLocalWriter::writeBoolean(const std::string& fieldName,
+                                        bool value) {
   m_dataOutput->writeBoolean(value);
-  return shared_from_this();
+  return *this;
  }
- std::shared_ptr<PdxWriter> PdxLocalWriter::writeByte(
-     const std::string& fieldName, int8_t value) {
+ PdxWriter& PdxLocalWriter::writeByte(const std::string& fieldName,
+                                      int8_t value) {
    m_dataOutput->write(value);
-   return shared_from_this();
+   return *this;
  }
- std::shared_ptr<PdxWriter> PdxLocalWriter::writeShort(
-     const std::string& fieldName, int16_t value) {
+ PdxWriter& PdxLocalWriter::writeShort(const std::string& fieldName,
+                                       int16_t value) {
    m_dataOutput->writeInt(value);
-   return shared_from_this();
+   return *this;
 }
-std::shared_ptr<PdxWriter> PdxLocalWriter::writeInt(
-    const std::string& fieldName, int32_t value) {
+PdxWriter& PdxLocalWriter::writeInt(const std::string& fieldName,
+                                    int32_t value) {
   m_dataOutput->writeInt(value);
-  return shared_from_this();
+  return *this;
  }
- std::shared_ptr<PdxWriter> PdxLocalWriter::writeLong(
-     const std::string& fieldName, int64_t value) {
+ PdxWriter& PdxLocalWriter::writeLong(const std::string& fieldName,
+                                      int64_t value) {
    m_dataOutput->writeInt(value);
-   return shared_from_this();
+   return *this;
  }
- std::shared_ptr<PdxWriter> PdxLocalWriter::writeFloat(
-     const std::string& fieldName, float value) {
+ PdxWriter& PdxLocalWriter::writeFloat(const std::string& fieldName,
+                                       float value) {
    m_dataOutput->writeFloat(value);
-   return shared_from_this();
+   return *this;
  }
- std::shared_ptr<PdxWriter> PdxLocalWriter::writeDouble(
-     const std::string& fieldName, double value) {
+ PdxWriter& PdxLocalWriter::writeDouble(const std::string& fieldName,
+                                        double value) {
    m_dataOutput->writeDouble(value);
-   return shared_from_this();
+   return *this;
  }
- std::shared_ptr<PdxWriter> PdxLocalWriter::writeDate(
-     const std::string& fieldName, std::shared_ptr<CacheableDate> date) {
+ PdxWriter& PdxLocalWriter::writeDate(const std::string& fieldName,
+                                      std::shared_ptr<CacheableDate> date) {
    // m_dataOutput->writeObject(date.get());
    if (date != nullptr) {
      date->toData(*m_dataOutput);
    } else {
      m_dataOutput->writeInt(static_cast<uint64_t>(-1L));
    }
-   return shared_from_this();
+   return *this;
 }
 
-std::shared_ptr<PdxWriter> PdxLocalWriter::writeString(
+PdxWriter& PdxLocalWriter::writeString(
     const std::string& fieldName, const std::string& value) {
   addOffset();
   m_dataOutput->writeString(value);
-  return shared_from_this();
+  return *this;
 }
 
-std::shared_ptr<PdxWriter> PdxLocalWriter::writeStringArray(
+PdxWriter& PdxLocalWriter::writeStringArray(
     const std::string& fieldName, const std::vector<std::string>& array) {
   addOffset();
   m_dataOutput->writeArrayLen(array.size());
   for (auto&& entry : array) {
     m_dataOutput->writeString(entry);
   }
-  return shared_from_this();
+  return *this;
 }
 
-std::shared_ptr<PdxWriter> PdxLocalWriter::writeObject(
+PdxWriter& PdxLocalWriter::writeObject(
     const std::string& fieldName, std::shared_ptr<Serializable> value) {
   addOffset();
   std::shared_ptr<CacheableEnum> enumValPtr = nullptr;
@@ -271,59 +271,59 @@ std::shared_ptr<PdxWriter> PdxLocalWriter::writeObject(
       m_dataOutput->writeObject(value);
     }
   }
-  return shared_from_this();
+  return *this;
 }
-std::shared_ptr<PdxWriter> PdxLocalWriter::writeBooleanArray(
-    const std::string& fieldName, bool* array, int length) {
+PdxWriter& PdxLocalWriter::writeBooleanArray(const std::string& fieldName,
+                                             bool* array, int length) {
   addOffset();
   writeObject(array, length);
-  return shared_from_this();
+  return *this;
 }
 
-std::shared_ptr<PdxWriter> PdxLocalWriter::writeCharArray(
+PdxWriter& PdxLocalWriter::writeCharArray(
     const std::string& fieldName, char16_t* array, int length) {
   addOffset();
   writeObject(array, length);
-  return shared_from_this();
+  return *this;
 }
 
-std::shared_ptr<PdxWriter> PdxLocalWriter::writeByteArray(
+PdxWriter& PdxLocalWriter::writeByteArray(
     const std::string& fieldName, int8_t* array, int length) {
   addOffset();
   writeObject(array, length);
-  return shared_from_this();
+  return *this;
 }
-std::shared_ptr<PdxWriter> PdxLocalWriter::writeShortArray(
-    const std::string& fieldName, int16_t* array, int length) {
+PdxWriter& PdxLocalWriter::writeShortArray(const std::string& fieldName,
+                                           int16_t* array, int length) {
   addOffset();
   writeObject(array, length);
-  return shared_from_this();
+  return *this;
 }
-std::shared_ptr<PdxWriter> PdxLocalWriter::writeIntArray(
-    const std::string& fieldName, int32_t* array, int length) {
+PdxWriter& PdxLocalWriter::writeIntArray(const std::string& fieldName,
+                                         int32_t* array, int length) {
   addOffset();
   writeObject(array, length);
-  return shared_from_this();
+  return *this;
 }
-std::shared_ptr<PdxWriter> PdxLocalWriter::writeLongArray(
-    const std::string& fieldName, int64_t* array, int length) {
+PdxWriter& PdxLocalWriter::writeLongArray(const std::string& fieldName,
+                                          int64_t* array, int length) {
   addOffset();
   writeObject(array, length);
-  return shared_from_this();
+  return *this;
  }
- std::shared_ptr<PdxWriter> PdxLocalWriter::writeFloatArray(
-     const std::string& fieldName, float* array, int length) {
+ PdxWriter& PdxLocalWriter::writeFloatArray(const std::string& fieldName,
+                                            float* array, int length) {
    addOffset();
    writeObject(array, length);
-   return shared_from_this();
+   return *this;
  }
- std::shared_ptr<PdxWriter> PdxLocalWriter::writeDoubleArray(
-     const std::string& fieldName, double* array, int length) {
+ PdxWriter& PdxLocalWriter::writeDoubleArray(const std::string& fieldName,
+                                             double* array, int length) {
    addOffset();
    writeObject(array, length);
-   return shared_from_this();
+   return *this;
  }
- std::shared_ptr<PdxWriter> PdxLocalWriter::writeObjectArray(
+ PdxWriter& PdxLocalWriter::writeObjectArray(
      const std::string& fieldName,
      std::shared_ptr<CacheableObjectArray> array) {
    addOffset();
@@ -332,9 +332,9 @@ std::shared_ptr<PdxWriter> PdxLocalWriter::writeLongArray(
    } else {
      m_dataOutput->write(static_cast<int8_t>(-1));
    }
-   return shared_from_this();
+   return *this;
 }
-std::shared_ptr<PdxWriter> PdxLocalWriter::writeArrayOfByteArrays(
+PdxWriter& PdxLocalWriter::writeArrayOfByteArrays(
     const std::string& fieldName, int8_t* const* const byteArrays,
     int arrayLength, const int* elementLength) {
   addOffset();
@@ -347,11 +347,10 @@ std::shared_ptr<PdxWriter> PdxLocalWriter::writeArrayOfByteArrays(
     m_dataOutput->write(static_cast<int8_t>(-1));
   }
 
-  return shared_from_this();
+  return *this;
 }
-std::shared_ptr<PdxWriter> PdxLocalWriter::markIdentityField(
-    const std::string& fieldName) {
-  return shared_from_this();
+PdxWriter& PdxLocalWriter::markIdentityField(const std::string& fieldName) {
+  return *this;
 }
 
 uint8_t* PdxLocalWriter::getPdxStream(int& pdxLen) {
diff --git a/cppcache/src/PdxLocalWriter.hpp b/cppcache/src/PdxLocalWriter.hpp
index 5194899..164c75f 100644
--- a/cppcache/src/PdxLocalWriter.hpp
+++ b/cppcache/src/PdxLocalWriter.hpp
@@ -34,8 +34,7 @@ namespace apache {
 namespace geode {
 namespace client {
 
-class PdxLocalWriter : public PdxWriter,
-                       public std::enable_shared_from_this<PdxLocalWriter> {
+class PdxLocalWriter : public PdxWriter {
  protected:
   DataOutput* m_dataOutput;
   std::shared_ptr<PdxType> m_pdxType;
@@ -49,6 +48,8 @@ class PdxLocalWriter : public PdxWriter,
   std::shared_ptr<PdxTypeRegistry> m_pdxTypeRegistry;
   std::string m_pdxClassName;
 
+  PdxLocalWriter() = default;
+
  public:
   PdxLocalWriter(DataOutput& output, std::shared_ptr<PdxType> pdxType,
                  std::shared_ptr<PdxTypeRegistry> pdxTypeRegistry);
@@ -57,6 +58,8 @@ class PdxLocalWriter : public PdxWriter,
                  std::string pdxDomainType,
                  std::shared_ptr<PdxTypeRegistry> pdxTypeRegistry);
 
+  PdxLocalWriter(PdxLocalWriter&& move) = default;
+
   virtual ~PdxLocalWriter();
 
   void initialize();
@@ -107,82 +110,79 @@ class PdxLocalWriter : public PdxWriter,
     }
   }
 
-  virtual std::shared_ptr<PdxWriter> writeChar(const std::string& fieldName,
+  virtual PdxWriter& writeChar(const std::string& fieldName,
                                                char16_t value) override;
 
-  virtual std::shared_ptr<PdxWriter> writeBoolean(const std::string& fieldName,
-                                                  bool value) override;
+  virtual PdxWriter& writeBoolean(const std::string& fieldName,
+                                  bool value) override;
 
-  virtual std::shared_ptr<PdxWriter> writeByte(const std::string& fieldName,
-                                               int8_t value) override;
+  virtual PdxWriter& writeByte(const std::string& fieldName,
+                               int8_t value) override;
 
-  virtual std::shared_ptr<PdxWriter> writeShort(const std::string& fieldName,
-                                                int16_t value) override;
+  virtual PdxWriter& writeShort(const std::string& fieldName,
+                                int16_t value) override;
 
-  virtual std::shared_ptr<PdxWriter> writeInt(const std::string& fieldName,
-                                              int32_t value) override;
+  virtual PdxWriter& writeInt(const std::string& fieldName,
+                              int32_t value) override;
 
-  virtual std::shared_ptr<PdxWriter> writeLong(const std::string& fieldName,
-                                               int64_t value) override;
+  virtual PdxWriter& writeLong(const std::string& fieldName,
+                               int64_t value) override;
 
-  virtual std::shared_ptr<PdxWriter> writeFloat(const std::string& fieldName,
-                                                float value) override;
+  virtual PdxWriter& writeFloat(const std::string& fieldName,
+                                float value) override;
 
-  virtual std::shared_ptr<PdxWriter> writeDouble(const std::string& fieldName,
-                                                 double value) override;
+  virtual PdxWriter& writeDouble(const std::string& fieldName,
+                                 double value) override;
 
-  virtual std::shared_ptr<PdxWriter> writeDate(
-      const std::string& fieldName,
-      std::shared_ptr<CacheableDate> date) override;
+  virtual PdxWriter& writeDate(const std::string& fieldName,
+                               std::shared_ptr<CacheableDate> date) override;
 
-  virtual std::shared_ptr<PdxWriter> writeString(
+  virtual PdxWriter& writeString(
       const std::string& fieldName, const std::string& value) override;
 
-  virtual std::shared_ptr<PdxWriter> writeObject(
+  virtual PdxWriter& writeObject(
       const std::string& fieldName,
       std::shared_ptr<Serializable> value) override;
 
-  virtual std::shared_ptr<PdxWriter> writeBooleanArray(
-      const std::string& fieldName, bool* array, int length) override;
+  virtual PdxWriter& writeBooleanArray(const std::string& fieldName,
+                                       bool* array, int length) override;
 
-  virtual std::shared_ptr<PdxWriter> writeCharArray(
+  virtual PdxWriter& writeCharArray(
       const std::string& fieldName, char16_t* array, int length) override;
 
-  virtual std::shared_ptr<PdxWriter> writeByteArray(
-      const std::string& fieldName, int8_t* array, int length) override;
+  virtual PdxWriter& writeByteArray(const std::string& fieldName, int8_t* array,
+                                    int length) override;
 
-  virtual std::shared_ptr<PdxWriter> writeShortArray(
-      const std::string& fieldName, int16_t* array, int length) override;
+  virtual PdxWriter& writeShortArray(const std::string& fieldName,
+                                     int16_t* array, int length) override;
 
-  virtual std::shared_ptr<PdxWriter> writeIntArray(const std::string& fieldName,
-                                                   int32_t* array,
-                                                   int length) override;
+  virtual PdxWriter& writeIntArray(const std::string& fieldName, int32_t* array,
+                                   int length) override;
 
-  virtual std::shared_ptr<PdxWriter> writeLongArray(
-      const std::string& fieldName, int64_t* array, int length) override;
+  virtual PdxWriter& writeLongArray(const std::string& fieldName,
+                                    int64_t* array, int length) override;
 
-  virtual std::shared_ptr<PdxWriter> writeFloatArray(
-      const std::string& fieldName, float* array, int length) override;
+  virtual PdxWriter& writeFloatArray(const std::string& fieldName, float* array,
+                                     int length) override;
 
-  virtual std::shared_ptr<PdxWriter> writeDoubleArray(
-      const std::string& fieldName, double* array, int length) override;
+  virtual PdxWriter& writeDoubleArray(const std::string& fieldName,
+                                      double* array, int length) override;
 
-  virtual std::shared_ptr<PdxWriter> writeStringArray(
+  virtual PdxWriter& writeStringArray(
       const std::string& fieldName,
       const std::vector<std::string>& array) override;
 
-  virtual std::shared_ptr<PdxWriter> writeObjectArray(
+  virtual PdxWriter& writeObjectArray(
       const std::string& fieldName,
       std::shared_ptr<CacheableObjectArray> array) override;
 
-  virtual std::shared_ptr<PdxWriter> writeArrayOfByteArrays(
+  virtual PdxWriter& writeArrayOfByteArrays(
       const std::string& fieldName, int8_t* const* const array, int arrayLength,
       const int* elementLength) override;
 
-  virtual std::shared_ptr<PdxWriter> markIdentityField(
-      const std::string& fieldName) override;
+  virtual PdxWriter& markIdentityField(const std::string& fieldName) override;
 
-  virtual std::shared_ptr<PdxWriter> writeUnreadFields(
+  virtual PdxWriter& writeUnreadFields(
       std::shared_ptr<PdxUnreadFields> unread) override;
 
   // this is used to get pdx stream when WriteablePdxStream udpadates the field
diff --git a/cppcache/src/PdxRemoteWriter.cpp b/cppcache/src/PdxRemoteWriter.cpp
index d226b4f..6d00ce7 100644
--- a/cppcache/src/PdxRemoteWriter.cpp
+++ b/cppcache/src/PdxRemoteWriter.cpp
@@ -123,152 +123,152 @@ bool PdxRemoteWriter::isFieldWritingStarted() {
                                   // this??
 }
 
-std::shared_ptr<PdxWriter> PdxRemoteWriter::writeUnreadFields(
+PdxWriter& PdxRemoteWriter::writeUnreadFields(
     std::shared_ptr<PdxUnreadFields> unread) {
   PdxLocalWriter::writeUnreadFields(unread);
   m_remoteTolocalMap = m_pdxType->getRemoteToLocalMap();
   m_remoteTolocalMapLength = m_pdxType->getTotalFields();
-  return shared_from_this();
+  return *this;
 }
 
-std::shared_ptr<PdxWriter> PdxRemoteWriter::writeChar(
+PdxWriter& PdxRemoteWriter::writeChar(
     const std::string& fieldName, char16_t value) {
   writePreserveData();
   PdxLocalWriter::writeChar(fieldName, value);
-  return shared_from_this();
+  return *this;
 }
-std::shared_ptr<PdxWriter> PdxRemoteWriter::writeBoolean(
-    const std::string& fieldName, bool value) {
+PdxWriter& PdxRemoteWriter::writeBoolean(const std::string& fieldName,
+                                         bool value) {
   writePreserveData();
   PdxLocalWriter::writeBoolean(fieldName, value);
-  return shared_from_this();
+  return *this;
 }
-std::shared_ptr<PdxWriter> PdxRemoteWriter::writeByte(
-    const std::string& fieldName, int8_t value) {
+PdxWriter& PdxRemoteWriter::writeByte(const std::string& fieldName,
+                                      int8_t value) {
   writePreserveData();
   PdxLocalWriter::writeByte(fieldName, value);
-  return shared_from_this();
+  return *this;
 }
-std::shared_ptr<PdxWriter> PdxRemoteWriter::writeShort(
-    const std::string& fieldName, int16_t value) {
+PdxWriter& PdxRemoteWriter::writeShort(const std::string& fieldName,
+                                       int16_t value) {
   writePreserveData();
   PdxLocalWriter::writeShort(fieldName, value);
-  return shared_from_this();
+  return *this;
 }
-std::shared_ptr<PdxWriter> PdxRemoteWriter::writeInt(
-    const std::string& fieldName, int32_t value) {
+PdxWriter& PdxRemoteWriter::writeInt(const std::string& fieldName,
+                                     int32_t value) {
   writePreserveData();
   PdxLocalWriter::writeInt(fieldName, value);
-  return shared_from_this();
+  return *this;
 }
-std::shared_ptr<PdxWriter> PdxRemoteWriter::writeLong(
-    const std::string& fieldName, int64_t value) {
+PdxWriter& PdxRemoteWriter::writeLong(const std::string& fieldName,
+                                      int64_t value) {
   writePreserveData();
   PdxLocalWriter::writeLong(fieldName, value);
-  return shared_from_this();
+  return *this;
 }
-std::shared_ptr<PdxWriter> PdxRemoteWriter::writeFloat(
-    const std::string& fieldName, float value) {
+PdxWriter& PdxRemoteWriter::writeFloat(const std::string& fieldName,
+                                       float value) {
   writePreserveData();
   PdxLocalWriter::writeFloat(fieldName, value);
-  return shared_from_this();
+  return *this;
 }
-std::shared_ptr<PdxWriter> PdxRemoteWriter::writeDouble(
-    const std::string& fieldName, double value) {
+PdxWriter& PdxRemoteWriter::writeDouble(const std::string& fieldName,
+                                        double value) {
   writePreserveData();
   PdxLocalWriter::writeDouble(fieldName, value);
-  return shared_from_this();
+  return *this;
 }
-std::shared_ptr<PdxWriter> PdxRemoteWriter::writeDate(
-    const std::string& fieldName, std::shared_ptr<CacheableDate> date) {
+PdxWriter& PdxRemoteWriter::writeDate(const std::string& fieldName,
+                                      std::shared_ptr<CacheableDate> date) {
   writePreserveData();
   PdxLocalWriter::writeDate(fieldName, date);
-  return shared_from_this();
+  return *this;
 }
 
-std::shared_ptr<PdxWriter> PdxRemoteWriter::writeString(
+PdxWriter& PdxRemoteWriter::writeString(
     const std::string& fieldName, const std::string& value) {
   writePreserveData();
   PdxLocalWriter::writeString(fieldName, value);
-  return shared_from_this();
+  return *this;
 }
 
-std::shared_ptr<PdxWriter> PdxRemoteWriter::writeStringArray(
+PdxWriter& PdxRemoteWriter::writeStringArray(
     const std::string& fieldName, const std::vector<std::string>& array) {
   writePreserveData();
   PdxLocalWriter::writeStringArray(fieldName, array);
-  return shared_from_this();
+  return *this;
 }
 
-std::shared_ptr<PdxWriter> PdxRemoteWriter::writeObject(
+PdxWriter& PdxRemoteWriter::writeObject(
     const std::string& fieldName, std::shared_ptr<Serializable> value) {
   writePreserveData();
   PdxLocalWriter::writeObject(fieldName, value);
-  return shared_from_this();
+  return *this;
 }
-std::shared_ptr<PdxWriter> PdxRemoteWriter::writeBooleanArray(
-    const std::string& fieldName, bool* array, int length) {
+PdxWriter& PdxRemoteWriter::writeBooleanArray(const std::string& fieldName,
+                                              bool* array, int length) {
   writePreserveData();
   PdxLocalWriter::writeBooleanArray(fieldName, array, length);
-  return shared_from_this();
+  return *this;
 }
 
-std::shared_ptr<PdxWriter> PdxRemoteWriter::writeCharArray(
+PdxWriter& PdxRemoteWriter::writeCharArray(
     const std::string& fieldName, char16_t* array, int length) {
   writePreserveData();
   PdxLocalWriter::writeCharArray(fieldName, array, length);
-  return shared_from_this();
+  return *this;
 }
 
-std::shared_ptr<PdxWriter> PdxRemoteWriter::writeByteArray(
+PdxWriter& PdxRemoteWriter::writeByteArray(
     const std::string& fieldName, int8_t* array, int length) {
   writePreserveData();
   PdxLocalWriter::writeByteArray(fieldName, array, length);
-  return shared_from_this();
+  return *this;
 }
-std::shared_ptr<PdxWriter> PdxRemoteWriter::writeShortArray(
-    const std::string& fieldName, int16_t* array, int length) {
+PdxWriter& PdxRemoteWriter::writeShortArray(const std::string& fieldName,
+                                            int16_t* array, int length) {
   writePreserveData();
   PdxLocalWriter::writeShortArray(fieldName, array, length);
-  return shared_from_this();
+  return *this;
 }
-std::shared_ptr<PdxWriter> PdxRemoteWriter::writeIntArray(
-    const std::string& fieldName, int32_t* array, int length) {
+PdxWriter& PdxRemoteWriter::writeIntArray(const std::string& fieldName,
+                                          int32_t* array, int length) {
   writePreserveData();
   PdxLocalWriter::writeIntArray(fieldName, array, length);
-  return shared_from_this();
+  return *this;
 }
-std::shared_ptr<PdxWriter> PdxRemoteWriter::writeLongArray(
-    const std::string& fieldName, int64_t* array, int length) {
+PdxWriter& PdxRemoteWriter::writeLongArray(const std::string& fieldName,
+                                           int64_t* array, int length) {
   writePreserveData();
   PdxLocalWriter::writeLongArray(fieldName, array, length);
-  return shared_from_this();
+  return *this;
 }
-std::shared_ptr<PdxWriter> PdxRemoteWriter::writeFloatArray(
-    const std::string& fieldName, float* array, int length) {
+PdxWriter& PdxRemoteWriter::writeFloatArray(const std::string& fieldName,
+                                            float* array, int length) {
   writePreserveData();
   PdxLocalWriter::writeFloatArray(fieldName, array, length);
-  return shared_from_this();
+  return *this;
 }
-std::shared_ptr<PdxWriter> PdxRemoteWriter::writeDoubleArray(
-    const std::string& fieldName, double* array, int length) {
+PdxWriter& PdxRemoteWriter::writeDoubleArray(const std::string& fieldName,
+                                             double* array, int length) {
   writePreserveData();
   PdxLocalWriter::writeDoubleArray(fieldName, array, length);
-  return shared_from_this();
+  return *this;
 }
-std::shared_ptr<PdxWriter> PdxRemoteWriter::writeObjectArray(
+PdxWriter& PdxRemoteWriter::writeObjectArray(
     const std::string& fieldName, std::shared_ptr<CacheableObjectArray> array) {
   writePreserveData();
   PdxLocalWriter::writeObjectArray(fieldName, array);
-  return shared_from_this();
+  return *this;
 }
-std::shared_ptr<PdxWriter> PdxRemoteWriter::writeArrayOfByteArrays(
+PdxWriter& PdxRemoteWriter::writeArrayOfByteArrays(
     const std::string& fieldName, int8_t* const* const byteArrays,
     int arrayLength, const int* elementLength) {
   writePreserveData();
   PdxLocalWriter::writeArrayOfByteArrays(fieldName, byteArrays, arrayLength,
                                          elementLength);
-  return shared_from_this();
+  return *this;
 }
 std::shared_ptr<PdxTypeRegistry> PdxRemoteWriter::getPdxTypeRegistry() const {
   return m_pdxTypeRegistry;
diff --git a/cppcache/src/PdxRemoteWriter.hpp b/cppcache/src/PdxRemoteWriter.hpp
index d85c567..abcae17 100644
--- a/cppcache/src/PdxRemoteWriter.hpp
+++ b/cppcache/src/PdxRemoteWriter.hpp
@@ -44,6 +44,8 @@ class PdxRemoteWriter : public PdxLocalWriter {
  public:
   virtual ~PdxRemoteWriter() override;
 
+  PdxRemoteWriter() = default;
+
   PdxRemoteWriter(DataOutput& output, std::shared_ptr<PdxType> pdxType,
                   std::shared_ptr<PdxRemotePreservedData> preservedData,
                   std::shared_ptr<PdxTypeRegistry> pdxTypeRegistry);
@@ -51,83 +53,85 @@ class PdxRemoteWriter : public PdxLocalWriter {
   PdxRemoteWriter(DataOutput& output, std::string pdxClassName,
                   std::shared_ptr<PdxTypeRegistry> pdxTypeRegistry);
 
+  PdxRemoteWriter(PdxRemoteWriter&& move) = default;
+
   virtual void endObjectWriting() override;
 
   virtual bool isFieldWritingStarted() override;
 
-  virtual std::shared_ptr<PdxWriter> writeUnreadFields(
+  virtual PdxWriter& writeUnreadFields(
       std::shared_ptr<PdxUnreadFields> unread) override;
 
 
-  virtual std::shared_ptr<PdxWriter> writeChar(const std::string& fieldName,
-                                               char16_t value) override;
+  virtual PdxWriter& writeChar(const std::string& fieldName,
+                               char16_t value) override;
 
-  virtual std::shared_ptr<PdxWriter> writeBoolean(const std::string& fieldName,
+  virtual PdxWriter& writeBoolean(const std::string& fieldName,
                                                   bool value) override;
 
-  virtual std::shared_ptr<PdxWriter> writeByte(const std::string& fieldName,
+  virtual PdxWriter& writeByte(const std::string& fieldName,
                                                int8_t value) override;
 
-  virtual std::shared_ptr<PdxWriter> writeShort(const std::string& fieldName,
+  virtual PdxWriter& writeShort(const std::string& fieldName,
                                                 int16_t value) override;
 
-  virtual std::shared_ptr<PdxWriter> writeInt(const std::string& fieldName,
+  virtual PdxWriter& writeInt(const std::string& fieldName,
                                               int32_t value) override;
 
-  virtual std::shared_ptr<PdxWriter> writeLong(const std::string& fieldName,
+  virtual PdxWriter& writeLong(const std::string& fieldName,
                                                int64_t value) override;
 
-  virtual std::shared_ptr<PdxWriter> writeFloat(const std::string& fieldName,
+  virtual PdxWriter& writeFloat(const std::string& fieldName,
                                                 float value) override;
 
-  virtual std::shared_ptr<PdxWriter> writeDouble(const std::string& fieldName,
+  virtual PdxWriter& writeDouble(const std::string& fieldName,
                                                  double value) override;
 
-  virtual std::shared_ptr<PdxWriter> writeDate(
+  virtual PdxWriter& writeDate(
       const std::string& fieldName,
       std::shared_ptr<CacheableDate> date) override;
 
-  virtual std::shared_ptr<PdxWriter> writeString(
+  virtual PdxWriter& writeString(
       const std::string& fieldName, const std::string& value) override;
 
-  virtual std::shared_ptr<PdxWriter> writeObject(
+  virtual PdxWriter& writeObject(
       const std::string& fieldName,
       std::shared_ptr<Serializable> value) override;
 
-  virtual std::shared_ptr<PdxWriter> writeBooleanArray(
+  virtual PdxWriter& writeBooleanArray(
       const std::string& fieldName, bool* array, int length) override;
 
-  virtual std::shared_ptr<PdxWriter> writeCharArray(
+  virtual PdxWriter& writeCharArray(
       const std::string& fieldName, char16_t* array, int length) override;
 
-  virtual std::shared_ptr<PdxWriter> writeByteArray(
+  virtual PdxWriter& writeByteArray(
       const std::string& fieldName, int8_t* array, int length) override;
 
-  virtual std::shared_ptr<PdxWriter> writeShortArray(
+  virtual PdxWriter& writeShortArray(
       const std::string& fieldName, int16_t* array, int length) override;
 
-  virtual std::shared_ptr<PdxWriter> writeIntArray(const std::string& fieldName,
+  virtual PdxWriter& writeIntArray(const std::string& fieldName,
                                                    int32_t* array,
                                                    int length) override;
 
-  virtual std::shared_ptr<PdxWriter> writeLongArray(
+  virtual PdxWriter& writeLongArray(
       const std::string& fieldName, int64_t* array, int length) override;
 
-  virtual std::shared_ptr<PdxWriter> writeFloatArray(
+  virtual PdxWriter& writeFloatArray(
       const std::string& fieldName, float* array, int length) override;
 
-  virtual std::shared_ptr<PdxWriter> writeDoubleArray(
+  virtual PdxWriter& writeDoubleArray(
       const std::string& fieldName, double* array, int length) override;
 
-  virtual std::shared_ptr<PdxWriter> writeStringArray(
+  virtual PdxWriter& writeStringArray(
       const std::string& fieldName,
       const std::vector<std::string>& array) override;
 
-  virtual std::shared_ptr<PdxWriter> writeObjectArray(
+  virtual PdxWriter& writeObjectArray(
       const std::string& fieldName,
       std::shared_ptr<CacheableObjectArray> array) override;
 
-  virtual std::shared_ptr<PdxWriter> writeArrayOfByteArrays(
+  virtual PdxWriter& writeArrayOfByteArrays(
       const std::string& fieldName, int8_t* const* const array, int arrayLength,
       const int* elementLength) override;
 };
diff --git a/cppcache/src/PdxWrapper.cpp b/cppcache/src/PdxWrapper.cpp
index d303c58..0f3aae6 100644
--- a/cppcache/src/PdxWrapper.cpp
+++ b/cppcache/src/PdxWrapper.cpp
@@ -106,7 +106,7 @@ int32_t PdxWrapper::hashcode() const {
   return apache::geode::client::serializer::hashcode(hash);
 }
 
-void PdxWrapper::toData(std::shared_ptr<PdxWriter> output) const {
+void PdxWrapper::toData(PdxWriter &output) const {
   if (m_userObject != nullptr) {
     m_serializer->toData(m_userObject, m_className.c_str(), output);
   } else {
@@ -116,7 +116,7 @@ void PdxWrapper::toData(std::shared_ptr<PdxWriter> output) const {
   }
 }
 
-void PdxWrapper::fromData(std::shared_ptr<PdxReader> input) {
+void PdxWrapper::fromData(PdxReader &input) {
   m_userObject = m_serializer->fromData(m_className.c_str(), input);
 }
 
diff --git a/cppcache/src/PdxWriterWithTypeCollector.cpp b/cppcache/src/PdxWriterWithTypeCollector.cpp
index c6d31ab..213ac2c 100644
--- a/cppcache/src/PdxWriterWithTypeCollector.cpp
+++ b/cppcache/src/PdxWriterWithTypeCollector.cpp
@@ -94,175 +94,175 @@ void PdxWriterWithTypeCollector::addOffset() {
 bool PdxWriterWithTypeCollector::isFieldWritingStarted() {
   return m_pdxType->getTotalFields() > 0;
 }
-std::shared_ptr<PdxWriter> PdxWriterWithTypeCollector::writeUnreadFields(
+PdxWriter& PdxWriterWithTypeCollector::writeUnreadFields(
     std::shared_ptr<PdxUnreadFields> unread) {
   PdxLocalWriter::writeUnreadFields(unread);
-  return shared_from_this();
+  return *this;
 }
 
-std::shared_ptr<PdxWriter> PdxWriterWithTypeCollector::writeChar(
+PdxWriter& PdxWriterWithTypeCollector::writeChar(
     const std::string& fieldName, char16_t value) {
   m_pdxType->addFixedLengthTypeField(fieldName, "char", PdxFieldTypes::CHAR,
                                      PdxTypes::CHAR_SIZE);
   PdxLocalWriter::writeChar(fieldName, value);
-  return shared_from_this();
+  return *this;
  }
- std::shared_ptr<PdxWriter> PdxWriterWithTypeCollector::writeBoolean(
+ PdxWriter& PdxWriterWithTypeCollector::writeBoolean(
      const std::string& fieldName, bool value) {
    m_pdxType->addFixedLengthTypeField(
        fieldName, "boolean", PdxFieldTypes::BOOLEAN, PdxTypes::BOOLEAN_SIZE);
    PdxLocalWriter::writeBoolean(fieldName, value);
-   return shared_from_this();
+   return *this;
  }
- std::shared_ptr<PdxWriter> PdxWriterWithTypeCollector::writeByte(
-     const std::string& fieldName, int8_t value) {
+ PdxWriter& PdxWriterWithTypeCollector::writeByte(const std::string& fieldName,
+                                                  int8_t value) {
    m_pdxType->addFixedLengthTypeField(fieldName, "byte", PdxFieldTypes::BYTE,
                                       PdxTypes::BYTE_SIZE);
    PdxLocalWriter::writeByte(fieldName, value);
-   return shared_from_this();
+   return *this;
 }
-std::shared_ptr<PdxWriter> PdxWriterWithTypeCollector::writeShort(
-    const std::string& fieldName, int16_t value) {
+PdxWriter& PdxWriterWithTypeCollector::writeShort(const std::string& fieldName,
+                                                  int16_t value) {
   m_pdxType->addFixedLengthTypeField(fieldName, "short", PdxFieldTypes::SHORT,
                                      PdxTypes::SHORT_SIZE);
   PdxLocalWriter::writeShort(fieldName, value);
-  return shared_from_this();
+  return *this;
  }
- std::shared_ptr<PdxWriter> PdxWriterWithTypeCollector::writeInt(
-     const std::string& fieldName, int32_t value) {
+ PdxWriter& PdxWriterWithTypeCollector::writeInt(const std::string& fieldName,
+                                                 int32_t value) {
    m_pdxType->addFixedLengthTypeField(fieldName, "int", PdxFieldTypes::INT,
                                       PdxTypes::INTEGER_SIZE);
    PdxLocalWriter::writeInt(fieldName, value);
-   return shared_from_this();
+   return *this;
  }
- std::shared_ptr<PdxWriter> PdxWriterWithTypeCollector::writeLong(
-     const std::string& fieldName, int64_t value) {
+ PdxWriter& PdxWriterWithTypeCollector::writeLong(const std::string& fieldName,
+                                                  int64_t value) {
    m_pdxType->addFixedLengthTypeField(fieldName, "long", PdxFieldTypes::LONG,
                                       PdxTypes::LONG_SIZE);
    PdxLocalWriter::writeLong(fieldName, value);
-   return shared_from_this();
+   return *this;
  }
- std::shared_ptr<PdxWriter> PdxWriterWithTypeCollector::writeFloat(
-     const std::string& fieldName, float value) {
+ PdxWriter& PdxWriterWithTypeCollector::writeFloat(const std::string& fieldName,
+                                                   float value) {
    m_pdxType->addFixedLengthTypeField(fieldName, "float", PdxFieldTypes::FLOAT,
                                       PdxTypes::FLOAT_SIZE);
    PdxLocalWriter::writeFloat(fieldName, value);
-   return shared_from_this();
+   return *this;
  }
- std::shared_ptr<PdxWriter> PdxWriterWithTypeCollector::writeDouble(
+ PdxWriter& PdxWriterWithTypeCollector::writeDouble(
      const std::string& fieldName, double value) {
    m_pdxType->addFixedLengthTypeField(
        fieldName, "double", PdxFieldTypes::DOUBLE, PdxTypes::DOUBLE_SIZE);
    PdxLocalWriter::writeDouble(fieldName, value);
-   return shared_from_this();
+   return *this;
 }
-std::shared_ptr<PdxWriter> PdxWriterWithTypeCollector::writeDate(
+PdxWriter& PdxWriterWithTypeCollector::writeDate(
     const std::string& fieldName, std::shared_ptr<CacheableDate> date) {
   m_pdxType->addFixedLengthTypeField(fieldName, "Date", PdxFieldTypes::DATE,
                                      PdxTypes::DATE_SIZE);
   PdxLocalWriter::writeDate(fieldName, date);
-  return shared_from_this();
+  return *this;
 }
 
-std::shared_ptr<PdxWriter> PdxWriterWithTypeCollector::writeString(
+PdxWriter& PdxWriterWithTypeCollector::writeString(
     const std::string& fieldName, const std::string& value) {
   m_pdxType->addVariableLengthTypeField(fieldName, "String",
                                         PdxFieldTypes::STRING);
   PdxLocalWriter::writeString(fieldName, value);
-  return shared_from_this();
+  return *this;
  }
 
-std::shared_ptr<PdxWriter> PdxWriterWithTypeCollector::writeObject(
+PdxWriter& PdxWriterWithTypeCollector::writeObject(
     const std::string& fieldName, std::shared_ptr<Serializable> value) {
   m_pdxType->addVariableLengthTypeField(fieldName, "Serializable",
                                         PdxFieldTypes::OBJECT);
   PdxLocalWriter::writeObject(fieldName, value);
-  return shared_from_this();
+  return *this;
 }
-std::shared_ptr<PdxWriter> PdxWriterWithTypeCollector::writeBooleanArray(
+PdxWriter& PdxWriterWithTypeCollector::writeBooleanArray(
     const std::string& fieldName, bool* array, int length) {
   m_pdxType->addVariableLengthTypeField(fieldName, "bool[]",
                                         PdxFieldTypes::BOOLEAN_ARRAY);
   PdxLocalWriter::writeBooleanArray(fieldName, array, length);
-  return shared_from_this();
+  return *this;
 }
 
-std::shared_ptr<PdxWriter> PdxWriterWithTypeCollector::writeCharArray(
+PdxWriter& PdxWriterWithTypeCollector::writeCharArray(
     const std::string& fieldName, char16_t* array, int length) {
   m_pdxType->addVariableLengthTypeField(fieldName, "char[]",
                                         PdxFieldTypes::CHAR_ARRAY);
   PdxLocalWriter::writeCharArray(fieldName, array, length);
-  return shared_from_this();
+  return *this;
 }
 
-std::shared_ptr<PdxWriter> PdxWriterWithTypeCollector::writeByteArray(
+PdxWriter& PdxWriterWithTypeCollector::writeByteArray(
     const std::string& fieldName, int8_t* array, int length) {
   m_pdxType->addVariableLengthTypeField(fieldName, "byte[]",
                                         PdxFieldTypes::BYTE_ARRAY);
   PdxLocalWriter::writeByteArray(fieldName, array, length);
-  return shared_from_this();
+  return *this;
 }
-std::shared_ptr<PdxWriter> PdxWriterWithTypeCollector::writeShortArray(
+PdxWriter& PdxWriterWithTypeCollector::writeShortArray(
     const std::string& fieldName, int16_t* array, int length) {
   m_pdxType->addVariableLengthTypeField(fieldName, "short[]",
                                         PdxFieldTypes::SHORT_ARRAY);
   PdxLocalWriter::writeShortArray(fieldName, array, length);
-  return shared_from_this();
+  return *this;
 }
-std::shared_ptr<PdxWriter> PdxWriterWithTypeCollector::writeIntArray(
+PdxWriter& PdxWriterWithTypeCollector::writeIntArray(
     const std::string& fieldName, int32_t* array, int length) {
   m_pdxType->addVariableLengthTypeField(fieldName, "int[]",
                                         PdxFieldTypes::INT_ARRAY);
   PdxLocalWriter::writeIntArray(fieldName, array, length);
-  return shared_from_this();
+  return *this;
 }
-std::shared_ptr<PdxWriter> PdxWriterWithTypeCollector::writeLongArray(
+PdxWriter& PdxWriterWithTypeCollector::writeLongArray(
     const std::string& fieldName, int64_t* array, int length) {
   m_pdxType->addVariableLengthTypeField(fieldName, "long[]",
                                         PdxFieldTypes::LONG_ARRAY);
   PdxLocalWriter::writeLongArray(fieldName, array, length);
-  return shared_from_this();
+  return *this;
 }
-std::shared_ptr<PdxWriter> PdxWriterWithTypeCollector::writeFloatArray(
+PdxWriter& PdxWriterWithTypeCollector::writeFloatArray(
     const std::string& fieldName, float* array, int length) {
   m_pdxType->addVariableLengthTypeField(fieldName, "float[]",
                                         PdxFieldTypes::FLOAT_ARRAY);
   PdxLocalWriter::writeFloatArray(fieldName, array, length);
-  return shared_from_this();
+  return *this;
 }
-std::shared_ptr<PdxWriter> PdxWriterWithTypeCollector::writeDoubleArray(
+PdxWriter& PdxWriterWithTypeCollector::writeDoubleArray(
     const std::string& fieldName, double* array, int length) {
   m_pdxType->addVariableLengthTypeField(fieldName, "double[]",
                                         PdxFieldTypes::DOUBLE_ARRAY);
   PdxLocalWriter::writeDoubleArray(fieldName, array, length);
-  return shared_from_this();
+  return *this;
 }
 
-std::shared_ptr<PdxWriter> PdxWriterWithTypeCollector::writeStringArray(
+PdxWriter& PdxWriterWithTypeCollector::writeStringArray(
     const std::string& fieldName, const std::vector<std::string>& array) {
   m_pdxType->addVariableLengthTypeField(fieldName, "String[]",
                                         PdxFieldTypes::STRING_ARRAY);
   PdxLocalWriter::writeStringArray(fieldName, array);
-  return shared_from_this();
+  return *this;
 }
 
-std::shared_ptr<PdxWriter> PdxWriterWithTypeCollector::writeObjectArray(
+PdxWriter& PdxWriterWithTypeCollector::writeObjectArray(
     const std::string& fieldName, std::shared_ptr<CacheableObjectArray> array) {
   m_pdxType->addVariableLengthTypeField(fieldName, "Object[]",
                                         PdxFieldTypes::OBJECT_ARRAY);
   PdxLocalWriter::writeObjectArray(fieldName, array);
-  return shared_from_this();
+  return *this;
 }
-std::shared_ptr<PdxWriter> PdxWriterWithTypeCollector::writeArrayOfByteArrays(
+PdxWriter& PdxWriterWithTypeCollector::writeArrayOfByteArrays(
     const std::string& fieldName, int8_t* const* const byteArrays,
     int arrayLength, const int* elementLength) {
   m_pdxType->addVariableLengthTypeField(fieldName, "byte[][]",
                                         PdxFieldTypes::ARRAY_OF_BYTE_ARRAYS);
   PdxLocalWriter::writeArrayOfByteArrays(fieldName, byteArrays, arrayLength,
                                          elementLength);
-  return shared_from_this();
+  return *this;
 }
-std::shared_ptr<PdxWriter> PdxWriterWithTypeCollector::markIdentityField(
+PdxWriter& PdxWriterWithTypeCollector::markIdentityField(
     const std::string& fieldName) {
   auto pft = m_pdxType->getPdxField(fieldName);
   if (pft == nullptr) {
@@ -271,7 +271,7 @@ std::shared_ptr<PdxWriter> PdxWriterWithTypeCollector::markIdentityField(
         "MarkIdentityField ");
   }
   pft->setIdentityField(true);
-  return shared_from_this();
+  return *this;
 }
 }  // namespace client
 }  // namespace geode
diff --git a/cppcache/src/PdxWriterWithTypeCollector.hpp b/cppcache/src/PdxWriterWithTypeCollector.hpp
index fef6dbf..39608dc 100644
--- a/cppcache/src/PdxWriterWithTypeCollector.hpp
+++ b/cppcache/src/PdxWriterWithTypeCollector.hpp
@@ -49,82 +49,81 @@ class PdxWriterWithTypeCollector : public PdxLocalWriter {
 
   virtual void writeOffsets(int32_t len) override;
 
-  virtual std::shared_ptr<PdxWriter> writeChar(const std::string& fieldName,
+  virtual PdxWriter& writeChar(const std::string& fieldName,
                                                char16_t value) override;
 
-  virtual std::shared_ptr<PdxWriter> writeBoolean(const std::string& fieldName,
+  virtual PdxWriter& writeBoolean(const std::string& fieldName,
                                                   bool value) override;
 
-  virtual std::shared_ptr<PdxWriter> writeByte(const std::string& fieldName,
+  virtual PdxWriter& writeByte(const std::string& fieldName,
                                                int8_t value) override;
 
-  virtual std::shared_ptr<PdxWriter> writeShort(const std::string& fieldName,
+  virtual PdxWriter& writeShort(const std::string& fieldName,
                                                 int16_t value) override;
 
-  virtual std::shared_ptr<PdxWriter> writeInt(const std::string& fieldName,
+  virtual PdxWriter& writeInt(const std::string& fieldName,
                                               int32_t value) override;
 
-  virtual std::shared_ptr<PdxWriter> writeLong(const std::string& fieldName,
+  virtual PdxWriter& writeLong(const std::string& fieldName,
                                                int64_t value) override;
 
-  virtual std::shared_ptr<PdxWriter> writeFloat(const std::string& fieldName,
+  virtual PdxWriter& writeFloat(const std::string& fieldName,
                                                 float value) override;
 
-  virtual std::shared_ptr<PdxWriter> writeDouble(const std::string& fieldName,
+  virtual PdxWriter& writeDouble(const std::string& fieldName,
                                                  double value) override;
 
-  virtual std::shared_ptr<PdxWriter> writeDate(
+  virtual PdxWriter& writeDate(
       const std::string& fieldName,
       std::shared_ptr<CacheableDate> date) override;
 
-  virtual std::shared_ptr<PdxWriter> writeString(
+  virtual PdxWriter& writeString(
       const std::string& fieldName, const std::string& value) override;
 
-  virtual std::shared_ptr<PdxWriter> writeObject(
+  virtual PdxWriter& writeObject(
       const std::string& fieldName,
       std::shared_ptr<Serializable> value) override;
 
-  virtual std::shared_ptr<PdxWriter> writeBooleanArray(
+  virtual PdxWriter& writeBooleanArray(
       const std::string& fieldName, bool* array, int length) override;
 
-  virtual std::shared_ptr<PdxWriter> writeCharArray(
+  virtual PdxWriter& writeCharArray(
       const std::string& fieldName, char16_t* array, int length) override;
 
-  virtual std::shared_ptr<PdxWriter> writeByteArray(
+  virtual PdxWriter& writeByteArray(
       const std::string& fieldName, int8_t* array, int length) override;
 
-  virtual std::shared_ptr<PdxWriter> writeShortArray(
+  virtual PdxWriter& writeShortArray(
       const std::string& fieldName, int16_t* array, int length) override;
 
-  virtual std::shared_ptr<PdxWriter> writeIntArray(const std::string& fieldName,
+  virtual PdxWriter& writeIntArray(const std::string& fieldName,
                                                    int32_t* array,
                                                    int length) override;
 
-  virtual std::shared_ptr<PdxWriter> writeLongArray(
+  virtual PdxWriter& writeLongArray(
       const std::string& fieldName, int64_t* array, int length) override;
 
-  virtual std::shared_ptr<PdxWriter> writeFloatArray(
+  virtual PdxWriter& writeFloatArray(
       const std::string& fieldName, float* array, int length) override;
 
-  virtual std::shared_ptr<PdxWriter> writeDoubleArray(
+  virtual PdxWriter& writeDoubleArray(
       const std::string& fieldName, double* array, int length) override;
 
-  virtual std::shared_ptr<PdxWriter> writeStringArray(
+  virtual PdxWriter& writeStringArray(
       const std::string& fieldName,
       const std::vector<std::string>& array) override;
 
-  virtual std::shared_ptr<PdxWriter> writeObjectArray(
+  virtual PdxWriter& writeObjectArray(
       const std::string& fieldName,
       std::shared_ptr<CacheableObjectArray> array) override;
 
-  virtual std::shared_ptr<PdxWriter> writeArrayOfByteArrays(
+  virtual PdxWriter& writeArrayOfByteArrays(
       const std::string& fieldName, int8_t* const* const byteArrays,
       int arrayLength, const int* elementLength) override;
 
-  virtual std::shared_ptr<PdxWriter> markIdentityField(
-      const std::string& fieldName) override;
+  virtual PdxWriter& markIdentityField(const std::string& fieldName) override;
 
-  virtual std::shared_ptr<PdxWriter> writeUnreadFields(
+  virtual PdxWriter& writeUnreadFields(
       std::shared_ptr<PdxUnreadFields> unread) override;
 };
 
diff --git a/quickstart/cpp/PdxSerializer.cpp b/quickstart/cpp/PdxSerializer.cpp
index 1ecf305..ce5be3d 100644
--- a/quickstart/cpp/PdxSerializer.cpp
+++ b/quickstart/cpp/PdxSerializer.cpp
@@ -104,14 +104,14 @@ class PersonPdxSerializer : public PdxSerializer {
     return NULL;
   }
 
-  void* fromData(const char* className, std::shared_ptr<PdxReader> pr) {
+  void* fromData(const char* className, PdxReader& pr) {
     if (strcmp(className, CLASSNAME) == 0) {
       Person* per = new Person();
 
       try {
-        per->setID(pr->readInt("m_id"));
-        per->setAge(pr->readInt("m_age"));
-        per->setName(pr->readString("m_name"));
+        per->setID(pr.readInt("m_id"));
+        per->setAge(pr.readInt("m_age"));
+        per->setName(pr.readString("m_name"));
       } catch (...) {
         return NULL;
       }
@@ -120,15 +120,14 @@ class PersonPdxSerializer : public PdxSerializer {
     return NULL;
   }
 
-  bool toData(void* testObject, const char* className,
-              std::shared_ptr<PdxWriter> pw) {
+  bool toData(void* testObject, const char* className, PdxWriter& pw) {
     if (strcmp(className, CLASSNAME) == 0) {
       Person* per = reinterpret_cast<Person*>(testObject);
 
       try {
-        pw->writeInt("m_id", per->getID());
-        pw->writeInt("m_age", per->getAge());
-        pw->writeString("m_name", per->getName());
+        pw.writeInt("m_id", per->getID());
+        pw.writeInt("m_age", per->getAge());
+        pw.writeString("m_name", per->getName());
       } catch (...) {
         return false;
       }
diff --git a/quickstart/cpp/queryobjects/PortfolioPdx.cpp b/quickstart/cpp/queryobjects/PortfolioPdx.cpp
index ba3842a..eb5ee64 100644
--- a/quickstart/cpp/queryobjects/PortfolioPdx.cpp
+++ b/quickstart/cpp/queryobjects/PortfolioPdx.cpp
@@ -94,60 +94,63 @@ PortfolioPdx::~PortfolioPdx() {
   }
 }
 
-void PortfolioPdx::toData(std::shared_ptr<PdxWriter> pw) {
-  pw->writeInt("ID", id);
-  pw->markIdentityField("ID");
+void PortfolioPdx::toData(PdxWriter& pw) {
+  pw.writeInt("ID", id);
+  pw.markIdentityField("ID");
 
-  pw->writeString("pkid", pkid);
-  pw->markIdentityField("pkid");
+  pw.writeString("pkid", pkid);
+  pw.markIdentityField("pkid");
 
-  pw->writeObject("position1", position1);
-  pw->markIdentityField("position1");
+  pw.writeObject("position1", position1);
+  pw.markIdentityField("position1");
 
-  pw->writeObject("position2", position2);
-  pw->markIdentityField("position2");
+  pw.writeObject("position2", position2);
+  pw.markIdentityField("position2");
 
-  pw->writeObject("positions", positions);
-  pw->markIdentityField("positions");
+  pw.writeObject("positions", positions);
+  pw.markIdentityField("positions");
 
-  pw->writeString("type", type);
-  pw->markIdentityField("type");
+  pw.writeString("type", type);
+  pw.markIdentityField("type");
 
-  pw->writeString("status", status);
-  pw->markIdentityField("status");
+  pw.writeString("status", status);
+  pw.markIdentityField("status");
 
-  pw->writeStringArray("names", names, 0);
-  pw->markIdentityField("names");
+  pw.writeStringArray("names", names, 0);
+  pw.markIdentityField("names");
 
-  pw->writeByteArray("newVal", newVal, newValSize);
-  pw->markIdentityField("newVal");
+  pw.writeByteArray("newVal", newVal, newValSize);
+  pw.markIdentityField("newVal");
 
-  pw->writeDate("creationDate", creationDate);
-  pw->markIdentityField("creationDate");
+  pw.writeDate("creationDate", creationDate);
+  pw.markIdentityField("creationDate");
 
-  pw->writeByteArray("arrayNull", arrayNull, 0);
-  pw->writeByteArray("arrayZeroSize", arrayZeroSize, 0);
+  pw.writeByteArray("arrayNull", arrayNull, 0);
+  pw.writeByteArray("arrayZeroSize", arrayZeroSize, 0);
 }
 
-void PortfolioPdx::fromData(std::shared_ptr<PdxReader> pr) {
-  id = pr->readInt("ID");
-  pkid = pr->readString("pkid");
+void PortfolioPdx::fromData(PdxReader& pr) {
+  id = pr.readInt("ID");
+  pkid = pr.readString("pkid");
 
-  position1 = std::dynamic_pointer_cast<PositionPdx>(pr->readObject("position1"));
-  position2 = std::dynamic_pointer_cast<PositionPdx>(pr->readObject("position2"));
-  positions = std::dynamic_pointer_cast<CacheableHashMap>(pr->readObject("positions"));
-  type = pr->readString("type");
-  status = pr->readString("status");
+  position1 =
+      std::dynamic_pointer_cast<PositionPdx>(pr.readObject("position1"));
+  position2 =
+      std::dynamic_pointer_cast<PositionPdx>(pr.readObject("position2"));
+  positions =
+      std::dynamic_pointer_cast<CacheableHashMap>(pr.readObject("positions"));
+  type = pr.readString("type");
+  status = pr.readString("status");
 
   int32_t strLenArray = 0;
-  names = pr->readStringArray("names", strLenArray);
+  names = pr.readStringArray("names", strLenArray);
   int32_t byteArrayLen = 0;
-  newVal = pr->readByteArray("newVal", byteArrayLen);
-  creationDate = pr->readDate("creationDate");
+  newVal = pr.readByteArray("newVal", byteArrayLen);
+  creationDate = pr.readDate("creationDate");
   int32_t arrayNullLen = 0;
-  arrayNull = pr->readByteArray("arrayNull", arrayNullLen);
+  arrayNull = pr.readByteArray("arrayNull", arrayNullLen);
   int32_t arrayZeroSizeLen = 0;
-  arrayZeroSize = pr->readByteArray("arrayZeroSize", arrayZeroSizeLen);
+  arrayZeroSize = pr.readByteArray("arrayZeroSize", arrayZeroSizeLen);
 }
 std::string PortfolioPdx::toString() const {
   LOGINFO("PortfolioPdx::toString() Start");
diff --git a/quickstart/cpp/queryobjects/PortfolioPdx.hpp b/quickstart/cpp/queryobjects/PortfolioPdx.hpp
index 02f6294..4991f21 100644
--- a/quickstart/cpp/queryobjects/PortfolioPdx.hpp
+++ b/quickstart/cpp/queryobjects/PortfolioPdx.hpp
@@ -96,8 +96,8 @@ class TESTOBJECT_EXPORT PortfolioPdx : public PdxSerializable {
 
   using PdxSerializable::toData;
   using PdxSerializable::fromData;
-  virtual void toData(std::shared_ptr<PdxWriter> pw);
-  virtual void fromData(std::shared_ptr<PdxReader> pr);
+  virtual void toData(PdxWriter& pw);
+  virtual void fromData(PdxReader& pr);
 
   std::string toString() const;
 };
diff --git a/quickstart/cpp/queryobjects/PortfolioPdxAuto.hpp b/quickstart/cpp/queryobjects/PortfolioPdxAuto.hpp
index 9a20cbd..6044673 100644
--- a/quickstart/cpp/queryobjects/PortfolioPdxAuto.hpp
+++ b/quickstart/cpp/queryobjects/PortfolioPdxAuto.hpp
@@ -98,8 +98,8 @@ class PortfolioPdxAuto : public apache::geode::client::PdxSerializable {
 
   const char* getClassName() const;
 
-  virtual void toData(std::shared_ptr<PdxWriter> pw);
-  virtual void fromData(std::shared_ptr<PdxReader> pr);
+  virtual void toData(PdxWriter& pw);
+  virtual void fromData(PdxReader& pr);
 
   static PdxSerializable* createDeserializable();
 
diff --git a/quickstart/cpp/queryobjects/PositionPdx.cpp b/quickstart/cpp/queryobjects/PositionPdx.cpp
index 006c956..0e5f283 100644
--- a/quickstart/cpp/queryobjects/PositionPdx.cpp
+++ b/quickstart/cpp/queryobjects/PositionPdx.cpp
@@ -101,73 +101,73 @@ void PositionPdx::init() {
   pid = 0;
 }
 
-void PositionPdx::toData(std::shared_ptr<PdxWriter> pw) {
-  pw->writeLong("avg20DaysVol", avg20DaysVol);
-  pw->markIdentityField("avg20DaysVol");
+void PositionPdx::toData(PdxWriter& pw) {
+  pw.writeLong("avg20DaysVol", avg20DaysVol);
+  pw.markIdentityField("avg20DaysVol");
 
-  pw->writeString("bondRating", bondRating);
-  pw->markIdentityField("bondRating");
+  pw.writeString("bondRating", bondRating);
+  pw.markIdentityField("bondRating");
 
-  pw->writeDouble("convRatio", convRatio);
-  pw->markIdentityField("convRatio");
+  pw.writeDouble("convRatio", convRatio);
+  pw.markIdentityField("convRatio");
 
-  pw->writeString("country", country);
-  pw->markIdentityField("country");
+  pw.writeString("country", country);
+  pw.markIdentityField("country");
 
-  pw->writeDouble("delta", delta);
-  pw->markIdentityField("delta");
+  pw.writeDouble("delta", delta);
+  pw.markIdentityField("delta");
 
-  pw->writeLong("industry", industry);
-  pw->markIdentityField("industry");
+  pw.writeLong("industry", industry);
+  pw.markIdentityField("industry");
 
-  pw->writeLong("issuer", issuer);
-  pw->markIdentityField("issuer");
+  pw.writeLong("issuer", issuer);
+  pw.markIdentityField("issuer");
 
-  pw->writeDouble("mktValue", mktValue);
-  pw->markIdentityField("mktValue");
+  pw.writeDouble("mktValue", mktValue);
+  pw.markIdentityField("mktValue");
 
-  pw->writeDouble("qty", qty);
-  pw->markIdentityField("qty");
+  pw.writeDouble("qty", qty);
+  pw.markIdentityField("qty");
 
-  pw->writeString("secId", secId);
-  pw->markIdentityField("secId");
+  pw.writeString("secId", secId);
+  pw.markIdentityField("secId");
 
-  pw->writeString("secLinks", secLinks);
-  pw->markIdentityField("secLinks");
+  pw.writeString("secLinks", secLinks);
+  pw.markIdentityField("secLinks");
 
-  pw->writeString("secType", secType);
-  pw->markIdentityField("secType");
+  pw.writeString("secType", secType);
+  pw.markIdentityField("secType");
 
-  pw->writeInt("sharesOutstanding", sharesOutstanding);
-  pw->markIdentityField("sharesOutstanding");
+  pw.writeInt("sharesOutstanding", sharesOutstanding);
+  pw.markIdentityField("sharesOutstanding");
 
-  pw->writeString("underlyer", underlyer);
-  pw->markIdentityField("underlyer");
+  pw.writeString("underlyer", underlyer);
+  pw.markIdentityField("underlyer");
 
-  pw->writeLong("volatility", volatility);
-  pw->markIdentityField("volatility");
+  pw.writeLong("volatility", volatility);
+  pw.markIdentityField("volatility");
 
-  pw->writeInt("pid", pid);
-  pw->markIdentityField("pid");
+  pw.writeInt("pid", pid);
+  pw.markIdentityField("pid");
 }
 
-void PositionPdx::fromData(std::shared_ptr<PdxReader> pr) {
-  avg20DaysVol = pr->readLong("avg20DaysVol");
-  bondRating = pr->readString("bondRating");
-  convRatio = pr->readDouble("convRatio");
-  country = pr->readString("country");
-  delta = pr->readDouble("delta");
-  industry = pr->readLong("industry");
-  issuer = pr->readLong("issuer");
-  mktValue = pr->readDouble("mktValue");
-  qty = pr->readDouble("qty");
-  secId = pr->readString("secId");
-  secLinks = pr->readString("secLinks");
-  secType = pr->readString("secType");
-  sharesOutstanding = pr->readInt("sharesOutstanding");
-  underlyer = pr->readString("underlyer");
-  volatility = pr->readLong("volatility");
-  pid = pr->readInt("pid");
+void PositionPdx::fromData(PdxReader& pr) {
+  avg20DaysVol = pr.readLong("avg20DaysVol");
+  bondRating = pr.readString("bondRating");
+  convRatio = pr.readDouble("convRatio");
+  country = pr.readString("country");
+  delta = pr.readDouble("delta");
+  industry = pr.readLong("industry");
+  issuer = pr.readLong("issuer");
+  mktValue = pr.readDouble("mktValue");
+  qty = pr.readDouble("qty");
+  secId = pr.readString("secId");
+  secLinks = pr.readString("secLinks");
+  secType = pr.readString("secType");
+  sharesOutstanding = pr.readInt("sharesOutstanding");
+  underlyer = pr.readString("underlyer");
+  volatility = pr.readLong("volatility");
+  pid = pr.readInt("pid");
 }
 std::string PositionPdx::toString() const {
   char buf[1024];
diff --git a/quickstart/cpp/queryobjects/PositionPdx.hpp b/quickstart/cpp/queryobjects/PositionPdx.hpp
index ebdf8ec..c143e37 100644
--- a/quickstart/cpp/queryobjects/PositionPdx.hpp
+++ b/quickstart/cpp/queryobjects/PositionPdx.hpp
@@ -72,8 +72,8 @@ class TESTOBJECT_EXPORT PositionPdx
   // This constructor is just for some internal data validation test
   PositionPdx(int32_t iForExactVal);
   virtual ~PositionPdx();
-  virtual void toData(std::shared_ptr<PdxWriter> pw);
-  virtual void fromData(std::shared_ptr<PdxReader> pr);
+  virtual void toData(PdxWriter& pw);
+  virtual void fromData(PdxReader& pr);
 
   std::string toString() const;
 
diff --git a/quickstart/cpp/queryobjects/PositionPdxAuto.hpp b/quickstart/cpp/queryobjects/PositionPdxAuto.hpp
index 90c1db3..08e43a2 100644
--- a/quickstart/cpp/queryobjects/PositionPdxAuto.hpp
+++ b/quickstart/cpp/queryobjects/PositionPdxAuto.hpp
@@ -73,8 +73,8 @@ class PositionPdxAuto : public apache::geode::client::PdxSerializable {
   // This constructor is just for some internal data validation test
   PositionPdxAuto(int32_t iForExactVal);
   virtual ~PositionPdxAuto();
-  virtual void toData(std::shared_ptr<PdxWriter> pw);
-  virtual void fromData(std::shared_ptr<PdxReader> pr);
+  virtual void toData(PdxWriter& pw);
+  virtual void fromData(PdxReader& pr);
 
   std::string toString() const;
 
diff --git a/tests/cpp/testobject/InvalidPdxUsage.cpp b/tests/cpp/testobject/InvalidPdxUsage.cpp
index 3575308..fe62eed 100644
--- a/tests/cpp/testobject/InvalidPdxUsage.cpp
+++ b/tests/cpp/testobject/InvalidPdxUsage.cpp
@@ -71,7 +71,7 @@ bool InvalidPdxUsage::generic2DCompare(T1** value1, T2** value2, int length,
 // InvalidPdxUsage::~PdxObject() {
 //}
 
-void InvalidPdxUsage::toData(std::shared_ptr<PdxWriter> pw) const {
+void InvalidPdxUsage::toData(PdxWriter& pw) const {
   // TODO:delete it later
   LOGINFO(" NILKANTH InvalidPdxUsage::toData() Start exceptionCounter = %d ",
           toDataexceptionCounter);
@@ -86,7 +86,7 @@ void InvalidPdxUsage::toData(std::shared_ptr<PdxWriter> pw) const {
   bool excptExpected ATTR_UNUSED = false;
 
   try {
-    pw->writeArrayOfByteArrays("", m_byteByteArray, 2, lengthArr);
+    pw.writeArrayOfByteArrays("", m_byteByteArray, 2, lengthArr);
   } catch (IllegalStateException& excpt) {
     toDataexceptionCounter++;
     LOGINFO("writeArrayOfByteArrays():: Got expected Exception :: %s ",
@@ -94,8 +94,8 @@ void InvalidPdxUsage::toData(std::shared_ptr<PdxWriter> pw) const {
   }
 
   try {
-    pw->writeChar("", m_char);
-    pw->markIdentityField("m_char");
+    pw.writeChar("", m_char);
+    pw.markIdentityField("m_char");
   } catch (IllegalStateException& excpt) {
     toDataexceptionCounter++;
     LOGINFO("writeWideChar():: Got expected Exception :: %s ",
@@ -103,8 +103,8 @@ void InvalidPdxUsage::toData(std::shared_ptr<PdxWriter> pw) const {
   }
 
   try {
-    pw->writeBoolean("", m_bool);  // 1
-    pw->markIdentityField("m_bool");
+    pw.writeBoolean("", m_bool);  // 1
+    pw.markIdentityField("m_bool");
   } catch (IllegalStateException& excpt) {
     toDataexceptionCounter++;
     LOGINFO("writeBoolean():: Got expected Exception :: %s ",
@@ -112,8 +112,8 @@ void InvalidPdxUsage::toData(std::shared_ptr<PdxWriter> pw) const {
   }
 
   try {
-    pw->writeBooleanArray("", m_boolArray, 3);
-    pw->markIdentityField("m_boolArray");
+    pw.writeBooleanArray("", m_boolArray, 3);
+    pw.markIdentityField("m_boolArray");
   } catch (IllegalStateException& excpt) {
     toDataexceptionCounter++;
     LOGINFO("writeBooleanArray():: Got expected Exception :: %s ",
@@ -121,16 +121,16 @@ void InvalidPdxUsage::toData(std::shared_ptr<PdxWriter> pw) const {
   }
 
   try {
-    pw->writeByte("", m_byte);
-    pw->markIdentityField("m_byte");
+    pw.writeByte("", m_byte);
+    pw.markIdentityField("m_byte");
   } catch (IllegalStateException& excpt) {
     toDataexceptionCounter++;
     LOGINFO("writeByte():: Got expected Exception :: %s ", excpt.what());
   }
 
   try {
-    pw->writeByteArray("", m_byteArray, 2);
-    pw->markIdentityField("m_byteArray");
+    pw.writeByteArray("", m_byteArray, 2);
+    pw.markIdentityField("m_byteArray");
   } catch (IllegalStateException& excpt) {
     toDataexceptionCounter++;
     LOGINFO("writeByteArray():: Got expected Exception :: %s ",
@@ -138,8 +138,8 @@ void InvalidPdxUsage::toData(std::shared_ptr<PdxWriter> pw) const {
   }
 
   try {
-    pw->writeCharArray("", m_charArray, 2);
-    pw->markIdentityField("m_charArray");
+    pw.writeCharArray("", m_charArray, 2);
+    pw.markIdentityField("m_charArray");
   } catch (IllegalStateException& excpt) {
     toDataexceptionCounter++;
     LOGINFO("writeWideCharArray():: Got expected Exception :: %s ",
@@ -147,8 +147,8 @@ void InvalidPdxUsage::toData(std::shared_ptr<PdxWriter> pw) const {
   }
 
   try {
-    pw->writeObject("", m_arraylist);
-    pw->markIdentityField("m_arraylist");
+    pw.writeObject("", m_arraylist);
+    pw.markIdentityField("m_arraylist");
   } catch (IllegalStateException& excpt) {
     toDataexceptionCounter++;
     LOGINFO("writeObject() for ArrayList:: Got expected Exception :: %s ",
@@ -156,8 +156,8 @@ void InvalidPdxUsage::toData(std::shared_ptr<PdxWriter> pw) const {
   }
 
   try {
-    pw->writeObject("", m_map);
-    pw->markIdentityField("m_map");
+    pw.writeObject("", m_map);
+    pw.markIdentityField("m_map");
   } catch (IllegalStateException& excpt) {
     toDataexceptionCounter++;
     LOGINFO("writeObject() for Map:: Got expected Exception :: %s ",
@@ -165,8 +165,8 @@ void InvalidPdxUsage::toData(std::shared_ptr<PdxWriter> pw) const {
   }
 
   try {
-    pw->writeObject("", m_hashtable);
-    pw->markIdentityField("m_hashtable");
+    pw.writeObject("", m_hashtable);
+    pw.markIdentityField("m_hashtable");
   } catch (IllegalStateException& excpt) {
     toDataexceptionCounter++;
     LOGINFO("writeObject() for HashTable:: Got expected Exception :: %s ",
@@ -174,8 +174,8 @@ void InvalidPdxUsage::toData(std::shared_ptr<PdxWriter> pw) const {
   }
 
   try {
-    pw->writeObject("", m_vector);
-    pw->markIdentityField("m_vector");
+    pw.writeObject("", m_vector);
+    pw.markIdentityField("m_vector");
   } catch (IllegalStateException& excpt) {
     toDataexceptionCounter++;
     LOGINFO("writeObject() for Vector:: Got expected Exception :: %s ",
@@ -183,8 +183,8 @@ void InvalidPdxUsage::toData(std::shared_ptr<PdxWriter> pw) const {
   }
 
   try {
-    pw->writeObject("", m_chs);
-    pw->markIdentityField("m_chs");
+    pw.writeObject("", m_chs);
+    pw.markIdentityField("m_chs");
   } catch (IllegalStateException& excpt) {
     toDataexceptionCounter++;
     LOGINFO(
@@ -193,8 +193,8 @@ void InvalidPdxUsage::toData(std::shared_ptr<PdxWriter> pw) const {
   }
 
   try {
-    pw->writeObject("", m_clhs);
-    pw->markIdentityField("m_clhs");
+    pw.writeObject("", m_clhs);
+    pw.markIdentityField("m_clhs");
   } catch (IllegalStateException& excpt) {
     toDataexceptionCounter++;
     LOGINFO(
@@ -204,8 +204,8 @@ void InvalidPdxUsage::toData(std::shared_ptr<PdxWriter> pw) const {
   }
 
   try {
-    pw->writeString("", m_string);
-    pw->markIdentityField("m_string");
+    pw.writeString("", m_string);
+    pw.markIdentityField("m_string");
   } catch (IllegalStateException& excpt) {
     toDataexceptionCounter++;
     LOGINFO("writeString():: Got expected Exception :: %s ",
@@ -213,16 +213,16 @@ void InvalidPdxUsage::toData(std::shared_ptr<PdxWriter> pw) const {
   }
 
   try {
-    pw->writeDate("", m_date);
-    pw->markIdentityField("m_dateTime");
+    pw.writeDate("", m_date);
+    pw.markIdentityField("m_dateTime");
   } catch (IllegalStateException& excpt) {
     toDataexceptionCounter++;
     LOGINFO("writeDate():: Got expected Exception :: %s ", excpt.what());
   }
 
   try {
-    pw->writeDouble("", m_double);
-    pw->markIdentityField("m_double");
+    pw.writeDouble("", m_double);
+    pw.markIdentityField("m_double");
   } catch (IllegalStateException& excpt) {
     toDataexceptionCounter++;
     LOGINFO("writeDouble():: Got expected Exception :: %s ",
@@ -230,8 +230,8 @@ void InvalidPdxUsage::toData(std::shared_ptr<PdxWriter> pw) const {
   }
 
   try {
-    pw->writeDoubleArray("", m_doubleArray, 2);
-    pw->markIdentityField("m_doubleArray");
+    pw.writeDoubleArray("", m_doubleArray, 2);
+    pw.markIdentityField("m_doubleArray");
   } catch (IllegalStateException& excpt) {
     toDataexceptionCounter++;
     LOGINFO("writeDoubleArray():: Got expected Exception :: %s ",
@@ -239,16 +239,16 @@ void InvalidPdxUsage::toData(std::shared_ptr<PdxWriter> pw) const {
   }
 
   try {
-    pw->writeFloat("", m_float);
-    pw->markIdentityField("m_float");
+    pw.writeFloat("", m_float);
+    pw.markIdentityField("m_float");
   } catch (IllegalStateException& excpt) {
     toDataexceptionCounter++;
     LOGINFO("writeFloat():: Got expected Exception :: %s ", excpt.what());
   }
 
   try {
-    pw->writeFloatArray("", m_floatArray, 2);
-    pw->markIdentityField("m_floatArray");
+    pw.writeFloatArray("", m_floatArray, 2);
+    pw.markIdentityField("m_floatArray");
   } catch (IllegalStateException& excpt) {
     toDataexceptionCounter++;
     LOGINFO("writeFloatArray():: Got expected Exception :: %s ",
@@ -256,32 +256,32 @@ void InvalidPdxUsage::toData(std::shared_ptr<PdxWriter> pw) const {
   }
 
   try {
-    pw->writeShort("", m_int16);
-    pw->markIdentityField("m_int16");
+    pw.writeShort("", m_int16);
+    pw.markIdentityField("m_int16");
   } catch (IllegalStateException& excpt) {
     toDataexceptionCounter++;
     LOGINFO("writeShort():: Got expected Exception :: %s ", excpt.what());
   }
 
   try {
-    pw->writeInt("", m_int32);
-    pw->markIdentityField("m_int32");
+    pw.writeInt("", m_int32);
+    pw.markIdentityField("m_int32");
   } catch (IllegalStateException& excpt) {
     toDataexceptionCounter++;
     LOGINFO("writeInt():: Got expected Exception :: %s ", excpt.what());
   }
 
   try {
-    pw->writeLong("", m_long);
-    pw->markIdentityField("m_long");
+    pw.writeLong("", m_long);
+    pw.markIdentityField("m_long");
   } catch (IllegalStateException& excpt) {
     toDataexceptionCounter++;
     LOGINFO("writeLong():: Got expected Exception :: %s ", excpt.what());
   }
 
   try {
-    pw->writeIntArray("", m_int32Array, 4);
-    pw->markIdentityField("m_int32Array");
+    pw.writeIntArray("", m_int32Array, 4);
+    pw.markIdentityField("m_int32Array");
   } catch (IllegalStateException& excpt) {
     toDataexceptionCounter++;
     LOGINFO("writeIntArray():: Got expected Exception :: %s ",
@@ -289,8 +289,8 @@ void InvalidPdxUsage::toData(std::shared_ptr<PdxWriter> pw) const {
   }
 
   try {
-    pw->writeLongArray("", m_longArray, 2);
-    pw->markIdentityField("m_longArray");
+    pw.writeLongArray("", m_longArray, 2);
+    pw.markIdentityField("m_longArray");
   } catch (IllegalStateException& excpt) {
     toDataexceptionCounter++;
     LOGINFO("writeLongArray():: Got expected Exception :: %s ",
@@ -298,8 +298,8 @@ void InvalidPdxUsage::toData(std::shared_ptr<PdxWriter> pw) const {
   }
 
   try {
-    pw->writeShortArray("", m_int16Array, 2);
-    pw->markIdentityField("m_int16Array");
+    pw.writeShortArray("", m_int16Array, 2);
+    pw.markIdentityField("m_int16Array");
   } catch (IllegalStateException& excpt) {
     toDataexceptionCounter++;
     LOGINFO("writeShortArray():: Got expected Exception :: %s ",
@@ -307,16 +307,16 @@ void InvalidPdxUsage::toData(std::shared_ptr<PdxWriter> pw) const {
   }
 
   try {
-    pw->writeByte("", m_sbyte);
-    pw->markIdentityField("m_sbyte");
+    pw.writeByte("", m_sbyte);
+    pw.markIdentityField("m_sbyte");
   } catch (IllegalStateException& excpt) {
     toDataexceptionCounter++;
     LOGINFO("writeByte():: Got expected Exception :: %s ", excpt.what());
   }
 
   try {
-    pw->writeByteArray("", m_sbyteArray, 2);
-    pw->markIdentityField("m_sbyteArray");
+    pw.writeByteArray("", m_sbyteArray, 2);
+    pw.markIdentityField("m_sbyteArray");
   } catch (IllegalStateException& excpt) {
     toDataexceptionCounter++;
     LOGINFO("writeByteArray():: Got expected Exception :: %s ",
@@ -324,8 +324,8 @@ void InvalidPdxUsage::toData(std::shared_ptr<PdxWriter> pw) const {
   }
 
   try {
-    pw->writeStringArray("", m_stringArray);
-    pw->markIdentityField("m_stringArray");
+    pw.writeStringArray("", m_stringArray);
+    pw.markIdentityField("m_stringArray");
   } catch (IllegalStateException& excpt) {
     toDataexceptionCounter++;
     LOGINFO("writeStringArray():: Got expected Exception :: %s ",
@@ -333,32 +333,32 @@ void InvalidPdxUsage::toData(std::shared_ptr<PdxWriter> pw) const {
   }
 
   try {
-    pw->writeShort("", m_uint16);
-    pw->markIdentityField("m_uint16");
+    pw.writeShort("", m_uint16);
+    pw.markIdentityField("m_uint16");
   } catch (IllegalStateException& excpt) {
     toDataexceptionCounter++;
     LOGINFO("writeShort():: Got expected Exception :: %s ", excpt.what());
   }
 
   try {
-    pw->writeInt("", m_uint32);
-    pw->markIdentityField("m_uint32");
+    pw.writeInt("", m_uint32);
+    pw.markIdentityField("m_uint32");
   } catch (IllegalStateException& excpt) {
     toDataexceptionCounter++;
     LOGINFO("writeInt():: Got expected Exception :: %s ", excpt.what());
   }
 
   try {
-    pw->writeLong("", m_ulong);
-    pw->markIdentityField("m_ulong");
+    pw.writeLong("", m_ulong);
+    pw.markIdentityField("m_ulong");
   } catch (IllegalStateException& excpt) {
     toDataexceptionCounter++;
     LOGINFO("writeLong():: Got expected Exception :: %s ", excpt.what());
   }
 
   try {
-    pw->writeIntArray("", m_uint32Array, 4);
-    pw->markIdentityField("m_uint32Array");
+    pw.writeIntArray("", m_uint32Array, 4);
+    pw.markIdentityField("m_uint32Array");
   } catch (IllegalStateException& excpt) {
     toDataexceptionCounter++;
     LOGINFO("writeIntArray():: Got expected Exception :: %s ",
@@ -366,8 +366,8 @@ void InvalidPdxUsage::toData(std::shared_ptr<PdxWriter> pw) const {
   }
 
   try {
-    pw->writeLongArray("", m_ulongArray, 2);
-    pw->markIdentityField("m_ulongArray");
+    pw.writeLongArray("", m_ulongArray, 2);
+    pw.markIdentityField("m_ulongArray");
   } catch (IllegalStateException& excpt) {
     toDataexceptionCounter++;
     LOGINFO("writeLongArray():: Got expected Exception :: %s ",
@@ -375,8 +375,8 @@ void InvalidPdxUsage::toData(std::shared_ptr<PdxWriter> pw) const {
   }
 
   try {
-    pw->writeShortArray("", m_uint16Array, 2);
-    pw->markIdentityField("m_uint16Array");
+    pw.writeShortArray("", m_uint16Array, 2);
+    pw.markIdentityField("m_uint16Array");
   } catch (IllegalStateException& excpt) {
     toDataexceptionCounter++;
     LOGINFO("writeShortArray():: Got expected Exception :: %s ",
@@ -384,8 +384,8 @@ void InvalidPdxUsage::toData(std::shared_ptr<PdxWriter> pw) const {
   }
 
   try {
-    pw->writeByteArray("", m_byte252, 252);
-    pw->markIdentityField("m_byte252");
+    pw.writeByteArray("", m_byte252, 252);
+    pw.markIdentityField("m_byte252");
   } catch (IllegalStateException& excpt) {
     toDataexceptionCounter++;
     LOGINFO("writeByteArray():: Got expected Exception :: %s ",
@@ -393,8 +393,8 @@ void InvalidPdxUsage::toData(std::shared_ptr<PdxWriter> pw) const {
   }
 
   try {
-    pw->writeByteArray("", m_byte253, 253);
-    pw->markIdentityField("m_byte253");
+    pw.writeByteArray("", m_byte253, 253);
+    pw.markIdentityField("m_byte253");
   } catch (IllegalStateException& excpt) {
     toDataexceptionCounter++;
     LOGINFO("writeByteArray():: Got expected Exception :: %s ",
@@ -402,8 +402,8 @@ void InvalidPdxUsage::toData(std::shared_ptr<PdxWriter> pw) const {
   }
 
   try {
-    pw->writeByteArray("", m_byte65535, 65535);
-    pw->markIdentityField("m_byte65535");
+    pw.writeByteArray("", m_byte65535, 65535);
+    pw.markIdentityField("m_byte65535");
   } catch (IllegalStateException& excpt) {
     toDataexceptionCounter++;
     LOGINFO("writeByteArray():: Got expected Exception :: %s ",
@@ -411,8 +411,8 @@ void InvalidPdxUsage::toData(std::shared_ptr<PdxWriter> pw) const {
   }
 
   try {
-    pw->writeByteArray("", m_byte65536, 65536);
-    pw->markIdentityField("m_byte65536");
+    pw.writeByteArray("", m_byte65536, 65536);
+    pw.markIdentityField("m_byte65536");
   } catch (IllegalStateException& excpt) {
     toDataexceptionCounter++;
     LOGINFO("writeByteArray():: Got expected Exception :: %s ",
@@ -420,8 +420,8 @@ void InvalidPdxUsage::toData(std::shared_ptr<PdxWriter> pw) const {
   }
 
   try {
-    pw->writeObject("", m_pdxEnum);
-    pw->markIdentityField("m_pdxEnum");
+    pw.writeObject("", m_pdxEnum);
+    pw.markIdentityField("m_pdxEnum");
   } catch (IllegalStateException& excpt) {
     toDataexceptionCounter++;
     LOGINFO("writeObject() for Enum:: Got expected Exception :: %s ",
@@ -429,7 +429,7 @@ void InvalidPdxUsage::toData(std::shared_ptr<PdxWriter> pw) const {
   }
 
   try {
-    pw->writeObject("", m_objectArray);
+    pw.writeObject("", m_objectArray);
   } catch (IllegalStateException& excpt) {
     toDataexceptionCounter++;
     LOGINFO(
@@ -439,7 +439,7 @@ void InvalidPdxUsage::toData(std::shared_ptr<PdxWriter> pw) const {
   }
 
   try {
-    pw->writeObjectArray("", m_objectArray);
+    pw.writeObjectArray("", m_objectArray);
   } catch (IllegalStateException& excpt) {
     toDataexceptionCounter++;
     LOGINFO("writeObjectArray():: Got expected Exception :: %s ",
@@ -447,8 +447,8 @@ void InvalidPdxUsage::toData(std::shared_ptr<PdxWriter> pw) const {
   }
 
   try {
-    pw->writeInt("toDataexceptionCounter", toDataexceptionCounter);
-    pw->writeInt("fromDataexceptionCounter", fromDataexceptionCounter);
+    pw.writeInt("toDataexceptionCounter", toDataexceptionCounter);
+    pw.writeInt("fromDataexceptionCounter", fromDataexceptionCounter);
   } catch (IllegalStateException& excpt) {
     LOGINFO("writeInt():: Got expected Exception :: %s ", excpt.what());
   }
@@ -456,7 +456,7 @@ void InvalidPdxUsage::toData(std::shared_ptr<PdxWriter> pw) const {
   LOGDEBUG("PdxObject::toData() Done......");
 }
 
-void InvalidPdxUsage::fromData(std::shared_ptr<PdxReader> pr) {
+void InvalidPdxUsage::fromData(PdxReader& pr) {
   // TODO:temp added, delete later
   LOGINFO(
       " NILKANTH InvalidPdxUsage::fromData() Start fromDataexceptionCounter = "
@@ -468,7 +468,7 @@ void InvalidPdxUsage::fromData(std::shared_ptr<PdxReader> pr) {
   int32_t arrLen = 0;
   int exceptionCounter = 0;
   try {
-    m_byteByteArray = pr->readArrayOfByteArrays("", arrLen, &Lengtharr);
+    m_byteByteArray = pr.readArrayOfByteArrays("", arrLen, &Lengtharr);
   } catch (IllegalStateException& excpt) {
     exceptionCounter++;
     LOGINFO("readArrayOfByteArrays():: Got expected Exception :: %s ",
@@ -476,7 +476,7 @@ void InvalidPdxUsage::fromData(std::shared_ptr<PdxReader> pr) {
   }
 
   try {
-    m_char = pr->readChar("");
+    m_char = pr.readChar("");
   } catch (IllegalStateException& excpt) {
     exceptionCounter++;
     LOGINFO("readWideChar():: Got expected Exception :: %s ",
@@ -484,7 +484,7 @@ void InvalidPdxUsage::fromData(std::shared_ptr<PdxReader> pr) {
   }
 
   try {
-    m_bool = pr->readBoolean("");
+    m_bool = pr.readBoolean("");
   } catch (IllegalStateException& excpt) {
     exceptionCounter++;
     LOGINFO("readBoolean():: Got expected Exception :: %s ",
@@ -492,7 +492,7 @@ void InvalidPdxUsage::fromData(std::shared_ptr<PdxReader> pr) {
   }
 
   try {
-    m_boolArray = pr->readBooleanArray("", boolArrayLen);
+    m_boolArray = pr.readBooleanArray("", boolArrayLen);
   } catch (IllegalStateException& excpt) {
     exceptionCounter++;
     LOGINFO("readBooleanArray():: Got expected Exception :: %s ",
@@ -500,14 +500,14 @@ void InvalidPdxUsage::fromData(std::shared_ptr<PdxReader> pr) {
   }
 
   try {
-    m_byte = pr->readByte("");
+    m_byte = pr.readByte("");
   } catch (IllegalStateException& excpt) {
     exceptionCounter++;
     LOGINFO("readByte():: Got expected Exception :: %s ", excpt.what());
   }
 
   try {
-    m_byteArray = pr->readByteArray("", byteArrayLen);
+    m_byteArray = pr.readByteArray("", byteArrayLen);
   } catch (IllegalStateException& excpt) {
     exceptionCounter++;
     LOGINFO("readByteArray():: Got expected Exception :: %s ",
@@ -515,7 +515,7 @@ void InvalidPdxUsage::fromData(std::shared_ptr<PdxReader> pr) {
   }
 
   try {
-    m_charArray = pr->readCharArray("", charArrayLen);
+    m_charArray = pr.readCharArray("", charArrayLen);
   } catch (IllegalStateException& excpt) {
     exceptionCounter++;
     LOGINFO("readWideCharArray():: Got expected Exception :: %s ",
@@ -524,14 +524,14 @@ void InvalidPdxUsage::fromData(std::shared_ptr<PdxReader> pr) {
 
   try {
     m_arraylist =
-        std::dynamic_pointer_cast<CacheableArrayList>(pr->readObject(""));
+        std::dynamic_pointer_cast<CacheableArrayList>(pr.readObject(""));
   } catch (IllegalStateException& excpt) {
     exceptionCounter++;
     LOGINFO("readObject():: Got expected Exception :: %s ", excpt.what());
   }
 
   try {
-    m_map = std::dynamic_pointer_cast<CacheableHashMap>(pr->readObject(""));
+    m_map = std::dynamic_pointer_cast<CacheableHashMap>(pr.readObject(""));
   } catch (IllegalStateException& excpt) {
     exceptionCounter++;
     LOGINFO("readObject():: Got expected Exception :: %s ", excpt.what());
@@ -539,21 +539,21 @@ void InvalidPdxUsage::fromData(std::shared_ptr<PdxReader> pr) {
 
   try {
     m_hashtable =
-        std::dynamic_pointer_cast<CacheableHashTable>(pr->readObject(""));
+        std::dynamic_pointer_cast<CacheableHashTable>(pr.readObject(""));
   } catch (IllegalStateException& excpt) {
     exceptionCounter++;
     LOGINFO("readObject():: Got expected Exception :: %s ", excpt.what());
   }
 
   try {
-    m_vector = std::dynamic_pointer_cast<CacheableVector>(pr->readObject(""));
+    m_vector = std::dynamic_pointer_cast<CacheableVector>(pr.readObject(""));
   } catch (IllegalStateException& excpt) {
     exceptionCounter++;
     LOGINFO("readObject():: Got expected Exception :: %s ", excpt.what());
   }
 
   try {
-    m_chs = std::dynamic_pointer_cast<CacheableHashSet>(pr->readObject(""));
+    m_chs = std::dynamic_pointer_cast<CacheableHashSet>(pr.readObject(""));
   } catch (IllegalStateException& excpt) {
     exceptionCounter++;
     LOGINFO("readObject():: Got expected Exception :: %s ", excpt.what());
@@ -561,35 +561,35 @@ void InvalidPdxUsage::fromData(std::shared_ptr<PdxReader> pr) {
 
   try {
     m_clhs =
-        std::dynamic_pointer_cast<CacheableLinkedHashSet>(pr->readObject(""));
+        std::dynamic_pointer_cast<CacheableLinkedHashSet>(pr.readObject(""));
   } catch (IllegalStateException& excpt) {
     exceptionCounter++;
     LOGINFO("readObject():: Got expected Exception :: %s ", excpt.what());
   }
 
   try {
-    m_string = pr->readString("");  // GenericValCompare
+    m_string = pr.readString("");  // GenericValCompare
   } catch (IllegalStateException& excpt) {
     exceptionCounter++;
     LOGINFO("readString():: Got expected Exception :: %s ", excpt.what());
   }
 
   try {
-    m_date = std::dynamic_pointer_cast<CacheableDate>(pr->readDate(""));
+    m_date = std::dynamic_pointer_cast<CacheableDate>(pr.readDate(""));
   } catch (IllegalStateException& excpt) {
     exceptionCounter++;
     LOGINFO("readDate():: Got expected Exception :: %s ", excpt.what());
   }
 
   try {
-    m_double = pr->readDouble("");
+    m_double = pr.readDouble("");
   } catch (IllegalStateException& excpt) {
     exceptionCounter++;
     LOGINFO("readDouble():: Got expected Exception :: %s ", excpt.what());
   }
 
   try {
-    m_doubleArray = pr->readDoubleArray("", doubleArrayLen);
+    m_doubleArray = pr.readDoubleArray("", doubleArrayLen);
   } catch (IllegalStateException& excpt) {
     exceptionCounter++;
     LOGINFO("readDoubleArray():: Got expected Exception :: %s ",
@@ -597,14 +597,14 @@ void InvalidPdxUsage::fromData(std::shared_ptr<PdxReader> pr) {
   }
 
   try {
-    m_float = pr->readFloat("");
+    m_float = pr.readFloat("");
   } catch (IllegalStateException& excpt) {
     exceptionCounter++;
     LOGINFO("readFloat():: Got expected Exception :: %s ", excpt.what());
   }
 
   try {
-    m_floatArray = pr->readFloatArray("", floatArrayLen);
+    m_floatArray = pr.readFloatArray("", floatArrayLen);
   } catch (IllegalStateException& excpt) {
     exceptionCounter++;
     LOGINFO("readFloatArray():: Got expected Exception :: %s ",
@@ -612,28 +612,28 @@ void InvalidPdxUsage::fromData(std::shared_ptr<PdxReader> pr) {
   }
 
   try {
-    m_int16 = pr->readShort("");
+    m_int16 = pr.readShort("");
   } catch (IllegalStateException& excpt) {
     exceptionCounter++;
     LOGINFO("readShort():: Got expected Exception :: %s ", excpt.what());
   }
 
   try {
-    m_int32 = pr->readInt("");
+    m_int32 = pr.readInt("");
   } catch (IllegalStateException& excpt) {
     exceptionCounter++;
     LOGINFO("readInt():: Got expected Exception :: %s ", excpt.what());
   }
 
   try {
-    m_long = pr->readLong("");
+    m_long = pr.readLong("");
   } catch (IllegalStateException& excpt) {
     exceptionCounter++;
     LOGINFO("readLong():: Got expected Exception :: %s ", excpt.what());
   }
 
   try {
-    m_int32Array = pr->readIntArray("", intArrayLen);
+    m_int32Array = pr.readIntArray("", intArrayLen);
   } catch (IllegalStateException& excpt) {
     exceptionCounter++;
     LOGINFO("readIntArray():: Got expected Exception :: %s ",
@@ -641,7 +641,7 @@ void InvalidPdxUsage::fromData(std::shared_ptr<PdxReader> pr) {
   }
 
   try {
-    m_longArray = pr->readLongArray("", longArrayLen);
+    m_longArray = pr.readLongArray("", longArrayLen);
   } catch (IllegalStateException& excpt) {
     exceptionCounter++;
     LOGINFO("readLongArray():: Got expected Exception :: %s ",
@@ -649,7 +649,7 @@ void InvalidPdxUsage::fromData(std::shared_ptr<PdxReader> pr) {
   }
 
   try {
-    m_int16Array = pr->readShortArray("", shortArrayLen);
+    m_int16Array = pr.readShortArray("", shortArrayLen);
   } catch (IllegalStateException& excpt) {
     exceptionCounter++;
     LOGINFO("readShortArray():: Got expected Exception :: %s ",
@@ -657,13 +657,13 @@ void InvalidPdxUsage::fromData(std::shared_ptr<PdxReader> pr) {
   }
 
   try {
-    m_sbyte = pr->readByte("");
+    m_sbyte = pr.readByte("");
   } catch (IllegalStateException& excpt) {
     exceptionCounter++;
     LOGINFO("readByte():: Got expected Exception :: %s ", excpt.what());
   }
   try {
-    m_sbyteArray = pr->readByteArray("", byteArrayLen);
+    m_sbyteArray = pr.readByteArray("", byteArrayLen);
   } catch (IllegalStateException& excpt) {
     exceptionCounter++;
     LOGINFO("readByteArray():: Got expected Exception :: %s ",
@@ -671,7 +671,7 @@ void InvalidPdxUsage::fromData(std::shared_ptr<PdxReader> pr) {
   }
 
   try {
-    m_stringArray = pr->readStringArray("");
+    m_stringArray = pr.readStringArray("");
   } catch (IllegalStateException& excpt) {
     exceptionCounter++;
     LOGINFO("readStringArray():: Got expected Exception :: %s ",
@@ -679,28 +679,28 @@ void InvalidPdxUsage::fromData(std::shared_ptr<PdxReader> pr) {
   }
 
   try {
-    m_uint16 = pr->readShort("");
+    m_uint16 = pr.readShort("");
   } catch (IllegalStateException& excpt) {
     exceptionCounter++;
     LOGINFO("readShort():: Got expected Exception :: %s ", excpt.what());
   }
 
   try {
-    m_uint32 = pr->readInt("");
+    m_uint32 = pr.readInt("");
   } catch (IllegalStateException& excpt) {
     exceptionCounter++;
     LOGINFO("readInt():: Got expected Exception :: %s ", excpt.what());
   }
 
   try {
-    m_ulong = pr->readLong("");
+    m_ulong = pr.readLong("");
   } catch (IllegalStateException& excpt) {
     exceptionCounter++;
     LOGINFO("readLong():: Got expected Exception :: %s ", excpt.what());
   }
 
   try {
-    m_uint32Array = pr->readIntArray("", intArrayLen);
+    m_uint32Array = pr.readIntArray("", intArrayLen);
   } catch (IllegalStateException& excpt) {
     exceptionCounter++;
     LOGINFO("readIntArray():: Got expected Exception :: %s ",
@@ -708,7 +708,7 @@ void InvalidPdxUsage::fromData(std::shared_ptr<PdxReader> pr) {
   }
 
   try {
-    m_ulongArray = pr->readLongArray("", longArrayLen);
+    m_ulongArray = pr.readLongArray("", longArrayLen);
   } catch (IllegalStateException& excpt) {
     exceptionCounter++;
     LOGINFO("readLongArray():: Got expected Exception :: %s ",
@@ -716,7 +716,7 @@ void InvalidPdxUsage::fromData(std::shared_ptr<PdxReader> pr) {
   }
 
   try {
-    m_uint16Array = pr->readShortArray("", shortArrayLen);
+    m_uint16Array = pr.readShortArray("", shortArrayLen);
   } catch (IllegalStateException& excpt) {
     exceptionCounter++;
     LOGINFO("readShortArray():: Got expected Exception :: %s ",
@@ -724,14 +724,14 @@ void InvalidPdxUsage::fromData(std::shared_ptr<PdxReader> pr) {
   }
 
   try {
-    m_byte252 = pr->readByteArray("", m_byte252Len);
+    m_byte252 = pr.readByteArray("", m_byte252Len);
   } catch (IllegalStateException& excpt) {
     exceptionCounter++;
     LOGINFO("readByteArray():: Got expected Exception :: %s ",
             excpt.what());
   }
   try {
-    m_byte253 = pr->readByteArray("", m_byte253Len);
+    m_byte253 = pr.readByteArray("", m_byte253Len);
   } catch (IllegalStateException& excpt) {
     exceptionCounter++;
     LOGINFO("readByteArray():: Got expected Exception :: %s ",
@@ -739,7 +739,7 @@ void InvalidPdxUsage::fromData(std::shared_ptr<PdxReader> pr) {
   }
 
   try {
-    m_byte65535 = pr->readByteArray("", m_byte65535Len);
+    m_byte65535 = pr.readByteArray("", m_byte65535Len);
   } catch (IllegalStateException& excpt) {
     exceptionCounter++;
     LOGINFO("readByteArray():: Got expected Exception :: %s ",
@@ -747,7 +747,7 @@ void InvalidPdxUsage::fromData(std::shared_ptr<PdxReader> pr) {
   }
 
   try {
-    m_byte65536 = pr->readByteArray("", m_byte65536Len);
+    m_byte65536 = pr.readByteArray("", m_byte65536Len);
   } catch (IllegalStateException& excpt) {
     exceptionCounter++;
     LOGINFO("readByteArray():: Got expected Exception :: %s ",
@@ -755,21 +755,21 @@ void InvalidPdxUsage::fromData(std::shared_ptr<PdxReader> pr) {
   }
 
   try {
-    m_pdxEnum = std::static_pointer_cast<CacheableEnum>(pr->readObject(""));
+    m_pdxEnum = std::static_pointer_cast<CacheableEnum>(pr.readObject(""));
   } catch (IllegalStateException& excpt) {
     exceptionCounter++;
     LOGINFO("readObject():: Got expected Exception :: %s ", excpt.what());
   }
 
   try {
-    m_address = pr->readObject("");
+    m_address = pr.readObject("");
   } catch (IllegalStateException& excpt) {
     exceptionCounter++;
     LOGINFO("readObject():: Got expected Exception :: %s ", excpt.what());
   }
 
   try {
-    m_objectArray = pr->readObjectArray("");
+    m_objectArray = pr.readObjectArray("");
   } catch (IllegalStateException& excpt) {
     exceptionCounter++;
     LOGINFO("readObjectArray():: Got expected Exception :: %s ",
@@ -777,8 +777,8 @@ void InvalidPdxUsage::fromData(std::shared_ptr<PdxReader> pr) {
   }
 
   try {
-    toDataexceptionCounter = pr->readInt("toDataexceptionCounter");
-    fromDataexceptionCounter = pr->readInt("fromDataexceptionCounter");
+    toDataexceptionCounter = pr.readInt("toDataexceptionCounter");
+    fromDataexceptionCounter = pr.readInt("fromDataexceptionCounter");
   } catch (IllegalStateException& excpt) {
     exceptionCounter++;
     LOGINFO("readObjectArray():: Got expected Exception :: %s ",
diff --git a/tests/cpp/testobject/InvalidPdxUsage.hpp b/tests/cpp/testobject/InvalidPdxUsage.hpp
index 8fe6473..adf205e 100644
--- a/tests/cpp/testobject/InvalidPdxUsage.hpp
+++ b/tests/cpp/testobject/InvalidPdxUsage.hpp
@@ -113,14 +113,14 @@ class TESTOBJECT_EXPORT CharTypesWithInvalidUsage : public PdxSerializable {
   using PdxSerializable::toData;
   using PdxSerializable::fromData;
 
-  void toData(std::shared_ptr<PdxWriter> pw) const override {
-    pw->writeChar("m_ch", m_ch);
-    pw->writeCharArray("m_chArray", m_chArray, 2);
+  void toData(PdxWriter& pw) const override {
+    pw.writeChar("m_ch", m_ch);
+    pw.writeCharArray("m_chArray", m_chArray, 2);
   }
 
-  void fromData(std::shared_ptr<PdxReader> pr) override {
-    m_ch = pr->readChar("m_ch");
-    m_chArray = pr->readCharArray("m_chArray", m_charArrayLen);
+  void fromData(PdxReader& pr) override {
+    m_ch = pr.readChar("m_ch");
+    m_chArray = pr.readCharArray("m_chArray", m_charArrayLen);
   }
 
   static PdxSerializable* createDeserializable() {
@@ -179,16 +179,16 @@ class TESTOBJECT_EXPORT AddressWithInvalidAPIUsage : public PdxSerializable {
   using PdxSerializable::toData;
   using PdxSerializable::fromData;
 
-  void toData(std::shared_ptr<PdxWriter> pw) const override {
-    pw->writeInt("_aptNumber", _aptNumber);  // 4
-    pw->writeString("_street", _street);
-    pw->writeString("_city", _city);
+  void toData(PdxWriter& pw) const override {
+    pw.writeInt("_aptNumber", _aptNumber);  // 4
+    pw.writeString("_street", _street);
+    pw.writeString("_city", _city);
   }
 
-  void fromData(std::shared_ptr<PdxReader> pr) override {
-    _aptNumber = pr->readInt("_aptNumber");
-    _street = pr->readString("_street");
-    _city = pr->readString("_city");
+  void fromData(PdxReader& pr) override {
+    _aptNumber = pr.readInt("_aptNumber");
+    _street = pr.readString("_street");
+    _city = pr.readString("_city");
   }
 
   static PdxSerializable* createDeserializable() {
@@ -612,9 +612,9 @@ class TESTOBJECT_EXPORT InvalidPdxUsage : public PdxSerializable {
   using PdxSerializable::toData;
   using PdxSerializable::fromData;
 
-  virtual void toData(std::shared_ptr<PdxWriter> pw) const override;
+  virtual void toData(PdxWriter& pw) const override;
 
-  virtual void fromData(std::shared_ptr<PdxReader> pr) override;
+  virtual void fromData(PdxReader& pr) override;
 
   std::string toString() const override;
 
diff --git a/tests/cpp/testobject/NestedPdxObject.cpp b/tests/cpp/testobject/NestedPdxObject.cpp
index 2f89611..955bf50 100644
--- a/tests/cpp/testobject/NestedPdxObject.cpp
+++ b/tests/cpp/testobject/NestedPdxObject.cpp
@@ -26,24 +26,24 @@ using namespace testobject;
 
 ChildPdx::~ChildPdx() {}
 
-void ChildPdx::toData(std::shared_ptr<PdxWriter> pw) const {
+void ChildPdx::toData(PdxWriter& pw) const {
   LOGDEBUG("ChildPdx::toData() Started......");
 
-  pw->writeInt("m_childId", m_childId);
-  pw->markIdentityField("m_childId");
-  pw->writeObject("m_enum", m_enum);
-  pw->writeString("m_childName", m_childName);
+  pw.writeInt("m_childId", m_childId);
+  pw.markIdentityField("m_childId");
+  pw.writeObject("m_enum", m_enum);
+  pw.writeString("m_childName", m_childName);
 
   LOGDEBUG("ChildPdx::toData() Done......");
 }
 
-void ChildPdx::fromData(std::shared_ptr<PdxReader> pr) {
+void ChildPdx::fromData(PdxReader& pr) {
   LOGINFO("ChildPdx::fromData() start...");
 
-  m_childId = pr->readInt("m_childId");
+  m_childId = pr.readInt("m_childId");
   LOGINFO("ChildPdx::fromData() m_childId = %d ", m_childId);
-  m_enum = std::static_pointer_cast<CacheableEnum>(pr->readObject("m_enum"));
-  m_childName = pr->readString("m_childName");
+  m_enum = std::static_pointer_cast<CacheableEnum>(pr.readObject("m_enum"));
+  m_childName = pr.readString("m_childName");
 
   LOGINFO("ChildPdx::fromData() end...");
 }
@@ -73,40 +73,40 @@ bool ChildPdx::equals(ChildPdx& other) const {
 
 ParentPdx::~ParentPdx() {}
 
-void ParentPdx::toData(std::shared_ptr<PdxWriter> pw) const {
+void ParentPdx::toData(PdxWriter& pw) const {
   LOGDEBUG("ParentPdx::toData() Started......");
 
-  pw->writeInt("m_parentId", m_parentId);
+  pw.writeInt("m_parentId", m_parentId);
   LOGDEBUG("ParentPdx::toData() m_parentId......");
-  pw->markIdentityField("m_parentId");
-  pw->writeObject("m_enum", m_enum);
+  pw.markIdentityField("m_parentId");
+  pw.writeObject("m_enum", m_enum);
   LOGDEBUG("ParentPdx::toData() m_enum......");
-  pw->writeString("m_parentName", m_parentName);
+  pw.writeString("m_parentName", m_parentName);
   LOGDEBUG("ParentPdx::toData() m_parentName......");
-  pw->writeObject("m_childPdx", m_childPdx);
+  pw.writeObject("m_childPdx", m_childPdx);
   LOGDEBUG("ParentPdx::toData() m_childPdx......");
-  pw->markIdentityField("m_childPdx");
+  pw.markIdentityField("m_childPdx");
 
-  pw->writeChar("m_char", m_char);
-  pw->writeCharArray("m_charArray", m_charArray, 2);
+  pw.writeChar("m_char", m_char);
+  pw.writeCharArray("m_charArray", m_charArray, 2);
 
   LOGDEBUG("ParentPdx::toData() Done......");
 }
 
-void ParentPdx::fromData(std::shared_ptr<PdxReader> pr) {
+void ParentPdx::fromData(PdxReader& pr) {
   LOGINFO("ParentPdx::fromData() start...");
 
-  m_parentId = pr->readInt("m_parentId");
+  m_parentId = pr.readInt("m_parentId");
   LOGINFO("ParentPdx::fromData() m_parentId = %d ", m_parentId);
-  m_enum = std::static_pointer_cast<CacheableEnum>(pr->readObject("m_enum"));
+  m_enum = std::static_pointer_cast<CacheableEnum>(pr.readObject("m_enum"));
   LOGINFO("ParentPdx::fromData() read gender ");
-  m_parentName = pr->readString("m_parentName");
+  m_parentName = pr.readString("m_parentName");
   LOGINFO("ParentPdx::fromData() m_parentName = %s ", m_parentName.c_str());
-  m_childPdx = pr->readObject("m_childPdx");
+  m_childPdx = pr.readObject("m_childPdx");
   LOGINFO("ParentPdx::fromData() start3...");
 
-  m_char = pr->readChar("m_char");
-  m_charArray = pr->readCharArray("m_charArray", m_charArrayLen);
+  m_char = pr.readChar("m_char");
+  m_charArray = pr.readCharArray("m_charArray", m_charArrayLen);
 
   LOGINFO("ParentPdx::fromData() end...");
 }
diff --git a/tests/cpp/testobject/NestedPdxObject.hpp b/tests/cpp/testobject/NestedPdxObject.hpp
index d767609..d462b53 100644
--- a/tests/cpp/testobject/NestedPdxObject.hpp
+++ b/tests/cpp/testobject/NestedPdxObject.hpp
@@ -73,9 +73,9 @@ class TESTOBJECT_EXPORT ChildPdx : public PdxSerializable {
   using PdxSerializable::toData;
   using PdxSerializable::fromData;
 
-  virtual void toData(std::shared_ptr<PdxWriter> pw) const override;
+  virtual void toData(PdxWriter& pw) const override;
 
-  virtual void fromData(std::shared_ptr<PdxReader> pr) override;
+  virtual void fromData(PdxReader& pr) override;
 
   std::string toString() const override;
 
@@ -144,9 +144,9 @@ class TESTOBJECT_EXPORT ParentPdx : public PdxSerializable {
   using PdxSerializable::toData;
   using PdxSerializable::fromData;
 
-  virtual void toData(std::shared_ptr<PdxWriter> pw) const override;
+  virtual void toData(PdxWriter& pw) const override;
 
-  virtual void fromData(std::shared_ptr<PdxReader> pr) override;
+  virtual void fromData(PdxReader& pr) override;
 
   std::string toString() const override;
 
@@ -203,15 +203,15 @@ class TESTOBJECT_EXPORT PdxEnumTestClass : public PdxSerializable {
   using PdxSerializable::toData;
   using PdxSerializable::fromData;
 
-  void toData(std::shared_ptr<PdxWriter> pw) const override {
-    pw->writeInt("m_id", m_id);
-    pw->writeObject("m_enumid", m_enumid);
+  void toData(PdxWriter& pw) const override {
+    pw.writeInt("m_id", m_id);
+    pw.writeObject("m_enumid", m_enumid);
   }
 
-  void fromData(std::shared_ptr<PdxReader> pr) override {
-    m_id = pr->readInt("m_id");
+  void fromData(PdxReader& pr) override {
+    m_id = pr.readInt("m_id");
     m_enumid =
-        std::static_pointer_cast<CacheableEnum>(pr->readObject("m_enumid"));
+        std::static_pointer_cast<CacheableEnum>(pr.readObject("m_enumid"));
   }
 
   std::string toString() const override { return "PdxEnumTestClass"; }
@@ -257,20 +257,20 @@ class TESTOBJECT_EXPORT SerializePdx : public PdxSerializable {
   using PdxSerializable::toData;
   using PdxSerializable::fromData;
 
-  void toData(std::shared_ptr<PdxWriter> pw) const override {
-    pw->writeInt("i1", i1);
-    pw->markIdentityField("i1");
-    pw->writeInt("i2", i2);
-    pw->writeString("s1", s1);
-    pw->markIdentityField("s1");
-    pw->writeString("s2", s2);
+  void toData(PdxWriter& pw) const override {
+    pw.writeInt("i1", i1);
+    pw.markIdentityField("i1");
+    pw.writeInt("i2", i2);
+    pw.writeString("s1", s1);
+    pw.markIdentityField("s1");
+    pw.writeString("s2", s2);
   }
 
-  void fromData(std::shared_ptr<PdxReader> pr) override {
-    i1 = pr->readInt("i1");
-    i2 = pr->readInt("i2");
-    s1 = pr->readString("s1");
-    s2 = pr->readString("s2");
+  void fromData(PdxReader& pr) override {
+    i1 = pr.readInt("i1");
+    i2 = pr.readInt("i2");
+    s1 = pr.readString("s1");
+    s2 = pr.readString("s2");
   }
 
   std::string toString() const override { return "SerializePdx"; }
diff --git a/tests/cpp/testobject/PdxClassV1.cpp b/tests/cpp/testobject/PdxClassV1.cpp
index 3ea2beb..e2bd84d 100644
--- a/tests/cpp/testobject/PdxClassV1.cpp
+++ b/tests/cpp/testobject/PdxClassV1.cpp
@@ -71,81 +71,81 @@ bool PdxType1V1::equals(std::shared_ptr<PdxSerializable> obj) {
   return false;
 }
 
-void PdxType1V1::toData(std::shared_ptr<PdxWriter> pw) const {
-  if (!m_useWeakHashMap) pw->writeUnreadFields(m_pdxUreadFields);
+void PdxType1V1::toData(PdxWriter& pw) const {
+  if (!m_useWeakHashMap) pw.writeUnreadFields(m_pdxUreadFields);
 
-  pw->writeInt("i1", m_i1 + 1);
-  pw->markIdentityField("i1");
-  pw->writeInt("i2", m_i2 + 1);
-  pw->writeInt("i3", m_i3 + 1);
-  pw->writeInt("i4", m_i4 + 1);
+  pw.writeInt("i1", m_i1 + 1);
+  pw.markIdentityField("i1");
+  pw.writeInt("i2", m_i2 + 1);
+  pw.writeInt("i3", m_i3 + 1);
+  pw.writeInt("i4", m_i4 + 1);
 
   m_diffInSameFields++;
 
   /*
-  pw->writeBoolean("m_bool", m_bool);
-  pw->writeByte("m_byte", m_byte);
-  pw->writeShort("m_int16", m_int16);
-  pw->writeInt("m_int32", m_int32);
-  pw->writeLong("m_long", m_long);
-  pw->writeFloat("m_float", m_float);
-  pw->writeDouble("m_double", m_double);
-  pw->writeString("m_string", m_string);
-  pw->writeBooleanArray("m_boolArray", m_boolArray, 3);
-  pw->writeByteArray("m_byteArray",m_byteArray, 2);
-  pw->writeShortArray("m_int16Array", m_int16Array, 2);
-  pw->writeIntArray("m_int32Array", m_int32Array, 4);
-  pw->writeLongArray("m_longArray", m_longArray, 2);
-  pw->writeFloatArray("m_floatArray", m_floatArray, 2);
-  pw->writeDoubleArray("m_doubleArray", m_doubleArray, 2);
+  pw.writeBoolean("m_bool", m_bool);
+  pw.writeByte("m_byte", m_byte);
+  pw.writeShort("m_int16", m_int16);
+  pw.writeInt("m_int32", m_int32);
+  pw.writeLong("m_long", m_long);
+  pw.writeFloat("m_float", m_float);
+  pw.writeDouble("m_double", m_double);
+  pw.writeString("m_string", m_string);
+  pw.writeBooleanArray("m_boolArray", m_boolArray, 3);
+  pw.writeByteArray("m_byteArray",m_byteArray, 2);
+  pw.writeShortArray("m_int16Array", m_int16Array, 2);
+  pw.writeIntArray("m_int32Array", m_int32Array, 4);
+  pw.writeLongArray("m_longArray", m_longArray, 2);
+  pw.writeFloatArray("m_floatArray", m_floatArray, 2);
+  pw.writeDoubleArray("m_doubleArray", m_doubleArray, 2);
 */
   // LOGDEBUG("PdxObject::toData() Done......");
 }
 
-void PdxType1V1::fromData(std::shared_ptr<PdxReader> pr) {
+void PdxType1V1::fromData(PdxReader& pr) {
   // LOGDEBUG("PdxObject::fromData() start...");
 
-  if (!m_useWeakHashMap) m_pdxUreadFields = pr->readUnreadFields();
+  if (!m_useWeakHashMap) m_pdxUreadFields = pr.readUnreadFields();
 
-  m_i1 = pr->readInt("i1");
-  m_i2 = pr->readInt("i2");
-  m_i3 = pr->readInt("i3");
-  m_i4 = pr->readInt("i4");
+  m_i1 = pr.readInt("i1");
+  m_i2 = pr.readInt("i2");
+  m_i3 = pr.readInt("i3");
+  m_i4 = pr.readInt("i4");
 
-  bool hasField = pr->hasField("i7");
+  bool hasField = pr.hasField("i7");
 
   if (hasField) throw Exception("i7 is not an valid field");
 
-  hasField = pr->hasField("i4");
+  hasField = pr.hasField("i4");
 
   if (!hasField) throw Exception("i4 is an valid field");
 
   /*
-  m_bool = pr->readBoolean("m_bool");
+  m_bool = pr.readBoolean("m_bool");
   //LOGDEBUG("PdxObject::fromData() -1 m_bool = %d", m_bool);
-  m_byte = pr->readByte("m_byte");
+  m_byte = pr.readByte("m_byte");
   //LOGDEBUG("PdxObject::fromData() -2 m_byte =%d", m_byte);
-  m_int16 = pr->readShort("m_int16");
+  m_int16 = pr.readShort("m_int16");
   //LOGDEBUG("PdxObject::fromData() -3 m_int16=%d", m_int16);
-  m_int32 = pr->readInt("m_int32");
+  m_int32 = pr.readInt("m_int32");
   //LOGDEBUG("PdxObject::fromData() -4 m_int32=%d", m_int32);
-  m_long = pr->readLong("m_long");
+  m_long = pr.readLong("m_long");
   //LOGDEBUG("PdxObject::fromData() -5 m_long=%lld", m_long);
-  m_float = pr->readFloat("m_float");
+  m_float = pr.readFloat("m_float");
   //LOGDEBUG("PdxObject::fromData() -6 m_float = %f", m_float);
-  m_double = pr->readDouble("m_double");
+  m_double = pr.readDouble("m_double");
   //LOGDEBUG("PdxObject::fromData() -7  m_double=%llf", m_double);
-  m_string = pr->readString("m_string");
+  m_string = pr.readString("m_string");
   //LOGDEBUG("PdxObject::fromData() -8  m_string=%s", m_string);
-  m_boolArray = pr->readBooleanArray("m_boolArray");
-  m_byteArray = pr->readByteArray("m_byteArray");
-  m_int16Array = pr->readShortArray("m_int16Array");
-  m_int32Array = pr->readIntArray("m_int32Array");
-  m_longArray = pr->readLongArray("m_longArray");
-  m_floatArray = pr->readFloatArray("m_floatArray");
-  m_doubleArray = pr->readDoubleArray("m_doubleArray");
+  m_boolArray = pr.readBooleanArray("m_boolArray");
+  m_byteArray = pr.readByteArray("m_byteArray");
+  m_int16Array = pr.readShortArray("m_int16Array");
+  m_int32Array = pr.readIntArray("m_int32Array");
+  m_longArray = pr.readLongArray("m_longArray");
+  m_floatArray = pr.readFloatArray("m_floatArray");
+  m_doubleArray = pr.readDoubleArray("m_doubleArray");
   //LOGDEBUG("PdxObject::fromData() -8  m_boolArray[0]=%d", m_boolArray[0]);
-  //m_int32 = pr->readInt("m_int32");
+  //m_int32 = pr.readInt("m_int32");
   */
   LOGDEBUG("PdxObject::fromData() End...");
 }
@@ -211,24 +211,24 @@ bool PdxType2V1::equals(std::shared_ptr<PdxSerializable> obj) {
   return false;
 }
 
-void PdxType2V1::toData(std::shared_ptr<PdxWriter> pw) const {
-  if (!m_useWeakHashMap) pw->writeUnreadFields(m_unreadFields);
+void PdxType2V1::toData(PdxWriter& pw) const {
+  if (!m_useWeakHashMap) pw.writeUnreadFields(m_unreadFields);
 
-  pw->writeInt("i1", m_i1 + 1);
-  pw->writeInt("i2", m_i2 + 1);
-  pw->writeInt("i3", m_i3 + 1);
-  pw->writeInt("i4", m_i4 + 1);
+  pw.writeInt("i1", m_i1 + 1);
+  pw.writeInt("i2", m_i2 + 1);
+  pw.writeInt("i3", m_i3 + 1);
+  pw.writeInt("i4", m_i4 + 1);
 }
 
-void PdxType2V1::fromData(std::shared_ptr<PdxReader> pr) {
+void PdxType2V1::fromData(PdxReader& pr) {
   // LOGDEBUG("PdxObject::fromData() start...");
 
-  if (!m_useWeakHashMap) m_unreadFields = pr->readUnreadFields();
+  if (!m_useWeakHashMap) m_unreadFields = pr.readUnreadFields();
 
-  m_i1 = pr->readInt("i1");
-  m_i2 = pr->readInt("i2");
-  m_i3 = pr->readInt("i3");
-  m_i4 = pr->readInt("i4");
+  m_i1 = pr.readInt("i1");
+  m_i2 = pr.readInt("i2");
+  m_i3 = pr.readInt("i3");
+  m_i4 = pr.readInt("i4");
 }
 std::string PdxType2V1::toString() const {
   char idbuf[4096];
@@ -290,33 +290,33 @@ bool PdxType3V1::equals(std::shared_ptr<PdxSerializable> obj) {
   return false;
 }
 
-void PdxType3V1::toData(std::shared_ptr<PdxWriter> pw) const {
-  if (!m_useWeakHashMap) pw->writeUnreadFields(m_unreadFields);
+void PdxType3V1::toData(PdxWriter& pw) const {
+  if (!m_useWeakHashMap) pw.writeUnreadFields(m_unreadFields);
 
-  pw->writeInt("i1", m_i1 + 1);
-  pw->writeInt("i2", m_i2 + 1);
-  pw->writeString("m_str1", m_str1);
-  pw->writeInt("i3", m_i3 + 1);
-  pw->writeInt("i4", m_i4 + 1);
-  pw->writeInt("i5", m_i5 + 1);
-  pw->writeString("m_str2", m_str2);
+  pw.writeInt("i1", m_i1 + 1);
+  pw.writeInt("i2", m_i2 + 1);
+  pw.writeString("m_str1", m_str1);
+  pw.writeInt("i3", m_i3 + 1);
+  pw.writeInt("i4", m_i4 + 1);
+  pw.writeInt("i5", m_i5 + 1);
+  pw.writeString("m_str2", m_str2);
 
   m_diffInSameFields++;
   m_diffInExtraFields++;
 }
 
-void PdxType3V1::fromData(std::shared_ptr<PdxReader> pr) {
+void PdxType3V1::fromData(PdxReader& pr) {
   // LOGDEBUG("PdxObject::fromData() start...");
 
-  if (!m_useWeakHashMap) m_unreadFields = pr->readUnreadFields();
+  if (!m_useWeakHashMap) m_unreadFields = pr.readUnreadFields();
 
-  m_i1 = pr->readInt("i1");
-  m_i2 = pr->readInt("i2");
-  m_str1 = pr->readString("m_str1");
-  m_i3 = pr->readInt("i3");
-  m_i4 = pr->readInt("i4");
-  m_i5 = pr->readInt("i5");
-  auto tmp = pr->readString("m_str2");
+  m_i1 = pr.readInt("i1");
+  m_i2 = pr.readInt("i2");
+  m_str1 = pr.readString("m_str1");
+  m_i3 = pr.readInt("i3");
+  m_i4 = pr.readInt("i4");
+  m_i5 = pr.readInt("i5");
+  auto tmp = pr.readString("m_str2");
 
   if (tmp.empty()) {
     m_str2 = std::to_string(m_diffInExtraFields);
@@ -377,24 +377,24 @@ bool PdxTypesV1R1::equals(std::shared_ptr<PdxSerializable> obj) {
   return false;
 }
 
-void PdxTypesV1R1::toData(std::shared_ptr<PdxWriter> pw) const {
-  if (!m_useWeakHashMap) pw->writeUnreadFields(m_pdxUreadFields);
+void PdxTypesV1R1::toData(PdxWriter& pw) const {
+  if (!m_useWeakHashMap) pw.writeUnreadFields(m_pdxUreadFields);
 
-  pw->writeInt("i1", m_i1 + 1);
-  pw->writeInt("i2", m_i2 + 1);
-  pw->writeInt("i3", m_i3 + 1);
-  pw->writeInt("i4", m_i4 + 1);
+  pw.writeInt("i1", m_i1 + 1);
+  pw.writeInt("i2", m_i2 + 1);
+  pw.writeInt("i3", m_i3 + 1);
+  pw.writeInt("i4", m_i4 + 1);
 
   m_diffInSameFields++;
 }
 
-void PdxTypesV1R1::fromData(std::shared_ptr<PdxReader> pr) {
-  if (!m_useWeakHashMap) m_pdxUreadFields = pr->readUnreadFields();
+void PdxTypesV1R1::fromData(PdxReader& pr) {
+  if (!m_useWeakHashMap) m_pdxUreadFields = pr.readUnreadFields();
 
-  m_i1 = pr->readInt("i1");
-  m_i2 = pr->readInt("i2");
-  m_i3 = pr->readInt("i3");
-  m_i4 = pr->readInt("i4");
+  m_i1 = pr.readInt("i1");
+  m_i2 = pr.readInt("i2");
+  m_i3 = pr.readInt("i3");
+  m_i4 = pr.readInt("i4");
 }
 std::string PdxTypesV1R1::toString() const {
   char idbuf[4096];
@@ -447,23 +447,23 @@ bool PdxTypesV1R2::equals(std::shared_ptr<PdxSerializable> obj) {
   return false;
 }
 
-void PdxTypesV1R2::toData(std::shared_ptr<PdxWriter> pw) const {
-  if (!m_useWeakHashMap) pw->writeUnreadFields(m_pdxUreadFields);
+void PdxTypesV1R2::toData(PdxWriter& pw) const {
+  if (!m_useWeakHashMap) pw.writeUnreadFields(m_pdxUreadFields);
 
-  pw->writeInt("i1", m_i1 + 1);
-  pw->writeInt("i2", m_i2 + 1);
-  pw->writeInt("i3", m_i3 + 1);
-  pw->writeInt("i4", m_i4 + 1);
+  pw.writeInt("i1", m_i1 + 1);
+  pw.writeInt("i2", m_i2 + 1);
+  pw.writeInt("i3", m_i3 + 1);
+  pw.writeInt("i4", m_i4 + 1);
 }
 
-void PdxTypesV1R2::fromData(std::shared_ptr<PdxReader> pr) {
+void PdxTypesV1R2::fromData(PdxReader& pr) {
   // LOGDEBUG("PdxObject::fromData() start...");
-  if (!m_useWeakHashMap) m_pdxUreadFields = pr->readUnreadFields();
+  if (!m_useWeakHashMap) m_pdxUreadFields = pr.readUnreadFields();
 
-  m_i1 = pr->readInt("i1");
-  m_i2 = pr->readInt("i2");
-  m_i3 = pr->readInt("i3");
-  m_i4 = pr->readInt("i4");
+  m_i1 = pr.readInt("i1");
+  m_i2 = pr.readInt("i2");
+  m_i3 = pr.readInt("i3");
+  m_i4 = pr.readInt("i4");
 }
 std::string PdxTypesV1R2::toString() const {
   char idbuf[4096];
@@ -517,32 +517,32 @@ bool PdxTypesIgnoreUnreadFieldsV1::equals(
   return false;
 }
 
-void PdxTypesIgnoreUnreadFieldsV1::toData(std::shared_ptr<PdxWriter> pw) const {
-  if (!m_useWeakHashMap) pw->writeUnreadFields(m_unreadFields);
+void PdxTypesIgnoreUnreadFieldsV1::toData(PdxWriter& pw) const {
+  if (!m_useWeakHashMap) pw.writeUnreadFields(m_unreadFields);
 
-  pw->writeInt("i1", m_i1 + 1);
-  pw->markIdentityField("i1");
-  pw->writeInt("i2", m_i2 + 1);
-  pw->writeInt("i3", m_i3 + 1);
-  pw->writeInt("i4", m_i4 + 1);
+  pw.writeInt("i1", m_i1 + 1);
+  pw.markIdentityField("i1");
+  pw.writeInt("i2", m_i2 + 1);
+  pw.writeInt("i3", m_i3 + 1);
+  pw.writeInt("i4", m_i4 + 1);
 
   m_diffInSameFields++;
 }
 
-void PdxTypesIgnoreUnreadFieldsV1::fromData(std::shared_ptr<PdxReader> pr) {
+void PdxTypesIgnoreUnreadFieldsV1::fromData(PdxReader& pr) {
   // LOGDEBUG("PdxObject::fromData() start...");
 
-  if (!m_useWeakHashMap) m_unreadFields = pr->readUnreadFields();
+  if (!m_useWeakHashMap) m_unreadFields = pr.readUnreadFields();
 
-  m_i1 = pr->readInt("i1");
-  m_i2 = pr->readInt("i2");
-  m_i3 = pr->readInt("i3");
-  m_i4 = pr->readInt("i4");
+  m_i1 = pr.readInt("i1");
+  m_i2 = pr.readInt("i2");
+  m_i3 = pr.readInt("i3");
+  m_i4 = pr.readInt("i4");
 
-  bool hasField = pr->hasField("i7");
+  bool hasField = pr.hasField("i7");
   if (hasField) throw Exception("i7 is not an valid field");
 
-  hasField = pr->hasField("i4");
+  hasField = pr.hasField("i4");
   if (!hasField) throw Exception("i4 is an valid field");
 }
 std::string PdxTypesIgnoreUnreadFieldsV1::toString() const {
@@ -615,44 +615,44 @@ PdxVersionedV1::~PdxVersionedV1() {
   // TODO Auto-generated destructor stub
 }
 
-void PdxVersionedV1::toData(std::shared_ptr<PdxWriter> pw) const {
-  // pw->writeChar("m_char", m_char);
-  pw->writeBoolean("m_bool", m_bool);
-  pw->writeByte("m_byte", m_byte);
-  pw->writeShort("m_int16", m_int16);
-  pw->writeInt("m_int32", m_int32);
-  pw->writeLong("m_long", m_long);
-  pw->writeFloat("m_float", m_float);
-  pw->writeDouble("m_double", m_double);
-  pw->writeString("m_string", m_string);
-  pw->writeBooleanArray("m_boolArray", m_boolArray, 3);
-  // pw->writeCharArray("m_charArray", m_charArray, 2);
-  pw->writeDate("m_dateTime", m_dateTime);
-  pw->writeShortArray("m_int16Array", m_int16Array, 2);
-  pw->writeIntArray("m_int32Array", m_int32Array, 2);
-  pw->writeLongArray("m_longArray", m_longArray, 2);
-  pw->writeFloatArray("m_floatArray", m_floatArray, 2);
-  pw->writeDoubleArray("m_doubleArray", m_doubleArray, 2);
-}
-
-void PdxVersionedV1::fromData(std::shared_ptr<PdxReader> pr) {
-  // m_char = pr->readChar("m_char");
-  m_bool = pr->readBoolean("m_bool");
-  m_byte = pr->readByte("m_byte");
-  m_int16 = pr->readShort("m_int16");
-  m_int32 = pr->readInt("m_int32");
-  m_long = pr->readLong("m_long");
-  m_float = pr->readFloat("m_float");
-  m_double = pr->readDouble("m_double");
-  m_string = pr->readString("m_string");
-  m_boolArray = pr->readBooleanArray("m_boolArray", boolArrayLen);
-  // m_charArray = pr->readCharArray("m_charArray");
-  m_dateTime = pr->readDate("m_dateTime");
-  m_int16Array = pr->readShortArray("m_int16Array", shortArrayLen);
-  m_int32Array = pr->readIntArray("m_int32Array", intArrayLen);
-  m_longArray = pr->readLongArray("m_longArray", longArrayLen);
-  m_floatArray = pr->readFloatArray("m_floatArray", floatArrayLen);
-  m_doubleArray = pr->readDoubleArray("m_doubleArray", doubleArrayLen);
+void PdxVersionedV1::toData(PdxWriter& pw) const {
+  // pw.writeChar("m_char", m_char);
+  pw.writeBoolean("m_bool", m_bool);
+  pw.writeByte("m_byte", m_byte);
+  pw.writeShort("m_int16", m_int16);
+  pw.writeInt("m_int32", m_int32);
+  pw.writeLong("m_long", m_long);
+  pw.writeFloat("m_float", m_float);
+  pw.writeDouble("m_double", m_double);
+  pw.writeString("m_string", m_string);
+  pw.writeBooleanArray("m_boolArray", m_boolArray, 3);
+  // pw.writeCharArray("m_charArray", m_charArray, 2);
+  pw.writeDate("m_dateTime", m_dateTime);
+  pw.writeShortArray("m_int16Array", m_int16Array, 2);
+  pw.writeIntArray("m_int32Array", m_int32Array, 2);
+  pw.writeLongArray("m_longArray", m_longArray, 2);
+  pw.writeFloatArray("m_floatArray", m_floatArray, 2);
+  pw.writeDoubleArray("m_doubleArray", m_doubleArray, 2);
+}
+
+void PdxVersionedV1::fromData(PdxReader& pr) {
+  // m_char = pr.readChar("m_char");
+  m_bool = pr.readBoolean("m_bool");
+  m_byte = pr.readByte("m_byte");
+  m_int16 = pr.readShort("m_int16");
+  m_int32 = pr.readInt("m_int32");
+  m_long = pr.readLong("m_long");
+  m_float = pr.readFloat("m_float");
+  m_double = pr.readDouble("m_double");
+  m_string = pr.readString("m_string");
+  m_boolArray = pr.readBooleanArray("m_boolArray", boolArrayLen);
+  // m_charArray = pr.readCharArray("m_charArray");
+  m_dateTime = pr.readDate("m_dateTime");
+  m_int16Array = pr.readShortArray("m_int16Array", shortArrayLen);
+  m_int32Array = pr.readIntArray("m_int32Array", intArrayLen);
+  m_longArray = pr.readLongArray("m_longArray", longArrayLen);
+  m_floatArray = pr.readFloatArray("m_floatArray", floatArrayLen);
+  m_doubleArray = pr.readDoubleArray("m_doubleArray", doubleArrayLen);
 }
 std::string PdxVersionedV1::toString() const {
   char idbuf[4096];
@@ -708,22 +708,22 @@ TestEqualsV1::TestEqualsV1() {
   // intArr = ;
 }
 
-void TestEqualsV1::toData(std::shared_ptr<PdxWriter> pw) const {
-  pw->writeInt("i1", i1);
-  pw->writeInt("i2", i2);
-  pw->writeString("s1", s1);
-  // pw->writeStringArray("sArr", sArr, 2);
-  // pw->writeIntArray("intArr", intArr, 2);
-  // pw->writeObject("intArrObject", intArr);
-  // pw->writeObject("sArrObject", sArr);
+void TestEqualsV1::toData(PdxWriter& pw) const {
+  pw.writeInt("i1", i1);
+  pw.writeInt("i2", i2);
+  pw.writeString("s1", s1);
+  // pw.writeStringArray("sArr", sArr, 2);
+  // pw.writeIntArray("intArr", intArr, 2);
+  // pw.writeObject("intArrObject", intArr);
+  // pw.writeObject("sArrObject", sArr);
 }
 
-void TestEqualsV1::fromData(std::shared_ptr<PdxReader> pr) {
-  i1 = pr->readInt("i1");
-  i2 = pr->readInt("i2");
-  s1 = pr->readString("s1");
-  // sArr = pr->readStringArray("sArr");
-  // intArr = pr->readIntArray("intArr");
+void TestEqualsV1::fromData(PdxReader& pr) {
+  i1 = pr.readInt("i1");
+  i2 = pr.readInt("i2");
+  s1 = pr.readString("s1");
+  // sArr = pr.readStringArray("sArr");
+  // intArr = pr.readIntArray("intArr");
   // intArr = (int[]) reader.ReadObject("intArrObject");
   // sArr = (string[]) reader.ReadObject("sArrObject");
 }
diff --git a/tests/cpp/testobject/PdxClassV1.hpp b/tests/cpp/testobject/PdxClassV1.hpp
index 30e769f..28ef297 100644
--- a/tests/cpp/testobject/PdxClassV1.hpp
+++ b/tests/cpp/testobject/PdxClassV1.hpp
@@ -78,9 +78,9 @@ class TESTOBJECT_EXPORT PdxType1V1 : public PdxSerializable {
 
   using PdxSerializable::fromData;
 
-  virtual void fromData(std::shared_ptr<PdxReader> pr) override;
+  virtual void fromData(PdxReader& pr) override;
 
-  virtual void toData(std::shared_ptr<PdxWriter> pw) const override;
+  virtual void toData(PdxWriter& pw) const override;
 
   const std::string& getClassName() const override {
     static std::string className = "PdxTests::PdxTypes1V";
@@ -119,9 +119,9 @@ class TESTOBJECT_EXPORT PdxType2V1 : public PdxSerializable {
   using PdxSerializable::toData;
   using PdxSerializable::fromData;
 
-  virtual void fromData(std::shared_ptr<PdxReader> pr) override;
+  virtual void fromData(PdxReader& pr) override;
 
-  virtual void toData(std::shared_ptr<PdxWriter> pw) const override;
+  virtual void toData(PdxWriter& pw) const override;
 
   const std::string& getClassName() const override {
     static std::string className = "PdxTests::PdxTypes2V";
@@ -165,9 +165,9 @@ class TESTOBJECT_EXPORT PdxType3V1 : public PdxSerializable {
   using PdxSerializable::toData;
   using PdxSerializable::fromData;
 
-  virtual void fromData(std::shared_ptr<PdxReader> pr) override;
+  virtual void fromData(PdxReader& pr) override;
 
-  virtual void toData(std::shared_ptr<PdxWriter> pw) const override;
+  virtual void toData(PdxWriter& pw) const override;
 
   const std::string& getClassName() const override {
     static std::string className = "PdxTests::PdxTypes3V";
@@ -206,9 +206,9 @@ class TESTOBJECT_EXPORT PdxTypesV1R1 : public PdxSerializable {
   using PdxSerializable::toData;
   using PdxSerializable::fromData;
 
-  virtual void fromData(std::shared_ptr<PdxReader> pr) override;
+  virtual void fromData(PdxReader& pr) override;
 
-  virtual void toData(std::shared_ptr<PdxWriter> pw) const override;
+  virtual void toData(PdxWriter& pw) const override;
 
   const std::string& getClassName() const override {
     static std::string className = "PdxTests::PdxTypesR1";
@@ -247,9 +247,9 @@ class TESTOBJECT_EXPORT PdxTypesV1R2 : public PdxSerializable {
   using PdxSerializable::toData;
   using PdxSerializable::fromData;
 
-  virtual void fromData(std::shared_ptr<PdxReader> pr) override;
+  virtual void fromData(PdxReader& pr) override;
 
-  virtual void toData(std::shared_ptr<PdxWriter> pw) const override;
+  virtual void toData(PdxWriter& pw) const override;
 
   const std::string& getClassName() const override {
     static std::string className = "PdxTests::PdxTypesR2";
@@ -288,9 +288,9 @@ class TESTOBJECT_EXPORT PdxTypesIgnoreUnreadFieldsV1 : public PdxSerializable {
   using PdxSerializable::toData;
   using PdxSerializable::fromData;
 
-  virtual void fromData(std::shared_ptr<PdxReader> pr) override;
+  virtual void fromData(PdxReader& pr) override;
 
-  virtual void toData(std::shared_ptr<PdxWriter> pw) const override;
+  virtual void toData(PdxWriter& pw) const override;
 
   const std::string& getClassName() const override {
     static std::string className = "PdxTypesIgnoreUnreadFields";
@@ -352,9 +352,9 @@ class TESTOBJECT_EXPORT PdxVersionedV1 : public PdxSerializable {
   using PdxSerializable::toData;
   using PdxSerializable::fromData;
 
-  virtual void fromData(std::shared_ptr<PdxReader> pr) override;
+  virtual void fromData(PdxReader& pr) override;
 
-  virtual void toData(std::shared_ptr<PdxWriter> pw) const override;
+  virtual void toData(PdxWriter& pw) const override;
 
   const std::string& getClassName() const override {
     static std::string className = "PdxTests::PdxVersioned";
@@ -441,21 +441,21 @@ class TestPdxSerializerForV1 : public PdxSerializer {
     return objectSize;
   }
 
-  void* fromDataForTestKeyV1(std::shared_ptr<PdxReader> pr) {
+  void* fromDataForTestKeyV1(PdxReader& pr) {
     try {
       PdxTests::TestKeyV1* tkv1 = new PdxTests::TestKeyV1;
-      tkv1->_id = pr->readString("_id");
+      tkv1->_id = pr.readString("_id");
       return (void*)tkv1;
     } catch (...) {
       return NULL;
     }
   }
 
-  bool toDataForTestKeyV1(void* testObject, std::shared_ptr<PdxWriter> pw) {
+  bool toDataForTestKeyV1(void* testObject, PdxWriter& pw) {
     try {
       PdxTests::TestKeyV1* tkv1 =
           reinterpret_cast<PdxTests::TestKeyV1*>(testObject);
-      pw->writeString("_id", tkv1->_id);
+      pw.writeString("_id", tkv1->_id);
 
       return true;
     } catch (...) {
@@ -463,23 +463,22 @@ class TestPdxSerializerForV1 : public PdxSerializer {
     }
   }
 
-  void* fromDataForTestDiffTypePdxSV1(std::shared_ptr<PdxReader> pr) {
+  void* fromDataForTestDiffTypePdxSV1(PdxReader& pr) {
     try {
       PdxTests::TestDiffTypePdxSV1* dtpv1 = new PdxTests::TestDiffTypePdxSV1;
-      dtpv1->_id = pr->readString("_id");
-      dtpv1->_name = pr->readString("_name");
+      dtpv1->_id = pr.readString("_id");
+      dtpv1->_name = pr.readString("_name");
       return (void*)dtpv1;
     } catch (...) {
       return NULL;
     }
   }
 
-  bool toDataForTestDiffTypePdxSV1(void* testObject, std::shared_ptr<PdxWriter> pw) {
+  bool toDataForTestDiffTypePdxSV1(void* testObject, PdxWriter& pw) {
     try {
-      PdxTests::TestDiffTypePdxSV1* dtpv1 =
-          reinterpret_cast<PdxTests::TestDiffTypePdxSV1*>(testObject);
-      pw->writeString("_id", dtpv1->_id);
-      pw->writeString("_name", dtpv1->_name);
+      auto dtpv1 = reinterpret_cast<PdxTests::TestDiffTypePdxSV1*>(testObject);
+      pw.writeString("_id", dtpv1->_id);
+      pw.writeString("_name", dtpv1->_name);
 
       return true;
     } catch (...) {
@@ -487,8 +486,7 @@ class TestPdxSerializerForV1 : public PdxSerializer {
     }
   }
 
-  virtual void* fromData(const std::string& className,
-                         std::shared_ptr<PdxReader> pr) override {
+  virtual void* fromData(const std::string& className, PdxReader& pr) override {
     // ASSERT(strcmp(className, V1CLASSNAME1) == 0 || strcmp(className,
     // V1CLASSNAME2) == 0, "Unexpected classname in fromData");
 
@@ -505,7 +503,7 @@ class TestPdxSerializerForV1 : public PdxSerializer {
   }
 
   virtual bool toData(void* testObject, const std::string& className,
-                      std::shared_ptr<PdxWriter> pw) override {
+                      PdxWriter& pw) override {
     // ASSERT(strcmp(className, V1CLASSNAME1) == 0 || strcmp(className,
     // V1CLASSNAME2) == 0, "Unexpected classname in toData");
 
@@ -540,9 +538,9 @@ class TESTOBJECT_EXPORT TestEqualsV1 : public PdxSerializable {
   using PdxSerializable::toData;
   using PdxSerializable::fromData;
 
-  virtual void fromData(std::shared_ptr<PdxReader> pr) override;
+  virtual void fromData(PdxReader& pr) override;
 
-  virtual void toData(std::shared_ptr<PdxWriter> pw) const override;
+  virtual void toData(PdxWriter& pw) const override;
 
   const std::string& getClassName() const override {
     static std::string className = "PdxTests::TestEquals";
diff --git a/tests/cpp/testobject/PdxClassV2.cpp b/tests/cpp/testobject/PdxClassV2.cpp
index ab39c12..9912931 100644
--- a/tests/cpp/testobject/PdxClassV2.cpp
+++ b/tests/cpp/testobject/PdxClassV2.cpp
@@ -77,36 +77,36 @@ bool PdxTypes1V2::equals(std::shared_ptr<PdxSerializable> obj) {
   return false;
 }
 
-void PdxTypes1V2::toData(std::shared_ptr<PdxWriter> pw) const {
+void PdxTypes1V2::toData(PdxWriter& pw) const {
   //
-  if (!m_useWeakHashMap) pw->writeUnreadFields(m_pdxUreadFields);
+  if (!m_useWeakHashMap) pw.writeUnreadFields(m_pdxUreadFields);
 
-  pw->writeInt("i1", m_i1 + 1);
-  pw->markIdentityField("i1");
-  pw->writeInt("i2", m_i2 + 1);
-  pw->writeInt("i3", m_i3 + 1);
-  pw->writeInt("i4", m_i4 + 1);
-  pw->writeInt("i5", m_i5 + 1);
-  pw->writeInt("i6", m_i6 + 1);
+  pw.writeInt("i1", m_i1 + 1);
+  pw.markIdentityField("i1");
+  pw.writeInt("i2", m_i2 + 1);
+  pw.writeInt("i3", m_i3 + 1);
+  pw.writeInt("i4", m_i4 + 1);
+  pw.writeInt("i5", m_i5 + 1);
+  pw.writeInt("i6", m_i6 + 1);
 
   m_diffInSameFields++;
   m_diffInExtraFields++;
   // LOGDEBUG("PdxObject::toData() Done......");
 }
 
-void PdxTypes1V2::fromData(std::shared_ptr<PdxReader> pr) {
+void PdxTypes1V2::fromData(PdxReader& pr) {
   // LOGDEBUG("PdxObject::fromData() start...");
-  m_i1 = pr->readInt("i1");
-  bool isIdentity = pr->isIdentityField("i2");
+  m_i1 = pr.readInt("i1");
+  bool isIdentity = pr.isIdentityField("i2");
   if (isIdentity) throw Exception("i2 is not identity field");
   //
-  if (!m_useWeakHashMap) m_pdxUreadFields = pr->readUnreadFields();
+  if (!m_useWeakHashMap) m_pdxUreadFields = pr.readUnreadFields();
 
-  m_i2 = pr->readInt("i2");
-  m_i3 = pr->readInt("i3");
-  m_i4 = pr->readInt("i4");
-  m_i5 = pr->readInt("i5");
-  m_i6 = pr->readInt("i6");
+  m_i2 = pr.readInt("i2");
+  m_i3 = pr.readInt("i3");
+  m_i4 = pr.readInt("i4");
+  m_i5 = pr.readInt("i5");
+  m_i6 = pr.readInt("i6");
 
   // LOGDEBUG("PdxType1V2::fromData() End...");
 }
@@ -171,31 +171,31 @@ bool PdxTypes2V2::equals(std::shared_ptr<PdxSerializable> obj) {
   return false;
 }
 
-void PdxTypes2V2::toData(std::shared_ptr<PdxWriter> pw) const {
-  if (!m_useWeakHashMap) pw->writeUnreadFields(m_unreadFields);
+void PdxTypes2V2::toData(PdxWriter& pw) const {
+  if (!m_useWeakHashMap) pw.writeUnreadFields(m_unreadFields);
 
-  pw->writeInt("i1", m_i1 + 1);
-  pw->writeInt("i2", m_i2 + 1);
-  pw->writeInt("i5", m_i5 + 1);
-  pw->writeInt("i6", m_i6 + 1);
-  pw->writeInt("i3", m_i3 + 1);
-  pw->writeInt("i4", m_i4 + 1);
+  pw.writeInt("i1", m_i1 + 1);
+  pw.writeInt("i2", m_i2 + 1);
+  pw.writeInt("i5", m_i5 + 1);
+  pw.writeInt("i6", m_i6 + 1);
+  pw.writeInt("i3", m_i3 + 1);
+  pw.writeInt("i4", m_i4 + 1);
 
   m_diffInExtraFields++;
   m_diffInSameFields++;
 }
 
-void PdxTypes2V2::fromData(std::shared_ptr<PdxReader> pr) {
+void PdxTypes2V2::fromData(PdxReader& pr) {
   // LOGDEBUG("PdxObject::fromData() start...");
   //
-  if (!m_useWeakHashMap) m_unreadFields = pr->readUnreadFields();
+  if (!m_useWeakHashMap) m_unreadFields = pr.readUnreadFields();
 
-  m_i1 = pr->readInt("i1");
-  m_i2 = pr->readInt("i2");
-  m_i5 = pr->readInt("i5");
-  m_i6 = pr->readInt("i6");
-  m_i3 = pr->readInt("i3");
-  m_i4 = pr->readInt("i4");
+  m_i1 = pr.readInt("i1");
+  m_i2 = pr.readInt("i2");
+  m_i5 = pr.readInt("i5");
+  m_i6 = pr.readInt("i6");
+  m_i3 = pr.readInt("i3");
+  m_i4 = pr.readInt("i4");
 }
 std::string PdxTypes2V2::toString() const {
   char idbuf[4096];
@@ -259,34 +259,34 @@ bool PdxTypes3V2::equals(std::shared_ptr<PdxSerializable> obj) {
   return false;
 }
 
-void PdxTypes3V2::toData(std::shared_ptr<PdxWriter> pw) const {
+void PdxTypes3V2::toData(PdxWriter& pw) const {
   //
-  if (!m_useWeakHashMap) pw->writeUnreadFields(m_unreadFields);
+  if (!m_useWeakHashMap) pw.writeUnreadFields(m_unreadFields);
 
-  pw->writeInt("i1", m_i1 + 1);
-  pw->writeInt("i2", m_i2 + 1);
-  pw->writeString("m_str1", m_str1);
-  pw->writeInt("i4", m_i4 + 1);
-  pw->writeInt("i3", m_i3 + 1);
-  pw->writeInt("i6", m_i6 + 1);
-  pw->writeString("m_str3", m_str3);
+  pw.writeInt("i1", m_i1 + 1);
+  pw.writeInt("i2", m_i2 + 1);
+  pw.writeString("m_str1", m_str1);
+  pw.writeInt("i4", m_i4 + 1);
+  pw.writeInt("i3", m_i3 + 1);
+  pw.writeInt("i6", m_i6 + 1);
+  pw.writeString("m_str3", m_str3);
 
   m_diffInExtraFields++;
   m_diffInSameFields++;
 }
 
-void PdxTypes3V2::fromData(std::shared_ptr<PdxReader> pr) {
+void PdxTypes3V2::fromData(PdxReader& pr) {
   // LOGDEBUG("PdxObject::fromData() start...");
   //
-  if (!m_useWeakHashMap) m_unreadFields = pr->readUnreadFields();
+  if (!m_useWeakHashMap) m_unreadFields = pr.readUnreadFields();
 
-  m_i1 = pr->readInt("i1");
-  m_i2 = pr->readInt("i2");
-  m_str1 = pr->readString("m_str1");
-  m_i4 = pr->readInt("i4");
-  m_i3 = pr->readInt("i3");
-  m_i6 = pr->readInt("i6");
-  auto tmp = pr->readString("m_str3");
+  m_i1 = pr.readInt("i1");
+  m_i2 = pr.readInt("i2");
+  m_str1 = pr.readString("m_str1");
+  m_i4 = pr.readInt("i4");
+  m_i3 = pr.readInt("i3");
+  m_i6 = pr.readInt("i6");
+  auto tmp = pr.readString("m_str3");
 
   char extraFieldsStr[20];
   if (tmp.empty()) {
@@ -358,31 +358,31 @@ bool PdxTypesR1V2::equals(std::shared_ptr<PdxSerializable> obj) {
   return false;
 }
 
-void PdxTypesR1V2::toData(std::shared_ptr<PdxWriter> pw) const {
-  if (!m_useWeakHashMap) pw->writeUnreadFields(m_pdxUnreadFields);
+void PdxTypesR1V2::toData(PdxWriter& pw) const {
+  if (!m_useWeakHashMap) pw.writeUnreadFields(m_pdxUnreadFields);
 
-  pw->writeInt("i1", m_i1 + 1);
-  pw->writeInt("i2", m_i2 + 1);
-  pw->writeInt("i3", m_i3 + 1);
-  pw->writeInt("i4", m_i4 + 1);
+  pw.writeInt("i1", m_i1 + 1);
+  pw.writeInt("i2", m_i2 + 1);
+  pw.writeInt("i3", m_i3 + 1);
+  pw.writeInt("i4", m_i4 + 1);
 
-  pw->writeInt("i5", m_i5 + 1);
-  pw->writeInt("i6", m_i6 + 1);
+  pw.writeInt("i5", m_i5 + 1);
+  pw.writeInt("i6", m_i6 + 1);
 
   m_diffInSameFields++;
   m_diffInExtraFields++;
 }
 
-void PdxTypesR1V2::fromData(std::shared_ptr<PdxReader> pr) {
-  if (!m_useWeakHashMap) m_pdxUnreadFields = pr->readUnreadFields();
+void PdxTypesR1V2::fromData(PdxReader& pr) {
+  if (!m_useWeakHashMap) m_pdxUnreadFields = pr.readUnreadFields();
 
-  m_i1 = pr->readInt("i1");
-  m_i2 = pr->readInt("i2");
-  m_i3 = pr->readInt("i3");
-  m_i4 = pr->readInt("i4");
+  m_i1 = pr.readInt("i1");
+  m_i2 = pr.readInt("i2");
+  m_i3 = pr.readInt("i3");
+  m_i4 = pr.readInt("i4");
 
-  m_i5 = pr->readInt("i5");
-  m_i6 = pr->readInt("i6");
+  m_i5 = pr.readInt("i5");
+  m_i6 = pr.readInt("i6");
 }
 std::string PdxTypesR1V2::toString() const {
   char idbuf[4096];
@@ -449,36 +449,36 @@ bool PdxTypesR2V2::equals(std::shared_ptr<PdxSerializable> obj) {
   return false;
 }
 
-void PdxTypesR2V2::toData(std::shared_ptr<PdxWriter> pw) const {
-  if (!m_useWeakHashMap) pw->writeUnreadFields(m_pdxunreadFields);
+void PdxTypesR2V2::toData(PdxWriter& pw) const {
+  if (!m_useWeakHashMap) pw.writeUnreadFields(m_pdxunreadFields);
 
-  pw->writeInt("i1", m_i1 + 1);
-  pw->writeInt("i2", m_i2 + 1);
-  pw->writeInt("i5", m_i5 + 1);
-  pw->writeInt("i6", m_i6 + 1);
-  pw->writeInt("i3", m_i3 + 1);
-  pw->writeInt("i4", m_i4 + 1);
+  pw.writeInt("i1", m_i1 + 1);
+  pw.writeInt("i2", m_i2 + 1);
+  pw.writeInt("i5", m_i5 + 1);
+  pw.writeInt("i6", m_i6 + 1);
+  pw.writeInt("i3", m_i3 + 1);
+  pw.writeInt("i4", m_i4 + 1);
 
   m_diffInExtraFields++;
   m_diffInSameFields++;
 
   char tmpBuf[512] = {0};
   sprintf(tmpBuf, "%d", m_diffInExtraFields);
-  pw->writeString("m_str1", tmpBuf);
+  pw.writeString("m_str1", tmpBuf);
 }
 
-void PdxTypesR2V2::fromData(std::shared_ptr<PdxReader> pr) {
+void PdxTypesR2V2::fromData(PdxReader& pr) {
   LOGDEBUG("PdxObject::fromData() start...");
 
-  if (!m_useWeakHashMap) m_pdxunreadFields = pr->readUnreadFields();
+  if (!m_useWeakHashMap) m_pdxunreadFields = pr.readUnreadFields();
 
-  m_i1 = pr->readInt("i1");
-  m_i2 = pr->readInt("i2");
-  m_i5 = pr->readInt("i5");
-  m_i6 = pr->readInt("i6");
-  m_i3 = pr->readInt("i3");
-  m_i4 = pr->readInt("i4");
-  m_str1 = pr->readString("m_str1");
+  m_i1 = pr.readInt("i1");
+  m_i2 = pr.readInt("i2");
+  m_i5 = pr.readInt("i5");
+  m_i6 = pr.readInt("i6");
+  m_i3 = pr.readInt("i3");
+  m_i4 = pr.readInt("i4");
+  m_str1 = pr.readString("m_str1");
 }
 std::string PdxTypesR2V2::toString() const {
   return "PdxTypesR2V2:[ m_i1=" + std::to_string(m_i1) +
@@ -558,16 +558,16 @@ void PdxTypesIgnoreUnreadFieldsV2::updateMembers() {
   m_i6 = (int32_t)m_diffInExtraFields;
 }
 
-void PdxTypesIgnoreUnreadFieldsV2::toData(std::shared_ptr<PdxWriter> pw) const {
-  if (!m_useWeakHashMap) pw->writeUnreadFields(m_unreadFields);
+void PdxTypesIgnoreUnreadFieldsV2::toData(PdxWriter& pw) const {
+  if (!m_useWeakHashMap) pw.writeUnreadFields(m_unreadFields);
 
-  pw->writeInt("i1", m_i1 + 1);
-  pw->markIdentityField("i1");
-  pw->writeInt("i2", m_i2 + 1);
-  pw->writeInt("i3", m_i3 + 1);
-  pw->writeInt("i4", m_i4 + 1);
-  pw->writeInt("i5", m_diffInExtraFields);
-  pw->writeInt("i6", m_diffInExtraFields);
+  pw.writeInt("i1", m_i1 + 1);
+  pw.markIdentityField("i1");
+  pw.writeInt("i2", m_i2 + 1);
+  pw.writeInt("i3", m_i3 + 1);
+  pw.writeInt("i4", m_i4 + 1);
+  pw.writeInt("i5", m_diffInExtraFields);
+  pw.writeInt("i6", m_diffInExtraFields);
 
   m_i5 = (int32_t)m_diffInExtraFields;
   m_i6 = (int32_t)m_diffInExtraFields;
@@ -576,21 +576,21 @@ void PdxTypesIgnoreUnreadFieldsV2::toData(std::shared_ptr<PdxWriter> pw) const {
   m_diffInExtraFields++;
 }
 
-void PdxTypesIgnoreUnreadFieldsV2::fromData(std::shared_ptr<PdxReader> pr) {
-  m_i1 = pr->readInt("i1");
-  bool isIdentity = pr->isIdentityField("i2");
+void PdxTypesIgnoreUnreadFieldsV2::fromData(PdxReader& pr) {
+  m_i1 = pr.readInt("i1");
+  bool isIdentity = pr.isIdentityField("i2");
 
   if (isIdentity) {
     throw Exception("i2 is not identity field");
   }
 
-  if (!m_useWeakHashMap) m_unreadFields = pr->readUnreadFields();
+  if (!m_useWeakHashMap) m_unreadFields = pr.readUnreadFields();
 
-  m_i2 = pr->readInt("i2");
-  m_i3 = pr->readInt("i3");
-  m_i4 = pr->readInt("i4");
-  m_i5 = pr->readInt("i5");
-  m_i6 = pr->readInt("i6");
+  m_i2 = pr.readInt("i2");
+  m_i3 = pr.readInt("i3");
+  m_i4 = pr.readInt("i4");
+  m_i5 = pr.readInt("i5");
+  m_i6 = pr.readInt("i6");
 }
 std::string PdxTypesIgnoreUnreadFieldsV2::toString() const {
   char idbuf[4096];
@@ -662,44 +662,44 @@ PdxVersionedV2::~PdxVersionedV2() {
   // TODO Auto-generated destructor stub
 }
 
-void PdxVersionedV2::toData(std::shared_ptr<PdxWriter> pw) const {
-  // pw->writeChar("m_char", m_char);
-  pw->writeBoolean("m_bool", m_bool);
-  pw->writeByte("m_byte", m_byte);
-  pw->writeShort("m_int16", m_int16);
-  pw->writeInt("m_int32", m_int32);
-  pw->writeLong("m_long", m_long);
-  pw->writeFloat("m_float", m_float);
-  pw->writeDouble("m_double", m_double);
-  pw->writeString("m_string", m_string);
-  pw->writeBooleanArray("m_boolArray", m_boolArray, 3);
-  // pw->writeCharArray("m_charArray", m_charArray, 2);
-  pw->writeDate("m_dateTime", m_dateTime);
-  pw->writeShortArray("m_int16Array", m_int16Array, 2);
-  pw->writeIntArray("m_int32Array", m_int32Array, 2);
-  pw->writeLongArray("m_longArray", m_longArray, 2);
-  pw->writeFloatArray("m_floatArray", m_floatArray, 2);
-  pw->writeDoubleArray("m_doubleArray", m_doubleArray, 2);
-}
-
-void PdxVersionedV2::fromData(std::shared_ptr<PdxReader> pr) {
-  // m_char = pr->readChar("m_char");
-  m_bool = pr->readBoolean("m_bool");
-  m_byte = pr->readByte("m_byte");
-  m_int16 = pr->readShort("m_int16");
-  m_int32 = pr->readInt("m_int32");
-  m_long = pr->readLong("m_long");
-  m_float = pr->readFloat("m_float");
-  m_double = pr->readDouble("m_double");
-  m_string = pr->readString("m_string");
-  m_boolArray = pr->readBooleanArray("m_boolArray", boolArrayLen);
-  // m_charArray = pr->readCharArray("m_charArray");
-  m_dateTime = pr->readDate("m_dateTime");
-  m_int16Array = pr->readShortArray("m_int16Array", shortArrayLen);
-  m_int32Array = pr->readIntArray("m_int32Array", intArrayLen);
-  m_longArray = pr->readLongArray("m_longArray", longArrayLen);
-  m_floatArray = pr->readFloatArray("m_floatArray", floatArrayLen);
-  m_doubleArray = pr->readDoubleArray("m_doubleArray", doubleArrayLen);
+void PdxVersionedV2::toData(PdxWriter& pw) const {
+  // pw.writeChar("m_char", m_char);
+  pw.writeBoolean("m_bool", m_bool);
+  pw.writeByte("m_byte", m_byte);
+  pw.writeShort("m_int16", m_int16);
+  pw.writeInt("m_int32", m_int32);
+  pw.writeLong("m_long", m_long);
+  pw.writeFloat("m_float", m_float);
+  pw.writeDouble("m_double", m_double);
+  pw.writeString("m_string", m_string);
+  pw.writeBooleanArray("m_boolArray", m_boolArray, 3);
+  // pw.writeCharArray("m_charArray", m_charArray, 2);
+  pw.writeDate("m_dateTime", m_dateTime);
+  pw.writeShortArray("m_int16Array", m_int16Array, 2);
+  pw.writeIntArray("m_int32Array", m_int32Array, 2);
+  pw.writeLongArray("m_longArray", m_longArray, 2);
+  pw.writeFloatArray("m_floatArray", m_floatArray, 2);
+  pw.writeDoubleArray("m_doubleArray", m_doubleArray, 2);
+}
+
+void PdxVersionedV2::fromData(PdxReader& pr) {
+  // m_char = pr.readChar("m_char");
+  m_bool = pr.readBoolean("m_bool");
+  m_byte = pr.readByte("m_byte");
+  m_int16 = pr.readShort("m_int16");
+  m_int32 = pr.readInt("m_int32");
+  m_long = pr.readLong("m_long");
+  m_float = pr.readFloat("m_float");
+  m_double = pr.readDouble("m_double");
+  m_string = pr.readString("m_string");
+  m_boolArray = pr.readBooleanArray("m_boolArray", boolArrayLen);
+  // m_charArray = pr.readCharArray("m_charArray");
+  m_dateTime = pr.readDate("m_dateTime");
+  m_int16Array = pr.readShortArray("m_int16Array", shortArrayLen);
+  m_int32Array = pr.readIntArray("m_int32Array", intArrayLen);
+  m_longArray = pr.readLongArray("m_longArray", longArrayLen);
+  m_floatArray = pr.readFloatArray("m_floatArray", floatArrayLen);
+  m_doubleArray = pr.readDoubleArray("m_doubleArray", doubleArrayLen);
 }
 std::string PdxVersionedV2::toString() const {
   char idbuf[4096];
@@ -763,23 +763,23 @@ bool TestDiffTypePdxSV2::equals(TestDiffTypePdxSV2 *obj) {
  //intArr = ;
  }
 
- void TestEqualsV1::toData( std::shared_ptr<PdxWriter> pw )  {
- pw->writeInt("i1", i1);
- pw->writeInt("i2", i2);
- pw->writeString("s1", s1);
- //pw->writeStringArray("sArr", sArr, 2);
- //pw->writeIntArray("intArr", intArr, 2);
- //pw->writeObject("intArrObject", intArr);
- //pw->writeObject("sArrObject", sArr);
+ void TestEqualsV1::toData( PdxWriter& pw )  {
+ pw.writeInt("i1", i1);
+ pw.writeInt("i2", i2);
+ pw.writeString("s1", s1);
+ //pw.writeStringArray("sArr", sArr, 2);
+ //pw.writeIntArray("intArr", intArr, 2);
+ //pw.writeObject("intArrObject", intArr);
+ //pw.writeObject("sArrObject", sArr);
  }
 
- void TestEqualsV1::fromData( std::shared_ptr<PdxReader> pr )
+ void TestEqualsV1::fromData( PdxReader& pr )
  {
- i1 = pr->readInt("i1");
- i2 = pr->readInt("i2");
- s1 = pr->readString("s1");
- //sArr = pr->readStringArray("sArr");
- //intArr = pr->readIntArray("intArr");
+ i1 = pr.readInt("i1");
+ i2 = pr.readInt("i2");
+ s1 = pr.readString("s1");
+ //sArr = pr.readStringArray("sArr");
+ //intArr = pr.readIntArray("intArr");
  //intArr = (int[]) reader.ReadObject("intArrObject");
  //sArr = (string[]) reader.ReadObject("sArrObject");
  }
diff --git a/tests/cpp/testobject/PdxClassV2.hpp b/tests/cpp/testobject/PdxClassV2.hpp
index 19ab979..432b2f8 100644
--- a/tests/cpp/testobject/PdxClassV2.hpp
+++ b/tests/cpp/testobject/PdxClassV2.hpp
@@ -80,9 +80,9 @@ class TESTOBJECT_EXPORT PdxTypes1V2 : public PdxSerializable {
   using PdxSerializable::toData;
   using PdxSerializable::fromData;
 
-  virtual void fromData(std::shared_ptr<PdxReader> pr) override;
+  virtual void fromData(PdxReader& pr) override;
 
-  virtual void toData(std::shared_ptr<PdxWriter> pw) const override;
+  virtual void toData(PdxWriter& pw) const override;
 
   const std::string& getClassName() const override {
     static std::string className = "PdxTests::PdxTypes1V";
@@ -125,9 +125,9 @@ class TESTOBJECT_EXPORT PdxTypes2V2 : public PdxSerializable {
   using PdxSerializable::toData;
   using PdxSerializable::fromData;
 
-  virtual void fromData(std::shared_ptr<PdxReader> pr) override;
+  virtual void fromData(PdxReader& pr) override;
 
-  virtual void toData(std::shared_ptr<PdxWriter> pw) const override;
+  virtual void toData(PdxWriter& pw) const override;
 
   const std::string& getClassName() const override {
     static std::string className = "PdxTests::PdxTypes2V";
@@ -171,9 +171,9 @@ class TESTOBJECT_EXPORT PdxTypes3V2 : public PdxSerializable {
   using PdxSerializable::toData;
   using PdxSerializable::fromData;
 
-  virtual void fromData(std::shared_ptr<PdxReader> pr) override;
+  virtual void fromData(PdxReader& pr) override;
 
-  virtual void toData(std::shared_ptr<PdxWriter> pw) const override;
+  virtual void toData(PdxWriter& pw) const override;
 
   const std::string& getClassName() const override {
     static std::string className = "PdxTests::PdxTypes3V";
@@ -218,9 +218,9 @@ class TESTOBJECT_EXPORT PdxTypesR1V2 : public PdxSerializable {
   using PdxSerializable::toData;
   using PdxSerializable::fromData;
 
-  virtual void fromData(std::shared_ptr<PdxReader> pr) override;
+  virtual void fromData(PdxReader& pr) override;
 
-  virtual void toData(std::shared_ptr<PdxWriter> pw) const override;
+  virtual void toData(PdxWriter& pw) const override;
 
   const std::string& getClassName() const override {
     static std::string className = "PdxTests::PdxTypesR1";
@@ -265,9 +265,9 @@ class TESTOBJECT_EXPORT PdxTypesR2V2 : public PdxSerializable {
   using PdxSerializable::toData;
   using PdxSerializable::fromData;
 
-  virtual void fromData(std::shared_ptr<PdxReader> pr) override;
+  virtual void fromData(PdxReader& pr) override;
 
-  virtual void toData(std::shared_ptr<PdxWriter> pw) const override;
+  virtual void toData(PdxWriter& pw) const override;
 
   const std::string& getClassName() const override {
     static std::string className = "PdxTests::PdxTypesR2";
@@ -312,9 +312,9 @@ class TESTOBJECT_EXPORT PdxTypesIgnoreUnreadFieldsV2 : public PdxSerializable {
   using PdxSerializable::toData;
   using PdxSerializable::fromData;
 
-  virtual void fromData(std::shared_ptr<PdxReader> pr) override;
+  virtual void fromData(PdxReader& pr) override;
 
-  virtual void toData(std::shared_ptr<PdxWriter> pw) const override;
+  virtual void toData(PdxWriter& pw) const override;
 
   const std::string& getClassName() const override {
     static std::string className = "PdxTests::PdxTypesIgnoreUnreadFields";
@@ -377,9 +377,9 @@ class TESTOBJECT_EXPORT PdxVersionedV2 : public PdxSerializable {
   using PdxSerializable::toData;
   using PdxSerializable::fromData;
 
-  virtual void fromData(std::shared_ptr<PdxReader> pr) override;
+  virtual void fromData(PdxReader& pr) override;
 
-  virtual void toData(std::shared_ptr<PdxWriter> pw) const override;
+  virtual void toData(PdxWriter& pw) const override;
 
   const std::string& getClassName() const override {
     static std::string className = "PdxTests::PdxVersioned";
@@ -470,21 +470,21 @@ class TestPdxSerializerForV2 : public PdxSerializer {
     return objectSize;
   }
 
-  void* fromDataForTestKeyV2(std::shared_ptr<PdxReader> pr) {
+  void* fromDataForTestKeyV2(PdxReader& pr) {
     try {
       PdxTests::TestKeyV2* tkv1 = new PdxTests::TestKeyV2;
-      tkv1->_id = pr->readString("_id");
+      tkv1->_id = pr.readString("_id");
       return (void*)tkv1;
     } catch (...) {
       return NULL;
     }
   }
 
-  bool toDataForTestKeyV2(void* testObject, std::shared_ptr<PdxWriter> pw) {
+  bool toDataForTestKeyV2(void* testObject, PdxWriter& pw) {
     try {
       PdxTests::TestKeyV2* tkv1 =
           reinterpret_cast<PdxTests::TestKeyV2*>(testObject);
-      pw->writeString("_id", tkv1->_id);
+      pw.writeString("_id", tkv1->_id);
 
       return true;
     } catch (...) {
@@ -492,26 +492,26 @@ class TestPdxSerializerForV2 : public PdxSerializer {
     }
   }
 
-  void* fromDataForTestDiffTypePdxSV2(std::shared_ptr<PdxReader> pr) {
+  void* fromDataForTestDiffTypePdxSV2(PdxReader& pr) {
     try {
       PdxTests::TestDiffTypePdxSV2* dtpv1 = new PdxTests::TestDiffTypePdxSV2;
-      dtpv1->_id = pr->readString("_id");
-      dtpv1->_name = pr->readString("_name");
-      dtpv1->_count = pr->readInt("_count");
+      dtpv1->_id = pr.readString("_id");
+      dtpv1->_name = pr.readString("_name");
+      dtpv1->_count = pr.readInt("_count");
       return (void*)dtpv1;
     } catch (...) {
       return NULL;
     }
   }
 
-  bool toDataForTestDiffTypePdxSV2(void* testObject, std::shared_ptr<PdxWriter> pw) {
+  bool toDataForTestDiffTypePdxSV2(void* testObject, PdxWriter& pw) {
     try {
       PdxTests::TestDiffTypePdxSV2* dtpv1 =
           reinterpret_cast<PdxTests::TestDiffTypePdxSV2*>(testObject);
-      pw->writeString("_id", dtpv1->_id);
-      pw->markIdentityField("_id");
-      pw->writeString("_name", dtpv1->_name);
-      pw->writeInt("_count", dtpv1->_count);
+      pw.writeString("_id", dtpv1->_id);
+      pw.markIdentityField("_id");
+      pw.writeString("_name", dtpv1->_name);
+      pw.writeInt("_count", dtpv1->_count);
 
       return true;
     } catch (...) {
@@ -519,8 +519,7 @@ class TestPdxSerializerForV2 : public PdxSerializer {
     }
   }
 
-  void* fromData(const std::string& className,
-                 std::shared_ptr<PdxReader> pr) override {
+  void* fromData(const std::string& className, PdxReader& pr) override {
     // ASSERT(strcmp(className, V2CLASSNAME3) == 0 || strcmp(className,
     // V2CLASSNAME4) == 0, "Unexpected classname in fromData");
 
@@ -537,7 +536,7 @@ class TestPdxSerializerForV2 : public PdxSerializer {
   }
 
   bool toData(void* testObject, const std::string& className,
-              std::shared_ptr<PdxWriter> pw) override {
+              PdxWriter& pw) override {
     // ASSERT(strcmp(className, V2CLASSNAME3) == 0 || strcmp(className,
     // V2CLASSNAME4) == 0, "Unexpected classname in toData");
 
@@ -577,9 +576,9 @@ public:
     using PdxSerializable::toData;
     using PdxSerializable::fromData;
 
-  virtual void fromData(std::shared_ptr<PdxReader> pr);
+  virtual void fromData(PdxReader& pr);
 
-  virtual void toData(std::shared_ptr<PdxWriter> pw) ;
+  virtual void toData(PdxWriter& pw) ;
 
   const char* getClassName()const {
     return "PdxTests::TestEquals";
diff --git a/tests/cpp/testobject/PdxType.cpp b/tests/cpp/testobject/PdxType.cpp
index 2d97070..635f77f 100644
--- a/tests/cpp/testobject/PdxType.cpp
+++ b/tests/cpp/testobject/PdxType.cpp
@@ -71,102 +71,102 @@ bool PdxTests::PdxType::generic2DCompare(T1** value1, T2** value2, int length,
 // PdxType::~PdxObject() {
 //}
 
-void PdxTests::PdxType::toData(std::shared_ptr<PdxWriter> pw) const {
+void PdxTests::PdxType::toData(PdxWriter& pw) const {
   // TODO:delete it later
 
   int* lengthArr = new int[2];
 
   lengthArr[0] = 1;
   lengthArr[1] = 2;
-  pw->writeArrayOfByteArrays("m_byteByteArray", m_byteByteArray, 2, lengthArr);
-  pw->writeChar("m_char", m_char);
-  pw->markIdentityField("m_char");
-  pw->writeBoolean("m_bool", m_bool);  // 1
-  pw->markIdentityField("m_bool");
-  pw->writeBooleanArray("m_boolArray", m_boolArray, 3);
-  pw->markIdentityField("m_boolArray");
-  pw->writeByte("m_byte", m_byte);
-  pw->markIdentityField("m_byte");
-  pw->writeByteArray("m_byteArray", m_byteArray, 2);
-  pw->markIdentityField("m_byteArray");
-  pw->writeCharArray("m_charArray", m_charArray, 2);
-  pw->markIdentityField("m_charArray");
-  pw->writeObject("m_arraylist", m_arraylist);
-  pw->writeObject("m_linkedlist", m_linkedlist);
-  pw->markIdentityField("m_arraylist");
-  pw->writeObject("m_map", m_map);
-  pw->markIdentityField("m_map");
-  pw->writeObject("m_hashtable", m_hashtable);
-  pw->markIdentityField("m_hashtable");
-  pw->writeObject("m_vector", m_vector);
-  pw->markIdentityField("m_vector");
-  pw->writeObject("m_chs", m_chs);
-  pw->markIdentityField("m_chs");
-  pw->writeObject("m_clhs", m_clhs);
-  pw->markIdentityField("m_clhs");
-  pw->writeString("m_string", m_string);
-  pw->markIdentityField("m_string");
-  pw->writeDate("m_dateTime", m_date);
-  pw->markIdentityField("m_dateTime");
-  pw->writeDouble("m_double", m_double);
-  pw->markIdentityField("m_double");
-  pw->writeDoubleArray("m_doubleArray", m_doubleArray, 2);
-  pw->markIdentityField("m_doubleArray");
-  pw->writeFloat("m_float", m_float);
-  pw->markIdentityField("m_float");
-  pw->writeFloatArray("m_floatArray", m_floatArray, 2);
-  pw->markIdentityField("m_floatArray");
-  pw->writeShort("m_int16", m_int16);
-  pw->markIdentityField("m_int16");
-  pw->writeInt("m_int32", m_int32);
-  pw->markIdentityField("m_int32");
-  pw->writeLong("m_long", m_long);
-  pw->markIdentityField("m_long");
-  pw->writeIntArray("m_int32Array", m_int32Array, 4);
-  pw->markIdentityField("m_int32Array");
-  pw->writeLongArray("m_longArray", m_longArray, 2);
-  pw->markIdentityField("m_longArray");
-  pw->writeShortArray("m_int16Array", m_int16Array, 2);
-  pw->markIdentityField("m_int16Array");
-  pw->writeByte("m_sbyte", m_sbyte);
-  pw->markIdentityField("m_sbyte");
-  pw->writeByteArray("m_sbyteArray", m_sbyteArray, 2);
-  pw->markIdentityField("m_sbyteArray");
+  pw.writeArrayOfByteArrays("m_byteByteArray", m_byteByteArray, 2, lengthArr);
+  pw.writeChar("m_char", m_char);
+  pw.markIdentityField("m_char");
+  pw.writeBoolean("m_bool", m_bool);  // 1
+  pw.markIdentityField("m_bool");
+  pw.writeBooleanArray("m_boolArray", m_boolArray, 3);
+  pw.markIdentityField("m_boolArray");
+  pw.writeByte("m_byte", m_byte);
+  pw.markIdentityField("m_byte");
+  pw.writeByteArray("m_byteArray", m_byteArray, 2);
+  pw.markIdentityField("m_byteArray");
+  pw.writeCharArray("m_charArray", m_charArray, 2);
+  pw.markIdentityField("m_charArray");
+  pw.writeObject("m_arraylist", m_arraylist);
+  pw.writeObject("m_linkedlist", m_linkedlist);
+  pw.markIdentityField("m_arraylist");
+  pw.writeObject("m_map", m_map);
+  pw.markIdentityField("m_map");
+  pw.writeObject("m_hashtable", m_hashtable);
+  pw.markIdentityField("m_hashtable");
+  pw.writeObject("m_vector", m_vector);
+  pw.markIdentityField("m_vector");
+  pw.writeObject("m_chs", m_chs);
+  pw.markIdentityField("m_chs");
+  pw.writeObject("m_clhs", m_clhs);
+  pw.markIdentityField("m_clhs");
+  pw.writeString("m_string", m_string);
+  pw.markIdentityField("m_string");
+  pw.writeDate("m_dateTime", m_date);
+  pw.markIdentityField("m_dateTime");
+  pw.writeDouble("m_double", m_double);
+  pw.markIdentityField("m_double");
+  pw.writeDoubleArray("m_doubleArray", m_doubleArray, 2);
+  pw.markIdentityField("m_doubleArray");
+  pw.writeFloat("m_float", m_float);
+  pw.markIdentityField("m_float");
+  pw.writeFloatArray("m_floatArray", m_floatArray, 2);
+  pw.markIdentityField("m_floatArray");
+  pw.writeShort("m_int16", m_int16);
+  pw.markIdentityField("m_int16");
+  pw.writeInt("m_int32", m_int32);
+  pw.markIdentityField("m_int32");
+  pw.writeLong("m_long", m_long);
+  pw.markIdentityField("m_long");
+  pw.writeIntArray("m_int32Array", m_int32Array, 4);
+  pw.markIdentityField("m_int32Array");
+  pw.writeLongArray("m_longArray", m_longArray, 2);
+  pw.markIdentityField("m_longArray");
+  pw.writeShortArray("m_int16Array", m_int16Array, 2);
+  pw.markIdentityField("m_int16Array");
+  pw.writeByte("m_sbyte", m_sbyte);
+  pw.markIdentityField("m_sbyte");
+  pw.writeByteArray("m_sbyteArray", m_sbyteArray, 2);
+  pw.markIdentityField("m_sbyteArray");
 
   // int* strlengthArr = new int[2];
 
   // strlengthArr[0] = 5;
   // strlengthArr[1] = 5;
-  pw->writeStringArray("m_stringArray", m_stringArray);
-  pw->markIdentityField("m_stringArray");
-  pw->writeShort("m_uint16", m_uint16);
-  pw->markIdentityField("m_uint16");
-  pw->writeInt("m_uint32", m_uint32);
-  pw->markIdentityField("m_uint32");
-  pw->writeLong("m_ulong", m_ulong);
-  pw->markIdentityField("m_ulong");
-  pw->writeIntArray("m_uint32Array", m_uint32Array, 4);
-  pw->markIdentityField("m_uint32Array");
-  pw->writeLongArray("m_ulongArray", m_ulongArray, 2);
-  pw->markIdentityField("m_ulongArray");
-  pw->writeShortArray("m_uint16Array", m_uint16Array, 2);
-  pw->markIdentityField("m_uint16Array");
-
-  pw->writeByteArray("m_byte252", m_byte252, 252);
-  pw->markIdentityField("m_byte252");
-  pw->writeByteArray("m_byte253", m_byte253, 253);
-  pw->markIdentityField("m_byte253");
-  pw->writeByteArray("m_byte65535", m_byte65535, 65535);
-  pw->markIdentityField("m_byte65535");
-  pw->writeByteArray("m_byte65536", m_byte65536, 65536);
-  pw->markIdentityField("m_byte65536");
-
-  pw->writeObject("m_pdxEnum", m_pdxEnum);
-  pw->markIdentityField("m_pdxEnum");
-  pw->writeObject("m_address", m_objectArray);
-
-  pw->writeObjectArray("m_objectArray", m_objectArray);
-  pw->writeObjectArray("", m_objectArrayEmptyPdxFieldName);
+  pw.writeStringArray("m_stringArray", m_stringArray);
+  pw.markIdentityField("m_stringArray");
+  pw.writeShort("m_uint16", m_uint16);
+  pw.markIdentityField("m_uint16");
+  pw.writeInt("m_uint32", m_uint32);
+  pw.markIdentityField("m_uint32");
+  pw.writeLong("m_ulong", m_ulong);
+  pw.markIdentityField("m_ulong");
+  pw.writeIntArray("m_uint32Array", m_uint32Array, 4);
+  pw.markIdentityField("m_uint32Array");
+  pw.writeLongArray("m_ulongArray", m_ulongArray, 2);
+  pw.markIdentityField("m_ulongArray");
+  pw.writeShortArray("m_uint16Array", m_uint16Array, 2);
+  pw.markIdentityField("m_uint16Array");
+
+  pw.writeByteArray("m_byte252", m_byte252, 252);
+  pw.markIdentityField("m_byte252");
+  pw.writeByteArray("m_byte253", m_byte253, 253);
+  pw.markIdentityField("m_byte253");
+  pw.writeByteArray("m_byte65535", m_byte65535, 65535);
+  pw.markIdentityField("m_byte65535");
+  pw.writeByteArray("m_byte65536", m_byte65536, 65536);
+  pw.markIdentityField("m_byte65536");
+
+  pw.writeObject("m_pdxEnum", m_pdxEnum);
+  pw.markIdentityField("m_pdxEnum");
+  pw.writeObject("m_address", m_objectArray);
+
+  pw.writeObjectArray("m_objectArray", m_objectArray);
+  pw.writeObjectArray("", m_objectArrayEmptyPdxFieldName);
 
   LOGDEBUG("PdxObject::writeObject() for enum Done......");
 
@@ -174,88 +174,88 @@ void PdxTests::PdxType::toData(std::shared_ptr<PdxWriter> pw) const {
   // TODO:delete it later
 }
 
-void PdxTests::PdxType::fromData(std::shared_ptr<PdxReader> pr) {
+void PdxTests::PdxType::fromData(PdxReader& pr) {
   // TODO:temp added, delete later
 
   int32_t* Lengtharr;
   GF_NEW(Lengtharr, int32_t[2]);
   int32_t arrLen = 0;
   m_byteByteArray =
-      pr->readArrayOfByteArrays("m_byteByteArray", arrLen, &Lengtharr);
+      pr.readArrayOfByteArrays("m_byteByteArray", arrLen, &Lengtharr);
   // TODO::need to write compareByteByteArray() and check for m_byteByteArray
   // elements
 
-  m_char = pr->readChar("m_char");
+  m_char = pr.readChar("m_char");
   // GenericValCompare
 
-  m_bool = pr->readBoolean("m_bool");
+  m_bool = pr.readBoolean("m_bool");
   // GenericValCompare
-  m_boolArray = pr->readBooleanArray("m_boolArray", boolArrayLen);
+  m_boolArray = pr.readBooleanArray("m_boolArray", boolArrayLen);
 
-  m_byte = pr->readByte("m_byte");
-  m_byteArray = pr->readByteArray("m_byteArray", byteArrayLen);
-  m_charArray = pr->readCharArray("m_charArray", charArrayLen);
+  m_byte = pr.readByte("m_byte");
+  m_byteArray = pr.readByteArray("m_byteArray", byteArrayLen);
+  m_charArray = pr.readCharArray("m_charArray", charArrayLen);
 
   m_arraylist = std::static_pointer_cast<CacheableArrayList>(
-      pr->readObject("m_arraylist"));
+      pr.readObject("m_arraylist"));
   m_linkedlist = std::static_pointer_cast<CacheableLinkedList>(
-      pr->readObject("m_linkedlist"));
-  m_map = std::static_pointer_cast<CacheableHashMap>(pr->readObject("m_map"));
+      pr.readObject("m_linkedlist"));
+  m_map = std::static_pointer_cast<CacheableHashMap>(pr.readObject("m_map"));
   // TODO:Check for the size
 
   m_hashtable = std::static_pointer_cast<CacheableHashTable>(
-      pr->readObject("m_hashtable"));
+      pr.readObject("m_hashtable"));
   // TODO:Check for the size
 
   m_vector =
-      std::static_pointer_cast<CacheableVector>(pr->readObject("m_vector"));
+      std::static_pointer_cast<CacheableVector>(pr.readObject("m_vector"));
   // TODO::Check for size
 
-  m_chs = std::static_pointer_cast<CacheableHashSet>(pr->readObject("m_chs"));
+  m_chs = std::static_pointer_cast<CacheableHashSet>(pr.readObject("m_chs"));
   // TODO::Size check
 
-  m_clhs = std::static_pointer_cast<CacheableLinkedHashSet>(
-      pr->readObject("m_clhs"));
+  m_clhs =
+      std::static_pointer_cast<CacheableLinkedHashSet>(pr.readObject("m_clhs"));
   // TODO:Size check
 
-  m_string = pr->readString("m_string");  // GenericValCompare
-  m_date = pr->readDate("m_dateTime");    // compareData
-
-  m_double = pr->readDouble("m_double");
-
-  m_doubleArray = pr->readDoubleArray("m_doubleArray", doubleArrayLen);
-  m_float = pr->readFloat("m_float");
-  m_floatArray = pr->readFloatArray("m_floatArray", floatArrayLen);
-  m_int16 = pr->readShort("m_int16");
-  m_int32 = pr->readInt("m_int32");
-  m_long = pr->readLong("m_long");
-  m_int32Array = pr->readIntArray("m_int32Array", intArrayLen);
-  m_longArray = pr->readLongArray("m_longArray", longArrayLen);
-  m_int16Array = pr->readShortArray("m_int16Array", shortArrayLen);
-  m_sbyte = pr->readByte("m_sbyte");
-  m_sbyteArray = pr->readByteArray("m_sbyteArray", byteArrayLen);
-  m_stringArray = pr->readStringArray("m_stringArray");
-  m_uint16 = pr->readShort("m_uint16");
-  m_uint32 = pr->readInt("m_uint32");
-  m_ulong = pr->readLong("m_ulong");
-  m_uint32Array = pr->readIntArray("m_uint32Array", intArrayLen);
-  m_ulongArray = pr->readLongArray("m_ulongArray", longArrayLen);
-  m_uint16Array = pr->readShortArray("m_uint16Array", shortArrayLen);
+  m_string = pr.readString("m_string");  // GenericValCompare
+  m_date = pr.readDate("m_dateTime");    // compareData
+
+  m_double = pr.readDouble("m_double");
+
+  m_doubleArray = pr.readDoubleArray("m_doubleArray", doubleArrayLen);
+  m_float = pr.readFloat("m_float");
+  m_floatArray = pr.readFloatArray("m_floatArray", floatArrayLen);
+  m_int16 = pr.readShort("m_int16");
+  m_int32 = pr.readInt("m_int32");
+  m_long = pr.readLong("m_long");
+  m_int32Array = pr.readIntArray("m_int32Array", intArrayLen);
+  m_longArray = pr.readLongArray("m_longArray", longArrayLen);
+  m_int16Array = pr.readShortArray("m_int16Array", shortArrayLen);
+  m_sbyte = pr.readByte("m_sbyte");
+  m_sbyteArray = pr.readByteArray("m_sbyteArray", byteArrayLen);
+  m_stringArray = pr.readStringArray("m_stringArray");
+  m_uint16 = pr.readShort("m_uint16");
+  m_uint32 = pr.readInt("m_uint32");
+  m_ulong = pr.readLong("m_ulong");
+  m_uint32Array = pr.readIntArray("m_uint32Array", intArrayLen);
+  m_ulongArray = pr.readLongArray("m_ulongArray", longArrayLen);
+  m_uint16Array = pr.readShortArray("m_uint16Array", shortArrayLen);
   // LOGINFO("PdxType::readInt() start...");
 
-  m_byte252 = pr->readByteArray("m_byte252", m_byte252Len);
-  m_byte253 = pr->readByteArray("m_byte253", m_byte253Len);
-  m_byte65535 = pr->readByteArray("m_byte65535", m_byte65535Len);
-  m_byte65536 = pr->readByteArray("m_byte65536", m_byte65536Len);
+  m_byte252 = pr.readByteArray("m_byte252", m_byte252Len);
+  m_byte253 = pr.readByteArray("m_byte253", m_byte253Len);
+  m_byte65535 = pr.readByteArray("m_byte65535", m_byte65535Len);
+  m_byte65536 = pr.readByteArray("m_byte65536", m_byte65536Len);
   // TODO:Check for size
 
-  m_pdxEnum = pr->readObject("m_pdxEnum");
+  m_pdxEnum = pr.readObject("m_pdxEnum");
 
-  m_address = pr->readObject("m_address");
+  m_address = pr.readObject("m_address");
   // size chaeck
 
-  m_objectArray = pr->readObjectArray("m_objectArray");
-  m_objectArrayEmptyPdxFieldName = pr->readObjectArray("");
+  m_objectArray = pr.readObjectArray("m_objectArray");
+  m_objectArrayEmptyPdxFieldName = pr.readObjectArray("");
 
   // Check for individual elements
 
diff --git a/tests/cpp/testobject/PdxType.hpp b/tests/cpp/testobject/PdxType.hpp
index 081a70e..c316965 100644
--- a/tests/cpp/testobject/PdxType.hpp
+++ b/tests/cpp/testobject/PdxType.hpp
@@ -114,22 +114,22 @@ class TESTOBJECT_EXPORT Child : public Parent, public PdxSerializable {
   using PdxSerializable::toData;
   using PdxSerializable::fromData;
 
-  void toData(std::shared_ptr<PdxWriter> pw) const override {
-    pw->writeInt("m_a", m_a);
-    pw->writeInt("m_b", m_b);
-    pw->writeInt("m_c", m_c);
-    pw->writeInt("m_d", m_d);
-    pw->writeInt("m_e", m_e);
-    pw->writeInt("m_f", m_f);
+  void toData(PdxWriter& pw) const override {
+    pw.writeInt("m_a", m_a);
+    pw.writeInt("m_b", m_b);
+    pw.writeInt("m_c", m_c);
+    pw.writeInt("m_d", m_d);
+    pw.writeInt("m_e", m_e);
+    pw.writeInt("m_f", m_f);
   }
 
-  void fromData(std::shared_ptr<PdxReader> pr) override {
-    m_a = pr->readInt("m_a");
-    m_b = pr->readInt("m_b");
-    m_c = pr->readInt("m_c");
-    m_d = pr->readInt("m_d");
-    m_e = pr->readInt("m_e");
-    m_f = pr->readInt("m_f");
+  void fromData(PdxReader& pr) override {
+    m_a = pr.readInt("m_a");
+    m_b = pr.readInt("m_b");
+    m_c = pr.readInt("m_c");
+    m_d = pr.readInt("m_d");
+    m_e = pr.readInt("m_e");
+    m_f = pr.readInt("m_f");
   }
 
   static PdxSerializable* createDeserializable() { return new Child(); }
@@ -215,14 +215,14 @@ class TESTOBJECT_EXPORT CharTypes : public PdxSerializable {
   using PdxSerializable::toData;
   using PdxSerializable::fromData;
 
-  void toData(std::shared_ptr<PdxWriter> pw) const override {
-    pw->writeChar("m_ch", m_ch);
-    pw->writeCharArray("m_chArray", m_chArray, 2);
+  void toData(PdxWriter& pw) const override {
+    pw.writeChar("m_ch", m_ch);
+    pw.writeCharArray("m_chArray", m_chArray, 2);
   }
 
-  void fromData(std::shared_ptr<PdxReader> pr) override {
-    m_ch = pr->readChar("m_ch");
-    m_chArray = pr->readCharArray("m_chArray", m_charArrayLen);
+  void fromData(PdxReader& pr) override {
+    m_ch = pr.readChar("m_ch");
+    m_chArray = pr.readCharArray("m_chArray", m_charArrayLen);
   }
 
   static PdxSerializable* createDeserializable() { return new CharTypes(); }
@@ -278,16 +278,16 @@ class TESTOBJECT_EXPORT Address : public PdxSerializable {
   using PdxSerializable::toData;
   using PdxSerializable::fromData;
 
-  void toData(std::shared_ptr<PdxWriter> pw) const override {
-    pw->writeInt("_aptNumber", _aptNumber);  // 4
-    pw->writeString("_street", _street);
-    pw->writeString("_city", _city);
+  void toData(PdxWriter& pw) const override {
+    pw.writeInt("_aptNumber", _aptNumber);  // 4
+    pw.writeString("_street", _street);
+    pw.writeString("_city", _city);
   }
 
-  void fromData(std::shared_ptr<PdxReader> pr) override {
-    _aptNumber = pr->readInt("_aptNumber");
-    _street = pr->readString("_street");
-    _city = pr->readString("_city");
+  void fromData(PdxReader& pr) override {
+    _aptNumber = pr.readInt("_aptNumber");
+    _street = pr.readString("_street");
+    _city = pr.readString("_city");
   }
 
   static PdxSerializable* createDeserializable() { return new Address(); }
@@ -741,9 +741,9 @@ class TESTOBJECT_EXPORT PdxType : public PdxSerializable {
   using PdxSerializable::toData;
   using PdxSerializable::fromData;
 
-  virtual void toData(std::shared_ptr<PdxWriter> pw) const override;
+  virtual void toData(PdxWriter& pw) const override;
 
-  virtual void fromData(std::shared_ptr<PdxReader> pr) override;
+  virtual void fromData(PdxReader& pr) override;
 
   std::string toString() const override;
 
diff --git a/tests/cpp/testobject/PdxVersioned1.cpp b/tests/cpp/testobject/PdxVersioned1.cpp
index 9bb1e85..1173bbf 100644
--- a/tests/cpp/testobject/PdxVersioned1.cpp
+++ b/tests/cpp/testobject/PdxVersioned1.cpp
@@ -258,107 +258,107 @@ void PdxVersioned1::init(const char* key) {
   lengthArr[1] = 2;
 }
 
-void PdxTests::PdxVersioned1::toData(std::shared_ptr<PdxWriter> pw) const {
+void PdxTests::PdxVersioned1::toData(PdxWriter& pw) const {
   // TODO:delete it later
 
   int* lengthArr = new int[2];
 
   lengthArr[0] = 1;
   lengthArr[1] = 2;
-  pw->writeArrayOfByteArrays("m_byteByteArray", m_byteByteArray, 2, lengthArr);
-  pw->writeChar("m_char", m_char);
-  pw->writeBoolean("m_bool", m_bool);  // 1
-  pw->writeBooleanArray("m_boolArray", m_boolArray, 3);
-  pw->writeByte("m_byte", m_byte);
-  pw->writeByteArray("m_byteArray", m_byteArray, 2);
-  pw->writeCharArray("m_charArray", m_charArray, 2);
-  pw->writeObject("m_arraylist", m_arraylist);
-  pw->writeObject("m_map", m_map);
-  pw->writeString("m_string", m_string);
-  pw->writeDate("m_dateTime", m_date);
-  pw->writeDouble("m_double", m_double);
-  pw->writeDoubleArray("m_doubleArray", m_doubleArray, 2);
-  pw->writeFloat("m_float", m_float);
-  pw->writeFloatArray("m_floatArray", m_floatArray, 2);
-  pw->writeShort("m_int16", m_int16);
-  pw->writeInt("m_int32", m_int32);
-  // pw->writeLong("m_long", m_long);
-  pw->writeIntArray("m_int32Array", m_int32Array, 4);
-  pw->writeLongArray("m_longArray", m_longArray, 2);
-  pw->writeShortArray("m_int16Array", m_int16Array, 2);
-  pw->writeByte("m_sbyte", m_sbyte);
-  pw->writeByteArray("m_sbyteArray", m_sbyteArray, 2);
+  pw.writeArrayOfByteArrays("m_byteByteArray", m_byteByteArray, 2, lengthArr);
+  pw.writeChar("m_char", m_char);
+  pw.writeBoolean("m_bool", m_bool);  // 1
+  pw.writeBooleanArray("m_boolArray", m_boolArray, 3);
+  pw.writeByte("m_byte", m_byte);
+  pw.writeByteArray("m_byteArray", m_byteArray, 2);
+  pw.writeCharArray("m_charArray", m_charArray, 2);
+  pw.writeObject("m_arraylist", m_arraylist);
+  pw.writeObject("m_map", m_map);
+  pw.writeString("m_string", m_string);
+  pw.writeDate("m_dateTime", m_date);
+  pw.writeDouble("m_double", m_double);
+  pw.writeDoubleArray("m_doubleArray", m_doubleArray, 2);
+  pw.writeFloat("m_float", m_float);
+  pw.writeFloatArray("m_floatArray", m_floatArray, 2);
+  pw.writeShort("m_int16", m_int16);
+  pw.writeInt("m_int32", m_int32);
+  // pw.writeLong("m_long", m_long);
+  pw.writeIntArray("m_int32Array", m_int32Array, 4);
+  pw.writeLongArray("m_longArray", m_longArray, 2);
+  pw.writeShortArray("m_int16Array", m_int16Array, 2);
+  pw.writeByte("m_sbyte", m_sbyte);
+  pw.writeByteArray("m_sbyteArray", m_sbyteArray, 2);
   // int* strlengthArr = new int[2];
 
   // strlengthArr[0] = 5;
   // strlengthArr[1] = 5;
-  pw->writeStringArray("m_stringArray", m_stringArray);
-  pw->writeShort("m_uint16", m_uint16);
-  // pw->writeInt("m_uint32", m_uint32);
-  pw->writeLong("m_ulong", m_ulong);
-  pw->writeIntArray("m_uint32Array", m_uint32Array, 4);
-  pw->writeLongArray("m_ulongArray", m_ulongArray, 2);
-  pw->writeShortArray("m_uint16Array", m_uint16Array, 2);
-  pw->writeByteArray("m_byte252", m_byte252, 252);
-  pw->writeByteArray("m_byte253", m_byte253, 253);
-  pw->writeByteArray("m_byte65535", m_byte65535, 65535);
-  pw->writeByteArray("m_byte65536", m_byte65536, 65536);
-  pw->writeObject("m_pdxEnum", m_pdxEnum);
+  pw.writeStringArray("m_stringArray", m_stringArray);
+  pw.writeShort("m_uint16", m_uint16);
+  // pw.writeInt("m_uint32", m_uint32);
+  pw.writeLong("m_ulong", m_ulong);
+  pw.writeIntArray("m_uint32Array", m_uint32Array, 4);
+  pw.writeLongArray("m_ulongArray", m_ulongArray, 2);
+  pw.writeShortArray("m_uint16Array", m_uint16Array, 2);
+  pw.writeByteArray("m_byte252", m_byte252, 252);
+  pw.writeByteArray("m_byte253", m_byte253, 253);
+  pw.writeByteArray("m_byte65535", m_byte65535, 65535);
+  pw.writeByteArray("m_byte65536", m_byte65536, 65536);
+  pw.writeObject("m_pdxEnum", m_pdxEnum);
 
   // TODO:delete it later
 }
 
-void PdxTests::PdxVersioned1::fromData(std::shared_ptr<PdxReader> pr) {
+void PdxTests::PdxVersioned1::fromData(PdxReader& pr) {
   // TODO:temp added, delete later
 
   int32_t* Lengtharr;
   GF_NEW(Lengtharr, int32_t[2]);
   int32_t arrLen = 0;
   m_byteByteArray =
-      pr->readArrayOfByteArrays("m_byteByteArray", arrLen, &Lengtharr);
+      pr.readArrayOfByteArrays("m_byteByteArray", arrLen, &Lengtharr);
   // TODO::need to write compareByteByteArray() and check for m_byteByteArray
   // elements
-  m_char = pr->readChar("m_char");
+  m_char = pr.readChar("m_char");
   // GenericValCompare
-  m_bool = pr->readBoolean("m_bool");
+  m_bool = pr.readBoolean("m_bool");
   // GenericValCompare
-  m_boolArray = pr->readBooleanArray("m_boolArray", boolArrayLen);
-  m_byte = pr->readByte("m_byte");
-  m_byteArray = pr->readByteArray("m_byteArray", byteArrayLen);
-  m_charArray = pr->readCharArray("m_charArray", charArrayLen);
+  m_boolArray = pr.readBooleanArray("m_boolArray", boolArrayLen);
+  m_byte = pr.readByte("m_byte");
+  m_byteArray = pr.readByteArray("m_byteArray", byteArrayLen);
+  m_charArray = pr.readCharArray("m_charArray", charArrayLen);
   m_arraylist = std::static_pointer_cast<CacheableArrayList>(
-      pr->readObject("m_arraylist"));
-  m_map = std::static_pointer_cast<CacheableHashMap>(pr->readObject("m_map"));
+      pr.readObject("m_arraylist"));
+  m_map = std::static_pointer_cast<CacheableHashMap>(pr.readObject("m_map"));
   // TODO:Check for the size
-  m_string = pr->readString("m_string");  // GenericValCompare
-  m_date = pr->readDate("m_dateTime");    // compareData
-  m_double = pr->readDouble("m_double");
-  m_doubleArray = pr->readDoubleArray("m_doubleArray", doubleArrayLen);
-  m_float = pr->readFloat("m_float");
-  m_floatArray = pr->readFloatArray("m_floatArray", floatArrayLen);
-  m_int16 = pr->readShort("m_int16");
-  m_int32 = pr->readInt("m_int32");
-  // m_long = pr->readLong("m_long");
-  m_int32Array = pr->readIntArray("m_int32Array", intArrayLen);
-  m_longArray = pr->readLongArray("m_longArray", longArrayLen);
-  m_int16Array = pr->readShortArray("m_int16Array", shortArrayLen);
-  m_sbyte = pr->readByte("m_sbyte");
-  m_sbyteArray = pr->readByteArray("m_sbyteArray", byteArrayLen);
-  m_stringArray = pr->readStringArray("m_stringArray");
-  m_uint16 = pr->readShort("m_uint16");
-  // m_uint32 = pr->readInt("m_uint32");
-  m_ulong = pr->readLong("m_ulong");
-  m_uint32Array = pr->readIntArray("m_uint32Array", intArrayLen);
-  m_ulongArray = pr->readLongArray("m_ulongArray", longArrayLen);
-  m_uint16Array = pr->readShortArray("m_uint16Array", shortArrayLen);
+  m_string = pr.readString("m_string");  // GenericValCompare
+  m_date = pr.readDate("m_dateTime");    // compareData
+  m_double = pr.readDouble("m_double");
+  m_doubleArray = pr.readDoubleArray("m_doubleArray", doubleArrayLen);
+  m_float = pr.readFloat("m_float");
+  m_floatArray = pr.readFloatArray("m_floatArray", floatArrayLen);
+  m_int16 = pr.readShort("m_int16");
+  m_int32 = pr.readInt("m_int32");
+  // m_long = pr.readLong("m_long");
+  m_int32Array = pr.readIntArray("m_int32Array", intArrayLen);
+  m_longArray = pr.readLongArray("m_longArray", longArrayLen);
+  m_int16Array = pr.readShortArray("m_int16Array", shortArrayLen);
+  m_sbyte = pr.readByte("m_sbyte");
+  m_sbyteArray = pr.readByteArray("m_sbyteArray", byteArrayLen);
+  m_stringArray = pr.readStringArray("m_stringArray");
+  m_uint16 = pr.readShort("m_uint16");
+  // m_uint32 = pr.readInt("m_uint32");
+  m_ulong = pr.readLong("m_ulong");
+  m_uint32Array = pr.readIntArray("m_uint32Array", intArrayLen);
+  m_ulongArray = pr.readLongArray("m_ulongArray", longArrayLen);
+  m_uint16Array = pr.readShortArray("m_uint16Array", shortArrayLen);
   // LOGINFO("PdxVersioned1::readInt() start...");
 
-  m_byte252 = pr->readByteArray("m_byte252", m_byte252Len);
-  m_byte253 = pr->readByteArray("m_byte253", m_byte253Len);
-  m_byte65535 = pr->readByteArray("m_byte65535", m_byte65535Len);
-  m_byte65536 = pr->readByteArray("m_byte65536", m_byte65536Len);
+  m_byte252 = pr.readByteArray("m_byte252", m_byte252Len);
+  m_byte253 = pr.readByteArray("m_byte253", m_byte253Len);
+  m_byte65535 = pr.readByteArray("m_byte65535", m_byte65535Len);
+  m_byte65536 = pr.readByteArray("m_byte65536", m_byte65536Len);
   // TODO:Check for size
-  m_pdxEnum = pr->readObject("m_pdxEnum");
+  m_pdxEnum = pr.readObject("m_pdxEnum");
 }
 
 std::string PdxTests::PdxVersioned1::toString() const {
diff --git a/tests/cpp/testobject/PdxVersioned1.hpp b/tests/cpp/testobject/PdxVersioned1.hpp
index 9cd272f..b8a348f 100644
--- a/tests/cpp/testobject/PdxVersioned1.hpp
+++ b/tests/cpp/testobject/PdxVersioned1.hpp
@@ -232,9 +232,9 @@ class TESTOBJECT_EXPORT PdxVersioned1 : public PdxSerializable {
   using PdxSerializable::toData;
   using PdxSerializable::fromData;
 
-  virtual void toData(std::shared_ptr<PdxWriter> pw) const override;
+  virtual void toData(PdxWriter& pw) const override;
 
-  virtual void fromData(std::shared_ptr<PdxReader> pr) override;
+  virtual void fromData(PdxReader& pr) override;
 
   std::string toString() const override;
 
diff --git a/tests/cpp/testobject/PdxVersioned2.cpp b/tests/cpp/testobject/PdxVersioned2.cpp
index 846b5e2..2fe4bd7 100644
--- a/tests/cpp/testobject/PdxVersioned2.cpp
+++ b/tests/cpp/testobject/PdxVersioned2.cpp
@@ -262,52 +262,52 @@ void PdxVersioned2::init(const char* key) {
   lengthArr[1] = 2;
 }
 
-void PdxTests::PdxVersioned2::toData(std::shared_ptr<PdxWriter> pw) const {
+void PdxTests::PdxVersioned2::toData(PdxWriter& pw) const {
   // TODO:delete it later
 
   int* lengthArr = new int[2];
 
   lengthArr[0] = 1;
   lengthArr[1] = 2;
-  pw->writeArrayOfByteArrays("m_byteByteArray", m_byteByteArray, 2, lengthArr);
-  pw->writeChar("m_char", m_char);
-  pw->writeBoolean("m_bool", m_bool);  // 1
-  pw->writeBooleanArray("m_boolArray", m_boolArray, 3);
-  pw->writeByte("m_byte", m_byte);
-  pw->writeByteArray("m_byteArray", m_byteArray, 2);
-  pw->writeCharArray("m_charArray", m_charArray, 2);
-  pw->writeObject("m_arraylist", m_arraylist);
-  pw->writeObject("m_map", m_map);
-  pw->writeString("m_string", m_string);
-  pw->writeDate("m_dateTime", m_date);
-  pw->writeDouble("m_double", m_double);
-  pw->writeDoubleArray("m_doubleArray", m_doubleArray, 2);
-  pw->writeFloat("m_float", m_float);
-  pw->writeFloatArray("m_floatArray", m_floatArray, 2);
-  pw->writeShort("m_int16", m_int16);
-  pw->writeInt("m_int32", m_int32);
-  pw->writeLong("m_long", m_long);
-  pw->writeIntArray("m_int32Array", m_int32Array, 4);
-  pw->writeLongArray("m_longArray", m_longArray, 2);
-  pw->writeShortArray("m_int16Array", m_int16Array, 2);
-  pw->writeByte("m_sbyte", m_sbyte);
-  pw->writeByteArray("m_sbyteArray", m_sbyteArray, 2);
+  pw.writeArrayOfByteArrays("m_byteByteArray", m_byteByteArray, 2, lengthArr);
+  pw.writeChar("m_char", m_char);
+  pw.writeBoolean("m_bool", m_bool);  // 1
+  pw.writeBooleanArray("m_boolArray", m_boolArray, 3);
+  pw.writeByte("m_byte", m_byte);
+  pw.writeByteArray("m_byteArray", m_byteArray, 2);
+  pw.writeCharArray("m_charArray", m_charArray, 2);
+  pw.writeObject("m_arraylist", m_arraylist);
+  pw.writeObject("m_map", m_map);
+  pw.writeString("m_string", m_string);
+  pw.writeDate("m_dateTime", m_date);
+  pw.writeDouble("m_double", m_double);
+  pw.writeDoubleArray("m_doubleArray", m_doubleArray, 2);
+  pw.writeFloat("m_float", m_float);
+  pw.writeFloatArray("m_floatArray", m_floatArray, 2);
+  pw.writeShort("m_int16", m_int16);
+  pw.writeInt("m_int32", m_int32);
+  pw.writeLong("m_long", m_long);
+  pw.writeIntArray("m_int32Array", m_int32Array, 4);
+  pw.writeLongArray("m_longArray", m_longArray, 2);
+  pw.writeShortArray("m_int16Array", m_int16Array, 2);
+  pw.writeByte("m_sbyte", m_sbyte);
+  pw.writeByteArray("m_sbyteArray", m_sbyteArray, 2);
   // int* strlengthArr = new int[2];
 
   // strlengthArr[0] = 5;
   // strlengthArr[1] = 5;
-  pw->writeStringArray("m_stringArray", m_stringArray);
-  pw->writeShort("m_uint16", m_uint16);
-  pw->writeInt("m_uint32", m_uint32);
-  pw->writeLong("m_ulong", m_ulong);
-  pw->writeIntArray("m_uint32Array", m_uint32Array, 4);
-  pw->writeLongArray("m_ulongArray", m_ulongArray, 2);
-  pw->writeShortArray("m_uint16Array", m_uint16Array, 2);
-  pw->writeByteArray("m_byte252", m_byte252, 252);
-  pw->writeByteArray("m_byte253", m_byte253, 253);
-  pw->writeByteArray("m_byte65535", m_byte65535, 65535);
-  pw->writeByteArray("m_byte65536", m_byte65536, 65536);
-  pw->writeObject("m_pdxEnum", m_pdxEnum);
+  pw.writeStringArray("m_stringArray", m_stringArray);
+  pw.writeShort("m_uint16", m_uint16);
+  pw.writeInt("m_uint32", m_uint32);
+  pw.writeLong("m_ulong", m_ulong);
+  pw.writeIntArray("m_uint32Array", m_uint32Array, 4);
+  pw.writeLongArray("m_ulongArray", m_ulongArray, 2);
+  pw.writeShortArray("m_uint16Array", m_uint16Array, 2);
+  pw.writeByteArray("m_byte252", m_byte252, 252);
+  pw.writeByteArray("m_byte253", m_byte253, 253);
+  pw.writeByteArray("m_byte65535", m_byte65535, 65535);
+  pw.writeByteArray("m_byte65536", m_byte65536, 65536);
+  pw.writeObject("m_pdxEnum", m_pdxEnum);
 
   LOGDEBUG("PdxObject::writeObject() for enum Done......");
 
@@ -315,57 +315,57 @@ void PdxTests::PdxVersioned2::toData(std::shared_ptr<PdxWriter> pw) const {
   // TODO:delete it later
 }
 
-void PdxTests::PdxVersioned2::fromData(std::shared_ptr<PdxReader> pr) {
+void PdxTests::PdxVersioned2::fromData(PdxReader& pr) {
   // TODO:temp added, delete later
 
   int32_t* Lengtharr;
   GF_NEW(Lengtharr, int32_t[2]);
   int32_t arrLen = 0;
   m_byteByteArray =
-      pr->readArrayOfByteArrays("m_byteByteArray", arrLen, &Lengtharr);
+      pr.readArrayOfByteArrays("m_byteByteArray", arrLen, &Lengtharr);
   // TODO::need to write compareByteByteArray() and check for m_byteByteArray
   // elements
-  m_char = pr->readChar("m_char");
+  m_char = pr.readChar("m_char");
   // GenericValCompare
-  m_bool = pr->readBoolean("m_bool");
+  m_bool = pr.readBoolean("m_bool");
   // GenericValCompare
-  m_boolArray = pr->readBooleanArray("m_boolArray", boolArrayLen);
-  m_byte = pr->readByte("m_byte");
-  m_byteArray = pr->readByteArray("m_byteArray", byteArrayLen);
-  m_charArray = pr->readCharArray("m_charArray", charArrayLen);
+  m_boolArray = pr.readBooleanArray("m_boolArray", boolArrayLen);
+  m_byte = pr.readByte("m_byte");
+  m_byteArray = pr.readByteArray("m_byteArray", byteArrayLen);
+  m_charArray = pr.readCharArray("m_charArray", charArrayLen);
   m_arraylist = std::static_pointer_cast<CacheableArrayList>(
-      pr->readObject("m_arraylist"));
-  m_map = std::static_pointer_cast<CacheableHashMap>(pr->readObject("m_map"));
+      pr.readObject("m_arraylist"));
+  m_map = std::static_pointer_cast<CacheableHashMap>(pr.readObject("m_map"));
   // TODO:Check for the size
-  m_string = pr->readString("m_string");  // GenericValCompare
-  m_date = pr->readDate("m_dateTime");    // compareData
-  m_double = pr->readDouble("m_double");
-  m_doubleArray = pr->readDoubleArray("m_doubleArray", doubleArrayLen);
-  m_float = pr->readFloat("m_float");
-  m_floatArray = pr->readFloatArray("m_floatArray", floatArrayLen);
-  m_int16 = pr->readShort("m_int16");
-  m_int32 = pr->readInt("m_int32");
-  m_long = pr->readLong("m_long");
-  m_int32Array = pr->readIntArray("m_int32Array", intArrayLen);
-  m_longArray = pr->readLongArray("m_longArray", longArrayLen);
-  m_int16Array = pr->readShortArray("m_int16Array", shortArrayLen);
-  m_sbyte = pr->readByte("m_sbyte");
-  m_sbyteArray = pr->readByteArray("m_sbyteArray", byteArrayLen);
-  m_stringArray = pr->readStringArray("m_stringArray");
-  m_uint16 = pr->readShort("m_uint16");
-  m_uint32 = pr->readInt("m_uint32");
-  m_ulong = pr->readLong("m_ulong");
-  m_uint32Array = pr->readIntArray("m_uint32Array", intArrayLen);
-  m_ulongArray = pr->readLongArray("m_ulongArray", longArrayLen);
-  m_uint16Array = pr->readShortArray("m_uint16Array", shortArrayLen);
+  m_string = pr.readString("m_string");  // GenericValCompare
+  m_date = pr.readDate("m_dateTime");    // compareData
+  m_double = pr.readDouble("m_double");
+  m_doubleArray = pr.readDoubleArray("m_doubleArray", doubleArrayLen);
+  m_float = pr.readFloat("m_float");
+  m_floatArray = pr.readFloatArray("m_floatArray", floatArrayLen);
+  m_int16 = pr.readShort("m_int16");
+  m_int32 = pr.readInt("m_int32");
+  m_long = pr.readLong("m_long");
+  m_int32Array = pr.readIntArray("m_int32Array", intArrayLen);
+  m_longArray = pr.readLongArray("m_longArray", longArrayLen);
+  m_int16Array = pr.readShortArray("m_int16Array", shortArrayLen);
+  m_sbyte = pr.readByte("m_sbyte");
+  m_sbyteArray = pr.readByteArray("m_sbyteArray", byteArrayLen);
+  m_stringArray = pr.readStringArray("m_stringArray");
+  m_uint16 = pr.readShort("m_uint16");
+  m_uint32 = pr.readInt("m_uint32");
+  m_ulong = pr.readLong("m_ulong");
+  m_uint32Array = pr.readIntArray("m_uint32Array", intArrayLen);
+  m_ulongArray = pr.readLongArray("m_ulongArray", longArrayLen);
+  m_uint16Array = pr.readShortArray("m_uint16Array", shortArrayLen);
   // LOGINFO("PdxVersioned2::readInt() start...");
 
-  m_byte252 = pr->readByteArray("m_byte252", m_byte252Len);
-  m_byte253 = pr->readByteArray("m_byte253", m_byte253Len);
-  m_byte65535 = pr->readByteArray("m_byte65535", m_byte65535Len);
-  m_byte65536 = pr->readByteArray("m_byte65536", m_byte65536Len);
+  m_byte252 = pr.readByteArray("m_byte252", m_byte252Len);
+  m_byte253 = pr.readByteArray("m_byte253", m_byte253Len);
+  m_byte65535 = pr.readByteArray("m_byte65535", m_byte65535Len);
+  m_byte65536 = pr.readByteArray("m_byte65536", m_byte65536Len);
   // TODO:Check for size
-  m_pdxEnum = pr->readObject("m_pdxEnum");
+  m_pdxEnum = pr.readObject("m_pdxEnum");
 }
 std::string PdxTests::PdxVersioned2::toString() const {
   return "PdxVersioned 2 : " + m_string;
diff --git a/tests/cpp/testobject/PdxVersioned2.hpp b/tests/cpp/testobject/PdxVersioned2.hpp
index 8d0ae3d..6db42ca 100644
--- a/tests/cpp/testobject/PdxVersioned2.hpp
+++ b/tests/cpp/testobject/PdxVersioned2.hpp
@@ -232,9 +232,9 @@ class TESTOBJECT_EXPORT PdxVersioned2 : public PdxSerializable {
   using PdxSerializable::toData;
   using PdxSerializable::fromData;
 
-  virtual void toData(std::shared_ptr<PdxWriter> pw) const override;
+  virtual void toData(PdxWriter& pw) const override;
 
-  virtual void fromData(std::shared_ptr<PdxReader> pr) override;
+  virtual void fromData(PdxReader& pr) override;
 
   std::string toString() const override;
 
diff --git a/tests/cpp/testobject/PortfolioPdx.cpp b/tests/cpp/testobject/PortfolioPdx.cpp
index a7477bc..8f67fb0 100644
--- a/tests/cpp/testobject/PortfolioPdx.cpp
+++ b/tests/cpp/testobject/PortfolioPdx.cpp
@@ -67,63 +67,61 @@ PortfolioPdx::~PortfolioPdx() {
   }
 }
 
-void PortfolioPdx::toData(std::shared_ptr<PdxWriter> pw) const {
-  pw->writeInt("ID", id);
-  pw->markIdentityField("ID");
+void PortfolioPdx::toData(PdxWriter& pw) const {
+  pw.writeInt("ID", id);
+  pw.markIdentityField("ID");
 
-  pw->writeString("pkid", pkid);
-  pw->markIdentityField("pkid");
+  pw.writeString("pkid", pkid);
+  pw.markIdentityField("pkid");
 
-  pw->writeObject("position1", position1);
-  pw->markIdentityField("position1");
+  pw.writeObject("position1", position1);
+  pw.markIdentityField("position1");
 
-  pw->writeObject("position2", position2);
-  pw->markIdentityField("position2");
+  pw.writeObject("position2", position2);
+  pw.markIdentityField("position2");
 
-  pw->writeObject("positions", positions);
-  pw->markIdentityField("positions");
+  pw.writeObject("positions", positions);
+  pw.markIdentityField("positions");
 
-  pw->writeString("type", type);
-  pw->markIdentityField("type");
+  pw.writeString("type", type);
+  pw.markIdentityField("type");
 
-  pw->writeString("status", status);
-  pw->markIdentityField("status");
+  pw.writeString("status", status);
+  pw.markIdentityField("status");
 
-  pw->writeStringArray("names", names);
-  pw->markIdentityField("names");
+  pw.writeStringArray("names", names);
+  pw.markIdentityField("names");
 
-  pw->writeByteArray("newVal", newVal, newValSize);
-  pw->markIdentityField("newVal");
+  pw.writeByteArray("newVal", newVal, newValSize);
+  pw.markIdentityField("newVal");
 
-  pw->writeDate("creationDate", creationDate);
-  pw->markIdentityField("creationDate");
+  pw.writeDate("creationDate", creationDate);
+  pw.markIdentityField("creationDate");
 
-  pw->writeByteArray("arrayNull", arrayNull, 0);
-  pw->writeByteArray("arrayZeroSize", arrayZeroSize, 0);
+  pw.writeByteArray("arrayNull", arrayNull, 0);
+  pw.writeByteArray("arrayZeroSize", arrayZeroSize, 0);
 }
 
-void PortfolioPdx::fromData(std::shared_ptr<PdxReader> pr) {
-  id = pr->readInt("ID");
-  pkid = pr->readString("pkid");
+void PortfolioPdx::fromData(PdxReader& pr) {
+  id = pr.readInt("ID");
+  pkid = pr.readString("pkid");
 
-  position1 =
-      std::static_pointer_cast<PositionPdx>(pr->readObject("position1"));
-  position2 =
-      std::static_pointer_cast<PositionPdx>(pr->readObject("position2"));
+  position1 = std::static_pointer_cast<PositionPdx>(pr.readObject("position1"));
+  position2 = std::static_pointer_cast<PositionPdx>(pr.readObject("position2"));
   positions =
-      std::static_pointer_cast<CacheableHashMap>(pr->readObject("positions"));
-  type = pr->readString("type");
-  status = pr->readString("status");
+      std::static_pointer_cast<CacheableHashMap>(pr.readObject("positions"));
+  type = pr.readString("type");
+  status = pr.readString("status");
 
   int32_t strLenArray = 0;
-  names = pr->readStringArray("names");
+  names = pr.readStringArray("names");
   int32_t byteArrayLen = 0;
-  newVal = pr->readByteArray("newVal", byteArrayLen);
-  creationDate = pr->readDate("creationDate");
+  newVal = pr.readByteArray("newVal", byteArrayLen);
+  creationDate = pr.readDate("creationDate");
   int32_t arrayNullLen = 0;
-  arrayNull = pr->readByteArray("arrayNull", arrayNullLen);
+  arrayNull = pr.readByteArray("arrayNull", arrayNullLen);
   int32_t arrayZeroSizeLen = 0;
-  arrayZeroSize = pr->readByteArray("arrayZeroSize", arrayZeroSizeLen);
+  arrayZeroSize = pr.readByteArray("arrayZeroSize", arrayZeroSizeLen);
 }
 std::string PortfolioPdx::toString() const {
   LOGINFO("PortfolioPdx::toString() Start");
diff --git a/tests/cpp/testobject/PortfolioPdx.hpp b/tests/cpp/testobject/PortfolioPdx.hpp
index 62dbadd..3862873 100644
--- a/tests/cpp/testobject/PortfolioPdx.hpp
+++ b/tests/cpp/testobject/PortfolioPdx.hpp
@@ -102,8 +102,8 @@ class TESTOBJECT_EXPORT PortfolioPdx : public PdxSerializable {
   using PdxSerializable::toData;
   using PdxSerializable::fromData;
 
-  virtual void toData(std::shared_ptr<PdxWriter> pw) const override;
-  virtual void fromData(std::shared_ptr<PdxReader> pr) override;
+  virtual void toData(PdxWriter& pw) const override;
+  virtual void fromData(PdxReader& pr) override;
 
   std::string toString() const override;
 };
diff --git a/tests/cpp/testobject/PositionPdx.cpp b/tests/cpp/testobject/PositionPdx.cpp
index 0577ee9..c259c6f 100644
--- a/tests/cpp/testobject/PositionPdx.cpp
+++ b/tests/cpp/testobject/PositionPdx.cpp
@@ -73,73 +73,73 @@ void PositionPdx::init() {
   pid = 0;
 }
 
-void PositionPdx::toData(std::shared_ptr<PdxWriter> pw) const {
-  pw->writeLong("avg20DaysVol", avg20DaysVol);
-  pw->markIdentityField("avg20DaysVol");
+void PositionPdx::toData(PdxWriter& pw) const {
+  pw.writeLong("avg20DaysVol", avg20DaysVol);
+  pw.markIdentityField("avg20DaysVol");
 
-  pw->writeString("bondRating", bondRating);
-  pw->markIdentityField("bondRating");
+  pw.writeString("bondRating", bondRating);
+  pw.markIdentityField("bondRating");
 
-  pw->writeDouble("convRatio", convRatio);
-  pw->markIdentityField("convRatio");
+  pw.writeDouble("convRatio", convRatio);
+  pw.markIdentityField("convRatio");
 
-  pw->writeString("country", country);
-  pw->markIdentityField("country");
+  pw.writeString("country", country);
+  pw.markIdentityField("country");
 
-  pw->writeDouble("delta", delta);
-  pw->markIdentityField("delta");
+  pw.writeDouble("delta", delta);
+  pw.markIdentityField("delta");
 
-  pw->writeLong("industry", industry);
-  pw->markIdentityField("industry");
+  pw.writeLong("industry", industry);
+  pw.markIdentityField("industry");
 
-  pw->writeLong("issuer", issuer);
-  pw->markIdentityField("issuer");
+  pw.writeLong("issuer", issuer);
+  pw.markIdentityField("issuer");
 
-  pw->writeDouble("mktValue", mktValue);
-  pw->markIdentityField("mktValue");
+  pw.writeDouble("mktValue", mktValue);
+  pw.markIdentityField("mktValue");
 
-  pw->writeDouble("qty", qty);
-  pw->markIdentityField("qty");
+  pw.writeDouble("qty", qty);
+  pw.markIdentityField("qty");
 
-  pw->writeString("secId", secId);
-  pw->markIdentityField("secId");
+  pw.writeString("secId", secId);
+  pw.markIdentityField("secId");
 
-  pw->writeString("secLinks", secLinks);
-  pw->markIdentityField("secLinks");
+  pw.writeString("secLinks", secLinks);
+  pw.markIdentityField("secLinks");
 
-  pw->writeString("secType", secType);
-  pw->markIdentityField("secType");
+  pw.writeString("secType", secType);
+  pw.markIdentityField("secType");
 
-  pw->writeInt("sharesOutstanding", sharesOutstanding);
-  pw->markIdentityField("sharesOutstanding");
+  pw.writeInt("sharesOutstanding", sharesOutstanding);
+  pw.markIdentityField("sharesOutstanding");
 
-  pw->writeString("underlyer", underlyer);
-  pw->markIdentityField("underlyer");
+  pw.writeString("underlyer", underlyer);
+  pw.markIdentityField("underlyer");
 
-  pw->writeLong("volatility", volatility);
-  pw->markIdentityField("volatility");
+  pw.writeLong("volatility", volatility);
+  pw.markIdentityField("volatility");
 
-  pw->writeInt("pid", pid);
-  pw->markIdentityField("pid");
+  pw.writeInt("pid", pid);
+  pw.markIdentityField("pid");
 }
 
-void PositionPdx::fromData(std::shared_ptr<PdxReader> pr) {
-  avg20DaysVol = pr->readLong("avg20DaysVol");
-  bondRating = pr->readString("bondRating");
-  convRatio = pr->readDouble("convRatio");
-  country = pr->readString("country");
-  delta = pr->readDouble("delta");
-  industry = pr->readLong("industry");
-  issuer = pr->readLong("issuer");
-  mktValue = pr->readDouble("mktValue");
-  qty = pr->readDouble("qty");
-  secId = pr->readString("secId");
-  secLinks = pr->readString("secLinks");
-  secType = pr->readString("secType");
-  sharesOutstanding = pr->readInt("sharesOutstanding");
-  underlyer = pr->readString("underlyer");
-  volatility = pr->readLong("volatility");
-  pid = pr->readInt("pid");
+void PositionPdx::fromData(PdxReader& pr) {
+  avg20DaysVol = pr.readLong("avg20DaysVol");
+  bondRating = pr.readString("bondRating");
+  convRatio = pr.readDouble("convRatio");
+  country = pr.readString("country");
+  delta = pr.readDouble("delta");
+  industry = pr.readLong("industry");
+  issuer = pr.readLong("issuer");
+  mktValue = pr.readDouble("mktValue");
+  qty = pr.readDouble("qty");
+  secId = pr.readString("secId");
+  secLinks = pr.readString("secLinks");
+  secType = pr.readString("secType");
+  sharesOutstanding = pr.readInt("sharesOutstanding");
+  underlyer = pr.readString("underlyer");
+  volatility = pr.readLong("volatility");
+  pid = pr.readInt("pid");
 }
 std::string PositionPdx::toString() const {
   char buf[1024];
diff --git a/tests/cpp/testobject/PositionPdx.hpp b/tests/cpp/testobject/PositionPdx.hpp
index 0aed075..23d08cf 100644
--- a/tests/cpp/testobject/PositionPdx.hpp
+++ b/tests/cpp/testobject/PositionPdx.hpp
@@ -75,9 +75,9 @@ class TESTOBJECT_EXPORT PositionPdx
   PositionPdx(int32_t iForExactVal);
   virtual ~PositionPdx();
 
-  virtual void toData(std::shared_ptr<PdxWriter> pw) const override;
+  virtual void toData(PdxWriter& pw) const override;
 
-  virtual void fromData(std::shared_ptr<PdxReader> pr) override;
+  virtual void fromData(PdxReader& pr) override;
 
   std::string toString() const override;
 
diff --git a/tests/cpp/testobject/VariousPdxTypes.cpp b/tests/cpp/testobject/VariousPdxTypes.cpp
index 1745e1a..841eb17 100644
--- a/tests/cpp/testobject/VariousPdxTypes.cpp
+++ b/tests/cpp/testobject/VariousPdxTypes.cpp
@@ -76,18 +76,18 @@ std::string PdxTypes1::toString() const {
   return idbuf;
 }
 
-void PdxTypes1::toData(std::shared_ptr<PdxWriter> pw) const {
-  pw->writeInt("i1", m_i1);
-  pw->writeInt("i2", m_i2);
-  pw->writeInt("i3", m_i3);
-  pw->writeInt("i4", m_i4);
+void PdxTypes1::toData(PdxWriter &pw) const {
+  pw.writeInt("i1", m_i1);
+  pw.writeInt("i2", m_i2);
+  pw.writeInt("i3", m_i3);
+  pw.writeInt("i4", m_i4);
 }
 
-void PdxTypes1::fromData(std::shared_ptr<PdxReader> pr) {
-  m_i1 = pr->readInt("i1");
-  m_i2 = pr->readInt("i2");
-  m_i3 = pr->readInt("i3");
-  m_i4 = pr->readInt("i4");
+void PdxTypes1::fromData(PdxReader &pr) {
+  m_i1 = pr.readInt("i1");
+  m_i2 = pr.readInt("i2");
+  m_i3 = pr.readInt("i3");
+  m_i4 = pr.readInt("i4");
 }
 
 /************************************************************
@@ -133,20 +133,20 @@ std::string PdxTypes2::toString() const {
   return idbuf;
  }
 
- void PdxTypes2::toData(std::shared_ptr<PdxWriter> pw) const {
-   pw->writeString("s1", m_s1);
-   pw->writeInt("i1", m_i1);
-   pw->writeInt("i2", m_i2);
-   pw->writeInt("i3", m_i3);
-   pw->writeInt("i4", m_i4);
+ void PdxTypes2::toData(PdxWriter &pw) const {
+   pw.writeString("s1", m_s1);
+   pw.writeInt("i1", m_i1);
+   pw.writeInt("i2", m_i2);
+   pw.writeInt("i3", m_i3);
+   pw.writeInt("i4", m_i4);
 }
 
-void PdxTypes2::fromData(std::shared_ptr<PdxReader> pr) {
-  m_s1 = pr->readString("s1");
-  m_i1 = pr->readInt("i1");
-  m_i2 = pr->readInt("i2");
-  m_i3 = pr->readInt("i3");
-  m_i4 = pr->readInt("i4");
+void PdxTypes2::fromData(PdxReader &pr) {
+  m_s1 = pr.readString("s1");
+  m_i1 = pr.readInt("i1");
+  m_i2 = pr.readInt("i2");
+  m_i3 = pr.readInt("i3");
+  m_i4 = pr.readInt("i4");
 }
 
 /************************************************************
@@ -189,20 +189,20 @@ std::string PdxTypes3::toString() const {
   return idbuf;
 }
 
-void PdxTypes3::toData(std::shared_ptr<PdxWriter> pw) const {
-  pw->writeInt("i1", m_i1);
-  pw->writeInt("i2", m_i2);
-  pw->writeInt("i3", m_i3);
-  pw->writeInt("i4", m_i4);
-  pw->writeString("s1", m_s1);
+void PdxTypes3::toData(PdxWriter &pw) const {
+  pw.writeInt("i1", m_i1);
+  pw.writeInt("i2", m_i2);
+  pw.writeInt("i3", m_i3);
+  pw.writeInt("i4", m_i4);
+  pw.writeString("s1", m_s1);
 }
 
-void PdxTypes3::fromData(std::shared_ptr<PdxReader> pr) {
-  m_i1 = pr->readInt("i1");
-  m_i2 = pr->readInt("i2");
-  m_i3 = pr->readInt("i3");
-  m_i4 = pr->readInt("i4");
-  m_s1 = pr->readString("s1");
+void PdxTypes3::fromData(PdxReader &pr) {
+  m_i1 = pr.readInt("i1");
+  m_i2 = pr.readInt("i2");
+  m_i3 = pr.readInt("i3");
+  m_i4 = pr.readInt("i4");
+  m_s1 = pr.readString("s1");
 }
 
 /************************************************************
@@ -245,20 +245,20 @@ std::string PdxTypes4::toString() const {
   return idbuf;
 }
 
-void PdxTypes4::toData(std::shared_ptr<PdxWriter> pw) const {
-  pw->writeInt("i1", m_i1);
-  pw->writeInt("i2", m_i2);
-  pw->writeString("s1", m_s1);
-  pw->writeInt("i3", m_i3);
-  pw->writeInt("i4", m_i4);
+void PdxTypes4::toData(PdxWriter &pw) const {
+  pw.writeInt("i1", m_i1);
+  pw.writeInt("i2", m_i2);
+  pw.writeString("s1", m_s1);
+  pw.writeInt("i3", m_i3);
+  pw.writeInt("i4", m_i4);
 }
 
-void PdxTypes4::fromData(std::shared_ptr<PdxReader> pr) {
-  m_i1 = pr->readInt("i1");
-  m_i2 = pr->readInt("i2");
-  m_s1 = pr->readString("s1");
-  m_i3 = pr->readInt("i3");
-  m_i4 = pr->readInt("i4");
+void PdxTypes4::fromData(PdxReader &pr) {
+  m_i1 = pr.readInt("i1");
+  m_i2 = pr.readInt("i2");
+  m_s1 = pr.readString("s1");
+  m_i3 = pr.readInt("i3");
+  m_i4 = pr.readInt("i4");
 }
 
 /************************************************************
@@ -304,22 +304,22 @@ std::string PdxTypes5::toString() const {
   return idbuf;
 }
 
-void PdxTypes5::toData(std::shared_ptr<PdxWriter> pw) const {
-  pw->writeString("s1", m_s1);
-  pw->writeString("s2", m_s2);
-  pw->writeInt("i1", m_i1);
-  pw->writeInt("i2", m_i2);
-  pw->writeInt("i3", m_i3);
-  pw->writeInt("i4", m_i4);
+void PdxTypes5::toData(PdxWriter &pw) const {
+  pw.writeString("s1", m_s1);
+  pw.writeString("s2", m_s2);
+  pw.writeInt("i1", m_i1);
+  pw.writeInt("i2", m_i2);
+  pw.writeInt("i3", m_i3);
+  pw.writeInt("i4", m_i4);
 }
 
-void PdxTypes5::fromData(std::shared_ptr<PdxReader> pr) {
-  m_s1 = pr->readString("s1");
-  m_s2 = pr->readString("s2");
-  m_i1 = pr->readInt("i1");
-  m_i2 = pr->readInt("i2");
-  m_i3 = pr->readInt("i3");
-  m_i4 = pr->readInt("i4");
+void PdxTypes5::fromData(PdxReader &pr) {
+  m_s1 = pr.readString("s1");
+  m_s2 = pr.readString("s2");
+  m_i1 = pr.readInt("i1");
+  m_i2 = pr.readInt("i2");
+  m_i3 = pr.readInt("i3");
+  m_i4 = pr.readInt("i4");
 }
 
 /************************************************************
@@ -386,34 +386,34 @@ std::string PdxTypes6::toString() const {
   return idbuf;
 }
 
-void PdxTypes6::toData(std::shared_ptr<PdxWriter> pw) const {
-  pw->writeString("s1", m_s1);
-  pw->writeInt("i1", m_i1);
-  pw->writeByteArray("bytes128", bytes128, 2);
-  pw->writeInt("i2", m_i2);
-  pw->writeInt("i3", m_i3);
-  pw->writeInt("i4", m_i4);
-  pw->writeString("s2", m_s2);
+void PdxTypes6::toData(PdxWriter &pw) const {
+  pw.writeString("s1", m_s1);
+  pw.writeInt("i1", m_i1);
+  pw.writeByteArray("bytes128", bytes128, 2);
+  pw.writeInt("i2", m_i2);
+  pw.writeInt("i3", m_i3);
+  pw.writeInt("i4", m_i4);
+  pw.writeString("s2", m_s2);
 }
 
-void PdxTypes6::fromData(std::shared_ptr<PdxReader> pr) {
-  m_s1 = pr->readString("s1");
+void PdxTypes6::fromData(PdxReader &pr) {
+  m_s1 = pr.readString("s1");
   // LOGDEBUG("PdxTypes6::fromData m_s1 = %s", m_s1);
 
-  m_i1 = pr->readInt("i1");
+  m_i1 = pr.readInt("i1");
   // LOGDEBUG("PdxTypes6::fromData m_i1 = %d", m_i1);
   int32_t byteArrLen = 0;
-  bytes128 = pr->readByteArray("bytes128", byteArrLen);
-  m_i2 = pr->readInt("i2");
+  bytes128 = pr.readByteArray("bytes128", byteArrLen);
+  m_i2 = pr.readInt("i2");
   // LOGDEBUG("PdxTypes6::fromData m_i2 = %d", m_i2);
 
-  m_i3 = pr->readInt("i3");
+  m_i3 = pr.readInt("i3");
   // LOGDEBUG("PdxTypes6::fromData m_i3 = %d", m_i3);
 
-  m_i4 = pr->readInt("i4");
+  m_i4 = pr.readInt("i4");
   // LOGDEBUG("PdxTypes6::fromData m_i4 = %d", m_i4);
 
-  m_s2 = pr->readString("s2");
+  m_s2 = pr.readString("s2");
   // LOGDEBUG("PdxTypes6::fromData m_s2 = %s", m_s2);
 }
 
@@ -463,25 +463,25 @@ std::string PdxTypes7::toString() const {
   return idbuf;
  }
 
- void PdxTypes7::toData(std::shared_ptr<PdxWriter> pw) const {
-   pw->writeInt("i1", m_i1);
-   pw->writeInt("i2", m_i2);
-   pw->writeString("s1", m_s1);
-   pw->writeByteArray("bytes38000", bytes38000, 2);
-   pw->writeInt("i3", m_i3);
-   pw->writeInt("i4", m_i4);
-   pw->writeString("s2", m_s2);
+ void PdxTypes7::toData(PdxWriter &pw) const {
+   pw.writeInt("i1", m_i1);
+   pw.writeInt("i2", m_i2);
+   pw.writeString("s1", m_s1);
+   pw.writeByteArray("bytes38000", bytes38000, 2);
+   pw.writeInt("i3", m_i3);
+   pw.writeInt("i4", m_i4);
+   pw.writeString("s2", m_s2);
  }
 
- void PdxTypes7::fromData(std::shared_ptr<PdxReader> pr) {
-   m_i1 = pr->readInt("i1");
-   m_i2 = pr->readInt("i2");
-   m_s1 = pr->readString("s1");
+ void PdxTypes7::fromData(PdxReader &pr) {
+   m_i1 = pr.readInt("i1");
+   m_i2 = pr.readInt("i2");
+   m_s1 = pr.readString("s1");
    int32_t byteArrLen = 0;
-   bytes38000 = pr->readByteArray("bytes38000", byteArrLen);
-   m_i3 = pr->readInt("i3");
-   m_i4 = pr->readInt("i4");
-   m_s2 = pr->readString("s2");
+   bytes38000 = pr.readByteArray("bytes38000", byteArrLen);
+   m_i3 = pr.readInt("i3");
+   m_i4 = pr.readInt("i4");
+   m_s2 = pr.readString("s2");
 }
 
 /************************************************************
@@ -530,27 +530,27 @@ std::string PdxTypes8::toString() const {
   return idbuf;
  }
 
- void PdxTypes8::toData(std::shared_ptr<PdxWriter> pw) const {
-   pw->writeInt("i1", m_i1);
-   pw->writeInt("i2", m_i2);
-   pw->writeString("s1", m_s1);
-   pw->writeByteArray("bytes300", bytes300, 2);
-   pw->writeObject("_enum", _enum);
-   pw->writeString("s2", m_s2);
-   pw->writeInt("i3", m_i3);
-   pw->writeInt("i4", m_i4);
+ void PdxTypes8::toData(PdxWriter &pw) const {
+   pw.writeInt("i1", m_i1);
+   pw.writeInt("i2", m_i2);
+   pw.writeString("s1", m_s1);
+   pw.writeByteArray("bytes300", bytes300, 2);
+   pw.writeObject("_enum", _enum);
+   pw.writeString("s2", m_s2);
+   pw.writeInt("i3", m_i3);
+   pw.writeInt("i4", m_i4);
  }
 
- void PdxTypes8::fromData(std::shared_ptr<PdxReader> pr) {
-   m_i1 = pr->readInt("i1");
-   m_i2 = pr->readInt("i2");
-   m_s1 = pr->readString("s1");
+ void PdxTypes8::fromData(PdxReader &pr) {
+   m_i1 = pr.readInt("i1");
+   m_i2 = pr.readInt("i2");
+   m_s1 = pr.readString("s1");
    int32_t byteArrLen = 0;
-   bytes300 = pr->readByteArray("bytes300", byteArrLen);
-   _enum = pr->readObject("_enum");
-   m_s2 = pr->readString("s2");
-   m_i3 = pr->readInt("i3");
-   m_i4 = pr->readInt("i4");
+   bytes300 = pr.readByteArray("bytes300", byteArrLen);
+   _enum = pr.readObject("_enum");
+   m_s2 = pr.readString("s2");
+   m_i3 = pr.readInt("i3");
+   m_i4 = pr.readInt("i4");
 }
 
 /************************************************************
@@ -594,23 +594,23 @@ std::string PdxTypes9::toString() const {
   return idbuf;
 }
 
-void PdxTypes9::toData(std::shared_ptr<PdxWriter> pw) const {
-  pw->writeString("s1", m_s1);
-  pw->writeString("s2", m_s2);
-  pw->writeByteArray("bytes66000", m_bytes66000, 2);
-  pw->writeString("s3", m_s3);
-  pw->writeString("s4", m_s4);
-  pw->writeString("s5", m_s5);
+void PdxTypes9::toData(PdxWriter &pw) const {
+  pw.writeString("s1", m_s1);
+  pw.writeString("s2", m_s2);
+  pw.writeByteArray("bytes66000", m_bytes66000, 2);
+  pw.writeString("s3", m_s3);
+  pw.writeString("s4", m_s4);
+  pw.writeString("s5", m_s5);
 }
 
-void PdxTypes9::fromData(std::shared_ptr<PdxReader> pr) {
-  m_s1 = pr->readString("s1");
-  m_s2 = pr->readString("s2");
+void PdxTypes9::fromData(PdxReader &pr) {
+  m_s1 = pr.readString("s1");
+  m_s2 = pr.readString("s2");
   int32_t byteArrLen = 0;
-  m_bytes66000 = pr->readByteArray("bytes66000", byteArrLen);
-  m_s3 = pr->readString("s3");
-  m_s4 = pr->readString("s4");
-  m_s5 = pr->readString("s5");
+  m_bytes66000 = pr.readByteArray("bytes66000", byteArrLen);
+  m_s3 = pr.readString("s3");
+  m_s4 = pr.readString("s4");
+  m_s5 = pr.readString("s5");
 }
 
 /************************************************************
@@ -654,23 +654,23 @@ std::string PdxTypes10::toString() const {
   return idbuf;
 }
 
-void PdxTypes10::toData(std::shared_ptr<PdxWriter> pw) const {
-  pw->writeString("s1", m_s1);
-  pw->writeString("s2", m_s2);
-  pw->writeByteArray("bytes66000", m_bytes66000, 2);
-  pw->writeString("s3", m_s3);
-  pw->writeString("s4", m_s4);
-  pw->writeString("s5", m_s5);
+void PdxTypes10::toData(PdxWriter &pw) const {
+  pw.writeString("s1", m_s1);
+  pw.writeString("s2", m_s2);
+  pw.writeByteArray("bytes66000", m_bytes66000, 2);
+  pw.writeString("s3", m_s3);
+  pw.writeString("s4", m_s4);
+  pw.writeString("s5", m_s5);
 }
 
-void PdxTypes10::fromData(std::shared_ptr<PdxReader> pr) {
-  m_s1 = pr->readString("s1");
-  m_s2 = pr->readString("s2");
+void PdxTypes10::fromData(PdxReader &pr) {
+  m_s1 = pr.readString("s1");
+  m_s2 = pr.readString("s2");
   int32_t byteArrLen = 0;
-  m_bytes66000 = pr->readByteArray("bytes66000", byteArrLen);
-  m_s3 = pr->readString("s3");
-  m_s4 = pr->readString("s4");
-  m_s5 = pr->readString("s5");
+  m_bytes66000 = pr.readByteArray("bytes66000", byteArrLen);
+  m_s3 = pr.readString("s3");
+  m_s4 = pr.readString("s4");
+  m_s5 = pr.readString("s5");
 }
 
 /************************************************************
@@ -730,26 +730,26 @@ std::string NestedPdx::toString() const {
   return idbuf;
 }
 
-void NestedPdx::toData(std::shared_ptr<PdxWriter> pw) const {
-  pw->writeInt("i1", m_i1);
-  pw->writeObject("pd1", m_pd1);
-  pw->writeInt("i2", m_i2);
-  pw->writeString("s1", m_s1);
-  pw->writeString("s2", m_s2);
-  pw->writeObject("pd2", m_pd2);
-  pw->writeInt("i3", m_i3);
-  pw->writeInt("i4", m_i4);
+void NestedPdx::toData(PdxWriter &pw) const {
+  pw.writeInt("i1", m_i1);
+  pw.writeObject("pd1", m_pd1);
+  pw.writeInt("i2", m_i2);
+  pw.writeString("s1", m_s1);
+  pw.writeString("s2", m_s2);
+  pw.writeObject("pd2", m_pd2);
+  pw.writeInt("i3", m_i3);
+  pw.writeInt("i4", m_i4);
 }
 
-void NestedPdx::fromData(std::shared_ptr<PdxReader> pr) {
-  m_i1 = pr->readInt("i1");
-  m_pd1 = std::static_pointer_cast<PdxTypes1>(pr->readObject("pd1"));
-  m_i2 = pr->readInt("i2");
-  m_s1 = pr->readString("s1");
-  m_s2 = pr->readString("s2");
-  m_pd2 = std::static_pointer_cast<PdxTypes2>(pr->readObject("pd2"));
-  m_i3 = pr->readInt("i3");
-  m_i4 = pr->readInt("i4");
+void NestedPdx::fromData(PdxReader &pr) {
+  m_i1 = pr.readInt("i1");
+  m_pd1 = std::static_pointer_cast<PdxTypes1>(pr.readObject("pd1"));
+  m_i2 = pr.readInt("i2");
+  m_s1 = pr.readString("s1");
+  m_s2 = pr.readString("s2");
+  m_pd2 = std::static_pointer_cast<PdxTypes2>(pr.readObject("pd2"));
+  m_i3 = pr.readInt("i3");
+  m_i4 = pr.readInt("i4");
 }
 
 /************************************************************
@@ -811,28 +811,28 @@ std::string MixedVersionNestedPdx::toString() const {
   return idbuf;
 }
 
-void MixedVersionNestedPdx::toData(std::shared_ptr<PdxWriter> pw) const {
-  pw->writeInt("i1", m_i1);
-  pw->writeObject("pd1", m_pd1);
-  pw->writeInt("i2", m_i2);
-  pw->writeString("s1", m_s1);
-  pw->writeString("s2", m_s2);
-  pw->writeString("s3", m_s3);
-  pw->writeObject("pd2", m_pd2);
-  pw->writeInt("i3", m_i3);
-  pw->writeInt("i4", m_i4);
-}
-
-void MixedVersionNestedPdx::fromData(std::shared_ptr<PdxReader> pr) {
-  m_i1 = pr->readInt("i1");
-  m_pd1 = std::static_pointer_cast<PdxTypes1>(pr->readObject("pd1"));
-  m_i2 = pr->readInt("i2");
-  m_s1 = pr->readString("s1");
-  m_s2 = pr->readString("s2");
-  // Mixed version missing: m_s3=pr->readString("m_s3")
-  m_pd2 = std::static_pointer_cast<PdxTypes2>(pr->readObject("pd2"));
-  m_i3 = pr->readInt("i3");
-  m_i4 = pr->readInt("i4");
+void MixedVersionNestedPdx::toData(PdxWriter &pw) const {
+  pw.writeInt("i1", m_i1);
+  pw.writeObject("pd1", m_pd1);
+  pw.writeInt("i2", m_i2);
+  pw.writeString("s1", m_s1);
+  pw.writeString("s2", m_s2);
+  pw.writeString("s3", m_s3);
+  pw.writeObject("pd2", m_pd2);
+  pw.writeInt("i3", m_i3);
+  pw.writeInt("i4", m_i4);
+}
+
+void MixedVersionNestedPdx::fromData(PdxReader &pr) {
+  m_i1 = pr.readInt("i1");
+  m_pd1 = std::static_pointer_cast<PdxTypes1>(pr.readObject("pd1"));
+  m_i2 = pr.readInt("i2");
+  m_s1 = pr.readString("s1");
+  m_s2 = pr.readString("s2");
+  // Mixed version missing: m_s3=pr.readString("m_s3")
+  m_pd2 = std::static_pointer_cast<PdxTypes2>(pr.readObject("pd2"));
+  m_i3 = pr.readInt("i3");
+  m_i4 = pr.readInt("i4");
 }
 
 /************************************************************
diff --git a/tests/cpp/testobject/VariousPdxTypes.hpp b/tests/cpp/testobject/VariousPdxTypes.hpp
index 064e87b..5bb0ad3 100644
--- a/tests/cpp/testobject/VariousPdxTypes.hpp
+++ b/tests/cpp/testobject/VariousPdxTypes.hpp
@@ -62,9 +62,9 @@ class TESTOBJECT_EXPORT PdxTypes1 : public PdxSerializable {
   using PdxSerializable::toData;
   using PdxSerializable::fromData;
 
-  virtual void fromData(std::shared_ptr<PdxReader> pr) override;
+  virtual void fromData(PdxReader& pr) override;
 
-  virtual void toData(std::shared_ptr<PdxWriter> pw) const override;
+  virtual void toData(PdxWriter& pw) const override;
 
   const std::string& getClassName() const override {
     static std::string className = "PdxTests.PdxTypes1";
@@ -100,9 +100,9 @@ class TESTOBJECT_EXPORT PdxTypes2 : public PdxSerializable {
   using PdxSerializable::toData;
   using PdxSerializable::fromData;
 
-  virtual void fromData(std::shared_ptr<PdxReader> pr) override;
+  virtual void fromData(PdxReader& pr) override;
 
-  virtual void toData(std::shared_ptr<PdxWriter> pw) const override;
+  virtual void toData(PdxWriter& pw) const override;
 
   const std::string& getClassName() const override {
     static std::string className = "PdxTests.PdxTypes2";
@@ -138,9 +138,9 @@ class TESTOBJECT_EXPORT PdxTypes3 : public PdxSerializable {
   using PdxSerializable::toData;
   using PdxSerializable::fromData;
 
-  virtual void fromData(std::shared_ptr<PdxReader> pr) override;
+  virtual void fromData(PdxReader& pr) override;
 
-  virtual void toData(std::shared_ptr<PdxWriter> pw) const override;
+  virtual void toData(PdxWriter& pw) const override;
 
   const std::string& getClassName() const override {
     static std::string className = "PdxTests.PdxTypes3";
@@ -175,9 +175,9 @@ class TESTOBJECT_EXPORT PdxTypes4 : public PdxSerializable {
   using PdxSerializable::toData;
   using PdxSerializable::fromData;
 
-  virtual void fromData(std::shared_ptr<PdxReader> pr) override;
+  virtual void fromData(PdxReader& pr) override;
 
-  virtual void toData(std::shared_ptr<PdxWriter> pw) const override;
+  virtual void toData(PdxWriter& pw) const override;
 
   const std::string& getClassName() const override {
     static std::string className = "PdxTests.PdxTypes4";
@@ -213,9 +213,9 @@ class TESTOBJECT_EXPORT PdxTypes5 : public PdxSerializable {
   using PdxSerializable::toData;
   using PdxSerializable::fromData;
 
-  virtual void fromData(std::shared_ptr<PdxReader> pr) override;
+  virtual void fromData(PdxReader& pr) override;
 
-  virtual void toData(std::shared_ptr<PdxWriter> pw) const override;
+  virtual void toData(PdxWriter& pw) const override;
 
   const std::string& getClassName() const override {
     static std::string className = "PdxTests.PdxTypes5";
@@ -252,9 +252,9 @@ class TESTOBJECT_EXPORT PdxTypes6 : public PdxSerializable {
   using PdxSerializable::toData;
   using PdxSerializable::fromData;
 
-  virtual void fromData(std::shared_ptr<PdxReader> pr) override;
+  virtual void fromData(PdxReader& pr) override;
 
-  virtual void toData(std::shared_ptr<PdxWriter> pw) const override;
+  virtual void toData(PdxWriter& pw) const override;
 
   const std::string& getClassName() const override {
     static std::string className = "PdxTests.PdxTypes6";
@@ -291,9 +291,9 @@ class TESTOBJECT_EXPORT PdxTypes7 : public PdxSerializable {
   using PdxSerializable::toData;
   using PdxSerializable::fromData;
 
-  virtual void fromData(std::shared_ptr<PdxReader> pr) override;
+  virtual void fromData(PdxReader& pr) override;
 
-  virtual void toData(std::shared_ptr<PdxWriter> pw) const override;
+  virtual void toData(PdxWriter& pw) const override;
 
   const std::string& getClassName() const override {
     static std::string className = "PdxTests.PdxTypes7";
@@ -332,9 +332,9 @@ class TESTOBJECT_EXPORT PdxTypes8 : public PdxSerializable {
   using PdxSerializable::toData;
   using PdxSerializable::fromData;
 
-  virtual void fromData(std::shared_ptr<PdxReader> pr) override;
+  virtual void fromData(PdxReader& pr) override;
 
-  virtual void toData(std::shared_ptr<PdxWriter> pw) const override;
+  virtual void toData(PdxWriter& pw) const override;
 
   const std::string& getClassName() const override {
     static std::string className = "PdxTests.PdxTypes8";
@@ -370,9 +370,9 @@ class TESTOBJECT_EXPORT PdxTypes9 : public PdxSerializable {
   using PdxSerializable::toData;
   using PdxSerializable::fromData;
 
-  virtual void fromData(std::shared_ptr<PdxReader> pr) override;
+  virtual void fromData(PdxReader& pr) override;
 
-  virtual void toData(std::shared_ptr<PdxWriter> pw) const override;
+  virtual void toData(PdxWriter& pw) const override;
 
   const std::string& getClassName() const override {
     static std::string className = "PdxTests.PdxTypes9";
@@ -409,9 +409,9 @@ class TESTOBJECT_EXPORT PdxTypes10 : public PdxSerializable {
   using PdxSerializable::toData;
   using PdxSerializable::fromData;
 
-  virtual void fromData(std::shared_ptr<PdxReader> pr) override;
+  virtual void fromData(PdxReader& pr) override;
 
-  virtual void toData(std::shared_ptr<PdxWriter> pw) const override;
+  virtual void toData(PdxWriter& pw) const override;
 
   const std::string& getClassName() const override {
     static std::string className = "PdxTests.PdxTypes10";
@@ -451,9 +451,9 @@ class TESTOBJECT_EXPORT NestedPdx : public PdxSerializable {
   using PdxSerializable::toData;
   using PdxSerializable::fromData;
 
-  virtual void fromData(std::shared_ptr<PdxReader> pr) override;
+  virtual void fromData(PdxReader& pr) override;
 
-  virtual void toData(std::shared_ptr<PdxWriter> pw) const override;
+  virtual void toData(PdxWriter& pw) const override;
 
   const std::string& getClassName() const override {
     static std::string className = "PdxTests.NestedPdx";
@@ -496,9 +496,9 @@ class TESTOBJECT_EXPORT MixedVersionNestedPdx : public PdxSerializable {
   using PdxSerializable::toData;
   using PdxSerializable::fromData;
 
-  virtual void fromData(std::shared_ptr<PdxReader> pr) override;
+  virtual void fromData(PdxReader& pr) override;
 
-  virtual void toData(std::shared_ptr<PdxWriter> pw) const override;
+  virtual void toData(PdxWriter& pw) const override;
 
   const std::string& getClassName() const override {
     static std::string className = "PdxTests.MixedVersionNestedPdx";

-- 
To stop receiving notification emails like this one, please contact
['"commits@geode.apache.org" <commits@geode.apache.org>'].

Mime
View raw message