You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by dg...@apache.org on 2018/02/07 18:26:06 UTC

[geode-native] branch develop updated: GEODE-4424: Fix broken examples (#212)

This is an automated email from the ASF dual-hosted git repository.

dgkimura 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 697348f  GEODE-4424: Fix broken examples (#212)
697348f is described below

commit 697348f616a10e09dab5517f505a9e612e46ad2b
Author: Michael Martell <mm...@pivotal.io>
AuthorDate: Wed Feb 7 10:26:03 2018 -0800

    GEODE-4424: Fix broken examples (#212)
---
 examples/cpp/customserializable/Order.cpp | 4 +++-
 examples/cpp/customserializable/Order.hpp | 2 +-
 examples/cpp/customserializable/main.cpp  | 4 ++--
 examples/cpp/customserializer/main.cpp    | 4 ++--
 examples/cpp/put-get-remove/main.cpp      | 6 +++---
 5 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/examples/cpp/customserializable/Order.cpp b/examples/cpp/customserializable/Order.cpp
index d8fdd3e..78322d5 100644
--- a/examples/cpp/customserializable/Order.cpp
+++ b/examples/cpp/customserializable/Order.cpp
@@ -55,7 +55,9 @@ const std::string& Order::getClassName() const {
   return CLASS_NAME;
 }
 
-PdxSerializable* Order::createDeserializable() { return new Order(); }
+std::shared_ptr<PdxSerializable> Order::createDeserializable() {
+  return std::make_shared<Order>();
+}
 
 const std::string Order::ORDER_ID_KEY_ = "order_id";
 const std::string Order::NAME_KEY_ = "name";
diff --git a/examples/cpp/customserializable/Order.hpp b/examples/cpp/customserializable/Order.hpp
index 054c772..27b327b 100644
--- a/examples/cpp/customserializable/Order.hpp
+++ b/examples/cpp/customserializable/Order.hpp
@@ -53,7 +53,7 @@ class Order : public PdxSerializable {
 
   const std::string& getClassName() const override;
 
-  static PdxSerializable* createDeserializable();
+  static std::shared_ptr<PdxSerializable> createDeserializable();
 
  private:
   static const std::string ORDER_ID_KEY_;
diff --git a/examples/cpp/customserializable/main.cpp b/examples/cpp/customserializable/main.cpp
index f1446da..a7c9017 100644
--- a/examples/cpp/customserializable/main.cpp
+++ b/examples/cpp/customserializable/main.cpp
@@ -33,8 +33,8 @@ int main(int argc, char** argv) {
   auto cache = cacheFactory.create();
 
   auto poolFactory = cache.getPoolManager().createFactory();
-  poolFactory->addLocator("localhost", 10334);
-  auto pool = poolFactory->create("pool");
+  poolFactory.addLocator("localhost", 10334);
+  auto pool = poolFactory.create("pool");
 
   auto regionFactory = cache.createRegionFactory(RegionShortcut::PROXY);
   auto region = regionFactory.setPoolName("pool").create("custom_orders");
diff --git a/examples/cpp/customserializer/main.cpp b/examples/cpp/customserializer/main.cpp
index 830bcf8..8460e30 100644
--- a/examples/cpp/customserializer/main.cpp
+++ b/examples/cpp/customserializer/main.cpp
@@ -33,8 +33,8 @@ int main(int argc, char **argv) {
   auto cache = cacheFactory.create();
   auto poolFactory = cache.getPoolManager().createFactory();
 
-  poolFactory->addLocator("localhost", 10334);
-  auto pool = poolFactory->create("pool");
+  poolFactory.addLocator("localhost", 10334);
+  auto pool = poolFactory.create("pool");
   auto regionFactory = cache.createRegionFactory(RegionShortcut::PROXY);
   auto region = regionFactory.setPoolName("pool").create("custom_orders");
 
diff --git a/examples/cpp/put-get-remove/main.cpp b/examples/cpp/put-get-remove/main.cpp
index 32ad9ef..87bcdb6 100644
--- a/examples/cpp/put-get-remove/main.cpp
+++ b/examples/cpp/put-get-remove/main.cpp
@@ -29,9 +29,9 @@ int main(int argc, char** argv) {
   auto cache = cacheFactory.create();
   auto poolFactory = cache.getPoolManager().createFactory();
 
-  poolFactory->addLocator("localhost", 10334);
-  auto pool = poolFactory->create("pool");
-  auto regionFactory = cache.createRegionFactory(PROXY);
+  poolFactory.addLocator("localhost", 10334);
+  auto pool = poolFactory.create("pool");
+  auto regionFactory = cache.createRegionFactory(RegionShortcut::PROXY);
   auto region = regionFactory.setPoolName("pool").create("example_userinfo");
 
   std::cout << "Storing id and username in the region" << std::endl;

-- 
To stop receiving notification emails like this one, please contact
dgkimura@apache.org.