You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by sb...@apache.org on 2017/04/06 13:31:42 UTC

[35/50] [abbrv] ignite git commit: IGNITE-3582: CPP: Replaced passing by pointer with passing by reference

IGNITE-3582: CPP: Replaced passing by pointer with passing by reference


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/5d5ba5cf
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/5d5ba5cf
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/5d5ba5cf

Branch: refs/heads/ignite-2893
Commit: 5d5ba5cf600f284512be54a023d49e3ec7533c76
Parents: 5469626
Author: Igor Sapego <ig...@gmail.com>
Authored: Tue Apr 4 13:45:49 2017 +0300
Committer: Igor Sapego <ig...@gmail.com>
Committed: Tue Apr 4 13:45:49 2017 +0300

----------------------------------------------------------------------
 .../include/ignite/binary/binary_containers.h   |  2 +-
 .../ignite/impl/binary/binary_reader_impl.h     |  6 +-
 .../src/binary_reader_writer_raw_test.cpp       | 12 ++--
 .../core-test/src/binary_reader_writer_test.cpp | 12 ++--
 .../platforms/cpp/core-test/src/cache_test.cpp  |  2 +-
 .../cpp/core-test/src/ignition_test.cpp         | 12 ++--
 .../platforms/cpp/core/include/ignite/ignite.h  | 18 +++---
 .../cpp/core/include/ignite/ignition.h          | 14 ++---
 modules/platforms/cpp/core/src/ignition.cpp     | 62 ++++++++++----------
 9 files changed, 70 insertions(+), 70 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/5d5ba5cf/modules/platforms/cpp/binary/include/ignite/binary/binary_containers.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/binary/include/ignite/binary/binary_containers.h b/modules/platforms/cpp/binary/include/ignite/binary/binary_containers.h
index 9938dd5..fb77b44 100644
--- a/modules/platforms/cpp/binary/include/ignite/binary/binary_containers.h
+++ b/modules/platforms/cpp/binary/include/ignite/binary/binary_containers.h
@@ -596,7 +596,7 @@ namespace ignite
              *
              * @throw IgniteError if there is no element to read.
              */
-            void GetNext(K* key, V* val)
+            void GetNext(K& key, V& val)
             {
                 return impl->ReadElement<K, V>(id, key, val);
             }

http://git-wip-us.apache.org/repos/asf/ignite/blob/5d5ba5cf/modules/platforms/cpp/binary/include/ignite/impl/binary/binary_reader_impl.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/binary/include/ignite/impl/binary/binary_reader_impl.h b/modules/platforms/cpp/binary/include/ignite/impl/binary/binary_reader_impl.h
index 76f6fbf..8be9172 100644
--- a/modules/platforms/cpp/binary/include/ignite/impl/binary/binary_reader_impl.h
+++ b/modules/platforms/cpp/binary/include/ignite/impl/binary/binary_reader_impl.h
@@ -798,7 +798,7 @@ namespace ignite
                  * @param val Value.
                  */
                 template<typename K, typename V>
-                void ReadElement(const int32_t id, K* key, V* val)
+                void ReadElement(const int32_t id, K& key, V& val)
                 {
                     CheckSession(id);
 
@@ -808,8 +808,8 @@ namespace ignite
                         elemRead = 0;
                     }
 
-                    *key = ReadTopObject<K>();
-                    *val = ReadTopObject<V>();
+                    key = ReadTopObject<K>();
+                    val = ReadTopObject<V>();
                 }
 
                 /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/5d5ba5cf/modules/platforms/cpp/core-test/src/binary_reader_writer_raw_test.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core-test/src/binary_reader_writer_raw_test.cpp b/modules/platforms/cpp/core-test/src/binary_reader_writer_raw_test.cpp
index 9e610e6..14d64b0 100644
--- a/modules/platforms/cpp/core-test/src/binary_reader_writer_raw_test.cpp
+++ b/modules/platforms/cpp/core-test/src/binary_reader_writer_raw_test.cpp
@@ -416,7 +416,7 @@ void CheckRawMapEmpty(MapType* mapType)
 
     int8_t key;
     BinaryInner val;
-    BOOST_CHECK_EXCEPTION(mapReader.GetNext(&key, &val), IgniteError, IsBinaryError);
+    BOOST_CHECK_EXCEPTION(mapReader.GetNext(key, val), IgniteError, IsBinaryError);
 
     BOOST_REQUIRE(rawReader.ReadInt8() == 1);
 }
@@ -473,21 +473,21 @@ void CheckRawMap(MapType* mapType)
 
     BOOST_REQUIRE(mapReader.HasNext());
 
-    mapReader.GetNext(&key, &val);
+    mapReader.GetNext(key, val);
     BOOST_REQUIRE(key == 1);
     BOOST_REQUIRE(val.GetValue() == writeVal1.GetValue());
 
-    mapReader.GetNext(&key, &val);
+    mapReader.GetNext(key, val);
     BOOST_REQUIRE(key == 2);
     BOOST_REQUIRE(val.GetValue() == writeVal2.GetValue());
 
-    mapReader.GetNext(&key, &val);
+    mapReader.GetNext(key, val);
     BOOST_REQUIRE(key == 3);
     BOOST_REQUIRE(val.GetValue() == writeVal3.GetValue());
 
     BOOST_REQUIRE(!mapReader.HasNext());
 
-    BOOST_CHECK_EXCEPTION(mapReader.GetNext(&key, &val), IgniteError, IsBinaryError);
+    BOOST_CHECK_EXCEPTION(mapReader.GetNext(key, val), IgniteError, IsBinaryError);
 
     BOOST_REQUIRE(rawReader.ReadInt8() == 1);
 }
@@ -1229,7 +1229,7 @@ BOOST_AUTO_TEST_CASE(TestMapNull)
 
     int8_t key;
     BinaryInner val;
-    BOOST_CHECK_EXCEPTION(mapReader.GetNext(&key, &val), IgniteError, IsBinaryError);
+    BOOST_CHECK_EXCEPTION(mapReader.GetNext(key, val), IgniteError, IsBinaryError);
 
     BOOST_REQUIRE(rawReader.ReadInt8() == 1);
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/5d5ba5cf/modules/platforms/cpp/core-test/src/binary_reader_writer_test.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core-test/src/binary_reader_writer_test.cpp b/modules/platforms/cpp/core-test/src/binary_reader_writer_test.cpp
index 8edc0ff..7802d15 100644
--- a/modules/platforms/cpp/core-test/src/binary_reader_writer_test.cpp
+++ b/modules/platforms/cpp/core-test/src/binary_reader_writer_test.cpp
@@ -542,7 +542,7 @@ void CheckMapEmpty(MapType* mapType)
 
     int8_t key;
     BinaryInner val;
-    BOOST_CHECK_EXCEPTION(mapReader.GetNext(&key, &val), IgniteError, IsBinaryError);
+    BOOST_CHECK_EXCEPTION(mapReader.GetNext(key, val), IgniteError, IsBinaryError);
 
     BOOST_REQUIRE(reader.ReadInt8("field2") == 1);
 }
@@ -611,21 +611,21 @@ void CheckMap(MapType* mapType)
 
     BOOST_REQUIRE(mapReader.HasNext());
 
-    mapReader.GetNext(&key, &val);
+    mapReader.GetNext(key, val);
     BOOST_REQUIRE(key == 1);
     BOOST_REQUIRE(val.GetValue() == writeVal1.GetValue());
 
-    mapReader.GetNext(&key, &val);
+    mapReader.GetNext(key, val);
     BOOST_REQUIRE(key == 2);
     BOOST_REQUIRE(val.GetValue() == writeVal2.GetValue());
 
-    mapReader.GetNext(&key, &val);
+    mapReader.GetNext(key, val);
     BOOST_REQUIRE(key == 3);
     BOOST_REQUIRE(val.GetValue() == writeVal3.GetValue());
 
     BOOST_REQUIRE(!mapReader.HasNext());
 
-    BOOST_CHECK_EXCEPTION(mapReader.GetNext(&key, &val), IgniteError, IsBinaryError);
+    BOOST_CHECK_EXCEPTION(mapReader.GetNext(key, val), IgniteError, IsBinaryError);
 
     BOOST_REQUIRE(reader.ReadInt8("field2") == 1);
 }
@@ -1576,7 +1576,7 @@ BOOST_AUTO_TEST_CASE(TestMapNull)
 
     int8_t key;
     BinaryInner val;
-    BOOST_CHECK_EXCEPTION(mapReader.GetNext(&key, &val), IgniteError, IsBinaryError);
+    BOOST_CHECK_EXCEPTION(mapReader.GetNext(key, val), IgniteError, IsBinaryError);
 
     BOOST_REQUIRE(reader.ReadInt8("field2") == 1);
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/5d5ba5cf/modules/platforms/cpp/core-test/src/cache_test.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core-test/src/cache_test.cpp b/modules/platforms/cpp/core-test/src/cache_test.cpp
index 22ad96c..fef777a 100644
--- a/modules/platforms/cpp/core-test/src/cache_test.cpp
+++ b/modules/platforms/cpp/core-test/src/cache_test.cpp
@@ -623,7 +623,7 @@ BOOST_AUTO_TEST_CASE(TestCreateCache)
     // Attempt to create cache with existing name
     IgniteError err;
 
-    grid0.CreateCache<int, int>("dynamic_cache", &err);
+    grid0.CreateCache<int, int>("dynamic_cache", err);
 
     BOOST_REQUIRE(err.GetCode() != IgniteError::IGNITE_SUCCESS);
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/5d5ba5cf/modules/platforms/cpp/core-test/src/ignition_test.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core-test/src/ignition_test.cpp b/modules/platforms/cpp/core-test/src/ignition_test.cpp
index 52a51d0..5466a3a 100644
--- a/modules/platforms/cpp/core-test/src/ignition_test.cpp
+++ b/modules/platforms/cpp/core-test/src/ignition_test.cpp
@@ -39,14 +39,14 @@ BOOST_AUTO_TEST_CASE(TestIgnition)
     IgniteError err;
 
     // Start two Ignite instances.
-    Ignite grid1 = Ignition::Start(cfg, "ignitionTest-1", &err);
+    Ignite grid1 = Ignition::Start(cfg, "ignitionTest-1", err);
     
     if (err.GetCode() != IgniteError::IGNITE_SUCCESS)
         BOOST_ERROR(err.GetText());
     
     BOOST_REQUIRE(strcmp(grid1.GetName(), "ignitionTest-1") == 0);
 
-    Ignite grid2 = Ignition::Start(cfg, "ignitionTest-2", &err);
+    Ignite grid2 = Ignition::Start(cfg, "ignitionTest-2", err);
 
     if (err.GetCode() != IgniteError::IGNITE_SUCCESS)
         BOOST_ERROR(err.GetText());
@@ -54,7 +54,7 @@ BOOST_AUTO_TEST_CASE(TestIgnition)
     BOOST_REQUIRE(strcmp(grid2.GetName(), "ignitionTest-2") == 0);
 
     // Test get
-    Ignite grid0 = Ignition::Get("ignitionTest-1", &err);
+    Ignite grid0 = Ignition::Get("ignitionTest-1", err);
     
     if (err.GetCode() != IgniteError::IGNITE_SUCCESS)
         BOOST_ERROR(err.GetText());
@@ -64,16 +64,16 @@ BOOST_AUTO_TEST_CASE(TestIgnition)
     // Stop one grid
     Ignition::Stop(grid1.GetName(), true);
     
-    Ignition::Get("ignitionTest-1", &err);
+    Ignition::Get("ignitionTest-1", err);
     BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_GENERIC);
     
-    Ignition::Get("ignitionTest-2", &err);
+    Ignition::Get("ignitionTest-2", err);
     BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_SUCCESS);
 
     // Stop all
     Ignition::StopAll(true);
     
-    Ignition::Get("ignitionTest-2", &err);
+    Ignition::Get("ignitionTest-2", err);
     BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_GENERIC);    
 }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/5d5ba5cf/modules/platforms/cpp/core/include/ignite/ignite.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core/include/ignite/ignite.h b/modules/platforms/cpp/core/include/ignite/ignite.h
index 140ee53..d96f81f 100644
--- a/modules/platforms/cpp/core/include/ignite/ignite.h
+++ b/modules/platforms/cpp/core/include/ignite/ignite.h
@@ -81,7 +81,7 @@ namespace ignite
         {
             IgniteError err;
 
-            cache::Cache<K, V> res = GetCache<K, V>(name, &err);
+            cache::Cache<K, V> res = GetCache<K, V>(name, err);
 
             IgniteError::ThrowIfNeeded(err);
 
@@ -98,9 +98,9 @@ namespace ignite
          * @return Cache.
          */
         template<typename K, typename V>
-        cache::Cache<K, V> GetCache(const char* name, IgniteError* err)
+        cache::Cache<K, V> GetCache(const char* name, IgniteError& err)
         {
-            impl::cache::CacheImpl* cacheImpl = impl.Get()->GetCache<K, V>(name, *err);
+            impl::cache::CacheImpl* cacheImpl = impl.Get()->GetCache<K, V>(name, err);
 
             return cache::Cache<K, V>(cacheImpl);
         }
@@ -118,7 +118,7 @@ namespace ignite
         {
             IgniteError err;
 
-            cache::Cache<K, V> res = GetOrCreateCache<K, V>(name, &err);
+            cache::Cache<K, V> res = GetOrCreateCache<K, V>(name, err);
 
             IgniteError::ThrowIfNeeded(err);
 
@@ -135,9 +135,9 @@ namespace ignite
          * @return Cache.
          */
         template<typename K, typename V>
-        cache::Cache<K, V> GetOrCreateCache(const char* name, IgniteError* err)
+        cache::Cache<K, V> GetOrCreateCache(const char* name, IgniteError& err)
         {
-            impl::cache::CacheImpl* cacheImpl = impl.Get()->GetOrCreateCache<K, V>(name, *err);
+            impl::cache::CacheImpl* cacheImpl = impl.Get()->GetOrCreateCache<K, V>(name, err);
 
             return cache::Cache<K, V>(cacheImpl);
         }
@@ -155,7 +155,7 @@ namespace ignite
         {
             IgniteError err;
 
-            cache::Cache<K, V> res = CreateCache<K, V>(name, &err);
+            cache::Cache<K, V> res = CreateCache<K, V>(name, err);
 
             IgniteError::ThrowIfNeeded(err);
 
@@ -172,9 +172,9 @@ namespace ignite
          * @return Cache.
          */
         template<typename K, typename V>
-        cache::Cache<K, V> CreateCache(const char* name, IgniteError* err)
+        cache::Cache<K, V> CreateCache(const char* name, IgniteError& err)
         {
-            impl::cache::CacheImpl* cacheImpl = impl.Get()->CreateCache<K, V>(name, *err);
+            impl::cache::CacheImpl* cacheImpl = impl.Get()->CreateCache<K, V>(name, err);
 
             return cache::Cache<K, V>(cacheImpl);
         }

http://git-wip-us.apache.org/repos/asf/ignite/blob/5d5ba5cf/modules/platforms/cpp/core/include/ignite/ignition.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core/include/ignite/ignition.h b/modules/platforms/cpp/core/include/ignite/ignition.h
index 57fd51c..f368c6e 100644
--- a/modules/platforms/cpp/core/include/ignite/ignition.h
+++ b/modules/platforms/cpp/core/include/ignite/ignition.h
@@ -51,7 +51,7 @@ namespace ignite
          * @param err Error.
          * @return Ignite instance.
          */
-        static Ignite Start(const IgniteConfiguration& cfg, IgniteError* err);
+        static Ignite Start(const IgniteConfiguration& cfg, IgniteError& err);
 
         /**
          * Start Ignite instance with specific name.
@@ -70,7 +70,7 @@ namespace ignite
          * @param err Error.
          * @return Ignite instance.
          */
-        static Ignite Start(const IgniteConfiguration& cfg, const char* name, IgniteError* err);
+        static Ignite Start(const IgniteConfiguration& cfg, const char* name, IgniteError& err);
 
         /**
          * Get default Ignite instance.
@@ -85,7 +85,7 @@ namespace ignite
          * @param err Error.
          * @return Default Ignite instance.
          */
-        static Ignite Get(IgniteError* err);
+        static Ignite Get(IgniteError& err);
 
         /**
          * Get Ignite instance with the given name.
@@ -102,7 +102,7 @@ namespace ignite
          * @param err Error.
          * @return Ignite instance.
          */
-        static Ignite Get(const char* name, IgniteError* err);
+        static Ignite Get(const char* name, IgniteError& err);
 
         /**
          * Stop default Ignite instance.
@@ -119,7 +119,7 @@ namespace ignite
          * @param err Error.
          * @return True if Ignite instance was stopped by this call.
          */
-        static bool Stop(bool cancel, IgniteError* err);
+        static bool Stop(bool cancel, IgniteError& err);
 
         /**
          * Stop Ignite instance with the given name.
@@ -138,7 +138,7 @@ namespace ignite
          * @param err Error.
          * @return True if Ignite instance was stopped by this call.
          */
-        static bool Stop(const char* name, bool cancel, IgniteError* err);
+        static bool Stop(const char* name, bool cancel, IgniteError& err);
 
         /**
          * Stop all running Ignite instances.
@@ -153,7 +153,7 @@ namespace ignite
          * @param cancel Cancel flag.
          * @param err Error.
          */
-        static void StopAll(bool cancel, IgniteError* err);
+        static void StopAll(bool cancel, IgniteError& err);
     };
 }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/5d5ba5cf/modules/platforms/cpp/core/src/ignition.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core/src/ignition.cpp b/modules/platforms/cpp/core/src/ignition.cpp
index 6a00eab..e12a208 100644
--- a/modules/platforms/cpp/core/src/ignition.cpp
+++ b/modules/platforms/cpp/core/src/ignition.cpp
@@ -182,7 +182,7 @@ namespace ignite
         return Start(cfg, static_cast<const char*>(0));
     }
 
-    Ignite Ignition::Start(const IgniteConfiguration& cfg, IgniteError* err)
+    Ignite Ignition::Start(const IgniteConfiguration& cfg, IgniteError& err)
     {
         return Start(cfg, 0, err);
     }
@@ -191,14 +191,14 @@ namespace ignite
     {
         IgniteError err;
 
-        Ignite res = Start(cfg, name, &err);
+        Ignite res = Start(cfg, name, err);
 
         IgniteError::ThrowIfNeeded(err);
 
         return res;
     }
 
-    Ignite Ignition::Start(const IgniteConfiguration& cfg, const char* name, IgniteError* err)
+    Ignite Ignition::Start(const IgniteConfiguration& cfg, const char* name, IgniteError& err)
     {
         CsLockGuard guard(factoryLock);
 
@@ -209,7 +209,7 @@ namespace ignite
         {
             if (jvmLib.empty())
             {
-                *err = IgniteError(IgniteError::IGNITE_ERR_JVM_LIB_NOT_FOUND,
+                err = IgniteError(IgniteError::IGNITE_ERR_JVM_LIB_NOT_FOUND,
                     "JVM library is not found (did you set JAVA_HOME environment variable?)");
 
                 return Ignite();
@@ -217,7 +217,7 @@ namespace ignite
 
             if (!LoadJvmLibrary(jvmLib))
             {
-                *err = IgniteError(IgniteError::IGNITE_ERR_JVM_LIB_LOAD_FAILED, "Failed to load JVM library.");
+                err = IgniteError(IgniteError::IGNITE_ERR_JVM_LIB_LOAD_FAILED, "Failed to load JVM library.");
 
                 return Ignite();
             }
@@ -239,7 +239,7 @@ namespace ignite
 
         if (cp.empty())
         {
-            *err = IgniteError(IgniteError::IGNITE_ERR_JVM_NO_CLASSPATH,
+            err = IgniteError(IgniteError::IGNITE_ERR_JVM_NO_CLASSPATH,
                 "Java classpath is empty (did you set IGNITE_HOME environment variable?)");
 
             return Ignite();
@@ -275,7 +275,7 @@ namespace ignite
 
         if (!ctx.Get())
         {
-            IgniteError::SetError(jniErr.code, jniErr.errCls, jniErr.errMsg, *err);
+            IgniteError::SetError(jniErr.code, jniErr.errCls, jniErr.errMsg, err);
 
             return Ignite();
         }
@@ -309,7 +309,7 @@ namespace ignite
 
         if (!javaRef)
         {
-            IgniteError::SetError(jniErr.code, jniErr.errCls, jniErr.errMsg, *err);
+            IgniteError::SetError(jniErr.code, jniErr.errCls, jniErr.errMsg, err);
 
             return Ignite();
         }
@@ -333,7 +333,7 @@ namespace ignite
         return Get(static_cast<const char*>(0));
     }
 
-    Ignite Ignition::Get(IgniteError* err)
+    Ignite Ignition::Get(IgniteError& err)
     {
         return Get(0, err);
     }
@@ -342,14 +342,14 @@ namespace ignite
     {
         IgniteError err;
 
-        Ignite res = Get(name, &err);
+        Ignite res = Get(name, err);
 
         IgniteError::ThrowIfNeeded(err);
 
         return res;
     }
 
-    Ignite Ignition::Get(const char* name, IgniteError* err)
+    Ignite Ignition::Get(const char* name, IgniteError& err)
     {
         Ignite res;
 
@@ -364,16 +364,16 @@ namespace ignite
 
             SharedPointer<JniContext> ctx(JniContext::Create(0, 0, JniHandlers(), &jniErr));
 
-            IgniteError::SetError(jniErr.code, jniErr.errCls, jniErr.errMsg, *err);
+            IgniteError::SetError(jniErr.code, jniErr.errCls, jniErr.errMsg, err);
 
-            if (err->GetCode() == IgniteError::IGNITE_SUCCESS)
+            if (err.GetCode() == IgniteError::IGNITE_SUCCESS)
             {
                 // 2. Get environment pointer.
                 long long ptr = ctx.Get()->IgnitionEnvironmentPointer(name0, &jniErr);
 
-                IgniteError::SetError(jniErr.code, jniErr.errCls, jniErr.errMsg, *err);
+                IgniteError::SetError(jniErr.code, jniErr.errCls, jniErr.errMsg, err);
 
-                if (err->GetCode() == IgniteError::IGNITE_SUCCESS)
+                if (err.GetCode() == IgniteError::IGNITE_SUCCESS)
                 {
                     if (ptr != 0)
                     {
@@ -386,7 +386,7 @@ namespace ignite
                         // 4. Get fresh node reference.
                         jobject ref = ctx.Get()->IgnitionInstance(name0, &jniErr);
 
-                        if (err->GetCode() == IgniteError::IGNITE_SUCCESS) {
+                        if (err.GetCode() == IgniteError::IGNITE_SUCCESS) {
                             if (ref)
                             {
                                 IgniteImpl* impl = new IgniteImpl(*env, ref);
@@ -395,14 +395,14 @@ namespace ignite
                             }
                             else
                                 // Error: concurrent node stop.
-                                *err = IgniteError(IgniteError::IGNITE_ERR_GENERIC,
+                                err = IgniteError(IgniteError::IGNITE_ERR_GENERIC,
                                     "Failed to get Ignite instance because it was stopped concurrently.");
 
                         }
                     }
                     else
                         // Error: no node with the given name.
-                        *err = IgniteError(IgniteError::IGNITE_ERR_GENERIC,
+                        err = IgniteError(IgniteError::IGNITE_ERR_GENERIC,
                             "Failed to get Ignite instance because it is either not started yet or already stopped.");
                 }
             }
@@ -411,7 +411,7 @@ namespace ignite
         }
         else
             // Error: no node with the given name.
-            *err = IgniteError(IgniteError::IGNITE_ERR_GENERIC,
+            err = IgniteError(IgniteError::IGNITE_ERR_GENERIC,
                 "Failed to get Ignite instance because it is either not started yet or already stopped.");
 
         factoryLock.Leave();
@@ -424,7 +424,7 @@ namespace ignite
         return Stop(0, cancel);
     }
 
-    bool Ignition::Stop(bool cancel, IgniteError* err)
+    bool Ignition::Stop(bool cancel, IgniteError& err)
     {
         return Stop(0, cancel, err);
     }
@@ -433,14 +433,14 @@ namespace ignite
     {
         IgniteError err;
 
-        bool res = Stop(name, cancel, &err);
+        bool res = Stop(name, cancel, err);
 
         IgniteError::ThrowIfNeeded(err);
 
         return res;
     }
 
-    bool Ignition::Stop(const char* name, bool cancel, IgniteError* err)
+    bool Ignition::Stop(const char* name, bool cancel, IgniteError& err)
     {
         bool res = false;
 
@@ -452,9 +452,9 @@ namespace ignite
 
             SharedPointer<JniContext> ctx(JniContext::Create(0, 0, JniHandlers(), &jniErr));
 
-            IgniteError::SetError(jniErr.code, jniErr.errCls, jniErr.errMsg, *err);
+            IgniteError::SetError(jniErr.code, jniErr.errCls, jniErr.errMsg, err);
 
-            if (err->GetCode() == IgniteError::IGNITE_SUCCESS)
+            if (err.GetCode() == IgniteError::IGNITE_SUCCESS)
             {
                 char* name0 = CopyChars(name);
 
@@ -462,9 +462,9 @@ namespace ignite
 
                 ReleaseChars(name0);
 
-                IgniteError::SetError(jniErr.code, jniErr.errCls, jniErr.errMsg, *err);
+                IgniteError::SetError(jniErr.code, jniErr.errCls, jniErr.errMsg, err);
 
-                if (err->GetCode() == IgniteError::IGNITE_SUCCESS)
+                if (err.GetCode() == IgniteError::IGNITE_SUCCESS)
                     res = res0;
             }
         }
@@ -478,12 +478,12 @@ namespace ignite
     {
         IgniteError err;
 
-        StopAll(cancel, &err);
+        StopAll(cancel, err);
 
         IgniteError::ThrowIfNeeded(err);
     }
 
-    void Ignition::StopAll(bool cancel, IgniteError* err)
+    void Ignition::StopAll(bool cancel, IgniteError& err)
     {
         factoryLock.Enter();
 
@@ -493,13 +493,13 @@ namespace ignite
 
             SharedPointer<JniContext> ctx(JniContext::Create(0, 0, JniHandlers(), &jniErr));
 
-            IgniteError::SetError(jniErr.code, jniErr.errCls, jniErr.errMsg, *err);
+            IgniteError::SetError(jniErr.code, jniErr.errCls, jniErr.errMsg, err);
 
-            if (err->GetCode() == IgniteError::IGNITE_SUCCESS)
+            if (err.GetCode() == IgniteError::IGNITE_SUCCESS)
             {
                 ctx.Get()->IgnitionStopAll(cancel, &jniErr);
 
-                IgniteError::SetError(jniErr.code, jniErr.errCls, jniErr.errMsg, *err);
+                IgniteError::SetError(jniErr.code, jniErr.errCls, jniErr.errMsg, err);
             }
         }