geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbarr...@apache.org
Subject [01/46] geode-native git commit: GEODE-2741: Remove custom shared pointer from cppcache
Date Wed, 17 May 2017 17:49:43 GMT
Repository: geode-native
Updated Branches:
  refs/heads/develop e2630b160 -> 767033e5c


http://git-wip-us.apache.org/repos/asf/geode-native/blob/c0098121/src/tests/cpp/testobject/BatchObject.hpp
----------------------------------------------------------------------
diff --git a/src/tests/cpp/testobject/BatchObject.hpp b/src/tests/cpp/testobject/BatchObject.hpp
index 3a46669..fb65401 100644
--- a/src/tests/cpp/testobject/BatchObject.hpp
+++ b/src/tests/cpp/testobject/BatchObject.hpp
@@ -54,11 +54,11 @@ class TESTOBJECT_EXPORT BatchObject : public TimestampedObject {
   CacheableBytesPtr byteArray;
 
   inline uint32_t getObjectSize(const SerializablePtr& obj) const {
-    return (obj == NULLPTR ? 0 : obj->objectSize());
+    return (obj == nullptr ? 0 : obj->objectSize());
   }
 
  public:
-  BatchObject() : index(0), timestamp(0), batch(0), byteArray(NULLPTR) {}
+  BatchObject() : index(0), timestamp(0), batch(0), byteArray(nullptr) {}
   BatchObject(int32_t anIndex, int32_t batchSize, int32_t size);
   virtual ~BatchObject();
   virtual void toData(apache::geode::client::DataOutput& output) const;

http://git-wip-us.apache.org/repos/asf/geode-native/blob/c0098121/src/tests/cpp/testobject/DeltaFastAssetAccount.cpp
----------------------------------------------------------------------
diff --git a/src/tests/cpp/testobject/DeltaFastAssetAccount.cpp b/src/tests/cpp/testobject/DeltaFastAssetAccount.cpp
index 67d136e..0401537 100644
--- a/src/tests/cpp/testobject/DeltaFastAssetAccount.cpp
+++ b/src/tests/cpp/testobject/DeltaFastAssetAccount.cpp
@@ -28,7 +28,7 @@ DeltaFastAssetAccount::DeltaFastAssetAccount(int index, bool encodeTimestp,
   netWorth = 0.0;
   assets = CacheableHashMap::create();
   for (int i = 0; i < asstSize; i++) {
-    FastAssetPtr asset(new FastAsset(i, maxVal));
+    auto asset = std::make_shared<FastAsset>(i, maxVal);
     assets->insert(CacheableInt32::create(i), asset);
     netWorth += asset->getValue();
   }

http://git-wip-us.apache.org/repos/asf/geode-native/blob/c0098121/src/tests/cpp/testobject/DeltaFastAssetAccount.hpp
----------------------------------------------------------------------
diff --git a/src/tests/cpp/testobject/DeltaFastAssetAccount.hpp b/src/tests/cpp/testobject/DeltaFastAssetAccount.hpp
index b8c420c..2037530 100644
--- a/src/tests/cpp/testobject/DeltaFastAssetAccount.hpp
+++ b/src/tests/cpp/testobject/DeltaFastAssetAccount.hpp
@@ -59,16 +59,16 @@ class TESTOBJECT_EXPORT DeltaFastAssetAccount : public Cacheable, public Delta {
   bool getBeforeUpdate;
 
   inline uint32_t getObjectSize(const SerializablePtr& obj) const {
-    return (obj == NULLPTR ? 0 : obj->objectSize());
+    return (obj == nullptr ? 0 : obj->objectSize());
   }
 
  public:
   DeltaFastAssetAccount()
       : encodeTimestamp(0),
         acctId(0),
-        customerName(NULLPTR),
+        customerName(nullptr),
         netWorth(0.0),
-        assets(NULLPTR),
+        assets(nullptr),
         timestamp(0),
         getBeforeUpdate(false) {}
   DeltaFastAssetAccount(int index, bool encodeTimestp, int maxVal,
@@ -134,12 +134,12 @@ class TESTOBJECT_EXPORT DeltaFastAssetAccount : public Cacheable, public Delta {
   }
 
   virtual DeltaPtr clone() {
-    DeltaFastAssetAccountPtr clonePtr(new DeltaFastAssetAccount());
+    auto clonePtr = std::make_shared<DeltaFastAssetAccount>();
     clonePtr->assets = CacheableHashMap::create();
     for (HashMapOfCacheable::Iterator item = this->assets->begin();
          item != this->assets->end(); item++) {
-      CacheableInt32Ptr key = dynCast<CacheableInt32Ptr>(item.first());
-      FastAssetPtr asset = dynCast<FastAssetPtr>(item.second());
+      auto key = std::dynamic_pointer_cast<CacheableInt32>(item.first());
+      auto asset = std::dynamic_pointer_cast<FastAsset>(item.second());
       clonePtr->assets->insert(key, asset->copy());
     }
     return clonePtr;

http://git-wip-us.apache.org/repos/asf/geode-native/blob/c0098121/src/tests/cpp/testobject/DeltaPSTObject.cpp
----------------------------------------------------------------------
diff --git a/src/tests/cpp/testobject/DeltaPSTObject.cpp b/src/tests/cpp/testobject/DeltaPSTObject.cpp
index 2b4b42a..4f3dfdc 100644
--- a/src/tests/cpp/testobject/DeltaPSTObject.cpp
+++ b/src/tests/cpp/testobject/DeltaPSTObject.cpp
@@ -31,7 +31,7 @@ DeltaPSTObject::DeltaPSTObject(int size, bool encodeKey, bool encodeTimestamp) {
   field1 = 1234;
   field2 = '*';
   if (size == 0) {
-    valueData = NULLPTR;
+    valueData = nullptr;
   } else {
     encodeKey = true;
     valueData = ArrayOfByte::init(size, encodeKey, false);

http://git-wip-us.apache.org/repos/asf/geode-native/blob/c0098121/src/tests/cpp/testobject/DeltaPSTObject.hpp
----------------------------------------------------------------------
diff --git a/src/tests/cpp/testobject/DeltaPSTObject.hpp b/src/tests/cpp/testobject/DeltaPSTObject.hpp
index e19b791..1e742ee 100644
--- a/src/tests/cpp/testobject/DeltaPSTObject.hpp
+++ b/src/tests/cpp/testobject/DeltaPSTObject.hpp
@@ -53,9 +53,13 @@ class TESTOBJECT_EXPORT DeltaPSTObject : public Cacheable, public Delta {
   int32_t field1;
   int8_t field2;
   CacheableBytesPtr valueData;
+  std::shared_ptr<DeltaPSTObject> shared_from_this() {
+    return std::static_pointer_cast<DeltaPSTObject>(
+        Serializable::shared_from_this());
+  }
 
  public:
-  DeltaPSTObject() : timestamp(0), valueData(NULLPTR) {}
+  DeltaPSTObject() : timestamp(0), valueData(nullptr) {}
   DeltaPSTObject(int size, bool encodeKey, bool encodeTimestamp);
   virtual ~DeltaPSTObject() {}
   void toData(apache::geode::client::DataOutput& output) const;
@@ -86,8 +90,8 @@ class TESTOBJECT_EXPORT DeltaPSTObject : public Cacheable, public Delta {
     timestamp = tusec * 1000;
   }
   DeltaPtr clone() {
-    DeltaPtr clonePtr(this);
-    return clonePtr;
+    // TODO shared_ptr - this isn't actually cloning.
+    return shared_from_this();
   }
 
   static Serializable* createDeserializable() { return new DeltaPSTObject(); }

http://git-wip-us.apache.org/repos/asf/geode-native/blob/c0098121/src/tests/cpp/testobject/DeltaTestImpl.cpp
----------------------------------------------------------------------
diff --git a/src/tests/cpp/testobject/DeltaTestImpl.cpp b/src/tests/cpp/testobject/DeltaTestImpl.cpp
index a9d2f9d..43ddd7c 100644
--- a/src/tests/cpp/testobject/DeltaTestImpl.cpp
+++ b/src/tests/cpp/testobject/DeltaTestImpl.cpp
@@ -37,7 +37,7 @@ DeltaTestImpl::DeltaTestImpl() {
   doubleVar = 1.1;
   uint8_t byte = 'A';
   byteArr = CacheableBytes::create(&byte, 1);
-  testObj = NULLPTR;
+  testObj = nullptr;
   m_hasDelta = false;
   deltaBits = 0;
   toDeltaCounter = 0;
@@ -53,12 +53,12 @@ DeltaTestImpl::DeltaTestImpl(DeltaTestImplPtr rhs) {
   intVar = rhs->intVar;
   str = CacheableString::create(rhs->str->asChar());
   doubleVar = rhs->doubleVar;
-  byteArr = (rhs->byteArr == NULLPTR ? NULLPTR : CacheableBytes::create(
+  byteArr = (rhs->byteArr == nullptr ? nullptr : CacheableBytes::create(
                                                      rhs->byteArr->value(),
                                                      rhs->byteArr->length()));
-  testObj = (rhs->testObj == NULLPTR
-                 ? NULLPTR
-                 : TestObject1Ptr(new TestObject1(*(rhs->testObj.ptr()))));
+  testObj = (rhs->testObj == nullptr
+                 ? nullptr
+                 : TestObject1Ptr(new TestObject1(*(rhs->testObj.get()))));
   toDeltaCounter = rhs->getToDeltaCounter();
   fromDeltaCounter = rhs->getFromDeltaCounter();
 }

http://git-wip-us.apache.org/repos/asf/geode-native/blob/c0098121/src/tests/cpp/testobject/DeltaTestImpl.hpp
----------------------------------------------------------------------
diff --git a/src/tests/cpp/testobject/DeltaTestImpl.hpp b/src/tests/cpp/testobject/DeltaTestImpl.hpp
index b71a00c..a8b4f29 100644
--- a/src/tests/cpp/testobject/DeltaTestImpl.hpp
+++ b/src/tests/cpp/testobject/DeltaTestImpl.hpp
@@ -86,9 +86,8 @@ class TESTOBJECT_EXPORT DeltaTestImpl : public Cacheable, public Delta {
   uint32_t objectSize() const { return 0; }
 
   DeltaPtr clone() {
-    DeltaPtr clonePtr(this);
-    return clonePtr;
-    // return DeltaPtr( this );
+    return DeltaPtr(
+        std::dynamic_pointer_cast<DeltaTestImpl>(shared_from_this()));
   }
 
   static Serializable* create() { return new DeltaTestImpl(); }

http://git-wip-us.apache.org/repos/asf/geode-native/blob/c0098121/src/tests/cpp/testobject/EqStruct.hpp
----------------------------------------------------------------------
diff --git a/src/tests/cpp/testobject/EqStruct.hpp b/src/tests/cpp/testobject/EqStruct.hpp
index 999f4c4..c7ef273 100644
--- a/src/tests/cpp/testobject/EqStruct.hpp
+++ b/src/tests/cpp/testobject/EqStruct.hpp
@@ -100,7 +100,7 @@ class TESTOBJECT_EXPORT EqStruct : public TimestampedObject {
   char* var9;
 
   inline uint32_t getObjectSize(const SerializablePtr& obj) const {
-    return (obj == NULLPTR ? 0 : obj->objectSize());
+    return (obj == nullptr ? 0 : obj->objectSize());
   }
 
  public:

http://git-wip-us.apache.org/repos/asf/geode-native/blob/c0098121/src/tests/cpp/testobject/FastAsset.hpp
----------------------------------------------------------------------
diff --git a/src/tests/cpp/testobject/FastAsset.hpp b/src/tests/cpp/testobject/FastAsset.hpp
index e20737c..0b929b4 100644
--- a/src/tests/cpp/testobject/FastAsset.hpp
+++ b/src/tests/cpp/testobject/FastAsset.hpp
@@ -55,7 +55,7 @@ class TESTOBJECT_EXPORT FastAsset : public TimestampedObject {
   double value;
 
   inline uint32_t getObjectSize(const SerializablePtr& obj) const {
-    return (obj == NULLPTR ? 0 : obj->objectSize());
+    return (obj == nullptr ? 0 : obj->objectSize());
   }
 
  public:
@@ -92,7 +92,7 @@ class TESTOBJECT_EXPORT FastAsset : public TimestampedObject {
    * Makes a copy of this asset.
    */
   FastAssetPtr copy() {
-    FastAssetPtr asset(new FastAsset());
+    auto asset = std::make_shared<FastAsset>();
     asset->setAssetId(getAssetId());
     asset->setValue(getValue());
     return asset;

http://git-wip-us.apache.org/repos/asf/geode-native/blob/c0098121/src/tests/cpp/testobject/FastAssetAccount.cpp
----------------------------------------------------------------------
diff --git a/src/tests/cpp/testobject/FastAssetAccount.cpp b/src/tests/cpp/testobject/FastAssetAccount.cpp
index 8d1040e..58b7d40 100644
--- a/src/tests/cpp/testobject/FastAssetAccount.cpp
+++ b/src/tests/cpp/testobject/FastAssetAccount.cpp
@@ -30,7 +30,7 @@ FastAssetAccount::FastAssetAccount(int idx, bool encodeTimestp, int maxVal,
   netWorth = 0.0;
   assets = CacheableHashMap::create();
   for (int i = 0; i < asstSize; i++) {
-    FastAssetPtr asset(new FastAsset(i, maxVal));
+    auto asset = std::make_shared<FastAsset>(i, maxVal);
     assets->insert(CacheableInt32::create(i), asset);
     netWorth += asset->getValue();
   }

http://git-wip-us.apache.org/repos/asf/geode-native/blob/c0098121/src/tests/cpp/testobject/FastAssetAccount.hpp
----------------------------------------------------------------------
diff --git a/src/tests/cpp/testobject/FastAssetAccount.hpp b/src/tests/cpp/testobject/FastAssetAccount.hpp
index 6fe7982..1127341 100644
--- a/src/tests/cpp/testobject/FastAssetAccount.hpp
+++ b/src/tests/cpp/testobject/FastAssetAccount.hpp
@@ -56,16 +56,16 @@ class TESTOBJECT_EXPORT FastAssetAccount : public TimestampedObject {
   uint64_t timestamp;
 
   inline uint32_t getObjectSize(const SerializablePtr& obj) const {
-    return (obj == NULLPTR ? 0 : obj->objectSize());
+    return (obj == nullptr ? 0 : obj->objectSize());
   }
 
  public:
   FastAssetAccount()
       : encodeTimestamp(0),
         acctId(0),
-        customerName(NULLPTR),
+        customerName(nullptr),
         netWorth(0.0),
-        assets(NULLPTR),
+        assets(nullptr),
         timestamp(0) {}
   FastAssetAccount(int index, bool encodeTimestp, int maxVal, int asstSize = 0);
   virtual ~FastAssetAccount();

http://git-wip-us.apache.org/repos/asf/geode-native/blob/c0098121/src/tests/cpp/testobject/InvalidPdxUsage.cpp
----------------------------------------------------------------------
diff --git a/src/tests/cpp/testobject/InvalidPdxUsage.cpp b/src/tests/cpp/testobject/InvalidPdxUsage.cpp
index a8e4a84..7ebf332 100644
--- a/src/tests/cpp/testobject/InvalidPdxUsage.cpp
+++ b/src/tests/cpp/testobject/InvalidPdxUsage.cpp
@@ -523,42 +523,45 @@ void InvalidPdxUsage::fromData(PdxReaderPtr pr) {
   }
 
   try {
-    m_arraylist = pr->readObject("");
+    m_arraylist =
+        std::dynamic_pointer_cast<CacheableArrayList>(pr->readObject(""));
   } catch (IllegalStateException& excpt) {
     exceptionCounter++;
     LOGINFO("readObject():: Got expected Exception :: %s ", excpt.getMessage());
   }
 
   try {
-    m_map = dynCast<CacheableHashMapPtr>(pr->readObject(""));
+    m_map = std::dynamic_pointer_cast<CacheableHashMap>(pr->readObject(""));
   } catch (IllegalStateException& excpt) {
     exceptionCounter++;
     LOGINFO("readObject():: Got expected Exception :: %s ", excpt.getMessage());
   }
 
   try {
-    m_hashtable = pr->readObject("");
+    m_hashtable =
+        std::dynamic_pointer_cast<CacheableHashTable>(pr->readObject(""));
   } catch (IllegalStateException& excpt) {
     exceptionCounter++;
     LOGINFO("readObject():: Got expected Exception :: %s ", excpt.getMessage());
   }
 
   try {
-    m_vector = pr->readObject("");
+    m_vector = std::dynamic_pointer_cast<CacheableVector>(pr->readObject(""));
   } catch (IllegalStateException& excpt) {
     exceptionCounter++;
     LOGINFO("readObject():: Got expected Exception :: %s ", excpt.getMessage());
   }
 
   try {
-    m_chs = pr->readObject("");
+    m_chs = std::dynamic_pointer_cast<CacheableHashSet>(pr->readObject(""));
   } catch (IllegalStateException& excpt) {
     exceptionCounter++;
     LOGINFO("readObject():: Got expected Exception :: %s ", excpt.getMessage());
   }
 
   try {
-    m_clhs = pr->readObject("");
+    m_clhs =
+        std::dynamic_pointer_cast<CacheableLinkedHashSet>(pr->readObject(""));
   } catch (IllegalStateException& excpt) {
     exceptionCounter++;
     LOGINFO("readObject():: Got expected Exception :: %s ", excpt.getMessage());
@@ -572,7 +575,7 @@ void InvalidPdxUsage::fromData(PdxReaderPtr pr) {
   }
 
   try {
-    m_date = pr->readDate("");
+    m_date = std::dynamic_pointer_cast<CacheableDate>(pr->readDate(""));
   } catch (IllegalStateException& excpt) {
     exceptionCounter++;
     LOGINFO("readDate():: Got expected Exception :: %s ", excpt.getMessage());
@@ -752,7 +755,7 @@ void InvalidPdxUsage::fromData(PdxReaderPtr pr) {
   }
 
   try {
-    m_pdxEnum = pr->readObject("");
+    m_pdxEnum = std::static_pointer_cast<CacheableEnum>(pr->readObject(""));
   } catch (IllegalStateException& excpt) {
     exceptionCounter++;
     LOGINFO("readObject():: Got expected Exception :: %s ", excpt.getMessage());
@@ -841,16 +844,16 @@ bool InvalidPdxUsage::equals(PdxTests::InvalidPdxUsage& other,
     for (int i = 0; i < m_objectArray->size(); i++) {
       AddressWithInvalidAPIUsage* otherAddr1 =
           dynamic_cast<AddressWithInvalidAPIUsage*>(
-              ot->m_objectArray->at(i).ptr());
+              ot->m_objectArray->at(i).get());
       AddressWithInvalidAPIUsage* myAddr1 =
-          dynamic_cast<AddressWithInvalidAPIUsage*>(m_objectArray->at(i).ptr());
+          dynamic_cast<AddressWithInvalidAPIUsage*>(m_objectArray->at(i).get());
       if (!otherAddr1->equals(*myAddr1)) return false;
     }
     LOGINFO("PdxObject::equals isPdxReadSerialized = %d", isPdxReadSerialized);
   }
 
-  CacheableEnumPtr myenum = dynCast<CacheableEnumPtr>(m_pdxEnum);
-  CacheableEnumPtr otenum = dynCast<CacheableEnumPtr>(ot->m_pdxEnum);
+  auto myenum = m_pdxEnum;
+  auto otenum = ot->m_pdxEnum;
   if (myenum->getEnumOrdinal() != otenum->getEnumOrdinal()) return false;
   if (strcmp(myenum->getEnumClassName(), otenum->getEnumClassName()) != 0) {
     return false;

http://git-wip-us.apache.org/repos/asf/geode-native/blob/c0098121/src/tests/cpp/testobject/InvalidPdxUsage.hpp
----------------------------------------------------------------------
diff --git a/src/tests/cpp/testobject/InvalidPdxUsage.hpp b/src/tests/cpp/testobject/InvalidPdxUsage.hpp
index d5a613b..f4301a6 100644
--- a/src/tests/cpp/testobject/InvalidPdxUsage.hpp
+++ b/src/tests/cpp/testobject/InvalidPdxUsage.hpp
@@ -280,7 +280,7 @@ class TESTOBJECT_EXPORT InvalidPdxUsage : public PdxSerializable {
   int8_t* m_byte253;
   int8_t* m_byte65535;
   int8_t* m_byte65536;
-  CacheablePtr m_pdxEnum;
+  CacheableEnumPtr m_pdxEnum;
   CacheableObjectArrayPtr m_objectArray;
 
   int32_t boolArrayLen;
@@ -454,19 +454,19 @@ class TESTOBJECT_EXPORT InvalidPdxUsage : public PdxSerializable {
       keys.push_back(CacheableKey::create(key));
     }*/
 
-    m_objectArray = NULLPTR;
+    m_objectArray = nullptr;
     /*AddressWithInvalidAPIUsagePtr objectArray[3];
     objectArray[0] = new AddressWithInvalidAPIUsage(1, "strt-1", "city-1");
     objectArray[1] = new AddressWithInvalidAPIUsage(2, "strt-2", "city-2");
     objectArray[2] = new AddressWithInvalidAPIUsage(3, "strt-3", "city-3");*/
 
     /*
-    AddressWithInvalidAPIUsagePtr addObj1(new AddressWithInvalidAPIUsage(1,
-    "abc", "ABC"));
-    AddressWithInvalidAPIUsagePtr addObj2(new AddressWithInvalidAPIUsage(2,
-    "def", "DEF"));
-    AddressWithInvalidAPIUsagePtr addObj3(new AddressWithInvalidAPIUsage(3,
-    "ghi", "GHI"));*/
+    auto addObj1 = std::make_shared<AddressWithInvalidAPIUsage>(1,
+    "abc", "ABC");
+    auto addObj2 = std::make_shared<AddressWithInvalidAPIUsage>(2,
+    "def", "DEF");
+    auto addObj3 = std::make_shared<AddressWithInvalidAPIUsage>(3,
+    "ghi", "GHI");*/
 
     m_objectArray = CacheableObjectArray::create();
     m_objectArray->push_back(AddressWithInvalidAPIUsagePtr(

http://git-wip-us.apache.org/repos/asf/geode-native/blob/c0098121/src/tests/cpp/testobject/NestedPdxObject.cpp
----------------------------------------------------------------------
diff --git a/src/tests/cpp/testobject/NestedPdxObject.cpp b/src/tests/cpp/testobject/NestedPdxObject.cpp
index 17a6356..660f13e 100644
--- a/src/tests/cpp/testobject/NestedPdxObject.cpp
+++ b/src/tests/cpp/testobject/NestedPdxObject.cpp
@@ -42,7 +42,7 @@ void ChildPdx::fromData(PdxReaderPtr pr) {
 
   m_childId = pr->readInt("m_childId");
   LOGINFO("ChildPdx::fromData() m_childId = %d ", m_childId);
-  m_enum = pr->readObject("m_enum");
+  m_enum = std::static_pointer_cast<CacheableEnum>(pr->readObject("m_enum"));
   m_childName = pr->readString("m_childName");
 
   LOGINFO("ChildPdx::fromData() end...");
@@ -91,7 +91,7 @@ void ParentPdx::toData(PdxWriterPtr pw) {
   LOGDEBUG("ParentPdx::toData() m_wideparentName......");
   pw->writeWideStringArray("m_wideparentArrayName", m_wideparentArrayName, 3);
   LOGDEBUG("ParentPdx::toData() m_wideparentArrayName......");
-  pw->writeObject("m_childPdx", (ChildPdxPtr)m_childPdx);
+  pw->writeObject("m_childPdx", m_childPdx);
   LOGDEBUG("ParentPdx::toData() m_childPdx......");
   pw->markIdentityField("m_childPdx");
 
@@ -108,7 +108,7 @@ void ParentPdx::fromData(PdxReaderPtr pr) {
 
   m_parentId = pr->readInt("m_parentId");
   LOGINFO("ParentPdx::fromData() m_parentId = %d ", m_parentId);
-  m_enum = 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");
   LOGINFO("ParentPdx::fromData() m_parentName = %s ", m_parentName);
@@ -121,7 +121,7 @@ void ParentPdx::fromData(PdxReaderPtr pr) {
             m_wideparentArrayName[i]);
   }
   LOGINFO("ParentPdx::fromData() m_wideparentArrayName done ");
-  m_childPdx = /*dynCast<SerializablePtr>*/ (pr->readObject("m_childPdx"));
+  m_childPdx = /*std::dynamic_pointer_cast<Serializable>*/ (pr->readObject("m_childPdx"));
   LOGINFO("ParentPdx::fromData() start3...");
 
   m_char = pr->readChar("m_char");
@@ -185,8 +185,8 @@ bool ParentPdx::equals(ParentPdx& other, bool isPdxReadSerialized) const {
     }
 
     if (!isPdxReadSerialized) {
-      ChildPdx* ch1 = dynamic_cast<ChildPdx*>(m_childPdx.ptr());
-      ChildPdx* ch2 = dynamic_cast<ChildPdx*>(other.m_childPdx.ptr());
+      ChildPdx* ch1 = dynamic_cast<ChildPdx*>(m_childPdx.get());
+      ChildPdx* ch2 = dynamic_cast<ChildPdx*>(other.m_childPdx.get());
 
       if (ch1->equals(*ch2)) {
         LOGINFO("ParentPdx::equals3");

http://git-wip-us.apache.org/repos/asf/geode-native/blob/c0098121/src/tests/cpp/testobject/NestedPdxObject.hpp
----------------------------------------------------------------------
diff --git a/src/tests/cpp/testobject/NestedPdxObject.hpp b/src/tests/cpp/testobject/NestedPdxObject.hpp
index 2e792c1..2ab02ca 100644
--- a/src/tests/cpp/testobject/NestedPdxObject.hpp
+++ b/src/tests/cpp/testobject/NestedPdxObject.hpp
@@ -120,7 +120,7 @@ class TESTOBJECT_EXPORT ParentPdx : public PdxSerializable {
     size_t strSize = strlen(buf) + 1;
     m_parentName = new char[strSize];
     memcpy(m_parentName, buf, strSize);
-    m_childPdx = new ChildPdx(id /** 1393*/);
+    m_childPdx = std::make_shared<ChildPdx>(id /** 1393*/);
     LOGDEBUG("parentPdx buf is %s ", buf);
     m_enum = CacheableEnum::create("Gender", "male", 6);
     m_wideparentName = L"Wide Parent name";
@@ -168,7 +168,9 @@ class TESTOBJECT_EXPORT ParentPdx : public PdxSerializable {
 
   wchar_t** getWideParentArrayName() { return m_wideparentArrayName; }
 
-  ChildPdxPtr getChildPdx() { return m_childPdx; }
+  ChildPdxPtr getChildPdx() {
+    return std::static_pointer_cast<ChildPdx>(m_childPdx);
+  }
 
   CacheableEnumPtr getEnum() { return m_enum; }
 
@@ -251,7 +253,8 @@ class TESTOBJECT_EXPORT PdxEnumTestClass : public PdxSerializable {
 
   void fromData(PdxReaderPtr pr) {
     m_id = pr->readInt("m_id");
-    m_enumid = pr->readObject("m_enumid");
+    m_enumid =
+        std::static_pointer_cast<CacheableEnum>(pr->readObject("m_enumid"));
   }
 
   CacheableStringPtr toString() const {

http://git-wip-us.apache.org/repos/asf/geode-native/blob/c0098121/src/tests/cpp/testobject/NonPdxType.cpp
----------------------------------------------------------------------
diff --git a/src/tests/cpp/testobject/NonPdxType.cpp b/src/tests/cpp/testobject/NonPdxType.cpp
index ed124ab..b77bdd2 100644
--- a/src/tests/cpp/testobject/NonPdxType.cpp
+++ b/src/tests/cpp/testobject/NonPdxType.cpp
@@ -112,18 +112,20 @@ bool PdxTests::NonPdxType::equals(PdxTests::NonPdxType& other,
 
   if (!isPdxReadSerialized) {
     for (int i = 0; i < m_objectArray->size(); i++) {
-      PdxWrapperPtr wrapper1 = dynCast<PdxWrapperPtr>(ot->m_objectArray->at(i));
+      auto wrapper1 =
+          std::dynamic_pointer_cast<PdxWrapper>(ot->m_objectArray->at(i));
       NonPdxAddress* otherAddr1 =
           reinterpret_cast<NonPdxAddress*>(wrapper1->getObject());
-      PdxWrapperPtr wrapper2 = dynCast<PdxWrapperPtr>(m_objectArray->at(i));
+      auto wrapper2 =
+          std::dynamic_pointer_cast<PdxWrapper>(m_objectArray->at(i));
       NonPdxAddress* myAddr1 =
           reinterpret_cast<NonPdxAddress*>(wrapper2->getObject());
       if (!otherAddr1->equals(*myAddr1)) return false;
     }
   }
 
-  CacheableEnumPtr myenum = dynCast<CacheableEnumPtr>(m_pdxEnum);
-  CacheableEnumPtr otenum = dynCast<CacheableEnumPtr>(ot->m_pdxEnum);
+  auto myenum = std::dynamic_pointer_cast<CacheableEnum>(m_pdxEnum);
+  auto otenum = std::dynamic_pointer_cast<CacheableEnum>(ot->m_pdxEnum);
   if (myenum->getEnumOrdinal() != otenum->getEnumOrdinal()) return false;
   if (strcmp(myenum->getEnumClassName(), otenum->getEnumClassName()) != 0) {
     return false;

http://git-wip-us.apache.org/repos/asf/geode-native/blob/c0098121/src/tests/cpp/testobject/NonPdxType.hpp
----------------------------------------------------------------------
diff --git a/src/tests/cpp/testobject/NonPdxType.hpp b/src/tests/cpp/testobject/NonPdxType.hpp
index 2ee0791..7b43ea5 100644
--- a/src/tests/cpp/testobject/NonPdxType.hpp
+++ b/src/tests/cpp/testobject/NonPdxType.hpp
@@ -446,7 +446,9 @@ class TESTOBJECT_EXPORT NonPdxType {
 
   CacheableObjectArrayPtr getCacheableObjectArray() { return m_objectArray; }
 
-  CacheableEnumPtr getEnum() { return m_pdxEnum; }
+  CacheableEnumPtr getEnum() {
+    return std::static_pointer_cast<CacheableEnum>(m_pdxEnum);
+  }
 
   int32_t getByteArrayLength() { return byteArrayLen; }
 

http://git-wip-us.apache.org/repos/asf/geode-native/blob/c0098121/src/tests/cpp/testobject/PSTObject.cpp
----------------------------------------------------------------------
diff --git a/src/tests/cpp/testobject/PSTObject.cpp b/src/tests/cpp/testobject/PSTObject.cpp
index 76189c5..a9299cc 100644
--- a/src/tests/cpp/testobject/PSTObject.cpp
+++ b/src/tests/cpp/testobject/PSTObject.cpp
@@ -31,7 +31,7 @@ PSTObject::PSTObject(int size, bool encodeKey, bool encodeTimestamp) {
   field1 = 1234;
   field2 = '*';
   if (size == 0) {
-    valueData = NULLPTR;
+    valueData = nullptr;
   } else {
     encodeKey = true;
     valueData = ArrayOfByte::init(size, encodeKey, false);

http://git-wip-us.apache.org/repos/asf/geode-native/blob/c0098121/src/tests/cpp/testobject/PSTObject.hpp
----------------------------------------------------------------------
diff --git a/src/tests/cpp/testobject/PSTObject.hpp b/src/tests/cpp/testobject/PSTObject.hpp
index 147e4d7..cdeac83 100644
--- a/src/tests/cpp/testobject/PSTObject.hpp
+++ b/src/tests/cpp/testobject/PSTObject.hpp
@@ -54,11 +54,11 @@ class TESTOBJECT_EXPORT PSTObject : public TimestampedObject {
   CacheableBytesPtr valueData;
 
   inline uint32_t getObjectSize(const SerializablePtr& obj) const {
-    return (obj == NULLPTR ? 0 : obj->objectSize());
+    return (obj == nullptr ? 0 : obj->objectSize());
   }
 
  public:
-  PSTObject() : timestamp(0), valueData(NULLPTR) {}
+  PSTObject() : timestamp(0), valueData(nullptr) {}
   PSTObject(int size, bool encodeKey, bool encodeTimestamp);
   virtual ~PSTObject();
   virtual void toData(apache::geode::client::DataOutput& output) const;

http://git-wip-us.apache.org/repos/asf/geode-native/blob/c0098121/src/tests/cpp/testobject/PdxClassV1.cpp
----------------------------------------------------------------------
diff --git a/src/tests/cpp/testobject/PdxClassV1.cpp b/src/tests/cpp/testobject/PdxClassV1.cpp
index b4a7163..9237243 100644
--- a/src/tests/cpp/testobject/PdxClassV1.cpp
+++ b/src/tests/cpp/testobject/PdxClassV1.cpp
@@ -54,12 +54,12 @@ int PdxType1V1::getHashCode() {
 }
 
 bool PdxType1V1::equals(PdxSerializablePtr obj) {
-  if (obj == NULLPTR) return false;
+  if (obj == nullptr) return false;
 
-  PdxType1V1Ptr pap = dynCast<PdxType1V1Ptr>(obj);
-  if (pap == NULLPTR) return false;
+  auto pap = std::dynamic_pointer_cast<PdxType1V1>(obj);
+  if (pap == nullptr) return false;
 
-  if (pap == this) return true;
+  if (pap.get() == this) return true;
 
   if (m_i1 + m_diffInSameFields <= pap->m_i1 &&
       m_i2 + m_diffInSameFields <= pap->m_i2 &&
@@ -195,12 +195,12 @@ int PdxType2V1::getHashCode() {
 }
 
 bool PdxType2V1::equals(PdxSerializablePtr obj) {
-  if (obj == NULLPTR) return false;
+  if (obj == nullptr) return false;
 
-  PdxType2V1Ptr pap = dynCast<PdxType2V1Ptr>(obj);
-  if (pap == NULLPTR) return false;
+  auto pap = std::dynamic_pointer_cast<PdxType2V1>(obj);
+  if (pap == nullptr) return false;
 
-  if (pap == this) return true;
+  if (pap.get() == this) return true;
 
   if (m_i1 + m_diffInSameFields <= pap->m_i1 &&
       m_i2 + m_diffInSameFields <= pap->m_i2 &&
@@ -273,12 +273,12 @@ int PdxType3V1::getHashCode() {
 }
 
 bool PdxType3V1::equals(PdxSerializablePtr obj) {
-  if (obj == NULLPTR) return false;
+  if (obj == nullptr) return false;
 
-  PdxType3V1Ptr pap = dynCast<PdxType3V1Ptr>(obj);
-  if (pap == NULLPTR) return false;
+  auto pap = std::dynamic_pointer_cast<PdxType3V1>(obj);
+  if (pap == nullptr) return false;
 
-  if (pap == this) return true;
+  if (pap.get() == this) return true;
 
   if (m_i1 + m_diffInSameFields <= pap->m_i1 &&
       m_i2 + m_diffInSameFields <= pap->m_i2 &&
@@ -374,12 +374,12 @@ int PdxTypesV1R1::getHashCode() {
 }
 
 bool PdxTypesV1R1::equals(PdxSerializablePtr obj) {
-  if (obj == NULLPTR) return false;
+  if (obj == nullptr) return false;
 
-  PdxTypesV1R1Ptr pap = dynCast<PdxTypesV1R1Ptr>(obj);
-  if (pap == NULLPTR) return false;
+  auto pap = std::dynamic_pointer_cast<PdxTypesV1R1>(obj);
+  if (pap == nullptr) return false;
 
-  if (pap == this) return true;
+  if (pap.get() == this) return true;
 
   if (m_i1 + m_diffInSameFields <= pap->m_i1 &&
       m_i2 + m_diffInSameFields <= pap->m_i2 &&
@@ -445,12 +445,12 @@ int PdxTypesV1R2::getHashCode() {
 }
 
 bool PdxTypesV1R2::equals(PdxSerializablePtr obj) {
-  if (obj == NULLPTR) return false;
+  if (obj == nullptr) return false;
 
-  PdxTypesV1R2Ptr pap = dynCast<PdxTypesV1R2Ptr>(obj);
-  if (pap == NULLPTR) return false;
+  auto pap = std::dynamic_pointer_cast<PdxTypesV1R2>(obj);
+  if (pap == nullptr) return false;
 
-  if (pap == this) return true;
+  if (pap.get() == this) return true;
 
   if (m_i1 + m_diffInSameFields <= pap->m_i1 &&
       m_i2 + m_diffInSameFields <= pap->m_i2 &&
@@ -515,13 +515,12 @@ int PdxTypesIgnoreUnreadFieldsV1::getHashCode() {
 }
 
 bool PdxTypesIgnoreUnreadFieldsV1::equals(PdxSerializablePtr obj) {
-  if (obj == NULLPTR) return false;
+  if (obj == nullptr) return false;
 
-  PdxTypesIgnoreUnreadFieldsV1Ptr pap =
-      dynCast<PdxTypesIgnoreUnreadFieldsV1Ptr>(obj);
-  if (pap == NULLPTR) return false;
+  auto pap = std::dynamic_pointer_cast<PdxTypesIgnoreUnreadFieldsV1>(obj);
+  if (pap == nullptr) return false;
 
-  if (pap == this) return true;
+  if (pap.get() == this) return true;
 
   if (m_i1 + m_diffInSameFields <= pap->m_i1 &&
       m_i2 + m_diffInSameFields <= pap->m_i2 &&
@@ -595,7 +594,7 @@ void PdxVersionedV1::init(int32_t size) {
   m_charArray[0] = 'c';
   m_charArray[1] = 'v';
 
-  m_dateTime = NULLPTR;
+  m_dateTime = nullptr;
 
   m_int16Array = new int16_t[size];
   m_int32Array = new int32_t[size];

http://git-wip-us.apache.org/repos/asf/geode-native/blob/c0098121/src/tests/cpp/testobject/PdxClassV2.cpp
----------------------------------------------------------------------
diff --git a/src/tests/cpp/testobject/PdxClassV2.cpp b/src/tests/cpp/testobject/PdxClassV2.cpp
index 7e12986..cf70f6a 100644
--- a/src/tests/cpp/testobject/PdxClassV2.cpp
+++ b/src/tests/cpp/testobject/PdxClassV2.cpp
@@ -58,12 +58,12 @@ int PdxTypes1V2::getHashCode() {
 }
 
 bool PdxTypes1V2::equals(PdxSerializablePtr obj) {
-  if (obj == NULLPTR) return false;
+  if (obj == nullptr) return false;
 
-  PdxTypes1V2Ptr pap = dynCast<PdxTypes1V2Ptr>(obj);
-  if (pap == NULLPTR) return false;
+  auto pap = std::dynamic_pointer_cast<PdxTypes1V2>(obj);
+  if (pap == nullptr) return false;
 
-  if (pap == this) return true;
+  if (pap.get() == this) return true;
 
   if (m_i1 + m_diffInSameFields <= pap->m_i1 &&
       m_i2 + m_diffInSameFields <= pap->m_i2 &&
@@ -153,12 +153,12 @@ int PdxTypes2V2::getHashCode() {
 }
 
 bool PdxTypes2V2::equals(PdxSerializablePtr obj) {
-  if (obj == NULLPTR) return false;
+  if (obj == nullptr) return false;
 
-  PdxTypes2V2Ptr pap = dynCast<PdxTypes2V2Ptr>(obj);
-  if (pap == NULLPTR) return false;
+  auto pap = std::dynamic_pointer_cast<PdxTypes2V2>(obj);
+  if (pap == nullptr) return false;
 
-  if (pap == this) return true;
+  if (pap.get() == this) return true;
 
   if (m_i1 + m_diffInSameFields <= pap->m_i1 &&
       m_i2 + m_diffInSameFields <= pap->m_i2 &&
@@ -242,12 +242,12 @@ int PdxTypes3V2::getHashCode() {
 }
 
 bool PdxTypes3V2::equals(PdxSerializablePtr obj) {
-  if (obj == NULLPTR) return false;
+  if (obj == nullptr) return false;
 
-  PdxTypes3V2Ptr pap = dynCast<PdxTypes3V2Ptr>(obj);
-  if (pap == NULLPTR) return false;
+  auto pap = std::dynamic_pointer_cast<PdxTypes3V2>(obj);
+  if (pap == nullptr) return false;
 
-  if (pap == this) return true;
+  if (pap.get() == this) return true;
 
   if (m_i1 + m_diffInSameFields <= pap->m_i1 &&
       m_i2 + m_diffInSameFields <= pap->m_i2 &&
@@ -350,12 +350,12 @@ int PdxTypesR1V2::getHashCode() {
 }
 
 bool PdxTypesR1V2::equals(PdxSerializablePtr obj) {
-  if (obj == NULLPTR) return false;
+  if (obj == nullptr) return false;
 
-  PdxTypesR1V2Ptr pap = dynCast<PdxTypesR1V2Ptr>(obj);
-  if (pap == NULLPTR) return false;
+  auto pap = std::dynamic_pointer_cast<PdxTypesR1V2>(obj);
+  if (pap == nullptr) return false;
 
-  if (pap == this) return true;
+  if (pap.get() == this) return true;
 
   if (m_i1 + m_diffInSameFields <= pap->m_i1 &&
       m_i2 + m_diffInSameFields <= pap->m_i2 &&
@@ -442,12 +442,12 @@ int PdxTypesR2V2::getHashCode() {
 }
 
 bool PdxTypesR2V2::equals(PdxSerializablePtr obj) {
-  if (obj == NULLPTR) return false;
+  if (obj == nullptr) return false;
 
-  PdxTypesR2V2Ptr pap = dynCast<PdxTypesR2V2Ptr>(obj);
-  if (pap == NULLPTR) return false;
+  auto pap = std::dynamic_pointer_cast<PdxTypesR2V2>(obj);
+  if (pap == nullptr) return false;
 
-  if (pap == this) return true;
+  if (pap.get() == this) return true;
 
   if (m_i1 + m_diffInSameFields <= pap->m_i1 &&
       m_i2 + m_diffInSameFields <= pap->m_i2 &&
@@ -539,13 +539,12 @@ int PdxTypesIgnoreUnreadFieldsV2::getHashCode() {
 }
 
 bool PdxTypesIgnoreUnreadFieldsV2::equals(PdxSerializablePtr obj) {
-  if (obj == NULLPTR) return false;
+  if (obj == nullptr) return false;
 
-  PdxTypesIgnoreUnreadFieldsV2Ptr pap =
-      dynCast<PdxTypesIgnoreUnreadFieldsV2Ptr>(obj);
-  if (pap == NULLPTR) return false;
+  auto pap = std::dynamic_pointer_cast<PdxTypesIgnoreUnreadFieldsV2>(obj);
+  if (pap == nullptr) return false;
 
-  if (pap == this) return true;
+  if (pap.get() == this) return true;
 
   LOGINFO("PdxTypesIgnoreUnreadFieldsV2::equals");
   LOGINFO("m_i1 =%d m_diffInSameFields=%d pap->m_i1=%d", m_i1,
@@ -645,7 +644,7 @@ void PdxVersionedV2::init(int32_t size) {
   m_charArray[0] = 'c';
   m_charArray[1] = 'v';
 
-  m_dateTime = NULLPTR;
+  m_dateTime = nullptr;
 
   m_int16Array = new int16_t[size];
   m_int32Array = new int32_t[size];

http://git-wip-us.apache.org/repos/asf/geode-native/blob/c0098121/src/tests/cpp/testobject/PdxType.cpp
----------------------------------------------------------------------
diff --git a/src/tests/cpp/testobject/PdxType.cpp b/src/tests/cpp/testobject/PdxType.cpp
index b284e2f..025a072 100644
--- a/src/tests/cpp/testobject/PdxType.cpp
+++ b/src/tests/cpp/testobject/PdxType.cpp
@@ -196,22 +196,26 @@ void PdxTests::PdxType::fromData(PdxReaderPtr pr) {
   m_byteArray = pr->readByteArray("m_byteArray", byteArrayLen);
   m_charArray = pr->readWideCharArray("m_charArray", charArrayLen);
 
-  m_arraylist = pr->readObject("m_arraylist");
-  m_linkedlist =
-      dynCast<CacheableLinkedListPtr>(pr->readObject("m_linkedlist"));
-  m_map = dynCast<CacheableHashMapPtr>(pr->readObject("m_map"));
+  m_arraylist = std::static_pointer_cast<CacheableArrayList>(
+      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"));
   // TODO:Check for the size
 
-  m_hashtable = pr->readObject("m_hashtable");
+  m_hashtable = std::static_pointer_cast<CacheableHashTable>(
+      pr->readObject("m_hashtable"));
   // TODO:Check for the size
 
-  m_vector = pr->readObject("m_vector");
+  m_vector =
+      std::static_pointer_cast<CacheableVector>(pr->readObject("m_vector"));
   // TODO::Check for size
 
-  m_chs = pr->readObject("m_chs");
+  m_chs = std::static_pointer_cast<CacheableHashSet>(pr->readObject("m_chs"));
   // TODO::Size check
 
-  m_clhs = 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
@@ -310,8 +314,8 @@ bool PdxTests::PdxType::equals(PdxTests::PdxType& other,
   if (!isPdxReadSerialized) {
     for (int i = 0; i < m_objectArray->size(); i++) {
       Address* otherAddr1 =
-          dynamic_cast<Address*>(ot->m_objectArray->at(i).ptr());
-      Address* myAddr1 = dynamic_cast<Address*>(m_objectArray->at(i).ptr());
+          dynamic_cast<Address*>(ot->m_objectArray->at(i).get());
+      Address* myAddr1 = dynamic_cast<Address*>(m_objectArray->at(i).get());
       if (!otherAddr1->equals(*myAddr1)) return false;
     }
     LOGINFO("PdxObject::equals isPdxReadSerialized = %d", isPdxReadSerialized);
@@ -321,16 +325,16 @@ bool PdxTests::PdxType::equals(PdxTests::PdxType& other,
   if (!isPdxReadSerialized) {
     for (int i = 0; i < m_objectArrayEmptyPdxFieldName->size(); i++) {
       Address* otherAddr1 =
-          dynamic_cast<Address*>(ot->m_objectArray->at(i).ptr());
-      Address* myAddr1 = dynamic_cast<Address*>(m_objectArray->at(i).ptr());
+          dynamic_cast<Address*>(ot->m_objectArray->at(i).get());
+      Address* myAddr1 = dynamic_cast<Address*>(m_objectArray->at(i).get());
       if (!otherAddr1->equals(*myAddr1)) return false;
     }
     LOGINFO("PdxObject::equals Empty Field Name isPdxReadSerialized = %d",
             isPdxReadSerialized);
   }
 
-  CacheableEnumPtr myenum = dynCast<CacheableEnumPtr>(m_pdxEnum);
-  CacheableEnumPtr otenum = dynCast<CacheableEnumPtr>(ot->m_pdxEnum);
+  auto myenum = std::dynamic_pointer_cast<CacheableEnum>(m_pdxEnum);
+  auto otenum = std::dynamic_pointer_cast<CacheableEnum>(ot->m_pdxEnum);
   if (myenum->getEnumOrdinal() != otenum->getEnumOrdinal()) return false;
   if (strcmp(myenum->getEnumClassName(), otenum->getEnumClassName()) != 0) {
     return false;

http://git-wip-us.apache.org/repos/asf/geode-native/blob/c0098121/src/tests/cpp/testobject/PdxType.hpp
----------------------------------------------------------------------
diff --git a/src/tests/cpp/testobject/PdxType.hpp b/src/tests/cpp/testobject/PdxType.hpp
index 2908373..3a3ab61 100644
--- a/src/tests/cpp/testobject/PdxType.hpp
+++ b/src/tests/cpp/testobject/PdxType.hpp
@@ -131,12 +131,12 @@ class TESTOBJECT_EXPORT Child : public Parent, public PdxSerializable {
   static PdxSerializable* createDeserializable() { return new Child(); }
 
   bool equals(PdxSerializablePtr obj) {
-    if (obj == NULLPTR) return false;
+    if (obj == nullptr) return false;
 
-    ChildPtr pap = dynCast<ChildPtr>(obj);
-    if (pap == NULLPTR) return false;
+    auto pap = std::dynamic_pointer_cast<Child>(obj);
+    if (pap == nullptr) return false;
 
-    if (pap == this) return true;
+    if (pap.get() == this) return true;
 
     if (m_a == pap->m_a && m_b == pap->m_b && m_c == pap->m_c &&
         m_d == pap->m_d && m_e == pap->m_e && m_f == pap->m_f) {
@@ -315,7 +315,7 @@ class TESTOBJECT_EXPORT Address : public PdxSerializable {
 
   /*static AddressPtr create(int32_t aptN, char* street, char* city)
   {
-          AddressPtr str = NULLPTR;
+          AddressPtr str = nullptr;
     if (value != NULL) {
       str = new Address();
     }
@@ -556,17 +556,17 @@ class TESTOBJECT_EXPORT PdxType : public PdxSerializable {
       keys.push_back(CacheableKey::create(key));
     }*/
 
-    m_objectArray = NULLPTR;
-    m_objectArrayEmptyPdxFieldName = NULLPTR;
+    m_objectArray = nullptr;
+    m_objectArrayEmptyPdxFieldName = nullptr;
     /*AddressPtr objectArray[3];
     objectArray[0] = new Address(1, "strt-1", "city-1");
     objectArray[1] = new Address(2, "strt-2", "city-2");
     objectArray[2] = new Address(3, "strt-3", "city-3");*/
 
     /*
-    AddressPtr addObj1(new Address(1, "abc", "ABC"));
-    AddressPtr addObj2(new Address(2, "def", "DEF"));
-    AddressPtr addObj3(new Address(3, "ghi", "GHI"));*/
+    auto addObj1 = std::make_shared<Address>(1, "abc", "ABC");
+    auto addObj2 = std::make_shared<Address>(2, "def", "DEF");
+    auto addObj3 = std::make_shared<Address>(3, "ghi", "GHI");*/
 
     m_objectArray = CacheableObjectArray::create();
     m_objectArray->push_back(AddressPtr(new Address(1, "street0", "city0")));
@@ -748,7 +748,9 @@ class TESTOBJECT_EXPORT PdxType : public PdxSerializable {
     return m_objectArrayEmptyPdxFieldName;
   }
 
-  CacheableEnumPtr getEnum() { return m_pdxEnum; }
+  CacheableEnumPtr getEnum() {
+    return std::static_pointer_cast<CacheableEnum>(m_pdxEnum);
+  }
 
   int32_t getByteArrayLength() { return byteArrayLen; }
 

http://git-wip-us.apache.org/repos/asf/geode-native/blob/c0098121/src/tests/cpp/testobject/PdxVersioned1.cpp
----------------------------------------------------------------------
diff --git a/src/tests/cpp/testobject/PdxVersioned1.cpp b/src/tests/cpp/testobject/PdxVersioned1.cpp
index 8b418a4..02a0317 100644
--- a/src/tests/cpp/testobject/PdxVersioned1.cpp
+++ b/src/tests/cpp/testobject/PdxVersioned1.cpp
@@ -337,8 +337,9 @@ void PdxTests::PdxVersioned1::fromData(PdxReaderPtr pr) {
   m_byte = pr->readByte("m_byte");
   m_byteArray = pr->readByteArray("m_byteArray", byteArrayLen);
   m_charArray = pr->readWideCharArray("m_charArray", charArrayLen);
-  m_arraylist = dynCast<CacheableArrayListPtr>(pr->readObject("m_arraylist"));
-  m_map = dynCast<CacheableHashMapPtr>(pr->readObject("m_map"));
+  m_arraylist = std::static_pointer_cast<CacheableArrayList>(
+      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
@@ -420,8 +421,8 @@ bool PdxTests::PdxVersioned1::equals(PdxTests::PdxVersioned1& other,
   // generic2DCompare(ot->m_byteByteArray, m_byteByteArray, byteByteArrayLen,
   // lengthArr);
 
-  // CacheableEnumPtr myenum = dynCast<CacheableEnumPtr>(m_pdxEnum);
-  // CacheableEnumPtr otenum = dynCast<CacheableEnumPtr>(ot->m_pdxEnum);
+  // auto myenum = std::dynamic_pointer_cast<CacheableEnum>(m_pdxEnum);
+  // auto otenum = std::dynamic_pointer_cast<CacheableEnum>(ot->m_pdxEnum);
   // if (myenum->getEnumOrdinal() != otenum->getEnumOrdinal()) return false;
   // if (strcmp(myenum->getEnumClassName(), otenum->getEnumClassName()) != 0)
   // return false;

http://git-wip-us.apache.org/repos/asf/geode-native/blob/c0098121/src/tests/cpp/testobject/PdxVersioned1.hpp
----------------------------------------------------------------------
diff --git a/src/tests/cpp/testobject/PdxVersioned1.hpp b/src/tests/cpp/testobject/PdxVersioned1.hpp
index b03b843..cbbb3b6 100644
--- a/src/tests/cpp/testobject/PdxVersioned1.hpp
+++ b/src/tests/cpp/testobject/PdxVersioned1.hpp
@@ -205,7 +205,9 @@ class TESTOBJECT_EXPORT PdxVersioned1 : public PdxSerializable {
 
   CacheableDatePtr getDate() { return m_date; }
 
-  CacheableEnumPtr getEnum() { return m_pdxEnum; }
+  CacheableEnumPtr getEnum() {
+    return std::static_pointer_cast<CacheableEnum>(m_pdxEnum);
+  }
 
   int32_t getByteArrayLength() { return byteArrayLen; }
 

http://git-wip-us.apache.org/repos/asf/geode-native/blob/c0098121/src/tests/cpp/testobject/PdxVersioned2.cpp
----------------------------------------------------------------------
diff --git a/src/tests/cpp/testobject/PdxVersioned2.cpp b/src/tests/cpp/testobject/PdxVersioned2.cpp
index 6422846..ffe4d7d 100644
--- a/src/tests/cpp/testobject/PdxVersioned2.cpp
+++ b/src/tests/cpp/testobject/PdxVersioned2.cpp
@@ -344,8 +344,9 @@ void PdxTests::PdxVersioned2::fromData(PdxReaderPtr pr) {
   m_byte = pr->readByte("m_byte");
   m_byteArray = pr->readByteArray("m_byteArray", byteArrayLen);
   m_charArray = pr->readWideCharArray("m_charArray", charArrayLen);
-  m_arraylist = dynCast<CacheableArrayListPtr>(pr->readObject("m_arraylist"));
-  m_map = dynCast<CacheableHashMapPtr>(pr->readObject("m_map"));
+  m_arraylist = std::static_pointer_cast<CacheableArrayList>(
+      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
@@ -427,8 +428,8 @@ bool PdxTests::PdxVersioned2::equals(PdxTests::PdxVersioned2& other,
   // generic2DCompare(ot->m_byteByteArray, m_byteByteArray, byteByteArrayLen,
   // lengthArr);
 
-  // CacheableEnumPtr myenum = dynCast<CacheableEnumPtr>(m_pdxEnum);
-  // CacheableEnumPtr otenum = dynCast<CacheableEnumPtr>(ot->m_pdxEnum);
+  // auto myenum = std::dynamic_pointer_cast<CacheableEnum>(m_pdxEnum);
+  // auto otenum = std::dynamic_pointer_cast<CacheableEnum>(ot->m_pdxEnum);
   // if (myenum->getEnumOrdinal() != otenum->getEnumOrdinal()) return false;
   // if (strcmp(myenum->getEnumClassName(), otenum->getEnumClassName()) != 0)
   // return false;

http://git-wip-us.apache.org/repos/asf/geode-native/blob/c0098121/src/tests/cpp/testobject/PdxVersioned2.hpp
----------------------------------------------------------------------
diff --git a/src/tests/cpp/testobject/PdxVersioned2.hpp b/src/tests/cpp/testobject/PdxVersioned2.hpp
index bc8ccbd..f53cd52 100644
--- a/src/tests/cpp/testobject/PdxVersioned2.hpp
+++ b/src/tests/cpp/testobject/PdxVersioned2.hpp
@@ -205,7 +205,9 @@ class TESTOBJECT_EXPORT PdxVersioned2 : public PdxSerializable {
 
   CacheableDatePtr getDate() { return m_date; }
 
-  CacheableEnumPtr getEnum() { return m_pdxEnum; }
+  CacheableEnumPtr getEnum() {
+    return std::static_pointer_cast<CacheableEnum>(m_pdxEnum);
+  }
 
   int32_t getByteArrayLength() { return byteArrayLen; }
 

http://git-wip-us.apache.org/repos/asf/geode-native/blob/c0098121/src/tests/cpp/testobject/Portfolio.cpp
----------------------------------------------------------------------
diff --git a/src/tests/cpp/testobject/Portfolio.cpp b/src/tests/cpp/testobject/Portfolio.cpp
index 7deedf1..50773a8 100644
--- a/src/tests/cpp/testobject/Portfolio.cpp
+++ b/src/tests/cpp/testobject/Portfolio.cpp
@@ -36,13 +36,13 @@ Portfolio::Portfolio(int32_t i, uint32_t size, CacheableStringArrayPtr nm)
   sprintf(buf, "type%d", (i % 3));
   type = CacheableString::create(buf);
   int numSecIds = sizeof(secIds) / sizeof(char*);
-  position1 =
-      new Position(secIds[Position::cnt % numSecIds], Position::cnt * 1000);
+  position1 = std::make_shared<Position>(secIds[Position::cnt % numSecIds],
+                                         Position::cnt * 1000);
   if (i % 2 != 0) {
-    position2 =
-        new Position(secIds[Position::cnt % numSecIds], Position::cnt * 1000);
+    position2 = std::make_shared<Position>(secIds[Position::cnt % numSecIds],
+                                           Position::cnt * 1000);
   } else {
-    position2 = NULLPTR;
+    position2 = nullptr;
   }
   positions = CacheableHashMap::create();
   positions->insert(CacheableString::create(secIds[Position::cnt % numSecIds]),
@@ -103,7 +103,7 @@ CacheableStringPtr Portfolio::toString() const {
   char idbuf[1024];
   sprintf(idbuf, "PortfolioObject: [ ID=%d", ID);
   char pkidbuf[1024];
-  if (pkid != NULLPTR) {
+  if (pkid != nullptr) {
     sprintf(pkidbuf, " status=%s type=%s pkid=%s\n", this->status,
             this->type->toString(), this->pkid->asChar());
   } else {
@@ -111,19 +111,19 @@ CacheableStringPtr Portfolio::toString() const {
             this->type->toString(), this->pkid->asChar());
   }
   char position1buf[2048];
-  if (position1 != NULLPTR) {
+  if (position1 != nullptr) {
     sprintf(position1buf, "\t\t\t  P1: %s", position1->toString()->asChar());
   } else {
     sprintf(position1buf, "\t\t\t  P1: %s", "NULL");
   }
   char position2buf[2048];
-  if (position2 != NULLPTR) {
+  if (position2 != nullptr) {
     sprintf(position2buf, " P2: %s", position2->toString()->asChar());
   } else {
     sprintf(position2buf, " P2: %s ]", "NULL");
   }
   char creationdatebuf[2048];
-  if (creationDate != NULLPTR) {
+  if (creationDate != nullptr) {
     sprintf(creationdatebuf, "creation Date %s",
             creationDate->toString()->asChar());
   } else {

http://git-wip-us.apache.org/repos/asf/geode-native/blob/c0098121/src/tests/cpp/testobject/Portfolio.hpp
----------------------------------------------------------------------
diff --git a/src/tests/cpp/testobject/Portfolio.hpp b/src/tests/cpp/testobject/Portfolio.hpp
index 0ca668e..92cdaba 100644
--- a/src/tests/cpp/testobject/Portfolio.hpp
+++ b/src/tests/cpp/testobject/Portfolio.hpp
@@ -49,21 +49,21 @@ class TESTOBJECT_EXPORT Portfolio : public Serializable {
   uint8_t* arrayZeroSize;
 
   inline uint32_t getObjectSize(const SerializablePtr& obj) const {
-    return (obj == NULLPTR ? 0 : obj->objectSize());
+    return (obj == nullptr ? 0 : obj->objectSize());
   }
 
  public:
   Portfolio()
       : ID(0),
-        pkid(NULLPTR),
-        type(NULLPTR),
+        pkid(nullptr),
+        type(nullptr),
         status(NULL),
         newVal(NULL),
-        creationDate(NULLPTR),
+        creationDate(nullptr),
         arrayNull(NULL),
         arrayZeroSize(NULL) {}
   Portfolio(int32_t id, uint32_t size = 0,
-            CacheableStringArrayPtr nm = NULLPTR);
+            CacheableStringArrayPtr nm = nullptr);
   virtual ~Portfolio();
 
   virtual uint32_t objectSize() const {
@@ -85,7 +85,7 @@ class TESTOBJECT_EXPORT Portfolio : public Serializable {
   int32_t getID() { return ID; }
   void showNames(const char* label) {
     LOGINFO(label);
-    if (names == NULLPTR) {
+    if (names == nullptr) {
       LOGINFO("names is NULL");
       return;
     }

http://git-wip-us.apache.org/repos/asf/geode-native/blob/c0098121/src/tests/cpp/testobject/PortfolioPdx.cpp
----------------------------------------------------------------------
diff --git a/src/tests/cpp/testobject/PortfolioPdx.cpp b/src/tests/cpp/testobject/PortfolioPdx.cpp
index 923d998..1328f82 100644
--- a/src/tests/cpp/testobject/PortfolioPdx.cpp
+++ b/src/tests/cpp/testobject/PortfolioPdx.cpp
@@ -43,13 +43,13 @@ PortfolioPdx::PortfolioPdx(int32_t i, int32_t size, char** nm) : names(nm) {
   memcpy(type, buf, strSize2);
 
   int numSecIds = sizeof(secIds) / sizeof(char*);
-  position1 = new PositionPdx(secIds[PositionPdx::cnt % numSecIds],
-                              PositionPdx::cnt * 1000);
+  position1 = std::make_shared<PositionPdx>(
+      secIds[PositionPdx::cnt % numSecIds], PositionPdx::cnt * 1000);
   if (i % 2 != 0) {
-    position2 = new PositionPdx(secIds[PositionPdx::cnt % numSecIds],
-                                PositionPdx::cnt * 1000);
+    position2 = std::make_shared<PositionPdx>(
+        secIds[PositionPdx::cnt % numSecIds], PositionPdx::cnt * 1000);
   } else {
-    position2 = NULLPTR;
+    position2 = nullptr;
   }
   positions = CacheableHashMap::create();
   positions->insert(
@@ -133,9 +133,12 @@ void PortfolioPdx::fromData(PdxReaderPtr pr) {
   id = pr->readInt("ID");
   pkid = pr->readString("pkid");
 
-  position1 = dynCast<PositionPdxPtr>(pr->readObject("position1"));
-  position2 = dynCast<PositionPdxPtr>(pr->readObject("position2"));
-  positions = dynCast<CacheableHashMapPtr>(pr->readObject("positions"));
+  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");
 
@@ -164,19 +167,19 @@ CacheableStringPtr PortfolioPdx::toString() const {
             this->pkid);
   }
   char position1buf[2048];
-  if (position1 != NULLPTR) {
+  if (position1 != nullptr) {
     sprintf(position1buf, "\t\t\t  P1: %s", position1->toString()->asChar());
   } else {
     sprintf(position1buf, "\t\t\t  P1: %s", "NULL");
   }
   char position2buf[2048];
-  if (position2 != NULLPTR) {
+  if (position2 != nullptr) {
     sprintf(position2buf, " P2: %s", position2->toString()->asChar());
   } else {
     sprintf(position2buf, " P2: %s ]", "NULL");
   }
   char creationdatebuf[2048];
-  if (creationDate != NULLPTR) {
+  if (creationDate != nullptr) {
     sprintf(creationdatebuf, "creation Date %s",
             creationDate->toString()->asChar());
   } else {

http://git-wip-us.apache.org/repos/asf/geode-native/blob/c0098121/src/tests/cpp/testobject/PortfolioPdx.hpp
----------------------------------------------------------------------
diff --git a/src/tests/cpp/testobject/PortfolioPdx.hpp b/src/tests/cpp/testobject/PortfolioPdx.hpp
index a400e44..a4cc600 100644
--- a/src/tests/cpp/testobject/PortfolioPdx.hpp
+++ b/src/tests/cpp/testobject/PortfolioPdx.hpp
@@ -56,7 +56,7 @@ class TESTOBJECT_EXPORT PortfolioPdx : public PdxSerializable {
         type(NULL),
         status(NULL),
         newVal(NULL),
-        creationDate(NULLPTR),
+        creationDate(nullptr),
         arrayNull(NULL),
         arrayZeroSize(NULL) {}
 

http://git-wip-us.apache.org/repos/asf/geode-native/blob/c0098121/src/tests/cpp/testobject/Position.cpp
----------------------------------------------------------------------
diff --git a/src/tests/cpp/testobject/Position.cpp b/src/tests/cpp/testobject/Position.cpp
index 374499f..04a11f2 100644
--- a/src/tests/cpp/testobject/Position.cpp
+++ b/src/tests/cpp/testobject/Position.cpp
@@ -63,19 +63,19 @@ Position::~Position() {
 
 void Position::init() {
   avg20DaysVol = 0;
-  bondRating = NULLPTR;
+  bondRating = nullptr;
   convRatio = 0.0;
-  country = NULLPTR;
+  country = nullptr;
   delta = 0.0;
   industry = 0;
   issuer = 0;
   mktValue = 0.0;
   qty = 0.0;
-  secId = NULLPTR;
-  secLinks = NULLPTR;
+  secId = nullptr;
+  secLinks = nullptr;
   secType = NULL;
   sharesOutstanding = 0;
-  underlyer = NULLPTR;
+  underlyer = nullptr;
   volatility = 0;
   pid = 0;
 }

http://git-wip-us.apache.org/repos/asf/geode-native/blob/c0098121/src/tests/cpp/testobject/Position.hpp
----------------------------------------------------------------------
diff --git a/src/tests/cpp/testobject/Position.hpp b/src/tests/cpp/testobject/Position.hpp
index a185e71..f9071c5 100644
--- a/src/tests/cpp/testobject/Position.hpp
+++ b/src/tests/cpp/testobject/Position.hpp
@@ -62,7 +62,7 @@ class TESTOBJECT_EXPORT Position : public apache::geode::client::Serializable {
   int32_t pid;
 
   inline uint32_t getObjectSize(const SerializablePtr& obj) const {
-    return (obj == NULLPTR ? 0 : obj->objectSize());
+    return (obj == nullptr ? 0 : obj->objectSize());
   }
 
  public:

http://git-wip-us.apache.org/repos/asf/geode-native/blob/c0098121/src/tests/cpp/testobject/TestObject1.cpp
----------------------------------------------------------------------
diff --git a/src/tests/cpp/testobject/TestObject1.cpp b/src/tests/cpp/testobject/TestObject1.cpp
index 2aaa48a..fab0ee5 100644
--- a/src/tests/cpp/testobject/TestObject1.cpp
+++ b/src/tests/cpp/testobject/TestObject1.cpp
@@ -25,7 +25,7 @@
 using namespace testobject;
 
 TestObject1::TestObject1()
-    : name(NULLPTR), arr(CacheableBytes::create(4 * 1024)), identifier(1) {}
+    : name(nullptr), arr(CacheableBytes::create(4 * 1024)), identifier(1) {}
 
 TestObject1::TestObject1(std::string& str, int32_t id) {
   name = CacheableString::create(str.c_str());
@@ -41,7 +41,7 @@ TestObject1::TestObject1(std::string& str, int32_t id) {
 }
 
 TestObject1::TestObject1(TestObject1& rhs) {
-  name = rhs.name == NULLPTR ? NULLPTR
+  name = rhs.name == nullptr ? nullptr
                              : CacheableString::create(rhs.name->asChar());
   identifier = rhs.identifier;
   arr = CacheableBytes::create(rhs.arr->value(), rhs.arr->length());

http://git-wip-us.apache.org/repos/asf/geode-native/blob/c0098121/src/tests/cpp/testobject/TestObject1.hpp
----------------------------------------------------------------------
diff --git a/src/tests/cpp/testobject/TestObject1.hpp b/src/tests/cpp/testobject/TestObject1.hpp
index 62ce31d..ed2bc46 100644
--- a/src/tests/cpp/testobject/TestObject1.hpp
+++ b/src/tests/cpp/testobject/TestObject1.hpp
@@ -50,7 +50,7 @@ class TESTOBJECT_EXPORT TestObject1 : public Cacheable {
  public:
   TestObject1();
   TestObject1(int32_t id)
-      : name(NULLPTR), arr(CacheableBytes::create(4 * 1024)), identifier(id) {}
+      : name(nullptr), arr(CacheableBytes::create(4 * 1024)), identifier(id) {}
   TestObject1(std::string& str, int32_t id);
   TestObject1(TestObject1& rhs);
   void toData(DataOutput& output) const;

http://git-wip-us.apache.org/repos/asf/geode-native/blob/c0098121/src/tests/cpp/testobject/VariousPdxTypes.cpp
----------------------------------------------------------------------
diff --git a/src/tests/cpp/testobject/VariousPdxTypes.cpp b/src/tests/cpp/testobject/VariousPdxTypes.cpp
index 5415927..52d7f7b 100644
--- a/src/tests/cpp/testobject/VariousPdxTypes.cpp
+++ b/src/tests/cpp/testobject/VariousPdxTypes.cpp
@@ -44,16 +44,16 @@ int32_t PdxTypes1::getHashCode() { return 1; }
 
 bool PdxTypes1::equals(PdxSerializablePtr obj) {
   // LOGDEBUG("NIL:PdxTypes1::==::33");
-  if (obj == NULLPTR) {
+  if (obj == nullptr) {
     // LOGDEBUG("NIL:PdxTypes1::==::35");
     return false;
   }
-  PdxTypes1Ptr pap = dynCast<PdxTypes1Ptr>(obj);
-  if (pap == NULLPTR) {
+  auto pap = std::dynamic_pointer_cast<PdxTypes1>(obj);
+  if (pap == nullptr) {
     // LOGDEBUG("NIL:PdxTypes1::==::40");
     return false;
   }
-  if (pap == this) {
+  if (pap.get() == this) {
     // LOGDEBUG("NIL:PdxTypes1::==::44");
     return true;
   }
@@ -109,13 +109,13 @@ int32_t PdxTypes2::getHashCode() { return 1; }
 bool PdxTypes2::equals(PdxSerializablePtr obj) {
   // LOGDEBUG("NIL:96:this::PdxType2 = %s", this->toString());
 
-  if (obj == NULLPTR) return false;
+  if (obj == nullptr) return false;
 
-  PdxTypes2Ptr pap = dynCast<PdxTypes2Ptr>(obj);
+  auto pap = std::dynamic_pointer_cast<PdxTypes2>(obj);
   // LOGDEBUG("NIl:102:pap::PdxType2 = %s", pap->toString());
-  if (pap == NULLPTR) return false;
+  if (pap == nullptr) return false;
 
-  // if (pap == this)
+  // if (pap.get() == this)
   //	return true;
 
   if (m_i1 == pap->m_i1 && m_i2 == pap->m_i2 && m_i3 == pap->m_i3 &&
@@ -167,12 +167,12 @@ PdxTypes3::~PdxTypes3() {
 int32_t PdxTypes3::getHashCode() { return 1; }
 
 bool PdxTypes3::equals(PdxSerializablePtr obj) {
-  if (obj == NULLPTR) return false;
+  if (obj == nullptr) return false;
 
-  PdxTypes3Ptr pap = dynCast<PdxTypes3Ptr>(obj);
-  if (pap == NULLPTR) return false;
+  auto pap = std::dynamic_pointer_cast<PdxTypes3>(obj);
+  if (pap == nullptr) return false;
 
-  // if (pap == this)
+  // if (pap.get() == this)
   //	return true;
 
   if (m_i1 == pap->m_i1 && m_i2 == pap->m_i2 && m_i3 == pap->m_i3 &&
@@ -224,12 +224,12 @@ PdxTypes4::~PdxTypes4() {
 int32_t PdxTypes4::getHashCode() { return 1; }
 
 bool PdxTypes4::equals(PdxSerializablePtr obj) {
-  if (obj == NULLPTR) return false;
+  if (obj == nullptr) return false;
 
-  PdxTypes4Ptr pap = dynCast<PdxTypes4Ptr>(obj);
-  if (pap == NULLPTR) return false;
+  auto pap = std::dynamic_pointer_cast<PdxTypes4>(obj);
+  if (pap == nullptr) return false;
 
-  // if (pap == this)
+  // if (pap.get() == this)
   //	return true;
 
   if (m_i1 == pap->m_i1 && m_i2 == pap->m_i2 && m_i3 == pap->m_i3 &&
@@ -282,12 +282,12 @@ PdxTypes5::~PdxTypes5() {
 int32_t PdxTypes5::getHashCode() { return 1; }
 
 bool PdxTypes5::equals(PdxSerializablePtr obj) {
-  if (obj == NULLPTR) return false;
+  if (obj == nullptr) return false;
 
-  PdxTypes5Ptr pap = dynCast<PdxTypes5Ptr>(obj);
-  if (pap == NULLPTR) return false;
+  auto pap = std::dynamic_pointer_cast<PdxTypes5>(obj);
+  if (pap == nullptr) return false;
 
-  // if (pap == this)
+  // if (pap.get() == this)
   //	return true;
 
   if (m_i1 == pap->m_i1 && m_i2 == pap->m_i2 && m_i3 == pap->m_i3 &&
@@ -350,11 +350,11 @@ int32_t PdxTypes6::getHashCode() { return 1; }
 
 bool PdxTypes6::equals(PdxSerializablePtr obj) {
   LOGDEBUG("PdxTypes6::equals -1");
-  if (obj == NULLPTR) return false;
+  if (obj == nullptr) return false;
 
   LOGDEBUG("PdxTypes6::equals -2");
-  PdxTypes6Ptr pap = dynCast<PdxTypes6Ptr>(obj);
-  if (pap == NULLPTR) return false;
+  auto pap = std::dynamic_pointer_cast<PdxTypes6>(obj);
+  if (pap == nullptr) return false;
 
   LOGDEBUG("PdxTypes6::equals -3 m_i1 = %d", m_i1);
   LOGDEBUG("PdxTypes6::equals -4 m_i2 = %d", m_i2);
@@ -369,7 +369,7 @@ bool PdxTypes6::equals(PdxSerializablePtr obj) {
   LOGDEBUG("PdxTypes6::equals -12 pap->m_i4 = %d", pap->m_i4);
   LOGDEBUG("PdxTypes6::equals -13 pap->m_s1 = %s", pap->m_s1);
   LOGDEBUG("PdxTypes6::equals -14 pap->m_s2 = %s", pap->m_s2);
-  // if (pap == this)
+  // if (pap.get() == this)
   //	return true;
 
   if (m_i1 == pap->m_i1 && m_i2 == pap->m_i2 && m_i3 == pap->m_i3 &&
@@ -443,12 +443,12 @@ PdxTypes7::~PdxTypes7() {
 int32_t PdxTypes7::getHashCode() { return 1; }
 
 bool PdxTypes7::equals(PdxSerializablePtr obj) {
-  if (obj == NULLPTR) return false;
+  if (obj == nullptr) return false;
 
-  PdxTypes7Ptr pap = dynCast<PdxTypes7Ptr>(obj);
-  if (pap == NULLPTR) return false;
+  auto pap = std::dynamic_pointer_cast<PdxTypes7>(obj);
+  if (pap == nullptr) return false;
 
-  // if (pap == this)
+  // if (pap.get() == this)
   //	return true;
 
   if (m_i1 == pap->m_i1 && m_i2 == pap->m_i2 && m_i3 == pap->m_i3 &&
@@ -512,12 +512,12 @@ PdxTypes8::~PdxTypes8() { delete[] bytes300; }
 int32_t PdxTypes8::getHashCode() { return 1; }
 
 bool PdxTypes8::equals(PdxSerializablePtr obj) {
-  if (obj == NULLPTR) return false;
+  if (obj == nullptr) return false;
 
-  PdxTypes8Ptr pap = dynCast<PdxTypes8Ptr>(obj);
-  if (pap == NULLPTR) return false;
+  auto pap = std::dynamic_pointer_cast<PdxTypes8>(obj);
+  if (pap == nullptr) return false;
 
-  // if (pap == this)
+  // if (pap.get() == this)
   //	return true;
 
   if (m_i1 == pap->m_i1 && m_i2 == pap->m_i2 && m_i3 == pap->m_i3 &&
@@ -580,12 +580,12 @@ PdxTypes9::~PdxTypes9() { delete[] m_bytes66000; }
 int32_t PdxTypes9::getHashCode() { return 1; }
 
 bool PdxTypes9::equals(PdxSerializablePtr obj) {
-  if (obj == NULLPTR) return false;
+  if (obj == nullptr) return false;
 
-  PdxTypes9Ptr pap = dynCast<PdxTypes9Ptr>(obj);
-  if (pap == NULLPTR) return false;
+  auto pap = std::dynamic_pointer_cast<PdxTypes9>(obj);
+  if (pap == nullptr) return false;
 
-  // if (pap == this)
+  // if (pap.get() == this)
   //	return true;
 
   if ((strcmp(m_s1, pap->m_s1) == 0) && (strcmp(m_s2, pap->m_s2) == 0) &&
@@ -642,12 +642,12 @@ PdxTypes10::~PdxTypes10() { delete[] m_bytes66000; }
 int32_t PdxTypes10::getHashCode() { return 1; }
 
 bool PdxTypes10::equals(PdxSerializablePtr obj) {
-  if (obj == NULLPTR) return false;
+  if (obj == nullptr) return false;
 
-  PdxTypes10Ptr pap = dynCast<PdxTypes10Ptr>(obj);
-  if (pap == NULLPTR) return false;
+  auto pap = std::dynamic_pointer_cast<PdxTypes10>(obj);
+  if (pap == nullptr) return false;
 
-  // if (pap == this)
+  // if (pap.get() == this)
   //	return true;
 
   if ((strcmp(m_s1, pap->m_s1) == 0) && (strcmp(m_s2, pap->m_s2) == 0) &&
@@ -692,8 +692,8 @@ void PdxTypes10::fromData(PdxReaderPtr pr) {
  * *********************************************************/
 
 NestedPdx::NestedPdx() {
-  m_pd1 = new PdxTypes1();
-  m_pd2 = new PdxTypes2();
+  m_pd1 = std::make_shared<PdxTypes1>();
+  m_pd2 = std::make_shared<PdxTypes2>();
   m_s1 = (char *)"one";
   m_s2 = (char *)"two";
   m_i1 = 34324;
@@ -703,8 +703,8 @@ NestedPdx::NestedPdx() {
 }
 
 NestedPdx::NestedPdx(char *key) {
-  m_pd1 = new PdxTypes1();
-  m_pd2 = new PdxTypes2();
+  m_pd1 = std::make_shared<PdxTypes1>();
+  m_pd2 = std::make_shared<PdxTypes2>();
   size_t len = strlen("NestedPdx ") + strlen(key) + 1;
   m_s1 = new char[len];
   strcpy(m_s1, "NestedPdx ");
@@ -722,12 +722,12 @@ NestedPdx::~NestedPdx() {
 int32_t NestedPdx::getHashCode() { return 1; }
 
 bool NestedPdx::equals(PdxSerializablePtr obj) {
-  if (obj == NULLPTR) return false;
+  if (obj == nullptr) return false;
 
-  NestedPdxPtr pap = dynCast<NestedPdxPtr>(obj);
-  if (pap == NULLPTR) return false;
+  auto pap = std::dynamic_pointer_cast<NestedPdx>(obj);
+  if (pap == nullptr) return false;
 
-  // if (pap == this)
+  // if (pap.get() == this)
   //	return true;
 
   if (m_i1 == pap->m_i1 && m_i2 == pap->m_i2 && m_i3 == pap->m_i3 &&
@@ -762,11 +762,11 @@ void NestedPdx::toData(PdxWriterPtr pw) {
 
 void NestedPdx::fromData(PdxReaderPtr pr) {
   m_i1 = pr->readInt("i1");
-  m_pd1 = pr->readObject("pd1");
+  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 = pr->readObject("pd2");
+  m_pd2 = std::static_pointer_cast<PdxTypes2>(pr->readObject("pd2"));
   m_i3 = pr->readInt("i3");
   m_i4 = pr->readInt("i4");
 }
@@ -776,8 +776,8 @@ void NestedPdx::fromData(PdxReaderPtr pr) {
  * *********************************************************/
 
 MixedVersionNestedPdx::MixedVersionNestedPdx() {
-  m_pd1 = new PdxTypes1();
-  m_pd2 = new PdxTypes2();
+  m_pd1 = std::make_shared<PdxTypes1>();
+  m_pd2 = std::make_shared<PdxTypes2>();
   m_s1 = (char *)"one";
   m_s2 = (char *)"two";
   m_s3 = (char *)"three";
@@ -788,8 +788,8 @@ MixedVersionNestedPdx::MixedVersionNestedPdx() {
 }
 
 MixedVersionNestedPdx::MixedVersionNestedPdx(char *key) {
-  m_pd1 = new PdxTypes1();
-  m_pd2 = new PdxTypes2();
+  m_pd1 = std::make_shared<PdxTypes1>();
+  m_pd2 = std::make_shared<PdxTypes2>();
   size_t len = strlen("MixedVersionNestedPdx ") + strlen(key) + 1;
   m_s1 = new char[len];
   strcpy(m_s1, "MixedVersionNestedPdx ");
@@ -808,12 +808,12 @@ MixedVersionNestedPdx::~MixedVersionNestedPdx() {
 int32_t MixedVersionNestedPdx::getHashCode() { return 1; }
 
 bool MixedVersionNestedPdx::equals(PdxSerializablePtr obj) {
-  if (obj == NULLPTR) return false;
+  if (obj == nullptr) return false;
 
-  MixedVersionNestedPdxPtr pap = dynCast<MixedVersionNestedPdxPtr>(obj);
-  if (pap == NULLPTR) return false;
+  auto pap = std::dynamic_pointer_cast<MixedVersionNestedPdx>(obj);
+  if (pap == nullptr) return false;
 
-  // if (pap == this)
+  // if (pap.get() == this)
   //	return true;
 
   if (m_i1 == pap->m_i1 && m_i2 == pap->m_i2 && m_i3 == pap->m_i3 &&
@@ -849,12 +849,12 @@ void MixedVersionNestedPdx::toData(PdxWriterPtr pw) {
 
 void MixedVersionNestedPdx::fromData(PdxReaderPtr pr) {
   m_i1 = pr->readInt("i1");
-  m_pd1 = pr->readObject("pd1");
+  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 = pr->readObject("pd2");
+  m_pd2 = std::static_pointer_cast<PdxTypes2>(pr->readObject("pd2"));
   m_i3 = pr->readInt("i3");
   m_i4 = pr->readInt("i4");
 }
@@ -863,8 +863,8 @@ void MixedVersionNestedPdx::fromData(PdxReaderPtr pr) {
  *  PdxInsideIGeodeSerializable
  * *********************************************************/
 PdxInsideIGeodeSerializable::PdxInsideIGeodeSerializable() {
-  m_npdx = new NestedPdx();
-  m_pdx3 = new PdxTypes3();
+  m_npdx = std::make_shared<NestedPdx>();
+  m_pdx3 = std::make_shared<PdxTypes3>();
   m_s1 = (char *)"one";
   m_s2 = (char *)"two";
   m_i1 = 34324;
@@ -880,13 +880,12 @@ PdxInsideIGeodeSerializable::~PdxInsideIGeodeSerializable() {
 int32_t PdxInsideIGeodeSerializable::getHashCode() { return 1; }
 
 bool PdxInsideIGeodeSerializable::equals(SerializablePtr obj) {
-  if (obj == NULLPTR) return false;
+  if (obj == nullptr) return false;
 
-  PdxInsideIGeodeSerializablePtr pap =
-      dynCast<PdxInsideIGeodeSerializablePtr>(obj);
-  if (pap == NULLPTR) return false;
+  auto pap = std::dynamic_pointer_cast<PdxInsideIGeodeSerializable>(obj);
+  if (pap == nullptr) return false;
 
-  // if (pap == this)
+  // if (pap.get() == this)
   //	return true;
 
   if (m_i1 == pap->m_i1 && m_i2 == pap->m_i2 && m_i3 == pap->m_i3 &&


Mime
View raw message