You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by vo...@apache.org on 2015/09/22 08:39:47 UTC

[01/28] ignite git commit: IGNITE-1513: Moved CPP.

Repository: ignite
Updated Branches:
  refs/heads/ignite-1513-final 20a7918bf -> 524f5653e


http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/core/src/impl/portable/portable_writer_impl.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/src/impl/portable/portable_writer_impl.cpp b/modules/platform/src/main/cpp/core/src/impl/portable/portable_writer_impl.cpp
deleted file mode 100644
index 93aacd9..0000000
--- a/modules/platform/src/main/cpp/core/src/impl/portable/portable_writer_impl.cpp
+++ /dev/null
@@ -1,600 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "ignite/impl/portable/portable_writer_impl.h"
-#include "ignite/ignite_error.h"
-
-using namespace ignite::impl::interop;
-using namespace ignite::impl::portable;
-using namespace ignite::portable;
-
-namespace ignite
-{
-    namespace impl
-    {
-        namespace portable
-        {
-            PortableWriterImpl::PortableWriterImpl(InteropOutputStream* stream, PortableIdResolver* idRslvr, 
-                PortableMetadataManager* metaMgr, PortableMetadataHandler* metaHnd) :
-                stream(stream), idRslvr(idRslvr), metaMgr(metaMgr), metaHnd(metaHnd), typeId(idRslvr->GetTypeId()),
-                elemIdGen(0), elemId(0), elemCnt(0), elemPos(-1), rawPos(-1)
-            {
-                // No-op.
-            }
-            
-            PortableWriterImpl::PortableWriterImpl(InteropOutputStream* stream, PortableMetadataManager* metaMgr) :
-                stream(stream), idRslvr(NULL), metaMgr(metaMgr), metaHnd(NULL), typeId(0), 
-                elemIdGen(0), elemId(0), elemCnt(0), elemPos(-1), rawPos(0)
-            {
-                // No-op.
-            }
-
-            void PortableWriterImpl::WriteInt8(const int8_t val)
-            {
-                WritePrimitiveRaw<int8_t>(val, PortableUtils::WriteInt8);
-            }
-
-            void PortableWriterImpl::WriteInt8Array(const int8_t* val, const int32_t len)
-            {
-                WritePrimitiveArrayRaw<int8_t>(val, len, PortableUtils::WriteInt8Array, IGNITE_TYPE_ARRAY_BYTE);
-            }
-
-            void PortableWriterImpl::WriteInt8(const char* fieldName, const int8_t val)
-            {
-                WritePrimitive<int8_t>(fieldName, val, PortableUtils::WriteInt8, IGNITE_TYPE_BYTE, 1);
-            }
-
-            void PortableWriterImpl::WriteInt8Array(const char* fieldName, const int8_t* val, const int32_t len)
-            {
-                WritePrimitiveArray<int8_t>(fieldName, val, len, PortableUtils::WriteInt8Array, IGNITE_TYPE_ARRAY_BYTE, 0);
-            }
-
-            void PortableWriterImpl::WriteBool(const bool val)
-            {
-                WritePrimitiveRaw<bool>(val, PortableUtils::WriteBool);
-            }
-
-            void PortableWriterImpl::WriteBoolArray(const bool* val, const int32_t len)
-            {
-                WritePrimitiveArrayRaw<bool>(val, len, PortableUtils::WriteBoolArray, IGNITE_TYPE_ARRAY_BOOL);
-            }
-
-            void PortableWriterImpl::WriteBool(const char* fieldName, const bool val)
-            {
-                WritePrimitive<bool>(fieldName, val, PortableUtils::WriteBool, IGNITE_TYPE_BOOL, 1);
-            }
-
-            void PortableWriterImpl::WriteBoolArray(const char* fieldName, const bool* val, const int32_t len)
-            {
-                WritePrimitiveArray<bool>(fieldName, val, len, PortableUtils::WriteBoolArray, IGNITE_TYPE_ARRAY_BOOL, 0);
-            }
-
-            void PortableWriterImpl::WriteInt16(const int16_t val)
-            {
-                WritePrimitiveRaw<int16_t>(val, PortableUtils::WriteInt16);
-            }
-
-            void PortableWriterImpl::WriteInt16Array(const int16_t* val, const int32_t len)
-            {
-                WritePrimitiveArrayRaw<int16_t>(val, len, PortableUtils::WriteInt16Array, IGNITE_TYPE_ARRAY_SHORT);
-            }
-
-            void PortableWriterImpl::WriteInt16(const char* fieldName, const int16_t val)
-            {
-                WritePrimitive<int16_t>(fieldName, val, PortableUtils::WriteInt16, IGNITE_TYPE_SHORT, 2);
-            }
-
-            void PortableWriterImpl::WriteInt16Array(const char* fieldName, const int16_t* val, const int32_t len)
-            {
-                WritePrimitiveArray<int16_t>(fieldName, val, len, PortableUtils::WriteInt16Array, IGNITE_TYPE_ARRAY_SHORT, 1);
-            }
-
-            void PortableWriterImpl::WriteUInt16(const uint16_t val)
-            {
-                WritePrimitiveRaw<uint16_t>(val, PortableUtils::WriteUInt16);
-            }
-
-            void PortableWriterImpl::WriteUInt16Array(const uint16_t* val, const int32_t len)
-            {
-                WritePrimitiveArrayRaw<uint16_t>(val, len, PortableUtils::WriteUInt16Array, IGNITE_TYPE_ARRAY_CHAR);
-            }
-
-            void PortableWriterImpl::WriteUInt16(const char* fieldName, const uint16_t val)
-            {
-                WritePrimitive<uint16_t>(fieldName, val, PortableUtils::WriteUInt16, IGNITE_TYPE_CHAR, 2);
-            }
-
-            void PortableWriterImpl::WriteUInt16Array(const char* fieldName, const uint16_t* val, const int32_t len)
-            {
-                WritePrimitiveArray<uint16_t>(fieldName, val, len, PortableUtils::WriteUInt16Array, IGNITE_TYPE_ARRAY_CHAR, 1);
-            }
-
-            void PortableWriterImpl::WriteInt32(const int32_t val)
-            {
-                WritePrimitiveRaw<int32_t>(val, PortableUtils::WriteInt32);
-            }
-
-            void PortableWriterImpl::WriteInt32Array(const int32_t* val, const int32_t len)
-            {
-                WritePrimitiveArrayRaw<int32_t>(val, len, PortableUtils::WriteInt32Array, IGNITE_TYPE_ARRAY_INT);
-            }
-
-            void PortableWriterImpl::WriteInt32(const char* fieldName, const int32_t val)
-            {
-                WritePrimitive<int32_t>(fieldName, val, PortableUtils::WriteInt32, IGNITE_TYPE_INT, 4);
-            }
-
-            void PortableWriterImpl::WriteInt32Array(const char* fieldName, const int32_t* val, const int32_t len)
-            {
-                WritePrimitiveArray<int32_t>(fieldName, val, len, PortableUtils::WriteInt32Array, IGNITE_TYPE_ARRAY_INT, 2);
-            }
-
-            void PortableWriterImpl::WriteInt64(const int64_t val)
-            {
-                WritePrimitiveRaw<int64_t>(val, PortableUtils::WriteInt64);
-            }
-
-            void PortableWriterImpl::WriteInt64Array(const int64_t* val, const int32_t len)
-            {
-                WritePrimitiveArrayRaw<int64_t>(val, len, PortableUtils::WriteInt64Array, IGNITE_TYPE_ARRAY_LONG);
-            }
-
-            void PortableWriterImpl::WriteInt64(const char* fieldName, const int64_t val)
-            {
-                WritePrimitive<int64_t>(fieldName, val, PortableUtils::WriteInt64, IGNITE_TYPE_LONG, 8);
-            }
-
-            void PortableWriterImpl::WriteInt64Array(const char* fieldName, const int64_t* val, const int32_t len)
-            {
-                WritePrimitiveArray<int64_t>(fieldName, val, len, PortableUtils::WriteInt64Array, IGNITE_TYPE_ARRAY_LONG, 3);
-            }
-
-            void PortableWriterImpl::WriteFloat(const float val)
-            {
-                WritePrimitiveRaw<float>(val, PortableUtils::WriteFloat);
-            }
-
-            void PortableWriterImpl::WriteFloatArray(const float* val, const int32_t len)
-            {
-                WritePrimitiveArrayRaw<float>(val, len, PortableUtils::WriteFloatArray, IGNITE_TYPE_ARRAY_FLOAT);
-            }
-
-            void PortableWriterImpl::WriteFloat(const char* fieldName, const float val)
-            {
-                WritePrimitive<float>(fieldName, val, PortableUtils::WriteFloat, IGNITE_TYPE_FLOAT, 4);
-            }
-
-            void PortableWriterImpl::WriteFloatArray(const char* fieldName, const float* val, const int32_t len)
-            {
-                WritePrimitiveArray<float>(fieldName, val, len, PortableUtils::WriteFloatArray, IGNITE_TYPE_ARRAY_FLOAT, 2);
-            }
-
-            void PortableWriterImpl::WriteDouble(const double val)
-            {
-                WritePrimitiveRaw<double>(val, PortableUtils::WriteDouble);
-            }
-
-            void PortableWriterImpl::WriteDoubleArray(const double* val, const int32_t len)
-            {
-                WritePrimitiveArrayRaw<double>(val, len, PortableUtils::WriteDoubleArray, IGNITE_TYPE_ARRAY_DOUBLE);
-            }
-
-            void PortableWriterImpl::WriteDouble(const char* fieldName, const double val)
-            {
-                WritePrimitive<double>(fieldName, val, PortableUtils::WriteDouble, IGNITE_TYPE_DOUBLE, 8);
-            }
-
-            void PortableWriterImpl::WriteDoubleArray(const char* fieldName, const double* val, const int32_t len)
-            {
-                WritePrimitiveArray<double>(fieldName, val, len, PortableUtils::WriteDoubleArray, IGNITE_TYPE_ARRAY_DOUBLE, 3);
-            }
-
-            void PortableWriterImpl::WriteGuid(const Guid val)
-            {                
-                CheckRawMode(true);
-                CheckSingleMode(true);
-
-                stream->WriteInt8(IGNITE_TYPE_UUID);
-
-                PortableUtils::WriteGuid(stream, val);
-            }
-
-            void PortableWriterImpl::WriteGuidArray(const Guid* val, const int32_t len)
-            {
-                CheckRawMode(true);
-                CheckSingleMode(true);
-                
-                if (val)
-                {
-                    stream->WriteInt8(IGNITE_TYPE_ARRAY_UUID);
-                    stream->WriteInt32(len);
-
-                    for (int i = 0; i < len; i++)
-                    {
-                        Guid elem = *(val + i);
-
-                        stream->WriteInt8(IGNITE_TYPE_UUID);
-                        PortableUtils::WriteGuid(stream, elem);
-                    }
-                }
-                else
-                    stream->WriteInt8(IGNITE_HDR_NULL);
-            }
-
-            void PortableWriterImpl::WriteGuid(const char* fieldName, const Guid val)
-            {
-                CheckRawMode(false);
-                CheckSingleMode(true);
-
-                WriteFieldIdAndLength(fieldName, IGNITE_TYPE_UUID, 1 + 16);
-
-                stream->WriteInt8(IGNITE_TYPE_UUID);
-
-                PortableUtils::WriteGuid(stream, val);
-            }
-
-            void PortableWriterImpl::WriteGuidArray(const char* fieldName, const Guid* val, const int32_t len)
-            {
-                CheckRawMode(false);
-                CheckSingleMode(true);
-
-                WriteFieldId(fieldName, IGNITE_TYPE_ARRAY_UUID);
-
-                if (val)
-                {
-                    stream->WriteInt32(5 + len * 17);
-                    stream->WriteInt8(IGNITE_TYPE_ARRAY_UUID);
-                    stream->WriteInt32(len);
-
-                    for (int i = 0; i < len; i++)
-                    {
-                        Guid elem = *(val + i);
-
-                        WriteTopObject(elem);
-                    }
-                }
-                else
-                {
-                    stream->WriteInt32(1);
-                    stream->WriteInt8(IGNITE_HDR_NULL);
-                }
-            }
-
-            void PortableWriterImpl::WriteString(const char* val, const int32_t len)
-            {
-                CheckRawMode(true);
-                CheckSingleMode(true);
-
-                if (val) 
-                {
-                    stream->WriteInt8(IGNITE_TYPE_STRING);
-
-                    PortableUtils::WriteString(stream, val, len);
-                }
-                else
-                    stream->WriteInt8(IGNITE_HDR_NULL);
-            }
-
-            void PortableWriterImpl::WriteString(const char* fieldName, const char* val, const int32_t len)
-            {
-                CheckRawMode(false);
-                CheckSingleMode(true);
-
-                WriteFieldId(fieldName, IGNITE_TYPE_STRING);
-                
-                if (val)
-                {
-                    int32_t lenPos = stream->Position();
-                    stream->Position(lenPos + 4);
-
-                    stream->WriteInt8(IGNITE_TYPE_STRING);
-                    stream->WriteBool(false);
-                    stream->WriteInt32(len);
-
-                    for (int i = 0; i < len; i++)
-                        stream->WriteUInt16(*(val + i));
-
-                    stream->WriteInt32(lenPos, stream->Position() - lenPos - 4);
-                }
-                else
-                {
-                    stream->WriteInt32(1);
-                    stream->WriteInt8(IGNITE_HDR_NULL);
-                }
-            }
-
-            int32_t PortableWriterImpl::WriteStringArray()
-            {
-                StartContainerSession(true);
-
-                stream->WriteInt8(IGNITE_TYPE_ARRAY_STRING);
-                stream->Position(stream->Position() + 4);
-
-                return elemId;
-            }
-
-            int32_t PortableWriterImpl::WriteStringArray(const char* fieldName)
-            {
-                StartContainerSession(false);
-
-                WriteFieldIdSkipLength(fieldName, IGNITE_TYPE_ARRAY_STRING);
-
-                stream->WriteInt8(IGNITE_TYPE_ARRAY_STRING);
-                stream->Position(stream->Position() + 4);
-
-                return elemId;
-            }
-
-            void PortableWriterImpl::WriteStringElement(int32_t id, const char* val, int32_t len)
-            {
-                CheckSession(id);
-
-                if (val)
-                {
-                    stream->WriteInt8(IGNITE_TYPE_STRING);
-
-                    PortableUtils::WriteString(stream, val, len);
-                }
-                else
-                    stream->WriteInt8(IGNITE_HDR_NULL);
-
-                elemCnt++;
-            }
-
-            void PortableWriterImpl::WriteNull()
-            {
-                CheckRawMode(true);
-                CheckSingleMode(true);
-
-                stream->WriteInt8(IGNITE_HDR_NULL);
-            }
-
-            void PortableWriterImpl::WriteNull(const char* fieldName)
-            {
-                CheckRawMode(false);
-                CheckSingleMode(true);
-
-                WriteFieldIdAndLength(fieldName, IGNITE_TYPE_OBJECT, 1);
-                stream->WriteInt8(IGNITE_HDR_NULL);
-            }
-
-            int32_t PortableWriterImpl::WriteArray()
-            {
-                StartContainerSession(true);
-                
-                stream->WriteInt8(IGNITE_TYPE_ARRAY);
-                stream->Position(stream->Position() + 4);
-
-                return elemId;
-            }
-
-            int32_t PortableWriterImpl::WriteArray(const char* fieldName)
-            {
-                StartContainerSession(false);
-
-                WriteFieldIdSkipLength(fieldName, IGNITE_TYPE_ARRAY);
-
-                stream->WriteInt8(IGNITE_TYPE_ARRAY);
-                stream->Position(stream->Position() + 4);
-
-                return elemId;
-            }
-
-            int32_t PortableWriterImpl::WriteCollection(CollectionType typ)
-            {
-                StartContainerSession(true);
-
-                stream->WriteInt8(IGNITE_TYPE_COLLECTION);
-                stream->Position(stream->Position() + 4);
-                stream->WriteInt8(typ);
-
-                return elemId;
-            }
-
-            int32_t PortableWriterImpl::WriteCollection(const char* fieldName, CollectionType typ)
-            {
-                StartContainerSession(false);
-                
-                WriteFieldIdSkipLength(fieldName, IGNITE_TYPE_COLLECTION);
-
-                stream->WriteInt8(IGNITE_TYPE_COLLECTION);
-                stream->Position(stream->Position() + 4);
-                stream->WriteInt8(typ);
-
-                return elemId;
-            }
-
-            int32_t PortableWriterImpl::WriteMap(ignite::portable::MapType typ)
-            {
-                StartContainerSession(true);
-
-                stream->WriteInt8(IGNITE_TYPE_MAP);
-                stream->Position(stream->Position() + 4);
-                stream->WriteInt8(typ);
-
-                return elemId;
-            }
-
-            int32_t PortableWriterImpl::WriteMap(const char* fieldName, ignite::portable::MapType typ)
-            {
-                StartContainerSession(false);
-
-                WriteFieldIdSkipLength(fieldName, IGNITE_TYPE_MAP);
-                
-                stream->WriteInt8(IGNITE_TYPE_MAP);
-                stream->Position(stream->Position() + 4);
-                stream->WriteInt8(typ);
-
-                return elemId;
-            }
-
-            void PortableWriterImpl::CommitContainer(int32_t id)
-            {
-                CheckSession(id);
-
-                if (rawPos == -1)
-                {
-                    int32_t len = stream->Position() - elemPos - 4;
-
-                    stream->WriteInt32(elemPos + 4, len);
-                    stream->WriteInt32(elemPos + 9, elemCnt);
-                }
-                else
-                    stream->WriteInt32(elemPos + 1, elemCnt);
-
-                elemId = 0;
-                elemCnt = 0;
-                elemPos = -1;
-            }
-            
-            void PortableWriterImpl::SetRawMode()
-            {
-                CheckRawMode(false);
-                CheckSingleMode(true);
-
-                rawPos = stream->Position();
-            }
-
-            int32_t PortableWriterImpl::GetRawPosition()
-            {
-                return rawPos == -1 ? stream->Position() : rawPos;
-            }
-
-            void PortableWriterImpl::CheckRawMode(bool expected)
-            {
-                bool rawMode = rawPos != -1;
-
-                if (expected && !rawMode) {
-                    IGNITE_ERROR_1(IgniteError::IGNITE_ERR_PORTABLE, "Operation can be performed only in raw mode.");
-                }
-                else if (!expected && rawMode) {
-                    IGNITE_ERROR_1(IgniteError::IGNITE_ERR_PORTABLE, "Operation cannot be performed in raw mode.");
-                }
-            }
-
-            void PortableWriterImpl::CheckSingleMode(bool expected)
-            {
-                if (expected && elemId != 0) {
-                    IGNITE_ERROR_1(IgniteError::IGNITE_ERR_PORTABLE, "Operation cannot be performed when container is being written.");
-                }
-                else if (!expected && elemId == 0) {
-                    IGNITE_ERROR_1(IgniteError::IGNITE_ERR_PORTABLE, "Operation can be performed only when container is being written.");
-                }
-            }
-
-            void PortableWriterImpl::StartContainerSession(bool expRawMode)
-            {
-                CheckRawMode(expRawMode);
-                CheckSingleMode(true);
-
-                elemId = ++elemIdGen;
-                elemPos = stream->Position();
-            }
-
-            void PortableWriterImpl::CheckSession(int32_t expSes)
-            {
-                if (elemId != expSes) 
-                {
-                    IGNITE_ERROR_1(IgniteError::IGNITE_ERR_PORTABLE, "Containter write session has been finished or is not started yet.");
-                }
-            }
-
-            void PortableWriterImpl::WriteFieldId(const char* fieldName, int32_t fieldTypeId)
-            {
-                int32_t fieldId = idRslvr->GetFieldId(typeId, fieldName);
-                
-                stream->WriteInt32(fieldId);
-
-                if (metaHnd)
-                    metaHnd->OnFieldWritten(fieldId, fieldName, fieldTypeId);
-            }
-
-            void PortableWriterImpl::WriteFieldIdSkipLength(const char* fieldName, int32_t fieldTypeId)
-            {
-                WriteFieldId(fieldName, fieldTypeId);
-
-                stream->Position(stream->Position() + 4);
-            }
-
-            void PortableWriterImpl::WriteFieldIdAndLength(const char* fieldName, int32_t fieldTypeId, int32_t len)
-            {
-                WriteFieldId(fieldName, fieldTypeId);
-
-                stream->WriteInt32(len);
-            }
-            
-            template <>
-            void PortableWriterImpl::WriteTopObject<int8_t>(const int8_t& obj)
-            {
-                WriteTopObject0<int8_t>(obj, PortableUtils::WriteInt8, IGNITE_TYPE_BYTE);
-            }
-
-            template <>
-            void PortableWriterImpl::WriteTopObject<bool>(const bool& obj)
-            {
-                WriteTopObject0<bool>(obj, PortableUtils::WriteBool, IGNITE_TYPE_BOOL);
-            }
-
-            template <>
-            void PortableWriterImpl::WriteTopObject<int16_t>(const int16_t& obj)
-            {
-                WriteTopObject0<int16_t>(obj, PortableUtils::WriteInt16, IGNITE_TYPE_SHORT);
-            }
-
-            template <>
-            void PortableWriterImpl::WriteTopObject<uint16_t>(const uint16_t& obj)
-            {
-                WriteTopObject0<uint16_t>(obj, PortableUtils::WriteUInt16, IGNITE_TYPE_CHAR);
-            }
-
-            template <>
-            void PortableWriterImpl::WriteTopObject<int32_t>(const int32_t& obj)
-            {
-                WriteTopObject0<int32_t>(obj, PortableUtils::WriteInt32, IGNITE_TYPE_INT);
-            }
-
-            template <>
-            void PortableWriterImpl::WriteTopObject<int64_t>(const int64_t& obj)
-            {
-                WriteTopObject0<int64_t>(obj, PortableUtils::WriteInt64, IGNITE_TYPE_LONG);
-            }
-
-            template <>
-            void PortableWriterImpl::WriteTopObject<float>(const float& obj)
-            {
-                WriteTopObject0<float>(obj, PortableUtils::WriteFloat, IGNITE_TYPE_FLOAT);
-            }
-
-            template <>
-            void PortableWriterImpl::WriteTopObject<double>(const double& obj)
-            {
-                WriteTopObject0<double>(obj, PortableUtils::WriteDouble, IGNITE_TYPE_DOUBLE);
-            }
-
-            template <>
-            void PortableWriterImpl::WriteTopObject<Guid>(const Guid& obj)
-            {
-                WriteTopObject0<Guid>(obj, PortableUtils::WriteGuid, IGNITE_TYPE_UUID);
-            }
-
-            InteropOutputStream* PortableWriterImpl::GetStream()
-            {
-                return stream;
-            }
-        }
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/core/src/portable/portable_containers.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/src/portable/portable_containers.cpp b/modules/platform/src/main/cpp/core/src/portable/portable_containers.cpp
deleted file mode 100644
index 8270a13..0000000
--- a/modules/platform/src/main/cpp/core/src/portable/portable_containers.cpp
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- 
-#include "ignite/portable/portable_containers.h"
-
-using namespace ignite::impl::portable;
-
-namespace ignite
-{
-    namespace portable
-    {
-        PortableStringArrayWriter::PortableStringArrayWriter(PortableWriterImpl* impl, const int32_t id) : 
-            impl(impl), id(id)
-        {
-            // No-op.
-        }
-
-        void PortableStringArrayWriter::Write(const char* val)
-        {
-            if (val)
-                Write(val, static_cast<int32_t>(strlen(val)));
-            else
-                Write(NULL, -1);
-        }
-
-        void PortableStringArrayWriter::Write(const char* val, const int32_t len)
-        {
-            impl->WriteStringElement(id, val, len);
-        }
-
-        void PortableStringArrayWriter::Close()
-        {
-            impl->CommitContainer(id);
-        }
-
-        PortableStringArrayReader::PortableStringArrayReader(impl::portable::PortableReaderImpl* impl, 
-            int32_t id, int32_t size) : impl(impl), id(id), size(size)
-        {
-            // No-op.
-        }
-
-        bool PortableStringArrayReader::HasNext()
-        {
-            return impl->HasNextElement(id);
-        }
-
-        int32_t PortableStringArrayReader::GetNext(char* res, const int32_t len)
-        {
-            return impl->ReadStringElement(id, res, len);
-        }
-
-        int32_t PortableStringArrayReader::GetSize()
-        {
-            return size;
-        }
-
-        bool PortableStringArrayReader::IsNull()
-        {
-            return size == -1;
-        }
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/core/src/portable/portable_raw_reader.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/src/portable/portable_raw_reader.cpp b/modules/platform/src/main/cpp/core/src/portable/portable_raw_reader.cpp
deleted file mode 100644
index f659913..0000000
--- a/modules/platform/src/main/cpp/core/src/portable/portable_raw_reader.cpp
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#include "ignite/impl/portable/portable_reader_impl.h"
-#include "ignite/portable/portable_raw_reader.h"
-
-using namespace ignite::impl::portable;
-
-namespace ignite
-{
-    namespace portable
-    {        
-        PortableRawReader::PortableRawReader(PortableReaderImpl* impl) : impl(impl)
-        {
-            // No-op.
-        }
-        
-        int8_t PortableRawReader::ReadInt8()
-        {
-            return impl->ReadInt8();
-        }
-
-        int32_t PortableRawReader::ReadInt8Array(int8_t* res, const int32_t len)
-        {
-            return impl->ReadInt8Array(res, len);
-        }
-        
-        bool PortableRawReader::ReadBool()
-        {
-            return impl->ReadBool();
-        }
-
-        int32_t PortableRawReader::ReadBoolArray(bool* res, const int32_t len)
-        {
-            return impl->ReadBoolArray(res, len);
-        }
-
-        int16_t PortableRawReader::ReadInt16()
-        {
-            return impl->ReadInt16();
-        }
-        
-        int32_t PortableRawReader::ReadInt16Array(int16_t* res, const int32_t len)
-        {
-            return impl->ReadInt16Array(res, len);
-        }
-
-        uint16_t PortableRawReader::ReadUInt16()
-        {
-            return impl->ReadUInt16();
-        }
-
-        int32_t PortableRawReader::ReadUInt16Array(uint16_t* res, const int32_t len)
-        {
-            return impl->ReadUInt16Array(res, len);
-        }
-
-        int32_t PortableRawReader::ReadInt32()
-        {
-            return impl->ReadInt32();
-        }
-        
-        int32_t PortableRawReader::ReadInt32Array(int32_t* res, const int32_t len)
-        {
-            return impl->ReadInt32Array(res, len);
-        }
-
-        int64_t PortableRawReader::ReadInt64()
-        {
-            return impl->ReadInt64();
-        }
-
-        int32_t PortableRawReader::ReadInt64Array(int64_t* res, const int32_t len)
-        {
-            return impl->ReadInt64Array(res, len);
-        }
-
-        float PortableRawReader::ReadFloat()
-        {
-            return impl->ReadFloat();
-        }
-        
-        int32_t PortableRawReader::ReadFloatArray(float* res, const int32_t len)
-        {
-            return impl->ReadFloatArray(res, len);
-        }
-
-        double PortableRawReader::ReadDouble()
-        {
-            return impl->ReadDouble();
-        }
-        
-        int32_t PortableRawReader::ReadDoubleArray(double* res, const int32_t len)
-        {
-            return impl->ReadDoubleArray(res, len);
-        }
-        
-        Guid PortableRawReader::ReadGuid()
-        {
-            return impl->ReadGuid();
-        }
-
-        int32_t PortableRawReader::ReadGuidArray(Guid* res, const int32_t len)
-        {
-            return impl->ReadGuidArray(res, len);
-        }        
-
-        int32_t PortableRawReader::ReadString(char* res, const int32_t len)
-        {
-            return impl->ReadString(res, len);
-        }
-
-        PortableStringArrayReader PortableRawReader::ReadStringArray()
-        {
-            int32_t size;
-
-            int32_t id = impl->ReadStringArray(&size);
-
-            return PortableStringArrayReader(impl, id, size);
-        }
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/core/src/portable/portable_raw_writer.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/src/portable/portable_raw_writer.cpp b/modules/platform/src/main/cpp/core/src/portable/portable_raw_writer.cpp
deleted file mode 100644
index c682abe..0000000
--- a/modules/platform/src/main/cpp/core/src/portable/portable_raw_writer.cpp
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "ignite/impl/portable/portable_writer_impl.h"
-#include "ignite/portable/portable_raw_writer.h"
-
-using namespace ignite::impl::portable;
-
-namespace ignite
-{
-    namespace portable
-    {
-        PortableRawWriter::PortableRawWriter(PortableWriterImpl* impl) : impl(impl)
-        {
-            // No-op.
-        }
-
-        void PortableRawWriter::WriteInt8(const int8_t val)
-        {
-            impl->WriteInt8(val);
-        }
-
-        void PortableRawWriter::WriteInt8Array(const int8_t* val, const int32_t len)
-        {
-            impl->WriteInt8Array(val, len);
-        }
-
-        void PortableRawWriter::WriteBool(const bool val)
-        {
-            impl->WriteBool(val);
-        }
-
-        void PortableRawWriter::WriteBoolArray(const bool* val, const int32_t len)
-        {            
-            impl->WriteBoolArray(val, len);
-        }
-
-        void PortableRawWriter::WriteInt16(const int16_t val)
-        {
-            impl->WriteInt16(val);
-        }
-
-        void PortableRawWriter::WriteInt16Array(const int16_t* val, const int32_t len)
-        {
-            impl->WriteInt16Array(val, len);
-        }
-
-        void PortableRawWriter::WriteUInt16(const uint16_t val)
-        {
-            impl->WriteUInt16(val);
-        }
-
-        void PortableRawWriter::WriteUInt16Array(const uint16_t* val, const int32_t len)
-        {
-            impl->WriteUInt16Array(val, len);
-        }
-
-        void PortableRawWriter::WriteInt32(const int32_t val)
-        {
-            impl->WriteInt32(val);
-        }
-
-        void PortableRawWriter::WriteInt32Array(const int32_t* val, const int32_t len)
-        {
-            impl->WriteInt32Array(val, len);
-        }
-
-        void PortableRawWriter::WriteInt64(const int64_t val)
-        {
-            impl->WriteInt64(val);
-        }
-
-        void PortableRawWriter::WriteInt64Array(const int64_t* val, const int32_t len)
-        {
-            impl->WriteInt64Array(val, len);
-        }
-
-        void PortableRawWriter::WriteFloat(const float val)
-        {
-            impl->WriteFloat(val);
-        }
-
-        void PortableRawWriter::WriteFloatArray(const float* val, const int32_t len)
-        {
-            impl->WriteFloatArray(val, len);
-        }
-
-        void PortableRawWriter::WriteDouble(const double val)
-        {
-            impl->WriteDouble(val);
-        }
-
-        void PortableRawWriter::WriteDoubleArray(const double* val, const int32_t len)
-        {
-            impl->WriteDoubleArray(val, len);
-        }
-
-        void PortableRawWriter::WriteGuid(const Guid val)
-        {
-            impl->WriteGuid(val);
-        }
-
-        void PortableRawWriter::WriteGuidArray(const Guid* val, const int32_t len)
-        {
-            impl->WriteGuidArray(val, len);
-        }
-
-        void PortableRawWriter::WriteString(const char* val)
-        {
-            if (val)
-                WriteString(val, static_cast<int32_t>(strlen(val)));
-            else
-                WriteNull();
-        }
-
-        void PortableRawWriter::WriteString(const char* val, const int32_t len)
-        {
-            impl->WriteString(val, len);
-        }
-
-        PortableStringArrayWriter PortableRawWriter::WriteStringArray()
-        {
-            int32_t id = impl->WriteStringArray();
-
-            return PortableStringArrayWriter(impl, id);
-        }
-
-        void PortableRawWriter::WriteNull()
-        {
-            impl->WriteNull();
-        }
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/core/src/portable/portable_reader.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/src/portable/portable_reader.cpp b/modules/platform/src/main/cpp/core/src/portable/portable_reader.cpp
deleted file mode 100644
index 515216d..0000000
--- a/modules/platform/src/main/cpp/core/src/portable/portable_reader.cpp
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#include "ignite/impl/portable/portable_reader_impl.h"
-#include "ignite/portable/portable_reader.h"
-
-using namespace ignite::impl::portable;
-
-namespace ignite
-{
-    namespace portable
-    {
-        PortableReader::PortableReader(PortableReaderImpl* impl) : impl(impl)
-        {
-            // No-op.
-        }
-        
-        int8_t PortableReader::ReadInt8(const char* fieldName)
-        {
-            return impl->ReadInt8(fieldName);
-        }
-
-        int32_t PortableReader::ReadInt8Array(const char* fieldName, int8_t* res, const int32_t len)
-        {
-            return impl->ReadInt8Array(fieldName, res, len);
-        }
-
-        bool PortableReader::ReadBool(const char* fieldName)
-        {
-            return impl->ReadBool(fieldName);
-        }
-
-        int32_t PortableReader::ReadBoolArray(const char* fieldName, bool* res, const int32_t len)
-        {
-            return impl->ReadBoolArray(fieldName, res, len);
-        }
-
-        int16_t PortableReader::ReadInt16(const char* fieldName)
-        {
-            return impl->ReadInt16(fieldName);
-        }
-
-        int32_t PortableReader::ReadInt16Array(const char* fieldName, int16_t* res, const int32_t len)
-        {
-            return impl->ReadInt16Array(fieldName, res, len);
-        }
-
-        uint16_t PortableReader::ReadUInt16(const char* fieldName)
-        {
-            return impl->ReadUInt16(fieldName);
-        }
-
-        int32_t PortableReader::ReadUInt16Array(const char* fieldName, uint16_t* res, const int32_t len)
-        {
-            return impl->ReadUInt16Array(fieldName, res, len);
-        }
-
-        int32_t PortableReader::ReadInt32(const char* fieldName)
-        {
-            return impl->ReadInt32(fieldName);
-        }
-
-        int32_t PortableReader::ReadInt32Array(const char* fieldName, int32_t* res, const int32_t len)
-        {
-            return impl->ReadInt32Array(fieldName, res, len);
-        }
-
-        int64_t PortableReader::ReadInt64(const char* fieldName)
-        {
-            return impl->ReadInt64(fieldName);
-        }
-
-        int32_t PortableReader::ReadInt64Array(const char* fieldName, int64_t* res, const int32_t len)
-        {
-            return impl->ReadInt64Array(fieldName, res, len);
-        }
-
-        float PortableReader::ReadFloat(const char* fieldName)
-        {
-            return impl->ReadFloat(fieldName);
-        }
-
-        int32_t PortableReader::ReadFloatArray(const char* fieldName, float* res, const int32_t len)
-        {
-            return impl->ReadFloatArray(fieldName, res, len);
-        }
-
-        double PortableReader::ReadDouble(const char* fieldName)
-        {
-            return impl->ReadDouble(fieldName);
-        }
-
-        int32_t PortableReader::ReadDoubleArray(const char* fieldName, double* res, const int32_t len)
-        {
-            return impl->ReadDoubleArray(fieldName, res, len);
-        }
-
-        Guid PortableReader::ReadGuid(const char* fieldName)
-        {
-            return impl->ReadGuid(fieldName);
-        }
-
-        int32_t PortableReader::ReadGuidArray(const char* fieldName, Guid* res, const int32_t len)
-        {
-            return impl->ReadGuidArray(fieldName, res, len);
-        }
-        
-        int32_t PortableReader::ReadString(const char* fieldName, char* res, const int32_t len)
-        {
-            return impl->ReadString(fieldName, res, len);
-        }
-
-        PortableStringArrayReader PortableReader::ReadStringArray(const char* fieldName)
-        {
-            int32_t size;
-
-            int32_t id = impl->ReadStringArray(fieldName, &size);
-
-            return PortableStringArrayReader(impl, id, size);
-        }
-
-        PortableRawReader PortableReader::RawReader()
-        {
-            impl->SetRawMode();
-
-            return PortableRawReader(impl);
-        }
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/core/src/portable/portable_type.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/src/portable/portable_type.cpp b/modules/platform/src/main/cpp/core/src/portable/portable_type.cpp
deleted file mode 100644
index e22f869..0000000
--- a/modules/platform/src/main/cpp/core/src/portable/portable_type.cpp
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "ignite/portable/portable_type.h"
-
-namespace ignite
-{
-    namespace portable
-    {
-        int32_t GetPortableStringHashCode(const char* val)
-        {
-            if (val)
-            {
-                int32_t hash = 0;
-
-                int i = 0;
-
-                while (true)
-                {
-                    char c = *(val + i++);
-
-                    if (c == '\0')
-                        break;
-
-                    if ('A' <= c && c <= 'Z')
-                        c = c | 0x20;
-
-                    hash = 31 * hash + c;
-                }
-
-                return hash;
-            }
-            else
-                return 0;
-        }
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/core/src/portable/portable_writer.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/src/portable/portable_writer.cpp b/modules/platform/src/main/cpp/core/src/portable/portable_writer.cpp
deleted file mode 100644
index f31b9dd..0000000
--- a/modules/platform/src/main/cpp/core/src/portable/portable_writer.cpp
+++ /dev/null
@@ -1,154 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "ignite/impl/portable/portable_writer_impl.h"
-#include "ignite/portable/portable_writer.h"
-
-using namespace ignite::impl::portable;
-
-namespace ignite
-{
-    namespace portable
-    {
-        PortableWriter::PortableWriter(PortableWriterImpl* impl) : impl(impl)
-        {
-            // No-op.
-        }
-
-        void PortableWriter::WriteInt8(const char* fieldName, const int8_t val)
-        {
-            impl->WriteInt8(fieldName, val);
-        }
-
-        void PortableWriter::WriteInt8Array(const char* fieldName, const int8_t* val, const int32_t len)
-        {
-            impl->WriteInt8Array(fieldName, val, len);
-        }
-
-        void PortableWriter::WriteBool(const char* fieldName, const bool val)
-        {
-            impl->WriteBool(fieldName, val);
-        }
-
-        void PortableWriter::WriteBoolArray(const char* fieldName, const bool* val, const int32_t len)
-        {
-            impl->WriteBoolArray(fieldName, val, len);
-        }
-
-        void PortableWriter::WriteInt16(const char* fieldName, const int16_t val)
-        {
-            impl->WriteInt16(fieldName, val);
-        }
-
-        void PortableWriter::WriteInt16Array(const char* fieldName, const int16_t* val, const int32_t len)
-        {
-            impl->WriteInt16Array(fieldName, val, len);
-        }
-
-        void PortableWriter::WriteUInt16(const char* fieldName, const uint16_t val)
-        {
-            impl->WriteUInt16(fieldName, val);
-        }
-
-        void PortableWriter::WriteUInt16Array(const char* fieldName, const uint16_t* val, const int32_t len)
-        {
-            impl->WriteUInt16Array(fieldName, val, len);
-        }
-
-        void PortableWriter::WriteInt32(const char* fieldName, const int32_t val)
-        {
-            impl->WriteInt32(fieldName, val);
-        }
-
-        void PortableWriter::WriteInt32Array(const char* fieldName, const int32_t* val, const int32_t len)
-        {
-            impl->WriteInt32Array(fieldName, val, len);
-        }
-
-        void PortableWriter::WriteInt64(const char* fieldName, const int64_t val)
-        {
-            impl->WriteInt64(fieldName, val);
-        }
-
-        void PortableWriter::WriteInt64Array(const char* fieldName, const int64_t* val, const int32_t len)
-        {
-            impl->WriteInt64Array(fieldName, val, len);
-        }
-
-        void PortableWriter::WriteFloat(const char* fieldName, const float val)
-        {
-            impl->WriteFloat(fieldName, val);
-        }
-
-        void PortableWriter::WriteFloatArray(const char* fieldName, const float* val, const int32_t len)
-        {
-            impl->WriteFloatArray(fieldName, val, len);
-        }
-
-        void PortableWriter::WriteDouble(const char* fieldName, const double val)
-        {
-            impl->WriteDouble(fieldName, val);
-        }
-
-        void PortableWriter::WriteDoubleArray(const char* fieldName, const double* val, const int32_t len)
-        {
-            impl->WriteDoubleArray(fieldName, val, len);
-        }
-
-        void PortableWriter::WriteGuid(const char* fieldName, const Guid val)
-        {
-            impl->WriteGuid(fieldName, val);
-        }
-
-        void PortableWriter::WriteGuidArray(const char* fieldName, const Guid* val, const int32_t len)
-        {
-            impl->WriteGuidArray(fieldName, val, len);
-        }
-
-        void PortableWriter::WriteString(const char* fieldName, const char* val)
-        {
-            if (val)
-                WriteString(fieldName, val, static_cast<int32_t>(strlen(val)));
-            else
-                WriteNull(fieldName);
-        }
-
-        void PortableWriter::WriteString(const char* fieldName, const char* val, const int32_t len)
-        {
-            impl->WriteString(fieldName, val, len);
-        }
-
-        PortableStringArrayWriter PortableWriter::WriteStringArray(const char* fieldName)
-        {
-            int32_t id = impl->WriteStringArray(fieldName);
-
-            return PortableStringArrayWriter(impl, id);
-        }
-
-        void PortableWriter::WriteNull(const char* fieldName)
-        {
-            impl->WriteNull(fieldName);
-        }
-
-        PortableRawWriter PortableWriter::RawWriter()
-        {
-            impl->SetRawMode();
-
-            return PortableRawWriter(impl);
-        }
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/examples/Makefile.am
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/examples/Makefile.am b/modules/platform/src/main/cpp/examples/Makefile.am
deleted file mode 100644
index d99cd82..0000000
--- a/modules/platform/src/main/cpp/examples/Makefile.am
+++ /dev/null
@@ -1,39 +0,0 @@
-##
-## Licensed to the Apache Software Foundation (ASF) under one or more
-## contributor license agreements.  See the NOTICE file distributed with
-## this work for additional information regarding copyright ownership.
-## The ASF licenses this file to You under the Apache License, Version 2.0
-## (the "License"); you may not use this file except in compliance with
-## the License.  You may obtain a copy of the License at
-##
-##      http://www.apache.org/licenses/LICENSE-2.0
-##
-## Unless required by applicable law or agreed to in writing, software
-## distributed under the License is distributed on an "AS IS" BASIS,
-## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-## See the License for the specific language governing permissions and
-## limitations under the License.
-##
-
-ACLOCAL_AMFLAGS = "-Im4"
-
-SUBDIRS = .
-DIST_SUBDIRS = . include
-
-AM_CPPFLAGS = -I$(srcdir)/include -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/linux -DIGNITE_IMPL
-AM_CXXFLAGS = -Wall -std=c++0x
-
-noinst_PROGRAMS = ignite-putgetexample
-
-ignite_putgetexample_SOURCES = src/putgetexample.cpp
-
-ignite_putgetexample_LDFLAGS = -static-libtool-libs -L/usr/local/lib -lignite
-
-run-check: check
-	./ignite-putgetexample -p
-
-clean-local: clean-check
-	$(RM) *.gcno *.gcda
-
-clean-check:
-	$(RM) $(ignite_putgetexample_OBJECTS)

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/examples/README.txt
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/examples/README.txt b/modules/platform/src/main/cpp/examples/README.txt
deleted file mode 100644
index a00cb3b..0000000
--- a/modules/platform/src/main/cpp/examples/README.txt
+++ /dev/null
@@ -1,42 +0,0 @@
-Ignite C++ Examples
-==================================
-
-Common requirements
-----------------------------------
- * Java Development Kit (JDK) must be installed: https://java.com/en/download/index.jsp
- * JAVA_HOME environment variable must be set pointing to Java installation directory.
- * IGNITE_HOME environment variable must be set to Ignite installation directory.
- * Ignite must be build and packaged using Maven. You can use the followin Maven command: mvn clean package -DskipTests
- * Ignite C++ must be built according to instructions for your platform.
-
-Running examples on Linux
-----------------------------------
-
-Prerequisites:
- * GCC, g++, autotools, automake, and libtool must be installed.
-
-To build examples execute the following commands one by one from $IGNITE_HOME/platforms/cpp/examples directory:
- * libtoolize
- * aclocal
- * autoheader
- * automake --add-missing
- * autoreconf
- * ./configure
- * make
-
-As a result several executables will appear in example's directory.
-
-Before running examples ensure that:
- * LD_LIBRARY_PATH environment variable is set and pointing to a directory with "libjvm.so" library. Typically this
-   library is located in $JAVA_HOME/jre/lib/amd64/server directory.
-
-
-Running examples on Windows
-----------------------------------
-
-Prerequisites:
- * Microsoft Visual Studio (tm) 2010 or higher must be installed.
- * Windows SDK 7.1 must be installed.
-
-Open Visual Studio solution %IGNITE_HOME%\platforms\cpp\examples\project\vs\ignite-examples.sln and select proper
-platform (x64 or x86). Run the solution.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/examples/config/example-cache.xml
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/examples/config/example-cache.xml b/modules/platform/src/main/cpp/examples/config/example-cache.xml
deleted file mode 100644
index beed238..0000000
--- a/modules/platform/src/main/cpp/examples/config/example-cache.xml
+++ /dev/null
@@ -1,77 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--
-  Licensed to the Apache Software Foundation (ASF) under one or more
-  contributor license agreements.  See the NOTICE file distributed with
-  this work for additional information regarding copyright ownership.
-  The ASF licenses this file to You under the Apache License, Version 2.0
-  (the "License"); you may not use this file except in compliance with
-  the License.  You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.
--->
-
-<beans xmlns="http://www.springframework.org/schema/beans"
-       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-       xmlns:util="http://www.springframework.org/schema/util"
-       xsi:schemaLocation="
-        http://www.springframework.org/schema/beans
-        http://www.springframework.org/schema/beans/spring-beans.xsd
-        http://www.springframework.org/schema/util
-        http://www.springframework.org/schema/util/spring-util.xsd">
-    <bean id="grid.cfg" class="org.apache.ignite.configuration.IgniteConfiguration">
-        <!-- Set to true to enable distributed class loading for examples, default is false. -->
-        <property name="peerClassLoadingEnabled" value="true"/>
-
-        <property name="cacheConfiguration">
-            <list>
-                <!--
-                    Partitioned cache example configuration with portable objects enabled.
-                    Used in .NET example that is available only in enterprise edition.
-                -->
-                <bean class="org.apache.ignite.configuration.CacheConfiguration">
-                    <property name="atomicityMode" value="ATOMIC"/>
-                    <property name="backups" value="1"/>
-                </bean>
-
-                <!--
-                    Partitioned cache example configuration.
-                    Used in .NET cache store example that is available only in enterprise edition.
-                -->
-                <bean class="org.apache.ignite.configuration.CacheConfiguration">
-                    <property name="name" value="tx"/>
-                    <property name="atomicityMode" value="TRANSACTIONAL"/>
-                    <property name="backups" value="1"/>
-                </bean>
-            </list>
-        </property>
-
-        <!-- Explicitly configure TCP discovery SPI to provide list of initial nodes. -->
-        <property name="discoverySpi">
-            <bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
-                <property name="ipFinder">
-                    <!--
-                        Ignite provides several options for automatic discovery that can be used
-                        instead os static IP based discovery.
-                    -->
-                    <!-- Uncomment static IP finder to enable static-based discovery of initial nodes. -->
-                    <!--<bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder">-->
-                    <bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.multicast.TcpDiscoveryMulticastIpFinder">
-                        <property name="addresses">
-                            <list>
-                                <!-- In distributed environment, replace with actual host IP address. -->
-                                <value>127.0.0.1:47500..47501</value>
-                            </list>
-                        </property>
-                    </bean>
-                </property>
-            </bean>
-        </property>
-    </bean>
-</beans>

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/examples/configure.ac
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/examples/configure.ac b/modules/platform/src/main/cpp/examples/configure.ac
deleted file mode 100644
index a5e902d..0000000
--- a/modules/platform/src/main/cpp/examples/configure.ac
+++ /dev/null
@@ -1,38 +0,0 @@
-#                                               -*- Autoconf -*-
-# Process this file with autoconf to produce a configure script.
-
-AC_PREREQ([2.69])
-AC_INIT([Ingnite C++ examples],[1.4.0],[dec@ignite.apache.org],[ignite-examples],[ignite.apache.org])
-AC_CONFIG_SRCDIR(src)
-
-AC_CANONICAL_SYSTEM
-AC_CONFIG_MACRO_DIR([m4])
-AC_LANG([C++])
-
-# Initialize automake
-AM_INIT_AUTOMAKE([-Wall foreign subdir-objects])
-AC_CONFIG_HEADER(config.h)
-
-AM_PROG_AR
-
-# Checks for programs.
-GXX="-g -O2"
-
-AC_PROG_CXX
-
-# Initialize Libtool
-LT_INIT
-
-AC_ARG_ENABLE([debug],
- [AS_HELP_STRING([--enable-debug],[enable debug build [default=no]])],
- [],[enable_debug=no])
-
-if test "x$enable_debug" = xyes; then
-    CXXFLAGS="-g -O0"
-else
-    CXXFLAGS="-g -O3"
-fi
-
-AC_CONFIG_FILES(Makefile)
-
-AC_OUTPUT

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/examples/include/Makefile.am
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/examples/include/Makefile.am b/modules/platform/src/main/cpp/examples/include/Makefile.am
deleted file mode 100644
index 13a8816..0000000
--- a/modules/platform/src/main/cpp/examples/include/Makefile.am
+++ /dev/null
@@ -1,21 +0,0 @@
-##
-## Licensed to the Apache Software Foundation (ASF) under one or more
-## contributor license agreements.  See the NOTICE file distributed with
-## this work for additional information regarding copyright ownership.
-## The ASF licenses this file to You under the Apache License, Version 2.0
-## (the "License"); you may not use this file except in compliance with
-## the License.  You may obtain a copy of the License at
-##
-##      http://www.apache.org/licenses/LICENSE-2.0
-##
-## Unless required by applicable law or agreed to in writing, software
-## distributed under the License is distributed on an "AS IS" BASIS,
-## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-## See the License for the specific language governing permissions and
-## limitations under the License.
-##
-
-ACLOCAL_AMFLAGS = "-Im4"
-
-nobase_include_HEADERS = ignite/examples/address.h \
-                         ignite/examples/organization.h

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/examples/include/ignite/examples/address.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/examples/include/ignite/examples/address.h b/modules/platform/src/main/cpp/examples/include/ignite/examples/address.h
deleted file mode 100644
index 29dbb0c..0000000
--- a/modules/platform/src/main/cpp/examples/include/ignite/examples/address.h
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef _IGNITE_EXAMPLES_ADDRESS
-#define _IGNITE_EXAMPLES_ADDRESS
-
-#include "ignite/portable/portable.h"
-
-namespace ignite
-{
-    namespace examples 
-    {
-        struct Address 
-        {
-            Address()
-            {
-                street = "";
-                zip = 0;
-            }
-            
-            Address(std::string street, int zip) : street(street), zip(zip) 
-            {
-                // No-op.
-            }
-            
-            std::string ToString() 
-            {
-                std::ostringstream oss;
-
-                oss << "Address [street=" << street << ", zip=" << zip << "]";
-
-                return oss.str();
-            }
-            
-            std::string street;
-            int zip;
-        };    
-    }
-}
-
-namespace ignite
-{
-    namespace portable 
-    {
-        template<>
-        struct PortableType<ignite::examples::Address>
-        {
-            int32_t GetTypeId()
-            {
-                return GetPortableStringHashCode("Address");
-            }
-
-            std::string GetTypeName()
-            {
-                return "Address";
-            }
-
-            int32_t GetFieldId(const char* name)
-            {
-                return GetPortableStringHashCode(name);
-            }
-
-            int32_t GetHashCode(ignite::examples::Address obj)
-            {
-                return 0;
-            }
-
-            bool IsNull(ignite::examples::Address obj)
-            {
-                return false;
-            }
-
-            ignite::examples::Address GetNull()
-            {
-                return ignite::examples::Address("", 0);
-            }
-
-            void Write(PortableWriter& writer, ignite::examples::Address obj)
-            {
-                writer.WriteString("street", obj.street);
-                writer.WriteInt32("zip", obj.zip);
-            }
-
-            ignite::examples::Address Read(PortableReader& reader)
-            {
-                std::string street = reader.ReadString("street");
-                int zip = reader.ReadInt32("zip");
-                
-                return ignite::examples::Address(street, zip);
-            }
-        };    
-    }    
-}
-
-#endif
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/examples/include/ignite/examples/organization.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/examples/include/ignite/examples/organization.h b/modules/platform/src/main/cpp/examples/include/ignite/examples/organization.h
deleted file mode 100644
index c9137c9..0000000
--- a/modules/platform/src/main/cpp/examples/include/ignite/examples/organization.h
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef _IGNITE_EXAMPLES_ORGANIZATION
-#define _IGNITE_EXAMPLES_ORGANIZATION
-
-#include "ignite/portable/portable.h"
-
-#include "ignite/examples/address.h"
-
-namespace ignite
-{
-    namespace examples 
-    {
-        struct Organization 
-        {
-            Organization()
-            {
-                name = "";
-                addr = Address();
-            }
-            
-            Organization(std::string name, Address addr) : name(name), addr(addr) 
-            {
-                // No-op.
-            }
-            
-            std::string ToString() 
-            {
-                std::ostringstream oss;
-
-                oss << "Organization [name=" << name << ", Address=" << addr.ToString() << "]";
-
-                return oss.str();
-            }
-            
-            std::string name;
-            Address addr;
-        };    
-    }
-}
-
-namespace ignite
-{
-    namespace portable 
-    {
-        template<>
-        struct PortableType<ignite::examples::Organization>
-        {
-            int32_t GetTypeId()
-            {
-                return GetPortableStringHashCode("Organization");
-            }
-
-            std::string GetTypeName()
-            {
-                return "Organization";
-            }
-
-            int32_t GetFieldId(const char* name)
-            {
-                return GetPortableStringHashCode(name);
-            }
-
-            int32_t GetHashCode(ignite::examples::Organization obj)
-            {
-                return 0;
-            }
-
-            bool IsNull(ignite::examples::Organization obj)
-            {
-                return false;
-            }
-
-            ignite::examples::Organization GetNull()
-            {
-                return ignite::examples::Organization("", ignite::examples::Address());
-            }
-
-            void Write(PortableWriter& writer, ignite::examples::Organization obj)
-            {
-                writer.WriteString("name", obj.name);
-                writer.WriteObject<ignite::examples::Address>("addr", obj.addr);
-            }
-
-            ignite::examples::Organization Read(PortableReader& reader)
-            {
-                std::string name = reader.ReadString("name");
-                ignite::examples::Address addr = reader.ReadObject<ignite::examples::Address>("addr");
-                                
-                return ignite::examples::Organization(name, addr);
-            }
-        };    
-    }    
-}
-
-#endif
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/examples/project/vs/ignite-examples.sln
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/examples/project/vs/ignite-examples.sln b/modules/platform/src/main/cpp/examples/project/vs/ignite-examples.sln
deleted file mode 100644
index 4970654..0000000
--- a/modules/platform/src/main/cpp/examples/project/vs/ignite-examples.sln
+++ /dev/null
@@ -1,19 +0,0 @@
-Microsoft Visual Studio Solution File, Format Version 11.00
-# Visual Studio 2010
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ignite-examples", "ignite-examples.vcxproj", "{34935DEC-80FC-4168-AA52-3DBFF4F79B6B}"
-EndProject
-Global
-	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-		Release|x64 = Release|x64
-		Release|x86 = Release|x86
-	EndGlobalSection
-	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{34935DEC-80FC-4168-AA52-3DBFF4F79B6B}.Release|x64.ActiveCfg = Release|x64
-		{34935DEC-80FC-4168-AA52-3DBFF4F79B6B}.Release|x64.Build.0 = Release|x64
-		{34935DEC-80FC-4168-AA52-3DBFF4F79B6B}.Release|x86.ActiveCfg = Release|Win32
-		{34935DEC-80FC-4168-AA52-3DBFF4F79B6B}.Release|x86.Build.0 = Release|Win32
-	EndGlobalSection
-	GlobalSection(SolutionProperties) = preSolution
-		HideSolutionNode = FALSE
-	EndGlobalSection
-EndGlobal

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/examples/project/vs/ignite-examples.vcxproj
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/examples/project/vs/ignite-examples.vcxproj b/modules/platform/src/main/cpp/examples/project/vs/ignite-examples.vcxproj
deleted file mode 100644
index 13ec564..0000000
--- a/modules/platform/src/main/cpp/examples/project/vs/ignite-examples.vcxproj
+++ /dev/null
@@ -1,107 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="Release|Win32">
-      <Configuration>Release</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|x64">
-      <Configuration>Release</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectGuid>{34935DEC-80FC-4168-AA52-3DBFF4F79B6B}</ProjectGuid>
-    <Keyword>Win32Proj</Keyword>
-    <RootNamespace>igniteexamples</RootNamespace>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseDebugLibraries>false</UseDebugLibraries>
-    <PlatformToolset>v120</PlatformToolset>
-    <WholeProgramOptimization>true</WholeProgramOptimization>
-    <CharacterSet>Unicode</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseDebugLibraries>false</UseDebugLibraries>
-    <PlatformToolset>v120</PlatformToolset>
-    <WholeProgramOptimization>true</WholeProgramOptimization>
-    <CharacterSet>Unicode</CharacterSet>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
-    <LinkIncremental>false</LinkIncremental>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <LinkIncremental>false</LinkIncremental>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
-    <ClCompile>
-      <WarningLevel>Level3</WarningLevel>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <Optimization>MaxSpeed</Optimization>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <IntrinsicFunctions>true</IntrinsicFunctions>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <AdditionalIncludeDirectories>$(JAVA_HOME)\include;$(JAVA_HOME)\include\win32;..\..\include;..\..\..\src\common\os\win\include;..\..\..\src\common\include;..\..\..\src\core\os\win\include;..\..\..\src\core\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-    </ClCompile>
-    <Link>
-      <SubSystem>Console</SubSystem>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <EnableCOMDATFolding>true</EnableCOMDATFolding>
-      <OptimizeReferences>true</OptimizeReferences>
-      <AdditionalDependencies>jvm.lib;ignite.common.lib;ignite.core.lib;%(AdditionalDependencies)</AdditionalDependencies>
-      <AdditionalLibraryDirectories>..\..\..\src\project\vs\$(Platform)\$(Configuration)\;$(JAVA_HOME)\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(ProjectDir)..\..\..\src\project\vs\$(Platform)\$(Configuration)\ignite.common.dll" "$(OutDir)"
-copy "$(ProjectDir)..\..\..\src\\project\vs\$(Platform)\$(Configuration)\ignite.core.dll" "$(OutDir)"</Command>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <ClCompile>
-      <WarningLevel>Level3</WarningLevel>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <Optimization>MaxSpeed</Optimization>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <IntrinsicFunctions>true</IntrinsicFunctions>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <AdditionalIncludeDirectories>$(JAVA_HOME)\include;$(JAVA_HOME)\include\win32;..\..\include;..\..\..\src\common\os\win\include;..\..\..\src\common\include;..\..\..\src\core\os\win\include;..\..\..\src\core\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-    </ClCompile>
-    <Link>
-      <SubSystem>Console</SubSystem>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <EnableCOMDATFolding>true</EnableCOMDATFolding>
-      <OptimizeReferences>true</OptimizeReferences>
-      <AdditionalDependencies>jvm.lib;ignite.common.lib;ignite.core.lib;%(AdditionalDependencies)</AdditionalDependencies>
-      <AdditionalLibraryDirectories>..\..\..\src\project\vs\$(Platform)\$(Configuration)\;$(JAVA_HOME)\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(ProjectDir)..\..\..\src\project\vs\$(Platform)\$(Configuration)\ignite.common.dll" "$(OutDir)"
-copy "$(ProjectDir)..\..\..\src\project\vs\$(Platform)\$(Configuration)\ignite.core.dll" "$(OutDir)"</Command>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <ClCompile Include="..\..\src\putgetexample.cpp" />
-  </ItemGroup>
-  <ItemGroup>
-    <ClInclude Include="..\..\include\ignite\examples\address.h" />
-    <ClInclude Include="..\..\include\ignite\examples\organization.h" />
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/examples/project/vs/ignite-examples.vcxproj.filters
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/examples/project/vs/ignite-examples.vcxproj.filters b/modules/platform/src/main/cpp/examples/project/vs/ignite-examples.vcxproj.filters
deleted file mode 100644
index ca62db7..0000000
--- a/modules/platform/src/main/cpp/examples/project/vs/ignite-examples.vcxproj.filters
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup>
-    <Filter Include="Source Files">
-      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
-      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
-    </Filter>
-    <Filter Include="Header Files">
-      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
-      <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
-    </Filter>
-    <Filter Include="Resource Files">
-      <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
-      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
-    </Filter>
-  </ItemGroup>
-  <ItemGroup>
-    <ClCompile Include="..\..\src\putgetexample.cpp">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-  </ItemGroup>
-  <ItemGroup>
-    <ClInclude Include="..\..\include\ignite\examples\address.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="..\..\include\ignite\examples\organization.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-  </ItemGroup>
-</Project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/examples/src/putgetexample.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/examples/src/putgetexample.cpp b/modules/platform/src/main/cpp/examples/src/putgetexample.cpp
deleted file mode 100644
index 206a2f4..0000000
--- a/modules/platform/src/main/cpp/examples/src/putgetexample.cpp
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <iostream>
-
-#include "ignite/ignite.h"
-#include "ignite/ignition.h"
-
-#include "ignite/examples/organization.h"
-
-using namespace ignite;
-using namespace cache;
-
-using namespace examples;
-
-/*
- * Execute individual Put and Get operations.
- * 
- * @param cache Cache instance.
- */
-void PutGet(Cache<int, Organization>& cache) 
-{
-    // Create new Organization to store in cache.
-    Organization org("Microsoft", Address("1096 Eddy Street, San Francisco, CA", 94109));
-    
-    // Put organization to cache.        
-    cache.Put(1, org);
-    
-    // Get recently created employee as a strongly-typed fully de-serialized instance.
-    Organization orgFromCache = cache.Get(1);
-
-    std::cout <<  ">>> Retrieved organization instance from cache: " << std::endl;
-    std::cout << orgFromCache.ToString() << std::endl;
-    std::cout << std::endl;
-}
-
-/*
- * Execute bulk Put and Get operations.
- */
-void PutGetAll(Cache<int, Organization>& cache) 
-{
-    // Create new Organizations to store in cache.
-    Organization org1("Microsoft", Address("1096 Eddy Street, San Francisco, CA", 94109));
-    Organization org2("Red Cross", Address("184 Fidler Drive, San Antonio, TX", 78205));
-    
-    // Put created data entries to cache.
-    std::map<int, Organization> vals;
-    
-    vals[1] = org1;
-    vals[2] = org2;
-    
-    cache.PutAll(vals);
-
-    // Get recently created organizations as a strongly-typed fully de-serialized instances.
-    std::set<int> keys;
-    
-    keys.insert(1);
-    keys.insert(2);
-    
-    std::map<int, Organization> valsFromCache = cache.GetAll(keys);
-
-    std::cout <<  ">>> Retrieved organization instances from cache: " << std::endl;
-    
-    for (std::map<int, Organization>::iterator it = valsFromCache.begin(); it != valsFromCache.end(); ++it) 
-        std::cout <<  it->second.ToString() << std::endl;
-    
-    std::cout << std::endl;
-}
-
-int main()
-{
-    IgniteConfiguration cfg;
-
-    cfg.jvmInitMem = 512;
-    cfg.jvmMaxMem = 512;
-    
-    cfg.springCfgPath = "platforms/cpp/examples/config/example-cache.xml";
- 
-    try 
-    {
-        // Start a node.
-        Ignite grid = Ignition::Start(cfg);
-        
-        std::cout << std::endl;
-        std::cout << ">>> Cache put-get example started." << std::endl;
-        std::cout << std::endl;
-        
-        // Get cache instance.
-        Cache<int, Organization> cache = grid.GetCache<int, Organization>(NULL);
-        
-        // Clear cache.
-        cache.Clear();
-
-        PutGet(cache);
-        PutGetAll(cache);        
-        
-        // Stop node.
-        Ignition::StopAll(false);
-    }
-    catch (IgniteError& err)
-    {
-        std::cout << "An error occurred: " << err.GetText() << std::endl;
-    }
-    
-    std::cout << std::endl;
-    std::cout << ">>> Example finished, press any key to exit ..." << std::endl;
-    std::cout << std::endl;
-    
-    std::cin.get();
-    
-    return 0;
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/project/vs/ignite.sln
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/project/vs/ignite.sln b/modules/platform/src/main/cpp/project/vs/ignite.sln
deleted file mode 100644
index f34d8e5..0000000
--- a/modules/platform/src/main/cpp/project/vs/ignite.sln
+++ /dev/null
@@ -1,46 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 11.00
-# Visual Studio 2010
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "common", "..\..\common\project\vs\common.vcxproj", "{4F7E4917-4612-4B96-9838-025711ADE391}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "core", "..\..\core\project\vs\core.vcxproj", "{E2DEA693-F2EA-43C2-A813-053378F6E4DB}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "core-test", "..\..\core-test\project\vs\core-test.vcxproj", "{133A22DB-FD60-44B9-B5E3-6CBB3EA5ABF0}"
-EndProject
-Global
-	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-		Debug|Win32 = Debug|Win32
-		Debug|x64 = Debug|x64
-		Release|Win32 = Release|Win32
-		Release|x64 = Release|x64
-	EndGlobalSection
-	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{4F7E4917-4612-4B96-9838-025711ADE391}.Debug|Win32.ActiveCfg = Debug|Win32
-		{4F7E4917-4612-4B96-9838-025711ADE391}.Debug|Win32.Build.0 = Debug|Win32
-		{4F7E4917-4612-4B96-9838-025711ADE391}.Debug|x64.ActiveCfg = Debug|x64
-		{4F7E4917-4612-4B96-9838-025711ADE391}.Debug|x64.Build.0 = Debug|x64
-		{4F7E4917-4612-4B96-9838-025711ADE391}.Release|Win32.ActiveCfg = Release|Win32
-		{4F7E4917-4612-4B96-9838-025711ADE391}.Release|Win32.Build.0 = Release|Win32
-		{4F7E4917-4612-4B96-9838-025711ADE391}.Release|x64.ActiveCfg = Release|x64
-		{4F7E4917-4612-4B96-9838-025711ADE391}.Release|x64.Build.0 = Release|x64
-		{E2DEA693-F2EA-43C2-A813-053378F6E4DB}.Debug|Win32.ActiveCfg = Debug|Win32
-		{E2DEA693-F2EA-43C2-A813-053378F6E4DB}.Debug|Win32.Build.0 = Debug|Win32
-		{E2DEA693-F2EA-43C2-A813-053378F6E4DB}.Debug|x64.ActiveCfg = Debug|x64
-		{E2DEA693-F2EA-43C2-A813-053378F6E4DB}.Debug|x64.Build.0 = Debug|x64
-		{E2DEA693-F2EA-43C2-A813-053378F6E4DB}.Release|Win32.ActiveCfg = Release|Win32
-		{E2DEA693-F2EA-43C2-A813-053378F6E4DB}.Release|Win32.Build.0 = Release|Win32
-		{E2DEA693-F2EA-43C2-A813-053378F6E4DB}.Release|x64.ActiveCfg = Release|x64
-		{E2DEA693-F2EA-43C2-A813-053378F6E4DB}.Release|x64.Build.0 = Release|x64
-		{133A22DB-FD60-44B9-B5E3-6CBB3EA5ABF0}.Debug|Win32.ActiveCfg = Debug|Win32
-		{133A22DB-FD60-44B9-B5E3-6CBB3EA5ABF0}.Debug|Win32.Build.0 = Debug|Win32
-		{133A22DB-FD60-44B9-B5E3-6CBB3EA5ABF0}.Debug|x64.ActiveCfg = Debug|x64
-		{133A22DB-FD60-44B9-B5E3-6CBB3EA5ABF0}.Debug|x64.Build.0 = Debug|x64
-		{133A22DB-FD60-44B9-B5E3-6CBB3EA5ABF0}.Release|Win32.ActiveCfg = Release|Win32
-		{133A22DB-FD60-44B9-B5E3-6CBB3EA5ABF0}.Release|Win32.Build.0 = Release|Win32
-		{133A22DB-FD60-44B9-B5E3-6CBB3EA5ABF0}.Release|x64.ActiveCfg = Release|x64
-		{133A22DB-FD60-44B9-B5E3-6CBB3EA5ABF0}.Release|x64.Build.0 = Release|x64
-	EndGlobalSection
-	GlobalSection(SolutionProperties) = preSolution
-		HideSolutionNode = FALSE
-	EndGlobalSection
-EndGlobal

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/project/vs/ignite.slnrel
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/project/vs/ignite.slnrel b/modules/platform/src/main/cpp/project/vs/ignite.slnrel
deleted file mode 100644
index 7456097..0000000
--- a/modules/platform/src/main/cpp/project/vs/ignite.slnrel
+++ /dev/null
@@ -1,33 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 11.00
-# Visual Studio 2010
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "common", "..\..\common\project\vs\common.vcxproj", "{4F7E4917-4612-4B96-9838-025711ADE391}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "core", "..\..\core\project\vs\core.vcxproj", "{E2DEA693-F2EA-43C2-A813-053378F6E4DB}"
-EndProject
-Global
-	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-		Release|x64 = Release|x64
-	EndGlobalSection
-	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{4F7E4917-4612-4B96-9838-025711ADE391}.Debug|Win32.ActiveCfg = Debug|Win32
-		{4F7E4917-4612-4B96-9838-025711ADE391}.Debug|Win32.Build.0 = Debug|Win32
-		{4F7E4917-4612-4B96-9838-025711ADE391}.Debug|x64.ActiveCfg = Debug|x64
-		{4F7E4917-4612-4B96-9838-025711ADE391}.Debug|x64.Build.0 = Debug|x64
-		{4F7E4917-4612-4B96-9838-025711ADE391}.Release|Win32.ActiveCfg = Release|Win32
-		{4F7E4917-4612-4B96-9838-025711ADE391}.Release|Win32.Build.0 = Release|Win32
-		{4F7E4917-4612-4B96-9838-025711ADE391}.Release|x64.ActiveCfg = Release|x64
-		{4F7E4917-4612-4B96-9838-025711ADE391}.Release|x64.Build.0 = Release|x64
-		{E2DEA693-F2EA-43C2-A813-053378F6E4DB}.Debug|Win32.ActiveCfg = Debug|Win32
-		{E2DEA693-F2EA-43C2-A813-053378F6E4DB}.Debug|Win32.Build.0 = Debug|Win32
-		{E2DEA693-F2EA-43C2-A813-053378F6E4DB}.Debug|x64.ActiveCfg = Debug|x64
-		{E2DEA693-F2EA-43C2-A813-053378F6E4DB}.Debug|x64.Build.0 = Debug|x64
-		{E2DEA693-F2EA-43C2-A813-053378F6E4DB}.Release|Win32.ActiveCfg = Release|Win32
-		{E2DEA693-F2EA-43C2-A813-053378F6E4DB}.Release|Win32.Build.0 = Release|Win32
-		{E2DEA693-F2EA-43C2-A813-053378F6E4DB}.Release|x64.ActiveCfg = Release|x64
-		{E2DEA693-F2EA-43C2-A813-053378F6E4DB}.Release|x64.Build.0 = Release|x64
-	EndGlobalSection
-	GlobalSection(SolutionProperties) = preSolution
-		HideSolutionNode = FALSE
-	EndGlobalSection
-EndGlobal

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/project/vs/ignite_x86.slnrel
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/project/vs/ignite_x86.slnrel b/modules/platform/src/main/cpp/project/vs/ignite_x86.slnrel
deleted file mode 100644
index b716b49..0000000
--- a/modules/platform/src/main/cpp/project/vs/ignite_x86.slnrel
+++ /dev/null
@@ -1,33 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 11.00
-# Visual Studio 2010
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "common", "..\..\common\project\vs\common.vcxproj", "{4F7E4917-4612-4B96-9838-025711ADE391}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "core", "..\..\core\project\vs\core.vcxproj", "{E2DEA693-F2EA-43C2-A813-053378F6E4DB}"
-EndProject
-Global
-	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-		Release|Win32 = Release|Win32
-	EndGlobalSection
-	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{4F7E4917-4612-4B96-9838-025711ADE391}.Debug|Win32.ActiveCfg = Debug|Win32
-		{4F7E4917-4612-4B96-9838-025711ADE391}.Debug|Win32.Build.0 = Debug|Win32
-		{4F7E4917-4612-4B96-9838-025711ADE391}.Debug|x64.ActiveCfg = Debug|x64
-		{4F7E4917-4612-4B96-9838-025711ADE391}.Debug|x64.Build.0 = Debug|x64
-		{4F7E4917-4612-4B96-9838-025711ADE391}.Release|Win32.ActiveCfg = Release|Win32
-		{4F7E4917-4612-4B96-9838-025711ADE391}.Release|Win32.Build.0 = Release|Win32
-		{4F7E4917-4612-4B96-9838-025711ADE391}.Release|x64.ActiveCfg = Release|x64
-		{4F7E4917-4612-4B96-9838-025711ADE391}.Release|x64.Build.0 = Release|x64
-		{E2DEA693-F2EA-43C2-A813-053378F6E4DB}.Debug|Win32.ActiveCfg = Debug|Win32
-		{E2DEA693-F2EA-43C2-A813-053378F6E4DB}.Debug|Win32.Build.0 = Debug|Win32
-		{E2DEA693-F2EA-43C2-A813-053378F6E4DB}.Debug|x64.ActiveCfg = Debug|x64
-		{E2DEA693-F2EA-43C2-A813-053378F6E4DB}.Debug|x64.Build.0 = Debug|x64
-		{E2DEA693-F2EA-43C2-A813-053378F6E4DB}.Release|Win32.ActiveCfg = Release|Win32
-		{E2DEA693-F2EA-43C2-A813-053378F6E4DB}.Release|Win32.Build.0 = Release|Win32
-		{E2DEA693-F2EA-43C2-A813-053378F6E4DB}.Release|x64.ActiveCfg = Release|x64
-		{E2DEA693-F2EA-43C2-A813-053378F6E4DB}.Release|x64.Build.0 = Release|x64
-	EndGlobalSection
-	GlobalSection(SolutionProperties) = preSolution
-		HideSolutionNode = FALSE
-	EndGlobalSection
-EndGlobal


[17/28] ignite git commit: IGNITE-1513: Moved CPP.

Posted by vo...@apache.org.
http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/core/project/vs/core.vcxproj
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/core/project/vs/core.vcxproj b/modules/platform/cpp/core/project/vs/core.vcxproj
new file mode 100644
index 0000000..58fa283
--- /dev/null
+++ b/modules/platform/cpp/core/project/vs/core.vcxproj
@@ -0,0 +1,272 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup Label="ProjectConfigurations">
+    <ProjectConfiguration Include="Debug|Win32">
+      <Configuration>Debug</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Debug|x64">
+      <Configuration>Debug</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|Win32">
+      <Configuration>Release</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|x64">
+      <Configuration>Release</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+  </ItemGroup>
+  <PropertyGroup Label="Globals">
+    <ProjectGuid>{E2DEA693-F2EA-43C2-A813-053378F6E4DB}</ProjectGuid>
+    <RootNamespace>core</RootNamespace>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <PlatformToolset>v100</PlatformToolset>
+    <CharacterSet>Unicode</CharacterSet>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <PlatformToolset>v100</PlatformToolset>
+    <CharacterSet>Unicode</CharacterSet>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <PlatformToolset>v100</PlatformToolset>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <PlatformToolset>v100</PlatformToolset>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+  <ImportGroup Label="ExtensionSettings">
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <PropertyGroup Label="UserMacros" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <TargetName>ignite.core</TargetName>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <TargetName>ignite.core</TargetName>
+    <OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
+    <IntDir>$(Platform)\$(Configuration)\</IntDir>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <TargetName>ignite.core</TargetName>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <TargetName>ignite.core</TargetName>
+    <OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
+    <IntDir>$(Platform)\$(Configuration)\</IntDir>
+  </PropertyGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <Optimization>Disabled</Optimization>
+      <SDLCheck>false</SDLCheck>
+      <AdditionalIncludeDirectories>$(JAVA_HOME)\include;$(JAVA_HOME)\include\win32;$(ProjectDir)\..\..\..\common\include;$(ProjectDir)\..\..\..\common\os\win\include;$(ProjectDir)\..\..\include;$(ProjectDir)\..\..\os\win\include</AdditionalIncludeDirectories>
+      <InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
+      <IntrinsicFunctions>false</IntrinsicFunctions>
+      <FavorSizeOrSpeed>Neither</FavorSizeOrSpeed>
+      <OmitFramePointers>false</OmitFramePointers>
+      <StringPooling>true</StringPooling>
+      <MinimalRebuild>false</MinimalRebuild>
+      <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+      <BufferSecurityCheck>false</BufferSecurityCheck>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;IGNITE_IMPL;IGNITE_FRIEND;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <WholeProgramOptimization>false</WholeProgramOptimization>
+    </ClCompile>
+    <Link>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <AdditionalLibraryDirectories>$(JAVA_HOME)\lib\jvm.lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <AdditionalDependencies>$(JAVA_HOME)\lib\jvm.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <OptimizeReferences>false</OptimizeReferences>
+      <EnableCOMDATFolding>false</EnableCOMDATFolding>
+      <LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <Optimization>Disabled</Optimization>
+      <SDLCheck>false</SDLCheck>
+      <AdditionalIncludeDirectories>$(JAVA_HOME)\include;$(JAVA_HOME)\include\win32;$(ProjectDir)\..\..\..\common\include;$(ProjectDir)\..\..\..\common\os\win\include;$(ProjectDir)\..\..\include;$(ProjectDir)\..\..\os\win\include</AdditionalIncludeDirectories>
+      <InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
+      <IntrinsicFunctions>false</IntrinsicFunctions>
+      <FavorSizeOrSpeed>Neither</FavorSizeOrSpeed>
+      <OmitFramePointers>false</OmitFramePointers>
+      <StringPooling>true</StringPooling>
+      <MinimalRebuild>false</MinimalRebuild>
+      <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+      <BufferSecurityCheck>false</BufferSecurityCheck>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;IGNITE_IMPL;IGNITE_FRIEND;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <WholeProgramOptimization>false</WholeProgramOptimization>
+    </ClCompile>
+    <Link>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <AdditionalLibraryDirectories>$(JAVA_HOME)\lib\jvm.lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <AdditionalDependencies>$(JAVA_HOME)\lib\jvm.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <OptimizeReferences>false</OptimizeReferences>
+      <EnableCOMDATFolding>false</EnableCOMDATFolding>
+      <LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <Optimization>Full</Optimization>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <IntrinsicFunctions>true</IntrinsicFunctions>
+      <SDLCheck>false</SDLCheck>
+      <AdditionalIncludeDirectories>$(JAVA_HOME)\include;$(JAVA_HOME)\include\win32;$(ProjectDir)\..\..\..\common\include;$(ProjectDir)\..\..\..\common\os\win\include;$(ProjectDir)\..\..\include;$(ProjectDir)\..\..\os\win\include</AdditionalIncludeDirectories>
+      <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
+      <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+      <OmitFramePointers>true</OmitFramePointers>
+      <StringPooling>true</StringPooling>
+      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+      <BufferSecurityCheck>false</BufferSecurityCheck>
+      <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;IGNITE_IMPL;IGNITE_FRIEND;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+    </ClCompile>
+    <Link>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <OptimizeReferences>true</OptimizeReferences>
+      <AdditionalLibraryDirectories>$(JAVA_HOME)\lib\jvm.lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <AdditionalDependencies>$(JAVA_HOME)\lib\jvm.lib;%(AdditionalDependencies)</AdditionalDependencies>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <Optimization>Full</Optimization>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <IntrinsicFunctions>true</IntrinsicFunctions>
+      <SDLCheck>false</SDLCheck>
+      <AdditionalIncludeDirectories>$(JAVA_HOME)\include;$(JAVA_HOME)\include\win32;$(ProjectDir)\..\..\..\common\include;$(ProjectDir)\..\..\..\common\os\win\include;$(ProjectDir)\..\..\include;$(ProjectDir)\..\..\os\win\include</AdditionalIncludeDirectories>
+      <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
+      <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+      <OmitFramePointers>true</OmitFramePointers>
+      <StringPooling>true</StringPooling>
+      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+      <BufferSecurityCheck>false</BufferSecurityCheck>
+      <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;IGNITE_IMPL;IGNITE_FRIEND;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+    </ClCompile>
+    <Link>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <OptimizeReferences>true</OptimizeReferences>
+      <AdditionalLibraryDirectories>$(JAVA_HOME)\lib\jvm.lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <AdditionalDependencies>$(JAVA_HOME)\lib\jvm.lib;%(AdditionalDependencies)</AdditionalDependencies>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemGroup>
+    <ClInclude Include="..\..\include\ignite\cache\cache.h" />
+    <ClInclude Include="..\..\include\ignite\cache\cache_entry.h" />
+    <ClInclude Include="..\..\include\ignite\cache\cache_peek_mode.h" />
+    <ClInclude Include="..\..\include\ignite\cache\query\query.h" />
+    <ClInclude Include="..\..\include\ignite\cache\query\query_argument.h" />
+    <ClInclude Include="..\..\include\ignite\cache\query\query_cursor.h" />
+    <ClInclude Include="..\..\include\ignite\cache\query\query_scan.h" />
+    <ClInclude Include="..\..\include\ignite\cache\query\query_sql.h" />
+    <ClInclude Include="..\..\include\ignite\cache\query\query_text.h" />
+    <ClInclude Include="..\..\include\ignite\ignite.h" />
+    <ClInclude Include="..\..\include\ignite\ignite_configuration.h" />
+    <ClInclude Include="..\..\include\ignite\ignite_error.h" />
+    <ClInclude Include="..\..\include\ignite\ignition.h" />
+    <ClInclude Include="..\..\include\ignite\guid.h" />
+    <ClInclude Include="..\..\include\ignite\impl\cache\cache_impl.h" />
+    <ClInclude Include="..\..\include\ignite\impl\cache\query\query_impl.h" />
+    <ClInclude Include="..\..\include\ignite\impl\ignite_environment.h" />
+    <ClInclude Include="..\..\include\ignite\impl\ignite_impl.h" />
+    <ClInclude Include="..\..\include\ignite\impl\handle_registry.h" />
+    <ClInclude Include="..\..\include\ignite\impl\interop\interop.h" />
+    <ClInclude Include="..\..\include\ignite\impl\interop\interop_input_stream.h" />
+    <ClInclude Include="..\..\include\ignite\impl\interop\interop_memory.h" />
+    <ClInclude Include="..\..\include\ignite\impl\interop\interop_output_stream.h" />
+    <ClInclude Include="..\..\include\ignite\impl\operations.h" />
+    <ClInclude Include="..\..\include\ignite\impl\portable\portable_common.h" />
+    <ClInclude Include="..\..\include\ignite\impl\portable\portable_id_resolver.h" />
+    <ClInclude Include="..\..\include\ignite\impl\portable\portable_metadata_handler.h" />
+    <ClInclude Include="..\..\include\ignite\impl\portable\portable_metadata_manager.h" />
+    <ClInclude Include="..\..\include\ignite\impl\portable\portable_metadata_snapshot.h" />
+    <ClInclude Include="..\..\include\ignite\impl\portable\portable_metadata_updater.h" />
+    <ClInclude Include="..\..\include\ignite\impl\portable\portable_metadata_updater_impl.h" />
+    <ClInclude Include="..\..\include\ignite\impl\portable\portable_reader_impl.h" />
+    <ClInclude Include="..\..\include\ignite\impl\portable\portable_utils.h" />
+    <ClInclude Include="..\..\include\ignite\impl\portable\portable_writer_impl.h" />
+    <ClInclude Include="..\..\include\ignite\portable\portable.h" />
+    <ClInclude Include="..\..\include\ignite\portable\portable_consts.h" />
+    <ClInclude Include="..\..\include\ignite\portable\portable_containers.h" />
+    <ClInclude Include="..\..\include\ignite\portable\portable_type.h" />
+    <ClInclude Include="..\..\include\ignite\portable\portable_raw_reader.h" />
+    <ClInclude Include="..\..\include\ignite\portable\portable_raw_writer.h" />
+    <ClInclude Include="..\..\include\ignite\portable\portable_reader.h" />
+    <ClInclude Include="..\..\include\ignite\portable\portable_writer.h" />
+    <ClInclude Include="..\..\os\win\include\ignite\impl\utils.h" />
+  </ItemGroup>
+  <ItemGroup>
+    <ClCompile Include="..\..\os\win\src\impl\utils.cpp" />
+    <ClCompile Include="..\..\src\ignite.cpp" />
+    <ClCompile Include="..\..\src\ignite_error.cpp" />
+    <ClCompile Include="..\..\src\ignition.cpp" />
+    <ClCompile Include="..\..\src\guid.cpp" />
+    <ClCompile Include="..\..\src\impl\cache\cache_impl.cpp" />
+    <ClCompile Include="..\..\src\impl\cache\query\query_impl.cpp" />
+    <ClCompile Include="..\..\src\impl\ignite_environment.cpp" />
+    <ClCompile Include="..\..\src\impl\ignite_impl.cpp" />
+    <ClCompile Include="..\..\src\impl\handle_registry.cpp" />
+    <ClCompile Include="..\..\src\impl\interop\interop_input_stream.cpp" />
+    <ClCompile Include="..\..\src\impl\interop\interop_memory.cpp" />
+    <ClCompile Include="..\..\src\impl\interop\interop_output_stream.cpp" />
+    <ClCompile Include="..\..\src\impl\portable\portable_metadata_handler.cpp" />
+    <ClCompile Include="..\..\src\impl\portable\portable_metadata_manager.cpp" />
+    <ClCompile Include="..\..\src\impl\portable\portable_metadata_snapshot.cpp" />
+    <ClCompile Include="..\..\src\impl\portable\portable_metadata_updater.cpp" />
+    <ClCompile Include="..\..\src\impl\portable\portable_metadata_updater_impl.cpp" />
+    <ClCompile Include="..\..\src\impl\portable\portable_reader_impl.cpp" />
+    <ClCompile Include="..\..\src\impl\portable\portable_utils.cpp" />
+    <ClCompile Include="..\..\src\impl\portable\portable_writer_impl.cpp" />
+    <ClCompile Include="..\..\src\portable\portable_containers.cpp" />
+    <ClCompile Include="..\..\src\portable\portable_type.cpp" />
+    <ClCompile Include="..\..\src\portable\portable_raw_reader.cpp" />
+    <ClCompile Include="..\..\src\portable\portable_raw_writer.cpp" />
+    <ClCompile Include="..\..\src\portable\portable_reader.cpp" />
+    <ClCompile Include="..\..\src\portable\portable_writer.cpp" />
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\..\..\common\project\vs\common.vcxproj">
+      <Project>{4f7e4917-4612-4b96-9838-025711ade391}</Project>
+    </ProjectReference>
+  </ItemGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+  <ImportGroup Label="ExtensionTargets">
+  </ImportGroup>
+</Project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/core/project/vs/core.vcxproj.filters
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/core/project/vs/core.vcxproj.filters b/modules/platform/cpp/core/project/vs/core.vcxproj.filters
new file mode 100644
index 0000000..d18599d
--- /dev/null
+++ b/modules/platform/cpp/core/project/vs/core.vcxproj.filters
@@ -0,0 +1,246 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup>
+    <ClCompile Include="..\..\src\impl\cache\cache_impl.cpp">
+      <Filter>Code\impl\cache</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\impl\interop\interop_input_stream.cpp">
+      <Filter>Code\impl\interop</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\impl\interop\interop_memory.cpp">
+      <Filter>Code\impl\interop</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\impl\interop\interop_output_stream.cpp">
+      <Filter>Code\impl\interop</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\impl\ignite_environment.cpp">
+      <Filter>Code\impl</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\impl\ignite_impl.cpp">
+      <Filter>Code\impl</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\portable\portable_containers.cpp">
+      <Filter>Code\portable</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\portable\portable_raw_reader.cpp">
+      <Filter>Code\portable</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\portable\portable_raw_writer.cpp">
+      <Filter>Code\portable</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\portable\portable_reader.cpp">
+      <Filter>Code\portable</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\portable\portable_writer.cpp">
+      <Filter>Code\portable</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\impl\portable\portable_reader_impl.cpp">
+      <Filter>Code\impl\portable</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\impl\portable\portable_utils.cpp">
+      <Filter>Code\impl\portable</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\impl\portable\portable_writer_impl.cpp">
+      <Filter>Code\impl\portable</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\os\win\src\impl\utils.cpp">
+      <Filter>Code\impl</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\ignite.cpp">
+      <Filter>Code</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\ignite_error.cpp">
+      <Filter>Code</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\ignition.cpp">
+      <Filter>Code</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\guid.cpp">
+      <Filter>Code</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\impl\handle_registry.cpp">
+      <Filter>Code\impl</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\impl\cache\query\query_impl.cpp">
+      <Filter>Code\impl\cache\query</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\impl\portable\portable_metadata_snapshot.cpp">
+      <Filter>Code\impl\portable</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\impl\portable\portable_metadata_handler.cpp">
+      <Filter>Code\impl\portable</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\portable\portable_type.cpp">
+      <Filter>Code\portable</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\impl\portable\portable_metadata_manager.cpp">
+      <Filter>Code\impl\portable</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\impl\portable\portable_metadata_updater.cpp">
+      <Filter>Code\impl\portable</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\impl\portable\portable_metadata_updater_impl.cpp">
+      <Filter>Code\impl\portable</Filter>
+    </ClCompile>
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="..\..\include\ignite\impl\cache\cache_impl.h">
+      <Filter>Code\impl\cache</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\include\ignite\cache\cache.h">
+      <Filter>Code\cache</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\include\ignite\cache\cache_peek_mode.h">
+      <Filter>Code\cache</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\include\ignite\impl\interop\interop.h">
+      <Filter>Code\impl\interop</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\include\ignite\impl\interop\interop_input_stream.h">
+      <Filter>Code\impl\interop</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\include\ignite\impl\interop\interop_memory.h">
+      <Filter>Code\impl\interop</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\include\ignite\impl\interop\interop_output_stream.h">
+      <Filter>Code\impl\interop</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\include\ignite\impl\ignite_environment.h">
+      <Filter>Code\impl</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\include\ignite\impl\ignite_impl.h">
+      <Filter>Code\impl</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\include\ignite\impl\operations.h">
+      <Filter>Code\impl</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\include\ignite\impl\portable\portable_common.h">
+      <Filter>Code\impl\portable</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\include\ignite\portable\portable_consts.h">
+      <Filter>Code\portable</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\include\ignite\portable\portable.h">
+      <Filter>Code\portable</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\include\ignite\portable\portable_containers.h">
+      <Filter>Code\portable</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\include\ignite\impl\portable\portable_id_resolver.h">
+      <Filter>Code\impl\portable</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\include\ignite\portable\portable_raw_reader.h">
+      <Filter>Code\portable</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\include\ignite\portable\portable_raw_writer.h">
+      <Filter>Code\portable</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\include\ignite\portable\portable_reader.h">
+      <Filter>Code\portable</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\include\ignite\portable\portable_writer.h">
+      <Filter>Code\portable</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\include\ignite\impl\portable\portable_reader_impl.h">
+      <Filter>Code\impl\portable</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\include\ignite\impl\portable\portable_utils.h">
+      <Filter>Code\impl\portable</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\include\ignite\impl\portable\portable_writer_impl.h">
+      <Filter>Code\impl\portable</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\os\win\include\ignite\impl\utils.h">
+      <Filter>Code\impl</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\include\ignite\ignite.h">
+      <Filter>Code</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\include\ignite\ignite_configuration.h">
+      <Filter>Code</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\include\ignite\ignite_error.h">
+      <Filter>Code</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\include\ignite\ignition.h">
+      <Filter>Code</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\include\ignite\guid.h">
+      <Filter>Code</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\include\ignite\impl\handle_registry.h">
+      <Filter>Code\impl</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\include\ignite\cache\cache_entry.h">
+      <Filter>Code\cache</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\include\ignite\impl\cache\query\query_impl.h">
+      <Filter>Code\impl\cache\query</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\include\ignite\impl\portable\portable_metadata_snapshot.h">
+      <Filter>Code\impl\portable</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\include\ignite\impl\portable\portable_metadata_handler.h">
+      <Filter>Code\impl\portable</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\include\ignite\impl\portable\portable_metadata_manager.h">
+      <Filter>Code\impl\portable</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\include\ignite\portable\portable_type.h">
+      <Filter>Code\portable</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\include\ignite\impl\portable\portable_metadata_updater.h">
+      <Filter>Code\impl\portable</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\include\ignite\impl\portable\portable_metadata_updater_impl.h">
+      <Filter>Code\impl\portable</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\include\ignite\cache\query\query_argument.h">
+      <Filter>Code\cache\query</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\include\ignite\cache\query\query_cursor.h">
+      <Filter>Code\cache\query</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\include\ignite\cache\query\query_sql.h">
+      <Filter>Code\cache\query</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\include\ignite\cache\query\query.h">
+      <Filter>Code\cache\query</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\include\ignite\cache\query\query_text.h">
+      <Filter>Code\cache\query</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\include\ignite\cache\query\query_scan.h">
+      <Filter>Code\cache\query</Filter>
+    </ClInclude>
+  </ItemGroup>
+  <ItemGroup>
+    <Filter Include="Code">
+      <UniqueIdentifier>{91873c79-a64f-4786-ab25-d03ef2db9dc8}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="Code\impl">
+      <UniqueIdentifier>{9bede404-e1b1-44d6-b54d-e9b2441c5f13}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="Code\impl\cache">
+      <UniqueIdentifier>{b013b0f6-c4b8-4b88-89bc-8b394971788e}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="Code\impl\portable">
+      <UniqueIdentifier>{883773bd-085d-4eb5-81ee-f11188134faf}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="Code\impl\interop">
+      <UniqueIdentifier>{d4cc8aeb-6e7b-47e6-9b83-cba925844d96}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="Code\cache">
+      <UniqueIdentifier>{8b7e32c0-e222-4f3a-af31-19df380c369f}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="Code\portable">
+      <UniqueIdentifier>{24b7134c-9335-44e1-9604-4093d0e3bbf5}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="Code\cache\query">
+      <UniqueIdentifier>{4658a0ff-0d2d-45a6-b8de-93eeec0cc081}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="Code\impl\cache\query">
+      <UniqueIdentifier>{b6e57294-120a-46f2-b0ad-c3595e2cf789}</UniqueIdentifier>
+    </Filter>
+  </ItemGroup>
+</Project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/core/src/guid.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/core/src/guid.cpp b/modules/platform/cpp/core/src/guid.cpp
new file mode 100644
index 0000000..77997e4
--- /dev/null
+++ b/modules/platform/cpp/core/src/guid.cpp
@@ -0,0 +1,65 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "ignite/guid.h"
+
+namespace ignite
+{
+    Guid::Guid() : most(0), least(0)
+    {
+        // No-op.
+    }
+
+    Guid::Guid(int64_t most, int64_t least) : most(most), least(least)
+    {
+        // No-op.
+    }
+
+    int64_t Guid::GetMostSignificantBits() const
+    {
+        return most;
+    }
+
+    int64_t Guid::GetLeastSignificantBits() const
+    {
+        return least;
+    }
+
+    int32_t Guid::GetVersion() const
+    {
+        return static_cast<int32_t>((most >> 12) & 0x0f);
+    }
+
+    int32_t Guid::GetVariant() const
+    {
+        uint64_t least0 = static_cast<uint64_t>(least);
+
+        return static_cast<int32_t>((least0 >> (64 - (least0 >> 62))) & (least >> 63));
+    }
+
+    int32_t Guid::GetHashCode() const
+    {
+        int64_t hilo = most ^ least;
+
+        return static_cast<int32_t>(hilo >> 32) ^ static_cast<int32_t>(hilo);
+    }
+
+    bool operator==(Guid& val1, Guid& val2)
+    {
+        return val1.least == val2.least && val1.most == val2.most;
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/core/src/ignite.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/core/src/ignite.cpp b/modules/platform/cpp/core/src/ignite.cpp
new file mode 100644
index 0000000..665383b
--- /dev/null
+++ b/modules/platform/cpp/core/src/ignite.cpp
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <ignite/common/java.h>
+
+#include "ignite/impl/ignite_impl.h"
+#include "ignite/ignite.h"
+
+using namespace ignite::common::concurrent;
+using namespace ignite::impl;
+
+namespace ignite
+{    
+    Ignite::Ignite() : impl(SharedPointer<IgniteImpl>())
+    {
+        // No-op.
+    }
+
+    Ignite::Ignite(IgniteImpl* impl) : impl(SharedPointer<IgniteImpl>(impl))
+    {
+        // No-op.
+    }
+
+    char* Ignite::GetName()
+    {
+        return impl.Get()->GetName();
+    }
+}
+

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/core/src/ignite_error.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/core/src/ignite_error.cpp b/modules/platform/cpp/core/src/ignite_error.cpp
new file mode 100644
index 0000000..65cd291
--- /dev/null
+++ b/modules/platform/cpp/core/src/ignite_error.cpp
@@ -0,0 +1,222 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#include <ignite/common/java.h>
+
+#include "ignite/impl/utils.h"
+#include "ignite/ignite_error.h"
+
+using namespace ignite::common::java;
+using namespace ignite::impl::utils;
+
+namespace ignite
+{
+    void IgniteError::ThrowIfNeeded(IgniteError& err)
+    {
+        if (err.code != IGNITE_SUCCESS)
+            throw err;
+    }
+
+    IgniteError::IgniteError() : code(IGNITE_SUCCESS), msg(NULL)
+    {
+        // No-op.
+    }
+
+    IgniteError::IgniteError(int32_t code) : code(code), msg(NULL)
+    {
+        // No-op.
+    }
+
+    IgniteError::IgniteError(int32_t code, const char* msg)
+    {
+        this->code = code;
+        this->msg = CopyChars(msg);
+    }
+
+    IgniteError::IgniteError(const IgniteError& other)
+    {
+        this->code = other.code;
+        this->msg = CopyChars(other.msg);
+    }
+
+    IgniteError& IgniteError::operator=(const IgniteError& other)
+    {
+        if (this != &other)
+        {
+            IgniteError tmp(other);
+
+            int tmpCode = code;
+            char* tmpMsg = msg;
+            
+            code = tmp.code;
+            msg = tmp.msg;
+
+            tmp.code = tmpCode;
+            tmp.msg = tmpMsg;
+        }
+
+        return *this;
+    }
+
+    IgniteError::~IgniteError()
+    {
+        ReleaseChars(msg);
+    }
+
+    int32_t IgniteError::GetCode()
+    {
+        return code;
+    }
+
+    const char* IgniteError::GetText()
+    {
+        if (code == IGNITE_SUCCESS)
+            return "Operation completed successfully.";
+        else if (msg)
+            return msg;
+        else
+            return  "No additional information available.";
+    }
+    
+    void IgniteError::SetError(const int jniCode, const char* jniCls, const char* jniMsg, IgniteError* err)
+    {
+        if (jniCode == IGNITE_JNI_ERR_SUCCESS)
+            *err = IgniteError();
+        else if (jniCode == IGNITE_JNI_ERR_GENERIC)
+        {
+            // The most common case when we have Java exception "in hands" and must map it to respective code.
+            if (jniCls)
+            {
+                std::string jniCls0 = jniCls;
+
+                if (jniCls0.compare("java.lang.NoClassDefFoundError") == 0)
+                {
+                    std::stringstream stream; 
+
+                    stream << "Java class is not found (did you set IGNITE_HOME environment variable?)";
+
+                    if (jniMsg)
+                        stream << ": " << jniMsg;
+                    
+                    *err = IgniteError(IGNITE_ERR_JVM_NO_CLASS_DEF_FOUND, stream.str().c_str());
+                }
+                else if (jniCls0.compare("java.lang.NoSuchMethodError") == 0)
+                {
+                    std::stringstream stream;
+
+                    stream << "Java method is not found (did you set IGNITE_HOME environment variable?)";
+
+                    if (jniMsg)
+                        stream << ": " << jniMsg;
+
+                    *err = IgniteError(IGNITE_ERR_JVM_NO_SUCH_METHOD, stream.str().c_str());
+                }
+                else if (jniCls0.compare("java.lang.IllegalArgumentException") == 0)
+                    *err = IgniteError(IGNITE_ERR_ILLEGAL_ARGUMENT, jniMsg);
+                else if (jniCls0.compare("java.lang.IllegalStateException") == 0)
+                    *err = IgniteError(IGNITE_ERR_ILLEGAL_STATE, jniMsg);
+                else if (jniCls0.compare("java.lang.UnsupportedOperationException") == 0)
+                    *err = IgniteError(IGNITE_ERR_UNSUPPORTED_OPERATION, jniMsg);
+                else if (jniCls0.compare("java.lang.InterruptedException") == 0)
+                    *err = IgniteError(IGNITE_ERR_INTERRUPTED, jniMsg);
+                else if (jniCls0.compare("org.apache.ignite.cluster.ClusterGroupEmptyException") == 0)
+                    *err = IgniteError(IGNITE_ERR_CLUSTER_GROUP_EMPTY, jniMsg);
+                else if (jniCls0.compare("org.apache.ignite.cluster.ClusterTopologyException") == 0)
+                    *err = IgniteError(IGNITE_ERR_CLUSTER_TOPOLOGY, jniMsg);
+                else if (jniCls0.compare("org.apache.ignite.compute.ComputeExecutionRejectedException") == 0)
+                    *err = IgniteError(IGNITE_ERR_COMPUTE_EXECUTION_REJECTED, jniMsg);
+                else if (jniCls0.compare("org.apache.ignite.compute.ComputeJobFailoverException") == 0)
+                    *err = IgniteError(IGNITE_ERR_COMPUTE_JOB_FAILOVER, jniMsg);
+                else if (jniCls0.compare("org.apache.ignite.compute.ComputeTaskCancelledException") == 0)
+                    *err = IgniteError(IGNITE_ERR_COMPUTE_TASK_CANCELLED, jniMsg);
+                else if (jniCls0.compare("org.apache.ignite.compute.ComputeTaskTimeoutException") == 0)
+                    *err = IgniteError(IGNITE_ERR_COMPUTE_TASK_TIMEOUT, jniMsg);
+                else if (jniCls0.compare("org.apache.ignite.compute.ComputeUserUndeclaredException") == 0)
+                    *err = IgniteError(IGNITE_ERR_COMPUTE_USER_UNDECLARED_EXCEPTION, jniMsg);
+                else if (jniCls0.compare("javax.cache.CacheException") == 0)
+                    *err = IgniteError(IGNITE_ERR_CACHE, jniMsg);
+                else if (jniCls0.compare("javax.cache.integration.CacheLoaderException") == 0)
+                    *err = IgniteError(IGNITE_ERR_CACHE_LOADER, jniMsg);
+                else if (jniCls0.compare("javax.cache.integration.CacheWriterException") == 0)
+                    *err = IgniteError(IGNITE_ERR_CACHE_WRITER, jniMsg);
+                else if (jniCls0.compare("javax.cache.processor.EntryProcessorException") == 0)
+                    *err = IgniteError(IGNITE_ERR_ENTRY_PROCESSOR, jniMsg);
+                else if (jniCls0.compare("org.apache.ignite.cache.CacheAtomicUpdateTimeoutException") == 0)
+                    *err = IgniteError(IGNITE_ERR_CACHE_ATOMIC_UPDATE_TIMEOUT, jniMsg);
+                else if (jniCls0.compare("org.apache.ignite.cache.CachePartialUpdateException") == 0)
+                    *err = IgniteError(IGNITE_ERR_CACHE_PARTIAL_UPDATE, jniMsg);
+                else if (jniCls0.compare("org.apache.ignite.transactions.TransactionOptimisticException") == 0)
+                    *err = IgniteError(IGNITE_ERR_TX_OPTIMISTIC, jniMsg);
+                else if (jniCls0.compare("org.apache.ignite.transactions.TransactionTimeoutException") == 0)
+                    *err = IgniteError(IGNITE_ERR_TX_TIMEOUT, jniMsg);
+                else if (jniCls0.compare("org.apache.ignite.transactions.TransactionRollbackException") == 0)
+                    *err = IgniteError(IGNITE_ERR_TX_ROLLBACK, jniMsg);
+                else if (jniCls0.compare("org.apache.ignite.transactions.TransactionHeuristicException") == 0)
+                    *err = IgniteError(IGNITE_ERR_TX_HEURISTIC, jniMsg);
+                else if (jniCls0.compare("org.apache.ignite.IgniteAuthenticationException") == 0)
+                    *err = IgniteError(IGNITE_ERR_AUTHENTICATION, jniMsg);
+                else if (jniCls0.compare("org.apache.ignite.plugin.security.GridSecurityException") == 0)
+                    *err = IgniteError(IGNITE_ERR_SECURITY, jniMsg);
+                else if (jniCls0.compare("org.apache.ignite.IgniteException") == 0)
+                    *err = IgniteError(IGNITE_ERR_GENERIC, jniMsg);
+                else if (jniCls0.compare("org.apache.ignite.IgniteCheckedException") == 0)
+                    *err = IgniteError(IGNITE_ERR_GENERIC, jniMsg);
+                else
+                {
+                    std::stringstream stream;
+                    
+                    stream << "Java exception occurred [cls=" << jniCls0;
+
+                    if (jniMsg)
+                        stream << ", msg=" << jniMsg;
+
+                    stream << "]";
+
+                    *err = IgniteError(IGNITE_ERR_UNKNOWN, stream.str().c_str());
+                }                    
+            }
+            else
+            {
+                // JNI class name is not available. Something really weird.
+                *err = IgniteError(IGNITE_ERR_UNKNOWN);
+            }
+        }
+        else if (jniCode == IGNITE_JNI_ERR_JVM_INIT)
+        {
+            std::stringstream stream;
+
+            stream << "Failed to initialize JVM [errCls=";
+
+            if (jniCls)
+                stream << jniCls;
+            else
+                stream << "N/A";
+
+            stream << ", errMsg=";
+
+            if (jniMsg)
+                stream << jniMsg;
+            else
+                stream << "N/A";
+
+            stream << "]";
+
+            *err = IgniteError(IGNITE_ERR_JVM_INIT, stream.str().c_str());
+        }
+        else if (jniCode == IGNITE_JNI_ERR_JVM_ATTACH)
+            *err = IgniteError(IGNITE_ERR_JVM_ATTACH, "Failed to attach to JVM.");
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/core/src/ignition.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/core/src/ignition.cpp b/modules/platform/cpp/core/src/ignition.cpp
new file mode 100644
index 0000000..a0e3367
--- /dev/null
+++ b/modules/platform/cpp/core/src/ignition.cpp
@@ -0,0 +1,468 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <sstream>
+
+#include <ignite/common/common.h>
+#include <ignite/common/concurrent.h>
+#include <ignite/common/exports.h>
+#include <ignite/common/java.h>
+
+#include "ignite/impl/ignite_environment.h"
+#include "ignite/impl/ignite_impl.h"
+#include "ignite/impl/utils.h"
+#include "ignite/ignition.h"
+
+using namespace ignite::common::concurrent;
+using namespace ignite::common::java;
+using namespace ignite::impl;
+using namespace ignite::impl::utils;
+
+namespace ignite
+{
+    /** Default configuration. */
+    const char* DFLT_CFG = "config/default-config.xml";
+
+    /** Whether JVM library is loaded to the process. */
+    bool JVM_LIB_LOADED;
+
+    /** Critical section for factory methods. */
+    CriticalSection factoryLock;
+
+    /** Flag indicating that at least one Ignite instance has started. */
+    bool started = false;
+
+    /**
+     * Convert integer value to string.
+     */
+    std::string JvmMemoryString(const std::string& prefix, int32_t val)
+    {
+        std::ostringstream ss;
+        ss << val;
+
+        std::string valStr = ss.str();
+
+        std::string res = std::string(prefix);
+        res.append(valStr);
+        res.append("m");
+
+        return res;
+    }
+
+    /**
+     * Create JVM options.
+     *
+     * @param cfg Configuration.
+     * @param home Optional GG home.
+     * @param cp Classpath.
+     * @param opts Options.
+     * @param optsLen Options length.
+     * @return Options.
+     */
+    char** CreateJvmOptions(const IgniteConfiguration& cfg, const std::string* home, const std::string& cp, int* optsLen)
+    {
+        *optsLen = 3 + (home ? 1 : 0) + cfg.jvmOptsLen;
+        char** opts = new char*[*optsLen];
+
+        int idx = 0;
+
+        // 1. Set classpath.
+        std::string cpFull = std::string("-Djava.class.path=") + cp;
+
+        *(opts + idx++) = CopyChars(cpFull.c_str());
+
+        // 2. Set home.
+        if (home) {
+            std::string homeFull = std::string("-DIGNITE_HOME=") + *home;
+
+            *(opts + idx++) = CopyChars(homeFull.c_str());
+        }
+
+        // 3. Set Xms, Xmx.
+        std::string xmsStr = JvmMemoryString(std::string("-Xms"), cfg.jvmInitMem);
+        std::string xmxStr = JvmMemoryString(std::string("-Xmx"), cfg.jvmMaxMem);
+
+        *(opts + idx++) = CopyChars(xmsStr.c_str());
+        *(opts + idx++) = CopyChars(xmxStr.c_str());
+
+        // 4. Set the rest options.
+        for (int i = 0; i < cfg.jvmOptsLen; i++) {
+            char* optCopy = CopyChars(cfg.jvmOpts[i].opt);
+
+            opts[idx++] = optCopy;
+        }
+
+        return opts;
+    }
+
+    Ignite Ignition::Start(const IgniteConfiguration& cfg)
+    {
+        return Start(cfg, static_cast<const char*>(NULL));
+    }
+
+    Ignite Ignition::Start(const IgniteConfiguration& cfg, IgniteError* err)
+    {
+        return Start(cfg, NULL, err);
+    }
+
+    Ignite Ignition::Start(const IgniteConfiguration& cfg, const char* name)
+    {
+        IgniteError err;
+
+        Ignite res = Start(cfg, name, &err);
+
+        IgniteError::ThrowIfNeeded(err);
+
+        return res;
+    }
+
+    Ignite Ignition::Start(const IgniteConfiguration& cfg, const char* name, IgniteError* err)
+    {
+        bool failed = false;
+
+        SharedPointer<IgniteEnvironment> env;
+        SharedPointer<IgniteEnvironment>* envTarget = NULL;
+
+        jobject javaRef = NULL;
+
+        factoryLock.Enter();
+
+        // 1. Load JVM library if needed.
+        if (!JVM_LIB_LOADED)
+        {
+            bool jvmLibFound;
+            std::string jvmLib;
+
+            if (cfg.jvmLibPath)
+            {
+                std::string jvmLibPath = std::string(cfg.jvmLibPath);
+
+                jvmLib = FindJvmLibrary(&jvmLibPath, &jvmLibFound);
+            }
+            else
+                jvmLib = FindJvmLibrary(NULL, &jvmLibFound);
+
+            if (!jvmLibFound)
+            {
+                *err = IgniteError(IgniteError::IGNITE_ERR_JVM_LIB_NOT_FOUND,
+                    "JVM library is not found (did you set JAVA_HOME environment variable?)");
+
+                failed = true;
+            }
+
+            if (!failed) {
+                if (!LoadJvmLibrary(jvmLib))
+                {
+                    *err = IgniteError(IgniteError::IGNITE_ERR_JVM_LIB_LOAD_FAILED, "Failed to load JVM library.");
+
+                    failed = true;
+                }
+            }
+
+            JVM_LIB_LOADED = true;
+        }
+
+        if (!failed)
+        {
+            // 2. Resolve IGNITE_HOME.
+            bool homeFound;
+            std::string home;
+
+            if (cfg.igniteHome)
+            {
+                std::string homePath = std::string(cfg.igniteHome);
+
+                home = ResolveIgniteHome(&homePath, &homeFound);
+            }
+            else
+                home = ResolveIgniteHome(NULL, &homeFound);
+
+            // 3. Create classpath.
+            std::string cp;
+
+            if (cfg.jvmClassPath)
+            {
+                std::string usrCp = cfg.jvmClassPath;
+
+                cp = CreateIgniteClasspath(&usrCp, homeFound ? &home : NULL);
+            }
+            else
+                cp = CreateIgniteClasspath(NULL, homeFound ? &home : NULL);
+
+            if (!cp.empty())
+            {
+                // 4. Start JVM if needed.
+                JniErrorInfo jniErr;
+
+                env = SharedPointer<IgniteEnvironment>(new IgniteEnvironment());
+
+                int optsLen;
+                char** opts = CreateJvmOptions(cfg, homeFound ? &home : NULL, cp, &optsLen);
+
+                envTarget = new SharedPointer<IgniteEnvironment>(env);
+                
+                SharedPointer<JniContext> ctx(
+                    JniContext::Create(opts, optsLen, env.Get()->GetJniHandlers(envTarget), &jniErr));
+
+                for (int i = 0; i < optsLen; i++)
+                    ReleaseChars(*(opts + i));
+
+                delete[] opts;
+
+                if (!ctx.Get())
+                {
+                    IgniteError::SetError(jniErr.code, jniErr.errCls, jniErr.errMsg, err);
+                    
+                    failed = true;
+                }
+
+                // 5. Start Ignite.
+                if (!failed)
+                {
+                    char* springCfgPath0 = CopyChars(cfg.springCfgPath);
+
+                    if (!springCfgPath0)
+                        springCfgPath0 = CopyChars(DFLT_CFG);
+
+                    char* name0 = CopyChars(name);
+
+                    interop::InteropUnpooledMemory mem(16);
+                    interop::InteropOutputStream stream(&mem);
+                    stream.WriteBool(false);
+                    stream.Synchronize();
+
+                    javaRef = ctx.Get()->IgnitionStart(springCfgPath0, name0, 2, mem.PointerLong(), &jniErr);
+
+                    ReleaseChars(springCfgPath0);
+                    ReleaseChars(name0);
+
+                    if (!javaRef) {
+                        IgniteError::SetError(jniErr.code, jniErr.errCls, jniErr.errMsg, err);
+                        
+                        failed = true;
+                    }
+                    else {
+                        // 6. Ignite is started at this point.
+                        env.Get()->Initialize(ctx);
+
+                        started = true;
+                    }
+                }
+            }
+            else {
+                *err = IgniteError(IgniteError::IGNITE_ERR_JVM_NO_CLASSPATH,
+                    "Java classpath is empty (did you set IGNITE_HOME environment variable?)");
+
+                failed = true;
+            }
+        }
+
+        factoryLock.Leave();
+
+        if (failed) 
+        {
+            if (envTarget)
+                delete envTarget;
+
+            return Ignite();
+        }
+        else 
+        {
+            IgniteImpl* impl = new IgniteImpl(env, javaRef);
+
+            return Ignite(impl);
+        }
+    }
+
+    Ignite Ignition::Get()
+    {
+        return Get(static_cast<const char*>(NULL));
+    }
+
+    Ignite Ignition::Get(IgniteError* err)
+    {
+        return Get(NULL, err);
+    }
+
+    Ignite Ignition::Get(const char* name)
+    {
+        IgniteError err;
+
+        Ignite res = Get(name, &err);
+
+        IgniteError::ThrowIfNeeded(err);
+
+        return res;
+    }
+
+    Ignite Ignition::Get(const char* name, IgniteError* err)
+    {
+        Ignite res;
+
+        factoryLock.Enter();
+
+        if (started)
+        {
+            char* name0 = CopyChars(name);
+
+            // 1. Create context for this operation.
+            JniErrorInfo jniErr;
+
+            SharedPointer<JniContext> ctx(JniContext::Create(NULL, 0, JniHandlers(), &jniErr));
+
+            IgniteError::SetError(jniErr.code, jniErr.errCls, jniErr.errMsg, err);
+
+            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);
+
+                if (err->GetCode() == IgniteError::IGNITE_SUCCESS)
+                {
+                    if (ptr != 0)
+                    {
+                        // 3. Obtain real environment for this instance.
+                        JniHandlers* hnds = reinterpret_cast<JniHandlers*>(ptr);
+
+                        SharedPointer<IgniteEnvironment>* env =
+                            static_cast<SharedPointer<IgniteEnvironment>*>(hnds->target);
+
+                        // 4. Get fresh node reference.
+                        jobject ref = ctx.Get()->IgnitionInstance(name0, &jniErr);
+
+                        if (err->GetCode() == IgniteError::IGNITE_SUCCESS) {
+                            if (ref)
+                            {
+                                IgniteImpl* impl = new IgniteImpl(*env, ref);
+
+                                res = Ignite(impl);
+                            }
+                            else
+                                // Error: concurrent node stop.
+                                *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,
+                            "Failed to get Ignite instance because it is either not started yet or already stopped.");
+                }
+            }
+
+            ReleaseChars(name0);
+        }
+        else
+            // Error: no node with the given name.
+            *err = IgniteError(IgniteError::IGNITE_ERR_GENERIC,
+                "Failed to get Ignite instance because it is either not started yet or already stopped.");
+
+        factoryLock.Leave();
+
+        return res;
+    }
+
+    bool Ignition::Stop(const bool cancel)
+    {
+        return Stop(NULL, cancel);
+    }
+
+    bool Ignition::Stop(const bool cancel, IgniteError* err)
+    {
+        return Stop(NULL, cancel, err);
+    }
+
+    bool Ignition::Stop(const char* name, const bool cancel)
+    {
+        IgniteError err;
+
+        bool res = Stop(name, cancel, &err);
+
+        IgniteError::ThrowIfNeeded(err);
+
+        return res;
+    }
+
+    bool Ignition::Stop(const char* name, const bool cancel, IgniteError* err)
+    {
+        bool res = false;
+
+        factoryLock.Enter();
+
+        if (started)
+        {
+            JniErrorInfo jniErr;
+
+            SharedPointer<JniContext> ctx(JniContext::Create(NULL, 0, JniHandlers(), &jniErr));
+
+            IgniteError::SetError(jniErr.code, jniErr.errCls, jniErr.errMsg, err);
+
+            if (err->GetCode() == IgniteError::IGNITE_SUCCESS)
+            {
+                char* name0 = CopyChars(name);
+
+                bool res0 = ctx.Get()->IgnitionStop(name0, cancel, &jniErr);
+
+                ReleaseChars(name0);
+
+                IgniteError::SetError(jniErr.code, jniErr.errCls, jniErr.errMsg, err);
+
+                if (err->GetCode() == IgniteError::IGNITE_SUCCESS)
+                    res = res0;
+            }
+        }
+
+        factoryLock.Leave();
+
+        return res;
+    }
+
+    void Ignition::StopAll(const bool cancel)
+    {
+        IgniteError err;
+
+        StopAll(cancel, &err);
+
+        IgniteError::ThrowIfNeeded(err);
+    }
+
+    void Ignition::StopAll(const bool cancel, IgniteError* err)
+    {
+        factoryLock.Enter();
+
+        if (started)
+        {
+            JniErrorInfo jniErr;
+
+            SharedPointer<JniContext> ctx(JniContext::Create(NULL, 0, JniHandlers(), &jniErr));
+             
+            IgniteError::SetError(jniErr.code, jniErr.errCls, jniErr.errMsg, err);
+
+            if (err->GetCode() == IgniteError::IGNITE_SUCCESS)
+            {
+                ctx.Get()->IgnitionStopAll(cancel, &jniErr);
+
+                IgniteError::SetError(jniErr.code, jniErr.errCls, jniErr.errMsg, err);
+            }
+        }
+
+        factoryLock.Leave();
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/core/src/impl/cache/cache_impl.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/core/src/impl/cache/cache_impl.cpp b/modules/platform/cpp/core/src/impl/cache/cache_impl.cpp
new file mode 100644
index 0000000..2f211e7
--- /dev/null
+++ b/modules/platform/cpp/core/src/impl/cache/cache_impl.cpp
@@ -0,0 +1,388 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "ignite/cache/cache_peek_mode.h"
+#include "ignite/impl/cache/cache_impl.h"
+#include "ignite/impl/interop/interop.h"
+#include "ignite/impl/portable/portable_reader_impl.h"
+#include "ignite/impl/utils.h"
+#include "ignite/impl/portable/portable_metadata_updater_impl.h"
+#include "ignite/portable/portable.h"
+
+using namespace ignite::common::concurrent;
+using namespace ignite::common::java;
+using namespace ignite::cache;
+using namespace ignite::cache::query;
+using namespace ignite::impl;
+using namespace ignite::impl::cache::query;
+using namespace ignite::impl::interop;
+using namespace ignite::impl::portable;
+using namespace ignite::impl::utils;
+using namespace ignite::portable;
+
+namespace ignite
+{
+    namespace impl
+    {
+        namespace cache
+        {
+            /** Operation: Clear. */
+            const int32_t OP_CLEAR = 1;
+
+            /** Operation: ClearAll. */
+            const int32_t OP_CLEAR_ALL = 2;
+
+            /** Operation: ContainsKey. */
+            const int32_t OP_CONTAINS_KEY = 3;
+
+            /** Operation: ContainsKeys. */
+            const int32_t OP_CONTAINS_KEYS = 4;
+
+            /** Operation: Get. */
+            const int32_t OP_GET = 5;
+
+            /** Operation: GetAll. */
+            const int32_t OP_GET_ALL = 6;
+
+            /** Operation: GetAndPut. */
+            const int32_t OP_GET_AND_PUT = 7;
+
+            /** Operation: GetAndPutIfAbsent. */
+            const int32_t OP_GET_AND_PUT_IF_ABSENT = 8;
+
+            /** Operation: GetAndRemove. */
+            const int32_t OP_GET_AND_REMOVE = 9;
+
+            /** Operation: GetAndReplace. */
+            const int32_t OP_GET_AND_REPLACE = 10;
+
+            /** Operation: LocalEvict. */
+            const int32_t OP_LOCAL_EVICT = 16;
+
+            /** Operation: LocalClear. */
+            const int32_t OP_LOCAL_CLEAR = 20;
+
+            /** Operation: LocalClearAll. */
+            const int32_t OP_LOCAL_CLEAR_ALL = 21;
+
+            /** Operation: LocalPeek. */
+            const int32_t OP_LOCAL_PEEK = 25;
+
+            /** Operation: Put. */
+            const int32_t OP_PUT = 26;
+
+            /** Operation: PutAll. */
+            const int32_t OP_PUT_ALL = 27;
+
+            /** Operation: PutIfAbsent. */
+            const int32_t OP_PUT_IF_ABSENT = 28;
+
+            /** Operation: SCAN query. */
+            const int32_t OP_QRY_SCAN = 30;
+
+            /** Operation: SQL query. */
+            const int32_t OP_QRY_SQL = 31;
+
+            /** Operation: SQL fields query. */
+            const int32_t OP_QRY_SQL_FIELDS = 32;
+
+            /** Operation: TEXT query. */
+            const int32_t OP_QRY_TEXT = 33;
+
+            /** Operation: RemoveAll. */
+            const int32_t OP_REMOVE_ALL = 34;
+
+            /** Operation: Remove(K, V). */
+            const int32_t OP_REMOVE_2 = 35;
+
+            /** Operation: Remove(K). */
+            const int32_t OP_REMOVE_1 = 36;
+
+            /** Operation: Replace(K, V). */
+            const int32_t OP_REPLACE_2 = 37;
+
+            /** Operation: Replace(K, V, V). */
+            const int32_t OP_REPLACE_3 = 38;
+
+            CacheImpl::CacheImpl(char* name, SharedPointer<IgniteEnvironment> env, jobject javaRef) :
+                name(name), env(env), javaRef(javaRef)
+            {
+                // No-op.
+            }
+
+            CacheImpl::~CacheImpl()
+            {
+                ReleaseChars(name);
+
+                JniContext::Release(javaRef);
+            }
+
+            char* CacheImpl::GetName()
+            {
+                return name;
+            }
+
+            bool CacheImpl::IsEmpty(IgniteError* err)
+            {
+                return Size(IGNITE_PEEK_MODE_ALL, err) == 0;
+            }
+
+            bool CacheImpl::ContainsKey(InputOperation& inOp, IgniteError* err)
+            {
+                return OutOpInternal(OP_CONTAINS_KEY, inOp, err);
+            }
+
+            bool CacheImpl::ContainsKeys(InputOperation& inOp, IgniteError* err)
+            {
+                return OutOpInternal(OP_CONTAINS_KEYS, inOp, err);
+            }
+
+            void CacheImpl::LocalPeek(InputOperation& inOp, OutputOperation& outOp, int32_t peekModes, IgniteError* err)
+            {
+                OutInOpInternal(OP_LOCAL_PEEK, inOp, outOp, err);
+            }
+
+            void CacheImpl::Get(InputOperation& inOp, OutputOperation& outOp, IgniteError* err)
+            {
+                OutInOpInternal(OP_GET, inOp, outOp, err);
+            }
+
+            void CacheImpl::GetAll(InputOperation& inOp, OutputOperation& outOp, IgniteError* err)
+            {
+                OutInOpInternal(OP_GET_ALL, inOp, outOp, err);
+            }
+
+            void CacheImpl::Put(InputOperation& inOp, IgniteError* err)
+            {
+                OutOpInternal(OP_PUT, inOp, err);
+            }
+
+            void CacheImpl::PutAll(ignite::impl::InputOperation& inOp, IgniteError* err)
+            {
+                OutOpInternal(OP_PUT_ALL, inOp, err);
+            }
+
+            void CacheImpl::GetAndPut(InputOperation& inOp, OutputOperation& outOp, IgniteError* err)
+            {
+                OutInOpInternal(OP_GET_AND_PUT, inOp, outOp, err);
+            }
+
+            void CacheImpl::GetAndReplace(InputOperation& inOp, OutputOperation& outOp, IgniteError* err)
+            {
+                OutInOpInternal(OP_GET_AND_REPLACE, inOp, outOp, err);
+            }
+
+            void CacheImpl::GetAndRemove(InputOperation& inOp, OutputOperation& outOp, IgniteError* err)
+            {
+                OutInOpInternal(OP_GET_AND_REMOVE, inOp, outOp, err);
+            }
+
+            bool CacheImpl::PutIfAbsent(InputOperation& inOp, IgniteError* err)
+            {
+                return OutOpInternal(OP_PUT_IF_ABSENT, inOp, err);
+            }
+
+            void CacheImpl::GetAndPutIfAbsent(InputOperation& inOp, OutputOperation& outOp, IgniteError* err)
+            {
+                OutInOpInternal(OP_GET_AND_PUT_IF_ABSENT, inOp, outOp, err);
+            }
+
+            bool CacheImpl::Replace(InputOperation& inOp, IgniteError* err)
+            {
+                return OutOpInternal(OP_REPLACE_2, inOp, err);
+            }
+
+            bool CacheImpl::ReplaceIfEqual(InputOperation& inOp, IgniteError* err)
+            {
+                return OutOpInternal(OP_REPLACE_3, inOp, err);
+            }
+
+            void CacheImpl::LocalEvict(InputOperation& inOp, IgniteError* err)
+            {
+                OutOpInternal(OP_LOCAL_EVICT, inOp, err);
+            }
+
+            void CacheImpl::Clear(IgniteError* err)
+            {
+                JniErrorInfo jniErr;
+
+                env.Get()->Context()->CacheClear(javaRef, &jniErr);
+
+                IgniteError::SetError(jniErr.code, jniErr.errCls, jniErr.errMsg, err);
+            }
+
+            void CacheImpl::Clear(InputOperation& inOp, IgniteError* err)
+            {
+                OutOpInternal(OP_CLEAR, inOp, err);
+            }
+
+            void CacheImpl::ClearAll(InputOperation& inOp, IgniteError* err)
+            {
+                OutOpInternal(OP_CLEAR_ALL, inOp, err);
+            }
+
+            void CacheImpl::LocalClear(InputOperation& inOp, IgniteError* err)
+            {
+                OutOpInternal(OP_LOCAL_CLEAR, inOp, err);
+            }
+
+            void CacheImpl::LocalClearAll(InputOperation& inOp, IgniteError* err)
+            {
+                OutOpInternal(OP_LOCAL_CLEAR_ALL, inOp, err);
+            }
+
+            bool CacheImpl::Remove(InputOperation& inOp, IgniteError* err)
+            {
+                return OutOpInternal(OP_REMOVE_1, inOp, err);
+            }
+
+            bool CacheImpl::RemoveIfEqual(InputOperation& inOp, IgniteError* err)
+            {
+                return OutOpInternal(OP_REMOVE_2, inOp, err);
+            }
+
+            void CacheImpl::RemoveAll(InputOperation& inOp, IgniteError* err)
+            {
+                OutOpInternal(OP_REMOVE_ALL, inOp, err);
+            }
+
+            void CacheImpl::RemoveAll(IgniteError* err)
+            {
+                JniErrorInfo jniErr;
+
+                env.Get()->Context()->CacheRemoveAll(javaRef, &jniErr);
+
+                IgniteError::SetError(jniErr.code, jniErr.errCls, jniErr.errMsg, err);
+            }
+
+            int32_t CacheImpl::Size(const int32_t peekModes, IgniteError* err)
+            {
+                return SizeInternal(peekModes, false, err);
+            }
+
+            int32_t CacheImpl::LocalSize(const int32_t peekModes, IgniteError* err)
+            {
+                return SizeInternal(peekModes, true, err);
+            }
+
+            QueryCursorImpl* CacheImpl::QuerySql(const SqlQuery& qry, IgniteError* err)
+            {
+                return QueryInternal(qry, OP_QRY_SQL, err);
+            }
+
+            QueryCursorImpl* CacheImpl::QueryText(const TextQuery& qry, IgniteError* err)
+            {
+                return QueryInternal(qry, OP_QRY_TEXT, err);
+            }
+
+            QueryCursorImpl* CacheImpl::QueryScan(const ScanQuery& qry, IgniteError* err)
+            {
+                return QueryInternal(qry, OP_QRY_SCAN, err);
+            }
+
+            int64_t CacheImpl::WriteTo(InteropMemory* mem, InputOperation& inOp, IgniteError* err)
+            {
+                PortableMetadataManager* metaMgr = env.Get()->GetMetadataManager();
+
+                int32_t metaVer = metaMgr->GetVersion();
+
+                InteropOutputStream out(mem);
+                PortableWriterImpl writer(&out, metaMgr);
+                
+                inOp.ProcessInput(writer);
+
+                out.Synchronize();
+
+                if (metaMgr->IsUpdatedSince(metaVer))
+                {
+                    PortableMetadataUpdaterImpl metaUpdater(env, javaRef);
+
+                    if (!metaMgr->ProcessPendingUpdates(&metaUpdater, err))
+                        return 0;
+                }
+
+                return mem->PointerLong();
+            }
+
+            void CacheImpl::ReadFrom(InteropMemory* mem, OutputOperation& outOp)
+            {
+                InteropInputStream in(mem);
+
+                PortableReaderImpl reader(&in);
+
+                outOp.ProcessOutput(reader);
+            }
+
+            int CacheImpl::SizeInternal(const int32_t peekModes, const bool loc, IgniteError* err)
+            {
+                JniErrorInfo jniErr;
+
+                int res = env.Get()->Context()->CacheSize(javaRef, peekModes, loc, &jniErr);
+
+                IgniteError::SetError(jniErr.code, jniErr.errCls, jniErr.errMsg, err);
+
+                if (jniErr.code == IGNITE_JNI_ERR_SUCCESS)
+                    return res;
+                else
+                    return -1;
+            }
+
+            bool CacheImpl::OutOpInternal(const int32_t opType, InputOperation& inOp, IgniteError* err)
+            {
+                JniErrorInfo jniErr;
+
+                SharedPointer<InteropMemory> mem = env.Get()->AllocateMemory();
+
+                int64_t outPtr = WriteTo(mem.Get(), inOp, err);
+
+                if (outPtr)
+                {
+                    long long res = env.Get()->Context()->TargetInStreamOutLong(javaRef, opType, outPtr, &jniErr);
+
+                    IgniteError::SetError(jniErr.code, jniErr.errCls, jniErr.errMsg, err);
+
+                    if (jniErr.code == IGNITE_JNI_ERR_SUCCESS)
+                        return res == 1;
+                }
+
+                return false;
+            }
+
+            void CacheImpl::OutInOpInternal(const int32_t opType, InputOperation& inOp, OutputOperation& outOp, 
+                IgniteError* err)
+            {
+                JniErrorInfo jniErr;
+
+                SharedPointer<InteropMemory> outMem = env.Get()->AllocateMemory();
+                SharedPointer<InteropMemory> inMem = env.Get()->AllocateMemory();
+
+                int64_t outPtr = WriteTo(outMem.Get(), inOp, err);
+
+                if (outPtr)
+                {
+                    env.Get()->Context()->TargetInStreamOutStream(javaRef, opType, WriteTo(outMem.Get(), inOp, err), 
+                        inMem.Get()->PointerLong(), &jniErr);
+
+                    IgniteError::SetError(jniErr.code, jniErr.errCls, jniErr.errMsg, err);
+
+                    if (jniErr.code == IGNITE_JNI_ERR_SUCCESS)
+                        ReadFrom(inMem.Get(), outOp);
+                }
+            }
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/core/src/impl/cache/query/query_impl.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/core/src/impl/cache/query/query_impl.cpp b/modules/platform/cpp/core/src/impl/cache/query/query_impl.cpp
new file mode 100644
index 0000000..7d89321
--- /dev/null
+++ b/modules/platform/cpp/core/src/impl/cache/query/query_impl.cpp
@@ -0,0 +1,193 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "ignite/impl/cache/query/query_impl.h"
+
+using namespace ignite::common::concurrent;
+using namespace ignite::common::java;
+using namespace ignite::impl::interop;
+using namespace ignite::impl::portable;
+
+namespace ignite
+{
+    namespace impl
+    {
+        namespace cache
+        {
+            namespace query
+            {
+                /** Operation: get all entries. */
+                const int32_t OP_GET_ALL = 1;
+
+                /** Operation: get single entry. */
+                const int32_t OP_GET_SINGLE = 3;
+
+                QueryCursorImpl::QueryCursorImpl(SharedPointer<IgniteEnvironment> env, jobject javaRef) :
+                    env(env), javaRef(javaRef), iterCalled(false), getAllCalled(false), hasNext(false)
+                {
+                    // No-op.
+                }
+
+                QueryCursorImpl::~QueryCursorImpl()
+                {
+                    // 1. Close the cursor.
+                    env.Get()->Context()->QueryCursorClose(javaRef);
+
+                    // 2. Release Java reference.
+                    JniContext::Release(javaRef);
+                }
+
+                bool QueryCursorImpl::HasNext(IgniteError* err)
+                {
+                    // Check whether GetAll() was called earlier.
+                    if (getAllCalled) 
+                    {
+                        *err = IgniteError(IgniteError::IGNITE_ERR_GENERIC, 
+                            "Cannot use HasNext() method because GetAll() was called.");
+
+                        return false;
+                    }
+
+                    // Create iterator in Java if needed.
+                    if (!CreateIteratorIfNeeded(err))
+                        return false;
+                    
+                    return hasNext;
+                }
+
+                void QueryCursorImpl::GetNext(OutputOperation& op, IgniteError* err)
+                {
+                    // Check whether GetAll() was called earlier.
+                    if (getAllCalled) 
+                    {
+                        *err = IgniteError(IgniteError::IGNITE_ERR_GENERIC, 
+                            "Cannot use GetNext() method because GetAll() was called.");
+
+                        return;
+                    }
+
+                    // Create iterator in Java if needed.
+                    if (!CreateIteratorIfNeeded(err))
+                        return;
+
+                    if (hasNext)
+                    {
+                        JniErrorInfo jniErr;
+
+                        SharedPointer<InteropMemory> inMem = env.Get()->AllocateMemory();
+
+                        env.Get()->Context()->TargetOutStream(javaRef, OP_GET_SINGLE, inMem.Get()->PointerLong(), &jniErr);
+
+                        IgniteError::SetError(jniErr.code, jniErr.errCls, jniErr.errMsg, err);
+
+                        if (jniErr.code == IGNITE_JNI_ERR_SUCCESS)
+                        {
+                            InteropInputStream in(inMem.Get());
+
+                            portable::PortableReaderImpl reader(&in);
+
+                            op.ProcessOutput(reader);
+
+                            hasNext = IteratorHasNext(err);
+                        }
+                    }
+                    else
+                    {
+                        // Ensure we do not overwrite possible previous error.
+                        if (err->GetCode() == IgniteError::IGNITE_SUCCESS)
+                            *err = IgniteError(IgniteError::IGNITE_ERR_GENERIC, "No more elements available.");
+                    }
+                }
+
+                void QueryCursorImpl::GetAll(OutputOperation& op, IgniteError* err)
+                {
+                    // Check whether any of iterator methods were called.
+                    if (iterCalled)
+                    {
+                        *err = IgniteError(IgniteError::IGNITE_ERR_GENERIC,
+                            "Cannot use GetAll() method because an iteration method was called.");
+
+                        return;
+                    }
+
+                    // Check whether GetAll was called before.
+                    if (getAllCalled)
+                    {
+                        *err = IgniteError(IgniteError::IGNITE_ERR_GENERIC,
+                            "Cannot use GetNext() method because GetAll() was called.");
+
+                        return;
+                    }
+
+                    // Get data.
+                    JniErrorInfo jniErr;
+
+                    SharedPointer<InteropMemory> inMem = env.Get()->AllocateMemory();
+
+                    env.Get()->Context()->TargetOutStream(javaRef, OP_GET_ALL, inMem.Get()->PointerLong(), &jniErr);
+
+                    IgniteError::SetError(jniErr.code, jniErr.errCls, jniErr.errMsg, err);
+
+                    if (jniErr.code == IGNITE_JNI_ERR_SUCCESS)
+                    {
+                        getAllCalled = true;
+
+                        InteropInputStream in(inMem.Get());
+
+                        portable::PortableReaderImpl reader(&in);
+
+                        op.ProcessOutput(reader);
+                    }
+                }
+
+                bool QueryCursorImpl::CreateIteratorIfNeeded(IgniteError* err)
+                {
+                    if (!iterCalled)
+                    {
+                        JniErrorInfo jniErr;
+
+                        env.Get()->Context()->QueryCursorIterator(javaRef, &jniErr);
+
+                        IgniteError::SetError(jniErr.code, jniErr.errCls, jniErr.errMsg, err);
+
+                        if (jniErr.code == IGNITE_JNI_ERR_SUCCESS)
+                        {
+                            iterCalled = true;
+
+                            hasNext = IteratorHasNext(err);
+                        }
+                        else
+                            return false;
+                    }
+                    
+                    return true;
+                }
+
+                bool QueryCursorImpl::IteratorHasNext(IgniteError* err)
+                {
+                    JniErrorInfo jniErr;
+
+                    bool res = env.Get()->Context()->QueryCursorIteratorHasNext(javaRef, &jniErr);
+
+                    IgniteError::SetError(jniErr.code, jniErr.errCls, jniErr.errMsg, err);
+
+                    return jniErr.code == IGNITE_JNI_ERR_SUCCESS && res;
+                }
+            }
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/core/src/impl/handle_registry.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/core/src/impl/handle_registry.cpp b/modules/platform/cpp/core/src/impl/handle_registry.cpp
new file mode 100644
index 0000000..c447faa
--- /dev/null
+++ b/modules/platform/cpp/core/src/impl/handle_registry.cpp
@@ -0,0 +1,234 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "ignite/impl/handle_registry.h"
+
+using namespace ignite::common::concurrent;
+
+namespace ignite
+{
+    namespace impl
+    {
+        HandleRegistryEntry::~HandleRegistryEntry()
+        {
+            // No-op.
+        }
+
+        HandleRegistrySegment::HandleRegistrySegment() : 
+            map(new std::map<int64_t, SharedPointer<HandleRegistryEntry>>()), mux(new CriticalSection())
+        {
+            // No-op.
+        }
+
+        HandleRegistrySegment::~HandleRegistrySegment()
+        {
+            delete map;
+            delete mux;
+        }
+
+        SharedPointer<HandleRegistryEntry> HandleRegistrySegment::Get(int64_t hnd)
+        {
+            mux->Enter();
+
+            SharedPointer<HandleRegistryEntry> res = (*map)[hnd];
+
+            mux->Leave();
+
+            return res;
+        }
+
+        void HandleRegistrySegment::Put(int64_t hnd, const SharedPointer<HandleRegistryEntry>& entry)
+        {
+            mux->Enter();
+
+            (*map)[hnd] = entry;
+
+            mux->Leave();
+        }
+
+        void HandleRegistrySegment::Remove(int64_t hnd)
+        {
+            mux->Enter();
+
+            map->erase(hnd);
+
+            mux->Leave();
+        }
+
+        void HandleRegistrySegment::Clear()
+        {
+            mux->Enter();
+
+            map->erase(map->begin(), map->end());
+
+            mux->Leave();
+        }
+
+        HandleRegistry::HandleRegistry(int32_t fastCap, int32_t slowSegmentCnt)
+        {
+            this->fastCap = fastCap;
+
+            fastCtr = 0;
+
+            fast = new SharedPointer<HandleRegistryEntry>[fastCap];
+
+            for (int i = 0; i < fastCap; i++)
+                fast[i] = SharedPointer<HandleRegistryEntry>();
+
+            this->slowSegmentCnt = slowSegmentCnt;
+
+            slowCtr = fastCap;
+
+            slow = new HandleRegistrySegment*[slowSegmentCnt];
+
+            for (int i = 0; i < slowSegmentCnt; i++)
+                slow[i] = new HandleRegistrySegment();
+
+            closed = 0;
+
+            Memory::Fence();
+        }
+
+        HandleRegistry::~HandleRegistry()
+        {
+            Close();
+
+            delete[] fast;
+
+            for (int i = 0; i < slowSegmentCnt; i++)
+                delete slow[i];
+
+            delete[] slow;
+        }
+
+        int64_t HandleRegistry::Allocate(const SharedPointer<HandleRegistryEntry>& target)
+        {
+            return Allocate0(target, false, false);
+        }
+
+        int64_t HandleRegistry::AllocateCritical(const SharedPointer<HandleRegistryEntry>& target)
+        {
+            return Allocate0(target, true, false);
+        }
+
+        int64_t HandleRegistry::AllocateSafe(const SharedPointer<HandleRegistryEntry>& target)
+        {
+            return Allocate0(target, false, true);
+        }
+
+        int64_t HandleRegistry::AllocateCriticalSafe(const SharedPointer<HandleRegistryEntry>& target)
+        {
+            return Allocate0(target, true, true);
+        }
+
+        void HandleRegistry::Release(int64_t hnd)
+        {
+            if (hnd < fastCap)
+                fast[static_cast<int32_t>(hnd)] = SharedPointer<HandleRegistryEntry>();
+            else
+            {
+                HandleRegistrySegment* segment = *(slow + hnd % slowSegmentCnt);
+
+                segment->Remove(hnd);
+            }
+
+            Memory::Fence();
+        }
+
+        SharedPointer<HandleRegistryEntry> HandleRegistry::Get(int64_t hnd)
+        {
+            Memory::Fence();
+
+            if (hnd < fastCap)
+                return fast[static_cast<int32_t>(hnd)];
+            else
+            {
+                HandleRegistrySegment* segment = *(slow + hnd % slowSegmentCnt);
+
+                return segment->Get(hnd);
+            }
+        }
+
+        void HandleRegistry::Close()
+        {
+            if (Atomics::CompareAndSet32(&closed, 0, 1))
+            {
+                // Cleanup fast-path handles.
+                for (int i = 0; i < fastCap; i++)
+                    fast[i] = SharedPointer<HandleRegistryEntry>();
+
+                // Cleanup slow-path handles.
+                for (int i = 0; i < slowSegmentCnt; i++)
+                    (*(slow + i))->Clear();
+            }
+        }
+
+        int64_t HandleRegistry::Allocate0(const SharedPointer<HandleRegistryEntry>& target, bool critical, bool safe)
+        {
+            // Check closed state.
+            Memory::Fence();
+
+            if (closed == 1)
+                return -1;
+
+            // Try allocating entry on critical path.
+            if (critical)
+            {
+                if (fastCtr < fastCap)
+                {
+                    int32_t fastIdx = Atomics::IncrementAndGet32(&fastCtr) - 1;
+
+                    if (fastIdx < fastCap)
+                    {
+                        fast[fastIdx] = target;
+
+                        // Double-check for closed state if safe mode is on.
+                        Memory::Fence();
+
+                        if (safe && closed == 1)
+                        {
+                            fast[fastIdx] = SharedPointer<HandleRegistryEntry>();
+
+                            return -1;
+                        }
+                        else
+                            return fastIdx;
+                    }
+                }
+            }
+
+            // Either allocating on slow-path, or fast-path can no longer accomodate more entries.
+            int64_t slowIdx = Atomics::IncrementAndGet64(&slowCtr) - 1;
+
+            HandleRegistrySegment* segment = *(slow + slowIdx % slowSegmentCnt);
+
+            segment->Put(slowIdx, target);
+
+            // Double-check for closed state if safe mode is on.
+            Memory::Fence();
+
+            if (safe && closed == 1)
+            {
+                segment->Remove(slowIdx);
+
+                return -1;
+            }
+
+            return slowIdx;
+        }
+    }
+}
\ No newline at end of file


[03/28] ignite git commit: IGNITE-1513: Moved CPP.

Posted by vo...@apache.org.
http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/core/project/vs/core.vcxproj
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/project/vs/core.vcxproj b/modules/platform/src/main/cpp/core/project/vs/core.vcxproj
deleted file mode 100644
index 58fa283..0000000
--- a/modules/platform/src/main/cpp/core/project/vs/core.vcxproj
+++ /dev/null
@@ -1,272 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="Debug|Win32">
-      <Configuration>Debug</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Debug|x64">
-      <Configuration>Debug</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|Win32">
-      <Configuration>Release</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|x64">
-      <Configuration>Release</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectGuid>{E2DEA693-F2EA-43C2-A813-053378F6E4DB}</ProjectGuid>
-    <RootNamespace>core</RootNamespace>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
-    <ConfigurationType>DynamicLibrary</ConfigurationType>
-    <UseDebugLibraries>true</UseDebugLibraries>
-    <PlatformToolset>v100</PlatformToolset>
-    <CharacterSet>Unicode</CharacterSet>
-    <WholeProgramOptimization>true</WholeProgramOptimization>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
-    <ConfigurationType>DynamicLibrary</ConfigurationType>
-    <UseDebugLibraries>true</UseDebugLibraries>
-    <PlatformToolset>v100</PlatformToolset>
-    <CharacterSet>Unicode</CharacterSet>
-    <WholeProgramOptimization>true</WholeProgramOptimization>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
-    <ConfigurationType>DynamicLibrary</ConfigurationType>
-    <UseDebugLibraries>false</UseDebugLibraries>
-    <PlatformToolset>v100</PlatformToolset>
-    <WholeProgramOptimization>true</WholeProgramOptimization>
-    <CharacterSet>Unicode</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-    <ConfigurationType>DynamicLibrary</ConfigurationType>
-    <UseDebugLibraries>false</UseDebugLibraries>
-    <PlatformToolset>v100</PlatformToolset>
-    <WholeProgramOptimization>true</WholeProgramOptimization>
-    <CharacterSet>Unicode</CharacterSet>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
-    <TargetName>ignite.core</TargetName>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <TargetName>ignite.core</TargetName>
-    <OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
-    <IntDir>$(Platform)\$(Configuration)\</IntDir>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
-    <TargetName>ignite.core</TargetName>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <TargetName>ignite.core</TargetName>
-    <OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
-    <IntDir>$(Platform)\$(Configuration)\</IntDir>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
-    <ClCompile>
-      <WarningLevel>Level3</WarningLevel>
-      <Optimization>Disabled</Optimization>
-      <SDLCheck>false</SDLCheck>
-      <AdditionalIncludeDirectories>$(JAVA_HOME)\include;$(JAVA_HOME)\include\win32;$(ProjectDir)\..\..\..\common\include;$(ProjectDir)\..\..\..\common\os\win\include;$(ProjectDir)\..\..\include;$(ProjectDir)\..\..\os\win\include</AdditionalIncludeDirectories>
-      <InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
-      <IntrinsicFunctions>false</IntrinsicFunctions>
-      <FavorSizeOrSpeed>Neither</FavorSizeOrSpeed>
-      <OmitFramePointers>false</OmitFramePointers>
-      <StringPooling>true</StringPooling>
-      <MinimalRebuild>false</MinimalRebuild>
-      <BasicRuntimeChecks>Default</BasicRuntimeChecks>
-      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
-      <BufferSecurityCheck>false</BufferSecurityCheck>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;IGNITE_IMPL;IGNITE_FRIEND;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <WholeProgramOptimization>false</WholeProgramOptimization>
-    </ClCompile>
-    <Link>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <AdditionalLibraryDirectories>$(JAVA_HOME)\lib\jvm.lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
-      <AdditionalDependencies>$(JAVA_HOME)\lib\jvm.lib;%(AdditionalDependencies)</AdditionalDependencies>
-      <OptimizeReferences>false</OptimizeReferences>
-      <EnableCOMDATFolding>false</EnableCOMDATFolding>
-      <LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <ClCompile>
-      <WarningLevel>Level3</WarningLevel>
-      <Optimization>Disabled</Optimization>
-      <SDLCheck>false</SDLCheck>
-      <AdditionalIncludeDirectories>$(JAVA_HOME)\include;$(JAVA_HOME)\include\win32;$(ProjectDir)\..\..\..\common\include;$(ProjectDir)\..\..\..\common\os\win\include;$(ProjectDir)\..\..\include;$(ProjectDir)\..\..\os\win\include</AdditionalIncludeDirectories>
-      <InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
-      <IntrinsicFunctions>false</IntrinsicFunctions>
-      <FavorSizeOrSpeed>Neither</FavorSizeOrSpeed>
-      <OmitFramePointers>false</OmitFramePointers>
-      <StringPooling>true</StringPooling>
-      <MinimalRebuild>false</MinimalRebuild>
-      <BasicRuntimeChecks>Default</BasicRuntimeChecks>
-      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
-      <BufferSecurityCheck>false</BufferSecurityCheck>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;IGNITE_IMPL;IGNITE_FRIEND;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <WholeProgramOptimization>false</WholeProgramOptimization>
-    </ClCompile>
-    <Link>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <AdditionalLibraryDirectories>$(JAVA_HOME)\lib\jvm.lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
-      <AdditionalDependencies>$(JAVA_HOME)\lib\jvm.lib;%(AdditionalDependencies)</AdditionalDependencies>
-      <OptimizeReferences>false</OptimizeReferences>
-      <EnableCOMDATFolding>false</EnableCOMDATFolding>
-      <LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
-    <ClCompile>
-      <WarningLevel>Level3</WarningLevel>
-      <Optimization>Full</Optimization>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <IntrinsicFunctions>true</IntrinsicFunctions>
-      <SDLCheck>false</SDLCheck>
-      <AdditionalIncludeDirectories>$(JAVA_HOME)\include;$(JAVA_HOME)\include\win32;$(ProjectDir)\..\..\..\common\include;$(ProjectDir)\..\..\..\common\os\win\include;$(ProjectDir)\..\..\include;$(ProjectDir)\..\..\os\win\include</AdditionalIncludeDirectories>
-      <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
-      <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
-      <OmitFramePointers>true</OmitFramePointers>
-      <StringPooling>true</StringPooling>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <BufferSecurityCheck>false</BufferSecurityCheck>
-      <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;IGNITE_IMPL;IGNITE_FRIEND;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-    </ClCompile>
-    <Link>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <EnableCOMDATFolding>true</EnableCOMDATFolding>
-      <OptimizeReferences>true</OptimizeReferences>
-      <AdditionalLibraryDirectories>$(JAVA_HOME)\lib\jvm.lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
-      <AdditionalDependencies>$(JAVA_HOME)\lib\jvm.lib;%(AdditionalDependencies)</AdditionalDependencies>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <ClCompile>
-      <WarningLevel>Level3</WarningLevel>
-      <Optimization>Full</Optimization>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <IntrinsicFunctions>true</IntrinsicFunctions>
-      <SDLCheck>false</SDLCheck>
-      <AdditionalIncludeDirectories>$(JAVA_HOME)\include;$(JAVA_HOME)\include\win32;$(ProjectDir)\..\..\..\common\include;$(ProjectDir)\..\..\..\common\os\win\include;$(ProjectDir)\..\..\include;$(ProjectDir)\..\..\os\win\include</AdditionalIncludeDirectories>
-      <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
-      <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
-      <OmitFramePointers>true</OmitFramePointers>
-      <StringPooling>true</StringPooling>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <BufferSecurityCheck>false</BufferSecurityCheck>
-      <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;IGNITE_IMPL;IGNITE_FRIEND;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-    </ClCompile>
-    <Link>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <EnableCOMDATFolding>true</EnableCOMDATFolding>
-      <OptimizeReferences>true</OptimizeReferences>
-      <AdditionalLibraryDirectories>$(JAVA_HOME)\lib\jvm.lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
-      <AdditionalDependencies>$(JAVA_HOME)\lib\jvm.lib;%(AdditionalDependencies)</AdditionalDependencies>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <ClInclude Include="..\..\include\ignite\cache\cache.h" />
-    <ClInclude Include="..\..\include\ignite\cache\cache_entry.h" />
-    <ClInclude Include="..\..\include\ignite\cache\cache_peek_mode.h" />
-    <ClInclude Include="..\..\include\ignite\cache\query\query.h" />
-    <ClInclude Include="..\..\include\ignite\cache\query\query_argument.h" />
-    <ClInclude Include="..\..\include\ignite\cache\query\query_cursor.h" />
-    <ClInclude Include="..\..\include\ignite\cache\query\query_scan.h" />
-    <ClInclude Include="..\..\include\ignite\cache\query\query_sql.h" />
-    <ClInclude Include="..\..\include\ignite\cache\query\query_text.h" />
-    <ClInclude Include="..\..\include\ignite\ignite.h" />
-    <ClInclude Include="..\..\include\ignite\ignite_configuration.h" />
-    <ClInclude Include="..\..\include\ignite\ignite_error.h" />
-    <ClInclude Include="..\..\include\ignite\ignition.h" />
-    <ClInclude Include="..\..\include\ignite\guid.h" />
-    <ClInclude Include="..\..\include\ignite\impl\cache\cache_impl.h" />
-    <ClInclude Include="..\..\include\ignite\impl\cache\query\query_impl.h" />
-    <ClInclude Include="..\..\include\ignite\impl\ignite_environment.h" />
-    <ClInclude Include="..\..\include\ignite\impl\ignite_impl.h" />
-    <ClInclude Include="..\..\include\ignite\impl\handle_registry.h" />
-    <ClInclude Include="..\..\include\ignite\impl\interop\interop.h" />
-    <ClInclude Include="..\..\include\ignite\impl\interop\interop_input_stream.h" />
-    <ClInclude Include="..\..\include\ignite\impl\interop\interop_memory.h" />
-    <ClInclude Include="..\..\include\ignite\impl\interop\interop_output_stream.h" />
-    <ClInclude Include="..\..\include\ignite\impl\operations.h" />
-    <ClInclude Include="..\..\include\ignite\impl\portable\portable_common.h" />
-    <ClInclude Include="..\..\include\ignite\impl\portable\portable_id_resolver.h" />
-    <ClInclude Include="..\..\include\ignite\impl\portable\portable_metadata_handler.h" />
-    <ClInclude Include="..\..\include\ignite\impl\portable\portable_metadata_manager.h" />
-    <ClInclude Include="..\..\include\ignite\impl\portable\portable_metadata_snapshot.h" />
-    <ClInclude Include="..\..\include\ignite\impl\portable\portable_metadata_updater.h" />
-    <ClInclude Include="..\..\include\ignite\impl\portable\portable_metadata_updater_impl.h" />
-    <ClInclude Include="..\..\include\ignite\impl\portable\portable_reader_impl.h" />
-    <ClInclude Include="..\..\include\ignite\impl\portable\portable_utils.h" />
-    <ClInclude Include="..\..\include\ignite\impl\portable\portable_writer_impl.h" />
-    <ClInclude Include="..\..\include\ignite\portable\portable.h" />
-    <ClInclude Include="..\..\include\ignite\portable\portable_consts.h" />
-    <ClInclude Include="..\..\include\ignite\portable\portable_containers.h" />
-    <ClInclude Include="..\..\include\ignite\portable\portable_type.h" />
-    <ClInclude Include="..\..\include\ignite\portable\portable_raw_reader.h" />
-    <ClInclude Include="..\..\include\ignite\portable\portable_raw_writer.h" />
-    <ClInclude Include="..\..\include\ignite\portable\portable_reader.h" />
-    <ClInclude Include="..\..\include\ignite\portable\portable_writer.h" />
-    <ClInclude Include="..\..\os\win\include\ignite\impl\utils.h" />
-  </ItemGroup>
-  <ItemGroup>
-    <ClCompile Include="..\..\os\win\src\impl\utils.cpp" />
-    <ClCompile Include="..\..\src\ignite.cpp" />
-    <ClCompile Include="..\..\src\ignite_error.cpp" />
-    <ClCompile Include="..\..\src\ignition.cpp" />
-    <ClCompile Include="..\..\src\guid.cpp" />
-    <ClCompile Include="..\..\src\impl\cache\cache_impl.cpp" />
-    <ClCompile Include="..\..\src\impl\cache\query\query_impl.cpp" />
-    <ClCompile Include="..\..\src\impl\ignite_environment.cpp" />
-    <ClCompile Include="..\..\src\impl\ignite_impl.cpp" />
-    <ClCompile Include="..\..\src\impl\handle_registry.cpp" />
-    <ClCompile Include="..\..\src\impl\interop\interop_input_stream.cpp" />
-    <ClCompile Include="..\..\src\impl\interop\interop_memory.cpp" />
-    <ClCompile Include="..\..\src\impl\interop\interop_output_stream.cpp" />
-    <ClCompile Include="..\..\src\impl\portable\portable_metadata_handler.cpp" />
-    <ClCompile Include="..\..\src\impl\portable\portable_metadata_manager.cpp" />
-    <ClCompile Include="..\..\src\impl\portable\portable_metadata_snapshot.cpp" />
-    <ClCompile Include="..\..\src\impl\portable\portable_metadata_updater.cpp" />
-    <ClCompile Include="..\..\src\impl\portable\portable_metadata_updater_impl.cpp" />
-    <ClCompile Include="..\..\src\impl\portable\portable_reader_impl.cpp" />
-    <ClCompile Include="..\..\src\impl\portable\portable_utils.cpp" />
-    <ClCompile Include="..\..\src\impl\portable\portable_writer_impl.cpp" />
-    <ClCompile Include="..\..\src\portable\portable_containers.cpp" />
-    <ClCompile Include="..\..\src\portable\portable_type.cpp" />
-    <ClCompile Include="..\..\src\portable\portable_raw_reader.cpp" />
-    <ClCompile Include="..\..\src\portable\portable_raw_writer.cpp" />
-    <ClCompile Include="..\..\src\portable\portable_reader.cpp" />
-    <ClCompile Include="..\..\src\portable\portable_writer.cpp" />
-  </ItemGroup>
-  <ItemGroup>
-    <ProjectReference Include="..\..\..\common\project\vs\common.vcxproj">
-      <Project>{4f7e4917-4612-4b96-9838-025711ade391}</Project>
-    </ProjectReference>
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/core/project/vs/core.vcxproj.filters
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/project/vs/core.vcxproj.filters b/modules/platform/src/main/cpp/core/project/vs/core.vcxproj.filters
deleted file mode 100644
index d18599d..0000000
--- a/modules/platform/src/main/cpp/core/project/vs/core.vcxproj.filters
+++ /dev/null
@@ -1,246 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup>
-    <ClCompile Include="..\..\src\impl\cache\cache_impl.cpp">
-      <Filter>Code\impl\cache</Filter>
-    </ClCompile>
-    <ClCompile Include="..\..\src\impl\interop\interop_input_stream.cpp">
-      <Filter>Code\impl\interop</Filter>
-    </ClCompile>
-    <ClCompile Include="..\..\src\impl\interop\interop_memory.cpp">
-      <Filter>Code\impl\interop</Filter>
-    </ClCompile>
-    <ClCompile Include="..\..\src\impl\interop\interop_output_stream.cpp">
-      <Filter>Code\impl\interop</Filter>
-    </ClCompile>
-    <ClCompile Include="..\..\src\impl\ignite_environment.cpp">
-      <Filter>Code\impl</Filter>
-    </ClCompile>
-    <ClCompile Include="..\..\src\impl\ignite_impl.cpp">
-      <Filter>Code\impl</Filter>
-    </ClCompile>
-    <ClCompile Include="..\..\src\portable\portable_containers.cpp">
-      <Filter>Code\portable</Filter>
-    </ClCompile>
-    <ClCompile Include="..\..\src\portable\portable_raw_reader.cpp">
-      <Filter>Code\portable</Filter>
-    </ClCompile>
-    <ClCompile Include="..\..\src\portable\portable_raw_writer.cpp">
-      <Filter>Code\portable</Filter>
-    </ClCompile>
-    <ClCompile Include="..\..\src\portable\portable_reader.cpp">
-      <Filter>Code\portable</Filter>
-    </ClCompile>
-    <ClCompile Include="..\..\src\portable\portable_writer.cpp">
-      <Filter>Code\portable</Filter>
-    </ClCompile>
-    <ClCompile Include="..\..\src\impl\portable\portable_reader_impl.cpp">
-      <Filter>Code\impl\portable</Filter>
-    </ClCompile>
-    <ClCompile Include="..\..\src\impl\portable\portable_utils.cpp">
-      <Filter>Code\impl\portable</Filter>
-    </ClCompile>
-    <ClCompile Include="..\..\src\impl\portable\portable_writer_impl.cpp">
-      <Filter>Code\impl\portable</Filter>
-    </ClCompile>
-    <ClCompile Include="..\..\os\win\src\impl\utils.cpp">
-      <Filter>Code\impl</Filter>
-    </ClCompile>
-    <ClCompile Include="..\..\src\ignite.cpp">
-      <Filter>Code</Filter>
-    </ClCompile>
-    <ClCompile Include="..\..\src\ignite_error.cpp">
-      <Filter>Code</Filter>
-    </ClCompile>
-    <ClCompile Include="..\..\src\ignition.cpp">
-      <Filter>Code</Filter>
-    </ClCompile>
-    <ClCompile Include="..\..\src\guid.cpp">
-      <Filter>Code</Filter>
-    </ClCompile>
-    <ClCompile Include="..\..\src\impl\handle_registry.cpp">
-      <Filter>Code\impl</Filter>
-    </ClCompile>
-    <ClCompile Include="..\..\src\impl\cache\query\query_impl.cpp">
-      <Filter>Code\impl\cache\query</Filter>
-    </ClCompile>
-    <ClCompile Include="..\..\src\impl\portable\portable_metadata_snapshot.cpp">
-      <Filter>Code\impl\portable</Filter>
-    </ClCompile>
-    <ClCompile Include="..\..\src\impl\portable\portable_metadata_handler.cpp">
-      <Filter>Code\impl\portable</Filter>
-    </ClCompile>
-    <ClCompile Include="..\..\src\portable\portable_type.cpp">
-      <Filter>Code\portable</Filter>
-    </ClCompile>
-    <ClCompile Include="..\..\src\impl\portable\portable_metadata_manager.cpp">
-      <Filter>Code\impl\portable</Filter>
-    </ClCompile>
-    <ClCompile Include="..\..\src\impl\portable\portable_metadata_updater.cpp">
-      <Filter>Code\impl\portable</Filter>
-    </ClCompile>
-    <ClCompile Include="..\..\src\impl\portable\portable_metadata_updater_impl.cpp">
-      <Filter>Code\impl\portable</Filter>
-    </ClCompile>
-  </ItemGroup>
-  <ItemGroup>
-    <ClInclude Include="..\..\include\ignite\impl\cache\cache_impl.h">
-      <Filter>Code\impl\cache</Filter>
-    </ClInclude>
-    <ClInclude Include="..\..\include\ignite\cache\cache.h">
-      <Filter>Code\cache</Filter>
-    </ClInclude>
-    <ClInclude Include="..\..\include\ignite\cache\cache_peek_mode.h">
-      <Filter>Code\cache</Filter>
-    </ClInclude>
-    <ClInclude Include="..\..\include\ignite\impl\interop\interop.h">
-      <Filter>Code\impl\interop</Filter>
-    </ClInclude>
-    <ClInclude Include="..\..\include\ignite\impl\interop\interop_input_stream.h">
-      <Filter>Code\impl\interop</Filter>
-    </ClInclude>
-    <ClInclude Include="..\..\include\ignite\impl\interop\interop_memory.h">
-      <Filter>Code\impl\interop</Filter>
-    </ClInclude>
-    <ClInclude Include="..\..\include\ignite\impl\interop\interop_output_stream.h">
-      <Filter>Code\impl\interop</Filter>
-    </ClInclude>
-    <ClInclude Include="..\..\include\ignite\impl\ignite_environment.h">
-      <Filter>Code\impl</Filter>
-    </ClInclude>
-    <ClInclude Include="..\..\include\ignite\impl\ignite_impl.h">
-      <Filter>Code\impl</Filter>
-    </ClInclude>
-    <ClInclude Include="..\..\include\ignite\impl\operations.h">
-      <Filter>Code\impl</Filter>
-    </ClInclude>
-    <ClInclude Include="..\..\include\ignite\impl\portable\portable_common.h">
-      <Filter>Code\impl\portable</Filter>
-    </ClInclude>
-    <ClInclude Include="..\..\include\ignite\portable\portable_consts.h">
-      <Filter>Code\portable</Filter>
-    </ClInclude>
-    <ClInclude Include="..\..\include\ignite\portable\portable.h">
-      <Filter>Code\portable</Filter>
-    </ClInclude>
-    <ClInclude Include="..\..\include\ignite\portable\portable_containers.h">
-      <Filter>Code\portable</Filter>
-    </ClInclude>
-    <ClInclude Include="..\..\include\ignite\impl\portable\portable_id_resolver.h">
-      <Filter>Code\impl\portable</Filter>
-    </ClInclude>
-    <ClInclude Include="..\..\include\ignite\portable\portable_raw_reader.h">
-      <Filter>Code\portable</Filter>
-    </ClInclude>
-    <ClInclude Include="..\..\include\ignite\portable\portable_raw_writer.h">
-      <Filter>Code\portable</Filter>
-    </ClInclude>
-    <ClInclude Include="..\..\include\ignite\portable\portable_reader.h">
-      <Filter>Code\portable</Filter>
-    </ClInclude>
-    <ClInclude Include="..\..\include\ignite\portable\portable_writer.h">
-      <Filter>Code\portable</Filter>
-    </ClInclude>
-    <ClInclude Include="..\..\include\ignite\impl\portable\portable_reader_impl.h">
-      <Filter>Code\impl\portable</Filter>
-    </ClInclude>
-    <ClInclude Include="..\..\include\ignite\impl\portable\portable_utils.h">
-      <Filter>Code\impl\portable</Filter>
-    </ClInclude>
-    <ClInclude Include="..\..\include\ignite\impl\portable\portable_writer_impl.h">
-      <Filter>Code\impl\portable</Filter>
-    </ClInclude>
-    <ClInclude Include="..\..\os\win\include\ignite\impl\utils.h">
-      <Filter>Code\impl</Filter>
-    </ClInclude>
-    <ClInclude Include="..\..\include\ignite\ignite.h">
-      <Filter>Code</Filter>
-    </ClInclude>
-    <ClInclude Include="..\..\include\ignite\ignite_configuration.h">
-      <Filter>Code</Filter>
-    </ClInclude>
-    <ClInclude Include="..\..\include\ignite\ignite_error.h">
-      <Filter>Code</Filter>
-    </ClInclude>
-    <ClInclude Include="..\..\include\ignite\ignition.h">
-      <Filter>Code</Filter>
-    </ClInclude>
-    <ClInclude Include="..\..\include\ignite\guid.h">
-      <Filter>Code</Filter>
-    </ClInclude>
-    <ClInclude Include="..\..\include\ignite\impl\handle_registry.h">
-      <Filter>Code\impl</Filter>
-    </ClInclude>
-    <ClInclude Include="..\..\include\ignite\cache\cache_entry.h">
-      <Filter>Code\cache</Filter>
-    </ClInclude>
-    <ClInclude Include="..\..\include\ignite\impl\cache\query\query_impl.h">
-      <Filter>Code\impl\cache\query</Filter>
-    </ClInclude>
-    <ClInclude Include="..\..\include\ignite\impl\portable\portable_metadata_snapshot.h">
-      <Filter>Code\impl\portable</Filter>
-    </ClInclude>
-    <ClInclude Include="..\..\include\ignite\impl\portable\portable_metadata_handler.h">
-      <Filter>Code\impl\portable</Filter>
-    </ClInclude>
-    <ClInclude Include="..\..\include\ignite\impl\portable\portable_metadata_manager.h">
-      <Filter>Code\impl\portable</Filter>
-    </ClInclude>
-    <ClInclude Include="..\..\include\ignite\portable\portable_type.h">
-      <Filter>Code\portable</Filter>
-    </ClInclude>
-    <ClInclude Include="..\..\include\ignite\impl\portable\portable_metadata_updater.h">
-      <Filter>Code\impl\portable</Filter>
-    </ClInclude>
-    <ClInclude Include="..\..\include\ignite\impl\portable\portable_metadata_updater_impl.h">
-      <Filter>Code\impl\portable</Filter>
-    </ClInclude>
-    <ClInclude Include="..\..\include\ignite\cache\query\query_argument.h">
-      <Filter>Code\cache\query</Filter>
-    </ClInclude>
-    <ClInclude Include="..\..\include\ignite\cache\query\query_cursor.h">
-      <Filter>Code\cache\query</Filter>
-    </ClInclude>
-    <ClInclude Include="..\..\include\ignite\cache\query\query_sql.h">
-      <Filter>Code\cache\query</Filter>
-    </ClInclude>
-    <ClInclude Include="..\..\include\ignite\cache\query\query.h">
-      <Filter>Code\cache\query</Filter>
-    </ClInclude>
-    <ClInclude Include="..\..\include\ignite\cache\query\query_text.h">
-      <Filter>Code\cache\query</Filter>
-    </ClInclude>
-    <ClInclude Include="..\..\include\ignite\cache\query\query_scan.h">
-      <Filter>Code\cache\query</Filter>
-    </ClInclude>
-  </ItemGroup>
-  <ItemGroup>
-    <Filter Include="Code">
-      <UniqueIdentifier>{91873c79-a64f-4786-ab25-d03ef2db9dc8}</UniqueIdentifier>
-    </Filter>
-    <Filter Include="Code\impl">
-      <UniqueIdentifier>{9bede404-e1b1-44d6-b54d-e9b2441c5f13}</UniqueIdentifier>
-    </Filter>
-    <Filter Include="Code\impl\cache">
-      <UniqueIdentifier>{b013b0f6-c4b8-4b88-89bc-8b394971788e}</UniqueIdentifier>
-    </Filter>
-    <Filter Include="Code\impl\portable">
-      <UniqueIdentifier>{883773bd-085d-4eb5-81ee-f11188134faf}</UniqueIdentifier>
-    </Filter>
-    <Filter Include="Code\impl\interop">
-      <UniqueIdentifier>{d4cc8aeb-6e7b-47e6-9b83-cba925844d96}</UniqueIdentifier>
-    </Filter>
-    <Filter Include="Code\cache">
-      <UniqueIdentifier>{8b7e32c0-e222-4f3a-af31-19df380c369f}</UniqueIdentifier>
-    </Filter>
-    <Filter Include="Code\portable">
-      <UniqueIdentifier>{24b7134c-9335-44e1-9604-4093d0e3bbf5}</UniqueIdentifier>
-    </Filter>
-    <Filter Include="Code\cache\query">
-      <UniqueIdentifier>{4658a0ff-0d2d-45a6-b8de-93eeec0cc081}</UniqueIdentifier>
-    </Filter>
-    <Filter Include="Code\impl\cache\query">
-      <UniqueIdentifier>{b6e57294-120a-46f2-b0ad-c3595e2cf789}</UniqueIdentifier>
-    </Filter>
-  </ItemGroup>
-</Project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/core/src/guid.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/src/guid.cpp b/modules/platform/src/main/cpp/core/src/guid.cpp
deleted file mode 100644
index 77997e4..0000000
--- a/modules/platform/src/main/cpp/core/src/guid.cpp
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "ignite/guid.h"
-
-namespace ignite
-{
-    Guid::Guid() : most(0), least(0)
-    {
-        // No-op.
-    }
-
-    Guid::Guid(int64_t most, int64_t least) : most(most), least(least)
-    {
-        // No-op.
-    }
-
-    int64_t Guid::GetMostSignificantBits() const
-    {
-        return most;
-    }
-
-    int64_t Guid::GetLeastSignificantBits() const
-    {
-        return least;
-    }
-
-    int32_t Guid::GetVersion() const
-    {
-        return static_cast<int32_t>((most >> 12) & 0x0f);
-    }
-
-    int32_t Guid::GetVariant() const
-    {
-        uint64_t least0 = static_cast<uint64_t>(least);
-
-        return static_cast<int32_t>((least0 >> (64 - (least0 >> 62))) & (least >> 63));
-    }
-
-    int32_t Guid::GetHashCode() const
-    {
-        int64_t hilo = most ^ least;
-
-        return static_cast<int32_t>(hilo >> 32) ^ static_cast<int32_t>(hilo);
-    }
-
-    bool operator==(Guid& val1, Guid& val2)
-    {
-        return val1.least == val2.least && val1.most == val2.most;
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/core/src/ignite.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/src/ignite.cpp b/modules/platform/src/main/cpp/core/src/ignite.cpp
deleted file mode 100644
index 665383b..0000000
--- a/modules/platform/src/main/cpp/core/src/ignite.cpp
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <ignite/common/java.h>
-
-#include "ignite/impl/ignite_impl.h"
-#include "ignite/ignite.h"
-
-using namespace ignite::common::concurrent;
-using namespace ignite::impl;
-
-namespace ignite
-{    
-    Ignite::Ignite() : impl(SharedPointer<IgniteImpl>())
-    {
-        // No-op.
-    }
-
-    Ignite::Ignite(IgniteImpl* impl) : impl(SharedPointer<IgniteImpl>(impl))
-    {
-        // No-op.
-    }
-
-    char* Ignite::GetName()
-    {
-        return impl.Get()->GetName();
-    }
-}
-

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/core/src/ignite_error.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/src/ignite_error.cpp b/modules/platform/src/main/cpp/core/src/ignite_error.cpp
deleted file mode 100644
index 65cd291..0000000
--- a/modules/platform/src/main/cpp/core/src/ignite_error.cpp
+++ /dev/null
@@ -1,222 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#include <ignite/common/java.h>
-
-#include "ignite/impl/utils.h"
-#include "ignite/ignite_error.h"
-
-using namespace ignite::common::java;
-using namespace ignite::impl::utils;
-
-namespace ignite
-{
-    void IgniteError::ThrowIfNeeded(IgniteError& err)
-    {
-        if (err.code != IGNITE_SUCCESS)
-            throw err;
-    }
-
-    IgniteError::IgniteError() : code(IGNITE_SUCCESS), msg(NULL)
-    {
-        // No-op.
-    }
-
-    IgniteError::IgniteError(int32_t code) : code(code), msg(NULL)
-    {
-        // No-op.
-    }
-
-    IgniteError::IgniteError(int32_t code, const char* msg)
-    {
-        this->code = code;
-        this->msg = CopyChars(msg);
-    }
-
-    IgniteError::IgniteError(const IgniteError& other)
-    {
-        this->code = other.code;
-        this->msg = CopyChars(other.msg);
-    }
-
-    IgniteError& IgniteError::operator=(const IgniteError& other)
-    {
-        if (this != &other)
-        {
-            IgniteError tmp(other);
-
-            int tmpCode = code;
-            char* tmpMsg = msg;
-            
-            code = tmp.code;
-            msg = tmp.msg;
-
-            tmp.code = tmpCode;
-            tmp.msg = tmpMsg;
-        }
-
-        return *this;
-    }
-
-    IgniteError::~IgniteError()
-    {
-        ReleaseChars(msg);
-    }
-
-    int32_t IgniteError::GetCode()
-    {
-        return code;
-    }
-
-    const char* IgniteError::GetText()
-    {
-        if (code == IGNITE_SUCCESS)
-            return "Operation completed successfully.";
-        else if (msg)
-            return msg;
-        else
-            return  "No additional information available.";
-    }
-    
-    void IgniteError::SetError(const int jniCode, const char* jniCls, const char* jniMsg, IgniteError* err)
-    {
-        if (jniCode == IGNITE_JNI_ERR_SUCCESS)
-            *err = IgniteError();
-        else if (jniCode == IGNITE_JNI_ERR_GENERIC)
-        {
-            // The most common case when we have Java exception "in hands" and must map it to respective code.
-            if (jniCls)
-            {
-                std::string jniCls0 = jniCls;
-
-                if (jniCls0.compare("java.lang.NoClassDefFoundError") == 0)
-                {
-                    std::stringstream stream; 
-
-                    stream << "Java class is not found (did you set IGNITE_HOME environment variable?)";
-
-                    if (jniMsg)
-                        stream << ": " << jniMsg;
-                    
-                    *err = IgniteError(IGNITE_ERR_JVM_NO_CLASS_DEF_FOUND, stream.str().c_str());
-                }
-                else if (jniCls0.compare("java.lang.NoSuchMethodError") == 0)
-                {
-                    std::stringstream stream;
-
-                    stream << "Java method is not found (did you set IGNITE_HOME environment variable?)";
-
-                    if (jniMsg)
-                        stream << ": " << jniMsg;
-
-                    *err = IgniteError(IGNITE_ERR_JVM_NO_SUCH_METHOD, stream.str().c_str());
-                }
-                else if (jniCls0.compare("java.lang.IllegalArgumentException") == 0)
-                    *err = IgniteError(IGNITE_ERR_ILLEGAL_ARGUMENT, jniMsg);
-                else if (jniCls0.compare("java.lang.IllegalStateException") == 0)
-                    *err = IgniteError(IGNITE_ERR_ILLEGAL_STATE, jniMsg);
-                else if (jniCls0.compare("java.lang.UnsupportedOperationException") == 0)
-                    *err = IgniteError(IGNITE_ERR_UNSUPPORTED_OPERATION, jniMsg);
-                else if (jniCls0.compare("java.lang.InterruptedException") == 0)
-                    *err = IgniteError(IGNITE_ERR_INTERRUPTED, jniMsg);
-                else if (jniCls0.compare("org.apache.ignite.cluster.ClusterGroupEmptyException") == 0)
-                    *err = IgniteError(IGNITE_ERR_CLUSTER_GROUP_EMPTY, jniMsg);
-                else if (jniCls0.compare("org.apache.ignite.cluster.ClusterTopologyException") == 0)
-                    *err = IgniteError(IGNITE_ERR_CLUSTER_TOPOLOGY, jniMsg);
-                else if (jniCls0.compare("org.apache.ignite.compute.ComputeExecutionRejectedException") == 0)
-                    *err = IgniteError(IGNITE_ERR_COMPUTE_EXECUTION_REJECTED, jniMsg);
-                else if (jniCls0.compare("org.apache.ignite.compute.ComputeJobFailoverException") == 0)
-                    *err = IgniteError(IGNITE_ERR_COMPUTE_JOB_FAILOVER, jniMsg);
-                else if (jniCls0.compare("org.apache.ignite.compute.ComputeTaskCancelledException") == 0)
-                    *err = IgniteError(IGNITE_ERR_COMPUTE_TASK_CANCELLED, jniMsg);
-                else if (jniCls0.compare("org.apache.ignite.compute.ComputeTaskTimeoutException") == 0)
-                    *err = IgniteError(IGNITE_ERR_COMPUTE_TASK_TIMEOUT, jniMsg);
-                else if (jniCls0.compare("org.apache.ignite.compute.ComputeUserUndeclaredException") == 0)
-                    *err = IgniteError(IGNITE_ERR_COMPUTE_USER_UNDECLARED_EXCEPTION, jniMsg);
-                else if (jniCls0.compare("javax.cache.CacheException") == 0)
-                    *err = IgniteError(IGNITE_ERR_CACHE, jniMsg);
-                else if (jniCls0.compare("javax.cache.integration.CacheLoaderException") == 0)
-                    *err = IgniteError(IGNITE_ERR_CACHE_LOADER, jniMsg);
-                else if (jniCls0.compare("javax.cache.integration.CacheWriterException") == 0)
-                    *err = IgniteError(IGNITE_ERR_CACHE_WRITER, jniMsg);
-                else if (jniCls0.compare("javax.cache.processor.EntryProcessorException") == 0)
-                    *err = IgniteError(IGNITE_ERR_ENTRY_PROCESSOR, jniMsg);
-                else if (jniCls0.compare("org.apache.ignite.cache.CacheAtomicUpdateTimeoutException") == 0)
-                    *err = IgniteError(IGNITE_ERR_CACHE_ATOMIC_UPDATE_TIMEOUT, jniMsg);
-                else if (jniCls0.compare("org.apache.ignite.cache.CachePartialUpdateException") == 0)
-                    *err = IgniteError(IGNITE_ERR_CACHE_PARTIAL_UPDATE, jniMsg);
-                else if (jniCls0.compare("org.apache.ignite.transactions.TransactionOptimisticException") == 0)
-                    *err = IgniteError(IGNITE_ERR_TX_OPTIMISTIC, jniMsg);
-                else if (jniCls0.compare("org.apache.ignite.transactions.TransactionTimeoutException") == 0)
-                    *err = IgniteError(IGNITE_ERR_TX_TIMEOUT, jniMsg);
-                else if (jniCls0.compare("org.apache.ignite.transactions.TransactionRollbackException") == 0)
-                    *err = IgniteError(IGNITE_ERR_TX_ROLLBACK, jniMsg);
-                else if (jniCls0.compare("org.apache.ignite.transactions.TransactionHeuristicException") == 0)
-                    *err = IgniteError(IGNITE_ERR_TX_HEURISTIC, jniMsg);
-                else if (jniCls0.compare("org.apache.ignite.IgniteAuthenticationException") == 0)
-                    *err = IgniteError(IGNITE_ERR_AUTHENTICATION, jniMsg);
-                else if (jniCls0.compare("org.apache.ignite.plugin.security.GridSecurityException") == 0)
-                    *err = IgniteError(IGNITE_ERR_SECURITY, jniMsg);
-                else if (jniCls0.compare("org.apache.ignite.IgniteException") == 0)
-                    *err = IgniteError(IGNITE_ERR_GENERIC, jniMsg);
-                else if (jniCls0.compare("org.apache.ignite.IgniteCheckedException") == 0)
-                    *err = IgniteError(IGNITE_ERR_GENERIC, jniMsg);
-                else
-                {
-                    std::stringstream stream;
-                    
-                    stream << "Java exception occurred [cls=" << jniCls0;
-
-                    if (jniMsg)
-                        stream << ", msg=" << jniMsg;
-
-                    stream << "]";
-
-                    *err = IgniteError(IGNITE_ERR_UNKNOWN, stream.str().c_str());
-                }                    
-            }
-            else
-            {
-                // JNI class name is not available. Something really weird.
-                *err = IgniteError(IGNITE_ERR_UNKNOWN);
-            }
-        }
-        else if (jniCode == IGNITE_JNI_ERR_JVM_INIT)
-        {
-            std::stringstream stream;
-
-            stream << "Failed to initialize JVM [errCls=";
-
-            if (jniCls)
-                stream << jniCls;
-            else
-                stream << "N/A";
-
-            stream << ", errMsg=";
-
-            if (jniMsg)
-                stream << jniMsg;
-            else
-                stream << "N/A";
-
-            stream << "]";
-
-            *err = IgniteError(IGNITE_ERR_JVM_INIT, stream.str().c_str());
-        }
-        else if (jniCode == IGNITE_JNI_ERR_JVM_ATTACH)
-            *err = IgniteError(IGNITE_ERR_JVM_ATTACH, "Failed to attach to JVM.");
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/core/src/ignition.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/src/ignition.cpp b/modules/platform/src/main/cpp/core/src/ignition.cpp
deleted file mode 100644
index a0e3367..0000000
--- a/modules/platform/src/main/cpp/core/src/ignition.cpp
+++ /dev/null
@@ -1,468 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <sstream>
-
-#include <ignite/common/common.h>
-#include <ignite/common/concurrent.h>
-#include <ignite/common/exports.h>
-#include <ignite/common/java.h>
-
-#include "ignite/impl/ignite_environment.h"
-#include "ignite/impl/ignite_impl.h"
-#include "ignite/impl/utils.h"
-#include "ignite/ignition.h"
-
-using namespace ignite::common::concurrent;
-using namespace ignite::common::java;
-using namespace ignite::impl;
-using namespace ignite::impl::utils;
-
-namespace ignite
-{
-    /** Default configuration. */
-    const char* DFLT_CFG = "config/default-config.xml";
-
-    /** Whether JVM library is loaded to the process. */
-    bool JVM_LIB_LOADED;
-
-    /** Critical section for factory methods. */
-    CriticalSection factoryLock;
-
-    /** Flag indicating that at least one Ignite instance has started. */
-    bool started = false;
-
-    /**
-     * Convert integer value to string.
-     */
-    std::string JvmMemoryString(const std::string& prefix, int32_t val)
-    {
-        std::ostringstream ss;
-        ss << val;
-
-        std::string valStr = ss.str();
-
-        std::string res = std::string(prefix);
-        res.append(valStr);
-        res.append("m");
-
-        return res;
-    }
-
-    /**
-     * Create JVM options.
-     *
-     * @param cfg Configuration.
-     * @param home Optional GG home.
-     * @param cp Classpath.
-     * @param opts Options.
-     * @param optsLen Options length.
-     * @return Options.
-     */
-    char** CreateJvmOptions(const IgniteConfiguration& cfg, const std::string* home, const std::string& cp, int* optsLen)
-    {
-        *optsLen = 3 + (home ? 1 : 0) + cfg.jvmOptsLen;
-        char** opts = new char*[*optsLen];
-
-        int idx = 0;
-
-        // 1. Set classpath.
-        std::string cpFull = std::string("-Djava.class.path=") + cp;
-
-        *(opts + idx++) = CopyChars(cpFull.c_str());
-
-        // 2. Set home.
-        if (home) {
-            std::string homeFull = std::string("-DIGNITE_HOME=") + *home;
-
-            *(opts + idx++) = CopyChars(homeFull.c_str());
-        }
-
-        // 3. Set Xms, Xmx.
-        std::string xmsStr = JvmMemoryString(std::string("-Xms"), cfg.jvmInitMem);
-        std::string xmxStr = JvmMemoryString(std::string("-Xmx"), cfg.jvmMaxMem);
-
-        *(opts + idx++) = CopyChars(xmsStr.c_str());
-        *(opts + idx++) = CopyChars(xmxStr.c_str());
-
-        // 4. Set the rest options.
-        for (int i = 0; i < cfg.jvmOptsLen; i++) {
-            char* optCopy = CopyChars(cfg.jvmOpts[i].opt);
-
-            opts[idx++] = optCopy;
-        }
-
-        return opts;
-    }
-
-    Ignite Ignition::Start(const IgniteConfiguration& cfg)
-    {
-        return Start(cfg, static_cast<const char*>(NULL));
-    }
-
-    Ignite Ignition::Start(const IgniteConfiguration& cfg, IgniteError* err)
-    {
-        return Start(cfg, NULL, err);
-    }
-
-    Ignite Ignition::Start(const IgniteConfiguration& cfg, const char* name)
-    {
-        IgniteError err;
-
-        Ignite res = Start(cfg, name, &err);
-
-        IgniteError::ThrowIfNeeded(err);
-
-        return res;
-    }
-
-    Ignite Ignition::Start(const IgniteConfiguration& cfg, const char* name, IgniteError* err)
-    {
-        bool failed = false;
-
-        SharedPointer<IgniteEnvironment> env;
-        SharedPointer<IgniteEnvironment>* envTarget = NULL;
-
-        jobject javaRef = NULL;
-
-        factoryLock.Enter();
-
-        // 1. Load JVM library if needed.
-        if (!JVM_LIB_LOADED)
-        {
-            bool jvmLibFound;
-            std::string jvmLib;
-
-            if (cfg.jvmLibPath)
-            {
-                std::string jvmLibPath = std::string(cfg.jvmLibPath);
-
-                jvmLib = FindJvmLibrary(&jvmLibPath, &jvmLibFound);
-            }
-            else
-                jvmLib = FindJvmLibrary(NULL, &jvmLibFound);
-
-            if (!jvmLibFound)
-            {
-                *err = IgniteError(IgniteError::IGNITE_ERR_JVM_LIB_NOT_FOUND,
-                    "JVM library is not found (did you set JAVA_HOME environment variable?)");
-
-                failed = true;
-            }
-
-            if (!failed) {
-                if (!LoadJvmLibrary(jvmLib))
-                {
-                    *err = IgniteError(IgniteError::IGNITE_ERR_JVM_LIB_LOAD_FAILED, "Failed to load JVM library.");
-
-                    failed = true;
-                }
-            }
-
-            JVM_LIB_LOADED = true;
-        }
-
-        if (!failed)
-        {
-            // 2. Resolve IGNITE_HOME.
-            bool homeFound;
-            std::string home;
-
-            if (cfg.igniteHome)
-            {
-                std::string homePath = std::string(cfg.igniteHome);
-
-                home = ResolveIgniteHome(&homePath, &homeFound);
-            }
-            else
-                home = ResolveIgniteHome(NULL, &homeFound);
-
-            // 3. Create classpath.
-            std::string cp;
-
-            if (cfg.jvmClassPath)
-            {
-                std::string usrCp = cfg.jvmClassPath;
-
-                cp = CreateIgniteClasspath(&usrCp, homeFound ? &home : NULL);
-            }
-            else
-                cp = CreateIgniteClasspath(NULL, homeFound ? &home : NULL);
-
-            if (!cp.empty())
-            {
-                // 4. Start JVM if needed.
-                JniErrorInfo jniErr;
-
-                env = SharedPointer<IgniteEnvironment>(new IgniteEnvironment());
-
-                int optsLen;
-                char** opts = CreateJvmOptions(cfg, homeFound ? &home : NULL, cp, &optsLen);
-
-                envTarget = new SharedPointer<IgniteEnvironment>(env);
-                
-                SharedPointer<JniContext> ctx(
-                    JniContext::Create(opts, optsLen, env.Get()->GetJniHandlers(envTarget), &jniErr));
-
-                for (int i = 0; i < optsLen; i++)
-                    ReleaseChars(*(opts + i));
-
-                delete[] opts;
-
-                if (!ctx.Get())
-                {
-                    IgniteError::SetError(jniErr.code, jniErr.errCls, jniErr.errMsg, err);
-                    
-                    failed = true;
-                }
-
-                // 5. Start Ignite.
-                if (!failed)
-                {
-                    char* springCfgPath0 = CopyChars(cfg.springCfgPath);
-
-                    if (!springCfgPath0)
-                        springCfgPath0 = CopyChars(DFLT_CFG);
-
-                    char* name0 = CopyChars(name);
-
-                    interop::InteropUnpooledMemory mem(16);
-                    interop::InteropOutputStream stream(&mem);
-                    stream.WriteBool(false);
-                    stream.Synchronize();
-
-                    javaRef = ctx.Get()->IgnitionStart(springCfgPath0, name0, 2, mem.PointerLong(), &jniErr);
-
-                    ReleaseChars(springCfgPath0);
-                    ReleaseChars(name0);
-
-                    if (!javaRef) {
-                        IgniteError::SetError(jniErr.code, jniErr.errCls, jniErr.errMsg, err);
-                        
-                        failed = true;
-                    }
-                    else {
-                        // 6. Ignite is started at this point.
-                        env.Get()->Initialize(ctx);
-
-                        started = true;
-                    }
-                }
-            }
-            else {
-                *err = IgniteError(IgniteError::IGNITE_ERR_JVM_NO_CLASSPATH,
-                    "Java classpath is empty (did you set IGNITE_HOME environment variable?)");
-
-                failed = true;
-            }
-        }
-
-        factoryLock.Leave();
-
-        if (failed) 
-        {
-            if (envTarget)
-                delete envTarget;
-
-            return Ignite();
-        }
-        else 
-        {
-            IgniteImpl* impl = new IgniteImpl(env, javaRef);
-
-            return Ignite(impl);
-        }
-    }
-
-    Ignite Ignition::Get()
-    {
-        return Get(static_cast<const char*>(NULL));
-    }
-
-    Ignite Ignition::Get(IgniteError* err)
-    {
-        return Get(NULL, err);
-    }
-
-    Ignite Ignition::Get(const char* name)
-    {
-        IgniteError err;
-
-        Ignite res = Get(name, &err);
-
-        IgniteError::ThrowIfNeeded(err);
-
-        return res;
-    }
-
-    Ignite Ignition::Get(const char* name, IgniteError* err)
-    {
-        Ignite res;
-
-        factoryLock.Enter();
-
-        if (started)
-        {
-            char* name0 = CopyChars(name);
-
-            // 1. Create context for this operation.
-            JniErrorInfo jniErr;
-
-            SharedPointer<JniContext> ctx(JniContext::Create(NULL, 0, JniHandlers(), &jniErr));
-
-            IgniteError::SetError(jniErr.code, jniErr.errCls, jniErr.errMsg, err);
-
-            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);
-
-                if (err->GetCode() == IgniteError::IGNITE_SUCCESS)
-                {
-                    if (ptr != 0)
-                    {
-                        // 3. Obtain real environment for this instance.
-                        JniHandlers* hnds = reinterpret_cast<JniHandlers*>(ptr);
-
-                        SharedPointer<IgniteEnvironment>* env =
-                            static_cast<SharedPointer<IgniteEnvironment>*>(hnds->target);
-
-                        // 4. Get fresh node reference.
-                        jobject ref = ctx.Get()->IgnitionInstance(name0, &jniErr);
-
-                        if (err->GetCode() == IgniteError::IGNITE_SUCCESS) {
-                            if (ref)
-                            {
-                                IgniteImpl* impl = new IgniteImpl(*env, ref);
-
-                                res = Ignite(impl);
-                            }
-                            else
-                                // Error: concurrent node stop.
-                                *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,
-                            "Failed to get Ignite instance because it is either not started yet or already stopped.");
-                }
-            }
-
-            ReleaseChars(name0);
-        }
-        else
-            // Error: no node with the given name.
-            *err = IgniteError(IgniteError::IGNITE_ERR_GENERIC,
-                "Failed to get Ignite instance because it is either not started yet or already stopped.");
-
-        factoryLock.Leave();
-
-        return res;
-    }
-
-    bool Ignition::Stop(const bool cancel)
-    {
-        return Stop(NULL, cancel);
-    }
-
-    bool Ignition::Stop(const bool cancel, IgniteError* err)
-    {
-        return Stop(NULL, cancel, err);
-    }
-
-    bool Ignition::Stop(const char* name, const bool cancel)
-    {
-        IgniteError err;
-
-        bool res = Stop(name, cancel, &err);
-
-        IgniteError::ThrowIfNeeded(err);
-
-        return res;
-    }
-
-    bool Ignition::Stop(const char* name, const bool cancel, IgniteError* err)
-    {
-        bool res = false;
-
-        factoryLock.Enter();
-
-        if (started)
-        {
-            JniErrorInfo jniErr;
-
-            SharedPointer<JniContext> ctx(JniContext::Create(NULL, 0, JniHandlers(), &jniErr));
-
-            IgniteError::SetError(jniErr.code, jniErr.errCls, jniErr.errMsg, err);
-
-            if (err->GetCode() == IgniteError::IGNITE_SUCCESS)
-            {
-                char* name0 = CopyChars(name);
-
-                bool res0 = ctx.Get()->IgnitionStop(name0, cancel, &jniErr);
-
-                ReleaseChars(name0);
-
-                IgniteError::SetError(jniErr.code, jniErr.errCls, jniErr.errMsg, err);
-
-                if (err->GetCode() == IgniteError::IGNITE_SUCCESS)
-                    res = res0;
-            }
-        }
-
-        factoryLock.Leave();
-
-        return res;
-    }
-
-    void Ignition::StopAll(const bool cancel)
-    {
-        IgniteError err;
-
-        StopAll(cancel, &err);
-
-        IgniteError::ThrowIfNeeded(err);
-    }
-
-    void Ignition::StopAll(const bool cancel, IgniteError* err)
-    {
-        factoryLock.Enter();
-
-        if (started)
-        {
-            JniErrorInfo jniErr;
-
-            SharedPointer<JniContext> ctx(JniContext::Create(NULL, 0, JniHandlers(), &jniErr));
-             
-            IgniteError::SetError(jniErr.code, jniErr.errCls, jniErr.errMsg, err);
-
-            if (err->GetCode() == IgniteError::IGNITE_SUCCESS)
-            {
-                ctx.Get()->IgnitionStopAll(cancel, &jniErr);
-
-                IgniteError::SetError(jniErr.code, jniErr.errCls, jniErr.errMsg, err);
-            }
-        }
-
-        factoryLock.Leave();
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/core/src/impl/cache/cache_impl.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/src/impl/cache/cache_impl.cpp b/modules/platform/src/main/cpp/core/src/impl/cache/cache_impl.cpp
deleted file mode 100644
index 2f211e7..0000000
--- a/modules/platform/src/main/cpp/core/src/impl/cache/cache_impl.cpp
+++ /dev/null
@@ -1,388 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "ignite/cache/cache_peek_mode.h"
-#include "ignite/impl/cache/cache_impl.h"
-#include "ignite/impl/interop/interop.h"
-#include "ignite/impl/portable/portable_reader_impl.h"
-#include "ignite/impl/utils.h"
-#include "ignite/impl/portable/portable_metadata_updater_impl.h"
-#include "ignite/portable/portable.h"
-
-using namespace ignite::common::concurrent;
-using namespace ignite::common::java;
-using namespace ignite::cache;
-using namespace ignite::cache::query;
-using namespace ignite::impl;
-using namespace ignite::impl::cache::query;
-using namespace ignite::impl::interop;
-using namespace ignite::impl::portable;
-using namespace ignite::impl::utils;
-using namespace ignite::portable;
-
-namespace ignite
-{
-    namespace impl
-    {
-        namespace cache
-        {
-            /** Operation: Clear. */
-            const int32_t OP_CLEAR = 1;
-
-            /** Operation: ClearAll. */
-            const int32_t OP_CLEAR_ALL = 2;
-
-            /** Operation: ContainsKey. */
-            const int32_t OP_CONTAINS_KEY = 3;
-
-            /** Operation: ContainsKeys. */
-            const int32_t OP_CONTAINS_KEYS = 4;
-
-            /** Operation: Get. */
-            const int32_t OP_GET = 5;
-
-            /** Operation: GetAll. */
-            const int32_t OP_GET_ALL = 6;
-
-            /** Operation: GetAndPut. */
-            const int32_t OP_GET_AND_PUT = 7;
-
-            /** Operation: GetAndPutIfAbsent. */
-            const int32_t OP_GET_AND_PUT_IF_ABSENT = 8;
-
-            /** Operation: GetAndRemove. */
-            const int32_t OP_GET_AND_REMOVE = 9;
-
-            /** Operation: GetAndReplace. */
-            const int32_t OP_GET_AND_REPLACE = 10;
-
-            /** Operation: LocalEvict. */
-            const int32_t OP_LOCAL_EVICT = 16;
-
-            /** Operation: LocalClear. */
-            const int32_t OP_LOCAL_CLEAR = 20;
-
-            /** Operation: LocalClearAll. */
-            const int32_t OP_LOCAL_CLEAR_ALL = 21;
-
-            /** Operation: LocalPeek. */
-            const int32_t OP_LOCAL_PEEK = 25;
-
-            /** Operation: Put. */
-            const int32_t OP_PUT = 26;
-
-            /** Operation: PutAll. */
-            const int32_t OP_PUT_ALL = 27;
-
-            /** Operation: PutIfAbsent. */
-            const int32_t OP_PUT_IF_ABSENT = 28;
-
-            /** Operation: SCAN query. */
-            const int32_t OP_QRY_SCAN = 30;
-
-            /** Operation: SQL query. */
-            const int32_t OP_QRY_SQL = 31;
-
-            /** Operation: SQL fields query. */
-            const int32_t OP_QRY_SQL_FIELDS = 32;
-
-            /** Operation: TEXT query. */
-            const int32_t OP_QRY_TEXT = 33;
-
-            /** Operation: RemoveAll. */
-            const int32_t OP_REMOVE_ALL = 34;
-
-            /** Operation: Remove(K, V). */
-            const int32_t OP_REMOVE_2 = 35;
-
-            /** Operation: Remove(K). */
-            const int32_t OP_REMOVE_1 = 36;
-
-            /** Operation: Replace(K, V). */
-            const int32_t OP_REPLACE_2 = 37;
-
-            /** Operation: Replace(K, V, V). */
-            const int32_t OP_REPLACE_3 = 38;
-
-            CacheImpl::CacheImpl(char* name, SharedPointer<IgniteEnvironment> env, jobject javaRef) :
-                name(name), env(env), javaRef(javaRef)
-            {
-                // No-op.
-            }
-
-            CacheImpl::~CacheImpl()
-            {
-                ReleaseChars(name);
-
-                JniContext::Release(javaRef);
-            }
-
-            char* CacheImpl::GetName()
-            {
-                return name;
-            }
-
-            bool CacheImpl::IsEmpty(IgniteError* err)
-            {
-                return Size(IGNITE_PEEK_MODE_ALL, err) == 0;
-            }
-
-            bool CacheImpl::ContainsKey(InputOperation& inOp, IgniteError* err)
-            {
-                return OutOpInternal(OP_CONTAINS_KEY, inOp, err);
-            }
-
-            bool CacheImpl::ContainsKeys(InputOperation& inOp, IgniteError* err)
-            {
-                return OutOpInternal(OP_CONTAINS_KEYS, inOp, err);
-            }
-
-            void CacheImpl::LocalPeek(InputOperation& inOp, OutputOperation& outOp, int32_t peekModes, IgniteError* err)
-            {
-                OutInOpInternal(OP_LOCAL_PEEK, inOp, outOp, err);
-            }
-
-            void CacheImpl::Get(InputOperation& inOp, OutputOperation& outOp, IgniteError* err)
-            {
-                OutInOpInternal(OP_GET, inOp, outOp, err);
-            }
-
-            void CacheImpl::GetAll(InputOperation& inOp, OutputOperation& outOp, IgniteError* err)
-            {
-                OutInOpInternal(OP_GET_ALL, inOp, outOp, err);
-            }
-
-            void CacheImpl::Put(InputOperation& inOp, IgniteError* err)
-            {
-                OutOpInternal(OP_PUT, inOp, err);
-            }
-
-            void CacheImpl::PutAll(ignite::impl::InputOperation& inOp, IgniteError* err)
-            {
-                OutOpInternal(OP_PUT_ALL, inOp, err);
-            }
-
-            void CacheImpl::GetAndPut(InputOperation& inOp, OutputOperation& outOp, IgniteError* err)
-            {
-                OutInOpInternal(OP_GET_AND_PUT, inOp, outOp, err);
-            }
-
-            void CacheImpl::GetAndReplace(InputOperation& inOp, OutputOperation& outOp, IgniteError* err)
-            {
-                OutInOpInternal(OP_GET_AND_REPLACE, inOp, outOp, err);
-            }
-
-            void CacheImpl::GetAndRemove(InputOperation& inOp, OutputOperation& outOp, IgniteError* err)
-            {
-                OutInOpInternal(OP_GET_AND_REMOVE, inOp, outOp, err);
-            }
-
-            bool CacheImpl::PutIfAbsent(InputOperation& inOp, IgniteError* err)
-            {
-                return OutOpInternal(OP_PUT_IF_ABSENT, inOp, err);
-            }
-
-            void CacheImpl::GetAndPutIfAbsent(InputOperation& inOp, OutputOperation& outOp, IgniteError* err)
-            {
-                OutInOpInternal(OP_GET_AND_PUT_IF_ABSENT, inOp, outOp, err);
-            }
-
-            bool CacheImpl::Replace(InputOperation& inOp, IgniteError* err)
-            {
-                return OutOpInternal(OP_REPLACE_2, inOp, err);
-            }
-
-            bool CacheImpl::ReplaceIfEqual(InputOperation& inOp, IgniteError* err)
-            {
-                return OutOpInternal(OP_REPLACE_3, inOp, err);
-            }
-
-            void CacheImpl::LocalEvict(InputOperation& inOp, IgniteError* err)
-            {
-                OutOpInternal(OP_LOCAL_EVICT, inOp, err);
-            }
-
-            void CacheImpl::Clear(IgniteError* err)
-            {
-                JniErrorInfo jniErr;
-
-                env.Get()->Context()->CacheClear(javaRef, &jniErr);
-
-                IgniteError::SetError(jniErr.code, jniErr.errCls, jniErr.errMsg, err);
-            }
-
-            void CacheImpl::Clear(InputOperation& inOp, IgniteError* err)
-            {
-                OutOpInternal(OP_CLEAR, inOp, err);
-            }
-
-            void CacheImpl::ClearAll(InputOperation& inOp, IgniteError* err)
-            {
-                OutOpInternal(OP_CLEAR_ALL, inOp, err);
-            }
-
-            void CacheImpl::LocalClear(InputOperation& inOp, IgniteError* err)
-            {
-                OutOpInternal(OP_LOCAL_CLEAR, inOp, err);
-            }
-
-            void CacheImpl::LocalClearAll(InputOperation& inOp, IgniteError* err)
-            {
-                OutOpInternal(OP_LOCAL_CLEAR_ALL, inOp, err);
-            }
-
-            bool CacheImpl::Remove(InputOperation& inOp, IgniteError* err)
-            {
-                return OutOpInternal(OP_REMOVE_1, inOp, err);
-            }
-
-            bool CacheImpl::RemoveIfEqual(InputOperation& inOp, IgniteError* err)
-            {
-                return OutOpInternal(OP_REMOVE_2, inOp, err);
-            }
-
-            void CacheImpl::RemoveAll(InputOperation& inOp, IgniteError* err)
-            {
-                OutOpInternal(OP_REMOVE_ALL, inOp, err);
-            }
-
-            void CacheImpl::RemoveAll(IgniteError* err)
-            {
-                JniErrorInfo jniErr;
-
-                env.Get()->Context()->CacheRemoveAll(javaRef, &jniErr);
-
-                IgniteError::SetError(jniErr.code, jniErr.errCls, jniErr.errMsg, err);
-            }
-
-            int32_t CacheImpl::Size(const int32_t peekModes, IgniteError* err)
-            {
-                return SizeInternal(peekModes, false, err);
-            }
-
-            int32_t CacheImpl::LocalSize(const int32_t peekModes, IgniteError* err)
-            {
-                return SizeInternal(peekModes, true, err);
-            }
-
-            QueryCursorImpl* CacheImpl::QuerySql(const SqlQuery& qry, IgniteError* err)
-            {
-                return QueryInternal(qry, OP_QRY_SQL, err);
-            }
-
-            QueryCursorImpl* CacheImpl::QueryText(const TextQuery& qry, IgniteError* err)
-            {
-                return QueryInternal(qry, OP_QRY_TEXT, err);
-            }
-
-            QueryCursorImpl* CacheImpl::QueryScan(const ScanQuery& qry, IgniteError* err)
-            {
-                return QueryInternal(qry, OP_QRY_SCAN, err);
-            }
-
-            int64_t CacheImpl::WriteTo(InteropMemory* mem, InputOperation& inOp, IgniteError* err)
-            {
-                PortableMetadataManager* metaMgr = env.Get()->GetMetadataManager();
-
-                int32_t metaVer = metaMgr->GetVersion();
-
-                InteropOutputStream out(mem);
-                PortableWriterImpl writer(&out, metaMgr);
-                
-                inOp.ProcessInput(writer);
-
-                out.Synchronize();
-
-                if (metaMgr->IsUpdatedSince(metaVer))
-                {
-                    PortableMetadataUpdaterImpl metaUpdater(env, javaRef);
-
-                    if (!metaMgr->ProcessPendingUpdates(&metaUpdater, err))
-                        return 0;
-                }
-
-                return mem->PointerLong();
-            }
-
-            void CacheImpl::ReadFrom(InteropMemory* mem, OutputOperation& outOp)
-            {
-                InteropInputStream in(mem);
-
-                PortableReaderImpl reader(&in);
-
-                outOp.ProcessOutput(reader);
-            }
-
-            int CacheImpl::SizeInternal(const int32_t peekModes, const bool loc, IgniteError* err)
-            {
-                JniErrorInfo jniErr;
-
-                int res = env.Get()->Context()->CacheSize(javaRef, peekModes, loc, &jniErr);
-
-                IgniteError::SetError(jniErr.code, jniErr.errCls, jniErr.errMsg, err);
-
-                if (jniErr.code == IGNITE_JNI_ERR_SUCCESS)
-                    return res;
-                else
-                    return -1;
-            }
-
-            bool CacheImpl::OutOpInternal(const int32_t opType, InputOperation& inOp, IgniteError* err)
-            {
-                JniErrorInfo jniErr;
-
-                SharedPointer<InteropMemory> mem = env.Get()->AllocateMemory();
-
-                int64_t outPtr = WriteTo(mem.Get(), inOp, err);
-
-                if (outPtr)
-                {
-                    long long res = env.Get()->Context()->TargetInStreamOutLong(javaRef, opType, outPtr, &jniErr);
-
-                    IgniteError::SetError(jniErr.code, jniErr.errCls, jniErr.errMsg, err);
-
-                    if (jniErr.code == IGNITE_JNI_ERR_SUCCESS)
-                        return res == 1;
-                }
-
-                return false;
-            }
-
-            void CacheImpl::OutInOpInternal(const int32_t opType, InputOperation& inOp, OutputOperation& outOp, 
-                IgniteError* err)
-            {
-                JniErrorInfo jniErr;
-
-                SharedPointer<InteropMemory> outMem = env.Get()->AllocateMemory();
-                SharedPointer<InteropMemory> inMem = env.Get()->AllocateMemory();
-
-                int64_t outPtr = WriteTo(outMem.Get(), inOp, err);
-
-                if (outPtr)
-                {
-                    env.Get()->Context()->TargetInStreamOutStream(javaRef, opType, WriteTo(outMem.Get(), inOp, err), 
-                        inMem.Get()->PointerLong(), &jniErr);
-
-                    IgniteError::SetError(jniErr.code, jniErr.errCls, jniErr.errMsg, err);
-
-                    if (jniErr.code == IGNITE_JNI_ERR_SUCCESS)
-                        ReadFrom(inMem.Get(), outOp);
-                }
-            }
-        }
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/core/src/impl/cache/query/query_impl.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/src/impl/cache/query/query_impl.cpp b/modules/platform/src/main/cpp/core/src/impl/cache/query/query_impl.cpp
deleted file mode 100644
index 7d89321..0000000
--- a/modules/platform/src/main/cpp/core/src/impl/cache/query/query_impl.cpp
+++ /dev/null
@@ -1,193 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "ignite/impl/cache/query/query_impl.h"
-
-using namespace ignite::common::concurrent;
-using namespace ignite::common::java;
-using namespace ignite::impl::interop;
-using namespace ignite::impl::portable;
-
-namespace ignite
-{
-    namespace impl
-    {
-        namespace cache
-        {
-            namespace query
-            {
-                /** Operation: get all entries. */
-                const int32_t OP_GET_ALL = 1;
-
-                /** Operation: get single entry. */
-                const int32_t OP_GET_SINGLE = 3;
-
-                QueryCursorImpl::QueryCursorImpl(SharedPointer<IgniteEnvironment> env, jobject javaRef) :
-                    env(env), javaRef(javaRef), iterCalled(false), getAllCalled(false), hasNext(false)
-                {
-                    // No-op.
-                }
-
-                QueryCursorImpl::~QueryCursorImpl()
-                {
-                    // 1. Close the cursor.
-                    env.Get()->Context()->QueryCursorClose(javaRef);
-
-                    // 2. Release Java reference.
-                    JniContext::Release(javaRef);
-                }
-
-                bool QueryCursorImpl::HasNext(IgniteError* err)
-                {
-                    // Check whether GetAll() was called earlier.
-                    if (getAllCalled) 
-                    {
-                        *err = IgniteError(IgniteError::IGNITE_ERR_GENERIC, 
-                            "Cannot use HasNext() method because GetAll() was called.");
-
-                        return false;
-                    }
-
-                    // Create iterator in Java if needed.
-                    if (!CreateIteratorIfNeeded(err))
-                        return false;
-                    
-                    return hasNext;
-                }
-
-                void QueryCursorImpl::GetNext(OutputOperation& op, IgniteError* err)
-                {
-                    // Check whether GetAll() was called earlier.
-                    if (getAllCalled) 
-                    {
-                        *err = IgniteError(IgniteError::IGNITE_ERR_GENERIC, 
-                            "Cannot use GetNext() method because GetAll() was called.");
-
-                        return;
-                    }
-
-                    // Create iterator in Java if needed.
-                    if (!CreateIteratorIfNeeded(err))
-                        return;
-
-                    if (hasNext)
-                    {
-                        JniErrorInfo jniErr;
-
-                        SharedPointer<InteropMemory> inMem = env.Get()->AllocateMemory();
-
-                        env.Get()->Context()->TargetOutStream(javaRef, OP_GET_SINGLE, inMem.Get()->PointerLong(), &jniErr);
-
-                        IgniteError::SetError(jniErr.code, jniErr.errCls, jniErr.errMsg, err);
-
-                        if (jniErr.code == IGNITE_JNI_ERR_SUCCESS)
-                        {
-                            InteropInputStream in(inMem.Get());
-
-                            portable::PortableReaderImpl reader(&in);
-
-                            op.ProcessOutput(reader);
-
-                            hasNext = IteratorHasNext(err);
-                        }
-                    }
-                    else
-                    {
-                        // Ensure we do not overwrite possible previous error.
-                        if (err->GetCode() == IgniteError::IGNITE_SUCCESS)
-                            *err = IgniteError(IgniteError::IGNITE_ERR_GENERIC, "No more elements available.");
-                    }
-                }
-
-                void QueryCursorImpl::GetAll(OutputOperation& op, IgniteError* err)
-                {
-                    // Check whether any of iterator methods were called.
-                    if (iterCalled)
-                    {
-                        *err = IgniteError(IgniteError::IGNITE_ERR_GENERIC,
-                            "Cannot use GetAll() method because an iteration method was called.");
-
-                        return;
-                    }
-
-                    // Check whether GetAll was called before.
-                    if (getAllCalled)
-                    {
-                        *err = IgniteError(IgniteError::IGNITE_ERR_GENERIC,
-                            "Cannot use GetNext() method because GetAll() was called.");
-
-                        return;
-                    }
-
-                    // Get data.
-                    JniErrorInfo jniErr;
-
-                    SharedPointer<InteropMemory> inMem = env.Get()->AllocateMemory();
-
-                    env.Get()->Context()->TargetOutStream(javaRef, OP_GET_ALL, inMem.Get()->PointerLong(), &jniErr);
-
-                    IgniteError::SetError(jniErr.code, jniErr.errCls, jniErr.errMsg, err);
-
-                    if (jniErr.code == IGNITE_JNI_ERR_SUCCESS)
-                    {
-                        getAllCalled = true;
-
-                        InteropInputStream in(inMem.Get());
-
-                        portable::PortableReaderImpl reader(&in);
-
-                        op.ProcessOutput(reader);
-                    }
-                }
-
-                bool QueryCursorImpl::CreateIteratorIfNeeded(IgniteError* err)
-                {
-                    if (!iterCalled)
-                    {
-                        JniErrorInfo jniErr;
-
-                        env.Get()->Context()->QueryCursorIterator(javaRef, &jniErr);
-
-                        IgniteError::SetError(jniErr.code, jniErr.errCls, jniErr.errMsg, err);
-
-                        if (jniErr.code == IGNITE_JNI_ERR_SUCCESS)
-                        {
-                            iterCalled = true;
-
-                            hasNext = IteratorHasNext(err);
-                        }
-                        else
-                            return false;
-                    }
-                    
-                    return true;
-                }
-
-                bool QueryCursorImpl::IteratorHasNext(IgniteError* err)
-                {
-                    JniErrorInfo jniErr;
-
-                    bool res = env.Get()->Context()->QueryCursorIteratorHasNext(javaRef, &jniErr);
-
-                    IgniteError::SetError(jniErr.code, jniErr.errCls, jniErr.errMsg, err);
-
-                    return jniErr.code == IGNITE_JNI_ERR_SUCCESS && res;
-                }
-            }
-        }
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/core/src/impl/handle_registry.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/src/impl/handle_registry.cpp b/modules/platform/src/main/cpp/core/src/impl/handle_registry.cpp
deleted file mode 100644
index c447faa..0000000
--- a/modules/platform/src/main/cpp/core/src/impl/handle_registry.cpp
+++ /dev/null
@@ -1,234 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "ignite/impl/handle_registry.h"
-
-using namespace ignite::common::concurrent;
-
-namespace ignite
-{
-    namespace impl
-    {
-        HandleRegistryEntry::~HandleRegistryEntry()
-        {
-            // No-op.
-        }
-
-        HandleRegistrySegment::HandleRegistrySegment() : 
-            map(new std::map<int64_t, SharedPointer<HandleRegistryEntry>>()), mux(new CriticalSection())
-        {
-            // No-op.
-        }
-
-        HandleRegistrySegment::~HandleRegistrySegment()
-        {
-            delete map;
-            delete mux;
-        }
-
-        SharedPointer<HandleRegistryEntry> HandleRegistrySegment::Get(int64_t hnd)
-        {
-            mux->Enter();
-
-            SharedPointer<HandleRegistryEntry> res = (*map)[hnd];
-
-            mux->Leave();
-
-            return res;
-        }
-
-        void HandleRegistrySegment::Put(int64_t hnd, const SharedPointer<HandleRegistryEntry>& entry)
-        {
-            mux->Enter();
-
-            (*map)[hnd] = entry;
-
-            mux->Leave();
-        }
-
-        void HandleRegistrySegment::Remove(int64_t hnd)
-        {
-            mux->Enter();
-
-            map->erase(hnd);
-
-            mux->Leave();
-        }
-
-        void HandleRegistrySegment::Clear()
-        {
-            mux->Enter();
-
-            map->erase(map->begin(), map->end());
-
-            mux->Leave();
-        }
-
-        HandleRegistry::HandleRegistry(int32_t fastCap, int32_t slowSegmentCnt)
-        {
-            this->fastCap = fastCap;
-
-            fastCtr = 0;
-
-            fast = new SharedPointer<HandleRegistryEntry>[fastCap];
-
-            for (int i = 0; i < fastCap; i++)
-                fast[i] = SharedPointer<HandleRegistryEntry>();
-
-            this->slowSegmentCnt = slowSegmentCnt;
-
-            slowCtr = fastCap;
-
-            slow = new HandleRegistrySegment*[slowSegmentCnt];
-
-            for (int i = 0; i < slowSegmentCnt; i++)
-                slow[i] = new HandleRegistrySegment();
-
-            closed = 0;
-
-            Memory::Fence();
-        }
-
-        HandleRegistry::~HandleRegistry()
-        {
-            Close();
-
-            delete[] fast;
-
-            for (int i = 0; i < slowSegmentCnt; i++)
-                delete slow[i];
-
-            delete[] slow;
-        }
-
-        int64_t HandleRegistry::Allocate(const SharedPointer<HandleRegistryEntry>& target)
-        {
-            return Allocate0(target, false, false);
-        }
-
-        int64_t HandleRegistry::AllocateCritical(const SharedPointer<HandleRegistryEntry>& target)
-        {
-            return Allocate0(target, true, false);
-        }
-
-        int64_t HandleRegistry::AllocateSafe(const SharedPointer<HandleRegistryEntry>& target)
-        {
-            return Allocate0(target, false, true);
-        }
-
-        int64_t HandleRegistry::AllocateCriticalSafe(const SharedPointer<HandleRegistryEntry>& target)
-        {
-            return Allocate0(target, true, true);
-        }
-
-        void HandleRegistry::Release(int64_t hnd)
-        {
-            if (hnd < fastCap)
-                fast[static_cast<int32_t>(hnd)] = SharedPointer<HandleRegistryEntry>();
-            else
-            {
-                HandleRegistrySegment* segment = *(slow + hnd % slowSegmentCnt);
-
-                segment->Remove(hnd);
-            }
-
-            Memory::Fence();
-        }
-
-        SharedPointer<HandleRegistryEntry> HandleRegistry::Get(int64_t hnd)
-        {
-            Memory::Fence();
-
-            if (hnd < fastCap)
-                return fast[static_cast<int32_t>(hnd)];
-            else
-            {
-                HandleRegistrySegment* segment = *(slow + hnd % slowSegmentCnt);
-
-                return segment->Get(hnd);
-            }
-        }
-
-        void HandleRegistry::Close()
-        {
-            if (Atomics::CompareAndSet32(&closed, 0, 1))
-            {
-                // Cleanup fast-path handles.
-                for (int i = 0; i < fastCap; i++)
-                    fast[i] = SharedPointer<HandleRegistryEntry>();
-
-                // Cleanup slow-path handles.
-                for (int i = 0; i < slowSegmentCnt; i++)
-                    (*(slow + i))->Clear();
-            }
-        }
-
-        int64_t HandleRegistry::Allocate0(const SharedPointer<HandleRegistryEntry>& target, bool critical, bool safe)
-        {
-            // Check closed state.
-            Memory::Fence();
-
-            if (closed == 1)
-                return -1;
-
-            // Try allocating entry on critical path.
-            if (critical)
-            {
-                if (fastCtr < fastCap)
-                {
-                    int32_t fastIdx = Atomics::IncrementAndGet32(&fastCtr) - 1;
-
-                    if (fastIdx < fastCap)
-                    {
-                        fast[fastIdx] = target;
-
-                        // Double-check for closed state if safe mode is on.
-                        Memory::Fence();
-
-                        if (safe && closed == 1)
-                        {
-                            fast[fastIdx] = SharedPointer<HandleRegistryEntry>();
-
-                            return -1;
-                        }
-                        else
-                            return fastIdx;
-                    }
-                }
-            }
-
-            // Either allocating on slow-path, or fast-path can no longer accomodate more entries.
-            int64_t slowIdx = Atomics::IncrementAndGet64(&slowCtr) - 1;
-
-            HandleRegistrySegment* segment = *(slow + slowIdx % slowSegmentCnt);
-
-            segment->Put(slowIdx, target);
-
-            // Double-check for closed state if safe mode is on.
-            Memory::Fence();
-
-            if (safe && closed == 1)
-            {
-                segment->Remove(slowIdx);
-
-                return -1;
-            }
-
-            return slowIdx;
-        }
-    }
-}
\ No newline at end of file


[20/28] ignite git commit: IGNITE-1513: Moved CPP.

Posted by vo...@apache.org.
http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/core/include/ignite/impl/operations.h
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/core/include/ignite/impl/operations.h b/modules/platform/cpp/core/include/ignite/impl/operations.h
new file mode 100644
index 0000000..8f32922
--- /dev/null
+++ b/modules/platform/cpp/core/include/ignite/impl/operations.h
@@ -0,0 +1,452 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _IGNITE_IMPL_OPERATION
+#define _IGNITE_IMPL_OPERATION
+
+#include <map>
+#include <set>
+#include <vector>
+
+#include <ignite/common/common.h>
+
+#include "ignite/cache/cache_entry.h"
+#include "ignite/impl/portable/portable_reader_impl.h"
+#include "ignite/impl/portable/portable_writer_impl.h"
+#include "ignite/portable/portable.h"
+
+namespace ignite
+{
+    namespace impl
+    {
+        /**
+         * Input operation.
+         */
+        class InputOperation
+        {
+        public:
+            /**
+             * Destructor.
+             */
+            virtual ~InputOperation()
+            {
+                // No-op.
+            }
+
+            /**
+             * Process input.
+             *
+             * @param writer Writer.
+             */
+            virtual void ProcessInput(ignite::impl::portable::PortableWriterImpl& writer) = 0;
+        };
+
+        /**
+         * Input operation accepting a single argument.
+         */
+        template<typename T>
+        class In1Operation : public InputOperation
+        {
+        public:
+            /**
+             * Constructor.
+             * 
+             * @param val Value.
+             */
+            In1Operation(const T* val) : val(val)
+            {
+                // No-op.
+            }
+
+            virtual void ProcessInput(ignite::impl::portable::PortableWriterImpl& writer)
+            {
+                writer.WriteTopObject<T>(*val);
+            }
+        private:
+            /** Value. */
+            const T* val; 
+
+            IGNITE_NO_COPY_ASSIGNMENT(In1Operation)
+        };
+
+        /**
+         * Input operation accepting two single objects.
+         */
+        template<typename T1, typename T2>
+        class In2Operation : public InputOperation
+        {
+        public:
+            /**
+             * Constructor.
+             *
+             * @param val1 First value.
+             * @param val2 Second value.
+             */
+            In2Operation(const T1* val1, const T2* val2) : val1(val1), val2(val2)
+            {
+                // No-op.
+            }
+
+            virtual void ProcessInput(ignite::impl::portable::PortableWriterImpl& writer)
+            {
+                writer.WriteTopObject<T1>(*val1);
+                writer.WriteTopObject<T2>(*val2);
+            }
+        private:
+            /** First value. */
+            const T1* val1; 
+
+            /** Second value. */
+            const T2* val2; 
+
+            IGNITE_NO_COPY_ASSIGNMENT(In2Operation)
+        };
+
+        /**
+         * Input operation accepting three single objects.
+         */
+        template<typename T1, typename T2, typename T3>
+        class In3Operation : public InputOperation
+        {
+        public:
+            /**
+             * Constructor.
+             *
+             * @param val1 First value.
+             * @param val2 Second value.
+             * @param val3 Third value.
+             */
+            In3Operation(const T1* val1, const T2* val2, const T3* val3) : val1(val1), val2(val2), val3(val3)
+            {
+                // No-op.
+            }
+
+            virtual void ProcessInput(ignite::impl::portable::PortableWriterImpl& writer)
+            {
+                writer.WriteTopObject<T1>(*val1);
+                writer.WriteTopObject<T2>(*val2);
+                writer.WriteTopObject<T3>(*val3);
+            }
+        private:
+            /** First value. */
+            const T1* val1;
+
+            /** Second value. */
+            const T2* val2;
+
+            /** Third value. */
+            const T3* val3;
+
+            IGNITE_NO_COPY_ASSIGNMENT(In3Operation)
+        };
+
+        /*
+         * Input set operation.
+         */
+        template<typename T>
+        class InSetOperation : public InputOperation
+        {
+        public:
+            /**
+             * Constructor.
+             *
+             * @param val Value.
+             */
+            InSetOperation(const std::set<T>* val) : val(val)
+            {
+                // No-op.
+            }
+
+            virtual void ProcessInput(ignite::impl::portable::PortableWriterImpl& writer)
+            {
+                writer.GetStream()->WriteInt32(static_cast<int32_t>(val->size()));
+
+                for (typename std::set<T>::const_iterator it = val->begin(); it != val->end(); ++it)
+                    writer.WriteTopObject<T>(*it);
+            }
+        private:
+            /** Value. */
+            const std::set<T>* val; 
+
+            IGNITE_NO_COPY_ASSIGNMENT(InSetOperation)
+        };
+
+        /**
+         * Input map operation.
+         */
+        template<typename K, typename V>
+        class InMapOperation : public InputOperation
+        {
+        public:
+            /*
+             * Constructor.
+             *
+             * @param val Value.
+             */
+            InMapOperation(const std::map<K, V>* val) : val(val)
+            {
+                // No-op.
+            }
+
+            virtual void ProcessInput(ignite::impl::portable::PortableWriterImpl& writer)
+            {
+                writer.GetStream()->WriteInt32(static_cast<int32_t>(val->size()));
+
+                for (typename std::map<K, V>::const_iterator it = val->begin(); it != val->end(); ++it) {
+                    writer.WriteTopObject<K>(it->first);
+                    writer.WriteTopObject<V>(it->second);
+                }
+            }
+        private:
+            /** Value. */
+            const std::map<K, V>* val; 
+
+            IGNITE_NO_COPY_ASSIGNMENT(InMapOperation)
+        };
+
+        /**
+         * Cache LocalPeek input operation.
+         */
+        template<typename T>
+        class InCacheLocalPeekOperation : public InputOperation
+        {
+        public:
+            /**
+             * Constructor.
+             *
+             * @param key Key.
+             * @param peekModes Peek modes.
+             */
+            InCacheLocalPeekOperation(const T* key, int32_t peekModes) : key(key), peekModes(peekModes)
+            {
+                // No-op.
+            }
+
+            virtual void ProcessInput(ignite::impl::portable::PortableWriterImpl& writer)
+            {
+                writer.WriteTopObject<T>(*key);
+                writer.GetStream()->WriteInt32(peekModes);
+            }
+        private:
+            /** Key. */
+            const T* key;   
+
+            /** Peek modes. */
+            int32_t peekModes; 
+
+            IGNITE_NO_COPY_ASSIGNMENT(InCacheLocalPeekOperation)
+        };
+
+        /**
+         * Output operation.
+         */
+        class OutputOperation
+        {
+        public:
+            /**
+             * Destructor.
+             */
+            virtual ~OutputOperation()
+            {
+                // No-op.
+            }
+
+            /**
+             * Process output.
+             *
+             * @param reader Reader.
+             */
+            virtual void ProcessOutput(ignite::impl::portable::PortableReaderImpl& reader) = 0;
+        };
+
+        /**
+         * Output operation returning single object.
+         */
+        template<typename T>
+        class Out1Operation : public OutputOperation
+        {
+        public:
+            /**
+             * Constructor.
+             */
+            Out1Operation()
+            {
+                // No-op.
+            }
+
+            virtual void ProcessOutput(ignite::impl::portable::PortableReaderImpl& reader)
+            {
+                val = reader.ReadTopObject<T>();
+            }
+
+            /**
+             * Get value.
+             *
+             * @param Value.
+             */
+            T GetResult()
+            {
+                return val;
+            }
+        private:
+            /** Value. */
+            T val; 
+
+            IGNITE_NO_COPY_ASSIGNMENT(Out1Operation)
+        };
+
+        /**
+         * Output operation returning single object.
+         */
+        template<typename T1, typename T2>
+        class Out2Operation : public OutputOperation
+        {
+        public:
+            /**
+             * Constructor.
+             */
+            Out2Operation()
+            {
+                // No-op.
+            }
+
+            virtual void ProcessOutput(ignite::impl::portable::PortableReaderImpl& reader)
+            {
+                val1 = reader.ReadTopObject<T1>();
+                val2 = reader.ReadTopObject<T2>();
+            }
+
+            /**
+             * Get value 1.
+             *
+             * @param Value 1.
+             */
+            T1& Get1()
+            {
+                return val1;
+            }
+
+            /**
+             * Get value 2.
+             *
+             * @param Value 2.
+             */
+            T2& Get2()
+            {
+                return val2;
+            }
+
+        private:
+            /** Value 1. */
+            T1 val1; 
+            
+            /** Value 2. */
+            T2 val2; 
+
+            IGNITE_NO_COPY_ASSIGNMENT(Out2Operation)
+        };
+        
+        /*
+         * Output map operation.
+         */
+        template<typename T1, typename T2>
+        class OutMapOperation :public OutputOperation
+        {
+        public:
+            /**
+             * Constructor.
+             */
+            OutMapOperation()
+            {
+                // No-op.
+            }
+
+            virtual void ProcessOutput(ignite::impl::portable::PortableReaderImpl& reader)
+            {
+                bool exists = reader.GetStream()->ReadBool();
+
+                if (exists)
+                {
+                    int32_t cnt = reader.GetStream()->ReadInt32();
+
+                    std::map<T1, T2> val0;
+
+                    for (int i = 0; i < cnt; i++) {
+                        T1 t1 = reader.ReadTopObject<T1>();
+                        T2 t2 = reader.ReadTopObject<T2>();
+
+                        val0[t1] = t2;
+                    }
+
+                    val = val0;
+                }
+            }
+
+            /**
+             * Get value.
+             *
+             * @param Value.
+             */
+            std::map<T1, T2> GetResult()
+            {
+                return val;
+            }
+        private:
+            /** Value. */
+            std::map<T1, T2> val;
+
+            IGNITE_NO_COPY_ASSIGNMENT(OutMapOperation)
+        };
+
+        /*
+         * Output query GET ALL operation.
+         */
+        template<typename K, typename V>
+        class OutQueryGetAllOperation : public OutputOperation
+        {
+        public:
+            /**
+             * Constructor.
+             */
+            OutQueryGetAllOperation(std::vector<ignite::cache::CacheEntry<K, V>>* res) : res(res)
+            {
+                // No-op.
+            }
+
+            virtual void ProcessOutput(ignite::impl::portable::PortableReaderImpl& reader)
+            {
+                int32_t cnt = reader.ReadInt32();
+
+                for (int i = 0; i < cnt; i++) 
+                {
+                    K key = reader.ReadTopObject<K>();
+                    V val = reader.ReadTopObject<V>();
+
+                    res->push_back(ignite::cache::CacheEntry<K, V>(key, val));
+                }
+            }
+
+        private:
+            /** Entries. */
+            std::vector<ignite::cache::CacheEntry<K, V>>* res;
+            
+            IGNITE_NO_COPY_ASSIGNMENT(OutQueryGetAllOperation)
+        };
+    }
+}
+
+#endif
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/core/include/ignite/impl/portable/portable_common.h
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/core/include/ignite/impl/portable/portable_common.h b/modules/platform/cpp/core/include/ignite/impl/portable/portable_common.h
new file mode 100644
index 0000000..622cb54
--- /dev/null
+++ b/modules/platform/cpp/core/include/ignite/impl/portable/portable_common.h
@@ -0,0 +1,146 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _IGNITE_IMPL_PORTABLE_COMMON
+#define _IGNITE_IMPL_PORTABLE_COMMON
+
+#include <stdint.h>
+
+namespace ignite
+{    
+    namespace impl
+    {
+        namespace portable
+        {
+            /** Header: null. */
+            const int8_t IGNITE_HDR_NULL = 101;
+
+            /** Header: handle. */
+            const int8_t IGNITE_HDR_HND = 102;
+
+            /** Header: fulle form. */
+            const int8_t IGNITE_HDR_FULL = 103;
+
+            /** Full header length. */
+            const int32_t IGNITE_FULL_HDR_LEN = 18;
+
+            /** Type: object. */
+            const int8_t IGNITE_TYPE_OBJECT = IGNITE_HDR_FULL;
+
+            /** Type: unsigned byte. */
+            const int8_t IGNITE_TYPE_BYTE = 1;
+
+            /** Type: short. */
+            const int8_t IGNITE_TYPE_SHORT = 2;
+
+            /** Type: int. */
+            const int8_t IGNITE_TYPE_INT = 3;
+
+            /** Type: long. */
+            const int8_t IGNITE_TYPE_LONG = 4;
+
+            /** Type: float. */
+            const int8_t IGNITE_TYPE_FLOAT = 5;
+
+            /** Type: double. */
+            const int8_t IGNITE_TYPE_DOUBLE = 6;
+
+            /** Type: char. */
+            const int8_t IGNITE_TYPE_CHAR = 7;
+
+            /** Type: boolean. */
+            const int8_t IGNITE_TYPE_BOOL = 8;
+
+            /** Type: decimal. */
+            const int8_t IGNITE_TYPE_DECIMAL = 30;
+
+            /** Type: string. */
+            const int8_t IGNITE_TYPE_STRING = 9;
+
+            /** Type: UUID. */
+            const int8_t IGNITE_TYPE_UUID = 10;
+
+            /** Type: date. */
+            const int8_t IGNITE_TYPE_DATE = 11;
+
+            /** Type: unsigned byte array. */
+            const int8_t IGNITE_TYPE_ARRAY_BYTE = 12;
+
+            /** Type: short array. */
+            const int8_t IGNITE_TYPE_ARRAY_SHORT = 13;
+
+            /** Type: int array. */
+            const int8_t IGNITE_TYPE_ARRAY_INT = 14;
+
+            /** Type: long array. */
+            const int8_t IGNITE_TYPE_ARRAY_LONG = 15;
+
+            /** Type: float array. */
+            const int8_t IGNITE_TYPE_ARRAY_FLOAT = 16;
+
+            /** Type: double array. */
+            const int8_t IGNITE_TYPE_ARRAY_DOUBLE = 17;
+
+            /** Type: char array. */
+            const int8_t IGNITE_TYPE_ARRAY_CHAR = 18;
+
+            /** Type: boolean array. */
+            const int8_t IGNITE_TYPE_ARRAY_BOOL = 19;
+
+            /** Type: decimal array. */
+            const int8_t IGNITE_TYPE_ARRAY_DECIMAL = 31;
+
+            /** Type: string array. */
+            const int8_t IGNITE_TYPE_ARRAY_STRING = 20;
+
+            /** Type: UUID array. */
+            const int8_t IGNITE_TYPE_ARRAY_UUID = 21;
+
+            /** Type: date array. */
+            const int8_t IGNITE_TYPE_ARRAY_DATE = 22;
+
+            /** Type: object array. */
+            const int8_t IGNITE_TYPE_ARRAY = 23;
+
+            /** Type: collection. */
+            const int8_t IGNITE_TYPE_COLLECTION = 24;
+
+            /** Type: map. */
+            const int8_t IGNITE_TYPE_MAP = 25;
+
+            /** Type: map entry. */
+            const int8_t IGNITE_TYPE_MAP_ENTRY = 26;
+
+            /** Type: portable object. */
+            const int8_t IGNITE_TYPE_PORTABLE = 27;
+
+            /** Read/write single object. */
+            const int32_t IGNITE_PORTABLE_MODE_SINGLE = 0;
+
+            /** Read/write array. */
+            const int32_t IGNITE_PORTABLE_MODE_ARRAY = 1;
+
+            /** Read/write collection. */
+            const int32_t IGNITE_PORTABLE_MODE_COL = 2;
+
+            /** Read/write map. */
+            const int32_t IGNITE_PORTABLE_MODE_MAP = 3;
+        }
+    }    
+}
+
+#endif
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/core/include/ignite/impl/portable/portable_id_resolver.h
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/core/include/ignite/impl/portable/portable_id_resolver.h b/modules/platform/cpp/core/include/ignite/impl/portable/portable_id_resolver.h
new file mode 100644
index 0000000..d8f7883
--- /dev/null
+++ b/modules/platform/cpp/core/include/ignite/impl/portable/portable_id_resolver.h
@@ -0,0 +1,106 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _IGNITE_IMPL_PORTABLE_ID_RESOLVER
+#define _IGNITE_IMPL_PORTABLE_ID_RESOLVER
+
+#include "ignite/portable/portable_type.h"
+
+namespace ignite
+{
+    namespace impl
+    {
+        namespace portable
+        {
+            /**
+             * Portable type id resolver.
+             */
+            class PortableIdResolver
+            {
+            public:
+                /**
+                 * Destructor.
+                 */
+                virtual ~PortableIdResolver()
+                {
+                    // No-op.
+                }
+
+                /**
+                 * Get portable object type ID.
+                 *
+                 * @return Type ID.
+                 */
+                virtual int32_t GetTypeId() = 0;
+
+                /**
+                 * Get portable object field ID.
+                 *
+                 * @param typeId Type ID.
+                 * @param name Field name.
+                 * @return Field ID.
+                 */
+                virtual int32_t GetFieldId(const int32_t typeId, const char* name) = 0;
+            };
+
+            /**
+             * Templated portable type descriptor.
+             */
+            template<typename T>
+            class TemplatedPortableIdResolver : public PortableIdResolver
+            {
+            public:
+                /**
+                 * Constructor.
+                 */
+                TemplatedPortableIdResolver()
+                {
+                    type = ignite::portable::PortableType<T>();
+                }
+
+                /**
+                 * Constructor.
+                 *
+                 * @param type Portable type.
+                 */
+                TemplatedPortableIdResolver(ignite::portable::PortableType<T> type) : type(type)
+                {
+                    // No-op.
+                }
+
+                virtual int32_t GetTypeId()
+                {
+                    return type.GetTypeId();
+                }
+
+                virtual int32_t GetFieldId(const int32_t typeId, const char* name) {
+                    if (!name)
+                    {
+                        IGNITE_ERROR_1(IgniteError::IGNITE_ERR_PORTABLE, "Field name cannot be NULL.");
+                    }
+
+                    return type.GetFieldId(name);
+                }
+            private:
+                /** Actual type.  */
+                ignite::portable::PortableType<T> type; 
+            };
+        }
+    }
+}
+
+#endif
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/core/include/ignite/impl/portable/portable_metadata_handler.h
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/core/include/ignite/impl/portable/portable_metadata_handler.h b/modules/platform/cpp/core/include/ignite/impl/portable/portable_metadata_handler.h
new file mode 100644
index 0000000..a557129
--- /dev/null
+++ b/modules/platform/cpp/core/include/ignite/impl/portable/portable_metadata_handler.h
@@ -0,0 +1,102 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _IGNITE_IMPL_PORTABLE_METADATA_HANDLER
+#define _IGNITE_IMPL_PORTABLE_METADATA_HANDLER
+
+#include <ignite/common/concurrent.h>
+
+#include "ignite/impl/portable/portable_metadata_snapshot.h"
+
+namespace ignite
+{    
+    namespace impl
+    {
+        namespace portable
+        {
+            /**
+             * Metadata handler. Tracks all metadata updates during write session.
+             */
+            class PortableMetadataHandler 
+            {
+            public:
+                /**
+                 * Constructor.
+                 *
+                 * @param snap Snapshot.
+                 */
+                PortableMetadataHandler(SPSnap snap);
+                
+                /**
+                 * Destructor.
+                 */
+                ~PortableMetadataHandler();
+
+                /**
+                 * Callback invoked when field is being written.
+                 *
+                 * @param fieldId Field ID.
+                 * @param fieldName Field name.
+                 * @param fieldTypeId Field type ID.
+                 */
+                void OnFieldWritten(int32_t fieldId, std::string fieldName, int32_t fieldTypeId);
+
+                /**
+                 * Get initial snapshot.
+                 *
+                 * @param Snapshot.
+                 */
+                SPSnap GetSnapshot();
+
+                /**
+                 * Whether any difference exists.
+                 *
+                 * @param True if difference exists.
+                 */
+                bool HasDifference();
+
+                /**
+                 * Get recorded field IDs difference.
+                 *
+                 * @param Recorded field IDs difference.
+                 */
+                std::set<int32_t>* GetFieldIds();
+
+                /**
+                 * Get recorded fields difference.
+                 *
+                 * @param Recorded fields difference.
+                 */
+                std::map<std::string, int32_t>* GetFields();
+
+            private:
+                /** Snapshot. */
+                SPSnap snap;                          
+
+                /** Recorded field IDs difference. */
+                std::set<int32_t>* fieldIds;           
+                
+                /** Recorded fields difference. */
+                std::map<std::string, int32_t>* fields; 
+
+                IGNITE_NO_COPY_ASSIGNMENT(PortableMetadataHandler)
+            };
+        }
+    }    
+}
+
+#endif
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/core/include/ignite/impl/portable/portable_metadata_manager.h
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/core/include/ignite/impl/portable/portable_metadata_manager.h b/modules/platform/cpp/core/include/ignite/impl/portable/portable_metadata_manager.h
new file mode 100644
index 0000000..3e2b770
--- /dev/null
+++ b/modules/platform/cpp/core/include/ignite/impl/portable/portable_metadata_manager.h
@@ -0,0 +1,120 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _IGNITE_IMPL_PORTABLE_METADATA_MANAGER
+#define _IGNITE_IMPL_PORTABLE_METADATA_MANAGER
+
+#include <vector>
+
+#include "ignite/ignite_error.h"
+#include "ignite/impl/portable/portable_metadata_handler.h"
+#include "ignite/impl/portable/portable_metadata_updater.h"
+
+namespace ignite
+{    
+    namespace impl
+    {
+        namespace portable
+        {
+            /**
+             * Metadata manager.
+             */
+            class IGNITE_IMPORT_EXPORT PortableMetadataManager
+            {
+            public:
+                /**
+                 * Constructor.
+                 */
+                PortableMetadataManager();
+
+                /**
+                 * Destructor.
+                 */
+                ~PortableMetadataManager();
+
+                /**
+                 * Get handler.
+                 *
+                 * @param typeId Type ID.
+                 */
+                ignite::common::concurrent::SharedPointer<PortableMetadataHandler> GetHandler(int32_t typeId);
+
+                /**
+                 * Submit handler for processing.
+                 * 
+                 * @param typeName Type name.
+                 * @param typeId Type ID.
+                 * @param hnd Handler.
+                 */
+                void SubmitHandler(std::string typeName, int32_t typeId, PortableMetadataHandler* hnd);
+
+                /**
+                 * Get current metadata manager version.
+                 *
+                 * @param Version.
+                 */
+                int32_t GetVersion();
+
+                /**
+                 * Check whether something is updated since the given version.
+                 *
+                 * @param oldVer Old version.
+                 * @return True if updated and it is very likely that pending metadata exists.
+                 */
+                bool IsUpdatedSince(int32_t oldVer);
+
+                /**
+                 * Process pending updates.
+                 *
+                 * @param updated Updater.
+                 * @param err Error.
+                 * @return In case of success.
+                 */
+                bool ProcessPendingUpdates(PortableMetadataUpdater* updater, IgniteError* err);
+
+            private:
+                /** Current snapshots. */
+                ignite::common::concurrent::SharedPointer<std::map<int32_t, SPSnap>> snapshots;
+                
+                /** Pending snapshots. */
+                std::vector<SPSnap>* pending;                                          
+
+                /** Critical section. */
+                ignite::common::concurrent::CriticalSection* cs;
+
+                /** Version of pending changes. */
+                int32_t pendingVer;                                                    
+                
+                /** Latest version. */
+                int32_t ver;          
+
+                IGNITE_NO_COPY_ASSIGNMENT(PortableMetadataManager);
+
+                /**
+                 * Copy fields from a snapshot into relevant collections.
+                 *
+                 * @param snap Target snapshot.
+                 * @param fieldIds Field IDs.
+                 * @param fields Fields.
+                 */
+                void CopyFields(Snap* snap, std::set<int32_t>* fieldIds, std::map<std::string, int32_t>* fields);
+            };
+        }
+    }    
+}
+
+#endif
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/core/include/ignite/impl/portable/portable_metadata_snapshot.h
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/core/include/ignite/impl/portable/portable_metadata_snapshot.h b/modules/platform/cpp/core/include/ignite/impl/portable/portable_metadata_snapshot.h
new file mode 100644
index 0000000..1e000fc
--- /dev/null
+++ b/modules/platform/cpp/core/include/ignite/impl/portable/portable_metadata_snapshot.h
@@ -0,0 +1,122 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _IGNITE_IMPL_PORTABLE_METADATA_SNAPSHOT
+#define _IGNITE_IMPL_PORTABLE_METADATA_SNAPSHOT
+
+#include <map>
+#include <set>
+#include <stdint.h>
+#include <string>
+
+#include <ignite/common/common.h>
+#include <ignite/common/concurrent.h>
+
+namespace ignite
+{    
+    namespace impl
+    {
+        namespace portable
+        {
+            /**
+             * Metadata snapshot. 
+             */
+            class PortableMetadataSnapshot
+            {
+            public:
+                /**
+                 * Constructor.
+                 *
+                 * @param typeName Type name.
+                 * @param typeId Type ID.
+                 * @param fieldIds Field IDs.
+                 * @param fields Fields.
+                 */
+                PortableMetadataSnapshot(std::string typeName, int32_t typeId, std::set<int32_t>* fieldIds, 
+                    std::map<std::string, int32_t>* fields);
+                
+                /**
+                 * Destructor.
+                 */
+                ~PortableMetadataSnapshot();
+
+                /**
+                 * Check whether snapshot contains a field with the given ID.
+                 *
+                 * @param fieldId Field ID.
+                 * @return True if contains, false otherwise.
+                 */
+                bool ContainsFieldId(int32_t fieldId);
+
+                /**
+                 * Get type name.
+                 *
+                 * @param Type name.
+                 */
+                std::string GetTypeName();
+
+                /**
+                 * Get type ID.
+                 *
+                 * @return Type ID.
+                 */
+                int32_t GetTypeId();
+
+                /**
+                 * Whether snapshot contains any fields.
+                 *
+                 * @param True if fields exist.
+                 */
+                bool HasFields();
+
+                /** 
+                 * Get field IDs.
+                 *
+                 * @param Field IDs.
+                 */
+                std::set<int32_t>* GetFieldIds();
+
+                /**
+                 * Get fields.
+                 *
+                 * @return Fields.
+                 */
+                std::map<std::string, int32_t>* GetFields();
+
+            private:
+                /** Type name. */
+                std::string typeName;                   
+                
+                /** Type ID. */
+                int32_t typeId;
+
+                /** Known field IDs. */
+                std::set<int32_t>* fieldIds;
+
+                /** Field name-type mappings. */
+                std::map<std::string, int32_t>* fields; 
+
+                IGNITE_NO_COPY_ASSIGNMENT(PortableMetadataSnapshot)
+            };
+
+            typedef PortableMetadataSnapshot Snap;
+            typedef ignite::common::concurrent::SharedPointer<Snap> SPSnap;
+        }
+    }    
+}
+
+#endif
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/core/include/ignite/impl/portable/portable_metadata_updater.h
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/core/include/ignite/impl/portable/portable_metadata_updater.h b/modules/platform/cpp/core/include/ignite/impl/portable/portable_metadata_updater.h
new file mode 100644
index 0000000..a734db7
--- /dev/null
+++ b/modules/platform/cpp/core/include/ignite/impl/portable/portable_metadata_updater.h
@@ -0,0 +1,53 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _IGNITE_IMPL_PORTABLE_METADATA_UPDATER
+#define _IGNITE_IMPL_PORTABLE_METADATA_UPDATER
+
+#include "ignite/ignite_error.h"
+#include "ignite/impl/portable/portable_metadata_snapshot.h"
+
+namespace ignite
+{    
+    namespace impl
+    {
+        namespace portable
+        {
+            /**
+             * Metadata updater interface.
+             */
+            class IGNITE_IMPORT_EXPORT PortableMetadataUpdater
+            {
+            public:
+                /**
+                 * Destructor.
+                 */
+                virtual ~PortableMetadataUpdater();
+
+                /**
+                 * Update metadata using provided snapshot.
+                 *
+                 * @param snapshot Snapshot.
+                 * @param err Error.
+                 */
+                virtual bool Update(Snap* snapshot, IgniteError* err) = 0;
+            };
+        }
+    }    
+}
+
+#endif
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/core/include/ignite/impl/portable/portable_metadata_updater_impl.h
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/core/include/ignite/impl/portable/portable_metadata_updater_impl.h b/modules/platform/cpp/core/include/ignite/impl/portable/portable_metadata_updater_impl.h
new file mode 100644
index 0000000..832c2a3
--- /dev/null
+++ b/modules/platform/cpp/core/include/ignite/impl/portable/portable_metadata_updater_impl.h
@@ -0,0 +1,65 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _IGNITE_IMPL_PORTABLE_METADATA_UPDATER_IMPL
+#define _IGNITE_IMPL_PORTABLE_METADATA_UPDATER_IMPL
+
+#include <ignite/common/exports.h>
+
+#include "ignite/impl/ignite_environment.h"
+#include "ignite/impl/portable/portable_metadata_updater.h"
+
+namespace ignite
+{    
+    namespace impl
+    {
+        namespace portable
+        {
+            /**
+             * Metadata updater implementation.
+             */
+            class IGNITE_IMPORT_EXPORT PortableMetadataUpdaterImpl : public PortableMetadataUpdater
+            {
+            public:
+                /**
+                 * Constructor.
+                 *
+                 * @param env Environment.
+                 * @param javaRef Reference to Java object which is able to process metadata request.
+                 */
+                PortableMetadataUpdaterImpl(ignite::common::concurrent::SharedPointer<IgniteEnvironment> env, jobject javaRef);
+
+                /**
+                 * Destructor.
+                 */
+                ~PortableMetadataUpdaterImpl();
+
+                bool Update(Snap* snapshot, IgniteError* err);
+            private:
+                /** Environment. */
+                ignite::common::concurrent::SharedPointer<IgniteEnvironment> env;
+                
+                /** Handle to Java object. */
+                jobject javaRef;                 
+
+                IGNITE_NO_COPY_ASSIGNMENT(PortableMetadataUpdaterImpl)
+            };
+        }
+    }    
+}
+
+#endif
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/core/include/ignite/impl/portable/portable_reader_impl.h
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/core/include/ignite/impl/portable/portable_reader_impl.h b/modules/platform/cpp/core/include/ignite/impl/portable/portable_reader_impl.h
new file mode 100644
index 0000000..7d82aa2
--- /dev/null
+++ b/modules/platform/cpp/core/include/ignite/impl/portable/portable_reader_impl.h
@@ -0,0 +1,1130 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _IGNITE_IMPL_PORTABLE_READER
+#define _IGNITE_IMPL_PORTABLE_READER
+
+#include <stdint.h>
+
+#include <ignite/common/common.h>
+
+#include "ignite/impl/interop/interop_input_stream.h"
+#include "ignite/impl/portable/portable_common.h"
+#include "ignite/impl/portable/portable_id_resolver.h"
+#include "ignite/impl/portable/portable_utils.h"
+#include "ignite/impl/utils.h"
+#include "ignite/portable/portable_consts.h"
+#include "ignite/portable/portable_type.h"
+#include "ignite/guid.h"
+
+namespace ignite
+{
+    namespace impl
+    {
+        namespace portable
+        {
+            /**
+             * Internal implementation of portable reader.
+             */
+            class IGNITE_IMPORT_EXPORT PortableReaderImpl
+            {
+            public:
+                /**
+                 * Constructor.
+                 *
+                 * @param stream Interop stream.
+                 * @param idRslvr Portable ID resolver.
+                 * @param pos Object position in the stream.
+                 * @param usrType user type flag.
+                 * @param typeId Type ID.
+                 * @param hashcode Hash code.
+                 * @param len Length in bytes.
+                 * @param rawOff Raw data offset.
+                 */
+                PortableReaderImpl(interop::InteropInputStream* stream, PortableIdResolver* idRslvr,                     
+                    int32_t pos, bool usrType, int32_t typeId, int32_t hashCode, int32_t len, int32_t rawOff);
+
+                /**
+                 * Constructor used to construct light-weight reader allowing only raw operations 
+                 * and read of primitives.
+                 *
+                 * @param stream Interop stream.
+                 */
+                PortableReaderImpl(interop::InteropInputStream* stream);
+
+                /**
+                 * Read 8-byte signed integer. Maps to "byte" type in Java.
+                 *
+                 * @return Result.
+                 */
+                int8_t ReadInt8();
+
+                /**
+                 * Read array of 8-byte signed integers. Maps to "byte[]" type in Java.
+                 *
+                 * @param res Array to store data to.
+                 * @param len Expected length of array.
+                 * @return Actual amount of elements read. If "len" argument is less than actual
+                 *     array size or resulting array is set to null, nothing will be written
+                 *     to resulting array and returned value will contain required array length.
+                 *     -1 will be returned in case array in stream was null.
+                 */
+                int32_t ReadInt8Array(int8_t* res, const int32_t len);
+
+                /**
+                 * Read 8-byte signed integer. Maps to "byte" type in Java.
+                 *
+                 * @param fieldName Field name.
+                 * @return Result.
+                 */
+                int8_t ReadInt8(const char* fieldName);
+
+                /**
+                 * Read array of 8-byte signed integers. Maps to "byte[]" type in Java.
+                 *
+                 * @param fieldName Field name.
+                 * @param res Array to store data to.
+                 * @param len Expected length of array.                 
+                 * @return Actual amount of elements read. If "len" argument is less than actual
+                 *     array size or resulting array is set to null, nothing will be written
+                 *     to resulting array and returned value will contain required array length.
+                 *     -1 will be returned in case array in stream was null.
+                 */
+                int32_t ReadInt8Array(const char* fieldName, int8_t* res, const int32_t len);
+
+                /**
+                 * Read bool. Maps to "boolean" type in Java.
+                 *
+                 * @return Result.
+                 */
+                bool ReadBool();
+
+                /**
+                 * Read bool array. Maps to "boolean[]" type in Java.
+                 *
+                 * @param res Array to store data to.
+                 * @param len Expected length of array.                 
+                 * @return Actual amount of elements read. If "len" argument is less than actual
+                 *     array size or resulting array is set to null, nothing will be written
+                 *     to resulting array and returned value will contain required array length.
+                 *     -1 will be returned in case array in stream was null.
+                 */
+                int32_t ReadBoolArray(bool* res, const int32_t len);
+
+                /**
+                 * Read bool. Maps to "short" type in Java.
+                 *
+                 * @param fieldName Field name.
+                 * @return Result.
+                 */
+                bool ReadBool(const char* fieldName);
+
+                /**
+                 * Read bool array. Maps to "bool[]" type in Java.
+                 *
+                 * @param fieldName Field name.
+                 * @param res Array to store data to.
+                 * @param len Expected length of array.                 
+                 * @return Actual amount of elements read. If "len" argument is less than actual
+                 *     array size or resulting array is set to null, nothing will be written
+                 *     to resulting array and returned value will contain required array length.
+                 *     -1 will be returned in case array in stream was null.
+                 */
+                int32_t ReadBoolArray(const char* fieldName, bool* res, const int32_t len);
+
+                /**
+                 * Read 16-byte signed integer. Maps to "short" type in Java.
+                 *
+                 * @return Result.
+                 */
+                int16_t ReadInt16();
+
+                /**
+                 * Read array of 16-byte signed integers. Maps to "short[]" type in Java.
+                 *
+                 * @param res Array to store data to.
+                 * @param len Expected length of array.                 
+                 * @return Actual amount of elements read. If "len" argument is less than actual
+                 *     array size or resulting array is set to null, nothing will be written
+                 *     to resulting array and returned value will contain required array length.
+                 *     -1 will be returned in case array in stream was null.
+                 */
+                int32_t ReadInt16Array(int16_t* res, const int32_t len);
+
+                /**
+                 * Read 16-byte signed integer. Maps to "short" type in Java.
+                 *
+                 * @param fieldName Field name.
+                 * @return Result.
+                 */
+                int16_t ReadInt16(const char* fieldName);
+
+                /**
+                 * Read array of 16-byte signed integers. Maps to "short[]" type in Java.
+                 *
+                 * @param fieldName Field name.
+                 * @param res Array to store data to.
+                 * @param len Expected length of array.                 
+                 * @return Actual amount of elements read. If "len" argument is less than actual
+                 *     array size or resulting array is set to null, nothing will be written
+                 *     to resulting array and returned value will contain required array length.
+                 *      -1 will be returned in case array in stream was null.
+                 */
+                int32_t ReadInt16Array(const char* fieldName, int16_t* res, const int32_t len);
+
+                /**
+                 * Read 16-byte unsigned integer. Maps to "char" type in Java.
+                 *
+                 * @return Result.
+                 */
+                uint16_t ReadUInt16();
+
+                /**
+                 * Read array of 16-byte unsigned integers. Maps to "char[]" type in Java.
+                 *
+                 * @param res Array to store data to.
+                 * @param len Expected length of array.                 
+                 * @return Actual amount of elements read. If "len" argument is less than actual
+                 *     array size or resulting array is set to null, nothing will be written
+                 *     to resulting array and returned value will contain required array length.
+                 *     -1 will be returned in case array in stream was null.
+                 */
+                int32_t ReadUInt16Array(uint16_t* res, const int32_t len);
+
+                /**
+                 * Read 16-byte unsigned integer. Maps to "char" type in Java.
+                 *
+                 * @param fieldName Field name.
+                 * @return Result.
+                 */
+                uint16_t ReadUInt16(const char* fieldName);
+
+                /**
+                 * Read array of 16-byte unsigned integers. Maps to "char[]" type in Java.
+                 *
+                 * @param fieldName Field name.
+                 * @param res Array to store data to.
+                 * @param len Expected length of array.                 
+                 * @return Actual amount of elements read. If "len" argument is less than actual
+                 *     array size or resulting array is set to null, nothing will be written
+                 *     to resulting array and returned value will contain required array length.
+                 *     -1 will be returned in case array in stream was null.
+                 */
+                int32_t ReadUInt16Array(const char* fieldName, uint16_t* res, const int32_t len);
+
+                /**
+                 * Read 32-byte signed integer. Maps to "int" type in Java.
+                 *
+                 * @return Result.
+                 */
+                int32_t ReadInt32();
+
+                /**
+                 * Read array of 32-byte signed integers. Maps to "int[]" type in Java.
+                 *
+                 * @param res Array to store data to.
+                 * @param len Expected length of array.                 
+                 * @return Actual amount of elements read. If "len" argument is less than actual
+                 *     array size or resulting array is set to null, nothing will be written
+                 *     to resulting array and returned value will contain required array length.
+                 *     -1 will be returned in case array in stream was null.
+                 */
+                int32_t ReadInt32Array(int32_t* res, const int32_t len);
+
+                /**
+                 * Read 32-byte signed integer. Maps to "int" type in Java.
+                 *
+                 * @param fieldName Field name.
+                 * @return Result.
+                 */
+                int32_t ReadInt32(const char* fieldName);
+
+                /**
+                 * Read array of 32-byte signed integers. Maps to "int[]" type in Java.
+                 *
+                 * @param fieldName Field name.
+                 * @param res Array to store data to.
+                 * @param len Expected length of array.                 
+                 * @return Actual amount of elements read. If "len" argument is less than actual
+                 *     array size or resulting array is set to null, nothing will be written
+                 *     to resulting array and returned value will contain required array length.
+                 *     -1 will be returned in case array in stream was null.
+                 */
+                int32_t ReadInt32Array(const char* fieldName, int32_t* res, const int32_t len);
+
+                /**
+                 * Read 64-byte signed integer. Maps to "long" type in Java.
+                 *
+                 * @return Result.
+                 */
+                int64_t ReadInt64();
+
+                /**
+                 * Read array of 64-byte signed integers. Maps to "long[]" type in Java.
+                 *
+                 * @param res Array to store data to.
+                 * @param len Expected length of array.                 
+                 * @return Actual amount of elements read. If "len" argument is less than actual
+                 *     array size or resulting array is set to null, nothing will be written
+                 *     to resulting array and returned value will contain required array length.
+                 *     -1 will be returned in case array in stream was null.
+                 */
+                int32_t ReadInt64Array(int64_t* res, const int32_t len);
+
+                /**
+                 * Read 64-byte signed integer. Maps to "long" type in Java.
+                 *
+                 * @param fieldName Field name.
+                 * @return Result.
+                 */
+                int64_t ReadInt64(const char* fieldName);
+
+                /**
+                 * Read array of 64-byte signed integers. Maps to "long[]" type in Java.
+                 *
+                 * @param fieldName Field name.
+                 * @param res Array to store data to.
+                 * @param len Expected length of array.                 
+                 * @return Actual amount of elements read. If "len" argument is less than actual
+                 *     array size or resulting array is set to null, nothing will be written
+                 *     to resulting array and returned value will contain required array length.
+                 *     -1 will be returned in case array in stream was null.
+                 */
+                int32_t ReadInt64Array(const char* fieldName, int64_t* res, const int32_t len);
+
+                /**
+                 * Read float. Maps to "float" type in Java.
+                 *
+                 * @return Result.
+                 */
+                float ReadFloat();
+
+                /**
+                 * Read float array. Maps to "float[]" type in Java.
+                 *
+                 * @param res Array to store data to.
+                 * @param len Expected length of array.                 
+                 * @return Actual amount of elements read. If "len" argument is less than actual
+                 *     array size or resulting array is set to null, nothing will be written
+                 *     to resulting array and returned value will contain required array length.
+                 *     -1 will be returned in case array in stream was null.
+                 */
+                int32_t ReadFloatArray(float* res, const int32_t len);
+
+                /**
+                 * Read float. Maps to "float" type in Java.
+                 *
+                 * @param fieldName Field name.
+                 * @return Result.
+                 */
+                float ReadFloat(const char* fieldName);
+
+                /**
+                 * Read float array. Maps to "float[]" type in Java.
+                 *
+                 * @param fieldName Field name.
+                 * @param res Array to store data to.
+                 * @param len Expected length of array.                 
+                 * @return Actual amount of elements read. If "len" argument is less than actual
+                 *     array size or resulting array is set to null, nothing will be written
+                 *     to resulting array and returned value will contain required array length.
+                 *     -1 will be returned in case array in stream was null.
+                 */
+                int32_t ReadFloatArray(const char* fieldName, float* res, const int32_t len);
+
+                /**
+                 * Read double. Maps to "double" type in Java.
+                 *
+                 * @return Result.
+                 */
+                double ReadDouble();
+                
+                /**
+                 * Read double array. Maps to "double[]" type in Java.
+                 *
+                 * @param res Array to store data to.
+                 * @param len Expected length of array.                 
+                 * @return Actual amount of elements read. If "len" argument is less than actual
+                 *     array size or resulting array is set to null, nothing will be written
+                 *     to resulting array and returned value will contain required array length.
+                 *     -1 will be returned in case array in stream was null.
+                 */
+                int32_t ReadDoubleArray(double* res, const int32_t len);
+
+                /**
+                 * Read double. Maps to "double" type in Java.
+                 *
+                 * @param fieldName Field name.
+                 * @return Result.
+                 */
+                double ReadDouble(const char* fieldName);
+
+                /**
+                 * Read double array. Maps to "double[]" type in Java.
+                 *
+                 * @param fieldName Field name.
+                 * @param res Array to store data to.
+                 * @param len Expected length of array.                 
+                 * @return Actual amount of elements read. If "len" argument is less than actual
+                 *     array size or resulting array is set to null, nothing will be written
+                 *     to resulting array and returned value will contain required array length.
+                 *     -1 will be returned in case array in stream was null.
+                 */
+                int32_t ReadDoubleArray(const char* fieldName, double* res, const int32_t len);
+
+                /**
+                 * Read Guid. Maps to "UUID" type in Java.
+                 *
+                 * @return Result.
+                 */
+                Guid ReadGuid();
+
+                /**
+                 * Read array of Guids. Maps to "UUID[]" type in Java.
+                 *
+                 * @param res Array to store data to.
+                 * @param len Expected length of array.                 
+                 * @return Actual amount of elements read. If "len" argument is less than actual
+                 *     array size or resulting array is set to null, nothing will be written
+                 *     to resulting array and returned value will contain required array length.
+                 *     -1 will be returned in case array in stream was null.
+                 */
+                int32_t ReadGuidArray(Guid* res, const int32_t len);
+
+                /**
+                 * Read Guid. Maps to "UUID" type in Java.
+                 *
+                 * @param fieldName Field name.
+                 * @return Result.
+                 */
+                Guid ReadGuid(const char* fieldName);
+
+                /**
+                 * Read array of Guids. Maps to "UUID[]" type in Java.
+                 *
+                 * @param fieldName Field name.
+                 * @param res Array to store data to.
+                 * @param len Expected length of array.                 
+                 * @return Actual amount of elements read. If "len" argument is less than actual
+                 *     array size or resulting array is set to null, nothing will be written
+                 *     to resulting array and returned value will contain required array length.
+                 *     -1 will be returned in case array in stream was null.
+                 */
+                int32_t ReadGuidArray(const char* fieldName, Guid* res, const int32_t len);
+
+                /**
+                 * Read string.
+                 *
+                 * @param len Expected length of string.
+                 * @param res Array to store data to (should be able to acocmodate null-terminator).
+                 * @return Actual amount of elements read. If "len" argument is less than actual
+                 *     array size or resulting array is set to null, nothing will be written
+                 *     to resulting array and returned value will contain required array length.
+                 *     -1 will be returned in case array in stream was null.
+                 */
+                int32_t ReadString(char* res, const int32_t len);
+
+                /**
+                 * Read string.
+                 *
+                 * @param fieldName Field name.                 
+                 * @param res Array to store data to (should be able to acocmodate null-terminator).
+                 * @param len Expected length of string.
+                 * @return Actual amount of elements read. If "len" argument is less than actual
+                 *     array size or resulting array is set to null, nothing will be written
+                 *     to resulting array and returned value will contain required array length.
+                 *     -1 will be returned in case array in stream was null.
+                 */
+                int32_t ReadString(const char* fieldName, char* res, const int32_t len);
+                
+                /**
+                 * Start string array read.
+                 *
+                 * @param size Array size.
+                 * @return Read session ID.
+                 */
+                int32_t ReadStringArray(int32_t* size);
+
+                /**
+                 * Start string array read.
+                 *
+                 * @param fieldName Field name.
+                 * @param size Array size.
+                 * @return Read session ID.
+                 */
+                int32_t ReadStringArray(const char* fieldName, int32_t* size);
+
+                /**
+                 * Read string element.
+                 *
+                 * @param id Session ID.
+                 * @param len Expected length of string.
+                 * @param res Array to store data to (should be able to acocmodate null-terminator).
+                 * @return Actual amount of elements read. If "len" argument is less than actual
+                 *     array size or resulting array is set to null, nothing will be written
+                 *     to resulting array and returned value will contain required array length.
+                 *     -1 will be returned in case array in stream was null.
+                 */
+                int32_t ReadStringElement(int32_t id, char* res, const int32_t len);
+
+                /**
+                 * Start array read.
+                 *
+                 * @param size Array size.
+                 * @return Read session ID.
+                 */
+                int32_t ReadArray(int32_t* size);
+
+                /**
+                 * Start array read.
+                 *
+                 * @param fieldName Field name.
+                 * @param size Array size.
+                 * @return Read session ID.
+                 */
+                int32_t ReadArray(const char* fieldName, int32_t* size);
+
+                /**
+                 * Start collection read.
+                 *
+                 * @param typ Collection type.
+                 * @param size Collection size.
+                 * @return Read session ID.
+                 */
+                int32_t ReadCollection(ignite::portable::CollectionType* typ, int32_t* size);
+
+                /**
+                 * Start collection read.
+                 *
+                 * @param fieldName Field name.
+                 * @param typ Collection type.
+                 * @param size Collection size.
+                 * @return Read session ID.
+                 */
+                int32_t ReadCollection(const char* fieldName, ignite::portable::CollectionType* typ, int32_t* size);
+
+                /**
+                 * Start map read.
+                 *
+                 * @param typ Map type.
+                 * @param size Map size.
+                 * @return Read session ID.
+                 */
+                int32_t ReadMap(ignite::portable::MapType* typ, int32_t* size);
+
+                /**
+                 * Start map read.
+                 *
+                 * @param fieldName Field name.
+                 * @param typ Map type.
+                 * @param size Map size.
+                 * @return Read session ID.
+                 */
+                int32_t ReadMap(const char* fieldName, ignite::portable::MapType* typ, int32_t* size);
+
+                /**
+                 * Check whether next value exists.
+                 *
+                 * @param id Session ID.
+                 * @return True if next element exists for the given session.
+                 */
+                bool HasNextElement(int32_t id);
+
+                /**
+                 * Read element.
+                 *
+                 * @param id Session ID.
+                 * @return Value.
+                 */
+                template<typename T>
+                T ReadElement(const int32_t id)
+                {
+                    CheckSession(id);
+
+                    if (++elemRead == elemCnt) {
+                        elemId = 0;
+                        elemCnt = -1;
+                        elemRead = 0;
+                    }
+
+                    return ReadTopObject<T>();
+                }
+
+                /**
+                 * Read element.
+                 *
+                 * @param id Session ID.
+                 * @param key Key.
+                 * @param val Value.
+                 */
+                template<typename K, typename V>
+                void ReadElement(const int32_t id, K* key, V* val)
+                {
+                    CheckSession(id);
+
+                    if (++elemRead == elemCnt) {
+                        elemId = 0;
+                        elemCnt = -1;
+                        elemRead = 0;
+                    }
+
+                    *key = ReadTopObject<K>();
+                    *val = ReadTopObject<V>();
+                }
+                
+                /**
+                 * Read object.
+                 *
+                 * @return Object.
+                 */
+                template<typename T>
+                T ReadObject()
+                {
+                    CheckRawMode(true);
+
+                    return ReadTopObject<T>();
+                }
+
+                /**
+                 * Read object.
+                 *
+                 * @param fieldName Field name.
+                 * @return Object.
+                 */
+                template<typename T>
+                T ReadObject(const char* fieldName)
+                {
+                    CheckRawMode(false);
+
+                    int32_t fieldId = idRslvr->GetFieldId(typeId, fieldName); 
+                        
+                    int32_t fieldLen = SeekField(fieldId); 
+                        
+                    if (fieldLen > 0) 
+                        return ReadTopObject<T>();
+                    
+                    return GetNull<T>();
+                }
+
+                /**
+                 * Set raw mode.
+                 */
+                void SetRawMode();
+
+                /**
+                 * Read object.
+                 *
+                 * @param obj Object to write.
+                 */
+                template<typename T>
+                T ReadTopObject()
+                {
+                    int32_t pos = stream->Position();
+                    int8_t hdr = stream->ReadInt8();
+
+                    if (hdr == IGNITE_HDR_NULL)
+                        return GetNull<T>();
+                    else if (hdr == IGNITE_HDR_HND) {
+                        IGNITE_ERROR_1(ignite::IgniteError::IGNITE_ERR_PORTABLE, "Circular references are not supported.");
+                    }
+                    else if (hdr == IGNITE_TYPE_PORTABLE)
+                    {
+                        int32_t portLen = stream->ReadInt32(); // Total length of portable object.
+                        int32_t curPos = stream->Position();
+                        int32_t portOff = stream->ReadInt32(curPos + portLen);
+
+                        stream->Position(curPos + portOff); // Position stream right on the object.
+
+                        T val = ReadTopObject<T>();
+
+                        stream->Position(curPos + portLen + 4); // Position stream after portable.
+
+                        return val;
+                    }
+                    else
+                    {
+                        bool usrType = stream->ReadBool();
+                        int32_t typeId = stream->ReadInt32();
+                        int32_t hashCode = stream->ReadInt32();
+                        int32_t len = stream->ReadInt32();
+                        int32_t rawOff = stream->ReadInt32();
+
+                        ignite::portable::PortableType<T> type;
+                        TemplatedPortableIdResolver<T> idRslvr(type);
+                        PortableReaderImpl readerImpl(stream, &idRslvr, pos, usrType, typeId, hashCode, len, rawOff);
+                        ignite::portable::PortableReader reader(&readerImpl);
+
+                        T val = type.Read(reader);
+
+                        stream->Position(pos + len);
+
+                        return val;
+                    }
+                }
+
+                /**
+                 * Get NULL value for the given type.
+                 */
+                template<typename T>
+                T GetNull()
+                {
+                    ignite::portable::PortableType<T> type;
+
+                    return type.GetNull();
+                }
+
+                /**
+                 * Get underlying stream.
+                 *
+                 * @return Stream.
+                 */
+                impl::interop::InteropInputStream* GetStream();
+            private:
+                /** Underlying stream. */
+                interop::InteropInputStream* stream;   
+                
+                /** ID resolver. */
+                PortableIdResolver* idRslvr;           
+
+                /** Position in the stream where this object starts. */
+                int32_t pos;       
+                
+                /** Whether this is user type or system type. */
+                bool usrType;      
+                
+                /** Type ID as defined in the stream. */
+                int32_t typeId;    
+                
+                /** Hash code. */
+                int32_t hashCode;  
+                
+                /** Total object length in the stream. */
+                int32_t len;       
+                
+                /** Raw data offset. */
+                int32_t rawOff;    
+
+                /** Raw mode flag. */
+                bool rawMode;      
+
+                /** Elements read session ID generator. */
+                int32_t elemIdGen; 
+                
+                /** Elements read session ID. */
+                int32_t elemId;    
+                
+                /** Total amount of elements in collection. */
+                int32_t elemCnt;   
+                
+                /** Amount of elements read. */
+                int32_t elemRead;  
+
+                IGNITE_NO_COPY_ASSIGNMENT(PortableReaderImpl)
+
+                /**
+                 * Internal routine to read Guid array.
+                 *
+                 * @param stream Stream.
+                 * @param res Resulting array.
+                 * @param len Length.
+                 */
+                static void ReadGuidArrayInternal(
+                    interop::InteropInputStream* stream, 
+                    Guid* res,
+                    const int32_t len
+                );
+
+                /**
+                 * Read single value in raw mode.
+                 * 
+                 * @param stream Stream.
+                 * @param func Function to be invoked on stream.
+                 * @return Result.
+                 */
+                template<typename T>
+                T ReadRaw(
+                    T(*func) (interop::InteropInputStream*)
+                )
+                {
+                    {
+                        CheckRawMode(true);
+                        CheckSingleMode(true);
+
+                        return func(stream);
+                    }
+                }
+
+                /**
+                 * Read single value.
+                 *
+                 * @param fieldName Field name.
+                 * @param func Function to be invoked on stream.
+                 * @param epxHdr Expected header.
+                 * @param dflt Default value returned if field is not found.
+                 * @return Result.
+                 */
+                template<typename T>
+                T Read(
+                    const char* fieldName, 
+                    T(*func) (interop::InteropInputStream*), 
+                    const int8_t expHdr, 
+                    T dflt
+                )
+                {
+                    {
+                        CheckRawMode(false);
+                        CheckSingleMode(true);
+
+                        int32_t fieldId = idRslvr->GetFieldId(typeId, fieldName);
+                        int32_t fieldLen = SeekField(fieldId);
+
+                        if (fieldLen > 0)
+                        {
+                            int8_t typeId = stream->ReadInt8();
+
+                            if (typeId == expHdr)
+                                return func(stream);
+                            else if (typeId != IGNITE_HDR_NULL)
+                            {
+                                int32_t pos = stream->Position();
+
+                                IGNITE_ERROR_FORMATTED_3(IgniteError::IGNITE_ERR_PORTABLE, "Invalid type ID", 
+                                    "position", pos, "expected", expHdr, "actual", typeId)
+                            }
+                        }
+
+                        return dflt;
+                    }
+                }
+
+                /**
+                 * Read array in raw mode.
+                 *
+                 * @param res Resulting array.
+                 * @param len Length.                 
+                 * @param func Function to be invoked on stream.
+                 * @param expHdr Expected header.
+                 * @return Length.
+                 */
+                template<typename T>
+                int32_t ReadRawArray(
+                    T* res,
+                    const int32_t len,
+                    void(*func)(interop::InteropInputStream*, T* const, const int32_t),
+                    const int8_t expHdr
+                )
+                {
+                    {
+                        CheckRawMode(true);
+                        CheckSingleMode(true);
+
+                        return ReadArrayInternal(res, len, stream, func, expHdr);
+                    }
+                }
+
+                /**
+                 * Read array.
+                 *
+                 * @param fieldName Field name.
+                 * @param res Resulting array.
+                 * @param len Length.
+                 * @param func Function to be invoked on stream.
+                 * @param expHdr Expected header.
+                 * @return Length.
+                 */
+                template<typename T>
+                int32_t ReadArray(
+                    const char* fieldName,
+                    T* res,
+                    const int32_t len,                    
+                    void(*func)(interop::InteropInputStream*, T* const, const int32_t),
+                    const int8_t expHdr
+                )
+                {
+                    {
+                        CheckRawMode(false);
+                        CheckSingleMode(true);
+
+                        int32_t pos = stream->Position();
+
+                        int32_t fieldId = idRslvr->GetFieldId(typeId, fieldName);
+                        int32_t fieldLen = SeekField(fieldId);
+
+                        if (fieldLen > 0) {
+                            int32_t realLen = ReadArrayInternal(res, len, stream, func, expHdr);
+
+                            // If actual read didn't occur return to initial position so that we do not perform 
+                            // N jumps to find the field again, where N is total amount of fields.
+                            if (realLen != -1 && (!res || realLen > len))
+                                stream->Position(pos);
+
+                            return realLen;
+                        }
+
+                        return -1;
+                    }
+                }
+
+                /**
+                 * Internal read array routine.
+                 *
+                 * @param res Resulting array.
+                 * @param len Length.                 
+                 * @param stream Stream.
+                 * @param func Function to be invoked on stream.
+                 * @param expHdr Expected header.
+                 * @return Length.
+                 */
+                template<typename T>
+                static int32_t ReadArrayInternal(
+                    T* res,
+                    const int32_t len,
+                    interop::InteropInputStream* stream,
+                    void(*func)(interop::InteropInputStream*, T* const, const int32_t),
+                    const int8_t expHdr
+                )
+                {
+                    {
+                        int8_t hdr = stream->ReadInt8();
+
+                        if (hdr == expHdr)
+                        {
+                            int32_t realLen = stream->ReadInt32();
+
+                            if (realLen == 0 || (res && len >= realLen))
+                                func(stream, res, realLen);
+                            else
+                                stream->Position(stream->Position() - 5);
+
+                            return realLen;
+                        }
+                        else if (hdr != IGNITE_HDR_NULL)
+                            ThrowOnInvalidHeader(stream->Position() - 1, expHdr, hdr);
+
+                        return -1;
+                    }
+                }
+
+                /**
+                 * Read nullable value.
+                 *
+                 * @param stream Stream.
+                 * @param func Function to be invoked on stream.
+                 * @param expHdr Expected header.
+                 */
+                template<typename T>
+                static T ReadNullable(
+                    interop::InteropInputStream* stream,
+                    T(*func)(interop::InteropInputStream*), 
+                    const int8_t expHdr
+                )
+                {
+                    {
+                        int8_t hdr = stream->ReadInt8();
+
+                        if (hdr == expHdr)
+                            return func(stream);
+                        else if (hdr == IGNITE_HDR_NULL)
+                            return Guid();
+                        else {
+                            ThrowOnInvalidHeader(stream->Position() - 1, expHdr, hdr);
+
+                            return Guid();
+                        }
+                    }
+                }
+
+                /**
+                 * Seek field with the given ID.
+                 *
+                 * @param fieldId Field ID.
+                 * @return Field length or -1 if field is not found.
+                 */
+                int32_t SeekField(const int32_t fieldId);
+
+                /**
+                 * Check raw mode.
+                 * 
+                 * @param expected Expected raw mode of the reader.
+                 */
+                void CheckRawMode(bool expected);
+
+                /**
+                 * Check whether reader is currently operating in single mode.
+                 *
+                 * @param expected Expected value.
+                 */
+                void CheckSingleMode(bool expected);
+
+                /**
+                 * Start new container reader session.
+                 *
+                 * @param expRawMode Expected raw mode.
+                 * @param expHdr Expected header.
+                 * @param size Container size.
+                 * @return Session ID.
+                 */
+                int32_t StartContainerSession(const bool expRawMode, const int8_t expHdr, int32_t* size);
+
+                /**
+                 * Check whether session ID matches.
+                 *
+                 * @param ses Expected session ID.
+                 */
+                void CheckSession(int32_t expSes);
+
+                /**
+                 * Throw an error due to invalid header.
+                 *
+                 * @param pos Position in the stream.
+                 * @param expHdr Expected header.
+                 * @param hdr Actual header.
+                 */
+                static void ThrowOnInvalidHeader(int32_t pos, int8_t expHdr, int8_t hdr);
+
+                /**
+                 * Throw an error due to invalid header.
+                 *
+                 * @param expHdr Expected header.
+                 * @param hdr Actual header.
+                 */
+                void ThrowOnInvalidHeader(int8_t expHdr, int8_t hdr);
+
+                /**
+                 * Internal string read routine.
+                 *
+                 * @param res Resulting array.
+                 * @param len Length of array.
+                 * @return Real array length.
+                 */
+                int32_t ReadStringInternal(char* res, const int32_t len);
+
+                /**
+                 * Read value.
+                 *
+                 * @param expHdr Expected header.
+                 * @param func Function to be applied to the stream.
+                 */
+                template<typename T>
+                T ReadTopObject0(const int8_t expHdr, T(*func) (ignite::impl::interop::InteropInputStream*))
+                {
+                    int8_t typeId = stream->ReadInt8();
+
+                    if (typeId == expHdr)
+                        return func(stream);
+                    else if (typeId == IGNITE_HDR_NULL)
+                        return GetNull<T>();
+                    else {
+                        int32_t pos = stream->Position() - 1;
+
+                        IGNITE_ERROR_FORMATTED_3(IgniteError::IGNITE_ERR_PORTABLE, "Invalid header", "position", pos, "expected", expHdr, "actual", typeId)
+                    }
+                }
+
+                /**
+                 * Read value.
+                 *
+                 * @param expHdr Expected header.
+                 * @param func Function to be applied to the stream.
+                 * @param dflt Default value.
+                 */
+                template<typename T>
+                T ReadTopObject0(const int8_t expHdr, T(*func) (ignite::impl::interop::InteropInputStream*), T dflt)
+                {
+                    int8_t typeId = stream->ReadInt8();
+
+                    if (typeId == expHdr)
+                        return func(stream);
+                    else if (typeId == IGNITE_HDR_NULL)
+                        return dflt;
+                    else {
+                        int32_t pos = stream->Position() - 1;
+
+                        IGNITE_ERROR_FORMATTED_3(IgniteError::IGNITE_ERR_PORTABLE, "Invalid header", "position", pos, "expected", expHdr, "actual", typeId)
+                    }
+                }
+            };
+
+            template<>
+            int8_t IGNITE_IMPORT_EXPORT PortableReaderImpl::ReadTopObject<int8_t>();
+
+            template<>
+            bool IGNITE_IMPORT_EXPORT PortableReaderImpl::ReadTopObject<bool>();
+
+            template<>
+            int16_t IGNITE_IMPORT_EXPORT PortableReaderImpl::ReadTopObject<int16_t>();
+
+            template<>
+            uint16_t IGNITE_IMPORT_EXPORT PortableReaderImpl::ReadTopObject<uint16_t>();
+
+            template<>
+            int32_t IGNITE_IMPORT_EXPORT PortableReaderImpl::ReadTopObject<int32_t>();
+
+            template<>
+            int64_t IGNITE_IMPORT_EXPORT PortableReaderImpl::ReadTopObject<int64_t>();
+
+            template<>
+            float IGNITE_IMPORT_EXPORT PortableReaderImpl::ReadTopObject<float>();
+
+            template<>
+            double IGNITE_IMPORT_EXPORT PortableReaderImpl::ReadTopObject<double>();
+
+            
+            template<>
+            Guid IGNITE_IMPORT_EXPORT PortableReaderImpl::ReadTopObject<Guid>();
+
+            template<>
+            inline std::string IGNITE_IMPORT_EXPORT PortableReaderImpl::ReadTopObject<std::string>()
+            {
+                int8_t typeId = stream->ReadInt8();
+
+                if (typeId == IGNITE_TYPE_STRING)
+                {
+                    bool utf8Mode = stream->ReadBool();
+                    int32_t realLen = stream->ReadInt32();
+
+                    ignite::impl::utils::SafeArray<char> arr(realLen + 1);
+
+                    if (utf8Mode)
+                    {
+                        for (int i = 0; i < realLen; i++)
+                            *(arr.target + i) = static_cast<char>(stream->ReadInt8());
+                    }
+                    else
+                    {
+                        for (int i = 0; i < realLen; i++)
+                            *(arr.target + i) = static_cast<char>(stream->ReadUInt16());
+                    }
+
+                    *(arr.target + realLen) = 0;
+
+                    return std::string(arr.target);
+                }
+
+                else if (typeId == IGNITE_HDR_NULL)
+                    return std::string();
+                else {
+                    int32_t pos = stream->Position() - 1;
+
+                    IGNITE_ERROR_FORMATTED_3(IgniteError::IGNITE_ERR_PORTABLE, "Invalid header", "position", pos, "expected", IGNITE_TYPE_STRING, "actual", typeId)
+                }
+            }
+        }
+    }
+}
+
+#endif
\ No newline at end of file


[27/28] ignite git commit: IGNITE-1513: Moved CPP.

Posted by vo...@apache.org.
http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/common/os/linux/include/ignite/common/concurrent_os.h
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/common/os/linux/include/ignite/common/concurrent_os.h b/modules/platform/cpp/common/os/linux/include/ignite/common/concurrent_os.h
new file mode 100644
index 0000000..63798b1
--- /dev/null
+++ b/modules/platform/cpp/common/os/linux/include/ignite/common/concurrent_os.h
@@ -0,0 +1,394 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _IGNITE_COMMON_CONCURRENT_OS
+#define _IGNITE_COMMON_CONCURRENT_OS
+
+#include <map>
+#include <stdint.h>
+#include <pthread.h>
+
+#include "ignite/common/common.h"
+
+namespace ignite
+{
+    namespace common
+    {
+        namespace concurrent
+        {
+            /**
+             * Static class to manage memory visibility semantics. 
+             */
+            class IGNITE_IMPORT_EXPORT Memory {
+            public:
+                /**
+                 * Full fence. 
+                 */
+                static void Fence();
+            };
+
+            /**
+             * Critical section.
+             */
+            class IGNITE_IMPORT_EXPORT CriticalSection {
+            public:
+                /**
+                 * Constructor.
+                 */
+                CriticalSection();
+
+                /**
+                 * Destructor. 
+                 */
+                ~CriticalSection();
+
+                /**
+                 * Enter critical section.
+                 */
+                void Enter();
+
+                /**
+                 * Leave critical section.
+                 */
+                void Leave();
+            private:
+                pthread_mutex_t mux;
+                
+                IGNITE_NO_COPY_ASSIGNMENT(CriticalSection)
+            };
+
+            /**
+             * Special latch with count = 1.
+             */
+            class IGNITE_IMPORT_EXPORT SingleLatch
+            {                
+            public:
+                /**
+                 * Constructor.
+                 */
+                SingleLatch();
+
+                /**
+                 * Destructor.
+                 */
+                ~SingleLatch();
+
+                /**
+                 * Perform the countdown.
+                 */
+                void CountDown();
+
+                /**
+                 * Await the countdown.
+                 */
+                void Await();
+            private:
+                /** Mutex. */
+                pthread_mutex_t mux;
+
+                /** Condition. */
+                pthread_cond_t cond;
+
+                /** Ready flag. */
+                bool ready;
+                
+                IGNITE_NO_COPY_ASSIGNMENT(SingleLatch)
+            };
+
+            /**
+             * Primitives for atomic access.
+             */
+            class IGNITE_IMPORT_EXPORT Atomics
+            {
+            public:
+                /**
+                 * Update the 32-bit integer value if it is equal to expected value.
+                 *
+                 * @param ptr Pointer.
+                 * @param expVal Expected value.
+                 * @param newVal New value.
+                 * @return True if update occurred as a result of this call, false otherwise.
+                 */
+                static bool CompareAndSet32(int32_t* ptr, int32_t expVal, int32_t newVal);
+
+                /**
+                 * Update the 32-bit integer value if it is equal to expected value.
+                 *
+                 * @param ptr Pointer.
+                 * @param expVal Expected value.
+                 * @param newVal New value.
+                 * @return Value which were observed during CAS attempt.
+                 */
+                static int32_t CompareAndSet32Val(int32_t* ptr, int32_t expVal, int32_t newVal);
+
+                /**
+                 * Increment 32-bit integer and return new value.
+                 *
+                 * @param ptr Pointer.
+                 * @return Value after increment.
+                 */
+                static int32_t IncrementAndGet32(int32_t* ptr);
+
+                /**
+                 * Decrement 32-bit integer and return new value.
+                 *
+                 * @param ptr Pointer.
+                 * @return Value after decrement.
+                 */
+                static int32_t DecrementAndGet32(int32_t* ptr);
+
+                /**
+                 * Update the 64-bit integer value if it is equal to expected value.
+                 *
+                 * @param ptr Pointer.
+                 * @param expVal Expected value.
+                 * @param newVal New value.
+                 * @return True if update occurred as a result of this call, false otherwise.
+                 */
+                static bool CompareAndSet64(int64_t* ptr, int64_t expVal, int64_t newVal);
+
+                /**
+                 * Update the 64-bit integer value if it is equal to expected value.
+                 *
+                 * @param ptr Pointer.
+                 * @param expVal Expected value.
+                 * @param newVal New value.
+                 * @return Value which were observed during CAS attempt.
+                 */
+                static int64_t CompareAndSet64Val(int64_t* ptr, int64_t expVal, int64_t newVal);
+
+                /**
+                 * Increment 64-bit integer and return new value.
+                 *
+                 * @param ptr Pointer.
+                 * @return Value after increment.
+                 */
+                static int64_t IncrementAndGet64(int64_t* ptr);
+
+                /**
+                 * Decrement 64-bit integer and return new value.
+                 *
+                 * @param ptr Pointer.
+                 * @return Value after decrement.
+                 */
+                static int64_t DecrementAndGet64(int64_t* ptr);
+            };
+
+            /**
+             * Thread-local entry.
+             */
+            class IGNITE_IMPORT_EXPORT ThreadLocalEntry
+            {
+            public:
+                /**
+                 * Virtual destructor to allow for correct typed entries cleanup.
+                 */
+                virtual ~ThreadLocalEntry()
+                {
+                    // No-op.
+                }
+            };
+
+            /**
+             * Typed thread-local entry.
+             */
+            template<typename T>
+            class IGNITE_IMPORT_EXPORT ThreadLocalTypedEntry : public ThreadLocalEntry
+            {
+            public:
+                /**
+                 * Constructor.
+                 *
+                 * @param val Value.
+                 */
+                ThreadLocalTypedEntry(T val) : val(val)
+                {
+                    // No-op.
+                }
+
+                ~ThreadLocalTypedEntry()
+                {
+                    // No-op.
+                }
+
+                /**
+                 * Get value.
+                 *
+                 * @return Value.
+                 */
+                T Get()
+                {
+                    return val;
+                }
+            private:
+                /** Value. */
+                T val;
+            };
+
+            /**
+             * Thread-local abstraction.
+             */
+            class IGNITE_IMPORT_EXPORT ThreadLocal
+            {
+            public:
+                /**
+                 * Get next available index to be used in thread-local storage.
+                 *
+                 * @return Index.
+                 */
+                static int32_t NextIndex();
+
+                /**
+                 * Get value by index.
+                 *
+                 * @param idx Index.
+                 * @return Value associated with the index or NULL.
+                 */
+                template<typename T>
+                static T Get(int32_t idx)
+                {
+                    void* linuxVal = Get0();
+
+                    if (linuxVal)
+                    {
+                        std::map<int32_t, ThreadLocalEntry*>* map =
+                            static_cast<std::map<int32_t, ThreadLocalEntry*>*>(linuxVal);
+
+                        ThreadLocalTypedEntry<T>* entry = static_cast<ThreadLocalTypedEntry<T>*>((*map)[idx]);
+
+                        if (entry)
+                            return entry->Get();
+                    }
+
+                    return T();
+                }
+
+                /**
+                 * Set value at the given index.
+                 *
+                 * @param idx Index.
+                 * @param val Value to be associated with the index.
+                 */
+                template<typename T>
+                static void Set(int32_t idx, const T& val)
+                {
+                    void* linuxVal = Get0();
+
+                    if (linuxVal)
+                    {
+                        std::map<int32_t, ThreadLocalEntry*>* map =
+                            static_cast<std::map<int32_t, ThreadLocalEntry*>*>(linuxVal);
+
+                        ThreadLocalEntry* appVal = (*map)[idx];
+
+                        if (appVal)
+                            delete appVal;
+
+                        (*map)[idx] = new ThreadLocalTypedEntry<T>(val);
+                    }
+                    else
+                    {
+                        std::map<int32_t, ThreadLocalEntry*>* map = new std::map<int32_t, ThreadLocalEntry*>();
+
+                        Set0(map);
+
+                        (*map)[idx] = new ThreadLocalTypedEntry<T>(val);
+                    }
+                }
+
+                /**
+                 * Remove value at the given index.
+                 *
+                 * @param idx Index.
+                 */
+                static void Remove(int32_t idx);
+
+                /**
+                 * Internal thread-local map clear routine.
+                 *
+                 * @param mapPtr Pointer to map.
+                 */
+                static void Clear0(void* mapPtr);
+
+            private:
+                /**
+                 * Internal get routine.
+                 *
+                 * @param Associated value.
+                 */
+                static void* Get0();
+
+                /**
+                 * Internal set routine.
+                 *
+                 * @param ptr Pointer.
+                 */
+                static void Set0(void* ptr);
+            };
+
+            /**
+             * Thread-local instance. Simplifies API avoiding direct index allocations.
+             */
+            template<typename T>
+            class IGNITE_IMPORT_EXPORT ThreadLocalInstance
+            {
+            public:
+                /**
+                 * Constructor.
+                 */
+                ThreadLocalInstance() : idx(ThreadLocal::NextIndex())
+                {
+                    // No-op.
+                }
+
+                /**
+                 * Get value.
+                 *
+                 * @return Value.
+                 */
+                T Get()
+                {
+                    return ThreadLocal::Get<T>(idx);
+                }
+
+                /**
+                 * Set instance.
+                 *
+                 * @param val Value.
+                 */
+                void Set(const T& val)
+                {
+                    ThreadLocal::Set<T>(idx, val);
+                }
+
+                /**
+                 * Remove instance.
+                 */
+                void Remove()
+                {
+                    ThreadLocal::Remove(idx);
+                }
+
+            private:
+                /** Index. */
+                int32_t idx;
+            };
+        }
+    }
+}
+
+#endif
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/common/os/linux/src/common.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/common/os/linux/src/common.cpp b/modules/platform/cpp/common/os/linux/src/common.cpp
new file mode 100644
index 0000000..c0cccdc
--- /dev/null
+++ b/modules/platform/cpp/common/os/linux/src/common.cpp
@@ -0,0 +1,59 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#include <pthread.h>
+
+#include "ignite/common/common.h"
+#include "ignite/common/java.h"
+
+using namespace ignite::common::java;
+
+namespace ignite
+{
+    namespace common
+    {
+        /** Key indicating that the thread is attached. */
+        static pthread_key_t attachKey;
+
+        /** Helper to ensure that attach key is allocated only once. */
+        static pthread_once_t attachKeyInit = PTHREAD_ONCE_INIT;
+        
+        AttachHelper::~AttachHelper()
+        {
+            JniContext::Detach();
+        }
+        
+        void AttachHelper::OnThreadAttach()
+        {
+            pthread_once(&attachKeyInit, AllocateAttachKey);
+            
+            void* val = pthread_getspecific(attachKey);
+            
+            if (!val)
+                pthread_setspecific(attachKey, new AttachHelper());
+        }
+        
+        void AttachHelper::AllocateAttachKey()
+        {
+            pthread_key_create(&attachKey, DestroyAttachKey);
+        }   
+        
+        void AttachHelper::DestroyAttachKey(void* key)
+        {
+            delete reinterpret_cast<AttachHelper*>(key);
+        }             
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/common/os/linux/src/concurrent_os.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/common/os/linux/src/concurrent_os.cpp b/modules/platform/cpp/common/os/linux/src/concurrent_os.cpp
new file mode 100644
index 0000000..44f0b22
--- /dev/null
+++ b/modules/platform/cpp/common/os/linux/src/concurrent_os.cpp
@@ -0,0 +1,175 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "ignite/common/concurrent_os.h"
+
+namespace ignite
+{
+    namespace common
+    {
+        namespace concurrent
+        {
+            /** Key indicating that the thread is attached. */
+            static pthread_key_t tlsKey;
+
+            /** Helper to ensure that attach key is allocated only once. */
+            static pthread_once_t tlsKeyInit = PTHREAD_ONCE_INIT;
+            
+            /**
+             * Routine to destroy TLS key.
+             * 
+             * @param key Key.
+             */
+            void DestroyTlsKey(void* key) {
+                ThreadLocal::Clear0(key);
+            }
+            
+            /**
+             * Routine to allocate TLS key.
+             */
+            void AllocateTlsKey() {
+                pthread_key_create(&tlsKey, DestroyTlsKey);
+            }
+            
+            void Memory::Fence() {
+                __asm__ volatile ("" ::: "memory");
+            }
+
+            CriticalSection::CriticalSection() {
+                pthread_mutex_init(&mux, NULL);
+                
+                Memory::Fence();
+            }
+
+            CriticalSection::~CriticalSection() {
+                Memory::Fence();
+                
+                pthread_mutex_destroy(&mux);
+            }
+
+            void CriticalSection::Enter() {
+                Memory::Fence();
+                
+                pthread_mutex_lock(&mux);
+            }
+
+            void CriticalSection::Leave() {
+                Memory::Fence();
+                
+                pthread_mutex_unlock(&mux);
+            }
+
+            SingleLatch::SingleLatch()
+            {
+                pthread_mutex_init(&mux, NULL);
+                pthread_cond_init(&cond, NULL);
+                ready = false;
+                
+                Memory::Fence();
+            }
+
+            SingleLatch::~SingleLatch()
+            {
+                Memory::Fence();
+
+                pthread_cond_destroy(&cond);
+                pthread_mutex_destroy(&mux);
+            }
+
+            void SingleLatch::CountDown()
+            {
+                pthread_mutex_lock(&mux);
+                
+                if (!ready) {
+                    ready = true;
+                    
+                    pthread_cond_broadcast(&cond);
+                }
+                
+                pthread_mutex_unlock(&mux);
+                
+                Memory::Fence();
+            }
+
+            void SingleLatch::Await()
+            {
+                pthread_mutex_lock(&mux);
+                
+                while (!ready)
+                    pthread_cond_wait(&cond, &mux);
+                
+                pthread_mutex_unlock(&mux);
+                
+                Memory::Fence();
+            }
+
+            bool Atomics::CompareAndSet32(int32_t* ptr, int32_t expVal, int32_t newVal)
+            {
+                return __sync_bool_compare_and_swap(ptr, expVal, newVal);
+            }
+
+            int32_t Atomics::CompareAndSet32Val(int32_t* ptr, int32_t expVal, int32_t newVal)
+            {
+                return __sync_val_compare_and_swap(ptr, expVal, newVal);
+            }
+
+            int32_t Atomics::IncrementAndGet32(int32_t* ptr)
+            {
+               return __sync_fetch_and_add(ptr, 1) + 1;
+            }
+
+            int32_t Atomics::DecrementAndGet32(int32_t* ptr)
+            {
+               return __sync_fetch_and_sub(ptr, 1) - 1;
+            }
+
+            bool Atomics::CompareAndSet64(int64_t* ptr, int64_t expVal, int64_t newVal)
+            {
+               return __sync_bool_compare_and_swap(ptr, expVal, newVal);
+            }
+
+            int64_t Atomics::CompareAndSet64Val(int64_t* ptr, int64_t expVal, int64_t newVal)
+            {
+               return __sync_val_compare_and_swap(ptr, expVal, newVal);
+            }
+
+            int64_t Atomics::IncrementAndGet64(int64_t* ptr)
+            {
+               return __sync_fetch_and_add(ptr, 1) + 1;
+            }
+
+            int64_t Atomics::DecrementAndGet64(int64_t* ptr)
+            {
+               return __sync_fetch_and_sub(ptr, 1) - 1;
+            }
+
+            void* ThreadLocal::Get0()
+            {
+                pthread_once(&tlsKeyInit, AllocateTlsKey);
+                                
+                return pthread_getspecific(tlsKey);
+            }
+
+            void ThreadLocal::Set0(void* ptr)
+            {
+                pthread_once(&tlsKeyInit, AllocateTlsKey);
+                
+                pthread_setspecific(tlsKey, ptr);
+            }
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/common/os/win/include/ignite/common/common.h
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/common/os/win/include/ignite/common/common.h b/modules/platform/cpp/common/os/win/include/ignite/common/common.h
new file mode 100644
index 0000000..9e57bde
--- /dev/null
+++ b/modules/platform/cpp/common/os/win/include/ignite/common/common.h
@@ -0,0 +1,56 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#ifndef _IGNITE_COMMON_COMMON
+#define _IGNITE_COMMON_COMMON
+
+#define IGNITE_EXPORT __declspec(dllexport)
+#define IGNITE_IMPORT __declspec(dllimport)
+#define IGNITE_CALL __stdcall
+
+#define IGNITE_IMPORT_EXPORT IGNITE_EXPORT
+
+#include <iostream>
+
+#define IGNITE_TRACE_ALLOC(addr) \
+    std::cout << "ALLOC " << __FILE__ << "(" << __LINE__ << "): 0x" << (void*)addr << std::endl;
+
+/**
+ * Common construction to disable copy constructor and assignment for class.
+ */
+#define IGNITE_NO_COPY_ASSIGNMENT(cls) \
+    cls(const cls& src); \
+    cls& operator= (const cls& other); 
+
+namespace ignite
+{
+    namespace common
+    {
+        /**
+         * Helper class to manage attached threads.
+         */
+        class AttachHelper 
+        {
+        public:                       
+            /**
+             * Callback invoked on successful thread attach ot JVM.
+             */
+            static void OnThreadAttach();
+        };   
+    }
+}
+
+#endif
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/common/os/win/include/ignite/common/concurrent_os.h
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/common/os/win/include/ignite/common/concurrent_os.h b/modules/platform/cpp/common/os/win/include/ignite/common/concurrent_os.h
new file mode 100644
index 0000000..0a47beb
--- /dev/null
+++ b/modules/platform/cpp/common/os/win/include/ignite/common/concurrent_os.h
@@ -0,0 +1,406 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _IGNITE_COMMON_CONCURRENT_OS
+#define _IGNITE_COMMON_CONCURRENT_OS
+
+#include <map>
+#include <stdint.h>
+#include <windows.h>
+
+#include "ignite/common/common.h"
+
+namespace ignite
+{
+    namespace common 
+    {
+        namespace concurrent 
+        {
+            /**
+             * Static class to manage memory visibility semantics. 
+             */
+            class IGNITE_IMPORT_EXPORT Memory {
+            public:
+                /**
+                 * Full fence. 
+                 */
+                static void Fence();
+            };
+
+            /**
+             * Critical section.
+             */
+            class IGNITE_IMPORT_EXPORT CriticalSection {
+            public:
+                /**
+                 * Constructor.
+                 */
+                CriticalSection();
+
+                /**
+                 * Destructor. 
+                 */
+                ~CriticalSection();
+
+                /**
+                 * Enter critical section.
+                 */
+                void Enter();
+
+                /**
+                 * Leave critical section.
+                 */
+                void Leave();
+            private:
+                /** Handle. */
+                CRITICAL_SECTION* hnd;
+
+                IGNITE_NO_COPY_ASSIGNMENT(CriticalSection)
+            };
+
+            /**
+             * Special latch with count = 1.
+             */
+            class IGNITE_IMPORT_EXPORT SingleLatch
+            {                
+            public:
+                /**
+                 * Constructor.
+                 */
+                SingleLatch();
+
+                /**
+                 * Destructor.
+                 */
+                ~SingleLatch();
+
+                /**
+                 * Perform the countdown.
+                 */
+                void CountDown();
+
+                /**
+                 * Await the countdown.
+                 */
+                void Await();
+            private:
+                /** Handle. */
+                void* hnd;
+
+                IGNITE_NO_COPY_ASSIGNMENT(SingleLatch)
+            };
+
+            /**
+             * Primitives for atomic access.
+             */
+            class IGNITE_IMPORT_EXPORT Atomics
+            {
+            public:
+                /**
+                 * Update the 32-bit integer value if it is equal to expected value.
+                 *
+                 * @param ptr Pointer.
+                 * @param expVal Expected value.
+                 * @param newVal New value.
+                 * @return True if update occurred as a result of this call, false otherwise.
+                 */
+                static bool CompareAndSet32(int32_t* ptr, int32_t expVal, int32_t newVal);
+
+                /**
+                 * Update the 32-bit integer value if it is equal to expected value.
+                 *
+                 * @param ptr Pointer.
+                 * @param expVal Expected value.
+                 * @param newVal New value.
+                 * @return Value which were observed during CAS attempt.
+                 */
+                static int32_t CompareAndSet32Val(int32_t* ptr, int32_t expVal, int32_t newVal);
+                
+                /**
+                 * Increment 32-bit integer and return new value.
+                 *
+                 * @param ptr Pointer.
+                 * @return Value after increment.
+                 */
+                static int32_t IncrementAndGet32(int32_t* ptr);
+
+                /**
+                 * Decrement 32-bit integer and return new value.
+                 *
+                 * @param ptr Pointer.
+                 * @return Value after decrement.
+                 */
+                static int32_t DecrementAndGet32(int32_t* ptr);
+
+                /**
+                 * Update the 64-bit integer value if it is equal to expected value.
+                 *
+                 * @param ptr Pointer.
+                 * @param expVal Expected value.
+                 * @param newVal New value.
+                 * @return True if update occurred as a result of this call, false otherwise.
+                 */
+                static bool CompareAndSet64(int64_t* ptr, int64_t expVal, int64_t newVal);
+
+                /**
+                 * Update the 64-bit integer value if it is equal to expected value.
+                 *
+                 * @param ptr Pointer.
+                 * @param expVal Expected value.
+                 * @param newVal New value.
+                 * @return Value which were observed during CAS attempt.
+                 */
+                static int64_t CompareAndSet64Val(int64_t* ptr, int64_t expVal, int64_t newVal);
+                
+                /**
+                 * Increment 64-bit integer and return new value.
+                 *
+                 * @param ptr Pointer.
+                 * @return Value after increment.
+                 */
+                static int64_t IncrementAndGet64(int64_t* ptr);
+
+                /**
+                 * Decrement 64-bit integer and return new value.
+                 *
+                 * @param ptr Pointer.
+                 * @return Value after decrement.
+                 */
+                static int64_t DecrementAndGet64(int64_t* ptr);
+            };
+
+            /**
+             * Thread-local entry.
+             */
+            class IGNITE_IMPORT_EXPORT ThreadLocalEntry
+            {
+            public:
+                /**
+                 * Virtual destructor to allow for correct typed entries cleanup.
+                 */
+                virtual ~ThreadLocalEntry()
+                {
+                    // No-op.
+                }
+            };
+
+            /**
+             * Typed thread-local entry.
+             */
+            template<typename T>
+            class IGNITE_IMPORT_EXPORT ThreadLocalTypedEntry : public ThreadLocalEntry
+            {
+            public:
+                /**
+                 * Constructor.
+                 *
+                 * @param val Value.
+                 */
+                ThreadLocalTypedEntry(T val) : val(val)
+                {
+                    // No-op.
+                }
+                
+                ~ThreadLocalTypedEntry()
+                {
+                    // No-op.
+                }
+
+                /**
+                 * Get value.
+                 *
+                 * @return Value.
+                 */
+                T Get()
+                {
+                    return val;
+                }
+            private:
+                /** Value. */
+                T val; 
+            };
+
+            /**
+             * Thread-local abstraction.
+             */
+            class IGNITE_IMPORT_EXPORT ThreadLocal
+            {
+            public:
+                /**
+                 * Allocate thread-local index. Invoked once on DLL process attach.
+                 *
+                 * @return True if allocation was successful.
+                 */
+                static bool OnProcessAttach();
+
+                /**
+                 * Release thread-local entry. Invoked on DLL thread detach.
+                 */
+                static void OnThreadDetach();
+
+                /**
+                 * Release thread-local index. Invoked once on DLL process detach.
+                 */
+                static void OnProcessDetach();
+
+                /**
+                 * Get next available index to be used in thread-local storage.
+                 *
+                 * @return Index.
+                 */
+                static int32_t NextIndex();
+
+                /**
+                 * Get value by index.
+                 *
+                 * @param idx Index.
+                 * @return Value associated with the index or NULL.
+                 */
+                template<typename T>
+                static T Get(int32_t idx)
+                {
+                    void* winVal = Get0();
+
+                    if (winVal)
+                    {
+                        std::map<int32_t, ThreadLocalEntry*>* map = 
+                            static_cast<std::map<int32_t, ThreadLocalEntry*>*>(winVal);
+
+                        ThreadLocalTypedEntry<T>* entry = static_cast<ThreadLocalTypedEntry<T>*>((*map)[idx]);
+                        
+                        if (entry)
+                            return entry->Get();
+                    }
+
+                    return T();
+                }
+
+                /**
+                 * Set value at the given index.
+                 *
+                 * @param idx Index.
+                 * @param val Value to be associated with the index.
+                 */
+                template<typename T>
+                static void Set(int32_t idx, const T& val)
+                {
+                    void* winVal = Get0();
+
+                    if (winVal)
+                    {
+                        std::map<int32_t, ThreadLocalEntry*>* map = 
+                            static_cast<std::map<int32_t, ThreadLocalEntry*>*>(winVal);
+
+                        ThreadLocalEntry* appVal = (*map)[idx];
+
+                        if (appVal)
+                            delete appVal;
+
+                        (*map)[idx] = new ThreadLocalTypedEntry<T>(val);
+                    }
+                    else
+                    {
+                        std::map<int32_t, ThreadLocalEntry*>* map = new std::map<int32_t, ThreadLocalEntry*>();
+
+                        Set0(map);
+
+                        (*map)[idx] = new ThreadLocalTypedEntry<T>(val);
+                    }
+                }
+
+                /**
+                 * Remove value at the given index.
+                 *
+                 * @param idx Index.
+                 */
+                static void Remove(int32_t idx);
+
+            private:
+                /**
+                 * Internal get routine.
+                 *
+                 * @param Associated value.
+                 */
+                static void* Get0();
+
+                /**
+                 * Internal set routine.
+                 *
+                 * @param ptr Pointer.
+                 */
+                static void Set0(void* ptr);
+
+                /**
+                 * Internal thread-local map clear routine.
+                 *
+                 * @param mapPtr Pointer to map.
+                 */
+                static void Clear0(void* mapPtr);
+            };
+
+            /**
+             * Thread-local instance. Simplifies API avoiding direct index allocations.
+             */
+            template<typename T>
+            class IGNITE_IMPORT_EXPORT ThreadLocalInstance
+            {
+            public:
+                /**
+                 * Constructor.
+                 */
+                ThreadLocalInstance() : idx(ThreadLocal::NextIndex())
+                {
+                    // No-op.
+                }
+
+                /**
+                 * Get value.
+                 *
+                 * @return Value.
+                 */
+                T Get()
+                {
+                    return ThreadLocal::Get<T>(idx);
+                }
+
+                /**
+                 * Set instance.
+                 *
+                 * @param val Value.
+                 */
+                void Set(const T& val)
+                {
+                    ThreadLocal::Set<T>(idx, val);
+                }
+
+                /**
+                 * Remove instance.
+                 */
+                void Remove()
+                {
+                    ThreadLocal::Remove(idx);
+                }
+
+            private:
+                /** Index. */
+                int32_t idx; 
+            };
+        }
+    }
+}
+
+#endif
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/common/os/win/src/common.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/common/os/win/src/common.cpp b/modules/platform/cpp/common/os/win/src/common.cpp
new file mode 100644
index 0000000..e83e736
--- /dev/null
+++ b/modules/platform/cpp/common/os/win/src/common.cpp
@@ -0,0 +1,65 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <windows.h>
+
+#include "ignite/common/common.h"
+#include "ignite/common/concurrent.h"
+#include "ignite/common/java.h"
+
+using namespace ignite::common::concurrent;
+using namespace ignite::common::java;
+
+namespace ignite
+{
+    namespace common
+    {
+        void AttachHelper::OnThreadAttach()
+        {
+            // No-op.
+        }
+    }
+}
+
+BOOL WINAPI DllMain(_In_ HINSTANCE hinstDLL, _In_ DWORD fdwReason, _In_ LPVOID lpvReserved)
+{
+    switch (fdwReason)
+    {
+        case DLL_PROCESS_ATTACH:
+            if (!ThreadLocal::OnProcessAttach())
+                return FALSE;
+
+            break;
+
+        case DLL_THREAD_DETACH:
+            ThreadLocal::OnThreadDetach();
+
+            JniContext::Detach();
+
+            break;
+
+        case DLL_PROCESS_DETACH:
+            ThreadLocal::OnProcessDetach();
+
+            break;
+
+        default:
+            break;
+    }
+
+    return TRUE;
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/common/os/win/src/concurrent_os.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/common/os/win/src/concurrent_os.cpp b/modules/platform/cpp/common/os/win/src/concurrent_os.cpp
new file mode 100644
index 0000000..a21f7ec
--- /dev/null
+++ b/modules/platform/cpp/common/os/win/src/concurrent_os.cpp
@@ -0,0 +1,151 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "ignite/common/concurrent_os.h"
+
+namespace ignite
+{
+    namespace common
+    {
+        namespace concurrent
+        {
+            /** Thread-local index for Windows. */
+            DWORD winTlsIdx;
+
+            void Memory::Fence() {
+                MemoryBarrier();
+            }
+
+            CriticalSection::CriticalSection() : hnd(new CRITICAL_SECTION) {
+                InitializeCriticalSection(hnd);
+
+                Memory::Fence();
+            }
+
+            CriticalSection::~CriticalSection() {
+                Memory::Fence();
+
+                delete hnd;
+            }
+
+            void CriticalSection::Enter() {
+                Memory::Fence();
+
+                EnterCriticalSection(hnd);
+            }
+
+            void CriticalSection::Leave() {
+                Memory::Fence();
+
+                LeaveCriticalSection(hnd);
+            }
+
+            SingleLatch::SingleLatch() : hnd(CreateEvent(NULL, TRUE, FALSE, NULL))
+            {
+                Memory::Fence();
+            }
+
+            SingleLatch::~SingleLatch()
+            {
+                Memory::Fence();
+
+                CloseHandle(hnd);
+            }
+
+            void SingleLatch::CountDown()
+            {
+                SetEvent(hnd);
+            }
+
+            void SingleLatch::Await()
+            {
+                WaitForSingleObject(hnd, INFINITE);
+            }
+
+            bool Atomics::CompareAndSet32(int32_t* ptr, int32_t expVal, int32_t newVal)
+            {
+                return CompareAndSet32Val(ptr, expVal, newVal) == expVal;
+            }
+
+            int32_t Atomics::CompareAndSet32Val(int32_t* ptr, int32_t expVal, int32_t newVal)
+            {
+                return InterlockedCompareExchange(reinterpret_cast<LONG*>(ptr), newVal, expVal);
+            }
+
+            int32_t Atomics::IncrementAndGet32(int32_t* ptr)
+            {
+                return InterlockedIncrement(reinterpret_cast<LONG*>(ptr));
+            }
+
+            int32_t Atomics::DecrementAndGet32(int32_t* ptr)
+            {
+                return InterlockedDecrement(reinterpret_cast<LONG*>(ptr));
+            }
+
+            bool Atomics::CompareAndSet64(int64_t* ptr, int64_t expVal, int64_t newVal)
+            {
+                return CompareAndSet64Val(ptr, expVal, newVal) == expVal;
+            }
+
+            int64_t Atomics::CompareAndSet64Val(int64_t* ptr, int64_t expVal, int64_t newVal)
+            {
+                return InterlockedCompareExchange64(reinterpret_cast<LONG64*>(ptr), newVal, expVal);
+            }
+
+            int64_t Atomics::IncrementAndGet64(int64_t* ptr)
+            {
+                return InterlockedIncrement64(reinterpret_cast<LONG64*>(ptr));
+            }
+
+            int64_t Atomics::DecrementAndGet64(int64_t* ptr)
+            {
+                return InterlockedDecrement64(reinterpret_cast<LONG64*>(ptr));
+            }
+            
+            bool ThreadLocal::OnProcessAttach()
+            {
+                return (winTlsIdx = TlsAlloc()) != TLS_OUT_OF_INDEXES;
+            }
+
+            void ThreadLocal::OnThreadDetach()
+            {
+                if (winTlsIdx != TLS_OUT_OF_INDEXES)
+                {
+                    void* mapPtr = Get0();
+
+                    Clear0(mapPtr);
+                }
+            }
+
+            void ThreadLocal::OnProcessDetach()
+            {
+                if (winTlsIdx != TLS_OUT_OF_INDEXES)
+                    TlsFree(winTlsIdx);
+            }
+
+            void* ThreadLocal::Get0()
+            {
+                return TlsGetValue(winTlsIdx);
+            }
+
+            void ThreadLocal::Set0(void* ptr)
+            {
+                TlsSetValue(winTlsIdx, ptr);
+            }
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/common/project/README.TXT
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/common/project/README.TXT b/modules/platform/cpp/common/project/README.TXT
new file mode 100644
index 0000000..97f4c64
--- /dev/null
+++ b/modules/platform/cpp/common/project/README.TXT
@@ -0,0 +1 @@
+Contains IDE projects artifacts.

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/common/project/vs/README.TXT
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/common/project/vs/README.TXT b/modules/platform/cpp/common/project/vs/README.TXT
new file mode 100644
index 0000000..f4fb456
--- /dev/null
+++ b/modules/platform/cpp/common/project/vs/README.TXT
@@ -0,0 +1 @@
+Contains Visual Studio project artifacts.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/common/project/vs/common.vcxproj
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/common/project/vs/common.vcxproj b/modules/platform/cpp/common/project/vs/common.vcxproj
new file mode 100644
index 0000000..b7cfb8a
--- /dev/null
+++ b/modules/platform/cpp/common/project/vs/common.vcxproj
@@ -0,0 +1,202 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup Label="ProjectConfigurations">
+    <ProjectConfiguration Include="Debug|Win32">
+      <Configuration>Debug</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Debug|x64">
+      <Configuration>Debug</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|Win32">
+      <Configuration>Release</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|x64">
+      <Configuration>Release</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+  </ItemGroup>
+  <PropertyGroup Label="Globals">
+    <ProjectGuid>{4F7E4917-4612-4B96-9838-025711ADE391}</ProjectGuid>
+    <Keyword>Win32Proj</Keyword>
+    <RootNamespace>common</RootNamespace>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <PlatformToolset>v100</PlatformToolset>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <PlatformToolset>v100</PlatformToolset>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <PlatformToolset>v100</PlatformToolset>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <PlatformToolset>v100</PlatformToolset>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+  <ImportGroup Label="ExtensionSettings">
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <PropertyGroup Label="UserMacros" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <LinkIncremental>true</LinkIncremental>
+    <TargetName>ignite.common</TargetName>
+    <OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
+    <IntDir>$(Platform)\$(Configuration)\</IntDir>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <TargetName>ignite.common</TargetName>
+    <OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
+    <IntDir>$(Platform)\$(Configuration)\</IntDir>
+    <LinkIncremental>true</LinkIncremental>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <LinkIncremental>false</LinkIncremental>
+    <TargetName>ignite.common</TargetName>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <TargetName>ignite.common</TargetName>
+    <OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
+    <IntDir>$(Platform)\$(Configuration)\</IntDir>
+    <LinkIncremental>false</LinkIncremental>
+  </PropertyGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <ClCompile>
+      <PrecompiledHeader>NotUsing</PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <Optimization>Disabled</Optimization>
+      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;IGNITEJVM_EXPORTS;_CRT_SECURE_NO_WARNINGS;IGNITE_IMPL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>$(JAVA_HOME)\include;$(JAVA_HOME)\include\win32;$(ProjectDir)\..\..\include;$(ProjectDir)\..\..\os\win\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+    </ClCompile>
+    <Link>
+      <SubSystem>Windows</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <AdditionalDependencies>$(JAVA_HOME)\lib\jvm.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalLibraryDirectories>$(JAVA_HOME)\lib\jvm.lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <DelayLoadDLLs>jvm.dll</DelayLoadDLLs>
+      <ModuleDefinitionFile>module.def</ModuleDefinitionFile>
+      <OptimizeReferences>false</OptimizeReferences>
+      <EnableCOMDATFolding>false</EnableCOMDATFolding>
+      <LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <SDLCheck>false</SDLCheck>
+      <AdditionalIncludeDirectories>$(JAVA_HOME)\include;$(JAVA_HOME)\include\win32;$(ProjectDir)\..\..\include;$(ProjectDir)\..\..\os\win\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;IGNITEJVM_EXPORTS;_CRT_SECURE_NO_WARNINGS;IGNITE_IMPL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+    </ClCompile>
+    <Link>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <AdditionalLibraryDirectories>$(JAVA_HOME)\lib\jvm.lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <AdditionalDependencies>$(JAVA_HOME)\lib\jvm.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <OptimizeReferences>true</OptimizeReferences>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <DelayLoadDLLs>jvm.dll</DelayLoadDLLs>
+      <LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
+      <ModuleDefinitionFile>module.def</ModuleDefinitionFile>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <PrecompiledHeader>NotUsing</PrecompiledHeader>
+      <Optimization>MaxSpeed</Optimization>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <IntrinsicFunctions>true</IntrinsicFunctions>
+      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;IGNITEJVM_EXPORTS;_CRT_SECURE_NO_WARNINGS;IGNITE_IMPL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>$(JAVA_HOME)\include;$(JAVA_HOME)\include\win32;$(ProjectDir)\..\..\include;$(ProjectDir)\..\..\os\win\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
+      <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+      <OmitFramePointers>true</OmitFramePointers>
+      <BufferSecurityCheck>false</BufferSecurityCheck>
+      <StringPooling>true</StringPooling>
+    </ClCompile>
+    <Link>
+      <SubSystem>Windows</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <OptimizeReferences>true</OptimizeReferences>
+      <AdditionalDependencies>$(JAVA_HOME)\lib\jvm.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalLibraryDirectories>$(JAVA_HOME)\lib\jvm.lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <DelayLoadDLLs>jvm.dll</DelayLoadDLLs>
+      <ModuleDefinitionFile>module.def</ModuleDefinitionFile>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <Optimization>Full</Optimization>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <IntrinsicFunctions>true</IntrinsicFunctions>
+      <SDLCheck>false</SDLCheck>
+      <AdditionalIncludeDirectories>$(JAVA_HOME)\include;$(JAVA_HOME)\include\win32;$(ProjectDir)\..\..\include;$(ProjectDir)\..\..\os\win\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
+      <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+      <OmitFramePointers>true</OmitFramePointers>
+      <StringPooling>true</StringPooling>
+      <BufferSecurityCheck>false</BufferSecurityCheck>
+      <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;IGNITE_IMPL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+    </ClCompile>
+    <Link>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <OptimizeReferences>true</OptimizeReferences>
+      <AdditionalLibraryDirectories>$(JAVA_HOME)\lib\jvm.lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <AdditionalDependencies>$(JAVA_HOME)\lib\jvm.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <DelayLoadDLLs>jvm.dll</DelayLoadDLLs>
+      <ModuleDefinitionFile>module.def</ModuleDefinitionFile>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemGroup>
+    <ClInclude Include="..\..\include\ignite\common\concurrent.h" />
+    <ClInclude Include="..\..\include\ignite\common\exports.h" />
+    <ClInclude Include="..\..\include\ignite\common\java.h" />
+    <ClInclude Include="..\..\os\win\include\ignite\common\common.h" />
+    <ClInclude Include="..\..\os\win\include\ignite\common\concurrent_os.h" />
+    <ClInclude Include="targetver.h" />
+  </ItemGroup>
+  <ItemGroup>
+    <ClCompile Include="..\..\os\win\src\common.cpp" />
+    <ClCompile Include="..\..\os\win\src\concurrent_os.cpp" />
+    <ClCompile Include="..\..\src\concurrent.cpp" />
+    <ClCompile Include="..\..\src\exports.cpp" />
+    <ClCompile Include="..\..\src\java.cpp" />
+  </ItemGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+  <ImportGroup Label="ExtensionTargets">
+  </ImportGroup>
+  <ItemGroup>
+    <None Include="module.def" />
+  </ItemGroup>
+</Project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/common/project/vs/common.vcxproj.filters
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/common/project/vs/common.vcxproj.filters b/modules/platform/cpp/common/project/vs/common.vcxproj.filters
new file mode 100644
index 0000000..3d4ae54
--- /dev/null
+++ b/modules/platform/cpp/common/project/vs/common.vcxproj.filters
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup>
+    <Filter Include="Misc">
+      <UniqueIdentifier>{1dbec2be-5cb4-4f70-aef6-b4627d39b99b}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="Code">
+      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+      <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
+    </Filter>
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="..\..\os\win\include\ignite\common\common.h">
+      <Filter>Code</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\os\win\include\ignite\common\concurrent_os.h">
+      <Filter>Code</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\include\ignite\common\exports.h">
+      <Filter>Code</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\include\ignite\common\java.h">
+      <Filter>Code</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\include\ignite\common\concurrent.h">
+      <Filter>Code</Filter>
+    </ClInclude>
+    <ClInclude Include="targetver.h">
+      <Filter>Misc</Filter>
+    </ClInclude>
+  </ItemGroup>
+  <ItemGroup>
+    <ClCompile Include="..\..\os\win\src\common.cpp">
+      <Filter>Code</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\concurrent.cpp">
+      <Filter>Code</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\os\win\src\concurrent_os.cpp">
+      <Filter>Code</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\exports.cpp">
+      <Filter>Code</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\java.cpp">
+      <Filter>Code</Filter>
+    </ClCompile>
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="module.def">
+      <Filter>Misc</Filter>
+    </None>
+  </ItemGroup>
+</Project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/common/project/vs/module.def
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/common/project/vs/module.def b/modules/platform/cpp/common/project/vs/module.def
new file mode 100644
index 0000000..d9e8d2b
--- /dev/null
+++ b/modules/platform/cpp/common/project/vs/module.def
@@ -0,0 +1,99 @@
+LIBRARY ignite.common.dll
+EXPORTS
+IgniteReallocate @1 
+IgniteIgnitionStart @2 
+IgniteIgnitionInstance @3 
+IgniteIgnitionEnvironmentPointer @4 
+IgniteIgnitionStop @5 
+IgniteIgnitionStopAll @6 
+IgniteTargetOutLong @7
+IgniteProcessorReleaseStart @8 
+IgniteProcessorProjection @9 
+IgniteProcessorCache @10 
+IgniteProcessorCreateCache @11 
+IgniteProcessorGetOrCreateCache @12 
+IgniteProcessorAffinity @13 
+IgniteProcessorDataStreamer @14 
+IgniteProcessorTransactions @15 
+IgniteProcessorServices @16
+IgniteTargetInStreamOutObject @17 
+IgniteTargetInStreamOutLong @18 
+IgniteTargetOutStream @19 
+IgniteTargetInStreamOutStream @20 
+IgniteTargetInObjectStreamOutStream @21 
+IgniteTargetListenFuture @22 
+IgniteTargetListenFutureForOperation @23 
+IgniteAffinityPartitions @24 
+IgniteCacheWithSkipStore @25 
+IgniteCacheWithNoRetries @26 
+IgniteCacheWithExpiryPolicy @27 
+IgniteCacheWithAsync @28 
+IgniteCacheWithKeepPortable @29 
+IgniteCacheClear @30 
+IgniteCacheRemoveAll @31 
+IgniteCacheOutOpQueryCursor @32 
+IgniteCacheOutOpContinuousQuery @33 
+IgniteCacheIterator @34 
+IgniteCacheLocalIterator @35 
+IgniteCacheEnterLock @36 
+IgniteCacheExitLock @37 
+IgniteCacheTryEnterLock @38 
+IgniteCacheCloseLock @39 
+IgniteCacheRebalance @40 
+IgniteCacheSize @41 
+IgniteCacheStoreCallbackInvoke @42 
+IgniteComputeWithNoFailover @43 
+IgniteComputeWithTimeout @44 
+IgniteComputeExecuteNative @45 
+IgniteContinuousQueryClose @46 
+IgniteContinuousQueryGetInitialQueryCursor @47 
+IgniteDataStreamerListenTopology @48 
+IgniteDataStreamerAllowOverwriteGet @49 
+IgniteDataStreamerAllowOverwriteSet @50 
+IgniteDataStreamerSkipStoreGet @51 
+IgniteDataStreamerSkipStoreSet @52 
+IgniteDataStreamerPerNodeBufferSizeGet @53 
+IgniteDataStreamerPerNodeBufferSizeSet @54 
+IgniteDataStreamerPerNodeParallelOperationsGet @55 
+IgniteDataStreamerPerNodeParallelOperationsSet @56 
+IgniteMessagingWithAsync @57 
+IgniteProjectionForOthers @58 
+IgniteProjectionForRemotes @59 
+IgniteProjectionForDaemons @60 
+IgniteProjectionForRandom @61 
+IgniteProjectionForOldest @62 
+IgniteProjectionForYoungest @63 
+IgniteProcessorCompute @64 
+IgniteProcessorMessage @65 
+IgniteProcessorEvents @66 
+IgniteProjectionResetMetrics @67 
+IgniteProjectionOutOpRet @68 
+IgniteQueryCursorIterator @69 
+IgniteQueryCursorClose @70 
+IgniteTransactionsStart @71 
+IgniteTransactionsCommit @72 
+IgniteTransactionsCommitAsync @73 
+IgniteTransactionsRollback @74 
+IgniteTransactionsRollbackAsync @75 
+IgniteTransactionsClose @76 
+IgniteTransactionsState @77 
+IgniteTransactionsSetRollbackOnly @78 
+IgniteTransactionsResetMetrics @79 
+IgniteAcquire @80 
+IgniteRelease @81 
+IgniteThrowToJava @82 
+IgniteHandlersSize @83 
+IgniteCreateContext @84 
+IgniteDeleteContext @85 
+IgniteDestroyJvm @86 
+IgniteEventsWithAsync @87 
+IgniteEventsStopLocalListen @88 
+IgniteEventsLocalListen @89 
+IgniteEventsIsEnabled @90 
+IgniteTargetOutObject @91 
+IgniteServicesWithAsync @92
+IgniteServicesWithServerKeepPortable @93
+IgniteServicesCancel @94
+IgniteServicesCancelAll @95
+IgniteServicesGetServiceProxy @96
+IgniteProcessorExtensions @97
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/common/project/vs/targetver.h
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/common/project/vs/targetver.h b/modules/platform/cpp/common/project/vs/targetver.h
new file mode 100644
index 0000000..4bea158
--- /dev/null
+++ b/modules/platform/cpp/common/project/vs/targetver.h
@@ -0,0 +1,25 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+// Including SDKDDKVer.h defines the highest available Windows platform.
+
+// If you wish to build your application for a previous Windows platform, include WinSDKVer.h and
+// set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h.
+
+#include <SDKDDKVer.h>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/common/src/concurrent.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/common/src/concurrent.cpp b/modules/platform/cpp/common/src/concurrent.cpp
new file mode 100644
index 0000000..3f85b65
--- /dev/null
+++ b/modules/platform/cpp/common/src/concurrent.cpp
@@ -0,0 +1,94 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "ignite/common/concurrent.h"
+
+namespace ignite
+{
+    namespace common
+    {
+        namespace concurrent
+        {
+            /** Thread-local index generator for application. */
+            int32_t appTlsIdxGen = 0;
+
+            int32_t ThreadLocal::NextIndex()
+            {
+                return Atomics::IncrementAndGet32(&appTlsIdxGen);
+            }
+
+            void ThreadLocal::Remove(int32_t idx)
+            {
+                void* val = Get0();
+
+                if (val)
+                {
+                    std::map<int32_t, ThreadLocalEntry*>* map =
+                        static_cast<std::map<int32_t, ThreadLocalEntry*>*>(val);
+
+                    ThreadLocalEntry* appVal = (*map)[idx];
+
+                    if (appVal)
+                        delete appVal;
+
+                    map->erase(idx);
+
+                    if (map->size() == 0)
+                    {
+                        delete map;
+
+                        Set0(NULL);
+                    }
+                }
+            }
+
+            void ThreadLocal::Clear0(void* mapPtr)
+            {
+                if (mapPtr)
+                {
+                    std::map<int32_t, ThreadLocalEntry*>* map =
+                        static_cast<std::map<int32_t, ThreadLocalEntry*>*>(mapPtr);
+
+                    for (std::map<int32_t, ThreadLocalEntry*>::iterator it = map->begin(); it != map->end(); ++it)
+                        delete it->second;
+
+                    delete map;
+                }
+            }
+
+            SharedPointerImpl::SharedPointerImpl(void* ptr) : ptr(ptr), refCnt(1)
+            {
+                Memory::Fence();
+            }
+
+            void* SharedPointerImpl::Pointer()
+            {
+                return ptr;
+            }
+
+            void SharedPointerImpl::Increment()
+            {
+                Atomics::IncrementAndGet32(&refCnt);
+            }
+
+            bool SharedPointerImpl::Decrement()
+            {
+                return Atomics::DecrementAndGet32(&refCnt) == 0;
+            }
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/common/src/exports.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/common/src/exports.cpp b/modules/platform/cpp/common/src/exports.cpp
new file mode 100644
index 0000000..2ac3340
--- /dev/null
+++ b/modules/platform/cpp/common/src/exports.cpp
@@ -0,0 +1,413 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "ignite/common/exports.h"
+#include "ignite/common/java.h"
+
+namespace gcj = ignite::common::java;
+
+/* --- Target methods. --- */
+extern "C" {
+    int IGNITE_CALL IgniteReallocate(long long memPtr, int cap) {
+        return gcj::JniContext::Reallocate(memPtr, cap);
+    }
+
+    void* IGNITE_CALL IgniteIgnitionStart(gcj::JniContext* ctx, char* cfgPath, char* name, int factoryId, long long dataPtr) {
+        return ctx->IgnitionStart(cfgPath, name, factoryId, dataPtr);
+    }
+
+	void* IGNITE_CALL IgniteIgnitionInstance(gcj::JniContext* ctx, char* name) {
+        return ctx->IgnitionInstance(name);
+    }
+
+    long long IGNITE_CALL IgniteIgnitionEnvironmentPointer(gcj::JniContext* ctx, char* name) {
+        return ctx->IgnitionEnvironmentPointer(name);
+    }
+
+	bool IGNITE_CALL IgniteIgnitionStop(gcj::JniContext* ctx, char* name, bool cancel) {
+        return ctx->IgnitionStop(name, cancel);
+    }
+
+	void IGNITE_CALL IgniteIgnitionStopAll(gcj::JniContext* ctx, bool cancel) {
+        return ctx->IgnitionStopAll(cancel);
+    }
+
+    void IGNITE_CALL IgniteProcessorReleaseStart(gcj::JniContext* ctx, void* obj) {
+        return ctx->ProcessorReleaseStart(static_cast<jobject>(obj));
+    }
+
+    void* IGNITE_CALL IgniteProcessorProjection(gcj::JniContext* ctx, void* obj) {
+        return ctx->ProcessorProjection(static_cast<jobject>(obj));
+    }
+
+    void* IGNITE_CALL IgniteProcessorCache(gcj::JniContext* ctx, void* obj, char* name) {
+        return ctx->ProcessorCache(static_cast<jobject>(obj), name);
+    }
+
+    void* IGNITE_CALL IgniteProcessorCreateCache(gcj::JniContext* ctx, void* obj, char* name) {
+        return ctx->ProcessorCreateCache(static_cast<jobject>(obj), name);
+    }
+
+    void* IGNITE_CALL IgniteProcessorGetOrCreateCache(gcj::JniContext* ctx, void* obj, char* name) {
+        return ctx->ProcessorGetOrCreateCache(static_cast<jobject>(obj), name);
+    }
+
+    void* IGNITE_CALL IgniteProcessorAffinity(gcj::JniContext* ctx, void* obj, char* name) {
+        return ctx->ProcessorAffinity(static_cast<jobject>(obj), name);
+    }
+
+    void*IGNITE_CALL IgniteProcessorDataStreamer(gcj::JniContext* ctx, void* obj, char* name, bool keepPortable) {
+        return ctx->ProcessorDataStreamer(static_cast<jobject>(obj), name, keepPortable);
+    }
+    
+    void* IGNITE_CALL IgniteProcessorTransactions(gcj::JniContext* ctx, void* obj) {
+        return ctx->ProcessorTransactions(static_cast<jobject>(obj));
+    }
+        
+    void* IGNITE_CALL IgniteProcessorCompute(gcj::JniContext* ctx, void* obj, void* prj) {
+        return ctx->ProcessorCompute(static_cast<jobject>(obj), static_cast<jobject>(prj));
+    }
+
+    void* IGNITE_CALL IgniteProcessorMessage(gcj::JniContext* ctx, void* obj, void* prj) {
+        return ctx->ProcessorMessage(static_cast<jobject>(obj), static_cast<jobject>(prj));
+    }
+
+    void* IGNITE_CALL IgniteProcessorEvents(gcj::JniContext* ctx, void* obj, void* prj) {
+        return ctx->ProcessorEvents(static_cast<jobject>(obj), static_cast<jobject>(prj));
+    }
+
+    void* IGNITE_CALL IgniteProcessorServices(gcj::JniContext* ctx, void* obj, void* prj) {
+        return ctx->ProcessorServices(static_cast<jobject>(obj), static_cast<jobject>(prj));
+    }
+
+    void* IGNITE_CALL IgniteProcessorExtensions(gcj::JniContext* ctx, void* obj) {
+        return ctx->ProcessorExtensions(static_cast<jobject>(obj));
+    }
+
+    long long IGNITE_CALL IgniteTargetInStreamOutLong(gcj::JniContext* ctx, void* obj, int opType, long long memPtr) {
+        return ctx->TargetInStreamOutLong(static_cast<jobject>(obj), opType, memPtr);
+    }
+
+    void IGNITE_CALL IgniteTargetInStreamOutStream(gcj::JniContext* ctx, void* obj, int opType, long long inMemPtr, long long outMemPtr) {
+        ctx->TargetInStreamOutStream(static_cast<jobject>(obj), opType, inMemPtr, outMemPtr);
+    }
+
+    void* IGNITE_CALL IgniteTargetInStreamOutObject(gcj::JniContext* ctx, void* obj, int opType, long long memPtr) {
+        return ctx->TargetInStreamOutObject(static_cast<jobject>(obj), opType, memPtr);
+    }
+
+    void IGNITE_CALL IgniteTargetInObjectStreamOutStream(gcj::JniContext* ctx, void* obj, int opType, void* arg, long long inMemPtr, long long outMemPtr) {
+        ctx->TargetInObjectStreamOutStream(static_cast<jobject>(obj), opType, arg, inMemPtr, outMemPtr);
+    }
+    
+    long long IGNITE_CALL IgniteTargetOutLong(gcj::JniContext* ctx, void* obj, int opType) {
+        return ctx->TargetOutLong(static_cast<jobject>(obj), opType);
+    }
+
+    void IGNITE_CALL IgniteTargetOutStream(gcj::JniContext* ctx, void* obj, int opType, long long memPtr) {
+        ctx->TargetOutStream(static_cast<jobject>(obj), opType, memPtr);
+    }
+
+    void* IGNITE_CALL IgniteTargetOutObject(gcj::JniContext* ctx, void* obj, int opType) {
+        return ctx->TargetOutObject(static_cast<jobject>(obj), opType);
+    }
+
+    void IGNITE_CALL IgniteTargetListenFuture(gcj::JniContext* ctx, void* obj, long long futId, int typ) {
+        ctx->TargetListenFuture(static_cast<jobject>(obj), futId, typ);
+    }
+
+    void IGNITE_CALL IgniteTargetListenFutureForOperation(gcj::JniContext* ctx, void* obj, long long futId, int typ, int opId) {
+        ctx->TargetListenFutureForOperation(static_cast<jobject>(obj), futId, typ, opId);
+    }
+
+    int IGNITE_CALL IgniteAffinityPartitions(gcj::JniContext* ctx, void* obj) {
+        return ctx->AffinityPartitions(static_cast<jobject>(obj));
+    }
+
+    void* IGNITE_CALL IgniteCacheWithSkipStore(gcj::JniContext* ctx, void* obj) {
+        return ctx->CacheWithSkipStore(static_cast<jobject>(obj));
+    }
+
+    void* IGNITE_CALL IgniteCacheWithNoRetries(gcj::JniContext* ctx, void* obj) {
+        return ctx->CacheWithNoRetries(static_cast<jobject>(obj));
+    }
+
+    void* IGNITE_CALL IgniteCacheWithExpiryPolicy(gcj::JniContext* ctx, void* obj, long long create, long long update, long long access) {
+        return ctx->CacheWithExpiryPolicy(static_cast<jobject>(obj), create, update, access);
+    }
+
+    void* IGNITE_CALL IgniteCacheWithAsync(gcj::JniContext* ctx, void* obj) {
+        return ctx->CacheWithAsync(static_cast<jobject>(obj));
+    }
+
+    void* IGNITE_CALL IgniteCacheWithKeepPortable(gcj::JniContext* ctx, void* obj)
+    {
+        return ctx->CacheWithKeepPortable(static_cast<jobject>(obj));
+    }
+
+    void IGNITE_CALL IgniteCacheClear(gcj::JniContext* ctx, void* obj) {
+        ctx->CacheClear(static_cast<jobject>(obj));
+    }
+
+    void IGNITE_CALL IgniteCacheRemoveAll(gcj::JniContext* ctx, void* obj) {
+        ctx->CacheRemoveAll(static_cast<jobject>(obj));
+    }
+
+    void* IGNITE_CALL IgniteCacheOutOpQueryCursor(gcj::JniContext* ctx, void* obj, int type, long long memPtr) {
+        return ctx->CacheOutOpQueryCursor(static_cast<jobject>(obj), type, memPtr);
+    }
+
+    void* IGNITE_CALL IgniteCacheOutOpContinuousQuery(gcj::JniContext* ctx, void* obj, int type, long long memPtr) {
+        return ctx->CacheOutOpContinuousQuery(static_cast<jobject>(obj), type, memPtr);
+    }
+
+    void* IGNITE_CALL IgniteCacheIterator(gcj::JniContext* ctx, void* obj) {
+        return ctx->CacheIterator(static_cast<jobject>(obj));
+    }
+
+    void* IGNITE_CALL IgniteCacheLocalIterator(gcj::JniContext* ctx, void* obj, int peekModes) {
+        return ctx->CacheLocalIterator(static_cast<jobject>(obj), peekModes);
+    }
+
+    void IGNITE_CALL IgniteCacheEnterLock(gcj::JniContext* ctx, void* obj, long long id) {
+        ctx->CacheEnterLock(static_cast<jobject>(obj), id);
+    }
+
+    void IGNITE_CALL IgniteCacheExitLock(gcj::JniContext* ctx, void* obj, long long id) {
+        ctx->CacheExitLock(static_cast<jobject>(obj), id);
+    }
+
+    bool IGNITE_CALL IgniteCacheTryEnterLock(gcj::JniContext* ctx, void* obj, long long id, long long timeout) {
+        return ctx->CacheTryEnterLock(static_cast<jobject>(obj), id, timeout);
+    }
+
+    void IGNITE_CALL IgniteCacheCloseLock(gcj::JniContext* ctx, void* obj, long long id) {
+        ctx->CacheCloseLock(static_cast<jobject>(obj), id);
+    }
+
+    void IGNITE_CALL IgniteCacheRebalance(gcj::JniContext* ctx, void* obj, long long futId) {
+        ctx->CacheRebalance(static_cast<jobject>(obj), futId);
+    }
+
+    int IGNITE_CALL IgniteCacheSize(gcj::JniContext* ctx, void* obj, int peekModes, bool loc) {
+        return ctx->CacheSize(static_cast<jobject>(obj), peekModes, loc);
+    }
+
+    void IGNITE_CALL IgniteComputeWithNoFailover(gcj::JniContext* ctx, void* obj) {
+        ctx->ComputeWithNoFailover(static_cast<jobject>(obj));
+    }
+
+    void IGNITE_CALL IgniteComputeWithTimeout(gcj::JniContext* ctx, void* obj, long long timeout) {
+        ctx->ComputeWithTimeout(static_cast<jobject>(obj), timeout);
+    }
+
+    void IGNITE_CALL IgniteComputeExecuteNative(gcj::JniContext* ctx, void* obj, long long taskPtr, long long topVer) {
+        ctx->ComputeExecuteNative(static_cast<jobject>(obj), taskPtr, topVer);
+    }
+
+    void IGNITE_CALL IgniteContinuousQueryClose(gcj::JniContext* ctx, void* obj) {
+        ctx->ContinuousQueryClose(static_cast<jobject>(obj));
+    }
+
+    void* IGNITE_CALL IgniteContinuousQueryGetInitialQueryCursor(gcj::JniContext* ctx, void* obj) {
+        return ctx->ContinuousQueryGetInitialQueryCursor(static_cast<jobject>(obj));
+    }
+
+    void IGNITE_CALL IgniteCacheStoreCallbackInvoke(gcj::JniContext* ctx, void* obj, long long memPtr) {
+        ctx->CacheStoreCallbackInvoke(static_cast<jobject>(obj), memPtr);
+    }
+
+    void IGNITE_CALL IgniteDataStreamerListenTopology(gcj::JniContext* ctx, void* obj, long long ptr) {
+        ctx->DataStreamerListenTopology(static_cast<jobject>(obj), ptr);
+    }
+
+    bool IGNITE_CALL IgniteDataStreamerAllowOverwriteGet(gcj::JniContext* ctx, void* obj) {
+        return ctx->DataStreamerAllowOverwriteGet(static_cast<jobject>(obj));
+    }
+
+    void IGNITE_CALL IgniteDataStreamerAllowOverwriteSet(gcj::JniContext* ctx, void* obj, bool val) {
+        ctx->DataStreamerAllowOverwriteSet(static_cast<jobject>(obj), val);
+    }
+
+    bool IGNITE_CALL IgniteDataStreamerSkipStoreGet(gcj::JniContext* ctx, void* obj) {
+        return ctx->DataStreamerSkipStoreGet(static_cast<jobject>(obj));
+    }
+
+    void IGNITE_CALL IgniteDataStreamerSkipStoreSet(gcj::JniContext* ctx, void* obj, bool val) {
+        ctx->DataStreamerSkipStoreSet(static_cast<jobject>(obj), val);
+    }
+
+    int IGNITE_CALL IgniteDataStreamerPerNodeBufferSizeGet(gcj::JniContext* ctx, void* obj) {
+        return ctx->DataStreamerPerNodeBufferSizeGet(static_cast<jobject>(obj));
+    }
+
+    void IGNITE_CALL IgniteDataStreamerPerNodeBufferSizeSet(gcj::JniContext* ctx, void* obj, int val) {
+        ctx->DataStreamerPerNodeBufferSizeSet(static_cast<jobject>(obj), val);
+    }
+
+    int IGNITE_CALL IgniteDataStreamerPerNodeParallelOperationsGet(gcj::JniContext* ctx, void* obj) {
+        return ctx->DataStreamerPerNodeParallelOperationsGet(static_cast<jobject>(obj));
+    }
+
+    void IGNITE_CALL IgniteDataStreamerPerNodeParallelOperationsSet(gcj::JniContext* ctx, void* obj, int val) {
+        ctx->DataStreamerPerNodeParallelOperationsSet(static_cast<jobject>(obj), val);
+    }
+
+    void* IGNITE_CALL IgniteMessagingWithAsync(gcj::JniContext* ctx, void* obj) {
+        return ctx->MessagingWithAsync(static_cast<jobject>(obj));
+    }
+
+    void* IGNITE_CALL IgniteProjectionForOthers(gcj::JniContext* ctx, void* obj, void* prj) {
+        return ctx->ProjectionForOthers(static_cast<jobject>(obj), static_cast<jobject>(prj));
+    }
+
+    void* IGNITE_CALL IgniteProjectionForRemotes(gcj::JniContext* ctx, void* obj) {
+        return ctx->ProjectionForRemotes(static_cast<jobject>(obj));
+    }
+
+    void* IGNITE_CALL IgniteProjectionForDaemons(gcj::JniContext* ctx, void* obj) {
+        return ctx->ProjectionForDaemons(static_cast<jobject>(obj));
+    }
+
+    void* IGNITE_CALL IgniteProjectionForRandom(gcj::JniContext* ctx, void* obj) {
+        return ctx->ProjectionForRandom(static_cast<jobject>(obj));
+    }
+
+    void* IGNITE_CALL IgniteProjectionForOldest(gcj::JniContext* ctx, void* obj) {
+        return ctx->ProjectionForOldest(static_cast<jobject>(obj));
+    }
+
+    void* IGNITE_CALL IgniteProjectionForYoungest(gcj::JniContext* ctx, void* obj) {
+        return ctx->ProjectionForYoungest(static_cast<jobject>(obj));
+    }
+
+    void IGNITE_CALL IgniteProjectionResetMetrics(gcj::JniContext* ctx, void* obj) {
+        ctx->ProjectionResetMetrics(static_cast<jobject>(obj));
+    }
+
+    void* IGNITE_CALL IgniteProjectionOutOpRet(gcj::JniContext* ctx, void* obj, int type, long long memPtr) {
+        return ctx->ProjectionOutOpRet(static_cast<jobject>(obj), type, memPtr);
+    }
+
+    void IGNITE_CALL IgniteQueryCursorIterator(gcj::JniContext* ctx, void* obj) {
+        ctx->QueryCursorIterator(static_cast<jobject>(obj));
+    }
+
+    void IGNITE_CALL IgniteQueryCursorClose(gcj::JniContext* ctx, void* obj) {
+        ctx->QueryCursorClose(static_cast<jobject>(obj));
+    }
+
+    long long IGNITE_CALL IgniteTransactionsStart(gcj::JniContext* ctx, void* obj, int concurrency, int isolation, long long timeout, int txSize) {
+        return ctx->TransactionsStart(static_cast<jobject>(obj), concurrency, isolation, timeout, txSize);
+    }   
+
+    int IGNITE_CALL IgniteTransactionsCommit(gcj::JniContext* ctx, void* obj, long long id) {
+        return ctx->TransactionsCommit(static_cast<jobject>(obj), id);
+    }
+
+    void IGNITE_CALL IgniteTransactionsCommitAsync(gcj::JniContext* ctx, void* obj, long long id, long long futId) {
+        return ctx->TransactionsCommitAsync(static_cast<jobject>(obj), id, futId);
+    }
+
+    int IGNITE_CALL IgniteTransactionsRollback(gcj::JniContext* ctx, void* obj, long long id) {
+        return ctx->TransactionsRollback(static_cast<jobject>(obj), id);
+    }
+
+    void IGNITE_CALL IgniteTransactionsRollbackAsync(gcj::JniContext* ctx, void* obj, long long id, long long futId) {
+        return ctx->TransactionsRollbackAsync(static_cast<jobject>(obj), id, futId);
+    }
+
+    int IGNITE_CALL IgniteTransactionsClose(gcj::JniContext* ctx, void* obj, long long id) {
+        return ctx->TransactionsClose(static_cast<jobject>(obj), id);
+    }
+
+    int IGNITE_CALL IgniteTransactionsState(gcj::JniContext* ctx, void* obj, long long id) {
+        return ctx->TransactionsState(static_cast<jobject>(obj), id);
+    }
+
+    bool IGNITE_CALL IgniteTransactionsSetRollbackOnly(gcj::JniContext* ctx, void* obj, long long id) {
+        return ctx->TransactionsSetRollbackOnly(static_cast<jobject>(obj), id);
+    }
+
+    void IGNITE_CALL IgniteTransactionsResetMetrics(gcj::JniContext* ctx, void* obj) {
+        ctx->TransactionsResetMetrics(static_cast<jobject>(obj));
+    }
+
+    void* IGNITE_CALL IgniteAcquire(gcj::JniContext* ctx, void* obj) {
+        return ctx->Acquire(static_cast<jobject>(obj));
+    }
+
+    void IGNITE_CALL IgniteRelease(void* obj) {
+        gcj::JniContext::Release(static_cast<jobject>(obj));
+    }
+
+    void IGNITE_CALL IgniteThrowToJava(gcj::JniContext* ctx, char* err) {
+        ctx->ThrowToJava(err);
+    }
+    
+    int IGNITE_CALL IgniteHandlersSize() {
+        return sizeof(gcj::JniHandlers);
+    }
+
+    void* IGNITE_CALL IgniteCreateContext(char** opts, int optsLen, gcj::JniHandlers* cbs) {
+        return gcj::JniContext::Create(opts, optsLen, *cbs);
+    }
+
+    void IGNITE_CALL IgniteDeleteContext(gcj::JniContext* ctx) {
+        delete ctx;
+    }
+
+    void IGNITE_CALL IgniteDestroyJvm(gcj::JniContext* ctx) {
+        ctx->DestroyJvm();
+    }
+
+    void* IGNITE_CALL IgniteEventsWithAsync(gcj::JniContext* ctx, void* obj) {
+        return ctx->EventsWithAsync(static_cast<jobject>(obj));
+    }
+
+    bool IGNITE_CALL IgniteEventsStopLocalListen(gcj::JniContext* ctx, void* obj, long long hnd) {
+        return ctx->EventsStopLocalListen(static_cast<jobject>(obj), hnd);
+    }
+
+    void IGNITE_CALL IgniteEventsLocalListen(gcj::JniContext* ctx, void* obj, long long hnd, int type) {
+        ctx->EventsLocalListen(static_cast<jobject>(obj), hnd, type);
+    }
+
+    bool IGNITE_CALL IgniteEventsIsEnabled(gcj::JniContext* ctx, void* obj, int type) {
+        return ctx->EventsIsEnabled(static_cast<jobject>(obj), type);
+    }    
+    
+	void* IGNITE_CALL IgniteServicesWithAsync(gcj::JniContext* ctx, void* obj) {
+		return ctx->ServicesWithAsync(static_cast<jobject>(obj));
+    }
+
+    void* IGNITE_CALL IgniteServicesWithServerKeepPortable(gcj::JniContext* ctx, void* obj) {
+    		return ctx->ServicesWithServerKeepPortable(static_cast<jobject>(obj));
+        }
+
+	void IGNITE_CALL IgniteServicesCancel(gcj::JniContext* ctx, void* obj, char* name) {
+		ctx->ServicesCancel(static_cast<jobject>(obj), name);
+    }
+
+	void IGNITE_CALL IgniteServicesCancelAll(gcj::JniContext* ctx, void* obj) {
+		ctx->ServicesCancelAll(static_cast<jobject>(obj));
+    }
+
+	void* IGNITE_CALL IgniteServicesGetServiceProxy(gcj::JniContext* ctx, void* obj, char* name, bool sticky) {
+		return ctx->ServicesGetServiceProxy(static_cast<jobject>(obj), name, sticky);
+    }
+}
\ No newline at end of file


[10/28] ignite git commit: IGNITE-1513: Moved CPP.

Posted by vo...@apache.org.
http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/core-test/src/cache_test.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core-test/src/cache_test.cpp b/modules/platform/src/main/cpp/core-test/src/cache_test.cpp
deleted file mode 100644
index 3239d89..0000000
--- a/modules/platform/src/main/cpp/core-test/src/cache_test.cpp
+++ /dev/null
@@ -1,486 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef _MSC_VER
-    #define BOOST_TEST_DYN_LINK
-#endif
-
-#include <boost/test/unit_test.hpp>
-
-#include "ignite/cache/cache_peek_mode.h"
-#include "ignite/ignite.h"
-#include "ignite/ignition.h"
-
-using namespace ignite;
-using namespace boost::unit_test;
-
-/* Nodes started during the test. */
-Ignite grid0 = Ignite();
-Ignite grid1 = Ignite();
-
-/** Cache accessor. */
-cache::Cache<int, int> Cache()
-{
-    return grid0.GetCache<int, int>("partitioned");
-}
-
-struct Person
-{
-    std::string name;
-    int age;
-
-    Person() : name(""), age(0)
-    {
-        // No-op.
-    }
-
-    Person(std::string name, int age) : name(name), age(age)
-    {
-        // No-op.
-    }
-};
-
-namespace ignite
-{
-    namespace portable
-    {
-        IGNITE_PORTABLE_TYPE_START(Person)
-        IGNITE_PORTABLE_GET_TYPE_ID_AS_HASH(Person)
-        IGNITE_PORTABLE_GET_TYPE_NAME_AS_IS(Person)
-        IGNITE_PORTABLE_GET_FIELD_ID_AS_HASH
-        IGNITE_PORTABLE_GET_HASH_CODE_ZERO(Person)
-        IGNITE_PORTABLE_IS_NULL_FALSE(Person)
-        IGNITE_PORTABLE_GET_NULL_DEFAULT_CTOR(Person)
-            
-        void Write(PortableWriter& writer, Person obj)
-        {
-            writer.WriteString("name", obj.name);
-            writer.WriteInt32("age", obj.age);            
-        }
-
-        Person Read(PortableReader& reader)
-        {
-            std::string name = reader.ReadString("name");
-            int age = reader.ReadInt32("age");
-            
-            return Person(name, age);
-        }
-
-        IGNITE_PORTABLE_TYPE_END
-    }
-}
-
-/*
- * Test setup fixture.
- */
-struct CacheTestSuiteFixture {
-    /*
-     * Constructor.
-     */
-    CacheTestSuiteFixture()
-    {
-        IgniteConfiguration cfg;
-
-        IgniteJvmOption opts[5];
-
-        opts[0] = IgniteJvmOption("-Xdebug");
-        opts[1] = IgniteJvmOption("-Xnoagent");
-        opts[2] = IgniteJvmOption("-Djava.compiler=NONE");
-        opts[3] = IgniteJvmOption("-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005");
-        opts[4] = IgniteJvmOption("-XX:+HeapDumpOnOutOfMemoryError");
-
-        cfg.jvmOptsLen = 5;
-        cfg.jvmOpts = opts;
-
-#ifdef IGNITE_TESTS_32
-        cfg.jvmInitMem = 256;
-        cfg.jvmMaxMem = 768;
-#else
-        cfg.jvmInitMem = 1024;
-        cfg.jvmMaxMem = 4096;
-#endif
-
-        char* cfgPath = getenv("IGNITE_NATIVE_TEST_CPP_CONFIG_PATH");
-
-        std::string cfgPathStr = std::string(cfgPath).append("/").append("cache-test.xml");
-
-        cfg.springCfgPath = const_cast<char*>(cfgPathStr.c_str());
-        
-        for (int i = 0; i < 2; i++) 
-        {
-            std::stringstream stream;
-
-            stream << "grid-" << i;
-
-            IgniteError err;
-
-            Ignite grid = Ignition::Start(cfg, stream.str().c_str(), &err);
-                
-            if (err.GetCode() != IgniteError::IGNITE_SUCCESS)
-                BOOST_FAIL(err.GetText());
-
-            if (i == 0)
-                grid0 = grid;
-            else
-                grid1 = grid;
-        }
-    }
-
-    /*
-     * Destructor.
-     */
-    ~CacheTestSuiteFixture()
-    {
-        Ignition::Stop(grid0.GetName(), true);
-        Ignition::Stop(grid1.GetName(), true);
-
-        grid0 = Ignite();
-        grid1 = Ignite();
-    }
-};
-
-BOOST_FIXTURE_TEST_SUITE(CacheTestSuite, CacheTestSuiteFixture)
-
-BOOST_AUTO_TEST_CASE(TestRemoveAllKeys)
-{
-    cache::Cache<int, int> cache = Cache();
-
-    cache.Put(1, 1);
-    cache.Put(2, 2);
-    cache.Put(3, 3);
-
-    int size = cache.Size(cache::IGNITE_PEEK_MODE_PRIMARY);
-
-    BOOST_REQUIRE(3 == size);
-
-    cache.RemoveAll();
-
-    size = cache.Size(cache::IGNITE_PEEK_MODE_ALL);
-
-    BOOST_REQUIRE(0 == size);
-
-    cache.Put(1, 1);
-    cache.Put(2, 2);
-    cache.Put(3, 3);
-
-    int keys[] = { 1, 2, 4, 5 };
-
-    std::set<int> keySet(keys, keys + 4);
-
-    cache.RemoveAll(keySet);
-
-    size = cache.Size(cache::IGNITE_PEEK_MODE_PRIMARY);
-
-    BOOST_REQUIRE(1 == size);
-}
-
-BOOST_AUTO_TEST_CASE(TestPut)
-{
-    cache::Cache<int, int> cache = Cache();
-
-    cache.Put(1, 1);
-
-    BOOST_REQUIRE(1 == cache.Get(1));
-}
-
-BOOST_AUTO_TEST_CASE(TestPutAll)
-{
-    std::map<int, int> map;
-
-    for (int i = 0; i < 100; i++)
-        map[i] = i + 1;
-    
-    cache::Cache<int, int> cache = Cache();
-
-    cache.PutAll(map);
-
-    for (int i = 0; i < 100; i++)
-        BOOST_REQUIRE(i + 1 == cache.Get(i));
-}
-
-BOOST_AUTO_TEST_CASE(TestPutIfAbsent)
-{
-    cache::Cache<int, int> cache = Cache();
-
-    BOOST_REQUIRE(true == cache.PutIfAbsent(1, 3));
-    BOOST_REQUIRE(false == cache.PutIfAbsent(1, 3));
-}
-
-BOOST_AUTO_TEST_CASE(TestGet)
-{
-    cache::Cache<int, int> cache = Cache();
-
-    cache.Put(1, 1);
-    cache.Put(2, 2);
-
-    BOOST_REQUIRE(1 == cache.Get(1));
-    BOOST_REQUIRE(2 == cache.Get(2));
-    
-    BOOST_REQUIRE(0 == cache.Get(3));
-}
-
-BOOST_AUTO_TEST_CASE(TestGetAll)
-{
-    cache::Cache<int, int> cache = Cache();
-
-    int keys[] = { 1, 2, 3, 4, 5 };
-    
-    std::set<int> keySet (keys, keys + 5);
-
-    for (int i = 0; i < keySet.size(); i++)
-        cache.Put(i + 1, i + 1);
-
-    std::map<int, int> map = cache.GetAll(keySet);
-
-    for (int i = 0; i < keySet.size(); i++)
-        BOOST_REQUIRE(i + 1 == map[i + 1]);
-}
-
-BOOST_AUTO_TEST_CASE(TestGetAndPut)
-{
-    cache::Cache<int, int> cache = Cache();
-
-    BOOST_REQUIRE(0 == cache.GetAndPut(1, 3));
-    BOOST_REQUIRE(3 == cache.GetAndPut(1, 1));
-    BOOST_REQUIRE(1 == cache.GetAndPut(1, 0));
-}
-
-BOOST_AUTO_TEST_CASE(TestGetAndPutIfAbsent)
-{
-    cache::Cache<int, int> cache = Cache();
-
-    BOOST_REQUIRE(0 == cache.GetAndPutIfAbsent(1, 3));
-    BOOST_REQUIRE(3 == cache.GetAndPutIfAbsent(1, 1));
-    BOOST_REQUIRE(3 == cache.GetAndPutIfAbsent(1, 1));
-}
-
-BOOST_AUTO_TEST_CASE(TestGetAndRemove)
-{
-    cache::Cache<int, int> cache = Cache();
-
-    cache.Put(1, 3);
-
-    BOOST_REQUIRE(3 == cache.GetAndRemove(1));
-    BOOST_REQUIRE(0 == cache.GetAndRemove(1));
-}
-
-BOOST_AUTO_TEST_CASE(TestGetAndReplace)
-{
-    cache::Cache<int, int> cache = Cache();
-
-    BOOST_REQUIRE(0 == cache.GetAndReplace(1, 3));
-    BOOST_REQUIRE(0 == cache.GetAndReplace(1, 3));
-
-    cache.Put(1, 5);
-
-    BOOST_REQUIRE(5 == cache.GetAndReplace(1, 3));
-    BOOST_REQUIRE(3 == cache.GetAndReplace(1, 3));
-}
-
-BOOST_AUTO_TEST_CASE(TestContainsKey)
-{
-    cache::Cache<int, int> cache = Cache();
-
-    BOOST_REQUIRE(false == cache.ContainsKey(1));
-
-    cache.Put(1, 1);
-
-    BOOST_REQUIRE(true == cache.ContainsKey(1));
-
-    BOOST_REQUIRE(true == cache.Remove(1));
-    
-    BOOST_REQUIRE(false == cache.ContainsKey(1));
-}
-
-BOOST_AUTO_TEST_CASE(TestContainsKeys)
-{
-    cache::Cache<int, int> cache = Cache();
-    
-    int keys[] = { 1, 2 };
-
-    std::set<int> keySet(keys, keys + 2);
-
-    BOOST_REQUIRE(false == cache.ContainsKeys(keySet));
-
-    cache.Put(1, 1);
-    cache.Put(2, 2);
-    
-    BOOST_REQUIRE(true == cache.ContainsKeys(keySet));
-
-    cache.Remove(1);
-
-    BOOST_REQUIRE(false == cache.ContainsKeys(keySet));
-}
-
-BOOST_AUTO_TEST_CASE(TestIsEmpty)
-{
-    cache::Cache<int, int> cache = Cache();
-
-    BOOST_REQUIRE(true == cache.IsEmpty());
-
-    cache.Put(1, 1);
-
-    BOOST_REQUIRE(false == cache.IsEmpty());
-
-    cache.Remove(1);
-
-    BOOST_REQUIRE(true == cache.IsEmpty());
-}
-
-BOOST_AUTO_TEST_CASE(TestRemove)
-{
-    cache::Cache<int, int> cache = Cache();
-
-    BOOST_REQUIRE(false == cache.Remove(1));
-
-    cache.Put(1, 1);
-
-    BOOST_REQUIRE(true == cache.Remove(1));
-    BOOST_REQUIRE(false == cache.Remove(1));
-    BOOST_REQUIRE(false == cache.ContainsKey(1));
-}
-
-BOOST_AUTO_TEST_CASE(TestClear)
-{
-    cache::Cache<int, int> cache = Cache();
-
-    cache.Put(1, 1);
-
-    BOOST_REQUIRE(true == cache.ContainsKey(1));
-
-    cache.Clear(1);
-
-    BOOST_REQUIRE(false == cache.ContainsKey(1));
-}
-
-BOOST_AUTO_TEST_CASE(TestLocalClear)
-{
-    cache::Cache<int, int> cache = Cache();
-
-    cache.Put(0, 2);
-
-    BOOST_REQUIRE(2 == cache.LocalPeek(0, cache::IGNITE_PEEK_MODE_PRIMARY));
-
-    cache.LocalClear(0);
-
-    BOOST_REQUIRE(0 == cache.LocalPeek(0, cache::IGNITE_PEEK_MODE_PRIMARY));
-}
-
-BOOST_AUTO_TEST_CASE(TestLocalClearAll)
-{
-    cache::Cache<int, int> cache = Cache();
-
-    cache.Put(0, 3);
-    cache.Put(1, 3);
-
-    int keys[] = { 0, 1 };
-
-    std::set<int> keySet(keys, keys + 2);
-
-    BOOST_REQUIRE(3 == cache.LocalPeek(0, cache::IGNITE_PEEK_MODE_PRIMARY));
-    BOOST_REQUIRE(3 == cache.LocalPeek(1, cache::IGNITE_PEEK_MODE_PRIMARY));
-
-    cache.LocalClearAll(keySet);
-
-    BOOST_REQUIRE(0 == cache.LocalPeek(0, cache::IGNITE_PEEK_MODE_PRIMARY));
-    BOOST_REQUIRE(0 == cache.LocalPeek(1, cache::IGNITE_PEEK_MODE_PRIMARY));
-}
-
-BOOST_AUTO_TEST_CASE(TestSizes)
-{
-    cache::Cache<int, int> cache = Cache();
-
-    BOOST_REQUIRE(0 == cache.Size());
-
-    cache.Put(1, 1);
-    cache.Put(2, 2);
-
-    BOOST_REQUIRE(2 <= cache.Size());
-
-    BOOST_REQUIRE(1 <= cache.LocalSize(cache::IGNITE_PEEK_MODE_PRIMARY));
-}
-
-BOOST_AUTO_TEST_CASE(TestLocalEvict)
-{
-    cache::Cache<int, int> cache = Cache();
-
-    cache.Put(1, 5);
-
-    BOOST_REQUIRE(5 == cache.LocalPeek(1, cache::IGNITE_PEEK_MODE_ONHEAP));
-
-    int keys[] = { 0, 1 };
-
-    std::set<int> keySet(keys, keys + 2);
-
-    cache.LocalEvict(keySet);
-
-    BOOST_REQUIRE(0 == cache.LocalPeek(1, cache::IGNITE_PEEK_MODE_ONHEAP));
-
-    BOOST_REQUIRE(5 == cache.Get(1));
-
-    BOOST_REQUIRE(5 == cache.LocalPeek(1, cache::IGNITE_PEEK_MODE_ONHEAP));
-}
-
-BOOST_AUTO_TEST_CASE(TestPortable)
-{
-    cache::Cache<int, Person> cache = grid0.GetCache<int, Person>("partitioned");
-
-    Person person("John Johnson", 3);
-
-    cache.Put(1, person);
-
-    Person person0 = cache.Get(1);
-
-    BOOST_REQUIRE(person.age == person0.age);
-    BOOST_REQUIRE(person.name.compare(person0.name) == 0);
-}
-
-BOOST_AUTO_TEST_CASE(TestCreateCache)
-{
-    // Create new cache
-    cache::Cache<int, int> cache = grid0.CreateCache<int, int>("dynamic_cache");
-
-    cache.Put(5, 7);
-
-    BOOST_REQUIRE(7 == cache.Get(5));
-
-    // Attempt to create cache with existing name
-    IgniteError err;
-
-    grid0.CreateCache<int, int>("dynamic_cache", &err);
-
-    BOOST_REQUIRE(err.GetCode() != IgniteError::IGNITE_SUCCESS);
-}
-
-BOOST_AUTO_TEST_CASE(TestGetOrCreateCache)
-{
-    // Get existing cache
-    cache::Cache<int, int> cache = grid0.GetOrCreateCache<int, int>("partitioned");
-
-    cache.Put(5, 7);
-
-    BOOST_REQUIRE(7 == cache.Get(5));
-
-    // Create new cache
-    cache::Cache<int, int> cache2 = grid0.GetOrCreateCache<int, int>("partitioned_new");
-
-    cache2.Put(5, 7);
-
-    BOOST_REQUIRE(7 == cache2.Get(5));
-}
-
-BOOST_AUTO_TEST_SUITE_END()
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/core-test/src/concurrent_test.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core-test/src/concurrent_test.cpp b/modules/platform/src/main/cpp/core-test/src/concurrent_test.cpp
deleted file mode 100644
index 2d89b7a..0000000
--- a/modules/platform/src/main/cpp/core-test/src/concurrent_test.cpp
+++ /dev/null
@@ -1,186 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef _MSC_VER
-    #define BOOST_TEST_DYN_LINK
-#endif
-
-#include <boost/test/unit_test.hpp>
-
-#include <ignite/common/concurrent.h>
-
-using namespace ignite::common::concurrent;
-
-BOOST_AUTO_TEST_SUITE(ConcurrentTestSuite)
-
-BOOST_AUTO_TEST_CASE(TestAtomic32)
-{
-    int32_t val = 1;
-
-    BOOST_REQUIRE(Atomics::CompareAndSet32(&val, 1, 2));
-    BOOST_REQUIRE(val == 2);
-
-    BOOST_REQUIRE(!Atomics::CompareAndSet32(&val, 3, 1));
-    BOOST_REQUIRE(val == 2);
-
-    BOOST_REQUIRE(Atomics::CompareAndSet32Val(&val, 2, 3) == 2);
-    BOOST_REQUIRE(val == 3);
-
-    BOOST_REQUIRE(Atomics::CompareAndSet32Val(&val, 4, 2) == 3);
-    BOOST_REQUIRE(val == 3);
-
-    BOOST_REQUIRE(Atomics::IncrementAndGet32(&val) == 4);
-    BOOST_REQUIRE(val == 4);
-
-    BOOST_REQUIRE(Atomics::DecrementAndGet32(&val) == 3);
-    BOOST_REQUIRE(val == 3);
-}
-
-BOOST_AUTO_TEST_CASE(TestAtomic64)
-{
-    int64_t val = 1;
-
-    BOOST_REQUIRE(Atomics::CompareAndSet64(&val, 1, 2));
-    BOOST_REQUIRE(val == 2);
-
-    BOOST_REQUIRE(!Atomics::CompareAndSet64(&val, 3, 1));
-    BOOST_REQUIRE(val == 2);
-
-    BOOST_REQUIRE(Atomics::CompareAndSet64Val(&val, 2, 3) == 2);
-    BOOST_REQUIRE(val == 3);
-
-    BOOST_REQUIRE(Atomics::CompareAndSet64Val(&val, 4, 2) == 3);
-    BOOST_REQUIRE(val == 3);
-
-    BOOST_REQUIRE(Atomics::IncrementAndGet64(&val) == 4);
-    BOOST_REQUIRE(val == 4);
-
-    BOOST_REQUIRE(Atomics::DecrementAndGet64(&val) == 3);
-    BOOST_REQUIRE(val == 3);
-}
-
-BOOST_AUTO_TEST_CASE(TestThreadLocal)
-{
-    int32_t idx1 = ThreadLocal::NextIndex();
-    int32_t idx2 = ThreadLocal::NextIndex();
-    BOOST_REQUIRE(idx2 > idx1);
-
-    BOOST_REQUIRE(ThreadLocal::Get<int32_t>(idx1) == 0);
-
-    ThreadLocal::Set(idx1, 1);
-    BOOST_REQUIRE(ThreadLocal::Get<int32_t>(idx1) == 1);
-
-    ThreadLocal::Set(idx1, 2);
-    BOOST_REQUIRE(ThreadLocal::Get<int32_t>(idx1) == 2);
-
-    ThreadLocal::Remove(idx1);
-    BOOST_REQUIRE(ThreadLocal::Get<int32_t>(idx1) == 0);
-    
-    ThreadLocal::Set(idx1, 1);
-    BOOST_REQUIRE(ThreadLocal::Get<int32_t>(idx1) == 1);
-
-    ThreadLocal::Remove(idx1);
-}
-
-BOOST_AUTO_TEST_CASE(TestThreadLocalInstance)
-{
-    ThreadLocalInstance<int32_t> val;
-
-    BOOST_REQUIRE(val.Get() == 0);
-
-    val.Set(1);
-    BOOST_REQUIRE(val.Get() == 1);
-
-    val.Set(2);
-    BOOST_REQUIRE(val.Get() == 2);
-
-    val.Remove();
-    BOOST_REQUIRE(val.Get() == 0);
-
-    val.Set(1);
-    BOOST_REQUIRE(val.Get() == 1);
-
-    val.Remove();
-}
-
-struct SharedPointerTarget
-{
-    bool deleted;
-
-    SharedPointerTarget() : deleted(false)
-    {
-        // No-op.
-    }
-};
-
-void DeleteSharedPointerTarget(SharedPointerTarget* ptr)
-{
-    ptr->deleted = true;
-}
-
-BOOST_AUTO_TEST_CASE(TestSharedPointer)
-{
-    // 1. Test the simples scenario.
-    SharedPointerTarget* target = new SharedPointerTarget();
-
-    SharedPointer<SharedPointerTarget>* ptr1 = 
-        new SharedPointer<SharedPointerTarget>(target, DeleteSharedPointerTarget);
-
-    delete ptr1;
-    BOOST_REQUIRE(target->deleted);
-
-    target->deleted = false;
-
-    // 2. Test copy ctor.
-    ptr1 = new SharedPointer<SharedPointerTarget>(target, DeleteSharedPointerTarget);
-    SharedPointer<SharedPointerTarget>* ptr2 = new SharedPointer<SharedPointerTarget>(*ptr1);
-
-    delete ptr1;
-    BOOST_REQUIRE(!target->deleted);
-
-    delete ptr2;
-    BOOST_REQUIRE(target->deleted);
-
-    target->deleted = false;
-
-    // 3. Test assignment logic.
-    ptr1 = new SharedPointer<SharedPointerTarget>(target, DeleteSharedPointerTarget);
-
-    SharedPointer<SharedPointerTarget> ptr3 = *ptr1;
-
-    delete ptr1;
-    BOOST_REQUIRE(!target->deleted);
-
-    ptr3 = SharedPointer<SharedPointerTarget>();
-    BOOST_REQUIRE(target->deleted);
-
-    target->deleted = false;
-
-    // 4. Test self-assignment.
-    ptr1 = new SharedPointer<SharedPointerTarget>(target, DeleteSharedPointerTarget);
-
-    *ptr1 = *ptr1;
-
-    delete ptr1;
-
-    BOOST_REQUIRE(target->deleted);
-
-    // 5. Tear-down.
-    delete target;    
-}
-
-BOOST_AUTO_TEST_SUITE_END()
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/core-test/src/handle_registry_test.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core-test/src/handle_registry_test.cpp b/modules/platform/src/main/cpp/core-test/src/handle_registry_test.cpp
deleted file mode 100644
index bc4a654..0000000
--- a/modules/platform/src/main/cpp/core-test/src/handle_registry_test.cpp
+++ /dev/null
@@ -1,176 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef _MSC_VER
-    #define BOOST_TEST_DYN_LINK
-#endif
-
-#include <boost/test/unit_test.hpp>
-
-#include "ignite/impl/handle_registry.h"
-
-using namespace ignite::common::concurrent;
-using namespace ignite::impl;
-
-struct HandleRegistryTestProbe
-{
-    bool deleted;
-    
-    HandleRegistryTestProbe()
-    {
-        deleted = false;
-    }
-};
-
-class HandleRegistryTestEntry : public HandleRegistryEntry
-{
-public:
-    HandleRegistryTestEntry(HandleRegistryTestProbe* probe) : probe(probe)
-    {
-        // No-op.
-    }
-
-    virtual ~HandleRegistryTestEntry()
-    {
-        probe->deleted = true;
-    }
-
-private:
-    HandleRegistryTestProbe* probe;
-};
-
-BOOST_AUTO_TEST_SUITE(HandleRegistryTestSuite)
-
-BOOST_AUTO_TEST_CASE(TestCritical)
-{
-    HandleRegistry reg(2, 1);
-
-    HandleRegistryTestProbe probe0;
-    HandleRegistryTestProbe probe1;
-    HandleRegistryTestProbe probe2;
-
-    HandleRegistryTestEntry* entry0 = new HandleRegistryTestEntry(&probe0);
-    HandleRegistryTestEntry* entry1 = new HandleRegistryTestEntry(&probe1);
-    HandleRegistryTestEntry* entry2 = new HandleRegistryTestEntry(&probe2);
-
-    int64_t hnd0 = reg.AllocateCritical(SharedPointer<HandleRegistryEntry>(entry0));
-    int64_t hnd1 = reg.AllocateCritical(SharedPointer<HandleRegistryEntry>(entry1));
-    int64_t hnd2 = reg.AllocateCritical(SharedPointer<HandleRegistryEntry>(entry2));
-
-    BOOST_REQUIRE(reg.Get(hnd0).Get() == entry0);
-    BOOST_REQUIRE(!probe0.deleted);
-
-    BOOST_REQUIRE(reg.Get(hnd1).Get() == entry1);
-    BOOST_REQUIRE(!probe1.deleted);
-
-    BOOST_REQUIRE(reg.Get(hnd2).Get() == entry2);
-    BOOST_REQUIRE(!probe2.deleted);
-
-    reg.Release(hnd0);
-
-    BOOST_REQUIRE(reg.Get(hnd0).Get() == NULL);
-    BOOST_REQUIRE(probe0.deleted);
-
-    BOOST_REQUIRE(reg.Get(hnd1).Get() == entry1);
-    BOOST_REQUIRE(!probe1.deleted);
-
-    BOOST_REQUIRE(reg.Get(hnd2).Get() == entry2);
-    BOOST_REQUIRE(!probe2.deleted);
-
-    reg.Close();
-
-    BOOST_REQUIRE(reg.Get(hnd0).Get() == NULL);
-    BOOST_REQUIRE(probe0.deleted);
-
-    BOOST_REQUIRE(reg.Get(hnd1).Get() == NULL);
-    BOOST_REQUIRE(probe1.deleted);
-
-    BOOST_REQUIRE(reg.Get(hnd2).Get() == NULL);
-    BOOST_REQUIRE(probe2.deleted);
-
-    HandleRegistry closedReg(2, 1);
-
-    closedReg.Close();
-
-    HandleRegistryTestProbe closedProbe;
-    HandleRegistryTestEntry* closedEntry = new HandleRegistryTestEntry(&closedProbe);
-
-    int64_t closedHnd = closedReg.AllocateCritical(SharedPointer<HandleRegistryEntry>(closedEntry));
-    BOOST_REQUIRE(closedHnd == -1);
-    BOOST_REQUIRE(closedProbe.deleted);
-}
-
-BOOST_AUTO_TEST_CASE(TestNonCritical)
-{
-    HandleRegistry reg(0, 2);
-
-    HandleRegistryTestProbe probe0;
-    HandleRegistryTestProbe probe1;
-    HandleRegistryTestProbe probe2;
-
-    HandleRegistryTestEntry* entry0 = new HandleRegistryTestEntry(&probe0);
-    HandleRegistryTestEntry* entry1 = new HandleRegistryTestEntry(&probe1);
-    HandleRegistryTestEntry* entry2 = new HandleRegistryTestEntry(&probe2);
-
-    int64_t hnd0 = reg.AllocateCritical(SharedPointer<HandleRegistryEntry>(entry0));
-    int64_t hnd1 = reg.Allocate(SharedPointer<HandleRegistryEntry>(entry1));
-    int64_t hnd2 = reg.Allocate(SharedPointer<HandleRegistryEntry>(entry2));
-
-    BOOST_REQUIRE(reg.Get(hnd0).Get() == entry0);
-    BOOST_REQUIRE(!probe0.deleted);
-
-    BOOST_REQUIRE(reg.Get(hnd1).Get() == entry1);
-    BOOST_REQUIRE(!probe1.deleted);
-
-    BOOST_REQUIRE(reg.Get(hnd2).Get() == entry2);
-    BOOST_REQUIRE(!probe2.deleted);
-
-    reg.Release(hnd0);
-
-    BOOST_REQUIRE(reg.Get(hnd0).Get() == NULL);
-    BOOST_REQUIRE(probe0.deleted);
-
-    BOOST_REQUIRE(reg.Get(hnd1).Get() == entry1);
-    BOOST_REQUIRE(!probe1.deleted);
-
-    BOOST_REQUIRE(reg.Get(hnd2).Get() == entry2);
-    BOOST_REQUIRE(!probe2.deleted);
-
-    reg.Close();
-
-    BOOST_REQUIRE(reg.Get(hnd0).Get() == NULL);
-    BOOST_REQUIRE(probe0.deleted);
-
-    BOOST_REQUIRE(reg.Get(hnd1).Get() == NULL);
-    BOOST_REQUIRE(probe1.deleted);
-
-    BOOST_REQUIRE(reg.Get(hnd2).Get() == NULL);
-    BOOST_REQUIRE(probe2.deleted);
-
-    HandleRegistry closedReg(0, 2);
-
-    closedReg.Close();
-
-    HandleRegistryTestProbe closedProbe;
-    HandleRegistryTestEntry* closedEntry = new HandleRegistryTestEntry(&closedProbe);
-
-    int64_t closedHnd = closedReg.Allocate(SharedPointer<HandleRegistryEntry>(closedEntry));
-    BOOST_REQUIRE(closedHnd == -1);
-    BOOST_REQUIRE(closedProbe.deleted);
-}
-
-BOOST_AUTO_TEST_SUITE_END()
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/core-test/src/ignition_test.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core-test/src/ignition_test.cpp b/modules/platform/src/main/cpp/core-test/src/ignition_test.cpp
deleted file mode 100644
index e0e26d3..0000000
--- a/modules/platform/src/main/cpp/core-test/src/ignition_test.cpp
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef _MSC_VER
-    #define BOOST_TEST_DYN_LINK
-#endif
-
-#include <boost/test/unit_test.hpp>
-
-#include "ignite/ignite.h"
-#include "ignite/ignition.h"
-
-using namespace ignite;
-using namespace boost::unit_test;
-
-BOOST_AUTO_TEST_SUITE(IgnitionTestSuite)
-
-BOOST_AUTO_TEST_CASE(TestIgnition)
-{
-    IgniteConfiguration cfg;
-
-    IgniteJvmOption opts[5];
-
-    opts[0] = IgniteJvmOption("-Xdebug");
-    opts[1] = IgniteJvmOption("-Xnoagent");
-    opts[2] = IgniteJvmOption("-Djava.compiler=NONE");
-    opts[3] = IgniteJvmOption("-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005");
-    opts[4] = IgniteJvmOption("-XX:+HeapDumpOnOutOfMemoryError");
-
-    cfg.jvmOptsLen = 5;
-    cfg.jvmOpts = opts;
-
-#ifdef IGNITE_TESTS_32
-        cfg.jvmInitMem = 256;
-        cfg.jvmMaxMem = 768;
-#else
-        cfg.jvmInitMem = 1024;
-        cfg.jvmMaxMem = 4096;
-#endif
-
-    char* cfgPath = getenv("IGNITE_NATIVE_TEST_CPP_CONFIG_PATH");
-
-    std::string cfgPathStr = std::string(cfgPath).append("/").append("cache-test.xml");
-
-    cfg.springCfgPath = const_cast<char*>(cfgPathStr.c_str());
-
-    IgniteError err;
-
-    // Start two Ignite instances.
-    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);
-
-    if (err.GetCode() != IgniteError::IGNITE_SUCCESS)
-        BOOST_ERROR(err.GetText());
-
-    BOOST_REQUIRE(strcmp(grid2.GetName(), "ignitionTest-2") == 0);
-
-    // Test get
-    Ignite grid0 = Ignition::Get("ignitionTest-1", &err);
-    
-    if (err.GetCode() != IgniteError::IGNITE_SUCCESS)
-        BOOST_ERROR(err.GetText());
-
-    BOOST_REQUIRE(strcmp(grid0.GetName(), grid1.GetName()) == 0);
-
-    // Stop one grid
-    Ignition::Stop(grid1.GetName(), true);
-    
-    Ignition::Get("ignitionTest-1", &err);
-    BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_GENERIC);
-    
-    Ignition::Get("ignitionTest-2", &err);
-    BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_SUCCESS);
-
-    // Stop all
-    Ignition::StopAll(true);
-    
-    Ignition::Get("ignitionTest-2", &err);
-    BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_GENERIC);    
-}
-
-BOOST_AUTO_TEST_SUITE_END()
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/core-test/src/portable_reader_writer_raw_test.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core-test/src/portable_reader_writer_raw_test.cpp b/modules/platform/src/main/cpp/core-test/src/portable_reader_writer_raw_test.cpp
deleted file mode 100644
index c3a98aa..0000000
--- a/modules/platform/src/main/cpp/core-test/src/portable_reader_writer_raw_test.cpp
+++ /dev/null
@@ -1,1532 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef _MSC_VER
-    #define BOOST_TEST_DYN_LINK
-#endif
-
-#include <boost/test/unit_test.hpp>
-
-#include "ignite/impl/interop/interop.h"
-#include "ignite/portable/portable.h"
-
-#include "ignite/portable_test_defs.h"
-#include "ignite/portable_test_utils.h"
-
-using namespace ignite;
-using namespace ignite::impl::interop;
-using namespace ignite::impl::portable;
-using namespace ignite::portable;
-using namespace ignite_test::core::portable;
-
-template<typename T>
-void CheckRawPrimitive(T val)
-{
-    InteropUnpooledMemory mem(1024);
-
-    InteropOutputStream out(&mem);
-    PortableWriterImpl writer(&out, NULL);
-    PortableRawWriter rawWriter(&writer);
-
-    Write<T>(rawWriter, val);
-
-    out.Synchronize();
-
-    InteropInputStream in(&mem);
-    PortableReaderImpl reader(&in);
-    PortableRawReader rawReader(&reader);
-
-    T readVal = Read<T>(rawReader);
-    
-    BOOST_REQUIRE(readVal == val);
-}
-
-template<typename T>
-void CheckRawPrimitiveArray(T dflt, T val1, T val2)
-{
-    InteropUnpooledMemory mem(1024);
-
-    InteropOutputStream out(&mem);
-    PortableWriterImpl writer(&out, NULL);
-    PortableRawWriter rawWriter(&writer);
-    
-    InteropInputStream in(&mem);
-    PortableReaderImpl reader(&in);
-    PortableRawReader rawReader(&reader);
-
-    // 1. Write NULL and see what happens.
-    WriteArray<T>(rawWriter, NULL, 0);
-
-    out.Synchronize();
-    in.Synchronize();
-    
-    BOOST_REQUIRE(ReadArray<T>(rawReader, NULL, 0) == -1);
-
-    in.Position(0);
-    BOOST_REQUIRE(ReadArray<T>(rawReader, NULL, 2) == -1);
-
-    T arr1[2];
-    arr1[0] = dflt;
-    arr1[1] = dflt;
-
-    in.Position(0);
-    BOOST_REQUIRE(ReadArray<T>(rawReader, arr1, 1) == -1);
-
-    BOOST_REQUIRE(arr1[0] == dflt);
-    BOOST_REQUIRE(arr1[1] == dflt);
-
-    // 2. Write empty array.
-    T arr2[2];
-    arr2[0] = val1;
-    arr2[1] = val2;
-
-    out.Position(0);
-    in.Position(0);
-
-    WriteArray<T>(rawWriter, arr2, 0);
-
-    out.Synchronize();
-    in.Synchronize();
-
-    BOOST_REQUIRE(ReadArray<T>(rawReader, NULL, 0) == 0);
-
-    in.Position(0);
-    BOOST_REQUIRE(ReadArray<T>(rawReader, NULL, 2) == 0);
-
-    in.Position(0);
-    BOOST_REQUIRE(ReadArray<T>(rawReader, arr1, 0) == 0);
-    BOOST_REQUIRE(arr1[0] == dflt);
-    BOOST_REQUIRE(arr1[1] == dflt);
-
-    in.Position(0);
-    BOOST_REQUIRE(ReadArray<T>(rawReader, arr1, 2) == 0);
-    BOOST_REQUIRE(arr1[0] == dflt);
-    BOOST_REQUIRE(arr1[1] == dflt);
-
-    // 3. Partial array write.
-    out.Position(0);
-    in.Position(0);
-
-    WriteArray<T>(rawWriter, arr2, 1);
-
-    out.Synchronize();
-    in.Synchronize();
-
-    BOOST_REQUIRE(ReadArray<T>(rawReader, NULL, 0) == 1);
-    BOOST_REQUIRE(ReadArray<T>(rawReader, NULL, 2) == 1);
-
-    BOOST_REQUIRE(ReadArray<T>(rawReader, arr1, 0) == 1);
-    BOOST_REQUIRE(arr1[0] == dflt);
-    BOOST_REQUIRE(arr1[1] == dflt);
-
-    BOOST_REQUIRE(ReadArray<T>(rawReader, arr1, 1) == 1);
-    BOOST_REQUIRE(arr1[0] == val1);
-    BOOST_REQUIRE(arr1[1] == dflt);
-    arr1[0] = dflt;
-
-    in.Position(0);
-    BOOST_REQUIRE(ReadArray<T>(rawReader, arr1, 2) == 1);
-    BOOST_REQUIRE(arr1[0] == val1);
-    BOOST_REQUIRE(arr1[1] == dflt);
-    arr1[0] = dflt;
-
-    // 4. Full array write.
-    out.Position(0);
-    in.Position(0);
-
-    WriteArray<T>(rawWriter, arr2, 2);
-
-    out.Synchronize();
-    in.Synchronize();
-
-    BOOST_REQUIRE(ReadArray<T>(rawReader, NULL, 0) == 2);
-    BOOST_REQUIRE(ReadArray<T>(rawReader, NULL, 2) == 2);
-
-    BOOST_REQUIRE(ReadArray<T>(rawReader, arr1, 0) == 2);
-    BOOST_REQUIRE(arr1[0] == dflt);
-    BOOST_REQUIRE(arr1[1] == dflt);
-
-    BOOST_REQUIRE(ReadArray<T>(rawReader, arr1, 1) == 2);
-    BOOST_REQUIRE(arr1[0] == dflt);
-    BOOST_REQUIRE(arr1[1] == dflt);
-
-    BOOST_REQUIRE(ReadArray<T>(rawReader, arr1, 2) == 2);
-    BOOST_REQUIRE(arr1[0] == val1);
-    BOOST_REQUIRE(arr1[1] == val2);
-}
-
-void CheckRawWritesRestricted(PortableRawWriter& writer)
-{
-    try
-    {
-        writer.WriteInt8(1);
-
-        BOOST_FAIL("Not restricted.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-
-    try
-    {
-        int8_t arr[1];
-
-        writer.WriteInt8Array(arr, 1);
-
-        BOOST_FAIL("Not restricted.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-
-    try
-    {
-        Guid val(1, 1);
-
-        writer.WriteGuid(val);
-
-        BOOST_FAIL("Not restricted.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-
-    try
-    {
-        writer.WriteString("test");
-
-        BOOST_FAIL("Not restricted.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-
-    try 
-    {
-        writer.WriteArray<int8_t>();
-
-        BOOST_FAIL("Not restricted.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-
-    try 
-    {
-        writer.WriteCollection<int8_t>();
-
-        BOOST_FAIL("Not restricted.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-
-    try 
-    {
-        writer.WriteMap<int8_t, int8_t>();
-
-        BOOST_FAIL("Not restricted.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-}
-
-void CheckRawReadsRestricted(PortableRawReader& reader)
-{
-    try
-    {
-        reader.ReadInt8();
-
-        BOOST_FAIL("Not restricted.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-
-    try
-    {
-        int8_t arr[1];
-
-        reader.ReadInt8Array(arr, 1);
-
-        BOOST_FAIL("Not restricted.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-
-    try
-    {
-        reader.ReadGuid();
-
-        BOOST_FAIL("Not restricted.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-
-    try
-    {
-        reader.ReadString();
-
-        BOOST_FAIL("Not restricted.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-
-    try
-    {
-        reader.ReadArray<int8_t>();
-
-        BOOST_FAIL("Not restricted.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-
-    try
-    {
-        reader.ReadCollection<int8_t>();
-
-        BOOST_FAIL("Not restricted.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-
-    try
-    {
-        reader.ReadMap<int8_t, int8_t>();
-
-        BOOST_FAIL("Not restricted.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-}
-
-void CheckRawCollectionEmpty(CollectionType* colType)
-{
-    InteropUnpooledMemory mem(1024);
-
-    InteropOutputStream out(&mem);
-    PortableWriterImpl writer(&out, NULL);
-    PortableRawWriter rawWriter(&writer);
-
-    PortableCollectionWriter<PortableInner> colWriter = colType ?
-        rawWriter.WriteCollection<PortableInner>(*colType) : rawWriter.WriteCollection<PortableInner>();
-
-    CheckRawWritesRestricted(rawWriter);
-
-    colWriter.Close();
-
-    rawWriter.WriteInt8(1);
-
-    try
-    {
-        colWriter.Write(1);
-
-        BOOST_FAIL("Error expected.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-
-    try
-    {
-        colWriter.Close();
-
-        BOOST_FAIL("Error expected.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-
-    out.Synchronize();
-
-    InteropInputStream in(&mem);
-    PortableReaderImpl reader(&in);
-    PortableRawReader rawReader(&reader);
-
-    PortableCollectionReader<PortableInner> colReader = rawReader.ReadCollection<PortableInner>();
-
-    if (colType)
-        BOOST_REQUIRE(colReader.GetType() == *colType);
-    else
-        BOOST_REQUIRE(colReader.GetType() == IGNITE_COLLECTION_UNDEFINED);
-
-    BOOST_REQUIRE(colReader.GetSize() == 0);
-    BOOST_REQUIRE(!colReader.HasNext());
-    BOOST_REQUIRE(!colReader.IsNull());
-
-    try
-    {
-        colReader.GetNext();
-
-        BOOST_FAIL("Error expected.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-
-    BOOST_REQUIRE(rawReader.ReadInt8() == 1);
-}
-
-void CheckRawCollection(CollectionType* colType)
-{
-    PortableInner writeVal1 = PortableInner(1);
-    PortableInner writeVal2 = PortableInner(0);
-    PortableInner writeVal3 = PortableInner(2);
-
-    InteropUnpooledMemory mem(1024);
-
-    InteropOutputStream out(&mem);
-    PortableWriterImpl writer(&out, NULL);
-    PortableRawWriter rawWriter(&writer);
-
-    PortableCollectionWriter<PortableInner> colWriter = colType ?
-        rawWriter.WriteCollection<PortableInner>(*colType) : rawWriter.WriteCollection<PortableInner>();
-
-    colWriter.Write(writeVal1);
-    colWriter.Write(writeVal2);
-    colWriter.Write(writeVal3);
-
-    CheckRawWritesRestricted(rawWriter);
-
-    colWriter.Close();
-
-    rawWriter.WriteInt8(1);
-
-    try
-    {
-        colWriter.Write(1);
-
-        BOOST_FAIL("Error expected.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-
-    try
-    {
-        colWriter.Close();
-
-        BOOST_FAIL("Error expected.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-
-    out.Synchronize();
-
-    InteropInputStream in(&mem);
-    PortableReaderImpl reader(&in);
-    PortableRawReader rawReader(&reader);
-
-    PortableCollectionReader<PortableInner> colReader = rawReader.ReadCollection<PortableInner>();
-
-    CheckRawReadsRestricted(rawReader);
-
-    if (colType)
-        BOOST_REQUIRE(colReader.GetType() == *colType);
-    else
-        BOOST_REQUIRE(colReader.GetType() == IGNITE_COLLECTION_UNDEFINED);
-
-    BOOST_REQUIRE(colReader.GetSize() == 3);
-    BOOST_REQUIRE(!colReader.IsNull());
-
-    BOOST_REQUIRE(colReader.HasNext());
-    BOOST_REQUIRE(colReader.GetNext().GetValue() == writeVal1.GetValue());
-
-    BOOST_REQUIRE(colReader.HasNext());
-    BOOST_REQUIRE(colReader.GetNext().GetValue() == writeVal2.GetValue());
-
-    BOOST_REQUIRE(colReader.HasNext());
-    BOOST_REQUIRE(colReader.GetNext().GetValue() == writeVal3.GetValue());
-
-    BOOST_REQUIRE(!colReader.HasNext());
-
-    try
-    {
-        colReader.GetNext();
-
-        BOOST_FAIL("Error expected.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-
-    BOOST_REQUIRE(rawReader.ReadInt8() == 1);
-}
-
-void CheckRawMapEmpty(MapType* mapType)
-{
-    InteropUnpooledMemory mem(1024);
-
-    InteropOutputStream out(&mem);
-    PortableWriterImpl writer(&out, NULL);
-    PortableRawWriter rawWriter(&writer);
-
-    PortableMapWriter<int8_t, PortableInner> mapWriter = mapType ?
-        rawWriter.WriteMap<int8_t, PortableInner>(*mapType) : rawWriter.WriteMap<int8_t, PortableInner>();
-
-    CheckRawWritesRestricted(rawWriter);
-
-    mapWriter.Close();
-
-    rawWriter.WriteInt8(1);
-
-    try
-    {
-        mapWriter.Write(1, PortableInner(1));
-
-        BOOST_FAIL("Error expected.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-
-    try
-    {
-        mapWriter.Close();
-
-        BOOST_FAIL("Error expected.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-
-    out.Synchronize();
-
-    InteropInputStream in(&mem);
-    PortableReaderImpl reader(&in);
-    PortableRawReader rawReader(&reader);
-
-    PortableMapReader<int8_t, PortableInner> mapReader = rawReader.ReadMap<int8_t, PortableInner>();
-
-    if (mapType)
-        BOOST_REQUIRE(mapReader.GetType() == *mapType);
-    else
-        BOOST_REQUIRE(mapReader.GetType() == IGNITE_MAP_UNDEFINED);
-
-    BOOST_REQUIRE(mapReader.GetSize() == 0);
-    BOOST_REQUIRE(!mapReader.HasNext());
-    BOOST_REQUIRE(!mapReader.IsNull());
-
-    try
-    {
-        int8_t key;
-        PortableInner val;
-
-        mapReader.GetNext(&key, &val);
-
-        BOOST_FAIL("Error expected.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-
-    BOOST_REQUIRE(rawReader.ReadInt8() == 1);
-}
-
-void CheckRawMap(MapType* mapType)
-{
-    PortableInner writeVal1 = PortableInner(1);
-    PortableInner writeVal2 = PortableInner(0);
-    PortableInner writeVal3 = PortableInner(2);
-
-    InteropUnpooledMemory mem(1024);
-
-    InteropOutputStream out(&mem);
-    PortableWriterImpl writer(&out, NULL);
-    PortableRawWriter rawWriter(&writer);
-
-    PortableMapWriter<int8_t, PortableInner> mapWriter = mapType ?
-        rawWriter.WriteMap<int8_t, PortableInner>(*mapType) : rawWriter.WriteMap<int8_t, PortableInner>();
-
-    mapWriter.Write(1, writeVal1);
-    mapWriter.Write(2, writeVal2);
-    mapWriter.Write(3, writeVal3);
-
-    CheckRawWritesRestricted(rawWriter);
-
-    mapWriter.Close();
-
-    rawWriter.WriteInt8(1);
-
-    try
-    {
-        mapWriter.Write(4, PortableInner(4));
-
-        BOOST_FAIL("Error expected.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-
-    try
-    {
-        mapWriter.Close();
-
-        BOOST_FAIL("Error expected.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-
-    out.Synchronize();
-
-    InteropInputStream in(&mem);
-    PortableReaderImpl reader(&in);
-    PortableRawReader rawReader(&reader);
-
-    PortableMapReader<int8_t, PortableInner> mapReader = rawReader.ReadMap<int8_t, PortableInner>();
-
-    CheckRawReadsRestricted(rawReader);
-
-    if (mapType)
-        BOOST_REQUIRE(mapReader.GetType() == *mapType);
-    else
-        BOOST_REQUIRE(mapReader.GetType() == IGNITE_MAP_UNDEFINED);
-
-    BOOST_REQUIRE(mapReader.GetSize() == 3);
-    BOOST_REQUIRE(!mapReader.IsNull());
-
-    int8_t key;
-    PortableInner val;
-
-    BOOST_REQUIRE(mapReader.HasNext());
-
-    mapReader.GetNext(&key, &val);
-    BOOST_REQUIRE(key == 1);
-    BOOST_REQUIRE(val.GetValue() == writeVal1.GetValue());
-
-    mapReader.GetNext(&key, &val);
-    BOOST_REQUIRE(key == 2);
-    BOOST_REQUIRE(val.GetValue() == writeVal2.GetValue());
-
-    mapReader.GetNext(&key, &val);
-    BOOST_REQUIRE(key == 3);
-    BOOST_REQUIRE(val.GetValue() == writeVal3.GetValue());
-
-    BOOST_REQUIRE(!mapReader.HasNext());
-
-    try
-    {
-        mapReader.GetNext(&key, &val);
-
-        BOOST_FAIL("Error expected.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-
-    BOOST_REQUIRE(rawReader.ReadInt8() == 1);
-}
-
-BOOST_AUTO_TEST_SUITE(PortableReaderWriterRawTestSuite)
-
-BOOST_AUTO_TEST_CASE(TestPrimitiveInt8)
-{
-    CheckRawPrimitive<int8_t>(1);
-}
-
-BOOST_AUTO_TEST_CASE(TestPrimitiveBool)
-{
-    CheckRawPrimitive<bool>(true);
-}
-
-BOOST_AUTO_TEST_CASE(TestPrimitiveInt16)
-{
-    CheckRawPrimitive<int16_t>(1);
-}
-
-BOOST_AUTO_TEST_CASE(TestPrimitiveUInt16)
-{
-    CheckRawPrimitive<uint16_t>(1);
-}
-
-BOOST_AUTO_TEST_CASE(TestPrimitiveInt32)
-{
-    CheckRawPrimitive<int32_t>(1);
-}
-
-BOOST_AUTO_TEST_CASE(TestPrimitiveInt64)
-{
-    CheckRawPrimitive<int64_t>(1);
-}
-
-BOOST_AUTO_TEST_CASE(TestPrimitiveFloat)
-{
-    CheckRawPrimitive<float>(1.1f);
-}
-
-BOOST_AUTO_TEST_CASE(TestPrimitiveDouble)
-{
-    CheckRawPrimitive<double>(1.1);
-}
-
-BOOST_AUTO_TEST_CASE(TestPrimitiveGuid)
-{
-    Guid val(1, 2);
-
-    CheckRawPrimitive<Guid>(val);
-}
-
-BOOST_AUTO_TEST_CASE(TestPrimitiveArrayInt8)
-{
-    CheckRawPrimitiveArray<int8_t>(1, 2, 3);
-}
-
-BOOST_AUTO_TEST_CASE(TestPrimitiveArrayBool)
-{
-    CheckRawPrimitiveArray<bool>(false, true, false);
-}
-
-BOOST_AUTO_TEST_CASE(TestPrimitiveArrayInt16)
-{
-    CheckRawPrimitiveArray<int16_t>(1, 2, 3);
-}
-
-BOOST_AUTO_TEST_CASE(TestPrimitiveArrayUInt16)
-{
-    CheckRawPrimitiveArray<uint16_t>(1, 2, 3);
-}
-
-BOOST_AUTO_TEST_CASE(TestPrimitiveArrayInt32)
-{
-    CheckRawPrimitiveArray<int32_t>(1, 2, 3);
-}
-
-BOOST_AUTO_TEST_CASE(TestPrimitiveArrayInt64)
-{
-    CheckRawPrimitiveArray<int64_t>(1, 2, 3);
-}
-
-BOOST_AUTO_TEST_CASE(TestPrimitiveArrayFloat)
-{
-    CheckRawPrimitiveArray<float>(1.1f, 2.2f, 3.3f);
-}
-
-BOOST_AUTO_TEST_CASE(TestPrimitiveArrayDouble)
-{
-    CheckRawPrimitiveArray<double>(1.1, 2.2, 3.3);
-}
-
-BOOST_AUTO_TEST_CASE(TestPrimitiveArrayGuid)
-{
-    Guid dflt(1, 2);
-    Guid val1(3, 4);
-    Guid val2(5, 6);
-
-    CheckRawPrimitiveArray<Guid>(dflt, val1, val2);
-}
-
-BOOST_AUTO_TEST_CASE(TestGuidNull)
-{
-    InteropUnpooledMemory mem(1024);
-
-    InteropOutputStream out(&mem);
-    PortableWriterImpl writer(&out, NULL);
-    PortableRawWriter rawWriter(&writer);
-
-    rawWriter.WriteNull();
-
-    out.Synchronize();
-
-    InteropInputStream in(&mem);
-    PortableReaderImpl reader(&in);
-    PortableRawReader rawReader(&reader);
-
-    Guid expVal;
-    Guid actualVal = rawReader.ReadGuid();
-
-    BOOST_REQUIRE(actualVal == expVal);
-}
-
-BOOST_AUTO_TEST_CASE(TestString) {
-    InteropUnpooledMemory mem(1024);
-
-    InteropOutputStream out(&mem);
-    PortableWriterImpl writer(&out, NULL);
-    PortableRawWriter rawWriter(&writer);
-
-    const char* writeVal1 = "testtest";
-    const char* writeVal2 = "test";
-    std::string writeVal3 = writeVal1;
-
-    rawWriter.WriteString(writeVal1);
-    rawWriter.WriteString(writeVal1, 4);
-    rawWriter.WriteString(writeVal3);
-    rawWriter.WriteString(NULL);
-    rawWriter.WriteString(NULL, 4);
-
-    out.Synchronize();
-
-    InteropInputStream in(&mem);
-    PortableReaderImpl reader(&in);
-    PortableRawReader rawReader(&reader);
-
-    char readVal1[9];
-    char readVal2[5];
-    
-    BOOST_REQUIRE(rawReader.ReadString(NULL, 0) == 8);
-    BOOST_REQUIRE(rawReader.ReadString(NULL, 8) == 8);
-    BOOST_REQUIRE(rawReader.ReadString(readVal1, 0) == 8);
-    BOOST_REQUIRE(rawReader.ReadString(readVal1, 4) == 8);
-
-    BOOST_REQUIRE(rawReader.ReadString(readVal1, 9) == 8);
-    std::string writeVal1Str = writeVal1;
-    std::string readVal1Str = readVal1;
-    BOOST_REQUIRE(readVal1Str.compare(writeVal1Str) == 0);
-
-    BOOST_REQUIRE(rawReader.ReadString(readVal2, 5) == 4);
-    std::string writeVal2Str = writeVal2;
-    std::string readVal2Str = readVal2;
-    BOOST_REQUIRE(readVal2Str.compare(writeVal2Str) == 0);
-
-    std::string readVal3 = rawReader.ReadString();
-    BOOST_REQUIRE(readVal3.compare(writeVal3) == 0);
-
-    BOOST_REQUIRE(rawReader.ReadString(readVal1, 9) == -1);
-    BOOST_REQUIRE(rawReader.ReadString(readVal1, 9) == -1);
-}
-
-BOOST_AUTO_TEST_CASE(TestStringArrayNull)
-{
-    InteropUnpooledMemory mem(1024);
-
-    InteropOutputStream out(&mem);
-    PortableWriterImpl writer(&out, NULL);
-    PortableRawWriter rawWriter(&writer);
-
-    rawWriter.WriteNull();
-    rawWriter.WriteInt8(1);
-
-    out.Synchronize();
-
-    InteropInputStream in(&mem);
-    PortableReaderImpl reader(&in);
-    PortableRawReader rawReader(&reader);
-
-    PortableStringArrayReader arrReader = rawReader.ReadStringArray();
-
-    BOOST_REQUIRE(arrReader.GetSize() == -1);
-    BOOST_REQUIRE(!arrReader.HasNext());
-    BOOST_REQUIRE(arrReader.IsNull());
-
-    try
-    {
-        char res[100];
-
-        arrReader.GetNext(res, 100);
-
-        BOOST_FAIL("Error expected.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-
-    try
-    {
-        arrReader.GetNext();
-
-        BOOST_FAIL("Error expected.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-
-    BOOST_REQUIRE(rawReader.ReadInt8() == 1);
-}
-
-BOOST_AUTO_TEST_CASE(TestStringArrayEmpty)
-{
-    InteropUnpooledMemory mem(1024);
-
-    InteropOutputStream out(&mem);
-    PortableWriterImpl writer(&out, NULL);
-    PortableRawWriter rawWriter(&writer);
-
-    PortableStringArrayWriter arrWriter = rawWriter.WriteStringArray();
-
-    CheckRawWritesRestricted(rawWriter);
-
-    arrWriter.Close();
-
-    rawWriter.WriteInt8(1);
-
-    try
-    {
-        const char* val = "test";
-
-        arrWriter.Write(val, 4);
-
-        BOOST_FAIL("Error expected.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-
-    try
-    {
-        const char* val = "test";
-
-        arrWriter.Write(val);
-
-        BOOST_FAIL("Error expected.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-
-    try
-    {
-        std::string val = "test";
-
-        arrWriter.Write(val);
-
-        BOOST_FAIL("Error expected.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-
-    try
-    {
-        arrWriter.Close();
-
-        BOOST_FAIL("Error expected.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-
-    out.Synchronize();
-
-    InteropInputStream in(&mem);
-    PortableReaderImpl reader(&in);
-    PortableRawReader rawReader(&reader);
-
-    PortableStringArrayReader arrReader = rawReader.ReadStringArray();
-
-    BOOST_REQUIRE(arrReader.GetSize() == 0);
-    BOOST_REQUIRE(!arrReader.HasNext());
-    BOOST_REQUIRE(!arrReader.IsNull());
-
-    try
-    {
-        char res[100];
-
-        arrReader.GetNext(res, 100);
-
-        BOOST_FAIL("Error expected.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-
-    try
-    {
-        arrReader.GetNext();
-
-        BOOST_FAIL("Error expected.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-
-    BOOST_REQUIRE(rawReader.ReadInt8() == 1);
-}
-
-BOOST_AUTO_TEST_CASE(TestStringArray)
-{
-    const char* writeVal1 = "testtest";
-    const char* writeVal2 = "test";
-    std::string writeVal3 = "test2";
-
-    InteropUnpooledMemory mem(1024);
-
-    InteropOutputStream out(&mem);
-    PortableWriterImpl writer(&out, NULL);
-    PortableRawWriter rawWriter(&writer);
-
-    PortableStringArrayWriter arrWriter = rawWriter.WriteStringArray();
-
-    arrWriter.Write(writeVal1);
-    arrWriter.Write(writeVal1, 4);
-    arrWriter.Write(NULL); // NULL value.
-    arrWriter.Write(NULL, 100); // NULL value again.
-    arrWriter.Write(writeVal3);
-
-    CheckRawWritesRestricted(rawWriter);
-
-    arrWriter.Close();
-
-    rawWriter.WriteInt8(1);
-
-    try
-    {
-        const char* val = "test";
-
-        arrWriter.Write(val, 4);
-
-        BOOST_FAIL("Error expected.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-
-    try
-    {
-        const char* val = "test";
-
-        arrWriter.Write(val);
-
-        BOOST_FAIL("Error expected.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-
-    try
-    {
-        std::string val = "test";
-
-        arrWriter.Write(val);
-
-        BOOST_FAIL("Error expected.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-
-    try
-    {
-        arrWriter.Close();
-
-        BOOST_FAIL("Error expected.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-
-    out.Synchronize();
-
-    InteropInputStream in(&mem);
-    PortableReaderImpl reader(&in);
-    PortableRawReader rawReader(&reader);
-
-    PortableStringArrayReader arrReader = rawReader.ReadStringArray();
-
-    CheckRawReadsRestricted(rawReader);
-
-    BOOST_REQUIRE(arrReader.GetSize() == 5);
-    BOOST_REQUIRE(!arrReader.IsNull());
-
-    // 1. Read first value.
-    BOOST_REQUIRE(arrReader.HasNext());
-        
-    char readVal1[9];
-    
-    BOOST_REQUIRE(arrReader.GetNext(NULL, 0) == 8);
-    BOOST_REQUIRE(arrReader.GetNext(NULL, 8) == 8);
-    BOOST_REQUIRE(arrReader.GetNext(readVal1, 0) == 8);
-    BOOST_REQUIRE(arrReader.GetNext(readVal1, 4) == 8);
-
-    BOOST_REQUIRE(arrReader.GetNext(readVal1, 9) == 8);
-    std::string writeVal1Str = writeVal1;
-    std::string readVal1Str = readVal1;
-    BOOST_REQUIRE(readVal1Str.compare(writeVal1Str) == 0);
-
-    // 2. Read second value.
-    BOOST_REQUIRE(arrReader.HasNext());
-
-    char readVal2[5];
-
-    BOOST_REQUIRE(arrReader.GetNext(readVal2, 5) == 4);
-    std::string writeVal2Str = writeVal2;
-    std::string readVal2Str = readVal2;
-    BOOST_REQUIRE(readVal2Str.compare(writeVal2Str) == 0);
-
-    // 3. Read NULL.
-    BOOST_REQUIRE(arrReader.HasNext());
-
-    BOOST_REQUIRE(arrReader.GetNext(readVal1, 4) == -1);
-    readVal1Str = readVal1;
-    BOOST_REQUIRE(readVal1Str.compare(writeVal1Str) == 0);
-
-    // 4. Read NULL again, this time through another method.
-    BOOST_REQUIRE(arrReader.HasNext());
-
-    std::string readNullVal = arrReader.GetNext();
-
-    BOOST_REQUIRE(readNullVal.length() == 0);
-
-    // 5. Read third value.
-    BOOST_REQUIRE(arrReader.HasNext());
-
-    std::string readVal3 = arrReader.GetNext();
-    BOOST_REQUIRE(readVal3.compare(writeVal3) == 0);
-
-    BOOST_REQUIRE(!arrReader.HasNext());
-
-    try
-    {
-        char res[100];
-
-        arrReader.GetNext(res, 100);
-
-        BOOST_FAIL("Error expected.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-
-    try
-    {
-        arrReader.GetNext();
-
-        BOOST_FAIL("Error expected.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-
-    BOOST_REQUIRE(rawReader.ReadInt8() == 1);
-}
-
-BOOST_AUTO_TEST_CASE(TestObject)
-{
-    PortableInner writeVal1(1);
-    PortableInner writeVal2(0);
-
-    InteropUnpooledMemory mem(1024);
-
-    InteropOutputStream out(&mem);
-    PortableWriterImpl writer(&out, NULL);
-    PortableRawWriter rawWriter(&writer);
-
-    rawWriter.WriteObject(writeVal1);
-    rawWriter.WriteObject(writeVal2);
-    rawWriter.WriteNull();
-
-    out.Synchronize();
-
-    InteropInputStream in(&mem);
-    PortableReaderImpl reader(&in);
-    PortableRawReader rawReader(&reader);
-
-    PortableInner readVal1 = rawReader.ReadObject<PortableInner>();
-    BOOST_REQUIRE(writeVal1.GetValue() == readVal1.GetValue());
-
-    PortableInner readVal2 = rawReader.ReadObject<PortableInner>();
-    BOOST_REQUIRE(writeVal2.GetValue() == readVal2.GetValue());
-
-    PortableInner readVal3 = rawReader.ReadObject<PortableInner>();
-    BOOST_REQUIRE(0 == readVal3.GetValue());
-}
-
-BOOST_AUTO_TEST_CASE(TestNestedObject)
-{
-    PortableOuter writeVal1(1, 2);
-    PortableOuter writeVal2(0, 0);
-
-    InteropUnpooledMemory mem(1024);
-
-    InteropOutputStream out(&mem);
-    PortableWriterImpl writer(&out, NULL);
-    PortableRawWriter rawWriter(&writer);
-
-    rawWriter.WriteObject(writeVal1);
-    rawWriter.WriteObject(writeVal2);
-    rawWriter.WriteNull();
-
-    out.Synchronize();
-
-    InteropInputStream in(&mem);
-    PortableReaderImpl reader(&in);
-    PortableRawReader rawReader(&reader);
-
-    PortableOuter readVal1 = rawReader.ReadObject<PortableOuter>();
-    BOOST_REQUIRE(writeVal1.GetValue() == readVal1.GetValue());
-    BOOST_REQUIRE(writeVal1.GetInner().GetValue() == readVal1.GetInner().GetValue());
-
-    PortableOuter readVal2 = rawReader.ReadObject<PortableOuter>();
-    BOOST_REQUIRE(writeVal2.GetValue() == readVal2.GetValue());
-    BOOST_REQUIRE(writeVal2.GetInner().GetValue() == readVal2.GetInner().GetValue());
-
-    PortableOuter readVal3 = rawReader.ReadObject<PortableOuter>();
-    BOOST_REQUIRE(0 == readVal3.GetValue());
-    BOOST_REQUIRE(0 == readVal3.GetInner().GetValue());
-}
-
-BOOST_AUTO_TEST_CASE(TestArrayNull)
-{
-    InteropUnpooledMemory mem(1024);
-
-    InteropOutputStream out(&mem);
-    PortableWriterImpl writer(&out, NULL);
-    PortableRawWriter rawWriter(&writer);
-
-    rawWriter.WriteNull();
-    rawWriter.WriteInt8(1);
-
-    out.Synchronize();
-
-    InteropInputStream in(&mem);
-    PortableReaderImpl reader(&in);
-    PortableRawReader rawReader(&reader);
-
-    PortableArrayReader<PortableInner> arrReader = rawReader.ReadArray<PortableInner>();
-
-    BOOST_REQUIRE(arrReader.GetSize() == -1);
-    BOOST_REQUIRE(!arrReader.HasNext());
-    BOOST_REQUIRE(arrReader.IsNull());
-
-    try
-    {
-        arrReader.GetNext();
-
-        BOOST_FAIL("Error expected.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-
-    BOOST_REQUIRE(rawReader.ReadInt8() == 1);
-}
-
-BOOST_AUTO_TEST_CASE(TestArrayEmpty) 
-{
-    InteropUnpooledMemory mem(1024);
-
-    InteropOutputStream out(&mem);
-    PortableWriterImpl writer(&out, NULL);
-    PortableRawWriter rawWriter(&writer);
-
-    PortableArrayWriter<PortableInner> arrWriter = rawWriter.WriteArray<PortableInner>();
-
-    CheckRawWritesRestricted(rawWriter);
-
-    arrWriter.Close();
-
-    rawWriter.WriteInt8(1);
-
-    try
-    {
-        arrWriter.Write(1);
-
-        BOOST_FAIL("Error expected.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-
-    try
-    {
-        arrWriter.Close();
-
-        BOOST_FAIL("Error expected.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-
-    out.Synchronize();
-
-    InteropInputStream in(&mem);
-    PortableReaderImpl reader(&in);
-    PortableRawReader rawReader(&reader);
-
-    PortableArrayReader<PortableInner> arrReader = rawReader.ReadArray<PortableInner>();
-
-    BOOST_REQUIRE(arrReader.GetSize() == 0);
-    BOOST_REQUIRE(!arrReader.HasNext());
-    BOOST_REQUIRE(!arrReader.IsNull());
-
-    try
-    {
-        arrReader.GetNext();
-
-        BOOST_FAIL("Error expected.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-
-    BOOST_REQUIRE(rawReader.ReadInt8() == 1);
-}
-
-BOOST_AUTO_TEST_CASE(TestArray)
-{
-    PortableInner writeVal1 = PortableInner(1);
-    PortableInner writeVal2 = PortableInner(0);
-    PortableInner writeVal3 = PortableInner(2);
-
-    InteropUnpooledMemory mem(1024);
-
-    InteropOutputStream out(&mem);
-    PortableWriterImpl writer(&out, NULL);
-    PortableRawWriter rawWriter(&writer);
-
-    PortableArrayWriter<PortableInner> arrWriter = rawWriter.WriteArray<PortableInner>();
-
-    arrWriter.Write(writeVal1); 
-    arrWriter.Write(writeVal2);
-    arrWriter.Write(writeVal3);
-
-    CheckRawWritesRestricted(rawWriter);
-
-    arrWriter.Close();
-
-    rawWriter.WriteInt8(1);
-
-    try
-    {
-        arrWriter.Write(1);
-
-        BOOST_FAIL("Error expected.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-
-    try
-    {
-        arrWriter.Close();
-
-        BOOST_FAIL("Error expected.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-
-    out.Synchronize();
-
-    InteropInputStream in(&mem);
-    PortableReaderImpl reader(&in);
-    PortableRawReader rawReader(&reader);
-
-    PortableArrayReader<PortableInner> arrReader = rawReader.ReadArray<PortableInner>();
-
-    CheckRawReadsRestricted(rawReader);
-
-    BOOST_REQUIRE(arrReader.GetSize() == 3);
-    BOOST_REQUIRE(!arrReader.IsNull());
-
-    BOOST_REQUIRE(arrReader.HasNext());
-    BOOST_REQUIRE(arrReader.GetNext().GetValue() == writeVal1.GetValue());
-
-    BOOST_REQUIRE(arrReader.HasNext());
-    BOOST_REQUIRE(arrReader.GetNext().GetValue() == writeVal2.GetValue());
-
-    BOOST_REQUIRE(arrReader.HasNext());
-    BOOST_REQUIRE(arrReader.GetNext().GetValue() == writeVal3.GetValue());
-
-    BOOST_REQUIRE(!arrReader.HasNext());
-
-    try
-    {
-        arrReader.GetNext();
-
-        BOOST_FAIL("Error expected.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-
-    BOOST_REQUIRE(rawReader.ReadInt8() == 1);
-}
-
-BOOST_AUTO_TEST_CASE(TestCollectionNull)
-{
-    InteropUnpooledMemory mem(1024);
-
-    InteropOutputStream out(&mem);
-    PortableWriterImpl writer(&out, NULL);
-    PortableRawWriter rawWriter(&writer);
-
-    rawWriter.WriteNull();
-    rawWriter.WriteInt8(1);
-
-    out.Synchronize();
-
-    InteropInputStream in(&mem);
-    PortableReaderImpl reader(&in);
-    PortableRawReader rawReader(&reader);
-
-    PortableCollectionReader<PortableInner> colReader = rawReader.ReadCollection<PortableInner>();
-
-    BOOST_REQUIRE(colReader.GetType() == IGNITE_COLLECTION_UNDEFINED);
-    BOOST_REQUIRE(colReader.GetSize() == -1);
-    BOOST_REQUIRE(!colReader.HasNext());
-    BOOST_REQUIRE(colReader.IsNull()); 
-
-    try
-    {
-        colReader.GetNext();
-
-        BOOST_FAIL("Error expected.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-
-    BOOST_REQUIRE(rawReader.ReadInt8() == 1);
-}
-
-BOOST_AUTO_TEST_CASE(TestCollectionEmpty)
-{
-    CheckRawCollectionEmpty(NULL);
-}
-
-BOOST_AUTO_TEST_CASE(TestCollectionEmptyTyped)
-{
-    CollectionType typ = IGNITE_COLLECTION_CONCURRENT_SKIP_LIST_SET;
-
-    CheckRawCollectionEmpty(&typ);
-}
-
-BOOST_AUTO_TEST_CASE(TestCollection)
-{
-    CheckRawCollection(NULL);
-}
-
-BOOST_AUTO_TEST_CASE(testCollectionTyped)
-{
-    CollectionType typ = IGNITE_COLLECTION_CONCURRENT_SKIP_LIST_SET;
-
-    CheckRawCollection(&typ);
-}
-
-BOOST_AUTO_TEST_CASE(TestMapNull)
-{
-    InteropUnpooledMemory mem(1024);
-
-    InteropOutputStream out(&mem);
-    PortableWriterImpl writer(&out, NULL);
-    PortableRawWriter rawWriter(&writer);
-
-    rawWriter.WriteNull();
-    rawWriter.WriteInt8(1);
-
-    out.Synchronize();
-
-    InteropInputStream in(&mem);
-    PortableReaderImpl reader(&in);
-    PortableRawReader rawReader(&reader);
-
-    PortableMapReader<int8_t, PortableInner> mapReader = rawReader.ReadMap<int8_t, PortableInner>();
-
-    BOOST_REQUIRE(mapReader.GetType() == IGNITE_MAP_UNDEFINED);
-    BOOST_REQUIRE(mapReader.GetSize() == -1);
-    BOOST_REQUIRE(!mapReader.HasNext());
-    BOOST_REQUIRE(mapReader.IsNull());
-
-    try
-    {
-        int8_t key;
-        PortableInner val;
-
-        mapReader.GetNext(&key, &val);
-
-        BOOST_FAIL("Error expected.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-
-    BOOST_REQUIRE(rawReader.ReadInt8() == 1);
-}
-
-BOOST_AUTO_TEST_CASE(TestMapEmpty)
-{
-    CheckRawMapEmpty(NULL);
-}
-
-BOOST_AUTO_TEST_CASE(TestMapEmptyTyped)
-{
-    MapType typ = IGNITE_MAP_CONCURRENT_HASH_MAP;
-
-    CheckRawMapEmpty(&typ);
-}
-
-BOOST_AUTO_TEST_CASE(TestMap)
-{
-    CheckRawMap(NULL);
-}
-
-BOOST_AUTO_TEST_CASE(TestMapTyped)
-{
-    MapType typ = IGNITE_MAP_CONCURRENT_HASH_MAP;
-
-    CheckRawMap(&typ);
-}
-
-BOOST_AUTO_TEST_SUITE_END()
\ No newline at end of file


[25/28] ignite git commit: IGNITE-1513: Moved CPP.

Posted by vo...@apache.org.
http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/core-test/Makefile.am
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/core-test/Makefile.am b/modules/platform/cpp/core-test/Makefile.am
new file mode 100644
index 0000000..9ed3111
--- /dev/null
+++ b/modules/platform/cpp/core-test/Makefile.am
@@ -0,0 +1,49 @@
+##
+## Licensed to the Apache Software Foundation (ASF) under one or more
+## contributor license agreements.  See the NOTICE file distributed with
+## this work for additional information regarding copyright ownership.
+## The ASF licenses this file to You under the Apache License, Version 2.0
+## (the "License"); you may not use this file except in compliance with
+## the License.  You may obtain a copy of the License at
+##
+##      http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS,
+## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+## See the License for the specific language governing permissions and
+## limitations under the License.
+##
+
+ACLOCAL_AMFLAGS = "-Im4"
+
+SUBDIRS = . include
+DIST_SUBDIRS = . include
+
+AM_CPPFLAGS = -I$(srcdir)/include -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/linux -DIGNITE_IMPL
+AM_CXXFLAGS = -Wall -std=c++0x
+
+noinst_PROGRAMS = ignite-tests
+
+ignite_tests_SOURCES = src/cache_test.cpp \
+                         src/cache_query_test.cpp \
+                         src/concurrent_test.cpp \
+                         src/ignition_test.cpp \
+                         src/handle_registry_test.cpp \
+                         src/portable_test_defs.cpp \
+                         src/portable_reader_writer_raw_test.cpp \
+                         src/portable_reader_writer_test.cpp \
+                         src/portable_session_test.cpp \
+                         src/teamcity_messages.cpp \
+                         src/teamcity_boost.cpp
+
+ignite_tests_LDFLAGS = -static-libtool-libs -L/usr/local/lib -lignite
+
+run-check: check
+	./ignite-tests -p
+
+clean-local: clean-check
+	$(RM) *.gcno *.gcda
+
+clean-check:
+	$(RM) $(ignite_tests_OBJECTS)

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/core-test/config/cache-query.xml
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/core-test/config/cache-query.xml b/modules/platform/cpp/core-test/config/cache-query.xml
new file mode 100644
index 0000000..160fe49
--- /dev/null
+++ b/modules/platform/cpp/core-test/config/cache-query.xml
@@ -0,0 +1,91 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+
+<!--
+    Ignite Spring configuration file to startup grid cache.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:util="http://www.springframework.org/schema/util"
+       xsi:schemaLocation="
+        http://www.springframework.org/schema/beans
+        http://www.springframework.org/schema/beans/spring-beans.xsd
+        http://www.springframework.org/schema/util
+        http://www.springframework.org/schema/util/spring-util.xsd">
+    <bean id="grid.cfg" class="org.apache.ignite.configuration.IgniteConfiguration">
+        <property name="localHost" value="127.0.0.1"/>
+        <property name="connectorConfiguration"><null/></property>
+
+        <property name="cacheConfiguration">
+            <list>
+                <bean class="org.apache.ignite.configuration.CacheConfiguration">
+                    <property name="name" value="cache"/>
+                    <property name="cacheMode" value="PARTITIONED"/>
+                    <property name="atomicityMode" value="TRANSACTIONAL"/>
+                    <property name="writeSynchronizationMode" value="FULL_SYNC"/>
+
+                    <property name="affinity">
+                        <bean class="org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction">
+                            <property name="partitions" value="256"/>
+                        </bean>
+                    </property>
+                    
+                    <property name="typeMetadata">
+                        <list>
+                            <bean class="org.apache.ignite.cache.CacheTypeMetadata">
+                                <property name="valueType" value="QueryPerson"/>
+                                <property name="ascendingFields">
+                                    <map>
+                                        <entry key="age" value="java.lang.Integer"/>
+                                    </map>
+                                </property>
+                                <property name="queryFields">
+                                    <map>
+                                        <entry key="name" value="java.lang.String"/>
+                                        <entry key="age" value="java.lang.Integer"/>
+                                    </map>
+                                </property>
+                                <property name="textFields">
+                                    <list>
+                                        <value>name</value>
+                                    </list>
+                                </property>
+                            </bean>
+                        </list>
+                    </property>
+                </bean>
+            </list>
+        </property>
+
+        <property name="discoverySpi">
+            <bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
+                <property name="ipFinder">
+                    <bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder">
+                        <property name="addresses">
+                            <list>
+                                <!-- In distributed environment, replace with actual host IP address. -->
+                                <value>127.0.0.1:47500..47501</value>
+                            </list>
+                        </property>
+                    </bean>
+                </property>
+            </bean>
+        </property>
+    </bean>
+</beans>

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/core-test/config/cache-test.xml
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/core-test/config/cache-test.xml b/modules/platform/cpp/core-test/config/cache-test.xml
new file mode 100644
index 0000000..f239ba9
--- /dev/null
+++ b/modules/platform/cpp/core-test/config/cache-test.xml
@@ -0,0 +1,129 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+
+<!--
+    Ignite Spring configuration file to startup grid cache.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:util="http://www.springframework.org/schema/util"
+       xsi:schemaLocation="
+        http://www.springframework.org/schema/beans
+        http://www.springframework.org/schema/beans/spring-beans.xsd
+        http://www.springframework.org/schema/util
+        http://www.springframework.org/schema/util/spring-util.xsd">
+    <bean id="grid.cfg" class="org.apache.ignite.configuration.IgniteConfiguration">
+        <property name="localHost" value="127.0.0.1"/>
+        <property name="connectorConfiguration"><null/></property>
+
+        <property name="includeEventTypes">
+            <util:constant static-field="org.apache.ignite.events.EventType.EVTS_CACHE"/>
+        </property>
+
+        <property name="cacheConfiguration">
+            <list>
+                <bean parent="cache-template">
+                    <property name="name" value="local"/>
+                    <property name="cacheMode" value="LOCAL"/>
+                    <property name="atomicityMode" value="TRANSACTIONAL"/>
+                </bean>
+
+                <bean parent="cache-template">
+                    <property name="name" value="local_atomic"/>
+                    <property name="cacheMode" value="LOCAL"/>
+                    <property name="atomicityMode" value="ATOMIC"/>
+                </bean>
+
+                <bean parent="cache-template">
+                    <property name="name" value="partitioned"/>
+                    <property name="cacheMode" value="PARTITIONED"/>
+                    <property name="atomicityMode" value="TRANSACTIONAL"/>
+                </bean>
+
+                <bean parent="cache-template">
+                    <property name="name" value="partitioned_atomic"/>
+                    <property name="cacheMode" value="PARTITIONED"/>
+                    <property name="atomicityMode" value="ATOMIC"/>
+                    <property name="atomicWriteOrderMode" value="PRIMARY"/>
+                </bean>
+
+                <bean parent="cache-template">
+                    <property name="name" value="partitioned_near"/>
+                    <property name="cacheMode" value="PARTITIONED"/>
+                    <property name="atomicityMode" value="TRANSACTIONAL"/>
+                    <property name="nearConfiguration">
+                        <bean class="org.apache.ignite.configuration.NearCacheConfiguration" />
+                    </property>
+                </bean>
+
+                <bean parent="cache-template">
+                    <property name="name" value="partitioned_atomic_near"/>
+                    <property name="cacheMode" value="PARTITIONED"/>
+                    <property name="atomicityMode" value="ATOMIC"/>
+                    <property name="atomicWriteOrderMode" value="PRIMARY"/>
+                    <property name="nearConfiguration">
+                        <bean class="org.apache.ignite.configuration.NearCacheConfiguration" />
+                    </property>
+                </bean>
+
+                <bean parent="cache-template">
+                    <property name="name" value="replicated"/>
+                    <property name="cacheMode" value="REPLICATED"/>
+                    <property name="atomicityMode" value="TRANSACTIONAL"/>
+                </bean>
+
+                <bean parent="cache-template">
+                    <property name="name" value="replicated_atomic"/>
+                    <property name="cacheMode" value="REPLICATED"/>
+                    <property name="atomicityMode" value="ATOMIC"/>
+                    <property name="atomicWriteOrderMode" value="PRIMARY"/>
+                </bean>
+            </list>
+        </property>
+
+        <property name="discoverySpi">
+            <bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
+                <property name="ipFinder">
+                    <bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder">
+                        <property name="addresses">
+                            <list>
+                                <!-- In distributed environment, replace with actual host IP address. -->
+                                <value>127.0.0.1:47500..47501</value>
+                            </list>
+                        </property>
+                    </bean>
+                </property>
+            </bean>
+        </property>
+
+        <property name="transactionConfiguration">
+            <bean class="org.apache.ignite.configuration.TransactionConfiguration">
+                <property name="txSerializableEnabled" value="true"/>
+            </bean>
+        </property>
+    </bean>
+
+    <bean id="cache-template" abstract="true" class="org.apache.ignite.configuration.CacheConfiguration">
+        <property name="rebalanceMode" value="SYNC"/>
+        <property name="writeSynchronizationMode" value="FULL_SYNC"/>
+        <property name="swapEnabled" value="true"/>
+        <property name="backups" value="1"/>
+        <property name="eagerTtl" value="true"/>
+    </bean>
+</beans>

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/core-test/configure.ac
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/core-test/configure.ac b/modules/platform/cpp/core-test/configure.ac
new file mode 100644
index 0000000..b337fba
--- /dev/null
+++ b/modules/platform/cpp/core-test/configure.ac
@@ -0,0 +1,62 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+#                                               -*- Autoconf -*-
+# Process this file with autoconf to produce a configure script.
+
+AC_PREREQ([2.69])
+AC_INIT([Apache Ignite C++ Test], [1.5.0], [dev@ignite.apache.org], [ignite], [ignite.apache.org])
+AC_CONFIG_SRCDIR(src)
+
+AC_CANONICAL_SYSTEM
+AC_CONFIG_MACRO_DIR([m4])
+AC_LANG([C++])
+
+# Initialize automake
+AM_INIT_AUTOMAKE([-Wall foreign subdir-objects])
+AC_CONFIG_HEADER(config.h)
+
+AM_PROG_AR
+
+# Checks for programs.
+GXX="-g -O2"
+
+AC_PROG_CXX
+
+# Initialize Libtool
+LT_INIT
+
+# Checks for libraries.
+AC_CHECK_LIB([pthread], [pthread_mutex_lock])
+
+# Checks for header files.
+
+# Checks for typedefs, structures, and compiler characteristics.
+AC_C_INLINE
+AC_TYPE_INT16_T
+AC_TYPE_INT32_T
+AC_TYPE_INT64_T
+AC_TYPE_INT8_T
+AC_TYPE_PID_T
+AC_TYPE_SIZE_T
+
+# Checks for library functions.
+AC_FUNC_ERROR_AT_LINE
+
+AC_CONFIG_FILES(Makefile include/Makefile)
+
+AC_OUTPUT

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/core-test/include/Makefile.am
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/core-test/include/Makefile.am b/modules/platform/cpp/core-test/include/Makefile.am
new file mode 100644
index 0000000..c43103e
--- /dev/null
+++ b/modules/platform/cpp/core-test/include/Makefile.am
@@ -0,0 +1,22 @@
+##
+## Licensed to the Apache Software Foundation (ASF) under one or more
+## contributor license agreements.  See the NOTICE file distributed with
+## this work for additional information regarding copyright ownership.
+## The ASF licenses this file to You under the Apache License, Version 2.0
+## (the "License"); you may not use this file except in compliance with
+## the License.  You may obtain a copy of the License at
+##
+##      http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS,
+## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+## See the License for the specific language governing permissions and
+## limitations under the License.
+##
+
+ACLOCAL_AMFLAGS = "-Im4"
+
+nobase_include_HEADERS = teamcity_messages.h \
+                         ignite/portable_test_defs.h \
+                         ignite/portable_test_utils.h

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/core-test/include/ignite/portable_test_defs.h
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/core-test/include/ignite/portable_test_defs.h b/modules/platform/cpp/core-test/include/ignite/portable_test_defs.h
new file mode 100644
index 0000000..bae0118
--- /dev/null
+++ b/modules/platform/cpp/core-test/include/ignite/portable_test_defs.h
@@ -0,0 +1,320 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _IGNITE_PORTABLE_TEST_DEFS
+#define _IGNITE_PORTABLE_TEST_DEFS
+
+#include <stdexcept>
+#include <stdint.h>
+
+#include "ignite/portable/portable.h"
+
+namespace ignite_test
+{
+    namespace core
+    {
+        namespace portable 
+        {
+            class PortableDummy
+            {
+                // No-op.
+            };
+
+            class PortableInner 
+            {
+            public:
+                PortableInner();
+
+                PortableInner(int32_t val);
+
+                int32_t GetValue() const;
+            private:
+                int32_t val;
+            };
+
+            class PortableOuter
+            {
+            public:
+                PortableOuter(int32_t valIn, int32_t valOut);
+
+                PortableInner GetInner() const;
+
+                int32_t GetValue() const;
+            private:
+                PortableInner inner;
+                int32_t val;
+            };
+
+            struct PortableFields
+            {
+                int32_t val1;
+                int32_t val2;
+                int32_t rawVal1;
+                int32_t rawVal2;
+
+                PortableFields() : val1(0), val2(0), rawVal1(0), rawVal2(0)
+                {
+                    // No-op.
+                }
+
+                PortableFields(int32_t val1, int32_t val2, int32_t rawVal1, int32_t rawVal2) :
+                    val1(val1), val2(val2), rawVal1(rawVal1), rawVal2(rawVal2)
+                {
+                    // No-op.   
+                }
+            };
+        }
+    }
+}
+
+namespace ignite
+{
+    namespace portable
+    {
+        namespace gt = ignite_test::core::portable;
+
+        template<>
+        struct PortableType<gt::PortableDummy>
+        {
+            /** <inheritdoc /> */
+            int32_t GetTypeId()
+            {
+                return GetPortableStringHashCode("PortableDummy");
+            }
+
+            /** <inheritdoc /> */
+            std::string GetTypeName()
+            {
+                return "PortableDummy";
+            }
+
+            /** <inheritdoc /> */
+            int32_t GetFieldId(const char* name)
+            {
+                return GetPortableStringHashCode(name);
+            }
+
+            /** <inheritdoc /> */
+            int32_t GetHashCode(const gt::PortableInner& obj)
+            {
+                return obj.GetValue();
+            }
+
+            /** <inheritdoc /> */
+            bool IsNull(const gt::PortableInner& obj)
+            {
+                return obj.GetValue() == 0;
+            }
+
+            /** <inheritdoc /> */
+            gt::PortableInner GetNull()
+            {
+                return gt::PortableInner(0);
+            }
+
+            /** <inheritdoc /> */
+            void Write(PortableWriter& writer, const gt::PortableDummy& obj)
+            {
+                // No-op.
+            }
+
+            /** <inheritdoc /> */
+            gt::PortableDummy Read(PortableReader& reader)
+            {
+                return gt::PortableDummy();
+            }
+        };
+
+        template<> 
+        struct PortableType<gt::PortableInner>
+        {
+            /** <inheritdoc /> */
+            int32_t GetTypeId() 
+            { 
+                return GetPortableStringHashCode("PortableInner"); 
+            }
+
+            /** <inheritdoc /> */
+            std::string GetTypeName()
+            {
+                return "PortableInner";
+            }
+
+            /** <inheritdoc /> */
+            int32_t GetFieldId(const char* name) 
+            { 
+                return GetPortableStringHashCode(name); 
+            }
+
+            /** <inheritdoc /> */
+            int32_t GetHashCode(const gt::PortableInner& obj)
+            {
+                return obj.GetValue();
+            }
+
+            /** <inheritdoc /> */
+            bool IsNull(const gt::PortableInner& obj)
+            {
+                return obj.GetValue() == 0;
+            }
+
+            /** <inheritdoc /> */
+            gt::PortableInner GetNull()
+            {
+                return gt::PortableInner(0);
+            }
+
+            /** <inheritdoc /> */
+            void Write(PortableWriter& writer, const gt::PortableInner& obj)
+            {
+                writer.WriteInt32("val", obj.GetValue());
+            }
+
+            /** <inheritdoc /> */
+            gt::PortableInner Read(PortableReader& reader)
+            {
+                int val = reader.ReadInt32("val");
+
+                return gt::PortableInner(val);
+            }
+        };
+
+        template<>
+        struct PortableType<gt::PortableOuter>
+        {
+            /** <inheritdoc /> */
+            int32_t GetTypeId()
+            {
+                return GetPortableStringHashCode("PortableOuter");
+            }
+
+            /** <inheritdoc /> */
+            std::string GetTypeName()
+            {
+                return "PortableOuter";
+            }
+
+            /** <inheritdoc /> */
+            int32_t GetFieldId(const char* name)
+            {
+                return GetPortableStringHashCode(name);
+            }
+
+            /** <inheritdoc /> */
+            int32_t GetHashCode(const gt::PortableOuter& obj)
+            {
+                return obj.GetValue() + obj.GetInner().GetValue();
+            }
+
+            /** <inheritdoc /> */
+            bool IsNull(const gt::PortableOuter& obj)
+            {
+                return obj.GetValue() == 0 && obj.GetInner().GetValue();
+            }
+
+            /** <inheritdoc /> */
+            gt::PortableOuter GetNull()
+            {
+                return gt::PortableOuter(0, 0);
+            }
+
+            /** <inheritdoc /> */
+            void Write(PortableWriter& writer, const gt::PortableOuter& obj)
+            {
+                writer.WriteObject("inner", obj.GetInner());
+                writer.WriteInt32("val", obj.GetValue());                
+            }
+
+            /** <inheritdoc /> */
+            gt::PortableOuter Read(PortableReader& reader)
+            {
+                gt::PortableInner inner = reader.ReadObject<gt::PortableInner>("inner");
+                int val = reader.ReadInt32("val");
+
+                return gt::PortableOuter(inner.GetValue(), val);
+            }
+        };
+
+        template<>
+        struct PortableType<gt::PortableFields>
+        {
+            /** <inheritdoc /> */
+            int32_t GetTypeId()
+            {
+                return GetPortableStringHashCode("PortableFields");
+            }
+
+            /** <inheritdoc /> */
+            std::string GetTypeName()
+            {
+                return "PortableFields";
+            }
+
+            /** <inheritdoc /> */
+            int32_t GetFieldId(const char* name)
+            {
+                return GetPortableStringHashCode(name);
+            }
+
+            /** <inheritdoc /> */
+            int32_t GetHashCode(const gt::PortableFields& obj)
+            {
+                return obj.val1 + obj.val2 + obj.rawVal1 + obj.rawVal2;
+            }
+
+            /** <inheritdoc /> */
+            bool IsNull(const gt::PortableFields& obj)
+            {
+                return false;
+            }
+
+            /** <inheritdoc /> */
+            gt::PortableFields GetNull()
+            {
+                throw std::runtime_error("Must not be called.");
+            }
+
+            /** <inheritdoc /> */
+            void Write(PortableWriter& writer, const gt::PortableFields& obj)
+            {
+                writer.WriteInt32("val1", obj.val1);
+                writer.WriteInt32("val2", obj.val2);
+
+                PortableRawWriter rawWriter = writer.RawWriter();
+
+                rawWriter.WriteInt32(obj.rawVal1);
+                rawWriter.WriteInt32(obj.rawVal2);
+            }
+
+            /** <inheritdoc /> */
+            gt::PortableFields Read(PortableReader& reader)
+            {
+                int32_t val1 = reader.ReadInt32("val1");
+                int32_t val2 = reader.ReadInt32("val2");
+
+                PortableRawReader rawReader = reader.RawReader();
+
+                int32_t rawVal1 = rawReader.ReadInt32();
+                int32_t rawVal2 = rawReader.ReadInt32();
+
+                return gt::PortableFields(val1, val2, rawVal1, rawVal2);
+            }
+        };
+    }
+}
+
+#endif
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/core-test/include/ignite/portable_test_utils.h
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/core-test/include/ignite/portable_test_utils.h b/modules/platform/cpp/core-test/include/ignite/portable_test_utils.h
new file mode 100644
index 0000000..62f99f9
--- /dev/null
+++ b/modules/platform/cpp/core-test/include/ignite/portable_test_utils.h
@@ -0,0 +1,516 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _IGNITE_PORTABLE_TEST_UTILS
+#define _IGNITE_PORTABLE_TEST_UTILS
+
+#include "ignite/portable/portable.h"
+
+using namespace ignite;
+using namespace ignite::portable;
+using namespace ignite::impl::portable;
+
+namespace ignite_test
+{
+    namespace core
+    {
+        namespace portable
+        {
+            template<typename T>
+            inline void Write(PortableRawWriter& writer, T val)
+            {
+                throw std::runtime_error("Function is not defined");
+            }
+
+            template<typename T>
+            inline T Read(PortableRawReader& reader)
+            {
+                throw std::runtime_error("Function is not defined");
+            }
+
+            template<>
+            inline void Write(PortableRawWriter& writer, int8_t val)
+            {
+                writer.WriteInt8(val);
+            }
+
+            template<>
+            inline int8_t Read(PortableRawReader& reader)
+            {
+                return reader.ReadInt8();
+            }
+
+            template<>
+            inline void Write(PortableRawWriter& writer, bool val)
+            {
+                writer.WriteBool(val);
+            }
+
+            template<>
+            inline bool Read(PortableRawReader& reader)
+            {
+                return reader.ReadBool();
+            }
+
+            template<>
+            inline void Write(PortableRawWriter& writer, int16_t val)
+            {
+                writer.WriteInt16(val);
+            }
+
+            template<>
+            inline int16_t Read(PortableRawReader& reader)
+            {
+                return reader.ReadInt16();
+            }
+
+            template<>
+            inline void Write(PortableRawWriter& writer, uint16_t val)
+            {
+                writer.WriteUInt16(val);
+            }
+
+            template<>
+            inline uint16_t Read(PortableRawReader& reader)
+            {
+                return reader.ReadUInt16();
+            }
+
+            template<>
+            inline void Write(PortableRawWriter& writer, int32_t val)
+            {
+                writer.WriteInt32(val);
+            }
+
+            template<>
+            inline int32_t Read(PortableRawReader& reader)
+            {
+                return reader.ReadInt32();
+            }
+
+            template<>
+            inline void Write(PortableRawWriter& writer, int64_t val)
+            {
+                writer.WriteInt64(val);
+            }
+
+            template<>
+            inline int64_t Read(PortableRawReader& reader)
+            {
+                return reader.ReadInt64();
+            }
+
+            template<>
+            inline void Write(PortableRawWriter& writer, float val)
+            {
+                writer.WriteFloat(val);
+            }
+
+            template<>
+            inline float Read(PortableRawReader& reader)
+            {
+                return reader.ReadFloat();
+            }
+
+            template<>
+            inline void Write(PortableRawWriter& writer, double val)
+            {
+                writer.WriteDouble(val);
+            }
+
+            template<>
+            inline double Read(PortableRawReader& reader)
+            {
+                return reader.ReadDouble();
+            }
+
+            template<>
+            inline void Write(PortableRawWriter& writer, Guid val)
+            {
+                writer.WriteGuid(val);
+            }
+
+            template<>
+            inline Guid Read(PortableRawReader& reader)
+            {
+                return reader.ReadGuid();
+            }
+
+            template<typename T>
+            inline void WriteArray(PortableRawWriter& writer, T* val, int32_t len)
+            {
+                throw std::runtime_error("Function is not defined");
+            }
+
+            template<typename T>
+            inline int32_t ReadArray(PortableRawReader& reader, T* val, int32_t len)
+            {
+                throw std::runtime_error("Function is not defined");
+            }
+
+            template<>
+            inline void WriteArray(PortableRawWriter& writer, int8_t* val, int32_t len)
+            {
+                writer.WriteInt8Array(val, len);
+            }
+
+            template<>
+            inline int32_t ReadArray(PortableRawReader& reader, int8_t* val, int32_t len)
+            {
+                return reader.ReadInt8Array(val, len);
+            }
+
+            template<>
+            inline void WriteArray(PortableRawWriter& writer, bool* val, int32_t len)
+            {
+                writer.WriteBoolArray(val, len);
+            }
+
+            template<>
+            inline int32_t ReadArray(PortableRawReader& reader, bool* val, int32_t len)
+            {
+                return reader.ReadBoolArray(val, len);
+            }
+
+            template<>
+            inline void WriteArray(PortableRawWriter& writer, int16_t* val, int32_t len)
+            {
+                writer.WriteInt16Array(val, len);
+            }
+
+            template<>
+            inline int32_t ReadArray(PortableRawReader& reader, int16_t* val, int32_t len)
+            {
+                return reader.ReadInt16Array(val, len);
+            }
+
+            template<>
+            inline void WriteArray(PortableRawWriter& writer, uint16_t* val, int32_t len)
+            {
+                writer.WriteUInt16Array(val, len);
+            }
+
+            template<>
+            inline int32_t ReadArray(PortableRawReader& reader, uint16_t* val, int32_t len)
+            {
+                return reader.ReadUInt16Array(val, len);
+            }
+
+            template<>
+            inline void WriteArray(PortableRawWriter& writer, int32_t* val, int32_t len)
+            {
+                writer.WriteInt32Array(val, len);
+            }
+
+            template<>
+            inline int32_t ReadArray(PortableRawReader& reader, int32_t* val, int32_t len)
+            {
+                return reader.ReadInt32Array(val, len);
+            }
+
+            template<>
+            inline void WriteArray(PortableRawWriter& writer, int64_t* val, int32_t len)
+            {
+                writer.WriteInt64Array(val, len);
+            }
+
+            template<>
+            inline int32_t ReadArray(PortableRawReader& reader, int64_t* val, int32_t len)
+            {
+                return reader.ReadInt64Array(val, len);
+            }
+
+            template<>
+            inline void WriteArray(PortableRawWriter& writer, float* val, int32_t len)
+            {
+                writer.WriteFloatArray(val, len);
+            }
+
+            template<>
+            inline int32_t ReadArray(PortableRawReader& reader, float* val, int32_t len)
+            {
+                return reader.ReadFloatArray(val, len);
+            }
+
+            template<>
+            inline void WriteArray(PortableRawWriter& writer, double* val, int32_t len)
+            {
+                writer.WriteDoubleArray(val, len);
+            }
+
+            template<>
+            inline int32_t ReadArray(PortableRawReader& reader, double* val, int32_t len)
+            {
+                return reader.ReadDoubleArray(val, len);
+            }
+
+            template<>
+            inline void WriteArray(PortableRawWriter& writer, Guid* val, int32_t len)
+            {
+                writer.WriteGuidArray(val, len);
+            }
+
+            template<>
+            inline int32_t ReadArray(PortableRawReader& reader, Guid* val, int32_t len)
+            {
+                return reader.ReadGuidArray(val, len);
+            }
+
+            template<typename T>
+            inline void Write(PortableWriter& writer, const char* fieldName, T val)
+            {
+                throw std::runtime_error("Function is not defined");
+            }
+
+            template<typename T>
+            inline T Read(PortableReader& reader, const char* fieldName)
+            {
+                throw std::runtime_error("Function is not defined");
+            }
+
+            template<>
+            inline void Write(PortableWriter& writer, const char* fieldName, int8_t val)
+            {
+                writer.WriteInt8(fieldName, val);
+            }
+
+            template<>
+            inline int8_t Read(PortableReader& reader, const char* fieldName)
+            {
+                return reader.ReadInt8(fieldName);
+            }
+
+            template<>
+            inline void Write(PortableWriter& writer, const char* fieldName, bool val)
+            {
+                writer.WriteBool(fieldName, val);
+            }
+
+            template<>
+            inline bool Read(PortableReader& reader, const char* fieldName)
+            {
+                return reader.ReadBool(fieldName);
+            }
+
+            template<>
+            inline void Write(PortableWriter& writer, const char* fieldName, int16_t val)
+            {
+                writer.WriteInt16(fieldName, val);
+            }
+
+            template<>
+            inline int16_t Read(PortableReader& reader, const char* fieldName)
+            {
+                return reader.ReadInt16(fieldName);
+            }
+
+            template<>
+            inline void Write(PortableWriter& writer, const char* fieldName, uint16_t val)
+            {
+                writer.WriteUInt16(fieldName, val);
+            }
+
+            template<>
+            inline uint16_t Read(PortableReader& reader, const char* fieldName)
+            {
+                return reader.ReadUInt16(fieldName);
+            }
+
+            template<>
+            inline void Write(PortableWriter& writer, const char* fieldName, int32_t val)
+            {
+                writer.WriteInt32(fieldName, val);
+            }
+
+            template<>
+            inline int32_t Read(PortableReader& reader, const char* fieldName)
+            {
+                return reader.ReadInt32(fieldName);
+            }
+
+            template<>
+            inline void Write(PortableWriter& writer, const char* fieldName, int64_t val)
+            {
+                writer.WriteInt64(fieldName, val);
+            }
+
+            template<>
+            inline int64_t Read(PortableReader& reader, const char* fieldName)
+            {
+                return reader.ReadInt64(fieldName);
+            }
+
+            template<>
+            inline void Write(PortableWriter& writer, const char* fieldName, float val)
+            {
+                writer.WriteFloat(fieldName, val);
+            }
+
+            template<>
+            inline float Read(PortableReader& reader, const char* fieldName)
+            {
+                return reader.ReadFloat(fieldName);
+            }
+
+            template<>
+            inline void Write(PortableWriter& writer, const char* fieldName, double val)
+            {
+                writer.WriteDouble(fieldName, val);
+            }
+
+            template<>
+            inline double Read(PortableReader& reader, const char* fieldName)
+            {
+                return reader.ReadDouble(fieldName);
+            }
+
+            template<>
+            inline void Write(PortableWriter& writer, const char* fieldName, Guid val)
+            {
+                writer.WriteGuid(fieldName, val);
+            }
+
+            template<>
+            inline Guid Read(PortableReader& reader, const char* fieldName)
+            {
+                return reader.ReadGuid(fieldName);
+            }
+
+            template<typename T>
+            inline void WriteArray(PortableWriter& writer, const char* fieldName, T* val, int32_t len)
+            {
+                throw std::runtime_error("Function is not defined");
+            }
+
+            template<typename T>
+            inline int32_t ReadArray(PortableReader& reader, const char* fieldName, T* val, int32_t len)
+            {
+                throw std::runtime_error("Function is not defined");
+            }
+
+            template<>
+            inline void WriteArray(PortableWriter& writer, const char* fieldName, int8_t* val, int32_t len)
+            {
+                writer.WriteInt8Array(fieldName, val, len);
+            }
+
+            template<>
+            inline int32_t ReadArray(PortableReader& reader, const char* fieldName, int8_t* val, int32_t len)
+            {
+                return reader.ReadInt8Array(fieldName, val, len);
+            }
+
+            template<>
+            inline void WriteArray(PortableWriter& writer, const char* fieldName, bool* val, int32_t len)
+            {
+                writer.WriteBoolArray(fieldName, val, len);
+            }
+
+            template<>
+            inline int32_t ReadArray(PortableReader& reader, const char* fieldName, bool* val, int32_t len)
+            {
+                return reader.ReadBoolArray(fieldName, val, len);
+            }
+
+            template<>
+            inline void WriteArray(PortableWriter& writer, const char* fieldName, int16_t* val, int32_t len)
+            {
+                writer.WriteInt16Array(fieldName, val, len);
+            }
+
+            template<>
+            inline int32_t ReadArray(PortableReader& reader, const char* fieldName, int16_t* val, int32_t len)
+            {
+                return reader.ReadInt16Array(fieldName, val, len);
+            }
+
+            template<>
+            inline void WriteArray(PortableWriter& writer, const char* fieldName, uint16_t* val, int32_t len)
+            {
+                writer.WriteUInt16Array(fieldName, val, len);
+            }
+
+            template<>
+            inline int32_t ReadArray(PortableReader& reader, const char* fieldName, uint16_t* val, int32_t len)
+            {
+                return reader.ReadUInt16Array(fieldName, val, len);
+            }
+
+            template<>
+            inline void WriteArray(PortableWriter& writer, const char* fieldName, int32_t* val, int32_t len)
+            {
+                writer.WriteInt32Array(fieldName, val, len);
+            }
+
+            template<>
+            inline int32_t ReadArray(PortableReader& reader, const char* fieldName, int32_t* val, int32_t len)
+            {
+                return reader.ReadInt32Array(fieldName, val, len);
+            }
+
+            template<>
+            inline void WriteArray(PortableWriter& writer, const char* fieldName, int64_t* val, int32_t len)
+            {
+                writer.WriteInt64Array(fieldName, val, len);
+            }
+
+            template<>
+            inline int32_t ReadArray(PortableReader& reader, const char* fieldName, int64_t* val, int32_t len)
+            {
+                return reader.ReadInt64Array(fieldName, val, len);
+            }
+
+            template<>
+            inline void WriteArray(PortableWriter& writer, const char* fieldName, float* val, int32_t len)
+            {
+                writer.WriteFloatArray(fieldName, val, len);
+            }
+
+            template<>
+            inline int32_t ReadArray(PortableReader& reader, const char* fieldName, float* val, int32_t len)
+            {
+                return reader.ReadFloatArray(fieldName, val, len);
+            }
+
+            template<>
+            inline void WriteArray(PortableWriter& writer, const char* fieldName, double* val, int32_t len)
+            {
+                writer.WriteDoubleArray(fieldName, val, len);
+            }
+
+            template<>
+            inline int32_t ReadArray(PortableReader& reader, const char* fieldName, double* val, int32_t len)
+            {
+                return reader.ReadDoubleArray(fieldName, val, len);
+            }
+
+            template<>
+            inline void WriteArray(PortableWriter& writer, const char* fieldName, Guid* val, int32_t len)
+            {
+                writer.WriteGuidArray(fieldName, val, len);
+            }
+
+            template<>
+            inline int32_t ReadArray(PortableReader& reader, const char* fieldName, Guid* val, int32_t len)
+            {
+                return reader.ReadGuidArray(fieldName, val, len);
+            }
+        }
+    }
+}
+
+#endif
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/core-test/include/teamcity_messages.h
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/core-test/include/teamcity_messages.h b/modules/platform/cpp/core-test/include/teamcity_messages.h
new file mode 100644
index 0000000..8cf23d0
--- /dev/null
+++ b/modules/platform/cpp/core-test/include/teamcity_messages.h
@@ -0,0 +1,55 @@
+/* Copyright 2011 JetBrains s.r.o.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * $Revision: 88625 $
+*/
+
+#ifndef H_TEAMCITY_MESSAGES
+#define H_TEAMCITY_MESSAGES
+
+#include <string>
+#include <iostream>
+
+namespace JetBrains {
+
+std::string getFlowIdFromEnvironment();
+bool underTeamcity();
+
+class TeamcityMessages {
+    std::ostream *m_out;
+    
+protected:
+    std::string escape(std::string s);
+
+    void openMsg(const std::string &name);
+    void writeProperty(std::string name, std::string value);
+    void closeMsg();
+
+public:
+    TeamcityMessages();
+    
+    void setOutput(std::ostream &);
+    
+    void suiteStarted(std::string name, std::string flowid = "");
+    void suiteFinished(std::string name, std::string flowid = "");
+    
+    void testStarted(std::string name, std::string flowid = "");
+    void testFailed(std::string name, std::string message, std::string details, std::string flowid = "");
+    void testIgnored(std::string name, std::string message, std::string flowid = "");
+    void testFinished(std::string name, int durationMs = -1, std::string flowid = "");    
+};
+
+}
+
+#endif /* H_TEAMCITY_MESSAGES */

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/core-test/project/README.TXT
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/core-test/project/README.TXT b/modules/platform/cpp/core-test/project/README.TXT
new file mode 100644
index 0000000..97f4c64
--- /dev/null
+++ b/modules/platform/cpp/core-test/project/README.TXT
@@ -0,0 +1 @@
+Contains IDE projects artifacts.

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/core-test/project/vs/README.TXT
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/core-test/project/vs/README.TXT b/modules/platform/cpp/core-test/project/vs/README.TXT
new file mode 100644
index 0000000..f4fb456
--- /dev/null
+++ b/modules/platform/cpp/core-test/project/vs/README.TXT
@@ -0,0 +1 @@
+Contains Visual Studio project artifacts.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/core-test/project/vs/core-test.vcxproj
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/core-test/project/vs/core-test.vcxproj b/modules/platform/cpp/core-test/project/vs/core-test.vcxproj
new file mode 100644
index 0000000..ca6ee1a
--- /dev/null
+++ b/modules/platform/cpp/core-test/project/vs/core-test.vcxproj
@@ -0,0 +1,174 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup Label="ProjectConfigurations">
+    <ProjectConfiguration Include="Debug|Win32">
+      <Configuration>Debug</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Debug|x64">
+      <Configuration>Debug</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|Win32">
+      <Configuration>Release</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|x64">
+      <Configuration>Release</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\..\..\common\project\vs\common.vcxproj">
+      <Project>{4f7e4917-4612-4b96-9838-025711ade391}</Project>
+    </ProjectReference>
+    <ProjectReference Include="..\..\..\core\project\vs\core.vcxproj">
+      <Project>{e2dea693-f2ea-43c2-a813-053378f6e4db}</Project>
+    </ProjectReference>
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="..\..\config\cache-query.xml" />
+    <None Include="..\..\config\cache-test.xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <ClCompile Include="..\..\src\cache_test.cpp" />
+    <ClCompile Include="..\..\src\concurrent_test.cpp" />
+    <ClCompile Include="..\..\src\ignition_test.cpp" />
+    <ClCompile Include="..\..\src\handle_registry_test.cpp" />
+    <ClCompile Include="..\..\src\portable_reader_writer_raw_test.cpp" />
+    <ClCompile Include="..\..\src\portable_reader_writer_test.cpp" />
+    <ClCompile Include="..\..\src\portable_session_test.cpp" />
+    <ClCompile Include="..\..\src\portable_test_defs.cpp" />
+    <ClCompile Include="..\..\src\cache_query_test.cpp" />
+    <ClCompile Include="..\..\src\teamcity_boost.cpp" />
+    <ClCompile Include="..\..\src\teamcity_messages.cpp" />
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="..\..\include\ignite\portable_test_defs.h" />
+    <ClInclude Include="..\..\include\ignite\portable_test_utils.h" />
+    <ClInclude Include="..\..\include\teamcity_messages.h" />
+  </ItemGroup>
+  <PropertyGroup Label="Globals">
+    <ProjectGuid>{133A22DB-FD60-44B9-B5E3-6CBB3EA5ABF0}</ProjectGuid>
+    <RootNamespace>coretest</RootNamespace>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <PlatformToolset>v100</PlatformToolset>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <PlatformToolset>v100</PlatformToolset>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <PlatformToolset>v100</PlatformToolset>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <PlatformToolset>v100</PlatformToolset>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+  <ImportGroup Label="ExtensionSettings">
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <PropertyGroup Label="UserMacros" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
+    <IntDir>$(Platform)\$(Configuration)\</IntDir>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
+    <IntDir>$(Platform)\$(Configuration)\</IntDir>
+  </PropertyGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <Optimization>Disabled</Optimization>
+      <SDLCheck>true</SDLCheck>
+      <AdditionalIncludeDirectories>$(JAVA_HOME)\include;$(JAVA_HOME)\include\win32;$(ProjectDir)\..\..\..\common\include;$(ProjectDir)\..\..\..\common\os\win\include;$(ProjectDir)\..\..\..\core\include;$(ProjectDir)\..\..\..\core\os\win\include;$(ProjectDir)\..\..\include;$(BOOST_HOME)</AdditionalIncludeDirectories>
+      <PreprocessorDefinitions>_DEBUG;IGNITE_IMPL;BOOST_DATE_TIME_NO_LIB;BOOST_REGEX_NO_LIB;_CRT_SECURE_NO_WARNINGS;IGNITE_FRIEND;_CRTDBG_MAP_ALLOC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <ExceptionHandling>Async</ExceptionHandling>
+    </ClCompile>
+    <Link>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <AdditionalDependencies>$(BOOST_HOME)\lib64-msvc-10.0\libboost_unit_test_framework-vc100-mt-gd-1_58.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <SubSystem>Console</SubSystem>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <Optimization>Disabled</Optimization>
+      <SDLCheck>true</SDLCheck>
+      <AdditionalIncludeDirectories>$(JAVA_HOME)\include;$(JAVA_HOME)\include\win32;$(ProjectDir)\..\..\..\common\include;$(ProjectDir)\..\..\..\common\os\win\include;$(ProjectDir)\..\..\..\core\include;$(ProjectDir)\..\..\..\core\os\win\include;$(ProjectDir)\..\..\include;$(BOOST_HOME)</AdditionalIncludeDirectories>
+      <PreprocessorDefinitions>_DEBUG;IGNITE_IMPL;BOOST_DATE_TIME_NO_LIB;BOOST_REGEX_NO_LIB;_CRT_SECURE_NO_WARNINGS;IGNITE_FRIEND;IGNITE_TESTS_32;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <ExceptionHandling>Async</ExceptionHandling>
+    </ClCompile>
+    <Link>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <AdditionalDependencies>$(BOOST_HOME)\lib64-msvc-10.0\libboost_unit_test_framework-vc100-mt-gd-1_58.lib;%(AdditionalDependencies)</AdditionalDependencies>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <Optimization>MaxSpeed</Optimization>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <IntrinsicFunctions>true</IntrinsicFunctions>
+      <SDLCheck>true</SDLCheck>
+      <AdditionalIncludeDirectories>$(JAVA_HOME)\include;$(JAVA_HOME)\include\win32;$(ProjectDir)\..\..\..\common\include;$(ProjectDir)\..\..\..\common\os\win\include;$(ProjectDir)\..\..\..\core\include;$(ProjectDir)\..\..\..\core\os\win\include;$(ProjectDir)\..\..\include;$(BOOST_HOME)</AdditionalIncludeDirectories>
+      <PreprocessorDefinitions>NDEBUG;IGNITE_IMPL;BOOST_DATE_TIME_NO_LIB;BOOST_REGEX_NO_LIB;_CRT_SECURE_NO_WARNINGS;IGNITE_FRIEND;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <ExceptionHandling>Async</ExceptionHandling>
+    </ClCompile>
+    <Link>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <OptimizeReferences>true</OptimizeReferences>
+      <AdditionalDependencies>$(BOOST_HOME)\lib64-msvc-10.0\libboost_unit_test_framework-vc100-mt-1_58.lib;%(AdditionalDependencies)</AdditionalDependencies>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <Optimization>MaxSpeed</Optimization>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <IntrinsicFunctions>true</IntrinsicFunctions>
+      <SDLCheck>true</SDLCheck>
+      <AdditionalIncludeDirectories>$(JAVA_HOME)\include;$(JAVA_HOME)\include\win32;$(ProjectDir)\..\..\..\common\include;$(ProjectDir)\..\..\..\common\os\win\include;$(ProjectDir)\..\..\..\core\include;$(ProjectDir)\..\..\..\core\os\win\include;$(ProjectDir)\..\..\include;$(BOOST_HOME)</AdditionalIncludeDirectories>
+      <PreprocessorDefinitions>NDEBUG;IGNITE_IMPL;BOOST_DATE_TIME_NO_LIB;BOOST_REGEX_NO_LIB;_CRT_SECURE_NO_WARNINGS;IGNITE_FRIEND;IGNITE_TESTS_32%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <ExceptionHandling>Async</ExceptionHandling>
+    </ClCompile>
+    <Link>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <OptimizeReferences>true</OptimizeReferences>
+      <AdditionalDependencies>$(BOOST_HOME)\lib64-msvc-10.0\libboost_unit_test_framework-vc100-mt-1_58.lib;%(AdditionalDependencies)</AdditionalDependencies>
+    </Link>
+  </ItemDefinitionGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+  <ImportGroup Label="ExtensionTargets">
+  </ImportGroup>
+</Project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/core-test/project/vs/core-test.vcxproj.filters
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/core-test/project/vs/core-test.vcxproj.filters b/modules/platform/cpp/core-test/project/vs/core-test.vcxproj.filters
new file mode 100644
index 0000000..7e8dd95
--- /dev/null
+++ b/modules/platform/cpp/core-test/project/vs/core-test.vcxproj.filters
@@ -0,0 +1,68 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup>
+    <ClCompile Include="..\..\src\cache_test.cpp">
+      <Filter>Code</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\concurrent_test.cpp">
+      <Filter>Code</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\ignition_test.cpp">
+      <Filter>Code</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\handle_registry_test.cpp">
+      <Filter>Code</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\portable_reader_writer_raw_test.cpp">
+      <Filter>Code</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\portable_reader_writer_test.cpp">
+      <Filter>Code</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\portable_session_test.cpp">
+      <Filter>Code</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\portable_test_defs.cpp">
+      <Filter>Code</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\cache_query_test.cpp">
+      <Filter>Code</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\teamcity_boost.cpp">
+      <Filter>TeamCity</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\teamcity_messages.cpp">
+      <Filter>TeamCity</Filter>
+    </ClCompile>
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="..\..\include\ignite\portable_test_defs.h">
+      <Filter>Code</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\include\ignite\portable_test_utils.h">
+      <Filter>Code</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\include\teamcity_messages.h">
+      <Filter>TeamCity</Filter>
+    </ClInclude>
+  </ItemGroup>
+  <ItemGroup>
+    <Filter Include="Code">
+      <UniqueIdentifier>{486c367c-57e9-430a-80f0-39fd5b09bc64}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="Configs">
+      <UniqueIdentifier>{a46d9d4c-44eb-40da-b4f6-89cc43b70c12}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="TeamCity">
+      <UniqueIdentifier>{76bceab0-e251-445f-88c3-3f6f8739423b}</UniqueIdentifier>
+    </Filter>
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="..\..\config\cache-test.xml">
+      <Filter>Configs</Filter>
+    </None>
+    <None Include="..\..\config\cache-query.xml">
+      <Filter>Configs</Filter>
+    </None>
+  </ItemGroup>
+</Project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/core-test/src/cache_query_test.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/core-test/src/cache_query_test.cpp b/modules/platform/cpp/core-test/src/cache_query_test.cpp
new file mode 100644
index 0000000..47009f4
--- /dev/null
+++ b/modules/platform/cpp/core-test/src/cache_query_test.cpp
@@ -0,0 +1,656 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _MSC_VER
+    #define BOOST_TEST_DYN_LINK
+#endif
+
+#include <sstream>
+
+#include <boost/test/unit_test.hpp>
+
+#include "ignite/impl/utils.h"
+#include "ignite/cache/cache.h"
+#include "ignite/cache/query/query_cursor.h"
+#include "ignite/cache/query/query_sql.h"
+#include "ignite/cache/query/query_text.h"
+#include "ignite/ignite.h"
+#include "ignite/ignition.h"
+
+using namespace boost::unit_test;
+
+using namespace ignite;
+using namespace ignite::cache;
+using namespace ignite::cache::query;
+using namespace ignite::impl::utils;
+
+/**
+ * Person class for query tests.
+ */
+class IGNITE_IMPORT_EXPORT QueryPerson
+{
+public:
+    /**
+     * Constructor.
+     */
+    QueryPerson() : name(NULL), age(0)
+    {
+        // No-op.
+    }
+
+    /**
+     * Constructor.
+     *
+     * @param name Name.
+     * @param age Age.
+     */
+    QueryPerson(std::string name, int age) : name(CopyChars(name.c_str())), age(age)
+    {
+        // No-op.
+    }
+
+    /**
+     * Copy constructor.
+     *
+     * @param other Other instance.
+     */
+    QueryPerson(const QueryPerson& other)
+    {
+        name = CopyChars(other.name);
+        age = other.age;
+    }
+
+    /**
+     * Assignment operator.
+     *
+     * @param other Other instance.
+     * @return This instance.
+     */
+    QueryPerson& operator=(const QueryPerson& other)
+    {
+        if (&other != this)
+        {
+            QueryPerson tmp(other);
+
+            char* name0 = name;
+            int age0 = age;
+
+            name = tmp.name;
+            age = tmp.age;
+
+            tmp.name = name0;
+            tmp.age = age0;
+        }
+
+        return *this;
+    }
+
+    /**
+     * Destructor.
+     */
+    ~QueryPerson()
+    {
+        ReleaseChars(name);
+    }
+
+    /**
+     * Get name.
+     * 
+     * @return Name.
+     */
+    std::string GetName()
+    {
+        return name ? std::string(name) : std::string();
+    }
+
+    /**
+     * Get age.
+     * 
+     * @return Age.
+     */
+    int32_t GetAge()
+    {
+        return age;
+    }
+
+private:
+    /** Name. */
+    char* name;
+
+    /** Age. */
+    int age;
+};
+
+namespace ignite
+{
+    namespace portable
+    {
+        /**
+         * Portable type definition.
+         */
+        IGNITE_PORTABLE_TYPE_START(QueryPerson)
+            IGNITE_PORTABLE_GET_TYPE_ID_AS_HASH(QueryPerson)
+            IGNITE_PORTABLE_GET_TYPE_NAME_AS_IS(QueryPerson)
+            IGNITE_PORTABLE_GET_FIELD_ID_AS_HASH
+            IGNITE_PORTABLE_GET_HASH_CODE_ZERO(QueryPerson)
+            IGNITE_PORTABLE_IS_NULL_FALSE(QueryPerson)
+            IGNITE_PORTABLE_GET_NULL_DEFAULT_CTOR(QueryPerson)
+
+            void Write(PortableWriter& writer, QueryPerson obj)
+            {
+                writer.WriteString("name", obj.GetName());
+                writer.WriteInt32("age", obj.GetAge());
+            }
+
+            QueryPerson Read(PortableReader& reader)
+            {
+                std::string name = reader.ReadString("name");
+                int age = reader.ReadInt32("age");
+            
+                return QueryPerson(name, age);
+            }
+
+        IGNITE_PORTABLE_TYPE_END
+    }
+}
+
+/** Node started during the test. */
+Ignite grid = Ignite();
+
+/** Cache accessor. */
+Cache<int, QueryPerson> GetCache()
+{
+    return grid.GetCache<int, QueryPerson>("cache");
+}
+
+/**
+ * Test setup fixture.
+ */
+struct CacheQueryTestSuiteFixture {
+    /**
+     * Constructor.
+     */
+    CacheQueryTestSuiteFixture()
+    {
+        IgniteConfiguration cfg;
+
+        IgniteJvmOption opts[5];
+
+        opts[0] = IgniteJvmOption("-Xdebug");
+        opts[1] = IgniteJvmOption("-Xnoagent");
+        opts[2] = IgniteJvmOption("-Djava.compiler=NONE");
+        opts[3] = IgniteJvmOption("-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005");
+        opts[4] = IgniteJvmOption("-XX:+HeapDumpOnOutOfMemoryError");
+
+        cfg.jvmOptsLen = 5;
+        cfg.jvmOpts = opts;
+
+#ifdef IGNITE_TESTS_32
+        cfg.jvmInitMem = 256;
+        cfg.jvmMaxMem = 768;
+#else
+        cfg.jvmInitMem = 1024;
+        cfg.jvmMaxMem = 4096;
+#endif
+
+        char* cfgPath = getenv("IGNITE_NATIVE_TEST_CPP_CONFIG_PATH");
+
+        std::string cfgPathStr = std::string(cfgPath).append("/").append("cache-query.xml");
+
+        cfg.springCfgPath = const_cast<char*>(cfgPathStr.c_str());
+
+        IgniteError err;
+
+        Ignite grid0 = Ignition::Start(cfg, &err);
+
+        if (err.GetCode() != IgniteError::IGNITE_SUCCESS)
+            BOOST_ERROR(err.GetText());
+
+        grid = grid0;
+    }
+
+    /**
+     * Destructor.
+     */
+    ~CacheQueryTestSuiteFixture()
+    {
+        Ignition::Stop(grid.GetName(), true);
+    }
+};
+
+/**
+ * Ensure that HasNext() fails.
+ *
+ * @param cur Cursor.
+ */
+void CheckHasNextFail(QueryCursor<int, QueryPerson>& cur)
+{
+    try
+    {
+        cur.HasNext();
+
+        BOOST_FAIL("Must fail.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_GENERIC);
+    }
+}
+
+/**
+ * Ensure that GetNext() fails.
+ *
+ * @param cur Cursor.
+ */
+void CheckGetNextFail(QueryCursor<int, QueryPerson>& cur)
+{
+    try
+    {
+        cur.GetNext();
+
+        BOOST_FAIL("Must fail.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_GENERIC);
+    }
+}
+
+/**
+ * Ensure that GetAll() fails.
+ *
+ * @param cur Cursor.
+ */
+void CheckGetAllFail(QueryCursor<int, QueryPerson>& cur)
+{
+    try 
+    {
+        std::vector<CacheEntry<int, QueryPerson>> res;
+
+        cur.GetAll(res);
+
+        BOOST_FAIL("Must fail.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_GENERIC);
+    }
+}
+
+/**
+ * Check empty result through iteration.
+ *
+ * @param cur Cursor.
+ */
+void CheckEmpty(QueryCursor<int, QueryPerson>& cur)
+{
+    BOOST_REQUIRE(!cur.HasNext());
+
+    CheckGetNextFail(cur);
+    CheckGetAllFail(cur);
+}
+
+/**
+ * Check empty result through GetAll().
+ *
+ * @param cur Cursor.
+ */
+void CheckEmptyGetAll(QueryCursor<int, QueryPerson>& cur)
+{
+    std::vector<CacheEntry<int, QueryPerson>> res;
+
+    cur.GetAll(res);
+
+    BOOST_REQUIRE(res.size() == 0);
+
+    CheckHasNextFail(cur);
+    CheckGetNextFail(cur);
+}
+
+/**
+ * Check single result through iteration.
+ *
+ * @param cur Cursor.
+ * @param key1 Key.
+ * @param name1 Name.
+ * @param age1 Age.
+ */
+void CheckSingle(QueryCursor<int, QueryPerson>& cur, int key, std::string name, int age)
+{
+    BOOST_REQUIRE(cur.HasNext());
+
+    CheckGetAllFail(cur);
+
+    CacheEntry<int, QueryPerson> entry = cur.GetNext();
+
+    CheckGetAllFail(cur);
+
+    BOOST_REQUIRE(entry.GetKey() == key);
+    BOOST_REQUIRE(entry.GetValue().GetName().compare(name) == 0);
+    BOOST_REQUIRE(entry.GetValue().GetAge() == age);
+
+    BOOST_REQUIRE(!cur.HasNext());
+
+    CheckGetNextFail(cur);
+    CheckGetAllFail(cur);
+}
+
+/**
+ * Check single result through GetAll().
+ *
+ * @param cur Cursor.
+ * @param key1 Key.
+ * @param name1 Name.
+ * @param age1 Age.
+ */
+void CheckSingleGetAll(QueryCursor<int, QueryPerson>& cur, int key, std::string name, int age)
+{
+    std::vector<CacheEntry<int, QueryPerson>> res;
+
+    cur.GetAll(res);
+
+    CheckHasNextFail(cur);
+    CheckGetNextFail(cur);
+    CheckGetAllFail(cur);
+
+    BOOST_REQUIRE(res.size() == 1);
+
+    BOOST_REQUIRE(res[0].GetKey() == 1);    
+    BOOST_REQUIRE(res[0].GetValue().GetName().compare(name) == 0);
+    BOOST_REQUIRE(res[0].GetValue().GetAge() == age);
+
+    CheckHasNextFail(cur);
+    CheckGetNextFail(cur);
+    CheckGetAllFail(cur);
+}
+
+/**
+ * Check multiple results through iteration.
+ *
+ * @param cur Cursor.
+ * @param key1 Key 1.
+ * @param name1 Name 1.
+ * @param age1 Age 1.
+ * @param key2 Key 2.
+ * @param name2 Name 2.
+ * @param age2 Age 2.
+ */
+void CheckMultiple(QueryCursor<int, QueryPerson>& cur, int key1, std::string name1, 
+    int age1, int key2, std::string name2, int age2)
+{
+    for (int i = 0; i < 2; i++)
+    {
+        BOOST_REQUIRE(cur.HasNext());
+
+        CheckGetAllFail(cur);
+
+        CacheEntry<int, QueryPerson> entry = cur.GetNext();
+
+        CheckGetAllFail(cur);
+
+        if (entry.GetKey() == key1)
+        {
+            BOOST_REQUIRE(entry.GetValue().GetName().compare(name1) == 0);
+            BOOST_REQUIRE(entry.GetValue().GetAge() == age1);            
+        }
+        else if (entry.GetKey() == key2)
+        {
+            BOOST_REQUIRE(entry.GetValue().GetName().compare(name2) == 0);
+            BOOST_REQUIRE(entry.GetValue().GetAge() == age2);            
+        }
+        else
+            BOOST_FAIL("Unexpected entry.");
+    }
+    
+    BOOST_REQUIRE(!cur.HasNext());
+
+    CheckGetNextFail(cur);
+    CheckGetAllFail(cur);
+}
+
+/**
+ * Check multiple results through GetAll().
+ *
+ * @param cur Cursor.
+ * @param key1 Key 1.
+ * @param name1 Name 1.
+ * @param age1 Age 1.
+ * @param key2 Key 2.
+ * @param name2 Name 2.
+ * @param age2 Age 2.
+ */
+void CheckMultipleGetAll(QueryCursor<int, QueryPerson>& cur, int key1, std::string name1, int age1, 
+    int key2, std::string name2, int age2)
+{
+    std::vector<CacheEntry<int, QueryPerson>> res;
+
+    cur.GetAll(res);
+
+    CheckHasNextFail(cur);
+    CheckGetNextFail(cur);
+    CheckGetAllFail(cur);
+
+    BOOST_REQUIRE(res.size() == 2);
+
+    for (int i = 0; i < 2; i++)
+    {
+        CacheEntry<int, QueryPerson> entry = res[i];
+
+        if (entry.GetKey() == key1)
+        {
+            BOOST_REQUIRE(entry.GetValue().GetName().compare(name1) == 0);
+            BOOST_REQUIRE(entry.GetValue().GetAge() == age1);            
+        }
+        else if (entry.GetKey() == key2)
+        {
+            BOOST_REQUIRE(entry.GetValue().GetName().compare(name2) == 0);
+            BOOST_REQUIRE(entry.GetValue().GetAge() == age2);
+        }
+        else
+            BOOST_FAIL("Unexpected entry.");
+    }
+}
+
+BOOST_FIXTURE_TEST_SUITE(CacheQueryTestSuite, CacheQueryTestSuiteFixture)
+
+/**
+ * Test SQL query.
+ */
+BOOST_AUTO_TEST_CASE(TestSqlQuery)
+{    
+    Cache<int, QueryPerson> cache = GetCache();
+
+    // Test query with no results.
+    SqlQuery qry("QueryPerson", "age < 20");
+
+    QueryCursor<int, QueryPerson> cursor = cache.Query(qry);
+    CheckEmpty(cursor);
+
+    cursor = cache.Query(qry);
+    CheckEmptyGetAll(cursor);
+
+    // Test simple query.
+    cache.Put(1, QueryPerson("A1", 10));
+    cache.Put(2, QueryPerson("A2", 20));
+    
+    cursor = cache.Query(qry);
+    CheckSingle(cursor, 1, "A1", 10);
+    
+    cursor = cache.Query(qry);
+    CheckSingleGetAll(cursor, 1, "A1", 10);
+
+    // Test simple local query.
+    qry.SetLocal(true);
+
+    cursor = cache.Query(qry);
+    CheckSingle(cursor, 1, "A1", 10);
+
+    cursor = cache.Query(qry);
+    CheckSingleGetAll(cursor, 1, "A1", 10);
+
+    // Test query with arguments.
+    qry.SetSql("age < ? AND name = ?");
+    qry.AddArgument<int>(20);
+    qry.AddArgument<std::string>("A1");
+
+    cursor = cache.Query(qry);
+    CheckSingle(cursor, 1, "A1", 10);
+
+    cursor = cache.Query(qry);
+    CheckSingleGetAll(cursor, 1, "A1", 10);
+
+    // Test query returning multiple entries.
+    qry = SqlQuery("QueryPerson", "age < 30");
+
+    cursor = cache.Query(qry);
+    CheckMultiple(cursor, 1, "A1", 10, 2, "A2", 20);
+
+    cursor = cache.Query(qry);
+    CheckMultipleGetAll(cursor, 1, "A1", 10, 2, "A2", 20);
+}
+
+/**
+ * Test text query.
+ */
+BOOST_AUTO_TEST_CASE(TestTextQuery)
+{
+    Cache<int, QueryPerson> cache = GetCache();
+
+    // Test query with no results.
+    TextQuery qry("QueryPerson", "A1");
+
+    QueryCursor<int, QueryPerson> cursor = cache.Query(qry);
+    CheckEmpty(cursor);
+
+    cursor = cache.Query(qry);
+    CheckEmptyGetAll(cursor);
+
+    // Test simple query.
+    cache.Put(1, QueryPerson("A1", 10));
+    cache.Put(2, QueryPerson("A2", 20));
+
+    cursor = cache.Query(qry);
+    CheckSingle(cursor, 1, "A1", 10);
+
+    cursor = cache.Query(qry);
+    CheckSingleGetAll(cursor, 1, "A1", 10);
+
+    // Test simple local query.
+    qry.SetLocal(true);
+
+    cursor = cache.Query(qry);
+    CheckSingle(cursor, 1, "A1", 10);
+
+    cursor = cache.Query(qry);
+    CheckSingleGetAll(cursor, 1, "A1", 10);
+
+    // Test query returning multiple entries.
+    qry = TextQuery("QueryPerson", "A*");
+
+    cursor = cache.Query(qry);
+    CheckMultiple(cursor, 1, "A1", 10, 2, "A2", 20);
+
+    cursor = cache.Query(qry);
+    CheckMultipleGetAll(cursor, 1, "A1", 10, 2, "A2", 20);
+}
+
+/**
+ * Test scan query.
+ */
+BOOST_AUTO_TEST_CASE(TestScanQuery)
+{
+    // Test simple query.
+    Cache<int, QueryPerson> cache = GetCache();
+
+    // Test query with no results.
+    ScanQuery qry;
+
+    QueryCursor<int, QueryPerson> cursor = cache.Query(qry);
+    CheckEmpty(cursor);
+
+    cursor = cache.Query(qry);
+    CheckEmptyGetAll(cursor);
+
+    // Test simple query.
+    cache.Put(1, QueryPerson("A1", 10));
+
+    cursor = cache.Query(qry);
+    CheckSingle(cursor, 1, "A1", 10);
+
+    cursor = cache.Query(qry);
+    CheckSingleGetAll(cursor, 1, "A1", 10);
+
+    // Test query returning multiple entries.
+    cache.Put(2, QueryPerson("A2", 20));
+
+    cursor = cache.Query(qry);
+    CheckMultiple(cursor, 1, "A1", 10, 2, "A2", 20);
+
+    cursor = cache.Query(qry);
+    CheckMultipleGetAll(cursor, 1, "A1", 10, 2, "A2", 20);
+}
+
+/**
+ * Test scan query over partitions.
+ */
+BOOST_AUTO_TEST_CASE(TestScanQueryPartitioned)
+{
+    // Populate cache with data.
+    Cache<int, QueryPerson> cache = GetCache();
+
+    int32_t partCnt = 256;   // Defined in configuration explicitly.   
+    int32_t entryCnt = 1000; // Should be greater than partCnt.
+    
+    for (int i = 0; i < entryCnt; i++) 
+    {
+        std::stringstream stream; 
+        
+        stream << "A" << i;
+            
+        cache.Put(i, QueryPerson(stream.str(), i * 10));
+    }
+
+    // Iterate over all partitions and collect data.
+    std::set<int> keys;
+
+    for (int i = 0; i < partCnt; i++)
+    {
+        ScanQuery qry(i);
+
+        QueryCursor<int, QueryPerson> cur = cache.Query(qry);
+
+        while (cur.HasNext())
+        {
+            CacheEntry<int, QueryPerson> entry = cur.GetNext();
+
+            int key = entry.GetKey();
+
+            keys.insert(key);
+
+            std::stringstream stream;
+            stream << "A" << key;
+            BOOST_REQUIRE(entry.GetValue().GetName().compare(stream.str()) == 0);
+
+            BOOST_REQUIRE(entry.GetValue().GetAge() == key * 10);
+        }
+    }
+
+    // Ensure that all keys were read.
+    BOOST_REQUIRE(keys.size() == entryCnt);
+}
+
+BOOST_AUTO_TEST_SUITE_END()
\ No newline at end of file


[11/28] ignite git commit: IGNITE-1513: Moved CPP.

Posted by vo...@apache.org.
http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/core-test/Makefile.am
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core-test/Makefile.am b/modules/platform/src/main/cpp/core-test/Makefile.am
deleted file mode 100644
index 9ed3111..0000000
--- a/modules/platform/src/main/cpp/core-test/Makefile.am
+++ /dev/null
@@ -1,49 +0,0 @@
-##
-## Licensed to the Apache Software Foundation (ASF) under one or more
-## contributor license agreements.  See the NOTICE file distributed with
-## this work for additional information regarding copyright ownership.
-## The ASF licenses this file to You under the Apache License, Version 2.0
-## (the "License"); you may not use this file except in compliance with
-## the License.  You may obtain a copy of the License at
-##
-##      http://www.apache.org/licenses/LICENSE-2.0
-##
-## Unless required by applicable law or agreed to in writing, software
-## distributed under the License is distributed on an "AS IS" BASIS,
-## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-## See the License for the specific language governing permissions and
-## limitations under the License.
-##
-
-ACLOCAL_AMFLAGS = "-Im4"
-
-SUBDIRS = . include
-DIST_SUBDIRS = . include
-
-AM_CPPFLAGS = -I$(srcdir)/include -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/linux -DIGNITE_IMPL
-AM_CXXFLAGS = -Wall -std=c++0x
-
-noinst_PROGRAMS = ignite-tests
-
-ignite_tests_SOURCES = src/cache_test.cpp \
-                         src/cache_query_test.cpp \
-                         src/concurrent_test.cpp \
-                         src/ignition_test.cpp \
-                         src/handle_registry_test.cpp \
-                         src/portable_test_defs.cpp \
-                         src/portable_reader_writer_raw_test.cpp \
-                         src/portable_reader_writer_test.cpp \
-                         src/portable_session_test.cpp \
-                         src/teamcity_messages.cpp \
-                         src/teamcity_boost.cpp
-
-ignite_tests_LDFLAGS = -static-libtool-libs -L/usr/local/lib -lignite
-
-run-check: check
-	./ignite-tests -p
-
-clean-local: clean-check
-	$(RM) *.gcno *.gcda
-
-clean-check:
-	$(RM) $(ignite_tests_OBJECTS)

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/core-test/config/cache-query.xml
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core-test/config/cache-query.xml b/modules/platform/src/main/cpp/core-test/config/cache-query.xml
deleted file mode 100644
index 160fe49..0000000
--- a/modules/platform/src/main/cpp/core-test/config/cache-query.xml
+++ /dev/null
@@ -1,91 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--
-    Licensed to the Apache Software Foundation (ASF) under one or more
-    contributor license agreements.  See the NOTICE file distributed with
-    this work for additional information regarding copyright ownership.
-    The ASF licenses this file to You under the Apache License, Version 2.0
-    (the "License"); you may not use this file except in compliance with
-    the License.  You may obtain a copy of the License at
-
-         http://www.apache.org/licenses/LICENSE-2.0
-
-    Unless required by applicable law or agreed to in writing, software
-    distributed under the License is distributed on an "AS IS" BASIS,
-    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-    See the License for the specific language governing permissions and
-    limitations under the License.
--->
-
-<!--
-    Ignite Spring configuration file to startup grid cache.
--->
-<beans xmlns="http://www.springframework.org/schema/beans"
-       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-       xmlns:util="http://www.springframework.org/schema/util"
-       xsi:schemaLocation="
-        http://www.springframework.org/schema/beans
-        http://www.springframework.org/schema/beans/spring-beans.xsd
-        http://www.springframework.org/schema/util
-        http://www.springframework.org/schema/util/spring-util.xsd">
-    <bean id="grid.cfg" class="org.apache.ignite.configuration.IgniteConfiguration">
-        <property name="localHost" value="127.0.0.1"/>
-        <property name="connectorConfiguration"><null/></property>
-
-        <property name="cacheConfiguration">
-            <list>
-                <bean class="org.apache.ignite.configuration.CacheConfiguration">
-                    <property name="name" value="cache"/>
-                    <property name="cacheMode" value="PARTITIONED"/>
-                    <property name="atomicityMode" value="TRANSACTIONAL"/>
-                    <property name="writeSynchronizationMode" value="FULL_SYNC"/>
-
-                    <property name="affinity">
-                        <bean class="org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction">
-                            <property name="partitions" value="256"/>
-                        </bean>
-                    </property>
-                    
-                    <property name="typeMetadata">
-                        <list>
-                            <bean class="org.apache.ignite.cache.CacheTypeMetadata">
-                                <property name="valueType" value="QueryPerson"/>
-                                <property name="ascendingFields">
-                                    <map>
-                                        <entry key="age" value="java.lang.Integer"/>
-                                    </map>
-                                </property>
-                                <property name="queryFields">
-                                    <map>
-                                        <entry key="name" value="java.lang.String"/>
-                                        <entry key="age" value="java.lang.Integer"/>
-                                    </map>
-                                </property>
-                                <property name="textFields">
-                                    <list>
-                                        <value>name</value>
-                                    </list>
-                                </property>
-                            </bean>
-                        </list>
-                    </property>
-                </bean>
-            </list>
-        </property>
-
-        <property name="discoverySpi">
-            <bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
-                <property name="ipFinder">
-                    <bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder">
-                        <property name="addresses">
-                            <list>
-                                <!-- In distributed environment, replace with actual host IP address. -->
-                                <value>127.0.0.1:47500..47501</value>
-                            </list>
-                        </property>
-                    </bean>
-                </property>
-            </bean>
-        </property>
-    </bean>
-</beans>

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/core-test/config/cache-test.xml
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core-test/config/cache-test.xml b/modules/platform/src/main/cpp/core-test/config/cache-test.xml
deleted file mode 100644
index f239ba9..0000000
--- a/modules/platform/src/main/cpp/core-test/config/cache-test.xml
+++ /dev/null
@@ -1,129 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--
-    Licensed to the Apache Software Foundation (ASF) under one or more
-    contributor license agreements.  See the NOTICE file distributed with
-    this work for additional information regarding copyright ownership.
-    The ASF licenses this file to You under the Apache License, Version 2.0
-    (the "License"); you may not use this file except in compliance with
-    the License.  You may obtain a copy of the License at
-
-         http://www.apache.org/licenses/LICENSE-2.0
-
-    Unless required by applicable law or agreed to in writing, software
-    distributed under the License is distributed on an "AS IS" BASIS,
-    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-    See the License for the specific language governing permissions and
-    limitations under the License.
--->
-
-<!--
-    Ignite Spring configuration file to startup grid cache.
--->
-<beans xmlns="http://www.springframework.org/schema/beans"
-       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-       xmlns:util="http://www.springframework.org/schema/util"
-       xsi:schemaLocation="
-        http://www.springframework.org/schema/beans
-        http://www.springframework.org/schema/beans/spring-beans.xsd
-        http://www.springframework.org/schema/util
-        http://www.springframework.org/schema/util/spring-util.xsd">
-    <bean id="grid.cfg" class="org.apache.ignite.configuration.IgniteConfiguration">
-        <property name="localHost" value="127.0.0.1"/>
-        <property name="connectorConfiguration"><null/></property>
-
-        <property name="includeEventTypes">
-            <util:constant static-field="org.apache.ignite.events.EventType.EVTS_CACHE"/>
-        </property>
-
-        <property name="cacheConfiguration">
-            <list>
-                <bean parent="cache-template">
-                    <property name="name" value="local"/>
-                    <property name="cacheMode" value="LOCAL"/>
-                    <property name="atomicityMode" value="TRANSACTIONAL"/>
-                </bean>
-
-                <bean parent="cache-template">
-                    <property name="name" value="local_atomic"/>
-                    <property name="cacheMode" value="LOCAL"/>
-                    <property name="atomicityMode" value="ATOMIC"/>
-                </bean>
-
-                <bean parent="cache-template">
-                    <property name="name" value="partitioned"/>
-                    <property name="cacheMode" value="PARTITIONED"/>
-                    <property name="atomicityMode" value="TRANSACTIONAL"/>
-                </bean>
-
-                <bean parent="cache-template">
-                    <property name="name" value="partitioned_atomic"/>
-                    <property name="cacheMode" value="PARTITIONED"/>
-                    <property name="atomicityMode" value="ATOMIC"/>
-                    <property name="atomicWriteOrderMode" value="PRIMARY"/>
-                </bean>
-
-                <bean parent="cache-template">
-                    <property name="name" value="partitioned_near"/>
-                    <property name="cacheMode" value="PARTITIONED"/>
-                    <property name="atomicityMode" value="TRANSACTIONAL"/>
-                    <property name="nearConfiguration">
-                        <bean class="org.apache.ignite.configuration.NearCacheConfiguration" />
-                    </property>
-                </bean>
-
-                <bean parent="cache-template">
-                    <property name="name" value="partitioned_atomic_near"/>
-                    <property name="cacheMode" value="PARTITIONED"/>
-                    <property name="atomicityMode" value="ATOMIC"/>
-                    <property name="atomicWriteOrderMode" value="PRIMARY"/>
-                    <property name="nearConfiguration">
-                        <bean class="org.apache.ignite.configuration.NearCacheConfiguration" />
-                    </property>
-                </bean>
-
-                <bean parent="cache-template">
-                    <property name="name" value="replicated"/>
-                    <property name="cacheMode" value="REPLICATED"/>
-                    <property name="atomicityMode" value="TRANSACTIONAL"/>
-                </bean>
-
-                <bean parent="cache-template">
-                    <property name="name" value="replicated_atomic"/>
-                    <property name="cacheMode" value="REPLICATED"/>
-                    <property name="atomicityMode" value="ATOMIC"/>
-                    <property name="atomicWriteOrderMode" value="PRIMARY"/>
-                </bean>
-            </list>
-        </property>
-
-        <property name="discoverySpi">
-            <bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
-                <property name="ipFinder">
-                    <bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder">
-                        <property name="addresses">
-                            <list>
-                                <!-- In distributed environment, replace with actual host IP address. -->
-                                <value>127.0.0.1:47500..47501</value>
-                            </list>
-                        </property>
-                    </bean>
-                </property>
-            </bean>
-        </property>
-
-        <property name="transactionConfiguration">
-            <bean class="org.apache.ignite.configuration.TransactionConfiguration">
-                <property name="txSerializableEnabled" value="true"/>
-            </bean>
-        </property>
-    </bean>
-
-    <bean id="cache-template" abstract="true" class="org.apache.ignite.configuration.CacheConfiguration">
-        <property name="rebalanceMode" value="SYNC"/>
-        <property name="writeSynchronizationMode" value="FULL_SYNC"/>
-        <property name="swapEnabled" value="true"/>
-        <property name="backups" value="1"/>
-        <property name="eagerTtl" value="true"/>
-    </bean>
-</beans>

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/core-test/configure.ac
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core-test/configure.ac b/modules/platform/src/main/cpp/core-test/configure.ac
deleted file mode 100644
index b337fba..0000000
--- a/modules/platform/src/main/cpp/core-test/configure.ac
+++ /dev/null
@@ -1,62 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-#                                               -*- Autoconf -*-
-# Process this file with autoconf to produce a configure script.
-
-AC_PREREQ([2.69])
-AC_INIT([Apache Ignite C++ Test], [1.5.0], [dev@ignite.apache.org], [ignite], [ignite.apache.org])
-AC_CONFIG_SRCDIR(src)
-
-AC_CANONICAL_SYSTEM
-AC_CONFIG_MACRO_DIR([m4])
-AC_LANG([C++])
-
-# Initialize automake
-AM_INIT_AUTOMAKE([-Wall foreign subdir-objects])
-AC_CONFIG_HEADER(config.h)
-
-AM_PROG_AR
-
-# Checks for programs.
-GXX="-g -O2"
-
-AC_PROG_CXX
-
-# Initialize Libtool
-LT_INIT
-
-# Checks for libraries.
-AC_CHECK_LIB([pthread], [pthread_mutex_lock])
-
-# Checks for header files.
-
-# Checks for typedefs, structures, and compiler characteristics.
-AC_C_INLINE
-AC_TYPE_INT16_T
-AC_TYPE_INT32_T
-AC_TYPE_INT64_T
-AC_TYPE_INT8_T
-AC_TYPE_PID_T
-AC_TYPE_SIZE_T
-
-# Checks for library functions.
-AC_FUNC_ERROR_AT_LINE
-
-AC_CONFIG_FILES(Makefile include/Makefile)
-
-AC_OUTPUT

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/core-test/include/Makefile.am
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core-test/include/Makefile.am b/modules/platform/src/main/cpp/core-test/include/Makefile.am
deleted file mode 100644
index c43103e..0000000
--- a/modules/platform/src/main/cpp/core-test/include/Makefile.am
+++ /dev/null
@@ -1,22 +0,0 @@
-##
-## Licensed to the Apache Software Foundation (ASF) under one or more
-## contributor license agreements.  See the NOTICE file distributed with
-## this work for additional information regarding copyright ownership.
-## The ASF licenses this file to You under the Apache License, Version 2.0
-## (the "License"); you may not use this file except in compliance with
-## the License.  You may obtain a copy of the License at
-##
-##      http://www.apache.org/licenses/LICENSE-2.0
-##
-## Unless required by applicable law or agreed to in writing, software
-## distributed under the License is distributed on an "AS IS" BASIS,
-## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-## See the License for the specific language governing permissions and
-## limitations under the License.
-##
-
-ACLOCAL_AMFLAGS = "-Im4"
-
-nobase_include_HEADERS = teamcity_messages.h \
-                         ignite/portable_test_defs.h \
-                         ignite/portable_test_utils.h

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/core-test/include/ignite/portable_test_defs.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core-test/include/ignite/portable_test_defs.h b/modules/platform/src/main/cpp/core-test/include/ignite/portable_test_defs.h
deleted file mode 100644
index bae0118..0000000
--- a/modules/platform/src/main/cpp/core-test/include/ignite/portable_test_defs.h
+++ /dev/null
@@ -1,320 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef _IGNITE_PORTABLE_TEST_DEFS
-#define _IGNITE_PORTABLE_TEST_DEFS
-
-#include <stdexcept>
-#include <stdint.h>
-
-#include "ignite/portable/portable.h"
-
-namespace ignite_test
-{
-    namespace core
-    {
-        namespace portable 
-        {
-            class PortableDummy
-            {
-                // No-op.
-            };
-
-            class PortableInner 
-            {
-            public:
-                PortableInner();
-
-                PortableInner(int32_t val);
-
-                int32_t GetValue() const;
-            private:
-                int32_t val;
-            };
-
-            class PortableOuter
-            {
-            public:
-                PortableOuter(int32_t valIn, int32_t valOut);
-
-                PortableInner GetInner() const;
-
-                int32_t GetValue() const;
-            private:
-                PortableInner inner;
-                int32_t val;
-            };
-
-            struct PortableFields
-            {
-                int32_t val1;
-                int32_t val2;
-                int32_t rawVal1;
-                int32_t rawVal2;
-
-                PortableFields() : val1(0), val2(0), rawVal1(0), rawVal2(0)
-                {
-                    // No-op.
-                }
-
-                PortableFields(int32_t val1, int32_t val2, int32_t rawVal1, int32_t rawVal2) :
-                    val1(val1), val2(val2), rawVal1(rawVal1), rawVal2(rawVal2)
-                {
-                    // No-op.   
-                }
-            };
-        }
-    }
-}
-
-namespace ignite
-{
-    namespace portable
-    {
-        namespace gt = ignite_test::core::portable;
-
-        template<>
-        struct PortableType<gt::PortableDummy>
-        {
-            /** <inheritdoc /> */
-            int32_t GetTypeId()
-            {
-                return GetPortableStringHashCode("PortableDummy");
-            }
-
-            /** <inheritdoc /> */
-            std::string GetTypeName()
-            {
-                return "PortableDummy";
-            }
-
-            /** <inheritdoc /> */
-            int32_t GetFieldId(const char* name)
-            {
-                return GetPortableStringHashCode(name);
-            }
-
-            /** <inheritdoc /> */
-            int32_t GetHashCode(const gt::PortableInner& obj)
-            {
-                return obj.GetValue();
-            }
-
-            /** <inheritdoc /> */
-            bool IsNull(const gt::PortableInner& obj)
-            {
-                return obj.GetValue() == 0;
-            }
-
-            /** <inheritdoc /> */
-            gt::PortableInner GetNull()
-            {
-                return gt::PortableInner(0);
-            }
-
-            /** <inheritdoc /> */
-            void Write(PortableWriter& writer, const gt::PortableDummy& obj)
-            {
-                // No-op.
-            }
-
-            /** <inheritdoc /> */
-            gt::PortableDummy Read(PortableReader& reader)
-            {
-                return gt::PortableDummy();
-            }
-        };
-
-        template<> 
-        struct PortableType<gt::PortableInner>
-        {
-            /** <inheritdoc /> */
-            int32_t GetTypeId() 
-            { 
-                return GetPortableStringHashCode("PortableInner"); 
-            }
-
-            /** <inheritdoc /> */
-            std::string GetTypeName()
-            {
-                return "PortableInner";
-            }
-
-            /** <inheritdoc /> */
-            int32_t GetFieldId(const char* name) 
-            { 
-                return GetPortableStringHashCode(name); 
-            }
-
-            /** <inheritdoc /> */
-            int32_t GetHashCode(const gt::PortableInner& obj)
-            {
-                return obj.GetValue();
-            }
-
-            /** <inheritdoc /> */
-            bool IsNull(const gt::PortableInner& obj)
-            {
-                return obj.GetValue() == 0;
-            }
-
-            /** <inheritdoc /> */
-            gt::PortableInner GetNull()
-            {
-                return gt::PortableInner(0);
-            }
-
-            /** <inheritdoc /> */
-            void Write(PortableWriter& writer, const gt::PortableInner& obj)
-            {
-                writer.WriteInt32("val", obj.GetValue());
-            }
-
-            /** <inheritdoc /> */
-            gt::PortableInner Read(PortableReader& reader)
-            {
-                int val = reader.ReadInt32("val");
-
-                return gt::PortableInner(val);
-            }
-        };
-
-        template<>
-        struct PortableType<gt::PortableOuter>
-        {
-            /** <inheritdoc /> */
-            int32_t GetTypeId()
-            {
-                return GetPortableStringHashCode("PortableOuter");
-            }
-
-            /** <inheritdoc /> */
-            std::string GetTypeName()
-            {
-                return "PortableOuter";
-            }
-
-            /** <inheritdoc /> */
-            int32_t GetFieldId(const char* name)
-            {
-                return GetPortableStringHashCode(name);
-            }
-
-            /** <inheritdoc /> */
-            int32_t GetHashCode(const gt::PortableOuter& obj)
-            {
-                return obj.GetValue() + obj.GetInner().GetValue();
-            }
-
-            /** <inheritdoc /> */
-            bool IsNull(const gt::PortableOuter& obj)
-            {
-                return obj.GetValue() == 0 && obj.GetInner().GetValue();
-            }
-
-            /** <inheritdoc /> */
-            gt::PortableOuter GetNull()
-            {
-                return gt::PortableOuter(0, 0);
-            }
-
-            /** <inheritdoc /> */
-            void Write(PortableWriter& writer, const gt::PortableOuter& obj)
-            {
-                writer.WriteObject("inner", obj.GetInner());
-                writer.WriteInt32("val", obj.GetValue());                
-            }
-
-            /** <inheritdoc /> */
-            gt::PortableOuter Read(PortableReader& reader)
-            {
-                gt::PortableInner inner = reader.ReadObject<gt::PortableInner>("inner");
-                int val = reader.ReadInt32("val");
-
-                return gt::PortableOuter(inner.GetValue(), val);
-            }
-        };
-
-        template<>
-        struct PortableType<gt::PortableFields>
-        {
-            /** <inheritdoc /> */
-            int32_t GetTypeId()
-            {
-                return GetPortableStringHashCode("PortableFields");
-            }
-
-            /** <inheritdoc /> */
-            std::string GetTypeName()
-            {
-                return "PortableFields";
-            }
-
-            /** <inheritdoc /> */
-            int32_t GetFieldId(const char* name)
-            {
-                return GetPortableStringHashCode(name);
-            }
-
-            /** <inheritdoc /> */
-            int32_t GetHashCode(const gt::PortableFields& obj)
-            {
-                return obj.val1 + obj.val2 + obj.rawVal1 + obj.rawVal2;
-            }
-
-            /** <inheritdoc /> */
-            bool IsNull(const gt::PortableFields& obj)
-            {
-                return false;
-            }
-
-            /** <inheritdoc /> */
-            gt::PortableFields GetNull()
-            {
-                throw std::runtime_error("Must not be called.");
-            }
-
-            /** <inheritdoc /> */
-            void Write(PortableWriter& writer, const gt::PortableFields& obj)
-            {
-                writer.WriteInt32("val1", obj.val1);
-                writer.WriteInt32("val2", obj.val2);
-
-                PortableRawWriter rawWriter = writer.RawWriter();
-
-                rawWriter.WriteInt32(obj.rawVal1);
-                rawWriter.WriteInt32(obj.rawVal2);
-            }
-
-            /** <inheritdoc /> */
-            gt::PortableFields Read(PortableReader& reader)
-            {
-                int32_t val1 = reader.ReadInt32("val1");
-                int32_t val2 = reader.ReadInt32("val2");
-
-                PortableRawReader rawReader = reader.RawReader();
-
-                int32_t rawVal1 = rawReader.ReadInt32();
-                int32_t rawVal2 = rawReader.ReadInt32();
-
-                return gt::PortableFields(val1, val2, rawVal1, rawVal2);
-            }
-        };
-    }
-}
-
-#endif
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/core-test/include/ignite/portable_test_utils.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core-test/include/ignite/portable_test_utils.h b/modules/platform/src/main/cpp/core-test/include/ignite/portable_test_utils.h
deleted file mode 100644
index 62f99f9..0000000
--- a/modules/platform/src/main/cpp/core-test/include/ignite/portable_test_utils.h
+++ /dev/null
@@ -1,516 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef _IGNITE_PORTABLE_TEST_UTILS
-#define _IGNITE_PORTABLE_TEST_UTILS
-
-#include "ignite/portable/portable.h"
-
-using namespace ignite;
-using namespace ignite::portable;
-using namespace ignite::impl::portable;
-
-namespace ignite_test
-{
-    namespace core
-    {
-        namespace portable
-        {
-            template<typename T>
-            inline void Write(PortableRawWriter& writer, T val)
-            {
-                throw std::runtime_error("Function is not defined");
-            }
-
-            template<typename T>
-            inline T Read(PortableRawReader& reader)
-            {
-                throw std::runtime_error("Function is not defined");
-            }
-
-            template<>
-            inline void Write(PortableRawWriter& writer, int8_t val)
-            {
-                writer.WriteInt8(val);
-            }
-
-            template<>
-            inline int8_t Read(PortableRawReader& reader)
-            {
-                return reader.ReadInt8();
-            }
-
-            template<>
-            inline void Write(PortableRawWriter& writer, bool val)
-            {
-                writer.WriteBool(val);
-            }
-
-            template<>
-            inline bool Read(PortableRawReader& reader)
-            {
-                return reader.ReadBool();
-            }
-
-            template<>
-            inline void Write(PortableRawWriter& writer, int16_t val)
-            {
-                writer.WriteInt16(val);
-            }
-
-            template<>
-            inline int16_t Read(PortableRawReader& reader)
-            {
-                return reader.ReadInt16();
-            }
-
-            template<>
-            inline void Write(PortableRawWriter& writer, uint16_t val)
-            {
-                writer.WriteUInt16(val);
-            }
-
-            template<>
-            inline uint16_t Read(PortableRawReader& reader)
-            {
-                return reader.ReadUInt16();
-            }
-
-            template<>
-            inline void Write(PortableRawWriter& writer, int32_t val)
-            {
-                writer.WriteInt32(val);
-            }
-
-            template<>
-            inline int32_t Read(PortableRawReader& reader)
-            {
-                return reader.ReadInt32();
-            }
-
-            template<>
-            inline void Write(PortableRawWriter& writer, int64_t val)
-            {
-                writer.WriteInt64(val);
-            }
-
-            template<>
-            inline int64_t Read(PortableRawReader& reader)
-            {
-                return reader.ReadInt64();
-            }
-
-            template<>
-            inline void Write(PortableRawWriter& writer, float val)
-            {
-                writer.WriteFloat(val);
-            }
-
-            template<>
-            inline float Read(PortableRawReader& reader)
-            {
-                return reader.ReadFloat();
-            }
-
-            template<>
-            inline void Write(PortableRawWriter& writer, double val)
-            {
-                writer.WriteDouble(val);
-            }
-
-            template<>
-            inline double Read(PortableRawReader& reader)
-            {
-                return reader.ReadDouble();
-            }
-
-            template<>
-            inline void Write(PortableRawWriter& writer, Guid val)
-            {
-                writer.WriteGuid(val);
-            }
-
-            template<>
-            inline Guid Read(PortableRawReader& reader)
-            {
-                return reader.ReadGuid();
-            }
-
-            template<typename T>
-            inline void WriteArray(PortableRawWriter& writer, T* val, int32_t len)
-            {
-                throw std::runtime_error("Function is not defined");
-            }
-
-            template<typename T>
-            inline int32_t ReadArray(PortableRawReader& reader, T* val, int32_t len)
-            {
-                throw std::runtime_error("Function is not defined");
-            }
-
-            template<>
-            inline void WriteArray(PortableRawWriter& writer, int8_t* val, int32_t len)
-            {
-                writer.WriteInt8Array(val, len);
-            }
-
-            template<>
-            inline int32_t ReadArray(PortableRawReader& reader, int8_t* val, int32_t len)
-            {
-                return reader.ReadInt8Array(val, len);
-            }
-
-            template<>
-            inline void WriteArray(PortableRawWriter& writer, bool* val, int32_t len)
-            {
-                writer.WriteBoolArray(val, len);
-            }
-
-            template<>
-            inline int32_t ReadArray(PortableRawReader& reader, bool* val, int32_t len)
-            {
-                return reader.ReadBoolArray(val, len);
-            }
-
-            template<>
-            inline void WriteArray(PortableRawWriter& writer, int16_t* val, int32_t len)
-            {
-                writer.WriteInt16Array(val, len);
-            }
-
-            template<>
-            inline int32_t ReadArray(PortableRawReader& reader, int16_t* val, int32_t len)
-            {
-                return reader.ReadInt16Array(val, len);
-            }
-
-            template<>
-            inline void WriteArray(PortableRawWriter& writer, uint16_t* val, int32_t len)
-            {
-                writer.WriteUInt16Array(val, len);
-            }
-
-            template<>
-            inline int32_t ReadArray(PortableRawReader& reader, uint16_t* val, int32_t len)
-            {
-                return reader.ReadUInt16Array(val, len);
-            }
-
-            template<>
-            inline void WriteArray(PortableRawWriter& writer, int32_t* val, int32_t len)
-            {
-                writer.WriteInt32Array(val, len);
-            }
-
-            template<>
-            inline int32_t ReadArray(PortableRawReader& reader, int32_t* val, int32_t len)
-            {
-                return reader.ReadInt32Array(val, len);
-            }
-
-            template<>
-            inline void WriteArray(PortableRawWriter& writer, int64_t* val, int32_t len)
-            {
-                writer.WriteInt64Array(val, len);
-            }
-
-            template<>
-            inline int32_t ReadArray(PortableRawReader& reader, int64_t* val, int32_t len)
-            {
-                return reader.ReadInt64Array(val, len);
-            }
-
-            template<>
-            inline void WriteArray(PortableRawWriter& writer, float* val, int32_t len)
-            {
-                writer.WriteFloatArray(val, len);
-            }
-
-            template<>
-            inline int32_t ReadArray(PortableRawReader& reader, float* val, int32_t len)
-            {
-                return reader.ReadFloatArray(val, len);
-            }
-
-            template<>
-            inline void WriteArray(PortableRawWriter& writer, double* val, int32_t len)
-            {
-                writer.WriteDoubleArray(val, len);
-            }
-
-            template<>
-            inline int32_t ReadArray(PortableRawReader& reader, double* val, int32_t len)
-            {
-                return reader.ReadDoubleArray(val, len);
-            }
-
-            template<>
-            inline void WriteArray(PortableRawWriter& writer, Guid* val, int32_t len)
-            {
-                writer.WriteGuidArray(val, len);
-            }
-
-            template<>
-            inline int32_t ReadArray(PortableRawReader& reader, Guid* val, int32_t len)
-            {
-                return reader.ReadGuidArray(val, len);
-            }
-
-            template<typename T>
-            inline void Write(PortableWriter& writer, const char* fieldName, T val)
-            {
-                throw std::runtime_error("Function is not defined");
-            }
-
-            template<typename T>
-            inline T Read(PortableReader& reader, const char* fieldName)
-            {
-                throw std::runtime_error("Function is not defined");
-            }
-
-            template<>
-            inline void Write(PortableWriter& writer, const char* fieldName, int8_t val)
-            {
-                writer.WriteInt8(fieldName, val);
-            }
-
-            template<>
-            inline int8_t Read(PortableReader& reader, const char* fieldName)
-            {
-                return reader.ReadInt8(fieldName);
-            }
-
-            template<>
-            inline void Write(PortableWriter& writer, const char* fieldName, bool val)
-            {
-                writer.WriteBool(fieldName, val);
-            }
-
-            template<>
-            inline bool Read(PortableReader& reader, const char* fieldName)
-            {
-                return reader.ReadBool(fieldName);
-            }
-
-            template<>
-            inline void Write(PortableWriter& writer, const char* fieldName, int16_t val)
-            {
-                writer.WriteInt16(fieldName, val);
-            }
-
-            template<>
-            inline int16_t Read(PortableReader& reader, const char* fieldName)
-            {
-                return reader.ReadInt16(fieldName);
-            }
-
-            template<>
-            inline void Write(PortableWriter& writer, const char* fieldName, uint16_t val)
-            {
-                writer.WriteUInt16(fieldName, val);
-            }
-
-            template<>
-            inline uint16_t Read(PortableReader& reader, const char* fieldName)
-            {
-                return reader.ReadUInt16(fieldName);
-            }
-
-            template<>
-            inline void Write(PortableWriter& writer, const char* fieldName, int32_t val)
-            {
-                writer.WriteInt32(fieldName, val);
-            }
-
-            template<>
-            inline int32_t Read(PortableReader& reader, const char* fieldName)
-            {
-                return reader.ReadInt32(fieldName);
-            }
-
-            template<>
-            inline void Write(PortableWriter& writer, const char* fieldName, int64_t val)
-            {
-                writer.WriteInt64(fieldName, val);
-            }
-
-            template<>
-            inline int64_t Read(PortableReader& reader, const char* fieldName)
-            {
-                return reader.ReadInt64(fieldName);
-            }
-
-            template<>
-            inline void Write(PortableWriter& writer, const char* fieldName, float val)
-            {
-                writer.WriteFloat(fieldName, val);
-            }
-
-            template<>
-            inline float Read(PortableReader& reader, const char* fieldName)
-            {
-                return reader.ReadFloat(fieldName);
-            }
-
-            template<>
-            inline void Write(PortableWriter& writer, const char* fieldName, double val)
-            {
-                writer.WriteDouble(fieldName, val);
-            }
-
-            template<>
-            inline double Read(PortableReader& reader, const char* fieldName)
-            {
-                return reader.ReadDouble(fieldName);
-            }
-
-            template<>
-            inline void Write(PortableWriter& writer, const char* fieldName, Guid val)
-            {
-                writer.WriteGuid(fieldName, val);
-            }
-
-            template<>
-            inline Guid Read(PortableReader& reader, const char* fieldName)
-            {
-                return reader.ReadGuid(fieldName);
-            }
-
-            template<typename T>
-            inline void WriteArray(PortableWriter& writer, const char* fieldName, T* val, int32_t len)
-            {
-                throw std::runtime_error("Function is not defined");
-            }
-
-            template<typename T>
-            inline int32_t ReadArray(PortableReader& reader, const char* fieldName, T* val, int32_t len)
-            {
-                throw std::runtime_error("Function is not defined");
-            }
-
-            template<>
-            inline void WriteArray(PortableWriter& writer, const char* fieldName, int8_t* val, int32_t len)
-            {
-                writer.WriteInt8Array(fieldName, val, len);
-            }
-
-            template<>
-            inline int32_t ReadArray(PortableReader& reader, const char* fieldName, int8_t* val, int32_t len)
-            {
-                return reader.ReadInt8Array(fieldName, val, len);
-            }
-
-            template<>
-            inline void WriteArray(PortableWriter& writer, const char* fieldName, bool* val, int32_t len)
-            {
-                writer.WriteBoolArray(fieldName, val, len);
-            }
-
-            template<>
-            inline int32_t ReadArray(PortableReader& reader, const char* fieldName, bool* val, int32_t len)
-            {
-                return reader.ReadBoolArray(fieldName, val, len);
-            }
-
-            template<>
-            inline void WriteArray(PortableWriter& writer, const char* fieldName, int16_t* val, int32_t len)
-            {
-                writer.WriteInt16Array(fieldName, val, len);
-            }
-
-            template<>
-            inline int32_t ReadArray(PortableReader& reader, const char* fieldName, int16_t* val, int32_t len)
-            {
-                return reader.ReadInt16Array(fieldName, val, len);
-            }
-
-            template<>
-            inline void WriteArray(PortableWriter& writer, const char* fieldName, uint16_t* val, int32_t len)
-            {
-                writer.WriteUInt16Array(fieldName, val, len);
-            }
-
-            template<>
-            inline int32_t ReadArray(PortableReader& reader, const char* fieldName, uint16_t* val, int32_t len)
-            {
-                return reader.ReadUInt16Array(fieldName, val, len);
-            }
-
-            template<>
-            inline void WriteArray(PortableWriter& writer, const char* fieldName, int32_t* val, int32_t len)
-            {
-                writer.WriteInt32Array(fieldName, val, len);
-            }
-
-            template<>
-            inline int32_t ReadArray(PortableReader& reader, const char* fieldName, int32_t* val, int32_t len)
-            {
-                return reader.ReadInt32Array(fieldName, val, len);
-            }
-
-            template<>
-            inline void WriteArray(PortableWriter& writer, const char* fieldName, int64_t* val, int32_t len)
-            {
-                writer.WriteInt64Array(fieldName, val, len);
-            }
-
-            template<>
-            inline int32_t ReadArray(PortableReader& reader, const char* fieldName, int64_t* val, int32_t len)
-            {
-                return reader.ReadInt64Array(fieldName, val, len);
-            }
-
-            template<>
-            inline void WriteArray(PortableWriter& writer, const char* fieldName, float* val, int32_t len)
-            {
-                writer.WriteFloatArray(fieldName, val, len);
-            }
-
-            template<>
-            inline int32_t ReadArray(PortableReader& reader, const char* fieldName, float* val, int32_t len)
-            {
-                return reader.ReadFloatArray(fieldName, val, len);
-            }
-
-            template<>
-            inline void WriteArray(PortableWriter& writer, const char* fieldName, double* val, int32_t len)
-            {
-                writer.WriteDoubleArray(fieldName, val, len);
-            }
-
-            template<>
-            inline int32_t ReadArray(PortableReader& reader, const char* fieldName, double* val, int32_t len)
-            {
-                return reader.ReadDoubleArray(fieldName, val, len);
-            }
-
-            template<>
-            inline void WriteArray(PortableWriter& writer, const char* fieldName, Guid* val, int32_t len)
-            {
-                writer.WriteGuidArray(fieldName, val, len);
-            }
-
-            template<>
-            inline int32_t ReadArray(PortableReader& reader, const char* fieldName, Guid* val, int32_t len)
-            {
-                return reader.ReadGuidArray(fieldName, val, len);
-            }
-        }
-    }
-}
-
-#endif
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/core-test/include/teamcity_messages.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core-test/include/teamcity_messages.h b/modules/platform/src/main/cpp/core-test/include/teamcity_messages.h
deleted file mode 100644
index 8cf23d0..0000000
--- a/modules/platform/src/main/cpp/core-test/include/teamcity_messages.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/* Copyright 2011 JetBrains s.r.o.
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * $Revision: 88625 $
-*/
-
-#ifndef H_TEAMCITY_MESSAGES
-#define H_TEAMCITY_MESSAGES
-
-#include <string>
-#include <iostream>
-
-namespace JetBrains {
-
-std::string getFlowIdFromEnvironment();
-bool underTeamcity();
-
-class TeamcityMessages {
-    std::ostream *m_out;
-    
-protected:
-    std::string escape(std::string s);
-
-    void openMsg(const std::string &name);
-    void writeProperty(std::string name, std::string value);
-    void closeMsg();
-
-public:
-    TeamcityMessages();
-    
-    void setOutput(std::ostream &);
-    
-    void suiteStarted(std::string name, std::string flowid = "");
-    void suiteFinished(std::string name, std::string flowid = "");
-    
-    void testStarted(std::string name, std::string flowid = "");
-    void testFailed(std::string name, std::string message, std::string details, std::string flowid = "");
-    void testIgnored(std::string name, std::string message, std::string flowid = "");
-    void testFinished(std::string name, int durationMs = -1, std::string flowid = "");    
-};
-
-}
-
-#endif /* H_TEAMCITY_MESSAGES */

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/core-test/project/README.TXT
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core-test/project/README.TXT b/modules/platform/src/main/cpp/core-test/project/README.TXT
deleted file mode 100644
index 97f4c64..0000000
--- a/modules/platform/src/main/cpp/core-test/project/README.TXT
+++ /dev/null
@@ -1 +0,0 @@
-Contains IDE projects artifacts.

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/core-test/project/vs/README.TXT
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core-test/project/vs/README.TXT b/modules/platform/src/main/cpp/core-test/project/vs/README.TXT
deleted file mode 100644
index f4fb456..0000000
--- a/modules/platform/src/main/cpp/core-test/project/vs/README.TXT
+++ /dev/null
@@ -1 +0,0 @@
-Contains Visual Studio project artifacts.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/core-test/project/vs/core-test.vcxproj
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core-test/project/vs/core-test.vcxproj b/modules/platform/src/main/cpp/core-test/project/vs/core-test.vcxproj
deleted file mode 100644
index ca6ee1a..0000000
--- a/modules/platform/src/main/cpp/core-test/project/vs/core-test.vcxproj
+++ /dev/null
@@ -1,174 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="Debug|Win32">
-      <Configuration>Debug</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Debug|x64">
-      <Configuration>Debug</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|Win32">
-      <Configuration>Release</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|x64">
-      <Configuration>Release</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <ItemGroup>
-    <ProjectReference Include="..\..\..\common\project\vs\common.vcxproj">
-      <Project>{4f7e4917-4612-4b96-9838-025711ade391}</Project>
-    </ProjectReference>
-    <ProjectReference Include="..\..\..\core\project\vs\core.vcxproj">
-      <Project>{e2dea693-f2ea-43c2-a813-053378f6e4db}</Project>
-    </ProjectReference>
-  </ItemGroup>
-  <ItemGroup>
-    <None Include="..\..\config\cache-query.xml" />
-    <None Include="..\..\config\cache-test.xml" />
-  </ItemGroup>
-  <ItemGroup>
-    <ClCompile Include="..\..\src\cache_test.cpp" />
-    <ClCompile Include="..\..\src\concurrent_test.cpp" />
-    <ClCompile Include="..\..\src\ignition_test.cpp" />
-    <ClCompile Include="..\..\src\handle_registry_test.cpp" />
-    <ClCompile Include="..\..\src\portable_reader_writer_raw_test.cpp" />
-    <ClCompile Include="..\..\src\portable_reader_writer_test.cpp" />
-    <ClCompile Include="..\..\src\portable_session_test.cpp" />
-    <ClCompile Include="..\..\src\portable_test_defs.cpp" />
-    <ClCompile Include="..\..\src\cache_query_test.cpp" />
-    <ClCompile Include="..\..\src\teamcity_boost.cpp" />
-    <ClCompile Include="..\..\src\teamcity_messages.cpp" />
-  </ItemGroup>
-  <ItemGroup>
-    <ClInclude Include="..\..\include\ignite\portable_test_defs.h" />
-    <ClInclude Include="..\..\include\ignite\portable_test_utils.h" />
-    <ClInclude Include="..\..\include\teamcity_messages.h" />
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectGuid>{133A22DB-FD60-44B9-B5E3-6CBB3EA5ABF0}</ProjectGuid>
-    <RootNamespace>coretest</RootNamespace>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseDebugLibraries>true</UseDebugLibraries>
-    <PlatformToolset>v100</PlatformToolset>
-    <CharacterSet>Unicode</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseDebugLibraries>true</UseDebugLibraries>
-    <PlatformToolset>v100</PlatformToolset>
-    <CharacterSet>Unicode</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseDebugLibraries>false</UseDebugLibraries>
-    <PlatformToolset>v100</PlatformToolset>
-    <WholeProgramOptimization>true</WholeProgramOptimization>
-    <CharacterSet>Unicode</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseDebugLibraries>false</UseDebugLibraries>
-    <PlatformToolset>v100</PlatformToolset>
-    <WholeProgramOptimization>true</WholeProgramOptimization>
-    <CharacterSet>Unicode</CharacterSet>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
-    <IntDir>$(Platform)\$(Configuration)\</IntDir>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
-    <IntDir>$(Platform)\$(Configuration)\</IntDir>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
-    <ClCompile>
-      <WarningLevel>Level3</WarningLevel>
-      <Optimization>Disabled</Optimization>
-      <SDLCheck>true</SDLCheck>
-      <AdditionalIncludeDirectories>$(JAVA_HOME)\include;$(JAVA_HOME)\include\win32;$(ProjectDir)\..\..\..\common\include;$(ProjectDir)\..\..\..\common\os\win\include;$(ProjectDir)\..\..\..\core\include;$(ProjectDir)\..\..\..\core\os\win\include;$(ProjectDir)\..\..\include;$(BOOST_HOME)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>_DEBUG;IGNITE_IMPL;BOOST_DATE_TIME_NO_LIB;BOOST_REGEX_NO_LIB;_CRT_SECURE_NO_WARNINGS;IGNITE_FRIEND;_CRTDBG_MAP_ALLOC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <ExceptionHandling>Async</ExceptionHandling>
-    </ClCompile>
-    <Link>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <AdditionalDependencies>$(BOOST_HOME)\lib64-msvc-10.0\libboost_unit_test_framework-vc100-mt-gd-1_58.lib;%(AdditionalDependencies)</AdditionalDependencies>
-      <SubSystem>Console</SubSystem>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <ClCompile>
-      <WarningLevel>Level3</WarningLevel>
-      <Optimization>Disabled</Optimization>
-      <SDLCheck>true</SDLCheck>
-      <AdditionalIncludeDirectories>$(JAVA_HOME)\include;$(JAVA_HOME)\include\win32;$(ProjectDir)\..\..\..\common\include;$(ProjectDir)\..\..\..\common\os\win\include;$(ProjectDir)\..\..\..\core\include;$(ProjectDir)\..\..\..\core\os\win\include;$(ProjectDir)\..\..\include;$(BOOST_HOME)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>_DEBUG;IGNITE_IMPL;BOOST_DATE_TIME_NO_LIB;BOOST_REGEX_NO_LIB;_CRT_SECURE_NO_WARNINGS;IGNITE_FRIEND;IGNITE_TESTS_32;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <ExceptionHandling>Async</ExceptionHandling>
-    </ClCompile>
-    <Link>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <AdditionalDependencies>$(BOOST_HOME)\lib64-msvc-10.0\libboost_unit_test_framework-vc100-mt-gd-1_58.lib;%(AdditionalDependencies)</AdditionalDependencies>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
-    <ClCompile>
-      <WarningLevel>Level3</WarningLevel>
-      <Optimization>MaxSpeed</Optimization>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <IntrinsicFunctions>true</IntrinsicFunctions>
-      <SDLCheck>true</SDLCheck>
-      <AdditionalIncludeDirectories>$(JAVA_HOME)\include;$(JAVA_HOME)\include\win32;$(ProjectDir)\..\..\..\common\include;$(ProjectDir)\..\..\..\common\os\win\include;$(ProjectDir)\..\..\..\core\include;$(ProjectDir)\..\..\..\core\os\win\include;$(ProjectDir)\..\..\include;$(BOOST_HOME)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>NDEBUG;IGNITE_IMPL;BOOST_DATE_TIME_NO_LIB;BOOST_REGEX_NO_LIB;_CRT_SECURE_NO_WARNINGS;IGNITE_FRIEND;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <ExceptionHandling>Async</ExceptionHandling>
-    </ClCompile>
-    <Link>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <EnableCOMDATFolding>true</EnableCOMDATFolding>
-      <OptimizeReferences>true</OptimizeReferences>
-      <AdditionalDependencies>$(BOOST_HOME)\lib64-msvc-10.0\libboost_unit_test_framework-vc100-mt-1_58.lib;%(AdditionalDependencies)</AdditionalDependencies>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <ClCompile>
-      <WarningLevel>Level3</WarningLevel>
-      <Optimization>MaxSpeed</Optimization>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <IntrinsicFunctions>true</IntrinsicFunctions>
-      <SDLCheck>true</SDLCheck>
-      <AdditionalIncludeDirectories>$(JAVA_HOME)\include;$(JAVA_HOME)\include\win32;$(ProjectDir)\..\..\..\common\include;$(ProjectDir)\..\..\..\common\os\win\include;$(ProjectDir)\..\..\..\core\include;$(ProjectDir)\..\..\..\core\os\win\include;$(ProjectDir)\..\..\include;$(BOOST_HOME)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>NDEBUG;IGNITE_IMPL;BOOST_DATE_TIME_NO_LIB;BOOST_REGEX_NO_LIB;_CRT_SECURE_NO_WARNINGS;IGNITE_FRIEND;IGNITE_TESTS_32%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <ExceptionHandling>Async</ExceptionHandling>
-    </ClCompile>
-    <Link>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <EnableCOMDATFolding>true</EnableCOMDATFolding>
-      <OptimizeReferences>true</OptimizeReferences>
-      <AdditionalDependencies>$(BOOST_HOME)\lib64-msvc-10.0\libboost_unit_test_framework-vc100-mt-1_58.lib;%(AdditionalDependencies)</AdditionalDependencies>
-    </Link>
-  </ItemDefinitionGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/core-test/project/vs/core-test.vcxproj.filters
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core-test/project/vs/core-test.vcxproj.filters b/modules/platform/src/main/cpp/core-test/project/vs/core-test.vcxproj.filters
deleted file mode 100644
index 7e8dd95..0000000
--- a/modules/platform/src/main/cpp/core-test/project/vs/core-test.vcxproj.filters
+++ /dev/null
@@ -1,68 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup>
-    <ClCompile Include="..\..\src\cache_test.cpp">
-      <Filter>Code</Filter>
-    </ClCompile>
-    <ClCompile Include="..\..\src\concurrent_test.cpp">
-      <Filter>Code</Filter>
-    </ClCompile>
-    <ClCompile Include="..\..\src\ignition_test.cpp">
-      <Filter>Code</Filter>
-    </ClCompile>
-    <ClCompile Include="..\..\src\handle_registry_test.cpp">
-      <Filter>Code</Filter>
-    </ClCompile>
-    <ClCompile Include="..\..\src\portable_reader_writer_raw_test.cpp">
-      <Filter>Code</Filter>
-    </ClCompile>
-    <ClCompile Include="..\..\src\portable_reader_writer_test.cpp">
-      <Filter>Code</Filter>
-    </ClCompile>
-    <ClCompile Include="..\..\src\portable_session_test.cpp">
-      <Filter>Code</Filter>
-    </ClCompile>
-    <ClCompile Include="..\..\src\portable_test_defs.cpp">
-      <Filter>Code</Filter>
-    </ClCompile>
-    <ClCompile Include="..\..\src\cache_query_test.cpp">
-      <Filter>Code</Filter>
-    </ClCompile>
-    <ClCompile Include="..\..\src\teamcity_boost.cpp">
-      <Filter>TeamCity</Filter>
-    </ClCompile>
-    <ClCompile Include="..\..\src\teamcity_messages.cpp">
-      <Filter>TeamCity</Filter>
-    </ClCompile>
-  </ItemGroup>
-  <ItemGroup>
-    <ClInclude Include="..\..\include\ignite\portable_test_defs.h">
-      <Filter>Code</Filter>
-    </ClInclude>
-    <ClInclude Include="..\..\include\ignite\portable_test_utils.h">
-      <Filter>Code</Filter>
-    </ClInclude>
-    <ClInclude Include="..\..\include\teamcity_messages.h">
-      <Filter>TeamCity</Filter>
-    </ClInclude>
-  </ItemGroup>
-  <ItemGroup>
-    <Filter Include="Code">
-      <UniqueIdentifier>{486c367c-57e9-430a-80f0-39fd5b09bc64}</UniqueIdentifier>
-    </Filter>
-    <Filter Include="Configs">
-      <UniqueIdentifier>{a46d9d4c-44eb-40da-b4f6-89cc43b70c12}</UniqueIdentifier>
-    </Filter>
-    <Filter Include="TeamCity">
-      <UniqueIdentifier>{76bceab0-e251-445f-88c3-3f6f8739423b}</UniqueIdentifier>
-    </Filter>
-  </ItemGroup>
-  <ItemGroup>
-    <None Include="..\..\config\cache-test.xml">
-      <Filter>Configs</Filter>
-    </None>
-    <None Include="..\..\config\cache-query.xml">
-      <Filter>Configs</Filter>
-    </None>
-  </ItemGroup>
-</Project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/core-test/src/cache_query_test.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core-test/src/cache_query_test.cpp b/modules/platform/src/main/cpp/core-test/src/cache_query_test.cpp
deleted file mode 100644
index 47009f4..0000000
--- a/modules/platform/src/main/cpp/core-test/src/cache_query_test.cpp
+++ /dev/null
@@ -1,656 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef _MSC_VER
-    #define BOOST_TEST_DYN_LINK
-#endif
-
-#include <sstream>
-
-#include <boost/test/unit_test.hpp>
-
-#include "ignite/impl/utils.h"
-#include "ignite/cache/cache.h"
-#include "ignite/cache/query/query_cursor.h"
-#include "ignite/cache/query/query_sql.h"
-#include "ignite/cache/query/query_text.h"
-#include "ignite/ignite.h"
-#include "ignite/ignition.h"
-
-using namespace boost::unit_test;
-
-using namespace ignite;
-using namespace ignite::cache;
-using namespace ignite::cache::query;
-using namespace ignite::impl::utils;
-
-/**
- * Person class for query tests.
- */
-class IGNITE_IMPORT_EXPORT QueryPerson
-{
-public:
-    /**
-     * Constructor.
-     */
-    QueryPerson() : name(NULL), age(0)
-    {
-        // No-op.
-    }
-
-    /**
-     * Constructor.
-     *
-     * @param name Name.
-     * @param age Age.
-     */
-    QueryPerson(std::string name, int age) : name(CopyChars(name.c_str())), age(age)
-    {
-        // No-op.
-    }
-
-    /**
-     * Copy constructor.
-     *
-     * @param other Other instance.
-     */
-    QueryPerson(const QueryPerson& other)
-    {
-        name = CopyChars(other.name);
-        age = other.age;
-    }
-
-    /**
-     * Assignment operator.
-     *
-     * @param other Other instance.
-     * @return This instance.
-     */
-    QueryPerson& operator=(const QueryPerson& other)
-    {
-        if (&other != this)
-        {
-            QueryPerson tmp(other);
-
-            char* name0 = name;
-            int age0 = age;
-
-            name = tmp.name;
-            age = tmp.age;
-
-            tmp.name = name0;
-            tmp.age = age0;
-        }
-
-        return *this;
-    }
-
-    /**
-     * Destructor.
-     */
-    ~QueryPerson()
-    {
-        ReleaseChars(name);
-    }
-
-    /**
-     * Get name.
-     * 
-     * @return Name.
-     */
-    std::string GetName()
-    {
-        return name ? std::string(name) : std::string();
-    }
-
-    /**
-     * Get age.
-     * 
-     * @return Age.
-     */
-    int32_t GetAge()
-    {
-        return age;
-    }
-
-private:
-    /** Name. */
-    char* name;
-
-    /** Age. */
-    int age;
-};
-
-namespace ignite
-{
-    namespace portable
-    {
-        /**
-         * Portable type definition.
-         */
-        IGNITE_PORTABLE_TYPE_START(QueryPerson)
-            IGNITE_PORTABLE_GET_TYPE_ID_AS_HASH(QueryPerson)
-            IGNITE_PORTABLE_GET_TYPE_NAME_AS_IS(QueryPerson)
-            IGNITE_PORTABLE_GET_FIELD_ID_AS_HASH
-            IGNITE_PORTABLE_GET_HASH_CODE_ZERO(QueryPerson)
-            IGNITE_PORTABLE_IS_NULL_FALSE(QueryPerson)
-            IGNITE_PORTABLE_GET_NULL_DEFAULT_CTOR(QueryPerson)
-
-            void Write(PortableWriter& writer, QueryPerson obj)
-            {
-                writer.WriteString("name", obj.GetName());
-                writer.WriteInt32("age", obj.GetAge());
-            }
-
-            QueryPerson Read(PortableReader& reader)
-            {
-                std::string name = reader.ReadString("name");
-                int age = reader.ReadInt32("age");
-            
-                return QueryPerson(name, age);
-            }
-
-        IGNITE_PORTABLE_TYPE_END
-    }
-}
-
-/** Node started during the test. */
-Ignite grid = Ignite();
-
-/** Cache accessor. */
-Cache<int, QueryPerson> GetCache()
-{
-    return grid.GetCache<int, QueryPerson>("cache");
-}
-
-/**
- * Test setup fixture.
- */
-struct CacheQueryTestSuiteFixture {
-    /**
-     * Constructor.
-     */
-    CacheQueryTestSuiteFixture()
-    {
-        IgniteConfiguration cfg;
-
-        IgniteJvmOption opts[5];
-
-        opts[0] = IgniteJvmOption("-Xdebug");
-        opts[1] = IgniteJvmOption("-Xnoagent");
-        opts[2] = IgniteJvmOption("-Djava.compiler=NONE");
-        opts[3] = IgniteJvmOption("-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005");
-        opts[4] = IgniteJvmOption("-XX:+HeapDumpOnOutOfMemoryError");
-
-        cfg.jvmOptsLen = 5;
-        cfg.jvmOpts = opts;
-
-#ifdef IGNITE_TESTS_32
-        cfg.jvmInitMem = 256;
-        cfg.jvmMaxMem = 768;
-#else
-        cfg.jvmInitMem = 1024;
-        cfg.jvmMaxMem = 4096;
-#endif
-
-        char* cfgPath = getenv("IGNITE_NATIVE_TEST_CPP_CONFIG_PATH");
-
-        std::string cfgPathStr = std::string(cfgPath).append("/").append("cache-query.xml");
-
-        cfg.springCfgPath = const_cast<char*>(cfgPathStr.c_str());
-
-        IgniteError err;
-
-        Ignite grid0 = Ignition::Start(cfg, &err);
-
-        if (err.GetCode() != IgniteError::IGNITE_SUCCESS)
-            BOOST_ERROR(err.GetText());
-
-        grid = grid0;
-    }
-
-    /**
-     * Destructor.
-     */
-    ~CacheQueryTestSuiteFixture()
-    {
-        Ignition::Stop(grid.GetName(), true);
-    }
-};
-
-/**
- * Ensure that HasNext() fails.
- *
- * @param cur Cursor.
- */
-void CheckHasNextFail(QueryCursor<int, QueryPerson>& cur)
-{
-    try
-    {
-        cur.HasNext();
-
-        BOOST_FAIL("Must fail.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_GENERIC);
-    }
-}
-
-/**
- * Ensure that GetNext() fails.
- *
- * @param cur Cursor.
- */
-void CheckGetNextFail(QueryCursor<int, QueryPerson>& cur)
-{
-    try
-    {
-        cur.GetNext();
-
-        BOOST_FAIL("Must fail.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_GENERIC);
-    }
-}
-
-/**
- * Ensure that GetAll() fails.
- *
- * @param cur Cursor.
- */
-void CheckGetAllFail(QueryCursor<int, QueryPerson>& cur)
-{
-    try 
-    {
-        std::vector<CacheEntry<int, QueryPerson>> res;
-
-        cur.GetAll(res);
-
-        BOOST_FAIL("Must fail.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_GENERIC);
-    }
-}
-
-/**
- * Check empty result through iteration.
- *
- * @param cur Cursor.
- */
-void CheckEmpty(QueryCursor<int, QueryPerson>& cur)
-{
-    BOOST_REQUIRE(!cur.HasNext());
-
-    CheckGetNextFail(cur);
-    CheckGetAllFail(cur);
-}
-
-/**
- * Check empty result through GetAll().
- *
- * @param cur Cursor.
- */
-void CheckEmptyGetAll(QueryCursor<int, QueryPerson>& cur)
-{
-    std::vector<CacheEntry<int, QueryPerson>> res;
-
-    cur.GetAll(res);
-
-    BOOST_REQUIRE(res.size() == 0);
-
-    CheckHasNextFail(cur);
-    CheckGetNextFail(cur);
-}
-
-/**
- * Check single result through iteration.
- *
- * @param cur Cursor.
- * @param key1 Key.
- * @param name1 Name.
- * @param age1 Age.
- */
-void CheckSingle(QueryCursor<int, QueryPerson>& cur, int key, std::string name, int age)
-{
-    BOOST_REQUIRE(cur.HasNext());
-
-    CheckGetAllFail(cur);
-
-    CacheEntry<int, QueryPerson> entry = cur.GetNext();
-
-    CheckGetAllFail(cur);
-
-    BOOST_REQUIRE(entry.GetKey() == key);
-    BOOST_REQUIRE(entry.GetValue().GetName().compare(name) == 0);
-    BOOST_REQUIRE(entry.GetValue().GetAge() == age);
-
-    BOOST_REQUIRE(!cur.HasNext());
-
-    CheckGetNextFail(cur);
-    CheckGetAllFail(cur);
-}
-
-/**
- * Check single result through GetAll().
- *
- * @param cur Cursor.
- * @param key1 Key.
- * @param name1 Name.
- * @param age1 Age.
- */
-void CheckSingleGetAll(QueryCursor<int, QueryPerson>& cur, int key, std::string name, int age)
-{
-    std::vector<CacheEntry<int, QueryPerson>> res;
-
-    cur.GetAll(res);
-
-    CheckHasNextFail(cur);
-    CheckGetNextFail(cur);
-    CheckGetAllFail(cur);
-
-    BOOST_REQUIRE(res.size() == 1);
-
-    BOOST_REQUIRE(res[0].GetKey() == 1);    
-    BOOST_REQUIRE(res[0].GetValue().GetName().compare(name) == 0);
-    BOOST_REQUIRE(res[0].GetValue().GetAge() == age);
-
-    CheckHasNextFail(cur);
-    CheckGetNextFail(cur);
-    CheckGetAllFail(cur);
-}
-
-/**
- * Check multiple results through iteration.
- *
- * @param cur Cursor.
- * @param key1 Key 1.
- * @param name1 Name 1.
- * @param age1 Age 1.
- * @param key2 Key 2.
- * @param name2 Name 2.
- * @param age2 Age 2.
- */
-void CheckMultiple(QueryCursor<int, QueryPerson>& cur, int key1, std::string name1, 
-    int age1, int key2, std::string name2, int age2)
-{
-    for (int i = 0; i < 2; i++)
-    {
-        BOOST_REQUIRE(cur.HasNext());
-
-        CheckGetAllFail(cur);
-
-        CacheEntry<int, QueryPerson> entry = cur.GetNext();
-
-        CheckGetAllFail(cur);
-
-        if (entry.GetKey() == key1)
-        {
-            BOOST_REQUIRE(entry.GetValue().GetName().compare(name1) == 0);
-            BOOST_REQUIRE(entry.GetValue().GetAge() == age1);            
-        }
-        else if (entry.GetKey() == key2)
-        {
-            BOOST_REQUIRE(entry.GetValue().GetName().compare(name2) == 0);
-            BOOST_REQUIRE(entry.GetValue().GetAge() == age2);            
-        }
-        else
-            BOOST_FAIL("Unexpected entry.");
-    }
-    
-    BOOST_REQUIRE(!cur.HasNext());
-
-    CheckGetNextFail(cur);
-    CheckGetAllFail(cur);
-}
-
-/**
- * Check multiple results through GetAll().
- *
- * @param cur Cursor.
- * @param key1 Key 1.
- * @param name1 Name 1.
- * @param age1 Age 1.
- * @param key2 Key 2.
- * @param name2 Name 2.
- * @param age2 Age 2.
- */
-void CheckMultipleGetAll(QueryCursor<int, QueryPerson>& cur, int key1, std::string name1, int age1, 
-    int key2, std::string name2, int age2)
-{
-    std::vector<CacheEntry<int, QueryPerson>> res;
-
-    cur.GetAll(res);
-
-    CheckHasNextFail(cur);
-    CheckGetNextFail(cur);
-    CheckGetAllFail(cur);
-
-    BOOST_REQUIRE(res.size() == 2);
-
-    for (int i = 0; i < 2; i++)
-    {
-        CacheEntry<int, QueryPerson> entry = res[i];
-
-        if (entry.GetKey() == key1)
-        {
-            BOOST_REQUIRE(entry.GetValue().GetName().compare(name1) == 0);
-            BOOST_REQUIRE(entry.GetValue().GetAge() == age1);            
-        }
-        else if (entry.GetKey() == key2)
-        {
-            BOOST_REQUIRE(entry.GetValue().GetName().compare(name2) == 0);
-            BOOST_REQUIRE(entry.GetValue().GetAge() == age2);
-        }
-        else
-            BOOST_FAIL("Unexpected entry.");
-    }
-}
-
-BOOST_FIXTURE_TEST_SUITE(CacheQueryTestSuite, CacheQueryTestSuiteFixture)
-
-/**
- * Test SQL query.
- */
-BOOST_AUTO_TEST_CASE(TestSqlQuery)
-{    
-    Cache<int, QueryPerson> cache = GetCache();
-
-    // Test query with no results.
-    SqlQuery qry("QueryPerson", "age < 20");
-
-    QueryCursor<int, QueryPerson> cursor = cache.Query(qry);
-    CheckEmpty(cursor);
-
-    cursor = cache.Query(qry);
-    CheckEmptyGetAll(cursor);
-
-    // Test simple query.
-    cache.Put(1, QueryPerson("A1", 10));
-    cache.Put(2, QueryPerson("A2", 20));
-    
-    cursor = cache.Query(qry);
-    CheckSingle(cursor, 1, "A1", 10);
-    
-    cursor = cache.Query(qry);
-    CheckSingleGetAll(cursor, 1, "A1", 10);
-
-    // Test simple local query.
-    qry.SetLocal(true);
-
-    cursor = cache.Query(qry);
-    CheckSingle(cursor, 1, "A1", 10);
-
-    cursor = cache.Query(qry);
-    CheckSingleGetAll(cursor, 1, "A1", 10);
-
-    // Test query with arguments.
-    qry.SetSql("age < ? AND name = ?");
-    qry.AddArgument<int>(20);
-    qry.AddArgument<std::string>("A1");
-
-    cursor = cache.Query(qry);
-    CheckSingle(cursor, 1, "A1", 10);
-
-    cursor = cache.Query(qry);
-    CheckSingleGetAll(cursor, 1, "A1", 10);
-
-    // Test query returning multiple entries.
-    qry = SqlQuery("QueryPerson", "age < 30");
-
-    cursor = cache.Query(qry);
-    CheckMultiple(cursor, 1, "A1", 10, 2, "A2", 20);
-
-    cursor = cache.Query(qry);
-    CheckMultipleGetAll(cursor, 1, "A1", 10, 2, "A2", 20);
-}
-
-/**
- * Test text query.
- */
-BOOST_AUTO_TEST_CASE(TestTextQuery)
-{
-    Cache<int, QueryPerson> cache = GetCache();
-
-    // Test query with no results.
-    TextQuery qry("QueryPerson", "A1");
-
-    QueryCursor<int, QueryPerson> cursor = cache.Query(qry);
-    CheckEmpty(cursor);
-
-    cursor = cache.Query(qry);
-    CheckEmptyGetAll(cursor);
-
-    // Test simple query.
-    cache.Put(1, QueryPerson("A1", 10));
-    cache.Put(2, QueryPerson("A2", 20));
-
-    cursor = cache.Query(qry);
-    CheckSingle(cursor, 1, "A1", 10);
-
-    cursor = cache.Query(qry);
-    CheckSingleGetAll(cursor, 1, "A1", 10);
-
-    // Test simple local query.
-    qry.SetLocal(true);
-
-    cursor = cache.Query(qry);
-    CheckSingle(cursor, 1, "A1", 10);
-
-    cursor = cache.Query(qry);
-    CheckSingleGetAll(cursor, 1, "A1", 10);
-
-    // Test query returning multiple entries.
-    qry = TextQuery("QueryPerson", "A*");
-
-    cursor = cache.Query(qry);
-    CheckMultiple(cursor, 1, "A1", 10, 2, "A2", 20);
-
-    cursor = cache.Query(qry);
-    CheckMultipleGetAll(cursor, 1, "A1", 10, 2, "A2", 20);
-}
-
-/**
- * Test scan query.
- */
-BOOST_AUTO_TEST_CASE(TestScanQuery)
-{
-    // Test simple query.
-    Cache<int, QueryPerson> cache = GetCache();
-
-    // Test query with no results.
-    ScanQuery qry;
-
-    QueryCursor<int, QueryPerson> cursor = cache.Query(qry);
-    CheckEmpty(cursor);
-
-    cursor = cache.Query(qry);
-    CheckEmptyGetAll(cursor);
-
-    // Test simple query.
-    cache.Put(1, QueryPerson("A1", 10));
-
-    cursor = cache.Query(qry);
-    CheckSingle(cursor, 1, "A1", 10);
-
-    cursor = cache.Query(qry);
-    CheckSingleGetAll(cursor, 1, "A1", 10);
-
-    // Test query returning multiple entries.
-    cache.Put(2, QueryPerson("A2", 20));
-
-    cursor = cache.Query(qry);
-    CheckMultiple(cursor, 1, "A1", 10, 2, "A2", 20);
-
-    cursor = cache.Query(qry);
-    CheckMultipleGetAll(cursor, 1, "A1", 10, 2, "A2", 20);
-}
-
-/**
- * Test scan query over partitions.
- */
-BOOST_AUTO_TEST_CASE(TestScanQueryPartitioned)
-{
-    // Populate cache with data.
-    Cache<int, QueryPerson> cache = GetCache();
-
-    int32_t partCnt = 256;   // Defined in configuration explicitly.   
-    int32_t entryCnt = 1000; // Should be greater than partCnt.
-    
-    for (int i = 0; i < entryCnt; i++) 
-    {
-        std::stringstream stream; 
-        
-        stream << "A" << i;
-            
-        cache.Put(i, QueryPerson(stream.str(), i * 10));
-    }
-
-    // Iterate over all partitions and collect data.
-    std::set<int> keys;
-
-    for (int i = 0; i < partCnt; i++)
-    {
-        ScanQuery qry(i);
-
-        QueryCursor<int, QueryPerson> cur = cache.Query(qry);
-
-        while (cur.HasNext())
-        {
-            CacheEntry<int, QueryPerson> entry = cur.GetNext();
-
-            int key = entry.GetKey();
-
-            keys.insert(key);
-
-            std::stringstream stream;
-            stream << "A" << key;
-            BOOST_REQUIRE(entry.GetValue().GetName().compare(stream.str()) == 0);
-
-            BOOST_REQUIRE(entry.GetValue().GetAge() == key * 10);
-        }
-    }
-
-    // Ensure that all keys were read.
-    BOOST_REQUIRE(keys.size() == entryCnt);
-}
-
-BOOST_AUTO_TEST_SUITE_END()
\ No newline at end of file


[02/28] ignite git commit: IGNITE-1513: Moved CPP.

Posted by vo...@apache.org.
http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/core/src/impl/ignite_environment.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/src/impl/ignite_environment.cpp b/modules/platform/src/main/cpp/core/src/impl/ignite_environment.cpp
deleted file mode 100644
index 8fb1a02..0000000
--- a/modules/platform/src/main/cpp/core/src/impl/ignite_environment.cpp
+++ /dev/null
@@ -1,167 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "ignite/impl/portable/portable_reader_impl.h"
-#include "ignite/impl/ignite_environment.h"
-#include "ignite/portable/portable.h"
-
-using namespace ignite::common::concurrent;
-using namespace ignite::common::java;
-using namespace ignite::impl::interop;
-using namespace ignite::impl::portable;
-using namespace ignite::portable;
-
-namespace ignite 
-{
-    namespace impl 
-    {
-        /**
-         * OnStart callback.
-         *
-         * @param target Target environment.
-         * @param proc Processor instance (not used for now).
-         * @param memPtr Memory pointer.
-         */
-        void IGNITE_CALL OnStart(void* target, void* proc, long long memPtr)
-        {
-            SharedPointer<IgniteEnvironment>* ptr = static_cast<SharedPointer<IgniteEnvironment>*>(target);
-
-            ptr->Get()->OnStartCallback(memPtr);
-        }
-
-        /**
-         * OnStop callback.
-         *
-         * @param target Target environment.
-         */
-        void IGNITE_CALL OnStop(void* target)
-        {
-            SharedPointer<IgniteEnvironment>* ptr = static_cast<SharedPointer<IgniteEnvironment>*>(target);
-
-            delete ptr;
-        } 
-
-        IgniteEnvironment::IgniteEnvironment() : ctx(SharedPointer<JniContext>()), latch(new SingleLatch), name(NULL),
-            metaMgr(new PortableMetadataManager())
-        {
-            // No-op.
-        }
-
-        IgniteEnvironment::~IgniteEnvironment()
-        {
-            delete latch;
-
-            if (name)
-                delete name;
-
-            delete metaMgr;
-        }
-
-        JniHandlers IgniteEnvironment::GetJniHandlers(SharedPointer<IgniteEnvironment>* target)
-        {
-            JniHandlers hnds = JniHandlers();
-
-            hnds.target = target;
-
-            hnds.onStart = OnStart;
-            hnds.onStop = OnStop;
-
-            hnds.error = NULL;
-
-            return hnds;
-        }
-            
-        void IgniteEnvironment::Initialize(SharedPointer<JniContext> ctx)
-        {
-            this->ctx = ctx;
-                
-            latch->CountDown();
-        }
-        
-        char* IgniteEnvironment::InstanceName()
-        {
-            return name;
-        }
-
-        JniContext* IgniteEnvironment::Context()
-        {
-            return ctx.Get();
-        }
-
-        SharedPointer<InteropMemory> IgniteEnvironment::AllocateMemory()
-        {
-            SharedPointer<InteropMemory> ptr(new InteropUnpooledMemory(1024));
-
-            return ptr;
-        }
-
-        SharedPointer<InteropMemory> IgniteEnvironment::AllocateMemory(int32_t cap)
-        {
-            SharedPointer<InteropMemory> ptr(new InteropUnpooledMemory(cap));
-
-            return ptr;
-        }
-
-        SharedPointer<InteropMemory> IgniteEnvironment::GetMemory(int64_t memPtr)
-        {
-            int8_t* memPtr0 = reinterpret_cast<int8_t*>(memPtr);
-
-            int32_t flags = InteropMemory::Flags(memPtr0);
-
-            if (InteropMemory::IsExternal(flags))
-            {
-                SharedPointer<InteropMemory> ptr(new InteropExternalMemory(memPtr0));
-
-                return ptr;
-            }
-            else
-            {
-                SharedPointer<InteropMemory> ptr(new InteropUnpooledMemory(memPtr0));
-
-                return ptr;
-            }
-        }
-
-        PortableMetadataManager* IgniteEnvironment::GetMetadataManager()
-        {
-            return metaMgr;
-        }
-
-        void IgniteEnvironment::OnStartCallback(long long memPtr)
-        {
-            InteropExternalMemory mem(reinterpret_cast<int8_t*>(memPtr));
-            InteropInputStream stream(&mem);
-
-            PortableReaderImpl reader(&stream);
-            
-            int32_t nameLen = reader.ReadString(NULL, 0);
-
-            if (nameLen >= 0)
-            {
-                name = new char[nameLen + 1];
-                reader.ReadString(name, nameLen + 1);
-            }
-            else
-                name = NULL;
-        }
-    }
-}
-
-
-
-
-

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/core/src/impl/ignite_impl.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/src/impl/ignite_impl.cpp b/modules/platform/src/main/cpp/core/src/impl/ignite_impl.cpp
deleted file mode 100644
index 1aad309..0000000
--- a/modules/platform/src/main/cpp/core/src/impl/ignite_impl.cpp
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "ignite/impl/ignite_impl.h"
-
-using namespace ignite::common::concurrent;
-using namespace ignite::common::java;
-
-namespace ignite
-{    
-    namespace impl
-    {
-        IgniteImpl::IgniteImpl(SharedPointer<IgniteEnvironment> env, jobject javaRef) : env(env), javaRef(javaRef)
-        {
-            // No-op.
-        }
-
-        IgniteImpl::~IgniteImpl()
-        {
-            JniContext::Release(javaRef);
-        }
-
-        char* IgniteImpl::GetName()
-        {
-            return env.Get()->InstanceName();
-        }
-    }    
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/core/src/impl/interop/interop_input_stream.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/src/impl/interop/interop_input_stream.cpp b/modules/platform/src/main/cpp/core/src/impl/interop/interop_input_stream.cpp
deleted file mode 100644
index 72340ee..0000000
--- a/modules/platform/src/main/cpp/core/src/impl/interop/interop_input_stream.cpp
+++ /dev/null
@@ -1,215 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <cstring>
-
-#include "ignite/impl/interop/interop_input_stream.h"
-#include "ignite/ignite_error.h"
-
-/**
- * Common macro to read a single value.
- */
-#define IGNITE_INTEROP_IN_READ(type, len) { \
-    EnsureEnoughData(len); \
-    type res = *reinterpret_cast<type*>(data + pos); \
-    Shift(len); \
-    return res; \
-}
-
-/**
- * Common macro to read an array.
- */
-#define IGNITE_INTEROP_IN_READ_ARRAY(len, shift) { \
-    CopyAndShift(reinterpret_cast<int8_t*>(res), 0, len << shift); \
-}
-
-namespace ignite
-{    
-    namespace impl
-    {
-        namespace interop 
-        {
-            union PortableInt32Float
-            {
-                int32_t i;
-                float f;
-            };
-
-            union PortableInt64Double
-            {
-                int64_t i;
-                double d;
-            };
-
-            InteropInputStream::InteropInputStream(InteropMemory* mem)
-            {
-                this->mem = mem;
-
-                data = mem->Data();
-                len = mem->Length();
-                pos = 0;
-            }
-
-            int8_t InteropInputStream::ReadInt8()
-            {
-                IGNITE_INTEROP_IN_READ(int8_t, 1);
-            }
-
-            void InteropInputStream::ReadInt8Array(int8_t* const res, const int32_t len)
-            {
-                IGNITE_INTEROP_IN_READ_ARRAY(len, 0);
-            }
-
-            bool InteropInputStream::ReadBool()
-            {
-                return ReadInt8() == 1;
-            }
-
-            void InteropInputStream::ReadBoolArray(bool* const res, const int32_t len)
-            {
-                for (int i = 0; i < len; i++)
-                    *(res + i) = ReadBool();
-            }
-                
-            int16_t InteropInputStream::ReadInt16()
-            {
-                IGNITE_INTEROP_IN_READ(int16_t, 2);
-            }
-
-            void InteropInputStream::ReadInt16Array(int16_t* const res, const int32_t len)
-            {
-                IGNITE_INTEROP_IN_READ_ARRAY(len, 1);
-            }
-
-            uint16_t InteropInputStream::ReadUInt16()
-            {
-                IGNITE_INTEROP_IN_READ(uint16_t, 2);
-            }
-
-            void InteropInputStream::ReadUInt16Array(uint16_t* const res, const int32_t len)
-            {
-                IGNITE_INTEROP_IN_READ_ARRAY(len, 1);
-            }
-
-            int32_t InteropInputStream::ReadInt32()
-            {
-                IGNITE_INTEROP_IN_READ(int32_t, 4);
-            }
-
-            int32_t InteropInputStream::ReadInt32(int32_t pos)
-            {
-                int delta = pos + 4 - this->pos;
-
-                if (delta > 0)
-                    EnsureEnoughData(delta);
-
-                return *reinterpret_cast<int32_t*>(data + pos);
-            }
-
-            void InteropInputStream::ReadInt32Array(int32_t* const res, const int32_t len)
-            {
-                IGNITE_INTEROP_IN_READ_ARRAY(len, 2);
-            }
-
-            int64_t InteropInputStream::ReadInt64()
-            {
-                IGNITE_INTEROP_IN_READ(int64_t, 8);
-            }
-
-            void InteropInputStream::ReadInt64Array(int64_t* const res, const int32_t len)
-            {
-                IGNITE_INTEROP_IN_READ_ARRAY(len, 3);
-            }
-
-            float InteropInputStream::ReadFloat()
-            {
-                PortableInt32Float u;
-
-                u.i = ReadInt32();
-
-                return u.f;
-            }
-
-            void InteropInputStream::ReadFloatArray(float* const res, const int32_t len)
-            {
-                IGNITE_INTEROP_IN_READ_ARRAY(len, 2);
-            }
-
-            double InteropInputStream::ReadDouble()
-            {
-                PortableInt64Double u;
-
-                u.i = ReadInt64();
-
-                return u.d;
-            }
-
-            void InteropInputStream::ReadDoubleArray(double* const res, const int32_t len)
-            {
-                IGNITE_INTEROP_IN_READ_ARRAY(len, 3);
-            }
-                
-            int32_t InteropInputStream::Remaining()
-            {
-                return len - pos;
-            }
-
-            int32_t InteropInputStream::Position()
-            {
-                return pos;
-            }
-
-            void InteropInputStream::Position(int32_t pos)
-            {
-                if (pos > len) {
-                    IGNITE_ERROR_FORMATTED_3(IgniteError::IGNITE_ERR_MEMORY, "Requested input stream position is out of bounds",
-                        "memPtr", mem->PointerLong(), "len", len, "pos", pos);
-                }
-
-                this->pos = pos;
-            }
-
-            void InteropInputStream::Synchronize()
-            {
-                data = mem->Data();
-                len = mem->Length();
-            }
-            
-            void InteropInputStream::EnsureEnoughData(int32_t cnt)
-            {
-                if (len - pos < cnt) {
-                    IGNITE_ERROR_FORMATTED_4(IgniteError::IGNITE_ERR_MEMORY, "Not enough data in the stream",
-                        "memPtr", mem->PointerLong(), "len", len, "pos", pos, "requested", cnt);
-                }
-            }
-
-            void InteropInputStream::CopyAndShift(int8_t* dest, int32_t off, int32_t cnt)
-            {
-                EnsureEnoughData(cnt);
-
-                memcpy(dest + off, data + pos, cnt);
-
-                Shift(cnt);
-            }
-
-            void InteropInputStream::Shift(int32_t cnt)
-            {
-                pos += cnt;
-            }
-        }
-    }
-}        

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/core/src/impl/interop/interop_memory.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/src/impl/interop/interop_memory.cpp b/modules/platform/src/main/cpp/core/src/impl/interop/interop_memory.cpp
deleted file mode 100644
index 05ba8b6..0000000
--- a/modules/platform/src/main/cpp/core/src/impl/interop/interop_memory.cpp
+++ /dev/null
@@ -1,182 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <ignite/common/java.h>
-
-#include "ignite/impl/interop/interop_memory.h"
-#include "ignite/ignite_error.h"
-
-using namespace ignite::common::java;
-
-namespace ignite
-{    
-    namespace impl
-    {
-        namespace interop 
-        {
-            int8_t* InteropMemory::Data(int8_t* memPtr)
-            {
-                return reinterpret_cast<int8_t*>(*reinterpret_cast<int64_t*>(memPtr));
-            }
-
-            void InteropMemory::Data(int8_t* memPtr, void* ptr)
-            {
-                *reinterpret_cast<int64_t*>(memPtr) = reinterpret_cast<int64_t>(ptr);
-            }
-
-            int32_t InteropMemory::Capacity(int8_t* memPtr)
-            {
-                return *reinterpret_cast<int32_t*>(memPtr + IGNITE_MEM_HDR_OFF_CAP);
-            }
-
-            void InteropMemory::Capacity(int8_t* memPtr, int32_t val)
-            {
-                *reinterpret_cast<int32_t*>(memPtr + IGNITE_MEM_HDR_OFF_CAP) = val;
-            }
-
-            int32_t InteropMemory::Length(int8_t* memPtr)
-            {
-                return *reinterpret_cast<int32_t*>(memPtr + IGNITE_MEM_HDR_OFF_LEN);
-            }
-
-            void InteropMemory::Length(int8_t* memPtr, int32_t val)
-            {
-                *reinterpret_cast<int32_t*>(memPtr + IGNITE_MEM_HDR_OFF_LEN) = val;
-            }
-
-            int32_t InteropMemory::Flags(int8_t* memPtr)
-            {
-                return *reinterpret_cast<int32_t*>(memPtr + IGNITE_MEM_HDR_OFF_FLAGS);
-            }
-
-            void InteropMemory::Flags(int8_t* memPtr, int32_t val)
-            {
-                *reinterpret_cast<int32_t*>(memPtr + IGNITE_MEM_HDR_OFF_FLAGS) = val;
-            }
-
-            bool InteropMemory::IsExternal(int8_t* memPtr)
-            {
-                return IsExternal(Flags(memPtr));
-            }
-
-            bool InteropMemory::IsExternal(int32_t flags)
-            {
-                return (flags & IGNITE_MEM_FLAG_EXT) != IGNITE_MEM_FLAG_EXT;
-            }
-
-            bool InteropMemory::IsPooled(int8_t* memPtr)
-            {
-                return IsPooled(Flags(memPtr));
-            }
-
-            bool InteropMemory::IsPooled(int32_t flags)
-            {
-                return (flags & IGNITE_MEM_FLAG_POOLED) != 0;
-            }
-
-            bool InteropMemory::IsAcquired(int8_t* memPtr)
-            {
-                return IsAcquired(Flags(memPtr));
-            }
-
-            bool InteropMemory::IsAcquired(int32_t flags)
-            {
-                return (flags & IGNITE_MEM_FLAG_ACQUIRED) != 0;
-            }
-                
-            int8_t* InteropMemory::Pointer()
-            {
-                return memPtr;
-            }
-
-            int64_t InteropMemory::PointerLong()
-            {
-                return reinterpret_cast<int64_t>(memPtr);
-            }
-
-            int8_t* InteropMemory::Data()
-            {
-                return Data(memPtr);
-            }
-
-            int32_t InteropMemory::Capacity()
-            {
-                return Capacity(memPtr);
-            }
-
-            int32_t InteropMemory::Length()
-            {
-                return Length(memPtr);
-            }
-
-            void InteropMemory::Length(int32_t val)
-            {
-                Length(memPtr, val);
-            }
-                
-            InteropUnpooledMemory::InteropUnpooledMemory(int32_t cap)
-            {
-                memPtr = static_cast<int8_t*>(malloc(IGNITE_MEM_HDR_LEN));
-                
-                Data(memPtr, malloc(cap));
-                Capacity(memPtr, cap);
-                Length(memPtr, 0);
-                Flags(memPtr, IGNITE_MEM_FLAG_EXT);
-
-                owning = true;
-            }
-
-            InteropUnpooledMemory::InteropUnpooledMemory(int8_t* memPtr)
-            {
-                this->memPtr = memPtr;
-                this->owning = false;
-            }
-
-            InteropUnpooledMemory::~InteropUnpooledMemory()
-            {
-                if (owning) {
-                    free(Data());
-                    free(memPtr);
-                }
-            }
-
-            void InteropUnpooledMemory::Reallocate(int32_t cap)
-            {
-                int doubledCap = Capacity() << 1;
-
-                if (doubledCap > cap)
-                    cap = doubledCap;
-
-                Data(memPtr, realloc(Data(memPtr), cap));
-                Capacity(memPtr, cap);
-            }
-
-            InteropExternalMemory::InteropExternalMemory(int8_t* memPtr) 
-            {
-                this->memPtr = memPtr;
-            }
-
-            void InteropExternalMemory::Reallocate(int32_t cap)
-            {
-                if (JniContext::Reallocate(reinterpret_cast<int64_t>(memPtr), cap) == -1) {
-                    IGNITE_ERROR_FORMATTED_2(IgniteError::IGNITE_ERR_MEMORY, "Failed to reallocate external memory", 
-                        "memPtr", PointerLong(), "requestedCapacity", cap)
-                }
-            }
-        }
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/core/src/impl/interop/interop_output_stream.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/src/impl/interop/interop_output_stream.cpp b/modules/platform/src/main/cpp/core/src/impl/interop/interop_output_stream.cpp
deleted file mode 100644
index ecdfd42..0000000
--- a/modules/platform/src/main/cpp/core/src/impl/interop/interop_output_stream.cpp
+++ /dev/null
@@ -1,215 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <cstring>
-
-#include "ignite/impl/interop/interop_output_stream.h"
-#include "ignite/ignite_error.h"
-
-/**
- * Common macro to write a single value.
- */
-#define IGNITE_INTEROP_OUT_WRITE(val, type, len) { \
-    EnsureCapacity(pos + len); \
-    *reinterpret_cast<type*>(data + pos) = val; \
-    Shift(len); \
-}
-
-/**
- * Common macro to write an array.
- */
-#define IGNITE_INTEROP_OUT_WRITE_ARRAY(val, len) { \
-    CopyAndShift(reinterpret_cast<const int8_t*>(val), 0, len); \
-}
-
-namespace ignite
-{
-    namespace impl
-    {
-        namespace interop 
-        {
-            union PortableFloatInt32
-            {
-                float f;
-                int32_t i;                
-            };
-
-            union PortableDoubleInt64
-            {
-                double d;
-                int64_t i;                
-            };
-
-            InteropOutputStream::InteropOutputStream(InteropMemory* mem)
-            {
-                this->mem = mem;
-
-                data = mem->Data();
-                cap = mem->Capacity();
-                pos = 0;
-            }
-
-            void InteropOutputStream::WriteInt8(const int8_t val)
-            {
-                IGNITE_INTEROP_OUT_WRITE(val, int8_t, 1);
-            }
-
-            void InteropOutputStream::WriteInt8(const int8_t val, const int32_t pos)
-            {
-                EnsureCapacity(pos + 1);
-
-                *(data + pos) = val;
-            }
-
-            void InteropOutputStream::WriteInt8Array(const int8_t* val, const int32_t len)
-            {
-                IGNITE_INTEROP_OUT_WRITE_ARRAY(val, len);
-            }
-
-            void InteropOutputStream::WriteBool(const bool val)
-            {
-                WriteInt8(val ? 1 : 0);
-            }
-
-            void InteropOutputStream::WriteBoolArray(const bool* val, const int32_t len)
-            {
-                for (int i = 0; i < len; i++)
-                    WriteBool(*(val + i));
-            }
-
-            void InteropOutputStream::WriteInt16(const int16_t val)
-            {
-                IGNITE_INTEROP_OUT_WRITE(val, int16_t, 2);
-            }
-
-            void InteropOutputStream::WriteInt16Array(const int16_t* val, const int32_t len)
-            {
-                IGNITE_INTEROP_OUT_WRITE_ARRAY(val, len << 1);
-            }
-
-            void InteropOutputStream::WriteUInt16(const uint16_t val)
-            {
-                IGNITE_INTEROP_OUT_WRITE(val, uint16_t, 2);
-            }
-
-            void InteropOutputStream::WriteUInt16Array(const uint16_t* val, const int32_t len)
-            {
-                IGNITE_INTEROP_OUT_WRITE_ARRAY(val, len << 1);
-            }
-
-            void InteropOutputStream::WriteInt32(const int32_t val)
-            {
-                IGNITE_INTEROP_OUT_WRITE(val, int32_t, 4);
-            }
-
-            void InteropOutputStream::WriteInt32(const int32_t pos, const int32_t val)
-            {
-                EnsureCapacity(pos + 4);
-
-                *reinterpret_cast<int32_t*>(data + pos) = val;
-            }
-
-            void InteropOutputStream::WriteInt32Array(const int32_t* val, const int32_t len)
-            {
-                IGNITE_INTEROP_OUT_WRITE_ARRAY(val, len << 2);
-            }
-
-            void InteropOutputStream::WriteInt64(const int64_t val)
-            {
-                IGNITE_INTEROP_OUT_WRITE(val, int64_t, 8);
-            }
-
-            void InteropOutputStream::WriteInt64Array(const int64_t* val, const int32_t len)
-            {
-                IGNITE_INTEROP_OUT_WRITE_ARRAY(val, len << 3);
-            }
-
-            void InteropOutputStream::WriteFloat(const float val)
-            {
-                PortableFloatInt32 u;
-
-                u.f = val;
-
-                WriteInt32(u.i);
-            }
-
-            void InteropOutputStream::WriteFloatArray(const float* val, const int32_t len)
-            {
-                for (int i = 0; i < len; i++)
-                    WriteFloat(*(val + i));
-            }
-
-            void InteropOutputStream::WriteDouble(const double val)
-            {
-                PortableDoubleInt64 u;
-
-                u.d = val;
-
-                WriteInt64(u.i);
-            }
-
-            void InteropOutputStream::WriteDoubleArray(const double* val, const int32_t len)
-            {
-                for (int i = 0; i < len; i++)
-                    WriteDouble(*(val + i));
-            }
-
-            int32_t InteropOutputStream::Position()
-            {
-                return pos;
-            }
-
-            void InteropOutputStream::Position(const int32_t val)
-            {
-                EnsureCapacity(val);
-
-                pos = val;
-            }
-
-            void InteropOutputStream::Synchronize()
-            {
-                mem->Length(pos);
-            }
-
-            void InteropOutputStream::EnsureCapacity(int32_t reqCap) {
-                if (reqCap > cap) {
-                    int newCap = cap << 1;
-
-                    if (newCap < reqCap)
-                        newCap = reqCap;
-
-                    mem->Reallocate(newCap);
-                    data = mem->Data();
-                    cap = newCap;
-                }
-            }
-
-            void InteropOutputStream::Shift(int32_t cnt) {
-                pos += cnt;
-            }
-
-            void InteropOutputStream::CopyAndShift(const int8_t* src, int32_t off, int32_t len) {
-                EnsureCapacity(pos + len);
-
-                memcpy(data + pos, src + off, len);
-
-                Shift(len);
-            }
-        }
-    }
-}
-

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/core/src/impl/portable/portable_metadata_handler.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/src/impl/portable/portable_metadata_handler.cpp b/modules/platform/src/main/cpp/core/src/impl/portable/portable_metadata_handler.cpp
deleted file mode 100644
index 5ca91dc..0000000
--- a/modules/platform/src/main/cpp/core/src/impl/portable/portable_metadata_handler.cpp
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "ignite/impl/portable/portable_metadata_handler.h"
-
-using namespace ignite::common::concurrent;
-
-namespace ignite
-{    
-    namespace impl
-    {
-        namespace portable
-        {
-            PortableMetadataHandler::PortableMetadataHandler(SPSnap snap) : snap(snap), fieldIds(NULL), fields(NULL)
-            {
-                // No-op.
-            }
-            
-            PortableMetadataHandler::~PortableMetadataHandler()
-            {
-                if (fieldIds)
-                    delete fieldIds;
-
-                if (fields)
-                    delete fields;
-            }
-
-            void PortableMetadataHandler::OnFieldWritten(int32_t fieldId, std::string fieldName, int32_t fieldTypeId)
-            {
-                if (!snap.Get() || !snap.Get()->ContainsFieldId(fieldId))
-                {
-                    if (!HasDifference())
-                    {
-                        fieldIds = new std::set<int32_t>();
-                        fields = new std::map<std::string, int32_t>();
-                    }
-
-                    fieldIds->insert(fieldId);
-                    (*fields)[fieldName] = fieldTypeId;
-                }
-            }
-
-            SPSnap PortableMetadataHandler::GetSnapshot()
-            {
-                return snap;
-            }
-
-            bool PortableMetadataHandler::HasDifference()
-            {
-                return fieldIds ? true : false;
-            }
-
-            std::set<int32_t>* PortableMetadataHandler::GetFieldIds()
-            {
-                return fieldIds;
-            }
-
-            std::map<std::string, int32_t>* PortableMetadataHandler::GetFields()
-            {
-                return fields;
-            }
-        }
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/core/src/impl/portable/portable_metadata_manager.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/src/impl/portable/portable_metadata_manager.cpp b/modules/platform/src/main/cpp/core/src/impl/portable/portable_metadata_manager.cpp
deleted file mode 100644
index 63e92a9..0000000
--- a/modules/platform/src/main/cpp/core/src/impl/portable/portable_metadata_manager.cpp
+++ /dev/null
@@ -1,201 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <ignite/common/concurrent.h>
-
-#include "ignite/impl/portable/portable_metadata_manager.h"
-
-using namespace ignite::common::concurrent;
-
-namespace ignite
-{    
-    namespace impl
-    {
-        namespace portable
-        {
-            PortableMetadataManager::PortableMetadataManager() : 
-                snapshots(SharedPointer<std::map<int32_t, SPSnap>>(new std::map<int32_t, SPSnap>)),
-                pending(new std::vector<SPSnap>()), 
-                cs(new CriticalSection()), 
-                pendingVer(0), ver(0)
-            {
-                // No-op.
-            }
-
-            PortableMetadataManager::~PortableMetadataManager()
-            {
-                pending->erase(pending->begin(), pending->end());
-
-                delete pending;
-                delete cs;
-            }
-
-            SharedPointer<PortableMetadataHandler> PortableMetadataManager::GetHandler(int32_t typeId)
-            {
-                SharedPointer<std::map<int32_t, SPSnap>> snapshots0 = snapshots;
-
-                SPSnap snapshot = (*snapshots0.Get())[typeId];
-
-                return SharedPointer<PortableMetadataHandler>(new PortableMetadataHandler(snapshot));
-            }
-
-            void PortableMetadataManager::SubmitHandler(std::string typeName, int32_t typeId, 
-                PortableMetadataHandler* hnd)
-            {
-                Snap* snap = hnd->GetSnapshot().Get();
-
-                // If this is the very first write of a class or difference exists, 
-                // we need to enqueue it for write.
-                if (!snap || hnd->HasDifference())
-                {
-                    std::set<int32_t>* newFieldIds = new std::set<int32_t>();
-                    std::map<std::string, int32_t>* newFields = new std::map<std::string, int32_t>();
-                    
-                    CopyFields(snap, newFieldIds, newFields);
-
-                    if (hnd->HasDifference())
-                    {
-                        std::set<int32_t>* diffFieldIds = hnd->GetFieldIds();
-                        std::map<std::string, int32_t>* diffFields = hnd->GetFields();
-
-                        for (std::set<int32_t>::iterator it = diffFieldIds->begin(); it != diffFieldIds->end(); ++it)
-                            newFieldIds->insert(*it);
-
-                        for (std::map<std::string, int32_t>::iterator it = diffFields->begin(); it != diffFields->end(); ++it)
-                            (*newFields)[it->first] = it->second;
-                    }
-
-                    Snap* diffSnap = new Snap(typeName, typeId, newFieldIds, newFields);
-
-                    cs->Enter();
-
-                    pending->push_back(SPSnap(diffSnap));
-
-                    pendingVer++;
-
-                    cs->Leave();
-                }
-            }
-
-            int32_t PortableMetadataManager::GetVersion()
-            {
-                Memory::Fence();
-
-                return ver;
-            }
-
-            bool PortableMetadataManager::IsUpdatedSince(int32_t oldVer)
-            {
-                Memory::Fence();
-
-                return pendingVer > oldVer;
-            }
-
-            bool PortableMetadataManager::ProcessPendingUpdates(PortableMetadataUpdater* updater, IgniteError* err)
-            {
-                bool success = true; // Optimistically assume that all will be fine.
-                
-                cs->Enter();
-
-                for (std::vector<SPSnap>::iterator it = pending->begin(); it != pending->end(); ++it)
-                {
-                    Snap* pendingSnap = (*it).Get();
-
-                    if (updater->Update(pendingSnap, err))
-                    {
-                        // Perform copy-on-write update of snapshot collection.
-                        std::map<int32_t, SPSnap>* newSnapshots = new std::map<int32_t, SPSnap>();
-                        
-                        bool snapshotFound = false;
-
-                        for (std::map<int32_t, SPSnap>::iterator snapIt = snapshots.Get()->begin();
-                            snapIt != snapshots.Get()->end(); ++snapIt)
-                        {
-                            int32_t curTypeId = snapIt->first;
-                            Snap* curSnap = snapIt->second.Get();
-
-                            if (pendingSnap->GetTypeId() == curTypeId)
-                            {
-                                // Have to create snapshot with updated fields.
-                                std::set<int32_t>* newFieldIds = new std::set<int32_t>();
-                                std::map<std::string, int32_t>* newFields = new std::map<std::string, int32_t>();
-
-                                // Add old fields.
-                                CopyFields(curSnap, newFieldIds, newFields);
-
-                                // Add new fields.
-                                CopyFields(pendingSnap, newFieldIds, newFields);
-                                
-                                // Create new snapshot.
-                                Snap* newSnap = new Snap(pendingSnap->GetTypeName(), pendingSnap->GetTypeId(), 
-                                    newFieldIds, newFields);
-
-                                (*newSnapshots)[curTypeId] = SPSnap(newSnap);
-
-                                snapshotFound = true;
-                            }
-                            else 
-                                (*newSnapshots)[curTypeId] = snapIt->second; // Just transfer exising snapshot.
-                        }
-
-                        // Handle situation when completely new snapshot is found.
-                        if (!snapshotFound)
-                            (*newSnapshots)[pendingSnap->GetTypeId()] = *it;
-
-                        snapshots = SharedPointer<std::map<int32_t, SPSnap>>(newSnapshots);
-                    }
-                    else
-                    {
-                        // Stop as we cannot move further.
-                        success = false;
-
-                        break;
-                    }
-                }
-
-                if (success) 
-                {
-                    pending->erase(pending->begin(), pending->end());
-
-                    ver = pendingVer;
-                }
-
-                cs->Leave();
-
-                return success;
-            }
-
-            void PortableMetadataManager::CopyFields(Snap* snap, std::set<int32_t>* fieldIds, 
-                std::map<std::string, int32_t>* fields)
-            {
-                if (snap && snap->HasFields())
-                {
-                    std::set<int32_t>* snapFieldIds = snap->GetFieldIds();
-                    std::map<std::string, int32_t>* snapFields = snap->GetFields();
-
-                    for (std::set<int32_t>::iterator oldIt = snapFieldIds->begin();
-                        oldIt != snapFieldIds->end(); ++oldIt)
-                        fieldIds->insert(*oldIt);
-
-                    for (std::map<std::string, int32_t>::iterator newFieldsIt = snapFields->begin();
-                        newFieldsIt != snapFields->end(); ++newFieldsIt)
-                        (*fields)[newFieldsIt->first] = newFieldsIt->second;
-                }
-            }
-        }
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/core/src/impl/portable/portable_metadata_snapshot.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/src/impl/portable/portable_metadata_snapshot.cpp b/modules/platform/src/main/cpp/core/src/impl/portable/portable_metadata_snapshot.cpp
deleted file mode 100644
index 6ce5ab5..0000000
--- a/modules/platform/src/main/cpp/core/src/impl/portable/portable_metadata_snapshot.cpp
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "ignite/impl/portable/portable_metadata_snapshot.h"
-
-namespace ignite
-{    
-    namespace impl
-    {
-        namespace portable
-        {
-            PortableMetadataSnapshot::PortableMetadataSnapshot(std::string typeName, int32_t typeId, 
-                std::set<int32_t>* fieldIds, std::map<std::string, int32_t>* fields) : 
-                typeName(typeName), typeId(typeId), fieldIds(fieldIds), fields(fields)
-            {
-                // No-op.
-            }
-
-            PortableMetadataSnapshot::~PortableMetadataSnapshot()
-            {
-                delete fieldIds;
-                delete fields;
-            }
-
-            bool PortableMetadataSnapshot::ContainsFieldId(int32_t fieldId)
-            {
-                return fieldIds && fieldIds->count(fieldId) == 1;
-            }
-
-            std::string PortableMetadataSnapshot::GetTypeName()
-            {
-                return typeName;
-            }
-
-            int32_t PortableMetadataSnapshot::GetTypeId()
-            {
-                return typeId;
-            }
-
-            bool PortableMetadataSnapshot::HasFields()
-            {
-                return !fieldIds->empty();
-            }
-
-            std::set<int32_t>* PortableMetadataSnapshot::GetFieldIds()
-            {
-                return fieldIds;
-            }
-
-            std::map<std::string, int32_t>* PortableMetadataSnapshot::GetFields()
-            {
-                return fields;
-            }
-        }
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/core/src/impl/portable/portable_metadata_updater.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/src/impl/portable/portable_metadata_updater.cpp b/modules/platform/src/main/cpp/core/src/impl/portable/portable_metadata_updater.cpp
deleted file mode 100644
index 81c96d7..0000000
--- a/modules/platform/src/main/cpp/core/src/impl/portable/portable_metadata_updater.cpp
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "ignite/impl/portable/portable_metadata_updater.h"
-
-namespace ignite
-{    
-    namespace impl
-    {
-        namespace portable
-        {
-            PortableMetadataUpdater::~PortableMetadataUpdater()
-            {
-                // No-op.
-            }
-        }
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/core/src/impl/portable/portable_metadata_updater_impl.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/src/impl/portable/portable_metadata_updater_impl.cpp b/modules/platform/src/main/cpp/core/src/impl/portable/portable_metadata_updater_impl.cpp
deleted file mode 100644
index 07a1758..0000000
--- a/modules/platform/src/main/cpp/core/src/impl/portable/portable_metadata_updater_impl.cpp
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "ignite/impl/portable/portable_metadata_updater_impl.h"
-#include "ignite/impl/interop/interop_output_stream.h"
-#include "ignite/impl/portable/portable_writer_impl.h"
-#include "ignite/portable/portable_raw_writer.h"
-
-using namespace ignite::common::concurrent;
-using namespace ignite::common::java;
-using namespace ignite::impl;
-using namespace ignite::impl::interop;
-using namespace ignite::portable;
-
-namespace ignite
-{    
-    namespace impl
-    {
-        namespace portable
-        {
-            /** Operation: Clear. */
-            const int32_t OP_METADATA = -1;
-
-            PortableMetadataUpdaterImpl::PortableMetadataUpdaterImpl(SharedPointer<IgniteEnvironment> env,
-                jobject javaRef) :  env(env), javaRef(javaRef)
-            {
-                // No-op.
-            }
-
-            PortableMetadataUpdaterImpl::~PortableMetadataUpdaterImpl()
-            {
-                // No-op.
-            }
-
-            bool PortableMetadataUpdaterImpl::Update(Snap* snap, IgniteError* err)
-            {
-                JniErrorInfo jniErr;
-
-                SharedPointer<InteropMemory> mem = env.Get()->AllocateMemory();
-
-                InteropOutputStream out(mem.Get());
-                PortableWriterImpl writer(&out, NULL);
-                PortableRawWriter rawWriter(&writer);
-
-                // We always pass only one meta at a time in current implementation for simplicity.
-                rawWriter.WriteInt32(1);
-
-                rawWriter.WriteInt32(snap->GetTypeId());
-                rawWriter.WriteString(snap->GetTypeName());
-                rawWriter.WriteString(NULL); // Affinity key is not supported for now.
-                
-                if (snap->HasFields())
-                {
-                    std::map<std::string, int32_t>* fields = snap->GetFields();
-
-                    rawWriter.WriteInt32(static_cast<int32_t>(fields->size()));
-
-                    for (std::map<std::string, int32_t>::iterator it = fields->begin(); it != fields->end(); ++it)
-                    {
-                        rawWriter.WriteString(it->first);
-                        rawWriter.WriteInt32(it->second);
-                    }
-                }
-                else
-                    rawWriter.WriteInt32(0);
-
-                out.Synchronize();
-
-                long long res = env.Get()->Context()->TargetInStreamOutLong(javaRef, OP_METADATA, mem.Get()->PointerLong(), &jniErr);
-
-                IgniteError::SetError(jniErr.code, jniErr.errCls, jniErr.errMsg, err);
-
-                if (jniErr.code == IGNITE_JNI_ERR_SUCCESS)
-                    return res == 1;
-                else
-                    return false;
-            }
-        }
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/core/src/impl/portable/portable_reader_impl.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/src/impl/portable/portable_reader_impl.cpp b/modules/platform/src/main/cpp/core/src/impl/portable/portable_reader_impl.cpp
deleted file mode 100644
index 753ec25..0000000
--- a/modules/platform/src/main/cpp/core/src/impl/portable/portable_reader_impl.cpp
+++ /dev/null
@@ -1,683 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "ignite/impl/interop/interop.h"
-#include "ignite/impl/portable/portable_common.h"
-#include "ignite/impl/portable/portable_id_resolver.h"
-#include "ignite/impl/portable/portable_reader_impl.h"
-#include "ignite/impl/portable/portable_utils.h"
-#include "ignite/portable/portable_type.h"
-#include "ignite/ignite_error.h"
-
-using namespace ignite::impl::interop;
-using namespace ignite::impl::portable;
-using namespace ignite::portable;
-
-namespace ignite
-{
-    namespace impl
-    {
-        namespace portable
-        {
-            PortableReaderImpl::PortableReaderImpl(InteropInputStream* stream, PortableIdResolver* idRslvr,
-                int32_t pos, bool usrType, int32_t typeId, int32_t hashCode, int32_t len, int32_t rawOff) :
-                stream(stream), idRslvr(idRslvr), pos(pos), usrType(usrType), typeId(typeId), 
-                hashCode(hashCode), len(len), rawOff(rawOff), rawMode(false), 
-                elemIdGen(0), elemId(0), elemCnt(-1), elemRead(0)
-            {
-                // No-op.
-            }
-
-            PortableReaderImpl::PortableReaderImpl(InteropInputStream* stream) :
-                stream(stream), idRslvr(NULL), pos(0), usrType(false), typeId(0), hashCode(0), 
-                len(0), rawOff(0), rawMode(true),
-                elemIdGen(0), elemId(0), elemCnt(-1), elemRead(0)
-            {
-                // No-op.
-            }
-
-            int8_t PortableReaderImpl::ReadInt8()
-            {
-                return ReadRaw<int8_t>(PortableUtils::ReadInt8);                
-            }
-            
-            int32_t PortableReaderImpl::ReadInt8Array(int8_t* res, const int32_t len)
-            {
-                return ReadRawArray<int8_t>(res, len, PortableUtils::ReadInt8Array, IGNITE_TYPE_ARRAY_BYTE);
-            }
-
-            int8_t PortableReaderImpl::ReadInt8(const char* fieldName)
-            {
-                return Read(fieldName, PortableUtils::ReadInt8, IGNITE_TYPE_BYTE, static_cast<int8_t>(0));
-            }
-
-            int32_t PortableReaderImpl::ReadInt8Array(const char* fieldName, int8_t* res, const int32_t len)
-            {
-                return ReadArray<int8_t>(fieldName, res, len,PortableUtils::ReadInt8Array, IGNITE_TYPE_ARRAY_BYTE);
-            }
-
-            bool PortableReaderImpl::ReadBool()
-            {
-                return ReadRaw<bool>(PortableUtils::ReadBool);
-            }
-
-            int32_t PortableReaderImpl::ReadBoolArray(bool* res, const int32_t len)
-            {
-                return ReadRawArray<bool>(res, len, PortableUtils::ReadBoolArray, IGNITE_TYPE_ARRAY_BOOL);
-            }
-
-            bool PortableReaderImpl::ReadBool(const char* fieldName)
-            {
-                return Read(fieldName, PortableUtils::ReadBool, IGNITE_TYPE_BOOL, static_cast<bool>(0));
-            }
-
-            int32_t PortableReaderImpl::ReadBoolArray(const char* fieldName, bool* res, const int32_t len)
-            {
-                return ReadArray<bool>(fieldName, res, len,PortableUtils::ReadBoolArray, IGNITE_TYPE_ARRAY_BOOL);
-            }
-
-            int16_t PortableReaderImpl::ReadInt16()
-            {
-                return ReadRaw<int16_t>(PortableUtils::ReadInt16);
-            }
-
-            int32_t PortableReaderImpl::ReadInt16Array(int16_t* res, const int32_t len)
-            {
-                return ReadRawArray<int16_t>(res, len, PortableUtils::ReadInt16Array, IGNITE_TYPE_ARRAY_SHORT);
-            }
-
-            int16_t PortableReaderImpl::ReadInt16(const char* fieldName)
-            {
-                return Read(fieldName, PortableUtils::ReadInt16, IGNITE_TYPE_SHORT, static_cast<int16_t>(0));
-            }
-
-            int32_t PortableReaderImpl::ReadInt16Array(const char* fieldName, int16_t* res, const int32_t len)
-            {
-                return ReadArray<int16_t>(fieldName, res, len, PortableUtils::ReadInt16Array, IGNITE_TYPE_ARRAY_SHORT);
-            }
-
-            uint16_t PortableReaderImpl::ReadUInt16()
-            {
-                return ReadRaw<uint16_t>(PortableUtils::ReadUInt16);
-            }
-
-            int32_t PortableReaderImpl::ReadUInt16Array(uint16_t* res, const int32_t len)
-            {
-                return ReadRawArray<uint16_t>(res, len, PortableUtils::ReadUInt16Array, IGNITE_TYPE_ARRAY_CHAR);
-            }
-
-            uint16_t PortableReaderImpl::ReadUInt16(const char* fieldName)
-            {
-                return Read(fieldName, PortableUtils::ReadUInt16, IGNITE_TYPE_CHAR, static_cast<uint16_t>(0));
-            }
-
-            int32_t PortableReaderImpl::ReadUInt16Array(const char* fieldName, uint16_t* res, const int32_t len)
-            {
-                return ReadArray<uint16_t>(fieldName, res, len,PortableUtils::ReadUInt16Array, IGNITE_TYPE_ARRAY_CHAR);
-            }
-
-            int32_t PortableReaderImpl::ReadInt32()
-            {
-                return ReadRaw<int32_t>(PortableUtils::ReadInt32);
-            }
-
-            int32_t PortableReaderImpl::ReadInt32Array(int32_t* res, const int32_t len)
-            {
-                return ReadRawArray<int32_t>(res, len, PortableUtils::ReadInt32Array, IGNITE_TYPE_ARRAY_INT);
-            }
-
-            int32_t PortableReaderImpl::ReadInt32(const char* fieldName)
-            {
-                return Read(fieldName, PortableUtils::ReadInt32, IGNITE_TYPE_INT, static_cast<int32_t>(0));
-            }
-
-            int32_t PortableReaderImpl::ReadInt32Array(const char* fieldName, int32_t* res, const int32_t len)
-            {
-                return ReadArray<int32_t>(fieldName, res, len,PortableUtils::ReadInt32Array, IGNITE_TYPE_ARRAY_INT);
-            }
-
-            int64_t PortableReaderImpl::ReadInt64()
-            {
-                return ReadRaw<int64_t>(PortableUtils::ReadInt64);
-            }
-
-            int32_t PortableReaderImpl::ReadInt64Array(int64_t* res, const int32_t len)
-            {
-                return ReadRawArray<int64_t>(res, len, PortableUtils::ReadInt64Array, IGNITE_TYPE_ARRAY_LONG);
-            }
-
-            int64_t PortableReaderImpl::ReadInt64(const char* fieldName)
-            {
-                return Read(fieldName, PortableUtils::ReadInt64, IGNITE_TYPE_LONG, static_cast<int64_t>(0));
-            }
-
-            int32_t PortableReaderImpl::ReadInt64Array(const char* fieldName, int64_t* res, const int32_t len)
-            {
-                return ReadArray<int64_t>(fieldName, res, len,PortableUtils::ReadInt64Array, IGNITE_TYPE_ARRAY_LONG);
-            }
-
-            float PortableReaderImpl::ReadFloat()
-            {
-                return ReadRaw<float>(PortableUtils::ReadFloat);
-            }
-
-            int32_t PortableReaderImpl::ReadFloatArray(float* res, const int32_t len)
-            {
-                return ReadRawArray<float>(res, len, PortableUtils::ReadFloatArray, IGNITE_TYPE_ARRAY_FLOAT);
-            }
-
-            float PortableReaderImpl::ReadFloat(const char* fieldName)
-            {
-                return Read(fieldName, PortableUtils::ReadFloat, IGNITE_TYPE_FLOAT, static_cast<float>(0));
-            }
-
-            int32_t PortableReaderImpl::ReadFloatArray(const char* fieldName, float* res, const int32_t len)
-            {
-                return ReadArray<float>(fieldName, res, len,PortableUtils::ReadFloatArray, IGNITE_TYPE_ARRAY_FLOAT);
-            }
-
-            double PortableReaderImpl::ReadDouble()
-            {
-                return ReadRaw<double>(PortableUtils::ReadDouble);
-            }
-
-            int32_t PortableReaderImpl::ReadDoubleArray(double* res, const int32_t len)
-            {
-                return ReadRawArray<double>(res, len, PortableUtils::ReadDoubleArray, IGNITE_TYPE_ARRAY_DOUBLE);
-            }
-
-            double PortableReaderImpl::ReadDouble(const char* fieldName)
-            {
-                return Read(fieldName, PortableUtils::ReadDouble, IGNITE_TYPE_DOUBLE, static_cast<double>(0));
-            }
-
-            int32_t PortableReaderImpl::ReadDoubleArray(const char* fieldName, double* res, const int32_t len)
-            {
-                return ReadArray<double>(fieldName, res, len,PortableUtils::ReadDoubleArray, IGNITE_TYPE_ARRAY_DOUBLE);
-            }
-
-            Guid PortableReaderImpl::ReadGuid()
-            {
-                CheckRawMode(true);
-                CheckSingleMode(true);
-
-                return ReadNullable(stream, PortableUtils::ReadGuid, IGNITE_TYPE_UUID);
-            }
-
-            int32_t PortableReaderImpl::ReadGuidArray(Guid* res, const int32_t len)
-            {
-                CheckRawMode(true);
-                CheckSingleMode(true);
-
-                return ReadArrayInternal<Guid>(res, len, stream, ReadGuidArrayInternal, IGNITE_TYPE_ARRAY_UUID);
-            }
-
-            Guid PortableReaderImpl::ReadGuid(const char* fieldName)
-            {
-                CheckRawMode(false);
-                CheckSingleMode(true);
-
-                int32_t fieldId = idRslvr->GetFieldId(typeId, fieldName);
-                int32_t fieldLen = SeekField(fieldId);
-
-                if (fieldLen > 0)
-                    return ReadNullable(stream, PortableUtils::ReadGuid, IGNITE_TYPE_UUID);
-
-                return Guid();
-            }
-
-            int32_t PortableReaderImpl::ReadGuidArray(const char* fieldName, Guid* res, const int32_t len)
-            {
-                CheckRawMode(false);
-                CheckSingleMode(true);
-
-                int32_t pos = stream->Position();
-
-                int32_t fieldId = idRslvr->GetFieldId(typeId, fieldName);
-                int32_t fieldLen = SeekField(fieldId);
-
-                if (fieldLen > 0) {
-                    int32_t realLen = ReadArrayInternal<Guid>(res, len, stream, ReadGuidArrayInternal, IGNITE_TYPE_ARRAY_UUID);
-
-                    // If actual read didn't occur return to initial position so that we do not perform 
-                    // N jumps to find the field again, where N is total amount of fields.
-                    if (realLen != -1 && (!res || realLen > len))
-                        stream->Position(pos);
-
-                    return realLen;
-                }
-
-                return -1;
-            }
-
-            void PortableReaderImpl::ReadGuidArrayInternal(InteropInputStream* stream, Guid* res, const int32_t len)
-            {
-                for (int i = 0; i < len; i++)
-                    *(res + i) = ReadNullable<Guid>(stream, PortableUtils::ReadGuid, IGNITE_TYPE_UUID);
-            }
-
-            int32_t PortableReaderImpl::ReadString(char* res, const int32_t len)
-            {
-                CheckRawMode(true);
-                CheckSingleMode(true);
-
-                return ReadStringInternal(res, len);
-            }
-
-            int32_t PortableReaderImpl::ReadString(const char* fieldName, char* res, const int32_t len)
-            {
-                CheckRawMode(false);
-                CheckSingleMode(true);
-
-                int32_t pos = stream->Position();
-                
-                int32_t fieldId = idRslvr->GetFieldId(typeId, fieldName);
-                int32_t fieldLen = SeekField(fieldId);
-
-                if (fieldLen > 0) {
-                    int32_t realLen = ReadStringInternal(res, len);
-
-                    // If actual read didn't occur return to initial position so that we do not perform 
-                    // N jumps to find the field again, where N is total amount of fields.
-                    if (realLen != -1 && (!res || realLen > len))
-                        stream->Position(pos);
-
-                    return realLen;
-                }
-
-                return -1;
-            }
-
-            int32_t PortableReaderImpl::ReadStringArray(int32_t* size)
-            {
-                return StartContainerSession(true, IGNITE_TYPE_ARRAY_STRING, size);
-            }
-
-            int32_t PortableReaderImpl::ReadStringArray(const char* fieldName, int32_t* size)
-            {
-                CheckRawMode(false);
-                CheckSingleMode(true);
-
-                int32_t fieldId = idRslvr->GetFieldId(typeId, fieldName);
-                int32_t fieldLen = SeekField(fieldId);
-
-                if (fieldLen > 0)
-                    return StartContainerSession(false, IGNITE_TYPE_ARRAY_STRING, size);
-                else {
-                    *size = -1;
-
-                    return ++elemIdGen;
-                }
-            }
-
-            int32_t PortableReaderImpl::ReadStringElement(int32_t id, char* res, const int32_t len)
-            {
-                CheckSession(id);
-
-                int32_t posBefore = stream->Position();
-
-                int32_t realLen = ReadStringInternal(res, len);
-
-                int32_t posAfter = stream->Position();
-
-                if (posAfter > posBefore && ++elemRead == elemCnt) {
-                    elemId = 0;
-                    elemCnt = -1;
-                    elemRead = 0;
-                }
-
-                return realLen;
-            }
-
-            int32_t PortableReaderImpl::ReadStringInternal(char* res, const int32_t len)
-            {
-                int8_t hdr = stream->ReadInt8();
-
-                if (hdr == IGNITE_TYPE_STRING) {
-                    bool utf8Mode = stream->ReadBool();
-                    int32_t realLen = stream->ReadInt32();
-
-                    if (res && len >= realLen) {
-                        if (utf8Mode)
-                        {
-                            for (int i = 0; i < realLen; i++)
-                                *(res + i) = static_cast<char>(stream->ReadInt8());
-                        }
-                        else
-                        {
-                            for (int i = 0; i < realLen; i++)
-                                *(res + i) = static_cast<char>(stream->ReadUInt16());
-                        }
-
-                        if (len > realLen)
-                            *(res + realLen) = 0; // Set NULL terminator if possible.
-                    }
-                    else
-                        stream->Position(stream->Position() - 6);
-
-                    return realLen;
-                }
-                else if (hdr != IGNITE_HDR_NULL)
-                    ThrowOnInvalidHeader(IGNITE_TYPE_ARRAY, hdr);
-
-                return -1;
-            }
-
-            int32_t PortableReaderImpl::ReadArray(int32_t* size)
-            {
-                return StartContainerSession(true, IGNITE_TYPE_ARRAY, size);
-            }
-
-            int32_t PortableReaderImpl::ReadArray(const char* fieldName, int32_t* size)
-            {
-                CheckRawMode(false);
-                CheckSingleMode(true);
-
-                int32_t fieldId = idRslvr->GetFieldId(typeId, fieldName);
-                int32_t fieldLen = SeekField(fieldId);
-
-                if (fieldLen > 0)
-                    return StartContainerSession(false, IGNITE_TYPE_ARRAY, size);
-                else {
-                    *size = -1;
-
-                    return ++elemIdGen;
-                }
-            }
-
-            int32_t PortableReaderImpl::ReadCollection(CollectionType* typ, int32_t* size)
-            {
-                int32_t id = StartContainerSession(true, IGNITE_TYPE_COLLECTION, size);
-
-                if (*size == -1)
-                    *typ = IGNITE_COLLECTION_UNDEFINED;
-                else
-                    *typ = static_cast<CollectionType>(stream->ReadInt8());
-
-                return id;
-            }
-
-            int32_t PortableReaderImpl::ReadCollection(const char* fieldName, CollectionType* typ, int32_t* size)
-            {
-                CheckRawMode(false);
-                CheckSingleMode(true);
-
-                int32_t fieldId = idRslvr->GetFieldId(typeId, fieldName);
-                int32_t fieldLen = SeekField(fieldId);
-
-                if (fieldLen > 0)
-                {
-                    int32_t id = StartContainerSession(false, IGNITE_TYPE_COLLECTION, size);
-
-                    if (*size == -1)
-                        *typ = IGNITE_COLLECTION_UNDEFINED;
-                    else
-                        *typ = static_cast<CollectionType>(stream->ReadInt8());
-
-                    return id;
-                }                    
-                else {
-                    *typ = IGNITE_COLLECTION_UNDEFINED;
-                    *size = -1;
-
-                    return ++elemIdGen;
-                }
-            }
-
-            int32_t PortableReaderImpl::ReadMap(MapType* typ, int32_t* size)
-            {
-                int32_t id = StartContainerSession(true, IGNITE_TYPE_MAP, size);
-
-                if (*size == -1)
-                    *typ = IGNITE_MAP_UNDEFINED;
-                else
-                    *typ = static_cast<MapType>(stream->ReadInt8());
-
-                return id;
-            }
-
-            int32_t PortableReaderImpl::ReadMap(const char* fieldName, MapType* typ, int32_t* size)
-            {
-                CheckRawMode(false);
-                CheckSingleMode(true);
-
-                int32_t fieldId = idRslvr->GetFieldId(typeId, fieldName);
-                int32_t fieldLen = SeekField(fieldId);
-
-                if (fieldLen > 0)
-                {
-                    int32_t id = StartContainerSession(false, IGNITE_TYPE_MAP, size);
-
-                    if (*size == -1)
-                        *typ = IGNITE_MAP_UNDEFINED;
-                    else
-                        *typ = static_cast<MapType>(stream->ReadInt8());
-
-                    return id;
-                }
-                else {
-                    *typ = IGNITE_MAP_UNDEFINED;
-                    *size = -1;
-
-                    return ++elemIdGen;
-                }
-            }
-
-            bool PortableReaderImpl::HasNextElement(int32_t id)
-            {
-                return elemId == id && elemRead < elemCnt;
-            }
-
-            void PortableReaderImpl::SetRawMode()
-            {
-                CheckRawMode(false);
-                CheckSingleMode(true);
-
-                stream->Position(pos + rawOff);
-                rawMode = true;
-            }
-
-            template <>
-            int8_t PortableReaderImpl::ReadTopObject<int8_t>()
-            {
-                return ReadTopObject0(IGNITE_TYPE_BYTE, PortableUtils::ReadInt8, static_cast<int8_t>(0));
-            }
-
-            template <>
-            bool PortableReaderImpl::ReadTopObject<bool>()
-            {
-                return ReadTopObject0(IGNITE_TYPE_BOOL, PortableUtils::ReadBool, static_cast<bool>(0));
-            }
-
-            template <>
-            int16_t PortableReaderImpl::ReadTopObject<int16_t>()
-            {
-                return ReadTopObject0(IGNITE_TYPE_SHORT, PortableUtils::ReadInt16, static_cast<int16_t>(0));
-            }
-
-            template <>
-            uint16_t PortableReaderImpl::ReadTopObject<uint16_t>()
-            {
-                return ReadTopObject0(IGNITE_TYPE_CHAR, PortableUtils::ReadUInt16, static_cast<uint16_t>(0));
-            }
-
-            template <>
-            int32_t PortableReaderImpl::ReadTopObject<int32_t>()
-            {
-                return ReadTopObject0(IGNITE_TYPE_INT, PortableUtils::ReadInt32, static_cast<int32_t>(0));
-            }
-
-            template <>
-            int64_t PortableReaderImpl::ReadTopObject<int64_t>()
-            {
-                return ReadTopObject0(IGNITE_TYPE_LONG, PortableUtils::ReadInt64, static_cast<int64_t>(0));
-            }
-
-            template <>
-            float PortableReaderImpl::ReadTopObject<float>()
-            {
-                return ReadTopObject0(IGNITE_TYPE_FLOAT, PortableUtils::ReadFloat, static_cast<float>(0));
-            }
-
-            template <>
-            double PortableReaderImpl::ReadTopObject<double>()
-            {
-                return ReadTopObject0(IGNITE_TYPE_DOUBLE, PortableUtils::ReadDouble, static_cast<double>(0));
-            }
-
-            template <>
-            Guid PortableReaderImpl::ReadTopObject<Guid>()
-            {
-                int8_t typeId = stream->ReadInt8();
-
-                if (typeId == IGNITE_TYPE_UUID)
-                    return PortableUtils::ReadGuid(stream);
-                else if (typeId == IGNITE_HDR_NULL)
-                    return Guid();
-                else {
-                    int32_t pos = stream->Position() - 1;
-
-                    IGNITE_ERROR_FORMATTED_3(IgniteError::IGNITE_ERR_PORTABLE, "Invalid header", "position", pos, "expected", IGNITE_TYPE_UUID, "actual", typeId)
-                }
-            }
-
-            InteropInputStream* PortableReaderImpl::GetStream()
-            {
-                return stream;
-            }
-
-            int32_t PortableReaderImpl::SeekField(const int32_t fieldId)
-            {
-                // We assume that it is very likely that fields are read in the same
-                // order as they were initially written. So we start seeking field
-                // from current stream position making a "loop" up to this position.
-                int32_t marker = stream->Position();
-
-                for (int32_t curPos = marker; curPos < pos + rawOff;)
-                {
-                    int32_t curFieldId = stream->ReadInt32();
-                    int32_t curFieldLen = stream->ReadInt32();
-
-                    if (fieldId == curFieldId)
-                        return curFieldLen;
-                    else {
-                        curPos = stream->Position() + curFieldLen;
-
-                        stream->Position(curPos);
-                    }
-                }
-
-                stream->Position(pos + IGNITE_FULL_HDR_LEN);
-
-                for (int32_t curPos = stream->Position(); curPos < marker;)
-                {
-                    int32_t curFieldId = stream->ReadInt32();
-                    int32_t curFieldLen = stream->ReadInt32();
-
-                    if (fieldId == curFieldId)
-                        return curFieldLen;
-                    else {
-                        curPos = stream->Position() + curFieldLen;
-
-                        stream->Position(curPos);
-                    }
-                }
-
-                return -1;
-            }
-
-            void PortableReaderImpl::CheckRawMode(bool expected)
-            {
-                if (expected && !rawMode) {
-                    IGNITE_ERROR_1(IgniteError::IGNITE_ERR_PORTABLE, "Operation can be performed only in raw mode.")
-                }
-                else if (!expected && rawMode) {
-                    IGNITE_ERROR_1(IgniteError::IGNITE_ERR_PORTABLE, "Operation cannot be performed in raw mode.")
-                }
-            }
-
-            void PortableReaderImpl::CheckSingleMode(bool expected)
-            {
-                if (expected && elemId != 0) {
-                    IGNITE_ERROR_1(IgniteError::IGNITE_ERR_PORTABLE, "Operation cannot be performed when container is being read.");
-                }
-                else if (!expected && elemId == 0) {
-                    IGNITE_ERROR_1(IgniteError::IGNITE_ERR_PORTABLE, "Operation can be performed only when container is being read.");
-                }
-            }
-
-            int32_t PortableReaderImpl::StartContainerSession(bool expRawMode, int8_t expHdr, int32_t* size)
-            {
-                CheckRawMode(expRawMode);
-                CheckSingleMode(true);
-
-                int8_t hdr = stream->ReadInt8();
-
-                if (hdr == expHdr)
-                {
-                    int32_t cnt = stream->ReadInt32();
-
-                    if (cnt != 0) 
-                    {
-                        elemId = ++elemIdGen;
-                        elemCnt = cnt;
-                        elemRead = 0;
-
-                        *size = cnt;
-
-                        return elemId;
-                    }
-                    else
-                    {
-                        *size = 0;
-
-                        return ++elemIdGen;
-                    }
-                }
-                else if (hdr == IGNITE_HDR_NULL) {
-                    *size = -1;
-
-                    return ++elemIdGen;
-                }
-                else {
-                    ThrowOnInvalidHeader(expHdr, hdr);
-
-                    return 0;
-                }
-            }
-
-            void PortableReaderImpl::CheckSession(int32_t expSes)
-            {
-                if (elemId != expSes) {
-                    IGNITE_ERROR_1(IgniteError::IGNITE_ERR_PORTABLE, "Containter read session has been finished or is not started yet.");
-                }
-            }
-
-            void PortableReaderImpl::ThrowOnInvalidHeader(int32_t pos, int8_t expHdr, int8_t hdr)
-            {
-                IGNITE_ERROR_FORMATTED_3(IgniteError::IGNITE_ERR_PORTABLE, "Invalid header", "position", pos, "expected", expHdr, "actual", hdr)
-            }
-
-            void PortableReaderImpl::ThrowOnInvalidHeader(int8_t expHdr, int8_t hdr)
-            {
-                int32_t pos = stream->Position() - 1;
-
-                ThrowOnInvalidHeader(pos, expHdr, hdr);
-            }
-        }
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/core/src/impl/portable/portable_utils.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/src/impl/portable/portable_utils.cpp b/modules/platform/src/main/cpp/core/src/impl/portable/portable_utils.cpp
deleted file mode 100644
index 2f9c259..0000000
--- a/modules/platform/src/main/cpp/core/src/impl/portable/portable_utils.cpp
+++ /dev/null
@@ -1,214 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "ignite/impl/interop/interop.h"
-#include "ignite/impl/portable/portable_utils.h"
-
-using namespace ignite::impl::interop;
-using namespace ignite::impl::portable;
-
-namespace ignite
-{
-    namespace impl
-    {
-        namespace portable
-        {
-            int8_t PortableUtils::ReadInt8(InteropInputStream* stream)
-            {
-                return stream->ReadInt8();
-            }
-
-            void PortableUtils::WriteInt8(InteropOutputStream* stream, int8_t val)
-            {
-                stream->WriteInt8(val); 
-            }
-
-            void PortableUtils::ReadInt8Array(InteropInputStream* stream, int8_t* res, const int32_t len)
-            {
-                stream->ReadInt8Array(res, len);
-            }
-
-            void PortableUtils::WriteInt8Array(InteropOutputStream* stream, const int8_t* val, const int32_t len)
-            {
-                stream->WriteInt8Array(val, len);
-            }
-
-            bool PortableUtils::ReadBool(InteropInputStream* stream)
-            {
-                return stream->ReadBool();
-            }
-
-            void PortableUtils::WriteBool(InteropOutputStream* stream, bool val)
-            {
-                stream->WriteBool(val);
-            }
-
-            void PortableUtils::ReadBoolArray(InteropInputStream* stream, bool* res, const int32_t len)
-            {
-                stream->ReadBoolArray(res, len);
-            }
-
-            void PortableUtils::WriteBoolArray(InteropOutputStream* stream, const bool* val, const int32_t len)
-            {
-                stream->WriteBoolArray(val, len);
-            }
-
-            int16_t PortableUtils::ReadInt16(InteropInputStream* stream)
-            {
-                return stream->ReadInt16();
-            }
-
-            void PortableUtils::WriteInt16(InteropOutputStream* stream, int16_t val)
-            {
-                stream->WriteInt16(val);
-            }
-
-            void PortableUtils::ReadInt16Array(InteropInputStream* stream, int16_t* res, const int32_t len)
-            {
-                stream->ReadInt16Array(res, len);
-            }
-            
-            void PortableUtils::WriteInt16Array(InteropOutputStream* stream, const int16_t* val, const int32_t len)
-            {
-                stream->WriteInt16Array(val, len);
-            }
-
-            uint16_t PortableUtils::ReadUInt16(InteropInputStream* stream)
-            {
-                return stream->ReadUInt16();
-            }
-
-            void PortableUtils::WriteUInt16(InteropOutputStream* stream, uint16_t val)
-            {
-                stream->WriteUInt16(val);
-            }
-
-            void PortableUtils::ReadUInt16Array(InteropInputStream* stream, uint16_t* res, const int32_t len)
-            {
-                stream->ReadUInt16Array(res, len);
-            }
-
-            void PortableUtils::WriteUInt16Array(InteropOutputStream* stream, const uint16_t* val, const int32_t len)
-            {
-                stream->WriteUInt16Array(val, len);
-            }
-
-            int32_t PortableUtils::ReadInt32(InteropInputStream* stream)
-            {
-                return stream->ReadInt32();
-            }
-
-            void PortableUtils::WriteInt32(InteropOutputStream* stream, int32_t val)
-            {
-                stream->WriteInt32(val);
-            }
-
-            void PortableUtils::ReadInt32Array(InteropInputStream* stream, int32_t* res, const int32_t len)
-            {
-                stream->ReadInt32Array(res, len);
-            }
-
-            void PortableUtils::WriteInt32Array(InteropOutputStream* stream, const int32_t* val, const int32_t len)
-            {
-                stream->WriteInt32Array(val, len);
-            }
-
-            int64_t PortableUtils::ReadInt64(InteropInputStream* stream)
-            {
-                return stream->ReadInt64();
-            }
-
-            void PortableUtils::WriteInt64(InteropOutputStream* stream, int64_t val)
-            {
-                stream->WriteInt64(val);
-            }
-
-            void PortableUtils::ReadInt64Array(InteropInputStream* stream, int64_t* res, const int32_t len)
-            {
-                stream->ReadInt64Array(res, len);
-            }
-
-            void PortableUtils::WriteInt64Array(InteropOutputStream* stream, const int64_t* val, const int32_t len)
-            {
-                stream->WriteInt64Array(val, len);
-            }
-
-            float PortableUtils::ReadFloat(InteropInputStream* stream)
-            {
-                return stream->ReadFloat();
-            }
-
-            void PortableUtils::WriteFloat(InteropOutputStream* stream, float val)
-            {
-                stream->WriteFloat(val);
-            }
-
-            void PortableUtils::ReadFloatArray(InteropInputStream* stream, float* res, const int32_t len)
-            {
-                stream->ReadFloatArray(res, len);
-            }
-
-            void PortableUtils::WriteFloatArray(InteropOutputStream* stream, const float* val, const int32_t len)
-            {
-                stream->WriteFloatArray(val, len);
-            }
-
-            double PortableUtils::ReadDouble(InteropInputStream* stream)
-            {
-                return stream->ReadDouble();
-            }
-
-            void PortableUtils::WriteDouble(InteropOutputStream* stream, double val)
-            {
-                stream->WriteDouble(val);
-            }
-
-            void PortableUtils::ReadDoubleArray(InteropInputStream* stream, double* res, const int32_t len)
-            {
-                stream->ReadDoubleArray(res, len);
-            }
-
-            void PortableUtils::WriteDoubleArray(InteropOutputStream* stream, const double* val, const int32_t len)
-            {
-                stream->WriteDoubleArray(val, len);
-            }
-
-            Guid PortableUtils::ReadGuid(interop::InteropInputStream* stream)
-            {
-                int64_t most = stream->ReadInt64();
-                int64_t least = stream->ReadInt64();
-
-                return Guid(most, least);
-            }
-
-            void PortableUtils::WriteGuid(interop::InteropOutputStream* stream, const Guid val)
-            {
-                stream->WriteInt64(val.GetMostSignificantBits());
-                stream->WriteInt64(val.GetLeastSignificantBits());
-            }
-
-            void PortableUtils::WriteString(interop::InteropOutputStream* stream, const char* val, const int32_t len)
-            {
-                stream->WriteBool(false);
-                stream->WriteInt32(len);
-
-                for (int i = 0; i < len; i++)
-                    stream->WriteUInt16(*(val + i));
-            }
-        }
-    }
-}
\ No newline at end of file


[04/28] ignite git commit: IGNITE-1513: Moved CPP.

Posted by vo...@apache.org.
http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/core/include/ignite/portable/portable_reader.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/ignite/portable/portable_reader.h b/modules/platform/src/main/cpp/core/include/ignite/portable/portable_reader.h
deleted file mode 100644
index 5e4b7ad..0000000
--- a/modules/platform/src/main/cpp/core/include/ignite/portable/portable_reader.h
+++ /dev/null
@@ -1,355 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef _IGNITE_PORTABLE_READER
-#define _IGNITE_PORTABLE_READER
-
-#include <stdint.h>
-#include <string>
-
-#include <ignite/common/common.h>
-
-#include "ignite/portable/portable_raw_reader.h"
-#include "ignite/guid.h"
-
-namespace ignite
-{    
-    namespace portable
-    {
-        /**
-         * Portable reader.
-         */
-        class IGNITE_IMPORT_EXPORT PortableReader
-        {
-        public:
-            /**
-             * Constructor.
-             *
-             * @param impl Implementation.
-             */
-            PortableReader(ignite::impl::portable::PortableReaderImpl* impl);
-
-            /**
-             * Read 8-byte signed integer. Maps to "byte" type in Java.
-             *
-             * @param fieldName Field name.
-             * @param fieldName Field name.
-             * @return Result.
-             */
-            int8_t ReadInt8(const char* fieldName);
-
-            /**
-             * Read array of 8-byte signed integers. Maps to "byte[]" type in Java.
-             *
-             * @param fieldName Field name.
-             * @param res Array to store data to.
-             * @param len Expected length of array.
-             * @return Actual amount of elements read. If "len" argument is less than actual
-             *     array size or resulting array is set to null, nothing will be written
-             *     to resulting array and returned value will contain required array length.
-             *     -1 will be returned in case array in stream was null.
-             */
-            int32_t ReadInt8Array(const char* fieldName, int8_t* res, const int32_t len);
-
-            /**
-             * Read bool. Maps to "short" type in Java.
-             *
-             * @param fieldName Field name.
-             * @return Result.
-             */
-            bool ReadBool(const char* fieldName);
-
-            /**
-             * Read array of bools. Maps to "bool[]" type in Java.
-             *
-             * @param fieldName Field name.
-             * @param res Array to store data to.
-             * @param len Expected length of array.             
-             * @return Actual amount of elements read. If "len" argument is less than actual
-             *     array size or resulting array is set to null, nothing will be written
-             *     to resulting array and returned value will contain required array length.
-             *     -1 will be returned in case array in stream was null.
-             */
-            int32_t ReadBoolArray(const char* fieldName, bool* res, const int32_t len);
-
-            /**
-             * Read 16-byte signed integer. Maps to "short" type in Java.
-             *
-             * @param fieldName Field name.
-             * @return Result.
-             */
-            int16_t ReadInt16(const char* fieldName);
-
-            /**
-             * Read array of 16-byte signed integers. Maps to "short[]" type in Java.
-             *
-             * @param fieldName Field name.
-             * @param res Array to store data to.
-             * @param len Expected length of array.
-             * @return Actual amount of elements read. If "len" argument is less than actual
-             *     array size or resulting array is set to null, nothing will be written
-             *     to resulting array and returned value will contain required array length.
-             *     -1 will be returned in case array in stream was null.
-             */
-            int32_t ReadInt16Array(const char* fieldName, int16_t* res, const int32_t len);
-
-            /**
-             * Read 16-byte unsigned integer. Maps to "char" type in Java.
-             *
-             * @param fieldName Field name.
-             * @return Result.
-             */
-            uint16_t ReadUInt16(const char* fieldName);
-
-            /**
-             * Read array of 16-byte unsigned integers. Maps to "char[]" type in Java.
-             *
-             * @param fieldName Field name.
-             * @param res Array to store data to.
-             * @param len Expected length of array.             
-             * @return Actual amount of elements read. If "len" argument is less than actual
-             *     array size or resulting array is set to null, nothing will be written
-             *     to resulting array and returned value will contain required array length.
-             *     -1 will be returned in case array in stream was null.
-             */
-            int32_t ReadUInt16Array(const char* fieldName, uint16_t* res, const int32_t len);
-
-            /**
-             * Read 32-byte signed integer. Maps to "int" type in Java.
-             *
-             * @param fieldName Field name.
-             * @return Result.
-             */
-            int32_t ReadInt32(const char* fieldName);
-
-            /**
-             * Read array of 32-byte signed integers. Maps to "int[]" type in Java.
-             *
-             * @param fieldName Field name.
-             * @param res Array to store data to.
-             * @param len Expected length of array.             
-             * @return Actual amount of elements read. If "len" argument is less than actual
-             *     array size or resulting array is set to null, nothing will be written
-             *     to resulting array and returned value will contain required array length.
-             *     -1 will be returned in case array in stream was null.
-             */
-            int32_t ReadInt32Array(const char* fieldName, int32_t* res, const int32_t len);
-
-            /**
-             * Read 64-byte signed integer. Maps to "long" type in Java.
-             *
-             * @param fieldName Field name.
-             * @return Result.
-             */
-            int64_t ReadInt64(const char* fieldName);
-
-            /**
-             * Read array of 64-byte signed integers. Maps to "long[]" type in Java.
-             *
-             * @param fieldName Field name.
-             * @param res Array to store data to.
-             * @param len Expected length of array.             
-             * @return Actual amount of elements read. If "len" argument is less than actual
-             *     array size or resulting array is set to null, nothing will be written
-             *     to resulting array and returned value will contain required array length.
-             *     -1 will be returned in case array in stream was null.
-             */
-            int32_t ReadInt64Array(const char* fieldName, int64_t* res, const int32_t len);
-
-            /**
-             * Read float. Maps to "float" type in Java.
-             *
-             * @param fieldName Field name.
-             * @return Result.
-             */
-            float ReadFloat(const char* fieldName);
-
-            /**
-             * Read array of floats. Maps to "float[]" type in Java.
-             * 
-             * @param fieldName Field name.
-             * @param res Array to store data to.
-             * @param len Expected length of array.             
-             * @return Actual amount of elements read. If "len" argument is less than actual
-             *     array size or resulting array is set to null, nothing will be written
-             *     to resulting array and returned value will contain required array length.
-             *     -1 will be returned in case array in stream was null.
-             */
-            int32_t ReadFloatArray(const char* fieldName, float* res, const int32_t len);
-
-            /**
-             * Read double. Maps to "double" type in Java.
-             *
-             * @param fieldName Field name.
-             * @return Result.
-             */
-            double ReadDouble(const char* fieldName);
-
-            /**
-             * Read array of doubles. Maps to "double[]" type in Java.
-             *
-             * @param fieldName Field name.
-             * @param res Array to store data to.
-             * @param len Expected length of array.             
-             * @return Actual amount of elements read. If "len" argument is less than actual
-             *     array size or resulting array is set to null, nothing will be written
-             *     to resulting array and returned value will contain required array length.
-             *     -1 will be returned in case array in stream was null.
-             */
-            int32_t ReadDoubleArray(const char* fieldName, double* res, const int32_t len);
-
-            /**
-             * Read Guid. Maps to "UUID" type in Java.
-             *
-             * @param fieldName Field name.
-             * @return Result.
-             */
-            Guid ReadGuid(const char* fieldName);
-
-            /**
-             * Read array of Guids. Maps to "UUID[]" type in Java.
-             *
-             * @param fieldName Field name.
-             * @param res Array to store data to.
-             * @param len Expected length of array.             
-             * @return Actual amount of elements read. If "len" argument is less than actual
-             *     array size or resulting array is set to null, nothing will be written
-             *     to resulting array and returned value will contain required array length.
-             *     -1 will be returned in case array in stream was null.
-             */
-            int32_t ReadGuidArray(const char* fieldName, Guid* res, const int32_t len);
-
-            /**
-             * Read string.
-             *
-             * @param fieldName Field name.
-             * @param res Array to store data to.
-             * @param len Expected length of string. NULL terminator will be set in case len is
-             *     greater than real string length.             
-             * @return Actual amount of elements read. If "len" argument is less than actual
-             *     array size or resulting array is set to null, nothing will be written
-             *     to resulting array and returned value will contain required array length.
-             *     -1 will be returned in case array in stream was null.
-             */
-            int32_t ReadString(const char* fieldName, char* res, const int32_t len);
-
-            /**
-             * Read string from the stream.
-             *
-             * @param fieldName Field name.
-             * @return String.
-             */
-            std::string ReadString(const char* fieldName)
-            {
-                int32_t len = ReadString(fieldName, NULL, 0);
-
-                if (len != -1)
-                {
-                    ignite::impl::utils::SafeArray<char> arr(len + 1);
-
-                    ReadString(fieldName, arr.target, len + 1);
-
-                    return std::string(arr.target);
-                }
-                else
-                    return std::string();
-            }
-
-            /**
-             * Start string array read.
-             *
-             * @param fieldName Field name.
-             * @return String array reader.
-             */
-            PortableStringArrayReader ReadStringArray(const char* fieldName);
-
-            /**
-             * Start array read.
-             *
-             * @param fieldName Field name.
-             * @return Array reader.
-             */
-            template<typename T>
-            PortableArrayReader<T> ReadArray(const char* fieldName)
-            {
-                int32_t size;
-
-                int32_t id = impl->ReadArray(fieldName, &size);
-
-                return PortableArrayReader<T>(impl, id, size);
-            }
-
-            /**
-             * Start collection read.
-             *
-             * @param fieldName Field name.
-             * @return Collection reader.
-             */
-            template<typename T>
-            PortableCollectionReader<T> ReadCollection(const char* fieldName)
-            {
-                CollectionType typ;
-                int32_t size;
-
-                int32_t id = impl->ReadCollection(fieldName, &typ, &size);
-
-                return PortableCollectionReader<T>(impl, id, typ, size);
-            }
-
-            /**
-             * Start map read.
-             *
-             * @param fieldName Field name.
-             * @return Map reader.
-             */
-            template<typename K, typename V>
-            PortableMapReader<K, V> ReadMap(const char* fieldName)
-            {
-                MapType typ;
-                int32_t size;
-
-                int32_t id = impl->ReadMap(fieldName, &typ, &size);
-
-                return PortableMapReader<K, V>(impl, id, typ, size);
-            }
-
-            /**
-             * Read object.
-             *
-             * @param fieldName Field name.
-             * @return Object.
-             */
-            template<typename T>
-            T ReadObject(const char* fieldName)
-            {
-                return impl->ReadObject<T>(fieldName);
-            }
-
-            /**
-             * Get raw reader for this reader.
-             *
-             * @return Raw reader.
-             */
-            PortableRawReader RawReader();
-        private:
-            /** Implementation delegate. */
-            ignite::impl::portable::PortableReaderImpl* impl;
-        };            
-    }
-}
-
-#endif
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/core/include/ignite/portable/portable_type.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/ignite/portable/portable_type.h b/modules/platform/src/main/cpp/core/include/ignite/portable/portable_type.h
deleted file mode 100644
index fb086ef..0000000
--- a/modules/platform/src/main/cpp/core/include/ignite/portable/portable_type.h
+++ /dev/null
@@ -1,293 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef _IGNITE_PORTABLE_TYPE
-#define _IGNITE_PORTABLE_TYPE
-
-#include <stdint.h>
-
-#include <ignite/common/common.h>
-
-#include "ignite/ignite_error.h"
-
-/**
- * Start portable type definition.
- */
-#define IGNITE_PORTABLE_TYPE_START(T) \
-template<> \
-struct PortableType<T> \
-{
-
-/**
- * End portable type definition.
- */
-#define IGNITE_PORTABLE_TYPE_END \
-};
-
-/**
- * Implementation of GetTypeId() which returns predefined constant.
- */
-#define IGNITE_PORTABLE_GET_TYPE_ID_AS_CONST(id) \
-int32_t GetTypeId() \
-{ \
-    return id; \
-}
-
-/**
- * Implementation of GetTypeId() which returns hash of passed type name.
- */
-#define IGNITE_PORTABLE_GET_TYPE_ID_AS_HASH(typeName) \
-int32_t GetTypeId() \
-{ \
-    return GetPortableStringHashCode(#typeName); \
-}
-
-/**
- * Implementation of GetTypeName() which returns type name as is.
- */
-#define IGNITE_PORTABLE_GET_TYPE_NAME_AS_IS(typeName) \
-std::string GetTypeName() \
-{ \
-    return #typeName; \
-}
-
-/**
- * Default implementation of GetFieldId() function which returns Java-way hash code of the string.
- */
-#define IGNITE_PORTABLE_GET_FIELD_ID_AS_HASH \
-int32_t GetFieldId(const char* name) \
-{ \
-    return GetPortableStringHashCode(name); \
-}
-
-/**
- * Implementation of GetHashCode() function which always returns 0.
- */
-#define IGNITE_PORTABLE_GET_HASH_CODE_ZERO(T) \
-int32_t GetHashCode(const T& obj) \
-{ \
-    return 0; \
-}
-
-/**
- * Implementation of IsNull() function which always returns false.
- */
-#define IGNITE_PORTABLE_IS_NULL_FALSE(T) \
-bool IsNull(const T& obj) \
-{ \
-    return false; \
-}
-
-/**
- * Implementation of IsNull() function which return true if passed object is null pointer.
- */
-#define IGNITE_PORTABLE_IS_NULL_IF_NULLPTR(T) \
-bool IsNull(const T& obj) \
-{ \
-    return obj; \
-}
-
-/**
- * Implementation of GetNull() function which returns an instance created with defult constructor.
- */
-#define IGNITE_PORTABLE_GET_NULL_DEFAULT_CTOR(T) \
-T GetNull() \
-{ \
-    return T(); \
-}
-
-/**
- * Implementation of GetNull() function which returns NULL pointer.
- */
-#define IGNITE_PORTABLE_GET_NULL_NULLPTR(T) \
-T GetNull() \
-{ \
-    return NULL; \
-}
-
-namespace ignite
-{
-    namespace portable
-    {
-        class PortableWriter;
-        class PortableReader;
-
-        /**
-         * Get portable string hash code.
-         *
-         * @param val Value.
-         * @return Hash code.
-         */
-        IGNITE_IMPORT_EXPORT int32_t GetPortableStringHashCode(const char* val);
-
-        /**
-         * Portable type structure. Defines a set of functions required for type to be serialized and deserialized.
-         */
-        template<typename T>
-        struct IGNITE_IMPORT_EXPORT PortableType
-        {
-            /**
-             * Get portable object type ID.
-             *
-             * @return Type ID.
-             */
-            int32_t GetTypeId()
-            {
-                IGNITE_ERROR_1(IgniteError::IGNITE_ERR_PORTABLE, "GetTypeId function is not defined for portable type.");
-            }
-
-            /**
-             * Get portable object type name.
-             *
-             * @return Type name.
-             */
-            std::string GetTypeName() 
-            {
-                IGNITE_ERROR_1(IgniteError::IGNITE_ERR_PORTABLE, "GetTypeName function is not defined for portable type.");
-            }
-
-            /**
-             * Get portable object field ID.
-             *
-             * @param name Field name.
-             * @return Field ID.
-             */
-            int32_t GetFieldId(const char* name)
-            {
-                return GetPortableStringHashCode(name);
-            }
-
-            /**
-             * Get portable object hash code.
-             *
-             * @param obj Portable object.
-             * @return Hash code.
-             */
-            int32_t GetHashCode(const T& obj)
-            {
-                return 0;
-            }
-
-            /**
-             * Write portable object.
-             *
-             * @param writer Writer.
-             * @param obj Object.
-             */
-            void Write(PortableWriter& writer, const T& obj)
-            {
-                IGNITE_ERROR_1(IgniteError::IGNITE_ERR_PORTABLE, "Write function is not defined for portable type.");
-            }
-
-            /**
-             * Read portable object.
-             *
-             * @param reader Reader.
-             * @return Object.
-             */
-            T Read(PortableReader& reader)
-            {
-                IGNITE_ERROR_1(IgniteError::IGNITE_ERR_PORTABLE, "Read function is not defined for portable type.");
-            }
-
-            /**
-             * Check whether passed portable object should be interpreted as NULL.
-             *
-             * @param obj Portable object to test.
-             * @return True if portable object should be interpreted as NULL.
-             */
-            bool IsNull(const T& obj)
-            {
-                return false;
-            }
-
-            /**
-             * Get NULL value for the given portable type.
-             *
-             * @return NULL value.
-             */
-            T GetNull()
-            {
-                IGNITE_ERROR_1(IgniteError::IGNITE_ERR_PORTABLE, "GetNull function is not defined for portable type.");
-            }
-        };
-
-        /*
-         * Templated portable type for pointers.
-         */
-        template <typename T>
-        struct IGNITE_IMPORT_EXPORT PortableType<T*>
-        {
-            /** Actual type. */
-            PortableType<T> typ;
-
-            /**
-             * Constructor.
-             */
-            PortableType()
-            {
-                typ = PortableType<T>();
-            }
-
-            int32_t GetTypeId()
-            {
-                return typ.GetTypeId();
-            }
-
-            std::string GetTypeName()
-            {
-                return typ.GetTypeName();
-            }
-
-            int32_t GetFieldId(const char* name)
-            {
-                return typ.GetFieldId(name);
-            }
-
-            int32_t GetHashCode(T* const& obj)
-            {
-                return typ.GetHashCode(*obj);
-            }
-
-            void Write(PortableWriter& writer, T* const& obj)
-            {
-                typ.Write(writer, *obj);
-            }
-
-            T* Read(PortableReader& reader)
-            {
-                T* res = new T();
-
-                *res = typ.Read(reader);
-
-                return res;
-            }
-
-            bool IsNull(T* const& obj)
-            {
-                return !obj || typ.IsNull(*obj);
-            }
-
-            T* GetNull()
-            {
-                return NULL;
-            }
-        };
-    }
-}
-
-#endif

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/core/include/ignite/portable/portable_writer.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/ignite/portable/portable_writer.h b/modules/platform/src/main/cpp/core/include/ignite/portable/portable_writer.h
deleted file mode 100644
index 5dc9494..0000000
--- a/modules/platform/src/main/cpp/core/include/ignite/portable/portable_writer.h
+++ /dev/null
@@ -1,335 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef _IGNITE_PORTABLE_WRITER
-#define _IGNITE_PORTABLE_WRITER
-
-#include <string>
-#include <stdint.h>
-
-#include <ignite/common/common.h>
-
-#include "ignite/portable/portable_raw_writer.h"
-
-namespace ignite
-{
-    namespace portable 
-    {
-        /**
-         * Portable writer.
-         */
-        class IGNITE_IMPORT_EXPORT PortableWriter
-        {
-        public:
-            /**
-             * Constructor.
-             *
-             * @param impl Implementation.
-             */
-            PortableWriter(ignite::impl::portable::PortableWriterImpl* impl);
-
-            /**
-             * Write 8-byte signed integer. Maps to "byte" type in Java.
-             *
-             * @param fieldName Field name.
-             * @param val Value.
-             */
-            void WriteInt8(const char* fieldName, const int8_t val);
-
-            /**
-             * Write array of 8-byte signed integers. Maps to "byte[]" type in Java.
-             *
-             * @param fieldName Field name.
-             * @param val Array.
-             * @param len Array length.
-             */
-            void WriteInt8Array(const char* fieldName, const int8_t* val, const int32_t len);
-
-            /**
-             * Write bool. Maps to "short" type in Java.
-             *
-             * @param fieldName Field name.
-             * @param val Value.
-             */
-            void WriteBool(const char* fieldName, const bool val);
-
-            /**
-             * Write array of bools. Maps to "bool[]" type in Java.
-             *
-             * @param fieldName Field name.
-             * @param val Array.
-             * @param len Array length.
-             */
-            void WriteBoolArray(const char* fieldName, const bool* val, const int32_t len);
-
-            /**
-             * Write 16-byte signed integer. Maps to "short" type in Java.
-             *
-             * @param fieldName Field name.
-             * @param val Value.
-             */
-            void WriteInt16(const char* fieldName, const int16_t val);
-
-            /**
-             * Write array of 16-byte signed integers. Maps to "short[]" type in Java.
-             *
-             * @param fieldName Field name.
-             * @param val Array.
-             * @param len Array length.
-             */
-            void WriteInt16Array(const char* fieldName, const int16_t* val, const int32_t len);
-
-            /**
-             * Write 16-byte unsigned integer. Maps to "char" type in Java.
-             *
-             * @param fieldName Field name.
-             * @param val Value.
-             */
-            void WriteUInt16(const char* fieldName, const uint16_t val);
-
-            /**
-             * Write array of 16-byte unsigned integers. Maps to "char[]" type in Java.
-             *
-             * @param fieldName Field name.
-             * @param val Array.
-             * @param len Array length.
-             */
-            void WriteUInt16Array(const char* fieldName, const uint16_t* val, const int32_t len);
-
-            /**
-             * Write 32-byte signed integer. Maps to "int" type in Java.
-             *
-             * @param fieldName Field name.
-             * @param val Value.
-             */
-            void WriteInt32(const char* fieldName, const int32_t val);
-
-            /**
-             * Write array of 32-byte signed integers. Maps to "int[]" type in Java.
-             *
-             * @param fieldName Field name.
-             * @param val Array.
-             * @param len Array length.
-             */
-            void WriteInt32Array(const char* fieldName, const int32_t* val, const int32_t len);
-
-            /**
-             * Write 64-byte signed integer. Maps to "long" type in Java.
-             *
-             * @param fieldName Field name.
-             * @param val Value.
-             */
-            void WriteInt64(const char* fieldName, const int64_t val);
-
-            /**
-             * Write array of 64-byte signed integers. Maps to "long[]" type in Java.
-             *
-             * @param fieldName Field name.
-             * @param val Array.
-             * @param len Array length.
-             */
-            void WriteInt64Array(const char* fieldName, const int64_t* val, const int32_t len);
-
-            /**
-             * Write float. Maps to "float" type in Java.
-             *
-             * @param fieldName Field name.
-             * @param val Value.
-             */
-            void WriteFloat(const char* fieldName, const float val);
-
-            /**
-             * Write array of floats. Maps to "float[]" type in Java.
-             *
-             * @param fieldName Field name.
-             * @param val Array.
-             * @param len Array length.
-             */
-            void WriteFloatArray(const char* fieldName, const float* val, const int32_t len);
-
-            /**
-             * Write double. Maps to "double" type in Java.
-             *
-             * @param fieldName Field name.
-             * @param val Value.
-             */
-            void WriteDouble(const char* fieldName, const double val);
-
-            /**
-             * Write array of doubles. Maps to "double[]" type in Java.
-             *
-             * @param fieldName Field name.
-             * @param val Array.
-             * @param len Array length.
-             */
-            void WriteDoubleArray(const char* fieldName, const double* val, const int32_t len);
-
-            /**
-             * Write Guid. Maps to "UUID" type in Java.
-             *
-             * @param fieldName Field name.
-             * @param val Value.
-             */
-            void WriteGuid(const char* fieldName, const Guid val);
-
-            /**
-             * Write array of Guids. Maps to "UUID[]" type in Java.
-             *
-             * @param fieldName Field name.
-             * @param val Array.
-             * @param len Array length.
-             */
-            void WriteGuidArray(const char* fieldName, const Guid* val, const int32_t len);
-
-            /**
-             * Write string.
-             *
-             * @param fieldName Field name.
-             * @param val Null-terminated character sequence.
-             */
-            void WriteString(const char* fieldName, const char* val);
-
-            /**
-             * Write string.
-             *
-             * @param fieldName Field name.
-             * @param val String.
-             * @param len String length (characters).
-             */
-            void WriteString(const char* fieldName, const char* val, const int32_t len);
-
-            /**
-             * Write string.
-             *
-             * @param fieldName Field name.
-             * @param val String.
-             */
-            void WriteString(const char* fieldName, const std::string& val)
-            {
-                WriteString(fieldName, val.c_str());
-            }
-
-            /**
-             * Start string array write.
-             *
-             * @param fieldName Field name.
-             * @return String array writer.
-             */
-            PortableStringArrayWriter WriteStringArray(const char* fieldName);
-
-            /**
-             * Write NULL value.
-             *
-             * @param fieldName Field name.
-             */
-            void WriteNull(const char* fieldName);
-
-            /**
-             * Start array write.
-             *
-             * @param fieldName Field name.
-             * @return Array writer.
-             */
-            template<typename T>
-            PortableArrayWriter<T> WriteArray(const char* fieldName)
-            {
-                int32_t id = impl->WriteArray(fieldName);
-
-                return PortableArrayWriter<T>(impl, id);
-            }
-
-            /**
-             * Start collection write.
-             *
-             * @param fieldName Field name.
-             * @return Collection writer.
-             */
-            template<typename T>
-            PortableCollectionWriter<T> WriteCollection(const char* fieldName)
-            {
-                return WriteCollection<T>(fieldName, IGNITE_COLLECTION_UNDEFINED);
-            }
-
-            /**
-             * Start collection write.
-             *
-             * @param fieldName Field name.
-             * @param type Collection type.
-             * @return Collection writer.
-             */
-            template<typename T>
-            PortableCollectionWriter<T> WriteCollection(const char* fieldName, ignite::portable::CollectionType typ)
-            {
-                int32_t id = impl->WriteCollection(fieldName, typ);
-
-                return PortableCollectionWriter<T>(impl, id);
-            }
-
-            /**
-             * Start map write.
-             *
-             * @param fieldName Field name.
-             * @param typ Map type.
-             * @return Map writer.
-             */
-            template<typename K, typename V>
-            PortableMapWriter<K, V> WriteMap(const char* fieldName)
-            {
-                return WriteMap<K, V>(fieldName, IGNITE_MAP_UNDEFINED);
-            }
-
-            /**
-             * Start map write.
-             *
-             * @param fieldName Field name.
-             * @param typ Map type.
-             * @return Map writer.
-             */
-            template<typename K, typename V>
-            PortableMapWriter<K, V> WriteMap(const char* fieldName, ignite::portable::MapType typ)
-            {
-                int32_t id = impl->WriteMap(fieldName, typ);
-
-                return PortableMapWriter<K, V>(impl, id);
-            }
-
-            /**
-             * Write object.
-             *
-             * @param fieldName Field name.
-             * @param val Value.
-             */
-            template<typename T>
-            void WriteObject(const char* fieldName, T val)
-            {
-                impl->WriteObject<T>(fieldName, val);
-            }
-
-            /**
-             * Get raw writer for this reader.
-             *
-             * @return Raw writer.
-             */
-            PortableRawWriter RawWriter();
-        private:
-            /** Implementation delegate. */
-            ignite::impl::portable::PortableWriterImpl* impl;
-        };
-    }
-}
-
-#endif
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/core/os/linux/include/Makefile.am
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/os/linux/include/Makefile.am b/modules/platform/src/main/cpp/core/os/linux/include/Makefile.am
deleted file mode 100644
index 2ee13eff..0000000
--- a/modules/platform/src/main/cpp/core/os/linux/include/Makefile.am
+++ /dev/null
@@ -1,20 +0,0 @@
-##
-## Licensed to the Apache Software Foundation (ASF) under one or more
-## contributor license agreements.  See the NOTICE file distributed with
-## this work for additional information regarding copyright ownership.
-## The ASF licenses this file to You under the Apache License, Version 2.0
-## (the "License"); you may not use this file except in compliance with
-## the License.  You may obtain a copy of the License at
-##
-##      http://www.apache.org/licenses/LICENSE-2.0
-##
-## Unless required by applicable law or agreed to in writing, software
-## distributed under the License is distributed on an "AS IS" BASIS,
-## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-## See the License for the specific language governing permissions and
-## limitations under the License.
-##
-
-ACLOCAL_AMFLAGS = "-Im4"
-
-nobase_include_HEADERS = ignite/impl/utils.h

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/core/os/linux/include/ignite/impl/utils.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/os/linux/include/ignite/impl/utils.h b/modules/platform/src/main/cpp/core/os/linux/include/ignite/impl/utils.h
deleted file mode 100644
index 8bbd2f7..0000000
--- a/modules/platform/src/main/cpp/core/os/linux/include/ignite/impl/utils.h
+++ /dev/null
@@ -1,155 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef _IGNITE_UTILS
-#define _IGNITE_UTILS
-
-#include <cstring>
-#include <string>
-
-#include <ignite/common/common.h>
-
-#ifdef IGNITE_FRIEND
-    #define IGNITE_FRIEND_EXPORT IGNITE_EXPORT
-#else
-    #define IGNITE_FRIEND_EXPORT
-#endif
-
-namespace ignite
-{    
-    namespace impl
-    {
-        namespace utils
-        {                
-            /**
-             * Copy characters.
-             *
-             * @param val Value.
-             * @return Result.
-             */
-            IGNITE_FRIEND_EXPORT char* CopyChars(const char* val);
-
-            /**
-             * Release characters.
-             *
-             * @param val Value.
-             */
-            IGNITE_FRIEND_EXPORT void ReleaseChars(char* val);
-            
-            /**
-             * Read system environment variable taking thread-safety in count.
-             *
-             * @param name Environment variable name.
-             * @param found Whether environment variable with such name was found.
-             * @return Environment variable value.
-             */
-            IGNITE_FRIEND_EXPORT std::string GetEnv(const std::string& name, bool* found);
-                                
-            /**
-             * Ensure that file on the given path exists in the system.
-             *
-             * @param path Path.
-             * @return True if file exists, false otherwise.
-             */
-            IGNITE_FRIEND_EXPORT bool FileExists(const std::string& path);
-
-            /**
-             * Attempts to find JVM library to load it into the process later.
-             * First search is performed using the passed path argument (is not NULL).
-             * Then JRE_HOME is evaluated. Last, JAVA_HOME is evaluated.
-             *
-             * @param Explicitly defined path (optional).
-             * @param found Whether library was found.
-             * @return Path to the file.
-             */
-            IGNITE_FRIEND_EXPORT std::string FindJvmLibrary(const std::string* path, bool* found);
-
-            /**
-             * Load JVM library into the process.
-             *
-             * @param path Optional path to the library.
-             * @return Whether load was successful.
-             */
-            IGNITE_FRIEND_EXPORT bool LoadJvmLibrary(const std::string& path);
-
-            /**
-             * Resolve IGNITE_HOME directory. Resolution is performed in several
-             * steps:
-             * 1) Check for path provided as argument.
-             * 2) Check for environment variable.
-             * 3) Check for current working directory.
-             * Result of these 3 checks are evaluated based on existence of certain
-             * predefined folders inside possible GG home. If they are found, 
-             * IGNITE_HOME is considered resolved.
-             *
-             * @param path Optional path to evaluate.
-             * @param found Whether IGNITE_HOME home was found.
-             * @return Resolved GG home.
-             */
-            IGNITE_FRIEND_EXPORT std::string ResolveIgniteHome(const std::string* path, bool* found);
-
-            /**
-             * Create Ignite classpath based on user input and home directory.
-             *
-             * @param usrCp User's classpath.
-             * @param home Ignite home directory.
-             * @return Classpath.
-             */
-            IGNITE_FRIEND_EXPORT std::string CreateIgniteClasspath(const std::string* usrCp, const std::string* home);
-
-            /**
-             * Create Ignite classpath based on user input and home directory.
-             *
-             * @param usrCp User's classpath.
-             * @param home Ignite home directory.
-             * @param test Whether test classpath must be used.
-             * @return Classpath.
-             */
-            IGNITE_FRIEND_EXPORT std::string CreateIgniteClasspath(const std::string* usrCp, const std::string* home, bool test);
-
-            /**
-             * Safe array which automatically reclaims occupied memory when out of scope.
-             */
-            template<typename T>
-            struct IGNITE_FRIEND_EXPORT SafeArray
-            {
-                /**
-                 * Constructor.
-                 */
-                SafeArray(int cap)
-                {
-                    target = new T[cap];
-                }
-
-                /**
-                 * Destructor.
-                 */
-                ~SafeArray()
-                {
-                    delete[] target;
-                }
-
-                IGNITE_NO_COPY_ASSIGNMENT(SafeArray);
-
-                /** Target array. */
-                T* target;
-            };
-        }
-    }    
-}
-
-#endif

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/core/os/linux/src/impl/utils.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/os/linux/src/impl/utils.cpp b/modules/platform/src/main/cpp/core/os/linux/src/impl/utils.cpp
deleted file mode 100644
index ec45eb6..0000000
--- a/modules/platform/src/main/cpp/core/os/linux/src/impl/utils.cpp
+++ /dev/null
@@ -1,439 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#include <sys/stat.h>
-#include <dirent.h>
-#include <dlfcn.h>
-
-#include "ignite/impl/utils.h"
-
-namespace ignite
-{
-    namespace impl
-    {
-        namespace utils
-        {
-            const char* JAVA_HOME = "JAVA_HOME";
-            const char* JAVA_DLL = "/jre/lib/amd64/server/libjvm.so";
-
-            const char* IGNITE_HOME = "IGNITE_HOME";
-
-            const char* PROBE_BIN = "/bin";
-            const char* PROBE_EXAMPLES = "/examples";
-
-            const char* IGNITE_NATIVE_TEST_CLASSPATH = "IGNITE_NATIVE_TEST_CLASSPATH";
-
-            /**
-             * Helper method to set boolean result to reference with proper NULL-check.
-             *
-             * @param res Result.
-             * @param outRes Where to set the result.
-             */
-            inline void SetBoolResult(bool res, bool* outRes)
-            {
-                if (outRes)
-                    *outRes = res;
-            }
-
-            /**
-             * Check if string ends with the given ending.
-             *
-             * @param str String to check.
-             * @param ending Ending.
-             * @return Result.
-             */
-            inline bool StringEndsWith(const std::string& str, const std::string& ending)
-            {
-                if (str.length() > ending.length())
-                    return str.compare(str.length() - ending.length(), ending.length(), ending) == 0;
-
-                return false;
-            }
-                
-            /**
-             * Helper function for GG home resolution. Checks whether certain folders
-             * exist in the path. Optionally goes upwards in directory hierarchy.
-             *
-             * @param path Path to evaluate.
-             * @param up Whether to go upwards.
-             * @res Resolution result.
-             * @return Resolved directory.
-             */
-            std::string ResolveIgniteHome0(const std::string& path, bool up, bool* res)
-            {
-                struct stat pathStat;
-                
-                if (stat(path.c_str(), &pathStat) != -1 && S_ISDIR(pathStat.st_mode)) 
-                {
-                    // Remove trailing slashes, otherwise we will have an infinite loop.
-                    std::string path0 = path;
-
-                    while (true) {
-                        char lastChar = *path0.rbegin();
-
-                        if (lastChar == '/' || lastChar == ' ') {
-                            size_t off = path0.find_last_of(lastChar);
-
-                            path0.erase(off, 1);
-                        }
-                        else
-                            break;
-                    }
-
-                    std::string binStr = path0 + PROBE_BIN;
-                    struct stat binStat;
-
-                    std::string examplesStr = path0 + PROBE_EXAMPLES;
-                    struct stat examplesStat;
-
-                    if (stat(binStr.c_str(), &binStat) != -1 && S_ISDIR(binStat.st_mode) &&
-                        stat(examplesStr.c_str(), &examplesStat) != -1 && S_ISDIR(examplesStat.st_mode))
-                    {
-                        SetBoolResult(true, res);
-
-                        return std::string(path0);
-                    }
-
-                    if (up)
-                    {
-                        // Evaluate parent directory.
-                        size_t slashPos = path0.find_last_of("/");
-
-                        if (slashPos != std::string::npos)
-                        {
-                            std::string parent = path0.substr(0, slashPos);
-
-                            return ResolveIgniteHome0(parent, true, res);
-                        }
-                    }
-
-                }
-
-                SetBoolResult(false, res);
-
-                return std::string();
-            }
-
-            /**
-             * Create classpath picking JARs from the given path.
-             *
-             * @path Path.
-             * @return Classpath;
-             */
-            std::string ClasspathJars(const std::string& path)
-            {
-                std::string res = std::string();
-
-                DIR* dir = opendir(path.c_str());
-
-                if (dir)
-                {
-                    struct dirent* entry;
-
-                    while ((entry = readdir(dir)) != NULL)
-                    {
-                        if (strstr(entry->d_name, ".jar"))
-                        {
-                            res.append(path);
-                            res.append("/");
-                            res.append(entry->d_name);
-                            res.append(":");
-                        }
-                    }
-
-                    closedir(dir);
-                }
-
-                return res;
-            }
-
-            /**
-             * Create classpath picking compiled classes from the given path.
-             *
-             * @path Path.
-             * @return Classpath;
-             */
-            std::string ClasspathExploded(const std::string& path, bool down)
-            {
-                std::string res = std::string();
-
-                if (FileExists(path))
-                {
-                    // 1. Append "target\classes".
-                    std::string classesPath = path + "/target/classes";
-
-                    if (FileExists(classesPath)) {
-                        res += classesPath;
-                        res += ":";
-                    }
-
-                    // 2. Append "target\test-classes"
-                    std::string testClassesPath = path + "/target/test-classes";
-
-                    if (FileExists(testClassesPath)) {
-                        res += testClassesPath;
-                        res += ":";
-                    }
-
-                    // 3. Append "target\libs"
-                    std::string libsPath = path + "/target/libs";
-
-                    if (FileExists(libsPath)) {
-                        std::string libsCp = ClasspathJars(libsPath);
-                        res += libsCp;
-                    }
-
-                    // 4. Do the same for child if needed.
-                    if (down)
-                    {
-                        DIR* dir = opendir(path.c_str());
-
-                        if (dir)
-                        {
-                            struct dirent* entry;
-
-                            while ((entry = readdir(dir)) != NULL)
-                            {
-                                std::string entryPath = entry->d_name;
-
-                                if (entryPath.compare(".") != 0 && entryPath.compare("..") != 0)
-                                {
-                                    std::string entryFullPath = path + "/" + entryPath;
-
-                                    struct stat entryFullStat;
-
-                                    if (stat(entryFullPath.c_str(), &entryFullStat) != -1 && S_ISDIR(entryFullStat.st_mode))
-                                    {
-                                        std::string childCp = ClasspathExploded(entryFullPath, false);
-
-                                        res += childCp;
-                                    }
-                                }
-                            }
-
-                            closedir(dir);
-                        }
-                    }
-                }
-
-                return res;
-            }
-
-            /**
-             * Helper function to create classpath based on Ignite home directory.
-             *
-             * @param home Home directory; expected to be valid.
-             * @param forceTest Force test classpath.
-             */
-            std::string CreateIgniteHomeClasspath(const std::string& home, bool forceTest)
-            {
-                std::string res = std::string();
-
-                // 1. Add exploded test directories.
-                if (forceTest)
-                {
-                    std::string examplesPath = home + "/examples";
-                    std::string examplesCp = ClasspathExploded(examplesPath, true);
-                    res.append(examplesCp);
-
-                    std::string modulesPath = home + "/modules";
-                    std::string modulesCp = ClasspathExploded(modulesPath, true);
-                    res.append(modulesCp);
-                }
-
-                // 2. Add regular jars from "libs" folder excluding "optional".
-                std::string libsPath = home + "/libs";
-
-                if (FileExists(libsPath))
-                {
-                    res.append(ClasspathJars(libsPath));
-
-                    // Append inner directories.
-                    DIR* dir = opendir(libsPath.c_str());
-
-                    if (dir)
-                    {
-                        struct dirent* entry;
-
-                        while ((entry = readdir(dir)) != NULL)
-                        {
-                            std::string entryPath = entry->d_name;
-
-                            if (entryPath.compare(".") != 0 && entryPath.compare("..") != 0 &&
-                                entryPath.compare("optional") != 0)
-                            {
-                                std::string entryFullPath = libsPath;
-
-                                entryFullPath.append("/");
-                                entryFullPath.append(entryPath);
-
-                                struct stat entryFullStat;
-
-                                if (stat(entryFullPath.c_str(), &entryFullStat) != -1 && 
-                                    S_ISDIR(entryFullStat.st_mode)) 
-                                    res.append(ClasspathJars(entryFullPath));
-                            }                                                              
-                        }
-
-                        closedir(dir);
-                    }
-                }
-
-                // 3. Return.
-                return res;
-            }
-
-            char* CopyChars(const char* val)
-            {
-                if (val) {
-                    size_t len = strlen(val);
-                    char* dest = new char[len + 1];
-                    strcpy(dest, val);
-                    *(dest + len) = 0;
-                    return dest;
-                }
-                else
-                    return NULL;
-            }
-
-            void ReleaseChars(char* val)
-            {
-                if (val)
-                    delete[] val;
-            }
-
-            std::string GetEnv(const std::string& name, bool* found)
-            {
-                char* val = std::getenv(name.c_str());
-                
-                if (val) {
-                    SetBoolResult(true, found);
-                    
-                    return std::string(val);
-                }
-                else {
-                    SetBoolResult(false, found);
-                    
-                    return std::string();
-                }
-            }
-
-            bool FileExists(const std::string& path)
-            {
-                struct stat s;
-                
-                int res = stat(path.c_str(), &s);
-
-                return res != -1;
-            }
-
-            std::string FindJvmLibrary(const std::string* path, bool* found)
-            {
-                SetBoolResult(true, found); // Optimistically assume that we will find it.
-
-                if (path) {
-                    // If path is provided explicitly, then check only it.
-                    if (FileExists(*path))                            
-                        return std::string(path->data());
-                }
-                else
-                {
-                    bool javaEnvFound;
-                    std::string javaEnv = GetEnv(JAVA_HOME, &javaEnvFound);
-
-                    if (javaEnvFound)
-                    {
-                        std::string javaDll = javaEnv + JAVA_DLL;
-
-                        if (FileExists(javaDll))
-                            return std::string(javaDll);
-                    }
-                }
-
-                SetBoolResult(false, found);
-
-                return std::string();
-            }
-
-            bool LoadJvmLibrary(const std::string& path)
-            {
-                void* hnd = dlopen(path.c_str(), RTLD_LAZY);
-                
-                return hnd != NULL;
-            }                
-
-            std::string ResolveIgniteHome(const std::string* path, bool* found)
-            {
-                if (path)
-                    // 1. Check passed argument.
-                    return ResolveIgniteHome0(*path, false, found);
-                else
-                {
-                    // 2. Check environment variable.
-                    bool envFound;
-                    std::string env = GetEnv(IGNITE_HOME, &envFound);
-
-                    if (envFound)
-                        return ResolveIgniteHome0(env, false, found);
-                }
-
-                SetBoolResult(false, found);
-                        
-                return std::string();
-            }
-
-            std::string CreateIgniteClasspath(const std::string* usrCp, const std::string* home)
-            {
-                bool forceTest = false;
-
-                if (home)
-                {
-                    bool envFound;
-                    std::string env = GetEnv(IGNITE_NATIVE_TEST_CLASSPATH, &envFound);
-
-                    forceTest = envFound && env.compare("true") == 0;
-                }
-
-                return CreateIgniteClasspath(usrCp, home, forceTest);
-            }
-
-            std::string CreateIgniteClasspath(const std::string* usrCp, const std::string* home, bool forceTest)
-            {
-                // 1. Append user classpath if it exists.
-                std::string cp = std::string();
-
-                if (usrCp)
-                {
-                    cp.append(*usrCp);
-
-                    if (*cp.rbegin() != ':')
-                        cp.append(":");
-                }
-
-                // 2. Append home classpath if home is defined.
-                if (home)
-                {
-                    std::string homeCp = CreateIgniteHomeClasspath(*home, forceTest);
-
-                    cp.append(homeCp);
-                }
-
-                // 3. Return.
-                return cp;
-            }
-        }
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/core/os/win/include/ignite/impl/utils.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/os/win/include/ignite/impl/utils.h b/modules/platform/src/main/cpp/core/os/win/include/ignite/impl/utils.h
deleted file mode 100644
index 08e76ee..0000000
--- a/modules/platform/src/main/cpp/core/os/win/include/ignite/impl/utils.h
+++ /dev/null
@@ -1,155 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef _IGNITE_UTILS
-#define _IGNITE_UTILS
-
-#include <cstring>
-#include <string>
-
-#include <ignite/common/common.h>
-
-#ifdef IGNITE_FRIEND
-    #define IGNITE_FRIEND_EXPORT IGNITE_EXPORT
-#else
-    #define IGNITE_FRIEND_EXPORT
-#endif
-
-namespace ignite
-{    
-    namespace impl
-    {
-        namespace utils
-        {                
-            /**
-             * Copy characters.
-             *
-             * @param val Value.
-             * @return Result.
-             */
-            IGNITE_FRIEND_EXPORT char* CopyChars(const char* val);
-
-            /**
-             * Release characters.
-             *
-             * @param val Value.
-             */
-            IGNITE_FRIEND_EXPORT void ReleaseChars(char* val);
-            
-            /**
-             * Read system environment variable taking thread-safety in count.
-             *
-             * @param name Environment variable name.
-             * @param found Whether environment variable with such name was found.
-             * @return Environment variable value.
-             */
-            IGNITE_FRIEND_EXPORT std::string GetEnv(const std::string& name, bool* found);
-                                
-            /**
-             * Ensure that file on the given path exists in the system.
-             *
-             * @param path Path.
-             * @return True if file exists, false otherwise.
-             */
-            IGNITE_FRIEND_EXPORT bool FileExists(const std::string& path);
-
-            /**
-             * Attempts to find JVM library to load it into the process later.
-             * First search is performed using the passed path argument (is not NULL).
-             * Then JRE_HOME is evaluated. Last, JAVA_HOME is evaluated.
-             *
-             * @param Explicitly defined path (optional).
-             * @param found Whether library was found.
-             * @return Path to the file.
-             */
-            IGNITE_FRIEND_EXPORT std::string FindJvmLibrary(const std::string* path, bool* found);
-
-            /**
-             * Load JVM library into the process.
-             *
-             * @param path Optional path to the library.
-             * @return Whether load was successful.
-             */
-            IGNITE_FRIEND_EXPORT bool LoadJvmLibrary(const std::string& path);
-
-            /**
-             * Resolve IGNITE_HOME directory. Resolution is performed in several
-             * steps:
-             * 1) Check for path provided as argument.
-             * 2) Check for environment variable.
-             * 3) Check for current working directory.
-             * Result of these 3 checks are evaluated based on existence of certain
-             * predefined folders inside possible GG home. If they are found, 
-             * IGNITE_HOME is considered resolved.
-             *
-             * @param path Optional path to evaluate.
-             * @param found Whether IGNITE_HOME home was found.
-             * @return Resolved GG home.
-             */
-            IGNITE_FRIEND_EXPORT std::string ResolveIgniteHome(const std::string* path, bool* found);
-
-            /**
-             * Create Ignite classpath based on user input and home directory.
-             *
-             * @param usrCp User's classpath.
-             * @param home Ignite home directory.
-             * @return Classpath.
-             */
-            IGNITE_FRIEND_EXPORT std::string CreateIgniteClasspath(const std::string* usrCp, const std::string* home);
-
-            /**
-             * Create Ignite classpath based on user input and home directory.
-             *
-             * @param usrCp User's classpath.
-             * @param home Ignite home directory.
-             * @param test Whether test classpath must be used.
-             * @return Classpath.
-             */
-            IGNITE_FRIEND_EXPORT std::string CreateIgniteClasspath(const std::string* usrCp, const std::string* home, bool test);
-
-            /**
-             * Safe array which automatically reclaims occupied memory when out of scope.
-             */
-            template<typename T>
-            struct IGNITE_FRIEND_EXPORT SafeArray
-            {
-                /** Target array. */
-                T* target;
-
-                /**
-                 * Constructor.
-                 */
-                SafeArray(int cap)
-                {
-                    target = new T[cap];
-                }
-
-                /**
-                 * Destructor.
-                 */
-                ~SafeArray()
-                {
-                    delete[] target;
-                }
-
-                IGNITE_NO_COPY_ASSIGNMENT(SafeArray);
-            };
-        }
-    }    
-}
-
-#endif
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/core/os/win/src/impl/utils.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/os/win/src/impl/utils.cpp b/modules/platform/src/main/cpp/core/os/win/src/impl/utils.cpp
deleted file mode 100644
index 5a450c3..0000000
--- a/modules/platform/src/main/cpp/core/os/win/src/impl/utils.cpp
+++ /dev/null
@@ -1,453 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <windows.h>
-
-#include "ignite/impl/utils.h"
-
-namespace ignite
-{
-    namespace impl
-    {
-        namespace utils
-        {
-            const char* JAVA_HOME = "JAVA_HOME";
-            const char* JAVA_DLL = "\\jre\\bin\\server\\jvm.dll";
-
-            const char* IGNITE_HOME = "IGNITE_HOME";
-
-            const char* PROBE_BIN = "\\bin";
-            const char* PROBE_EXAMPLES = "\\examples";
-
-            const char* IGNITE_NATIVE_TEST_CLASSPATH = "IGNITE_NATIVE_TEST_CLASSPATH";
-
-            /**
-             * Helper method to set boolean result to reference with proper NULL-check.
-             *
-             * @param res Result.
-             * @param outRes Where to set the result.
-             */
-            inline void SetBoolResult(bool res, bool* outRes)
-            {
-                if (outRes)
-                    *outRes = res;
-            }
-
-            /**
-             * Check if string ends with the given ending.
-             *
-             * @param str String to check.
-             * @param ending Ending.
-             * @return Result.
-             */
-            inline bool StringEndsWith(const std::string& str, const std::string& ending)
-            {
-                if (str.length() > ending.length())
-                    return str.compare(str.length() - ending.length(), ending.length(), ending) == 0;
-
-                return false;
-            }
-                
-            /**
-             * Helper function for GG home resolution. Checks whether certain folders
-             * exist in the path. Optionally goes upwards in directory hierarchy.
-             *
-             * @param path Path to evaluate.
-             * @param up Whether to go upwards.
-             * @res Resolution result.
-             * @return Resolved directory.
-             */
-            std::string ResolveIgniteHome0(const std::string& path, bool up, bool* res)
-            {
-                DWORD attrs = GetFileAttributesA(path.c_str());
-
-                if (attrs != INVALID_FILE_ATTRIBUTES && (attrs & FILE_ATTRIBUTE_DIRECTORY))
-                {
-                    // Remove trailing slashes, otherwise we will have an infinite loop.
-                    std::string path0 = path;
-
-                    while (true) {
-                        char lastChar = *path0.rbegin();
-
-                        if (lastChar == '/' || lastChar == '\\' || lastChar == ' ') {
-                            size_t off = path0.find_last_of(lastChar);
-
-                            path0.erase(off, 1);
-                        }
-                        else
-                            break;
-                    }
-
-                    std::string binStr = path0 + PROBE_BIN;
-                    DWORD binAttrs = GetFileAttributesA(binStr.c_str());
-
-                    std::string examplesStr = path0 + PROBE_EXAMPLES;
-                    DWORD examplesAttrs = GetFileAttributesA(examplesStr.c_str());
-
-                    if (binAttrs != INVALID_FILE_ATTRIBUTES && (binAttrs & FILE_ATTRIBUTE_DIRECTORY) &&
-                        examplesAttrs != INVALID_FILE_ATTRIBUTES && (examplesAttrs & FILE_ATTRIBUTE_DIRECTORY))
-                    {
-                        SetBoolResult(true, res);
-                        return std::string(path0);
-                    }
-
-                    if (up)
-                    {
-                        // Evaluate parent directory.
-                        size_t slashPos = path0.find_last_of("/\\");
-
-                        if (slashPos != std::string::npos)
-                        {
-                            std::string parent = path0.substr(0, slashPos);
-
-                            return ResolveIgniteHome0(parent, true, res);
-                        }
-                    }
-                }
-
-                SetBoolResult(false, res);
-
-                return std::string();
-            }
-
-            /**
-             * Create classpath picking JARs from the given path.
-             *
-             * @path Path.
-             * @return Classpath;
-             */
-            std::string ClasspathJars(const std::string& path)
-            {
-                std::string searchPath = path + "\\*.jar";
-
-                std::string res = std::string();
-
-                WIN32_FIND_DATAA findData;
-
-                HANDLE hnd = FindFirstFileA(searchPath.c_str(), &findData);
-
-                if (hnd != INVALID_HANDLE_VALUE)
-                {
-                    do
-                    {
-                        res.append(path);
-                        res.append("\\");
-                        res.append(findData.cFileName);
-                        res.append(";");
-                    } while (FindNextFileA(hnd, &findData) != 0);
-
-                    FindClose(hnd);
-                }
-
-                return res;
-            }
-
-            /**
-             * Create classpath picking compiled classes from the given path.
-             *
-             * @path Path.
-             * @return Classpath;
-             */
-            std::string ClasspathExploded(const std::string& path, bool down)
-            {
-                std::string res = std::string();
-
-                if (FileExists(path))
-                {
-                    // 1. Append "target\classes".
-                    std::string classesPath = path + "\\target\\classes";
-
-                    if (FileExists(classesPath)) {
-                        res.append(classesPath);
-                        res.append(";");
-                    }
-
-                    // 2. Append "target\test-classes"
-                    std::string testClassesPath = path + "\\target\\test-classes";
-
-                    if (FileExists(testClassesPath)) {
-                        res.append(testClassesPath);
-                        res.append(";");
-                    }
-
-                    // 3. Append "target\libs"
-                    std::string libsPath = path + "\\target\\libs";
-
-                    if (FileExists(libsPath)) {
-                        std::string libsCp = ClasspathJars(libsPath);
-                        res.append(libsCp);
-                    }
-
-                    // 4. Do the same for child if needed.
-                    if (down)
-                    {
-                        std::string searchPath = path + "\\*";
-
-                        WIN32_FIND_DATAA findData;
-
-                        HANDLE hnd = FindFirstFileA(searchPath.c_str(), &findData);
-
-                        if (hnd != INVALID_HANDLE_VALUE)
-                        {
-                            do
-                            {
-                                if (findData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
-                                {
-                                    std::string childPath = findData.cFileName;
-
-                                    if (childPath.compare(".") != 0 &&
-                                        childPath.compare("..") != 0)
-                                    {
-                                        std::string childCp =
-                                            ClasspathExploded(path + "\\" + childPath, false);
-
-                                        res.append(childCp);
-                                    }
-                                }
-                            } while (FindNextFileA(hnd, &findData) != 0);
-
-                            FindClose(hnd);
-                        }
-                    }
-                }
-
-                return res;
-            }
-
-            /**
-             * Helper function to create classpath based on Ignite home directory.
-             *
-             * @param home Home directory; expected to be valid.
-             * @param forceTest Force test classpath.
-             */
-            std::string CreateIgniteHomeClasspath(const std::string& home, bool forceTest)
-            {
-                std::string res = std::string();
-
-                // 1. Add exploded test directories.
-                if (forceTest)
-                {
-                    std::string examplesPath = home + "\\examples";
-                    std::string examplesCp = ClasspathExploded(examplesPath, true);
-                    res.append(examplesCp);
-
-                    std::string modulesPath = home + "\\modules";
-                    std::string modulesCp = ClasspathExploded(modulesPath, true);
-                    res.append(modulesCp);
-                }
-
-                // 2. Add regular jars from "libs" folder excluding "optional".
-                std::string libsPath = home + "\\libs";
-
-                if (FileExists(libsPath))
-                {
-                    res.append(ClasspathJars(libsPath));
-
-                    // Append inner directories.
-                    std::string libsSearchPath = libsPath + "\\*";
-
-                    WIN32_FIND_DATAA libsFindData;
-
-                    HANDLE libsHnd = FindFirstFileA(libsSearchPath.c_str(), &libsFindData);
-
-                    if (libsHnd != INVALID_HANDLE_VALUE)
-                    {
-                        do
-                        {
-                            if (libsFindData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
-                            {
-                                std::string libsChildPath = libsFindData.cFileName;
-
-                                if (libsChildPath.compare(".") != 0 &&
-                                    libsChildPath.compare("..") != 0 &&
-                                    libsChildPath.compare("optional") != 0) {
-                                    std::string libsFolder = libsPath + "\\" + libsChildPath;
-
-                                    res.append(ClasspathJars(libsFolder));
-                                }
-                            }
-                        } while (FindNextFileA(libsHnd, &libsFindData) != 0);
-
-                        FindClose(libsHnd);
-                    }
-                }
-
-                // 3. Return.
-                return res;
-            }
-
-            char* CopyChars(const char* val)
-            {
-                if (val) {
-                    size_t len = strlen(val);
-                    char* dest = new char[len + 1];
-                    strcpy(dest, val);
-                    *(dest + len) = 0;
-                    return dest;
-                }
-                else
-                    return NULL;
-            }
-
-            void ReleaseChars(char* val)
-            {
-                if (val)
-                    delete[] val;
-            }
-
-            std::string GetEnv(const std::string& name, bool* found)
-            {
-                char res0[32767];
-
-                DWORD envRes = GetEnvironmentVariableA(name.c_str(), res0, 32767);
-
-                if (envRes != 0)
-                {
-                    SetBoolResult(true, found);
-
-                    return std::string(res0);
-                }
-                else 
-                {
-                    SetBoolResult(false, found);
-
-                    return std::string();
-                }
-            }
-
-            bool FileExists(const std::string& path)
-            {
-                WIN32_FIND_DATAA findres;
-
-                HANDLE hnd = FindFirstFileA(path.c_str(), &findres);
-
-                if (hnd == INVALID_HANDLE_VALUE)
-                    return false;
-                else
-                {
-                    FindClose(hnd);
-
-                    return true;
-                }
-            }
-
-            std::string FindJvmLibrary(const std::string* path, bool* found)
-            {
-                SetBoolResult(true, found); // Optimistically assume that we will find it.
-
-                if (path) {
-                    // If path is provided explicitly, then check only it.
-                    if (FileExists(*path))                            
-                        return std::string(path->data());
-                }
-                else
-                {
-                    bool javaEnvFound;
-                    std::string javaEnv = GetEnv(JAVA_HOME, &javaEnvFound);
-
-                    if (javaEnvFound)
-                    {
-                        std::string javaDll = javaEnv + JAVA_DLL;
-
-                        if (FileExists(javaDll))
-                            return std::string(javaDll);
-                    }
-                }
-
-                *found = false; 
-
-                return std::string();
-            }
-
-            bool LoadJvmLibrary(const std::string& path)
-            {
-                HMODULE mod = LoadLibraryA(path.c_str());
-
-                return mod != NULL;
-            }                
-
-            std::string ResolveIgniteHome(const std::string* path, bool* found)
-            {
-                if (path)
-                    // 1. Check passed argument.
-                    return ResolveIgniteHome0(*path, false, found);
-                else
-                {
-                    // 2. Check environment variable.
-                    bool envFound;
-                    std::string env = GetEnv(IGNITE_HOME, &envFound);
-
-                    if (envFound)
-                        return ResolveIgniteHome0(env, false, found);
-
-                    // 3. Check current work dir.
-                    const DWORD curDirLen = GetCurrentDirectory(0, NULL);
-                        
-                    char* curDir = new char[curDirLen];
-
-                    GetCurrentDirectoryA(curDirLen, curDir);
-
-                    std::string curDirStr = curDir;
-
-                    delete[] curDir;
-
-                    return ResolveIgniteHome0(curDirStr, true, found);
-                }
-            }
-
-            std::string CreateIgniteClasspath(const std::string* usrCp, const std::string* home)
-            {
-                bool forceTest = false;
-
-                if (home)
-                {
-                    bool envFound;
-                    std::string env = GetEnv(IGNITE_NATIVE_TEST_CLASSPATH, &envFound);
-
-                    forceTest = envFound && env.compare("true") == 0;
-                }
-
-                return CreateIgniteClasspath(usrCp, home, forceTest);
-            }
-
-            std::string CreateIgniteClasspath(const std::string* usrCp, const std::string* home, bool forceTest)
-            {
-                // 1. Append user classpath if it exists.
-                std::string cp = std::string();
-
-                if (usrCp)
-                {
-                    cp.append(*usrCp);
-
-                    if (*cp.rbegin() != ';')
-                        cp.append(";");
-                }
-
-                // 2. Append home classpath if home is defined.
-                if (home)
-                {
-                    std::string homeCp = CreateIgniteHomeClasspath(*home, forceTest);
-
-                    cp.append(homeCp);
-                }
-
-                // 3. Return.
-                return cp;
-            }
-        }
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/core/project/README.TXT
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/project/README.TXT b/modules/platform/src/main/cpp/core/project/README.TXT
deleted file mode 100644
index 97f4c64..0000000
--- a/modules/platform/src/main/cpp/core/project/README.TXT
+++ /dev/null
@@ -1 +0,0 @@
-Contains IDE projects artifacts.

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/core/project/vs/README.TXT
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/project/vs/README.TXT b/modules/platform/src/main/cpp/core/project/vs/README.TXT
deleted file mode 100644
index f4fb456..0000000
--- a/modules/platform/src/main/cpp/core/project/vs/README.TXT
+++ /dev/null
@@ -1 +0,0 @@
-Contains Visual Studio project artifacts.
\ No newline at end of file


[05/28] ignite git commit: IGNITE-1513: Moved CPP.

Posted by vo...@apache.org.
http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/core/include/ignite/impl/portable/portable_utils.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/ignite/impl/portable/portable_utils.h b/modules/platform/src/main/cpp/core/include/ignite/impl/portable/portable_utils.h
deleted file mode 100644
index dd16686..0000000
--- a/modules/platform/src/main/cpp/core/include/ignite/impl/portable/portable_utils.h
+++ /dev/null
@@ -1,344 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef _IGNITE_IMPL_PORTABLE_UTILS
-#define _IGNITE_IMPL_PORTABLE_UTILS
-
-#include <stdint.h>
-
-#include "ignite/guid.h"
-
-namespace ignite
-{
-    namespace impl
-    {
-        namespace interop
-        {
-            class InteropInputStream;
-            class InteropOutputStream;
-        }
-
-        namespace portable
-        {
-            /**
-             * Portable uilts.
-             */
-            class IGNITE_IMPORT_EXPORT PortableUtils
-            {
-            public:
-                /**
-                 * Utility method to read signed 8-bit integer from stream.
-                 *
-                 * @param stream Stream.
-                 * @return Value.
-                 */
-                static int8_t ReadInt8(interop::InteropInputStream* stream);
-
-                /**
-                 * Utility method to write signed 8-bit integer to stream.
-                 *
-                 * @param stream Stream.
-                 * @param val Value.
-                 */
-                static void WriteInt8(interop::InteropOutputStream* stream, int8_t val);
-
-                /**
-                 * Utility method to read signed 8-bit integer array from stream.
-                 *
-                 * @param stream Stream.
-                 * @param res Target array.
-                 * @param len Array length.                 
-                 */
-                static void ReadInt8Array(interop::InteropInputStream* stream, int8_t* res, const int32_t len);
-
-                /**
-                 * Utility method to write signed 8-bit integer array to stream.
-                 *
-                 * @param stream Stream.
-                 * @param val Value.
-                 * @param len Array length.
-                 */
-                static void WriteInt8Array(interop::InteropOutputStream* stream, const int8_t* val, const int32_t len);
-
-                /**
-                 * Utility method to read boolean from stream.
-                 *
-                 * @param stream Stream.
-                 * @return Value.
-                 */
-                static bool ReadBool(interop::InteropInputStream* stream);
-
-                /**
-                 * Utility method to write bool to stream.
-                 *
-                 * @param stream Stream.
-                 * @param val Value.
-                 */
-                static void WriteBool(interop::InteropOutputStream* stream, bool val);
-
-                /**
-                 * Utility method to read bool array from stream.
-                 *
-                 * @param stream Stream.
-                 * @param res Target array.
-                 * @param len Array length.
-                 */
-                static void ReadBoolArray(interop::InteropInputStream* stream, bool* res, const int32_t len);
-
-                /**
-                 * Utility method to write bool array to stream.
-                 *
-                 * @param stream Stream.
-                 * @param val Value.
-                 * @param len Array length.
-                 */
-                static void WriteBoolArray(interop::InteropOutputStream* stream, const bool* val, const int32_t len);
-
-                /**
-                 * Utility method to read signed 16-bit integer from stream.
-                 *
-                 * @param stream Stream.
-                 * @return Value.
-                 */
-                static int16_t ReadInt16(interop::InteropInputStream* stream);
-
-                /**
-                 * Utility method to write signed 16-bit integer to stream.
-                 *
-                 * @param stream Stream.
-                 * @param val Value.
-                 */
-                static void WriteInt16(interop::InteropOutputStream* stream, int16_t val);
-
-                /**
-                 * Utility method to read signed 16-bit integer array from stream.
-                 *
-                 * @param stream Stream.
-                 * @param res Target array.
-                 * @param len Array length.                 
-                 */
-                static void ReadInt16Array(interop::InteropInputStream* stream, int16_t* res, const int32_t len);
-
-                /**
-                 * Utility method to write signed 16-bit integer array to stream.
-                 *
-                 * @param stream Stream.
-                 * @param val Value.
-                 * @param len Array length.
-                 */
-                static void WriteInt16Array(interop::InteropOutputStream* stream, const int16_t* val, const int32_t len);
-
-                /**
-                 * Utility method to read unsigned 16-bit integer from stream.
-                 *
-                 * @param stream Stream.
-                 * @return Value.
-                 */
-                static uint16_t ReadUInt16(interop::InteropInputStream* stream);
-
-                /**
-                 * Utility method to write unsigned 16-bit integer to stream.
-                 *
-                 * @param stream Stream.
-                 * @param val Value.
-                 */
-                static void WriteUInt16(interop::InteropOutputStream* stream, uint16_t val);
-
-                /**
-                 * Utility method to read unsigned 16-bit integer array from stream.
-                 *
-                 * @param stream Stream.
-                 * @param res Target array.
-                 * @param len Array length.
-                 */
-                static void ReadUInt16Array(interop::InteropInputStream* stream, uint16_t* res, const int32_t len);
-
-                /**
-                 * Utility method to write unsigned 16-bit integer array to stream.
-                 *
-                 * @param stream Stream.
-                 * @param val Value.
-                 * @param len Array length.
-                 */
-                static void WriteUInt16Array(interop::InteropOutputStream* stream, const uint16_t* val, const int32_t len);
-
-                /**
-                 * Utility method to read signed 32-bit integer from stream.
-                 *
-                 * @param stream Stream.
-                 * @return Value.
-                 */
-                static int32_t ReadInt32(interop::InteropInputStream* stream);
-
-                /**
-                 * Utility method to write signed 32-bit integer to stream.
-                 *
-                 * @param stream Stream.
-                 * @param val Value.
-                 */
-                static void WriteInt32(interop::InteropOutputStream* stream, int32_t val);
-
-                /**
-                 * Utility method to read signed 32-bit integer array from stream.
-                 *
-                 * @param stream Stream.
-                 * @param res Target array.
-                 * @param len Array length.
-                 */
-                static void ReadInt32Array(interop::InteropInputStream* stream, int32_t* res, const int32_t len);
-
-                /**
-                 * Utility method to write signed 32-bit integer array to stream.
-                 *
-                 * @param stream Stream.
-                 * @param val Value.
-                 * @param len Array length.
-                 */
-                static void WriteInt32Array(interop::InteropOutputStream* stream, const int32_t* val, const int32_t len);
-
-                /**
-                 * Utility method to read signed 64-bit integer from stream.
-                 *
-                 * @param stream Stream.
-                 * @return Value.
-                 */
-                static int64_t ReadInt64(interop::InteropInputStream* stream);
-
-                /**
-                 * Utility method to write signed 64-bit integer to stream.
-                 *
-                 * @param stream Stream.
-                 * @param val Value.
-                 */
-                static void WriteInt64(interop::InteropOutputStream* stream, int64_t val);
-
-                /**
-                 * Utility method to read signed 64-bit integer array from stream.
-                 *
-                 * @param stream Stream.
-                 * @param res Target array.
-                 * @param len Array length.
-                 */
-                static void ReadInt64Array(interop::InteropInputStream* stream, int64_t* res, const int32_t len);
-
-                /**
-                 * Utility method to write signed 64-bit integer array to stream.
-                 *
-                 * @param stream Stream.
-                 * @param val Value.
-                 * @param len Array length.
-                 */
-                static void WriteInt64Array(interop::InteropOutputStream* stream, const int64_t* val, const int32_t len);
-
-                /**
-                 * Utility method to read float from stream.
-                 *
-                 * @param stream Stream.
-                 * @return Value.
-                 */
-                static float ReadFloat(interop::InteropInputStream* stream);
-
-                /**
-                 * Utility method to write float to stream.
-                 *
-                 * @param stream Stream.
-                 * @param val Value.
-                 */
-                static void WriteFloat(interop::InteropOutputStream* stream, float val);
-
-                /**
-                 * Utility method to read float array from stream.
-                 *
-                 * @param stream Stream.
-                 * @param res Target array.
-                 * @param len Array length.
-                 */
-                static void ReadFloatArray(interop::InteropInputStream* stream, float* res, const int32_t len);
-
-                /**
-                 * Utility method to write float array to stream.
-                 *
-                 * @param stream Stream.
-                 * @param val Value.
-                 * @param len Array length.
-                 */
-                static void WriteFloatArray(interop::InteropOutputStream* stream, const float* val, const int32_t len);
-
-                /**
-                 * Utility method to read double from stream.
-                 *
-                 * @param stream Stream.
-                 * @return Value.
-                 */
-                static double ReadDouble(interop::InteropInputStream* stream);
-
-                /**
-                 * Utility method to write double to stream.
-                 *
-                 * @param stream Stream.
-                 * @param val Value.
-                 */
-                static void WriteDouble(interop::InteropOutputStream* stream, double val);
-
-                /**
-                 * Utility method to read double array from stream.
-                 *
-                 * @param stream Stream.
-                 * @param res Target array.
-                 * @param len Array length.
-                 */
-                static void ReadDoubleArray(interop::InteropInputStream* stream, double* res, const int32_t len);
-
-                /**
-                 * Utility method to write double array to stream.
-                 *
-                 * @param stream Stream.
-                 * @param val Value.
-                 * @param len Array length.
-                 */
-                static void WriteDoubleArray(interop::InteropOutputStream* stream, const double* val, const int32_t len);
-
-                /**
-                 * Utility method to read Guid from stream.
-                 *
-                 * @param stream Stream.
-                 * @param res Value.
-                 */
-                static Guid ReadGuid(interop::InteropInputStream* stream);
-
-                /**
-                 * Utility method to write Guid to stream.
-                 *
-                 * @param stream Stream.
-                 * @param val Value.
-                 */
-                static void WriteGuid(interop::InteropOutputStream* stream, const Guid val);
-
-                /**
-                 * Utility method to write string to stream.
-                 *
-                 * @param stream Stream.
-                 * @param val Value.
-                 * @param len Length.
-                 */
-                static void WriteString(interop::InteropOutputStream* stream, const char* val, const int32_t len);
-            };
-        }
-    }
-}
-
-#endif
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/core/include/ignite/impl/portable/portable_writer_impl.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/ignite/impl/portable/portable_writer_impl.h b/modules/platform/src/main/cpp/core/include/ignite/impl/portable/portable_writer_impl.h
deleted file mode 100644
index b38dc1f..0000000
--- a/modules/platform/src/main/cpp/core/include/ignite/impl/portable/portable_writer_impl.h
+++ /dev/null
@@ -1,859 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef _IGNITE_IMPL_PORTABLE_WRITER
-#define _IGNITE_IMPL_PORTABLE_WRITER
-
-#include <cstring>
-#include <string>
-#include <stdint.h>
-
-#include <ignite/common/common.h>
-#include <ignite/common/concurrent.h>
-
-#include "ignite/impl/interop/interop_output_stream.h"
-#include "ignite/impl/portable/portable_common.h"
-#include "ignite/impl/portable/portable_id_resolver.h"
-#include "ignite/impl/portable/portable_metadata_manager.h"
-#include "ignite/impl/portable/portable_utils.h"
-#include "ignite/portable/portable_consts.h"
-#include "ignite/portable/portable_type.h"
-#include "ignite/guid.h"
-
-namespace ignite
-{
-    namespace impl
-    {
-        namespace portable
-        {
-            /**
-             * Internal implementation of portable reader.
-             */
-            class IGNITE_IMPORT_EXPORT PortableWriterImpl
-            {
-            public:
-                /**
-                 * Constructor.
-                 *
-                 * @param stream Interop stream.
-                 * @param idRslvr Portable ID resolver.
-                 * @param metaMgr Metadata manager.
-                 * @param metaHnd Metadata handler.
-                 */
-                PortableWriterImpl(ignite::impl::interop::InteropOutputStream* stream, PortableIdResolver* idRslvr, 
-                    PortableMetadataManager* metaMgr, PortableMetadataHandler* metaHnd);
-                
-                /**
-                 * Constructor used to construct light-weight writer allowing only raw operations 
-                 * and primitive objects.
-                 *
-                 * @param stream Interop stream.
-                 * @param metaMgr Metadata manager.
-                 */
-                PortableWriterImpl(ignite::impl::interop::InteropOutputStream* stream, PortableMetadataManager* metaMgr);
-
-                /**
-                 * Write 8-byte signed integer. Maps to "byte" type in Java.
-                 *
-                 * @param val Value.
-                 */
-                void WriteInt8(const int8_t val);
-
-                /**
-                 * Write array of 8-byte signed integers. Maps to "byte[]" type in Java.
-                 *
-                 * @param val Array.
-                 * @param len Array length.
-                 */
-                void WriteInt8Array(const int8_t* val, const int32_t len);
-
-                /**
-                 * Write 8-byte signed integer. Maps to "byte" type in Java.
-                 *
-                 * @param fieldName Field name.
-                 * @param val Value.
-                 */
-                void WriteInt8(const char* fieldName, const int8_t val);
-
-                /**
-                 * Write array of 8-byte signed integers. Maps to "byte[]" type in Java.
-                 *
-                 * @param fieldName Field name.
-                 * @param val Array.
-                 * @param len Array length.
-                 */
-                void WriteInt8Array(const char* fieldName, const int8_t* val, const int32_t len);
-
-                /**
-                 * Write bool. Maps to "short" type in Java.
-                 *
-                 * @param val Value.
-                 */
-                void WriteBool(const bool val);
-
-                /**
-                 * Write array of bools. Maps to "bool[]" type in Java.
-                 *
-                 * @param val Array.
-                 * @param len Array length.
-                 */
-                void WriteBoolArray(const bool* val, const int32_t len);
-
-                /**
-                 * Write bool. Maps to "short" type in Java.
-                 *
-                 * @param fieldName Field name.
-                 * @param val Value.
-                 */
-                void WriteBool(const char* fieldName, const bool val);
-
-                /**
-                 * Write array of bools. Maps to "bool[]" type in Java.
-                 *
-                 * @param fieldName Field name.
-                 * @param val Array.
-                 * @param len Array length.
-                 */
-                void WriteBoolArray(const char* fieldName, const bool* val, const int32_t len);
-
-                /**
-                 * Write 16-byte signed integer. Maps to "short" type in Java.
-                 *
-                 * @param val Value.
-                 */
-                void WriteInt16(const int16_t val);
-
-                /**
-                 * Write array of 16-byte signed integers. Maps to "short[]" type in Java.
-                 *
-                 * @param val Array.
-                 * @param len Array length.
-                 */
-                void WriteInt16Array(const int16_t* val, const int32_t len);
-
-                /**
-                 * Write 16-byte signed integer. Maps to "short" type in Java.
-                 *
-                 * @param fieldName Field name.
-                 * @param val Value.
-                 */
-                void WriteInt16(const char* fieldName, const int16_t val);
-
-                /**
-                 * Write array of 16-byte signed integers. Maps to "short[]" type in Java.
-                 *
-                 * @param fieldName Field name.
-                 * @param val Array.
-                 * @param len Array length.
-                 */
-                void WriteInt16Array(const char* fieldName, const int16_t* val, const int32_t len);
-
-                /**
-                 * Write 16-byte unsigned integer. Maps to "char" type in Java.
-                 *
-                 * @param val Value.
-                 */
-                void WriteUInt16(const uint16_t val);
-
-                /**
-                 * Write array of 16-byte unsigned integers. Maps to "char[]" type in Java.
-                 *
-                 * @param val Array.
-                 * @param len Array length.
-                 */
-                void WriteUInt16Array(const uint16_t* val, const int32_t len);
-
-                /**
-                 * Write 16-byte unsigned integer. Maps to "char" type in Java.
-                 *
-                 * @param fieldName Field name.
-                 * @param val Value.
-                 */
-                void WriteUInt16(const char* fieldName, const uint16_t val);
-
-                /**
-                 * Write array of 16-byte unsigned integers. Maps to "char[]" type in Java.
-                 *
-                 * @param fieldName Field name.
-                 * @param val Array.
-                 * @param len Array length.
-                 */
-                void WriteUInt16Array(const char* fieldName, const uint16_t* val, const int32_t len);
-
-                /**
-                 * Write 32-byte signed integer. Maps to "int" type in Java.
-                 *
-                 * @param val Value.
-                 */
-                void WriteInt32(const int32_t val);
-
-                /**
-                 * Write array of 32-byte signed integers. Maps to "int[]" type in Java.
-                 *
-                 * @param val Array.
-                 * @param len Array length.
-                 */
-                void WriteInt32Array(const int32_t* val, const int32_t len);
-
-                /**
-                 * Write 32-byte signed integer. Maps to "int" type in Java.
-                 *
-                 * @param fieldName Field name.
-                 * @param val Value.
-                 */
-                void WriteInt32(const char* fieldName, const int32_t val);
-
-                /**
-                 * Write array of 32-byte signed integers. Maps to "int[]" type in Java.
-                 *
-                 * @param fieldName Field name.
-                 * @param val Array.
-                 * @param len Array length.
-                 */
-                void WriteInt32Array(const char* fieldName, const int32_t* val, const int32_t len);
-
-                /**
-                 * Write 64-byte signed integer. Maps to "long" type in Java.
-                 *
-                 * @param val Value.
-                 */
-                void WriteInt64(const int64_t val);
-
-                /**
-                 * Write array of 64-byte signed integers. Maps to "long[]" type in Java.
-                 *
-                 * @param val Array.
-                 * @param len Array length.
-                 */
-                void WriteInt64Array(const int64_t* val, const int32_t len);
-
-                /**
-                 * Write 64-byte signed integer. Maps to "long" type in Java.
-                 *
-                 * @param fieldName Field name.
-                 * @param val Value.
-                 */
-                void WriteInt64(const char* fieldName, const int64_t val);
-
-                /**
-                 * Write array of 64-byte signed integers. Maps to "long[]" type in Java.
-                 *
-                 * @param fieldName Field name.
-                 * @param val Array.
-                 * @param len Array length.
-                 */
-                void WriteInt64Array(const char* fieldName, const int64_t* val, const int32_t len);
-
-                /**
-                 * Write float. Maps to "float" type in Java.
-                 *
-                 * @param val Value.
-                 */
-                void WriteFloat(const float val);
-
-                /**
-                 * Write array of floats. Maps to "float[]" type in Java.
-                 *
-                 * @param val Array.
-                 * @param len Array length.
-                 */
-                void WriteFloatArray(const float* val, const int32_t len);
-
-                /**
-                 * Write float. Maps to "float" type in Java.
-                 *
-                 * @param fieldName Field name.
-                 * @param val Value.
-                 */
-                void WriteFloat(const char* fieldName, const float val);
-
-                /**
-                 * Write array of floats. Maps to "float[]" type in Java.
-                 *
-                 * @param fieldName Field name.
-                 * @param val Array.
-                 * @param len Array length.
-                 */
-                void WriteFloatArray(const char* fieldName, const float* val, const int32_t len);
-
-                /**
-                 * Write double. Maps to "double" type in Java.
-                 *
-                 * @param val Value.
-                 */
-                void WriteDouble(const double val);
-
-                /**
-                 * Write array of doubles. Maps to "double[]" type in Java.
-                 *
-                 * @param val Array.
-                 * @param len Array length.
-                 */
-                void WriteDoubleArray(const double* val, const int32_t len);
-
-                /**
-                 * Write double. Maps to "double" type in Java.
-                 *
-                 * @param fieldName Field name.
-                 * @param val Value.
-                 */
-                void WriteDouble(const char* fieldName, const double val);
-
-                /**
-                 * Write array of doubles. Maps to "double[]" type in Java.
-                 *
-                 * @param fieldName Field name.
-                 * @param val Array.
-                 * @param len Array length.
-                 */
-                void WriteDoubleArray(const char* fieldName, const double* val, const int32_t len);
-
-                /**
-                 * Write Guid. Maps to "UUID" type in Java.
-                 *
-                 * @param val Value.
-                 */
-                void WriteGuid(const Guid val);
-
-                /**
-                 * Write array of Guids. Maps to "UUID[]" type in Java.
-                 *
-                 * @param val Array.
-                 * @param len Array length.
-                 */
-                void WriteGuidArray(const Guid* val, const int32_t len);
-
-                /**
-                 * Write Guid. Maps to "UUID" type in Java.
-                 *
-                 * @param fieldName Field name.
-                 * @param val Value.
-                 */
-                void WriteGuid(const char* fieldName, const Guid val);
-
-                /**
-                 * Write array of Guids. Maps to "UUID[]" type in Java.
-                 *
-                 * @param fieldName Field name.
-                 * @param val Array.
-                 * @param len Array length.
-                 */
-                void WriteGuidArray(const char* fieldName, const Guid* val, const int32_t len);
-
-                /**
-                 * Write string.
-                 *
-                 * @param val String.
-                 * @param len String length (characters).
-                 */
-                void WriteString(const char* val, const int32_t len);
-
-                /**
-                 * Write string.
-                 *
-                 * @param fieldName Field name.
-                 * @param val String.
-                 * @param len String length (characters).
-                 */
-                void WriteString(const char* fieldName, const char* val, const int32_t len);
-
-                /**
-                 * Start string array write.
-                 *
-                 * @param typ Collection type.
-                 * @return Session ID.
-                 */
-                int32_t WriteStringArray();
-
-                /**
-                 * Start string array write.
-                 *
-                 * @param fieldName Field name.
-                 * @return Session ID.
-                 */
-                int32_t WriteStringArray(const char* fieldName);
-
-                /**
-                 * Write string element.
-                 *
-                 * @param id Session ID.
-                 * @param val Value.
-                 * @param len Length.
-                 */
-                void WriteStringElement(int32_t id, const char* val, int32_t len);
-
-                /**
-                 * Write NULL value.
-                 */
-                void WriteNull();
-
-                /**
-                 * Write NULL value.
-                 *
-                 * @param fieldName Field name.
-                 */
-                void WriteNull(const char* fieldName);
-
-                /**
-                 * Start array write.
-                 *
-                 * @param typ Collection type.
-                 * @return Session ID.
-                 */
-                int32_t WriteArray();
-
-                /**
-                 * Start array write.
-                 *
-                 * @param fieldName Field name.
-                 * @return Session ID.
-                 */
-                int32_t WriteArray(const char* fieldName);
-                                
-                /**
-                 * Start collection write.
-                 *
-                 * @param typ Collection type.
-                 * @return Session ID.
-                 */
-                int32_t WriteCollection(ignite::portable::CollectionType typ);
-
-                /**
-                 * Start collection write.
-                 *
-                 * @param fieldName Field name.
-                 * @param typ Collection type.
-                 * @return Session ID.
-                 */
-                int32_t WriteCollection(const char* fieldName, ignite::portable::CollectionType typ);
-                
-                /**
-                 * Start map write.
-                 *
-                 * @param typ Map type.
-                 * @return Session ID.
-                 */
-                int32_t WriteMap(ignite::portable::MapType typ);
-
-                /**
-                 * Start map write.
-                 *
-                 * @param fieldName Field name.
-                 * @param typ Map type.
-                 * @return Session ID.
-                 */
-                int32_t WriteMap(const char* fieldName, ignite::portable::MapType typ);
-
-                /**
-                 * Write collection element.
-                 *
-                 * @param id Session ID.
-                 * @param val Value.
-                 */
-                template<typename T>
-                void WriteElement(int32_t id, T val)
-                {
-                    CheckSession(id);
-                                        
-                    WriteTopObject<T>(val);
-
-                    elemCnt++;
-                }
-
-                /**
-                 * Write map element.
-                 *
-                 * @param id Session ID.
-                 * @param key Key.
-                 * @param val Value.
-                 */
-                template<typename K, typename V>
-                void WriteElement(int32_t id, K key, V val)
-                {
-                    CheckSession(id);
-                    
-                    WriteTopObject<K>(key);
-                    WriteTopObject<V>(val);
-
-                    elemCnt++;
-                }
-
-                /**
-                 * Commit container write session.
-                 *
-                 * @param id Session ID.
-                 */
-                void CommitContainer(int32_t id);                
-
-                /**
-                 * Write object.
-                 *
-                 * @param val Object.
-                 */
-                template<typename T>
-                void WriteObject(T val)
-                {
-                    CheckRawMode(true);
-
-                    WriteTopObject(val);
-                }
-
-                /**
-                 * Write object.
-                 *
-                 * @param fieldName Field name.
-                 * @param val Object.
-                 */
-                template<typename T>
-                void WriteObject(const char* fieldName, T val)
-                {
-                    CheckRawMode(false); 
-                        
-                    // 1. Write field ID.
-                    WriteFieldId(fieldName, IGNITE_TYPE_OBJECT);
-
-                    // 2. Preserve space for length.
-                    int32_t lenPos = stream->Position();
-                    stream->Position(lenPos + 4);
-
-                    // 3. Actual write.
-                    WriteTopObject(val);
-
-                    // 4. Write field length.
-                    int32_t len = stream->Position() - lenPos - 4;
-                    stream->WriteInt32(lenPos, len);
-                }
-
-                /**
-                 * Set raw mode.
-                 */
-                void SetRawMode();
-
-                /**
-                 * Get raw position.
-                 */
-                int32_t GetRawPosition();
-
-                /**
-                 * Write object.
-                 *
-                 * @param obj Object to write.
-                 */
-                template<typename T>
-                void WriteTopObject(const T& obj)
-                {
-                    ignite::portable::PortableType<T> type;
-
-                    if (type.IsNull(obj))
-                        stream->WriteInt8(IGNITE_HDR_NULL);
-                    else
-                    {
-                        TemplatedPortableIdResolver<T> idRslvr(type);
-                        ignite::common::concurrent::SharedPointer<PortableMetadataHandler> metaHnd;
-
-                        if (metaMgr)                        
-                            metaHnd = metaMgr->GetHandler(idRslvr.GetTypeId());
-
-                        PortableWriterImpl writerImpl(stream, &idRslvr, metaMgr, metaHnd.Get());
-                        ignite::portable::PortableWriter writer(&writerImpl);
-
-                        int32_t pos = stream->Position();
-
-                        stream->WriteInt8(IGNITE_HDR_FULL);
-                        stream->WriteBool(true);
-                        stream->WriteInt32(idRslvr.GetTypeId());
-                        stream->WriteInt32(type.GetHashCode(obj));
-
-                        stream->Position(pos + IGNITE_FULL_HDR_LEN);
-
-                        type.Write(writer, obj);
-
-                        int32_t len = stream->Position() - pos;
-
-                        stream->WriteInt32(pos + 10, len);
-                        stream->WriteInt32(pos + 14, writerImpl.GetRawPosition() - pos);
-
-                        if (metaMgr)
-                            metaMgr->SubmitHandler(type.GetTypeName(), idRslvr.GetTypeId(), metaHnd.Get());
-                    }
-                }
-
-                /**
-                 * Get underlying stream.
-                 *
-                 * @return Stream.
-                 */
-                impl::interop::InteropOutputStream* GetStream();
-            private:
-                /** Underlying stream. */
-                ignite::impl::interop::InteropOutputStream* stream; 
-                
-                /** ID resolver. */
-                PortableIdResolver* idRslvr;                     
-                
-                /** Metadata manager. */
-                PortableMetadataManager* metaMgr;                   
-                
-                /** Metadata handler. */
-                PortableMetadataHandler* metaHnd;                  
-
-                /** Type ID. */
-                int32_t typeId;                                       
-
-                /** Elements write session ID generator. */
-                int32_t elemIdGen;                                   
-                
-                /** Elements write session ID. */
-                int32_t elemId;                                       
-                
-                /** Elements count. */
-                int32_t elemCnt;                                      
-                
-                /** Elements start position. */
-                int32_t elemPos;                                      
-
-                /** Raw data offset. */
-                int32_t rawPos;                                       
-
-                IGNITE_NO_COPY_ASSIGNMENT(PortableWriterImpl)
-
-                /**
-                 * Write a primitive value to stream in raw mode.
-                 *
-                 * @param val Value.
-                 * @param func Stream function.
-                 */
-                template<typename T>
-                void WritePrimitiveRaw(
-                    const T val, 
-                    void(*func)(interop::InteropOutputStream*, T)
-                )
-                {
-                    CheckRawMode(true);
-                    CheckSingleMode(true);
-
-                    func(stream, val);
-                }
-
-                /**
-                 * Write a primitive array to stream in raw mode.
-                 *
-                 * @param val Value.
-                 * @param len Array length.
-                 * @param func Stream function.
-                 * @param hdr Header.
-                 */
-                template<typename T>
-                void WritePrimitiveArrayRaw(
-                    const T* val,
-                    const int32_t len,
-                    void(*func)(interop::InteropOutputStream*, const T*, const int32_t),
-                    const int8_t hdr
-                )
-                {
-                    CheckRawMode(true);
-                    CheckSingleMode(true);
-
-                    if (val)
-                    {
-                        stream->WriteInt8(hdr);
-                        stream->WriteInt32(len);
-                        func(stream, val, len);
-                    }
-                    else
-                        stream->WriteInt8(IGNITE_HDR_NULL);
-                }
-
-                /**
-                 * Write a primitive value to stream.
-                 *
-                 * @param fieldName Field name.
-                 * @param val Value.
-                 * @param func Stream function.
-                 * @param typ Field type ID.
-                 * @param len Field length.
-                 */
-                template<typename T>
-                void WritePrimitive(
-                    const char* fieldName, 
-                    const T val, 
-                    void(*func)(interop::InteropOutputStream*, T), 
-                    const int8_t typ, 
-                    const int32_t len
-                )
-                {
-                    CheckRawMode(false);
-                    CheckSingleMode(true);
-
-                    WriteFieldId(fieldName, typ);
-
-                    stream->WriteInt32(1 + len);
-                    stream->WriteInt8(typ);
-
-                    func(stream, val);
-                }
-
-                /**
-                 * Write a primitive array to stream.
-                 *
-                 * @param fieldName Field name.
-                 * @param val Value.
-                 * @param len Array length.
-                 * @param func Stream function.
-                 * @param hdr Header.
-                 * @param lenShift Length shift.
-                 */
-                template<typename T>
-                void WritePrimitiveArray(
-                    const char* fieldName, 
-                    const T* val, 
-                    const int32_t len, 
-                    void(*func)(interop::InteropOutputStream*, const T*, const int32_t), 
-                    const int8_t hdr, 
-                    const int32_t lenShift
-                )
-                {
-                    CheckRawMode(false);
-                    CheckSingleMode(true);
-
-                    WriteFieldId(fieldName, hdr);
-
-                    if (val)
-                    {
-                        stream->WriteInt32(5 + (len << lenShift));
-                        stream->WriteInt8(hdr);
-                        stream->WriteInt32(len);
-                        func(stream, val, len);
-                    }
-                    else
-                    {
-                        stream->WriteInt32(1);
-                        stream->WriteInt8(IGNITE_HDR_NULL);
-                    }
-                }
-
-                /**
-                 * Check raw mode.
-                 *
-                 * @param expected Expected raw mode of the reader.
-                 */
-                void CheckRawMode(bool expected);
-
-                /**
-                 * Check whether writer is currently operating in single mode.
-                 *
-                 * @param expected Expected value.
-                 */
-                void CheckSingleMode(bool expected);
-
-                /**
-                 * Start new container writer session.
-                 *
-                 * @param expRawMode Expected raw mode.
-                 */
-                void StartContainerSession(bool expRawMode);
-
-                /**
-                 * Check whether session ID matches.
-                 *
-                 * @param ses Expected session ID.
-                 */
-                void CheckSession(int32_t expSes);
-
-                /**
-                 * Write field ID.
-                 *
-                 * @param fieldName Field name.
-                 * @param fieldTypeId Field type ID.
-                 */
-                void WriteFieldId(const char* fieldName, int32_t fieldTypeId);
-
-                /**
-                 * Write field ID and skip field length.
-                 *
-                 * @param fieldName Field name.
-                 * @param fieldTypeId Field type ID.
-                 */
-                void WriteFieldIdSkipLength(const char* fieldName, int32_t fieldTypeId);
-
-                /**
-                 * Write field ID and length.
-                 *
-                 * @param fieldName Field name.
-                 * @param fieldTypeId Field type ID.
-                 * @param len Length.
-                 */
-                void WriteFieldIdAndLength(const char* fieldName, int32_t fieldTypeId, int32_t len);
-
-                /**
-                 * Write primitive value.
-                 *
-                 * @param obj Value.
-                 * @param func Stream function.
-                 * @param hdr Header.
-                 */
-                template<typename T>
-                void WriteTopObject0(const T obj, void(*func)(impl::interop::InteropOutputStream*, T), const int8_t hdr)
-                {
-                    stream->WriteInt8(hdr);
-                    func(stream, obj);
-                }
-            };
-
-            template<>
-            void IGNITE_IMPORT_EXPORT PortableWriterImpl::WriteTopObject(const int8_t& obj);
-
-            template<>
-            void IGNITE_IMPORT_EXPORT PortableWriterImpl::WriteTopObject(const bool& obj);
-
-            template<>
-            void IGNITE_IMPORT_EXPORT PortableWriterImpl::WriteTopObject(const int16_t& obj);
-
-            template<>
-            void IGNITE_IMPORT_EXPORT PortableWriterImpl::WriteTopObject(const uint16_t& obj);
-
-            template<>
-            void IGNITE_IMPORT_EXPORT PortableWriterImpl::WriteTopObject(const int32_t& obj);
-
-            template<>
-            void IGNITE_IMPORT_EXPORT PortableWriterImpl::WriteTopObject(const int64_t& obj);
-
-            template<>
-            void IGNITE_IMPORT_EXPORT PortableWriterImpl::WriteTopObject(const float& obj);
-
-            template<>
-            void IGNITE_IMPORT_EXPORT PortableWriterImpl::WriteTopObject(const double& obj);
-
-            template<>
-            void IGNITE_IMPORT_EXPORT PortableWriterImpl::WriteTopObject(const Guid& obj);
-
-            template<>
-            inline void IGNITE_IMPORT_EXPORT PortableWriterImpl::WriteTopObject(const std::string& obj)
-            {
-                const char* obj0 = obj.c_str();
-
-                int32_t len = static_cast<int32_t>(strlen(obj0));
-
-                stream->WriteInt8(IGNITE_TYPE_STRING);
-
-                PortableUtils::WriteString(stream, obj0, len);
-            }
-        }
-    }
-}
-
-#endif
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/core/include/ignite/portable/portable.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/ignite/portable/portable.h b/modules/platform/src/main/cpp/core/include/ignite/portable/portable.h
deleted file mode 100644
index 1a7c3dd..0000000
--- a/modules/platform/src/main/cpp/core/include/ignite/portable/portable.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef _IGNITE_PORTABLE
-#define _IGNITE_PORTABLE
-
-#include "ignite/portable/portable_consts.h"
-#include "ignite/portable/portable_containers.h"
-#include "ignite/portable/portable_type.h"
-#include "ignite/portable/portable_raw_reader.h"
-#include "ignite/portable/portable_raw_writer.h"
-#include "ignite/portable/portable_reader.h"
-#include "ignite/portable/portable_writer.h"
-
-#endif
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/core/include/ignite/portable/portable_consts.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/ignite/portable/portable_consts.h b/modules/platform/src/main/cpp/core/include/ignite/portable/portable_consts.h
deleted file mode 100644
index ef6db45..0000000
--- a/modules/platform/src/main/cpp/core/include/ignite/portable/portable_consts.h
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef _IGNITE_PORTABLE_CONSTS
-#define _IGNITE_PORTABLE_CONSTS
-
-#include <ignite/common/common.h>
-
-namespace ignite 
-{
-    namespace portable 
-    {
-        /**
-         * Portable collection types.
-         */
-        enum CollectionType 
-        {
-            /** 
-             * Undefined. Maps to ArrayList in Java.
-             */
-            IGNITE_COLLECTION_UNDEFINED = 0,
-
-            /** 
-             * Array list. Maps to ArrayList in Java.
-             */
-            IGNITE_COLLECTION_ARRAY_LIST = 1,
-            
-            /**
-             * Linked list. Maps to LinkedList in Java.
-             */
-            IGNITE_COLLECTION_LINKED_LIST = 2,
-            
-            /**
-             * Hash set. Maps to HashSet in Java.
-             */
-            IGNITE_COLLECTION_HASH_SET = 3,
-            
-            /**
-             * Linked hash set. Maps to LinkedHashSet in Java.
-             */
-            IGNITE_COLLECTION_LINKED_HASH_SET = 4,
-
-            /**
-             * Tree set. Maps to TreeSet in Java.
-             */
-            IGNITE_COLLECTION_TREE_SET = 5,
-
-            /**
-             * Concurrent skip list set. Maps to ConcurrentSkipListSet in Java.
-             */
-            IGNITE_COLLECTION_CONCURRENT_SKIP_LIST_SET = 6
-        };
-
-        /**
-         * Portable map types.
-         */
-        enum MapType 
-        {
-            /**
-             * Undefined. Maps to HashMap in Java.
-             */
-            IGNITE_MAP_UNDEFINED = 0,
-            
-            /**
-             * Hash map. Maps to HashMap in Java.
-             */
-            IGNITE_MAP_HASH_MAP = 1,
-            
-            /**
-             * Linked hash map. Maps to LinkedHashMap in Java.
-             */
-            IGNITE_MAP_LINKED_HASH_MAP = 2,
-
-            /**
-             * Tree map. Maps to TreeMap in Java.
-             */
-            IGNITE_MAP_TREE_MAP = 3,
-            
-            /**
-             * Concurrent hash map. Maps to ConcurrentHashMap in Java.
-             */
-            IGNITE_MAP_CONCURRENT_HASH_MAP = 4,
-            
-            /**
-             * Properties map. Maps to Properties in Java.
-             */
-            IGNITE_MAP_PROPERTIES_MAP = 5
-        };
-    }
-}
-
-#endif
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/core/include/ignite/portable/portable_containers.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/ignite/portable/portable_containers.h b/modules/platform/src/main/cpp/core/include/ignite/portable/portable_containers.h
deleted file mode 100644
index f93a11a..0000000
--- a/modules/platform/src/main/cpp/core/include/ignite/portable/portable_containers.h
+++ /dev/null
@@ -1,525 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef _IGNITE_PORTABLE_CONTAINERS
-#define _IGNITE_PORTABLE_CONTAINERS
-
-#include <stdint.h>
-
-#include "ignite/impl/portable/portable_writer_impl.h"
-#include "ignite/impl/portable/portable_reader_impl.h"
-#include "ignite/impl/utils.h"
-#include "ignite/portable/portable_consts.h"
-
-namespace ignite
-{
-    namespace portable
-    {
-        /**
-         * Portable string array writer.
-         */
-        class IGNITE_IMPORT_EXPORT PortableStringArrayWriter
-        {
-        public:
-            /**
-             * Constructor.
-             * 
-             * @param id Identifier.
-             * @param impl Writer.
-             */
-            PortableStringArrayWriter(impl::portable::PortableWriterImpl* impl, const int32_t id);
-
-            /**
-             * Write string.
-             *
-             * @param val Null-terminated character sequence.
-             */
-            void Write(const char* val);
-
-            /**
-             * Write string.
-             *
-             * @param val String.
-             * @param len String length (characters).
-             */
-            void Write(const char* val, const int32_t len);
-
-            /**
-             * Write string.
-             *
-             * @param val String.
-             */
-            void Write(const std::string& val)
-            {
-                Write(val.c_str());
-            }
-
-            /**
-             * Close the writer.
-             */
-            void Close();
-        private:
-            /** Implementation delegate. */
-            impl::portable::PortableWriterImpl* impl; 
-
-            /** Idnetifier. */
-            const int32_t id;    
-        };
-
-        /**
-         * Portable collection writer.
-         */
-        template<typename T>
-        class IGNITE_IMPORT_EXPORT PortableArrayWriter
-        {
-        public:
-            /**
-             * Constructor.
-             *
-             * @param impl Writer.
-             * @param id Identifier.
-             */
-            PortableArrayWriter(impl::portable::PortableWriterImpl* impl, const int32_t id) : impl(impl), id(id)
-            {
-                // No-op.
-            }
-
-            /**
-             * Write a value.
-             *
-             * @param val Value.
-             */
-            void Write(const T& val)
-            {
-                impl->WriteElement<T>(id, val);
-            }
-
-            /**
-             * Close the writer.
-             */
-            void Close()
-            {
-                impl->CommitContainer(id);
-            }
-        private:
-            /** Implementation delegate. */
-            impl::portable::PortableWriterImpl* impl; 
-
-            /** Idnetifier. */
-            const int32_t id;      
-        };
-
-        /**
-         * Portable collection writer.
-         */
-        template<typename T>
-        class IGNITE_IMPORT_EXPORT PortableCollectionWriter
-        {
-        public:
-            /**
-             * Constructor.
-             *
-             * @param impl Writer.
-             * @param id Identifier.
-             */
-            PortableCollectionWriter(impl::portable::PortableWriterImpl* impl, const int32_t id) : impl(impl), id(id)
-            {
-                // No-op.
-            }
-
-            /**
-             * Write a value.
-             *
-             * @param val Value.
-             */
-            void Write(const T& val)
-            {
-                impl->WriteElement<T>(id, val);
-            }
-
-            /**
-             * Close the writer.
-             */
-            void Close()
-            {
-                impl->CommitContainer(id);
-            }
-        private:
-            /** Implementation delegate. */
-            impl::portable::PortableWriterImpl* impl; 
-
-            /** Identifier. */
-            const int32_t id;    
-        };
-
-        /**
-         * Portable map writer.
-         */
-        template<typename K, typename V>
-        class IGNITE_IMPORT_EXPORT PortableMapWriter
-        {
-        public:
-            /**
-             * Constructor.
-             *
-             * @param impl Writer.
-             */
-            PortableMapWriter(impl::portable::PortableWriterImpl* impl, const int32_t id) : impl(impl), id(id)
-            {
-                // No-op.
-            }
-
-            /**
-             * Write a value.
-             *
-             * @param key Key.
-             * @param val Value.
-             */
-            void Write(const K& key, const V& val)
-            {
-                impl->WriteElement<K, V>(id, key, val);
-            }
-
-            /**
-             * Close the writer.
-             */
-            void Close()
-            {
-                impl->CommitContainer(id);
-            }
-        private:
-            /** Implementation delegate. */
-            impl::portable::PortableWriterImpl* impl; 
-
-            /** Identifier. */
-            const int32_t id;      
-        };
-
-        /**
-         * Portable string array reader.
-         */
-        class IGNITE_IMPORT_EXPORT PortableStringArrayReader
-        {
-        public:
-            /**
-             * Constructor.
-             *
-             * @param impl Reader.
-             * @param id Identifier.
-             * @param size Array size.
-             */
-            PortableStringArrayReader(impl::portable::PortableReaderImpl* impl, const int32_t id, const int32_t size);
-
-            /**
-             * Check whether next element is available for read.
-             *
-             * @return True if available.
-             */
-            bool HasNext();
-
-            /**
-             * Get next element.
-             *
-             * @param res Array to store data to. 
-             * @param len Expected length of string. NULL terminator will be set in case len is 
-             *     greater than real string length.
-             * @return Actual amount of elements read. If "len" argument is less than actual
-             *     array size or resulting array is set to null, nothing will be written
-             *     to resulting array and returned value will contain required array length.
-             *     -1 will be returned in case array in stream was null.
-             */
-            int32_t GetNext(char* res, const int32_t len);
-
-            /**
-             * Get next element.
-             *
-             * @return String. 
-             */
-            std::string GetNext()
-            {
-                int32_t len = GetNext(NULL, 0);
-
-                if (len != -1)
-                {
-                    impl::utils::SafeArray<char> arr(len + 1);
-
-                    GetNext(arr.target, len + 1);
-
-                    return std::string(arr.target);
-                }
-                else
-                    return std::string();
-            }
-
-            /**
-             * Get array size.
-             *
-             * @return Size or -1 if array is NULL.
-             */
-            int32_t GetSize();
-
-            /**
-             * Whether array is NULL.
-             */
-            bool IsNull();
-        private:
-            /** Implementation delegate. */
-            impl::portable::PortableReaderImpl* impl;  
-
-            /** Identifier. */
-            const int32_t id;    
-
-            /** Size. */
-            const int32_t size;                              
-        };
-
-        /**
-         * Portable array reader.
-         */
-        template<typename T>
-        class PortableArrayReader
-        {
-        public:
-            /**
-             * Constructor.
-             *
-             * @param impl Reader.
-             * @param id Identifier.
-             * @param size Array size.
-             */
-            PortableArrayReader(impl::portable::PortableReaderImpl* impl, const int32_t id, const int32_t size) : 
-                impl(impl), id(id), size(size)
-            {
-                // No-op.
-            }
-
-            /**
-             * Check whether next element is available for read.
-             *
-             * @return True if available.
-             */
-            bool HasNext()
-            {
-                return impl->HasNextElement(id);
-            }
-
-            /**
-             * Read next element.
-             *
-             * @return Next element.
-             */
-            T GetNext()
-            {
-                return impl->ReadElement<T>(id);
-            }
-
-            /**
-             * Get array size.
-             *
-             * @return Size or -1 if array is NULL.
-             */
-            int32_t GetSize()
-            {
-                return size;
-            }
-
-            /**
-             * Whether array is NULL.
-             */
-            bool IsNull()
-            {
-                return size == -1;
-            }
-        private:
-            /** Implementation delegate. */
-            impl::portable::PortableReaderImpl* impl;
-
-            /** Identifier. */
-            const int32_t id;
-
-            /** Size. */
-            const int32_t size;
-        };
-
-        /**
-         * Portable collection reader.
-         */
-        template<typename T>
-        class PortableCollectionReader
-        {
-        public:
-            /**
-             * Constructor.
-             *
-             * @param impl Reader.
-             * @param id Identifier.
-             * @param type Collection type.
-             * @param size Collection size.
-             */
-            PortableCollectionReader(impl::portable::PortableReaderImpl* impl, const int32_t id, 
-                const CollectionType type,  const int32_t size) : impl(impl), id(id), type(type), size(size)
-            {
-                // No-op.
-            }
-
-            /**
-             * Check whether next element is available for read.
-             *
-             * @return True if available.
-             */
-            bool HasNext()
-            {
-                return impl->HasNextElement(id);
-            }
-
-            /**
-             * Read next element.
-             *
-             * @return Next element.
-             */
-            T GetNext()
-            {
-                return impl->ReadElement<T>(id);
-            }
-            
-            /**
-             * Get collection type.
-             *
-             * @return Type.
-             */
-            CollectionType GetType()
-            {
-                return type;
-            }
-
-            /**
-             * Get collection size.
-             *
-             * @return Size or -1 if collection is NULL.
-             */
-            int32_t GetSize()
-            {
-                return size;
-            }
-
-            /**
-             * Whether collection is NULL.
-             */
-            bool IsNull()
-            {
-                return size == -1;
-            }
-        private:
-            /** Implementation delegate. */
-            impl::portable::PortableReaderImpl* impl;  
-
-            /** Identifier. */
-            const int32_t id;     
-            
-            /** Collection type. */
-            const CollectionType type;  
-
-            /** Size. */
-            const int32_t size;                              
-        };    
-
-        /**
-         * Portable map reader.
-         */
-        template<typename K, typename V>
-        class PortableMapReader
-        {
-        public:
-            /**
-             * Constructor.
-             *
-             * @param impl Reader.
-             * @param id Identifier.
-             * @param type Map type.
-             * @param size Map size.
-            */
-            PortableMapReader(impl::portable::PortableReaderImpl* impl, const int32_t id, const MapType type,
-                const int32_t size) : impl(impl), id(id), type(type), size(size)
-            {
-                // No-op.
-            }
-
-            /**
-             * Check whether next element is available for read.
-             *
-             * @return True if available.
-             */
-            bool HasNext()
-            {
-                return impl->HasNextElement(id);
-            }
-
-            /**
-             * Read next element.
-             *
-             * @param key Key.
-             * @param val Value.
-             */
-            void GetNext(K* key, V* val)
-            {
-                return impl->ReadElement<K, V>(id, key, val);
-            }
-
-            /**
-             * Get map type.
-             *
-             * @return Type.
-             */
-            MapType GetType()
-            {
-                return type;
-            }
-
-            /**
-             * Get map size.
-             *
-             * @return Size or -1 if map is NULL.
-             */
-            int32_t GetSize()
-            {
-                return size;
-            }
-
-            /**
-             * Whether map is NULL.
-             */
-            bool IsNull()
-            {
-                return size == -1;
-            }
-        private:
-            /** Implementation delegate. */
-            impl::portable::PortableReaderImpl* impl;  
-
-            /** Identifier. */
-            const int32_t id;     
-
-            /** Map type. */
-            const MapType type;
-
-            /** Size. */
-            const int32_t size;
-        };
-    }
-}
-
-#endif
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/core/include/ignite/portable/portable_raw_reader.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/ignite/portable/portable_raw_reader.h b/modules/platform/src/main/cpp/core/include/ignite/portable/portable_raw_reader.h
deleted file mode 100644
index 9f1d74c..0000000
--- a/modules/platform/src/main/cpp/core/include/ignite/portable/portable_raw_reader.h
+++ /dev/null
@@ -1,324 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef _IGNITE_PORTABLE_RAW_READER
-#define _IGNITE_PORTABLE_RAW_READER
-
-#include <stdint.h>
-#include <string>
-
-#include <ignite/common/common.h>
-
-#include "ignite/impl/portable/portable_reader_impl.h"
-#include "ignite/portable/portable_consts.h"
-#include "ignite/portable/portable_containers.h"
-#include "ignite/guid.h"
-
-namespace ignite
-{    
-    namespace portable
-    {
-        /**
-         * Portable raw reader.
-         */
-        class IGNITE_IMPORT_EXPORT PortableRawReader
-        {
-        public:
-            /**
-             * Constructor.
-             *
-             * @param impl Implementation.
-             */
-            PortableRawReader(ignite::impl::portable::PortableReaderImpl* impl);
-                        
-            /**
-             * Read 8-byte signed integer. Maps to "byte" type in Java.
-             *
-             * @return Result.
-             */
-            int8_t ReadInt8();
-
-            /**
-             * Read array of 8-byte signed integers. Maps to "byte[]" type in Java.
-             *
-             * @param res Array to store data to.
-             * @param len Expected length of array.             
-             * @return Actual amount of elements read. If "len" argument is less than actual
-             *     array size or resulting array is set to null, nothing will be written 
-             *     to resulting array and returned value will contain required array length.
-             *     -1 will be returned in case array in stream was null.
-             */
-            int32_t ReadInt8Array(int8_t* res, const int32_t len);
-
-            /**
-             * Read bool. Maps to "boolean" type in Java.
-             *
-             * @return Result.
-             */
-            bool ReadBool();
-
-            /**
-             * Read array of bools. Maps to "boolean[]" type in Java.
-             *
-             * @param res Array to store data to.
-             * @param len Expected length of array.             
-             * @return Actual amount of elements read. If "len" argument is less than actual
-             *     array size or resulting array is set to null, nothing will be written
-             *     to resulting array and returned value will contain required array length.
-             *     -1 will be returned in case array in stream was null.
-             */
-            int32_t ReadBoolArray(bool* res, const int32_t len);
-            
-            /**
-             * Read 16-byte signed integer. Maps to "short" type in Java.
-             *
-             * @return Result.
-             */
-            int16_t ReadInt16();
-
-            /**
-             * Read array of 16-byte signed integers. Maps to "short[]" type in Java.
-             *
-             * @param res Array to store data to.
-             * @param len Expected length of array.             
-             * @return Actual amount of elements read. If "len" argument is less than actual
-             *     array size or resulting array is set to null, nothing will be written
-             *     to resulting array and returned value will contain required array length.
-             *     -1 will be returned in case array in stream was null.
-             */
-            int32_t ReadInt16Array(int16_t* res, const int32_t len);
-
-            /**
-             * Read 16-byte unsigned integer. Maps to "char" type in Java.
-             *
-             * @return Result.
-             */
-            uint16_t ReadUInt16();
-
-            /**
-             * Read array of 16-byte unsigned integers. Maps to "char[]" type in Java.
-             *
-             * @param res Array to store data to.
-             * @param len Expected length of array.             
-             * @return Actual amount of elements read. If "len" argument is less than actual
-             *     array size or resulting array is set to null, nothing will be written
-             *     to resulting array and returned value will contain required array length.
-             *     -1 will be returned in case array in stream was null.
-             */
-            int32_t ReadUInt16Array(uint16_t* res, const int32_t len);
-
-            /**
-             * Read 32-byte signed integer. Maps to "int" type in Java.
-             *
-             * @return Result.
-             */
-            int32_t ReadInt32();
-            
-            /**
-             * Read array of 32-byte signed integers. Maps to "int[]" type in Java.
-             *
-             * @param res Array to store data to.
-             * @param len Expected length of array.             
-             * @return Actual amount of elements read. If "len" argument is less than actual
-             *     array size or resulting array is set to null, nothing will be written
-             *     to resulting array and returned value will contain required array length.
-             *     -1 will be returned in case array in stream was null.
-             */
-            int32_t ReadInt32Array(int32_t* res, const int32_t len);
-
-            /**
-             * Read 64-byte signed integer. Maps to "long" type in Java.
-             *
-             * @return Result.
-             */
-            int64_t ReadInt64();
-
-            /**
-             * Read array of 64-byte signed integers. Maps to "long[]" type in Java.
-             *
-             * @param res Array to store data to.
-             * @param len Expected length of array.
-             * @return Actual amount of elements read. If "len" argument is less than actual
-             *     array size or resulting array is set to null, nothing will be written
-             *     to resulting array and returned value will contain required array length.
-             *     -1 will be returned in case array in stream was null.
-             */
-            int32_t ReadInt64Array(int64_t* res, const int32_t len);
-
-            /**
-             * Read float. Maps to "float" type in Java.
-             *
-             * @return Result.
-             */
-            float ReadFloat();
-            
-            /**
-             * Read array of floats. Maps to "float[]" type in Java.
-             *
-             * @param res Array to store data to.
-             * @param len Expected length of array.             
-             * @return Actual amount of elements read. If "len" argument is less than actual
-             *     array size or resulting array is set to null, nothing will be written
-             *     to resulting array and returned value will contain required array length.
-             *     -1 will be returned in case array in stream was null.
-             */
-            int32_t ReadFloatArray(float* res, const int32_t len);
-
-            /**
-             * Read double. Maps to "double" type in Java.
-             *
-             * @return Result.
-             */
-            double ReadDouble();
-            
-            /**
-             * Read array of doubles. Maps to "double[]" type in Java.
-             *
-             * @param res Array to store data to.
-             * @param len Expected length of array.             
-             * @return Actual amount of elements read. If "len" argument is less than actual
-             *     array size or resulting array is set to null, nothing will be written
-             *     to resulting array and returned value will contain required array length.
-             *     -1 will be returned in case array in stream was null.
-             */
-            int32_t ReadDoubleArray(double* res, const int32_t len);
-            
-            /**
-             * Read Guid. Maps to "UUID" type in Java.
-             *
-             * @return Result.
-             */
-            Guid ReadGuid();
-
-            /**
-             * Read array of Guids. Maps to "UUID[]" type in Java.
-             *
-             * @param res Array to store data to.
-             * @param len Expected length of array.             
-             * @return Actual amount of elements read. If "len" argument is less than actual
-             *     array size or resulting array is set to null, nothing will be written
-             *     to resulting array and returned value will contain required array length.
-             *     -1 will be returned in case array in stream was null.
-             */
-            int32_t ReadGuidArray(Guid* res, const int32_t len);
-
-            /**
-             * Read string.
-             *
-             * @param res Array to store data to. 
-             * @param len Expected length of string. NULL terminator will be set in case len is 
-             *     greater than real string length.
-             * @return Actual amount of elements read. If "len" argument is less than actual
-             *     array size or resulting array is set to null, nothing will be written
-             *     to resulting array and returned value will contain required array length.
-             *     -1 will be returned in case array in stream was null.
-             */
-            int32_t ReadString(char* res, const int32_t len);
-
-            /**
-             * Read string from the stream.
-             *
-             * @return String. 
-             */
-            std::string ReadString()
-            {
-                int32_t len = ReadString(NULL, 0);
-
-                if (len != -1)
-                {
-                    ignite::impl::utils::SafeArray<char> arr(len + 1);
-
-                    ReadString(arr.target, len + 1);
-
-                    return std::string(arr.target);
-                }
-                else
-                    return std::string();
-            }
-
-            /**
-             * Start string array read.
-             *
-             * @return String array reader.
-             */
-            PortableStringArrayReader ReadStringArray();
-
-            /**
-             * Start array read.
-             *
-             * @return Array reader.
-             */
-            template<typename T>
-            PortableArrayReader<T> ReadArray()
-            {
-                int32_t size;
-
-                int32_t id = impl->ReadArray(&size);
-
-                return PortableArrayReader<T>(impl, id, size);
-            }
-
-            /**
-             * Start collection read.
-             *
-             * @return Collection reader.
-             */
-            template<typename T>
-            PortableCollectionReader<T> ReadCollection()
-            {
-                CollectionType typ;
-                int32_t size;
-
-                int32_t id = impl->ReadCollection(&typ, &size);
-
-                return PortableCollectionReader<T>(impl, id, typ, size);
-            }
-
-            /**
-             * Start map read.
-             *
-             * @return Map reader.
-             */
-            template<typename K, typename V>
-            PortableMapReader<K, V> ReadMap()
-            {
-                MapType typ;
-                int32_t size;
-
-                int32_t id = impl->ReadMap(&typ, &size);
-
-                return PortableMapReader<K, V>(impl, id, typ, size);
-            }
-
-            /**
-             * Read object.
-             *
-             * @return Object.
-             */
-            template<typename T>
-            T ReadObject()
-            {
-                return impl->ReadObject<T>();
-            }
-        private:
-            /** Implementation delegate. */
-            ignite::impl::portable::PortableReaderImpl* impl;  
-        };
-    }
-}
-
-#endif
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/core/include/ignite/portable/portable_raw_writer.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/ignite/portable/portable_raw_writer.h b/modules/platform/src/main/cpp/core/include/ignite/portable/portable_raw_writer.h
deleted file mode 100644
index 47b5880..0000000
--- a/modules/platform/src/main/cpp/core/include/ignite/portable/portable_raw_writer.h
+++ /dev/null
@@ -1,300 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef _IGNITE_PORTABLE_RAW_WRITER
-#define _IGNITE_PORTABLE_RAW_WRITER
-
-#include <stdint.h>
-
-#include <ignite/common/common.h>
-
-#include "ignite/impl/portable/portable_writer_impl.h"
-#include "ignite/portable/portable_consts.h"
-#include "ignite/portable/portable_containers.h"
-#include "ignite/guid.h"
-
-namespace ignite
-{
-    namespace portable
-    {
-        /**
-         * Portable raw writer.
-         */
-        class IGNITE_IMPORT_EXPORT PortableRawWriter
-        {
-        public:
-            /**
-             * Constructor.
-             *
-             * @param impl Implementation.
-             */
-            PortableRawWriter(ignite::impl::portable::PortableWriterImpl* impl);
-
-            /**
-             * Write 8-byte signed integer. Maps to "byte" type in Java.
-             *
-             * @param val Value.
-             */
-            void WriteInt8(const int8_t val);
-
-            /**
-             * Write array of 8-byte signed integers. Maps to "byte[]" type in Java.
-             *
-             * @param val Array.
-             * @param len Array length.
-             */
-            void WriteInt8Array(const int8_t* val, const int32_t len);
-
-            /**
-             * Write bool. Maps to "short" type in Java.
-             *
-             * @param val Value.
-             */
-            void WriteBool(const bool val);
-
-            /**
-             * Write array of bools. Maps to "bool[]" type in Java.
-             *
-             * @param val Array.
-             * @param len Array length.
-             */
-            void WriteBoolArray(const bool* val, const int32_t len);
-
-            /**
-             * Write 16-byte signed integer. Maps to "short" type in Java.
-             *
-             * @param val Value.
-             */
-            void WriteInt16(const int16_t val);
-
-            /**
-             * Write array of 16-byte signed integers. Maps to "short[]" type in Java.
-             *
-             * @param val Array.
-             * @param len Array length.
-             */
-            void WriteInt16Array(const int16_t* val, const int32_t len);
-
-            /**
-             * Write 16-byte unsigned integer. Maps to "char" type in Java.
-             *
-             * @param val Value.
-             */
-            void WriteUInt16(const uint16_t val);
-
-            /**
-             * Write array of 16-byte unsigned integers. Maps to "char[]" type in Java.
-             *
-             * @param val Array.
-             * @param len Array length.
-             */
-            void WriteUInt16Array(const uint16_t* val, const int32_t len);
-
-            /**
-             * Write 32-byte signed integer. Maps to "int" type in Java.
-             *
-             * @param val Value.
-             */
-            void WriteInt32(const int32_t val);
-
-            /**
-             * Write array of 32-byte signed integers. Maps to "int[]" type in Java.
-             *
-             * @param val Array.
-             * @param len Array length.
-             */
-            void WriteInt32Array(const int32_t* val, const int32_t len);
-
-            /**
-             * Write 64-byte signed integer. Maps to "long" type in Java.
-             *
-             * @param val Value.
-             */
-            void WriteInt64(const int64_t val);
-
-            /**
-             * Write array of 64-byte signed integers. Maps to "long[]" type in Java.
-             *
-             * @param val Array.
-             * @param len Array length.
-             */
-            void WriteInt64Array(const int64_t* val, const int32_t len);
-
-            /**
-             * Write float. Maps to "float" type in Java.
-             *
-             * @param val Value.
-             */
-            void WriteFloat(const float val);
-
-            /**
-             * Write array of floats. Maps to "float[]" type in Java.
-             *
-             * @param val Array.
-             * @param len Array length.
-             */
-            void WriteFloatArray(const float* val, const int32_t len);
-
-            /**
-             * Write double. Maps to "double" type in Java.
-             *
-             * @param val Value.
-             */
-            void WriteDouble(const double val);
-
-            /**
-             * Write array of doubles. Maps to "double[]" type in Java.
-             *
-             * @param val Array.
-             * @param len Array length.
-             */
-            void WriteDoubleArray(const double* val, const int32_t len);
-
-            /**
-             * Write Guid. Maps to "UUID" type in Java.
-             *
-             * @param val Value.
-             */
-            void WriteGuid(const Guid val);
-
-            /**
-             * Write array of Guids. Maps to "UUID[]" type in Java.
-             *
-             * @param val Array.
-             * @param len Array length.
-             */
-            void WriteGuidArray(const Guid* val, const int32_t len);
-
-            /**
-             * Write string.
-             *
-             * @param val Null-terminated character array.
-             */
-            void WriteString(const char* val);
-
-            /**
-             * Write string.
-             *
-             * @param val String.
-             * @param len String length (characters).
-             */
-            void WriteString(const char* val, const int32_t len);
-            
-            /**
-             * Write string.
-             *
-             * @param val String.
-             */
-            void WriteString(const std::string& val)
-            {
-                WriteString(val.c_str());
-            }
-            
-            /**
-             * Start string array write.
-             *
-             * @return String array writer.
-             */
-            PortableStringArrayWriter WriteStringArray();
-
-            /**
-             * Write NULL value.
-             */
-            void WriteNull();
-
-            /**
-             * Start array write.
-             *
-             * @return Array writer.
-             */
-            template<typename T>
-            PortableArrayWriter<T> WriteArray()
-            {
-                int32_t id = impl->WriteArray();
-
-                return PortableArrayWriter<T>(impl, id);
-            }
-
-            /**
-             * Start collection write.
-             *
-             * @return Collection writer.
-             */
-            template<typename T>
-            PortableCollectionWriter<T> WriteCollection()
-            {
-                return WriteCollection<T>(IGNITE_COLLECTION_UNDEFINED);
-            }
-
-            /**
-             * Start collection write.
-             *
-             * @param type Collection type.
-             * @return Collection writer.
-             */
-            template<typename T>
-            PortableCollectionWriter<T> WriteCollection(ignite::portable::CollectionType typ)
-            {
-                int32_t id = impl->WriteCollection(typ);
-
-                return PortableCollectionWriter<T>(impl, id);
-            }
-
-            /**
-             * Start map write.
-             *
-             * @param typ Map type.
-             * @return Map writer.
-             */
-            template<typename K, typename V>
-            PortableMapWriter<K, V> WriteMap()
-            {
-                return WriteMap<K, V>(IGNITE_MAP_UNDEFINED);
-            }
-
-            /**
-             * Start map write.
-             *
-             * @param typ Map type.
-             * @return Map writer.
-             */
-            template<typename K, typename V>
-            PortableMapWriter<K, V> WriteMap(ignite::portable::MapType typ)
-            {
-                int32_t id = impl->WriteMap(typ);
-
-                return PortableMapWriter<K, V>(impl, id);
-            }
-
-            /**
-             * Write object.
-             *
-             * @param val Object.
-             */
-            template<typename T>
-            void WriteObject(T val)
-            {
-                impl->WriteObject<T>(val);
-            }
-        private:
-            /** Implementation delegate. */
-            ignite::impl::portable::PortableWriterImpl* impl; 
-        };
-    }
-}
-
-#endif
\ No newline at end of file


[24/28] ignite git commit: IGNITE-1513: Moved CPP.

Posted by vo...@apache.org.
http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/core-test/src/cache_test.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/core-test/src/cache_test.cpp b/modules/platform/cpp/core-test/src/cache_test.cpp
new file mode 100644
index 0000000..3239d89
--- /dev/null
+++ b/modules/platform/cpp/core-test/src/cache_test.cpp
@@ -0,0 +1,486 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _MSC_VER
+    #define BOOST_TEST_DYN_LINK
+#endif
+
+#include <boost/test/unit_test.hpp>
+
+#include "ignite/cache/cache_peek_mode.h"
+#include "ignite/ignite.h"
+#include "ignite/ignition.h"
+
+using namespace ignite;
+using namespace boost::unit_test;
+
+/* Nodes started during the test. */
+Ignite grid0 = Ignite();
+Ignite grid1 = Ignite();
+
+/** Cache accessor. */
+cache::Cache<int, int> Cache()
+{
+    return grid0.GetCache<int, int>("partitioned");
+}
+
+struct Person
+{
+    std::string name;
+    int age;
+
+    Person() : name(""), age(0)
+    {
+        // No-op.
+    }
+
+    Person(std::string name, int age) : name(name), age(age)
+    {
+        // No-op.
+    }
+};
+
+namespace ignite
+{
+    namespace portable
+    {
+        IGNITE_PORTABLE_TYPE_START(Person)
+        IGNITE_PORTABLE_GET_TYPE_ID_AS_HASH(Person)
+        IGNITE_PORTABLE_GET_TYPE_NAME_AS_IS(Person)
+        IGNITE_PORTABLE_GET_FIELD_ID_AS_HASH
+        IGNITE_PORTABLE_GET_HASH_CODE_ZERO(Person)
+        IGNITE_PORTABLE_IS_NULL_FALSE(Person)
+        IGNITE_PORTABLE_GET_NULL_DEFAULT_CTOR(Person)
+            
+        void Write(PortableWriter& writer, Person obj)
+        {
+            writer.WriteString("name", obj.name);
+            writer.WriteInt32("age", obj.age);            
+        }
+
+        Person Read(PortableReader& reader)
+        {
+            std::string name = reader.ReadString("name");
+            int age = reader.ReadInt32("age");
+            
+            return Person(name, age);
+        }
+
+        IGNITE_PORTABLE_TYPE_END
+    }
+}
+
+/*
+ * Test setup fixture.
+ */
+struct CacheTestSuiteFixture {
+    /*
+     * Constructor.
+     */
+    CacheTestSuiteFixture()
+    {
+        IgniteConfiguration cfg;
+
+        IgniteJvmOption opts[5];
+
+        opts[0] = IgniteJvmOption("-Xdebug");
+        opts[1] = IgniteJvmOption("-Xnoagent");
+        opts[2] = IgniteJvmOption("-Djava.compiler=NONE");
+        opts[3] = IgniteJvmOption("-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005");
+        opts[4] = IgniteJvmOption("-XX:+HeapDumpOnOutOfMemoryError");
+
+        cfg.jvmOptsLen = 5;
+        cfg.jvmOpts = opts;
+
+#ifdef IGNITE_TESTS_32
+        cfg.jvmInitMem = 256;
+        cfg.jvmMaxMem = 768;
+#else
+        cfg.jvmInitMem = 1024;
+        cfg.jvmMaxMem = 4096;
+#endif
+
+        char* cfgPath = getenv("IGNITE_NATIVE_TEST_CPP_CONFIG_PATH");
+
+        std::string cfgPathStr = std::string(cfgPath).append("/").append("cache-test.xml");
+
+        cfg.springCfgPath = const_cast<char*>(cfgPathStr.c_str());
+        
+        for (int i = 0; i < 2; i++) 
+        {
+            std::stringstream stream;
+
+            stream << "grid-" << i;
+
+            IgniteError err;
+
+            Ignite grid = Ignition::Start(cfg, stream.str().c_str(), &err);
+                
+            if (err.GetCode() != IgniteError::IGNITE_SUCCESS)
+                BOOST_FAIL(err.GetText());
+
+            if (i == 0)
+                grid0 = grid;
+            else
+                grid1 = grid;
+        }
+    }
+
+    /*
+     * Destructor.
+     */
+    ~CacheTestSuiteFixture()
+    {
+        Ignition::Stop(grid0.GetName(), true);
+        Ignition::Stop(grid1.GetName(), true);
+
+        grid0 = Ignite();
+        grid1 = Ignite();
+    }
+};
+
+BOOST_FIXTURE_TEST_SUITE(CacheTestSuite, CacheTestSuiteFixture)
+
+BOOST_AUTO_TEST_CASE(TestRemoveAllKeys)
+{
+    cache::Cache<int, int> cache = Cache();
+
+    cache.Put(1, 1);
+    cache.Put(2, 2);
+    cache.Put(3, 3);
+
+    int size = cache.Size(cache::IGNITE_PEEK_MODE_PRIMARY);
+
+    BOOST_REQUIRE(3 == size);
+
+    cache.RemoveAll();
+
+    size = cache.Size(cache::IGNITE_PEEK_MODE_ALL);
+
+    BOOST_REQUIRE(0 == size);
+
+    cache.Put(1, 1);
+    cache.Put(2, 2);
+    cache.Put(3, 3);
+
+    int keys[] = { 1, 2, 4, 5 };
+
+    std::set<int> keySet(keys, keys + 4);
+
+    cache.RemoveAll(keySet);
+
+    size = cache.Size(cache::IGNITE_PEEK_MODE_PRIMARY);
+
+    BOOST_REQUIRE(1 == size);
+}
+
+BOOST_AUTO_TEST_CASE(TestPut)
+{
+    cache::Cache<int, int> cache = Cache();
+
+    cache.Put(1, 1);
+
+    BOOST_REQUIRE(1 == cache.Get(1));
+}
+
+BOOST_AUTO_TEST_CASE(TestPutAll)
+{
+    std::map<int, int> map;
+
+    for (int i = 0; i < 100; i++)
+        map[i] = i + 1;
+    
+    cache::Cache<int, int> cache = Cache();
+
+    cache.PutAll(map);
+
+    for (int i = 0; i < 100; i++)
+        BOOST_REQUIRE(i + 1 == cache.Get(i));
+}
+
+BOOST_AUTO_TEST_CASE(TestPutIfAbsent)
+{
+    cache::Cache<int, int> cache = Cache();
+
+    BOOST_REQUIRE(true == cache.PutIfAbsent(1, 3));
+    BOOST_REQUIRE(false == cache.PutIfAbsent(1, 3));
+}
+
+BOOST_AUTO_TEST_CASE(TestGet)
+{
+    cache::Cache<int, int> cache = Cache();
+
+    cache.Put(1, 1);
+    cache.Put(2, 2);
+
+    BOOST_REQUIRE(1 == cache.Get(1));
+    BOOST_REQUIRE(2 == cache.Get(2));
+    
+    BOOST_REQUIRE(0 == cache.Get(3));
+}
+
+BOOST_AUTO_TEST_CASE(TestGetAll)
+{
+    cache::Cache<int, int> cache = Cache();
+
+    int keys[] = { 1, 2, 3, 4, 5 };
+    
+    std::set<int> keySet (keys, keys + 5);
+
+    for (int i = 0; i < keySet.size(); i++)
+        cache.Put(i + 1, i + 1);
+
+    std::map<int, int> map = cache.GetAll(keySet);
+
+    for (int i = 0; i < keySet.size(); i++)
+        BOOST_REQUIRE(i + 1 == map[i + 1]);
+}
+
+BOOST_AUTO_TEST_CASE(TestGetAndPut)
+{
+    cache::Cache<int, int> cache = Cache();
+
+    BOOST_REQUIRE(0 == cache.GetAndPut(1, 3));
+    BOOST_REQUIRE(3 == cache.GetAndPut(1, 1));
+    BOOST_REQUIRE(1 == cache.GetAndPut(1, 0));
+}
+
+BOOST_AUTO_TEST_CASE(TestGetAndPutIfAbsent)
+{
+    cache::Cache<int, int> cache = Cache();
+
+    BOOST_REQUIRE(0 == cache.GetAndPutIfAbsent(1, 3));
+    BOOST_REQUIRE(3 == cache.GetAndPutIfAbsent(1, 1));
+    BOOST_REQUIRE(3 == cache.GetAndPutIfAbsent(1, 1));
+}
+
+BOOST_AUTO_TEST_CASE(TestGetAndRemove)
+{
+    cache::Cache<int, int> cache = Cache();
+
+    cache.Put(1, 3);
+
+    BOOST_REQUIRE(3 == cache.GetAndRemove(1));
+    BOOST_REQUIRE(0 == cache.GetAndRemove(1));
+}
+
+BOOST_AUTO_TEST_CASE(TestGetAndReplace)
+{
+    cache::Cache<int, int> cache = Cache();
+
+    BOOST_REQUIRE(0 == cache.GetAndReplace(1, 3));
+    BOOST_REQUIRE(0 == cache.GetAndReplace(1, 3));
+
+    cache.Put(1, 5);
+
+    BOOST_REQUIRE(5 == cache.GetAndReplace(1, 3));
+    BOOST_REQUIRE(3 == cache.GetAndReplace(1, 3));
+}
+
+BOOST_AUTO_TEST_CASE(TestContainsKey)
+{
+    cache::Cache<int, int> cache = Cache();
+
+    BOOST_REQUIRE(false == cache.ContainsKey(1));
+
+    cache.Put(1, 1);
+
+    BOOST_REQUIRE(true == cache.ContainsKey(1));
+
+    BOOST_REQUIRE(true == cache.Remove(1));
+    
+    BOOST_REQUIRE(false == cache.ContainsKey(1));
+}
+
+BOOST_AUTO_TEST_CASE(TestContainsKeys)
+{
+    cache::Cache<int, int> cache = Cache();
+    
+    int keys[] = { 1, 2 };
+
+    std::set<int> keySet(keys, keys + 2);
+
+    BOOST_REQUIRE(false == cache.ContainsKeys(keySet));
+
+    cache.Put(1, 1);
+    cache.Put(2, 2);
+    
+    BOOST_REQUIRE(true == cache.ContainsKeys(keySet));
+
+    cache.Remove(1);
+
+    BOOST_REQUIRE(false == cache.ContainsKeys(keySet));
+}
+
+BOOST_AUTO_TEST_CASE(TestIsEmpty)
+{
+    cache::Cache<int, int> cache = Cache();
+
+    BOOST_REQUIRE(true == cache.IsEmpty());
+
+    cache.Put(1, 1);
+
+    BOOST_REQUIRE(false == cache.IsEmpty());
+
+    cache.Remove(1);
+
+    BOOST_REQUIRE(true == cache.IsEmpty());
+}
+
+BOOST_AUTO_TEST_CASE(TestRemove)
+{
+    cache::Cache<int, int> cache = Cache();
+
+    BOOST_REQUIRE(false == cache.Remove(1));
+
+    cache.Put(1, 1);
+
+    BOOST_REQUIRE(true == cache.Remove(1));
+    BOOST_REQUIRE(false == cache.Remove(1));
+    BOOST_REQUIRE(false == cache.ContainsKey(1));
+}
+
+BOOST_AUTO_TEST_CASE(TestClear)
+{
+    cache::Cache<int, int> cache = Cache();
+
+    cache.Put(1, 1);
+
+    BOOST_REQUIRE(true == cache.ContainsKey(1));
+
+    cache.Clear(1);
+
+    BOOST_REQUIRE(false == cache.ContainsKey(1));
+}
+
+BOOST_AUTO_TEST_CASE(TestLocalClear)
+{
+    cache::Cache<int, int> cache = Cache();
+
+    cache.Put(0, 2);
+
+    BOOST_REQUIRE(2 == cache.LocalPeek(0, cache::IGNITE_PEEK_MODE_PRIMARY));
+
+    cache.LocalClear(0);
+
+    BOOST_REQUIRE(0 == cache.LocalPeek(0, cache::IGNITE_PEEK_MODE_PRIMARY));
+}
+
+BOOST_AUTO_TEST_CASE(TestLocalClearAll)
+{
+    cache::Cache<int, int> cache = Cache();
+
+    cache.Put(0, 3);
+    cache.Put(1, 3);
+
+    int keys[] = { 0, 1 };
+
+    std::set<int> keySet(keys, keys + 2);
+
+    BOOST_REQUIRE(3 == cache.LocalPeek(0, cache::IGNITE_PEEK_MODE_PRIMARY));
+    BOOST_REQUIRE(3 == cache.LocalPeek(1, cache::IGNITE_PEEK_MODE_PRIMARY));
+
+    cache.LocalClearAll(keySet);
+
+    BOOST_REQUIRE(0 == cache.LocalPeek(0, cache::IGNITE_PEEK_MODE_PRIMARY));
+    BOOST_REQUIRE(0 == cache.LocalPeek(1, cache::IGNITE_PEEK_MODE_PRIMARY));
+}
+
+BOOST_AUTO_TEST_CASE(TestSizes)
+{
+    cache::Cache<int, int> cache = Cache();
+
+    BOOST_REQUIRE(0 == cache.Size());
+
+    cache.Put(1, 1);
+    cache.Put(2, 2);
+
+    BOOST_REQUIRE(2 <= cache.Size());
+
+    BOOST_REQUIRE(1 <= cache.LocalSize(cache::IGNITE_PEEK_MODE_PRIMARY));
+}
+
+BOOST_AUTO_TEST_CASE(TestLocalEvict)
+{
+    cache::Cache<int, int> cache = Cache();
+
+    cache.Put(1, 5);
+
+    BOOST_REQUIRE(5 == cache.LocalPeek(1, cache::IGNITE_PEEK_MODE_ONHEAP));
+
+    int keys[] = { 0, 1 };
+
+    std::set<int> keySet(keys, keys + 2);
+
+    cache.LocalEvict(keySet);
+
+    BOOST_REQUIRE(0 == cache.LocalPeek(1, cache::IGNITE_PEEK_MODE_ONHEAP));
+
+    BOOST_REQUIRE(5 == cache.Get(1));
+
+    BOOST_REQUIRE(5 == cache.LocalPeek(1, cache::IGNITE_PEEK_MODE_ONHEAP));
+}
+
+BOOST_AUTO_TEST_CASE(TestPortable)
+{
+    cache::Cache<int, Person> cache = grid0.GetCache<int, Person>("partitioned");
+
+    Person person("John Johnson", 3);
+
+    cache.Put(1, person);
+
+    Person person0 = cache.Get(1);
+
+    BOOST_REQUIRE(person.age == person0.age);
+    BOOST_REQUIRE(person.name.compare(person0.name) == 0);
+}
+
+BOOST_AUTO_TEST_CASE(TestCreateCache)
+{
+    // Create new cache
+    cache::Cache<int, int> cache = grid0.CreateCache<int, int>("dynamic_cache");
+
+    cache.Put(5, 7);
+
+    BOOST_REQUIRE(7 == cache.Get(5));
+
+    // Attempt to create cache with existing name
+    IgniteError err;
+
+    grid0.CreateCache<int, int>("dynamic_cache", &err);
+
+    BOOST_REQUIRE(err.GetCode() != IgniteError::IGNITE_SUCCESS);
+}
+
+BOOST_AUTO_TEST_CASE(TestGetOrCreateCache)
+{
+    // Get existing cache
+    cache::Cache<int, int> cache = grid0.GetOrCreateCache<int, int>("partitioned");
+
+    cache.Put(5, 7);
+
+    BOOST_REQUIRE(7 == cache.Get(5));
+
+    // Create new cache
+    cache::Cache<int, int> cache2 = grid0.GetOrCreateCache<int, int>("partitioned_new");
+
+    cache2.Put(5, 7);
+
+    BOOST_REQUIRE(7 == cache2.Get(5));
+}
+
+BOOST_AUTO_TEST_SUITE_END()
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/core-test/src/concurrent_test.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/core-test/src/concurrent_test.cpp b/modules/platform/cpp/core-test/src/concurrent_test.cpp
new file mode 100644
index 0000000..2d89b7a
--- /dev/null
+++ b/modules/platform/cpp/core-test/src/concurrent_test.cpp
@@ -0,0 +1,186 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _MSC_VER
+    #define BOOST_TEST_DYN_LINK
+#endif
+
+#include <boost/test/unit_test.hpp>
+
+#include <ignite/common/concurrent.h>
+
+using namespace ignite::common::concurrent;
+
+BOOST_AUTO_TEST_SUITE(ConcurrentTestSuite)
+
+BOOST_AUTO_TEST_CASE(TestAtomic32)
+{
+    int32_t val = 1;
+
+    BOOST_REQUIRE(Atomics::CompareAndSet32(&val, 1, 2));
+    BOOST_REQUIRE(val == 2);
+
+    BOOST_REQUIRE(!Atomics::CompareAndSet32(&val, 3, 1));
+    BOOST_REQUIRE(val == 2);
+
+    BOOST_REQUIRE(Atomics::CompareAndSet32Val(&val, 2, 3) == 2);
+    BOOST_REQUIRE(val == 3);
+
+    BOOST_REQUIRE(Atomics::CompareAndSet32Val(&val, 4, 2) == 3);
+    BOOST_REQUIRE(val == 3);
+
+    BOOST_REQUIRE(Atomics::IncrementAndGet32(&val) == 4);
+    BOOST_REQUIRE(val == 4);
+
+    BOOST_REQUIRE(Atomics::DecrementAndGet32(&val) == 3);
+    BOOST_REQUIRE(val == 3);
+}
+
+BOOST_AUTO_TEST_CASE(TestAtomic64)
+{
+    int64_t val = 1;
+
+    BOOST_REQUIRE(Atomics::CompareAndSet64(&val, 1, 2));
+    BOOST_REQUIRE(val == 2);
+
+    BOOST_REQUIRE(!Atomics::CompareAndSet64(&val, 3, 1));
+    BOOST_REQUIRE(val == 2);
+
+    BOOST_REQUIRE(Atomics::CompareAndSet64Val(&val, 2, 3) == 2);
+    BOOST_REQUIRE(val == 3);
+
+    BOOST_REQUIRE(Atomics::CompareAndSet64Val(&val, 4, 2) == 3);
+    BOOST_REQUIRE(val == 3);
+
+    BOOST_REQUIRE(Atomics::IncrementAndGet64(&val) == 4);
+    BOOST_REQUIRE(val == 4);
+
+    BOOST_REQUIRE(Atomics::DecrementAndGet64(&val) == 3);
+    BOOST_REQUIRE(val == 3);
+}
+
+BOOST_AUTO_TEST_CASE(TestThreadLocal)
+{
+    int32_t idx1 = ThreadLocal::NextIndex();
+    int32_t idx2 = ThreadLocal::NextIndex();
+    BOOST_REQUIRE(idx2 > idx1);
+
+    BOOST_REQUIRE(ThreadLocal::Get<int32_t>(idx1) == 0);
+
+    ThreadLocal::Set(idx1, 1);
+    BOOST_REQUIRE(ThreadLocal::Get<int32_t>(idx1) == 1);
+
+    ThreadLocal::Set(idx1, 2);
+    BOOST_REQUIRE(ThreadLocal::Get<int32_t>(idx1) == 2);
+
+    ThreadLocal::Remove(idx1);
+    BOOST_REQUIRE(ThreadLocal::Get<int32_t>(idx1) == 0);
+    
+    ThreadLocal::Set(idx1, 1);
+    BOOST_REQUIRE(ThreadLocal::Get<int32_t>(idx1) == 1);
+
+    ThreadLocal::Remove(idx1);
+}
+
+BOOST_AUTO_TEST_CASE(TestThreadLocalInstance)
+{
+    ThreadLocalInstance<int32_t> val;
+
+    BOOST_REQUIRE(val.Get() == 0);
+
+    val.Set(1);
+    BOOST_REQUIRE(val.Get() == 1);
+
+    val.Set(2);
+    BOOST_REQUIRE(val.Get() == 2);
+
+    val.Remove();
+    BOOST_REQUIRE(val.Get() == 0);
+
+    val.Set(1);
+    BOOST_REQUIRE(val.Get() == 1);
+
+    val.Remove();
+}
+
+struct SharedPointerTarget
+{
+    bool deleted;
+
+    SharedPointerTarget() : deleted(false)
+    {
+        // No-op.
+    }
+};
+
+void DeleteSharedPointerTarget(SharedPointerTarget* ptr)
+{
+    ptr->deleted = true;
+}
+
+BOOST_AUTO_TEST_CASE(TestSharedPointer)
+{
+    // 1. Test the simples scenario.
+    SharedPointerTarget* target = new SharedPointerTarget();
+
+    SharedPointer<SharedPointerTarget>* ptr1 = 
+        new SharedPointer<SharedPointerTarget>(target, DeleteSharedPointerTarget);
+
+    delete ptr1;
+    BOOST_REQUIRE(target->deleted);
+
+    target->deleted = false;
+
+    // 2. Test copy ctor.
+    ptr1 = new SharedPointer<SharedPointerTarget>(target, DeleteSharedPointerTarget);
+    SharedPointer<SharedPointerTarget>* ptr2 = new SharedPointer<SharedPointerTarget>(*ptr1);
+
+    delete ptr1;
+    BOOST_REQUIRE(!target->deleted);
+
+    delete ptr2;
+    BOOST_REQUIRE(target->deleted);
+
+    target->deleted = false;
+
+    // 3. Test assignment logic.
+    ptr1 = new SharedPointer<SharedPointerTarget>(target, DeleteSharedPointerTarget);
+
+    SharedPointer<SharedPointerTarget> ptr3 = *ptr1;
+
+    delete ptr1;
+    BOOST_REQUIRE(!target->deleted);
+
+    ptr3 = SharedPointer<SharedPointerTarget>();
+    BOOST_REQUIRE(target->deleted);
+
+    target->deleted = false;
+
+    // 4. Test self-assignment.
+    ptr1 = new SharedPointer<SharedPointerTarget>(target, DeleteSharedPointerTarget);
+
+    *ptr1 = *ptr1;
+
+    delete ptr1;
+
+    BOOST_REQUIRE(target->deleted);
+
+    // 5. Tear-down.
+    delete target;    
+}
+
+BOOST_AUTO_TEST_SUITE_END()
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/core-test/src/handle_registry_test.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/core-test/src/handle_registry_test.cpp b/modules/platform/cpp/core-test/src/handle_registry_test.cpp
new file mode 100644
index 0000000..bc4a654
--- /dev/null
+++ b/modules/platform/cpp/core-test/src/handle_registry_test.cpp
@@ -0,0 +1,176 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _MSC_VER
+    #define BOOST_TEST_DYN_LINK
+#endif
+
+#include <boost/test/unit_test.hpp>
+
+#include "ignite/impl/handle_registry.h"
+
+using namespace ignite::common::concurrent;
+using namespace ignite::impl;
+
+struct HandleRegistryTestProbe
+{
+    bool deleted;
+    
+    HandleRegistryTestProbe()
+    {
+        deleted = false;
+    }
+};
+
+class HandleRegistryTestEntry : public HandleRegistryEntry
+{
+public:
+    HandleRegistryTestEntry(HandleRegistryTestProbe* probe) : probe(probe)
+    {
+        // No-op.
+    }
+
+    virtual ~HandleRegistryTestEntry()
+    {
+        probe->deleted = true;
+    }
+
+private:
+    HandleRegistryTestProbe* probe;
+};
+
+BOOST_AUTO_TEST_SUITE(HandleRegistryTestSuite)
+
+BOOST_AUTO_TEST_CASE(TestCritical)
+{
+    HandleRegistry reg(2, 1);
+
+    HandleRegistryTestProbe probe0;
+    HandleRegistryTestProbe probe1;
+    HandleRegistryTestProbe probe2;
+
+    HandleRegistryTestEntry* entry0 = new HandleRegistryTestEntry(&probe0);
+    HandleRegistryTestEntry* entry1 = new HandleRegistryTestEntry(&probe1);
+    HandleRegistryTestEntry* entry2 = new HandleRegistryTestEntry(&probe2);
+
+    int64_t hnd0 = reg.AllocateCritical(SharedPointer<HandleRegistryEntry>(entry0));
+    int64_t hnd1 = reg.AllocateCritical(SharedPointer<HandleRegistryEntry>(entry1));
+    int64_t hnd2 = reg.AllocateCritical(SharedPointer<HandleRegistryEntry>(entry2));
+
+    BOOST_REQUIRE(reg.Get(hnd0).Get() == entry0);
+    BOOST_REQUIRE(!probe0.deleted);
+
+    BOOST_REQUIRE(reg.Get(hnd1).Get() == entry1);
+    BOOST_REQUIRE(!probe1.deleted);
+
+    BOOST_REQUIRE(reg.Get(hnd2).Get() == entry2);
+    BOOST_REQUIRE(!probe2.deleted);
+
+    reg.Release(hnd0);
+
+    BOOST_REQUIRE(reg.Get(hnd0).Get() == NULL);
+    BOOST_REQUIRE(probe0.deleted);
+
+    BOOST_REQUIRE(reg.Get(hnd1).Get() == entry1);
+    BOOST_REQUIRE(!probe1.deleted);
+
+    BOOST_REQUIRE(reg.Get(hnd2).Get() == entry2);
+    BOOST_REQUIRE(!probe2.deleted);
+
+    reg.Close();
+
+    BOOST_REQUIRE(reg.Get(hnd0).Get() == NULL);
+    BOOST_REQUIRE(probe0.deleted);
+
+    BOOST_REQUIRE(reg.Get(hnd1).Get() == NULL);
+    BOOST_REQUIRE(probe1.deleted);
+
+    BOOST_REQUIRE(reg.Get(hnd2).Get() == NULL);
+    BOOST_REQUIRE(probe2.deleted);
+
+    HandleRegistry closedReg(2, 1);
+
+    closedReg.Close();
+
+    HandleRegistryTestProbe closedProbe;
+    HandleRegistryTestEntry* closedEntry = new HandleRegistryTestEntry(&closedProbe);
+
+    int64_t closedHnd = closedReg.AllocateCritical(SharedPointer<HandleRegistryEntry>(closedEntry));
+    BOOST_REQUIRE(closedHnd == -1);
+    BOOST_REQUIRE(closedProbe.deleted);
+}
+
+BOOST_AUTO_TEST_CASE(TestNonCritical)
+{
+    HandleRegistry reg(0, 2);
+
+    HandleRegistryTestProbe probe0;
+    HandleRegistryTestProbe probe1;
+    HandleRegistryTestProbe probe2;
+
+    HandleRegistryTestEntry* entry0 = new HandleRegistryTestEntry(&probe0);
+    HandleRegistryTestEntry* entry1 = new HandleRegistryTestEntry(&probe1);
+    HandleRegistryTestEntry* entry2 = new HandleRegistryTestEntry(&probe2);
+
+    int64_t hnd0 = reg.AllocateCritical(SharedPointer<HandleRegistryEntry>(entry0));
+    int64_t hnd1 = reg.Allocate(SharedPointer<HandleRegistryEntry>(entry1));
+    int64_t hnd2 = reg.Allocate(SharedPointer<HandleRegistryEntry>(entry2));
+
+    BOOST_REQUIRE(reg.Get(hnd0).Get() == entry0);
+    BOOST_REQUIRE(!probe0.deleted);
+
+    BOOST_REQUIRE(reg.Get(hnd1).Get() == entry1);
+    BOOST_REQUIRE(!probe1.deleted);
+
+    BOOST_REQUIRE(reg.Get(hnd2).Get() == entry2);
+    BOOST_REQUIRE(!probe2.deleted);
+
+    reg.Release(hnd0);
+
+    BOOST_REQUIRE(reg.Get(hnd0).Get() == NULL);
+    BOOST_REQUIRE(probe0.deleted);
+
+    BOOST_REQUIRE(reg.Get(hnd1).Get() == entry1);
+    BOOST_REQUIRE(!probe1.deleted);
+
+    BOOST_REQUIRE(reg.Get(hnd2).Get() == entry2);
+    BOOST_REQUIRE(!probe2.deleted);
+
+    reg.Close();
+
+    BOOST_REQUIRE(reg.Get(hnd0).Get() == NULL);
+    BOOST_REQUIRE(probe0.deleted);
+
+    BOOST_REQUIRE(reg.Get(hnd1).Get() == NULL);
+    BOOST_REQUIRE(probe1.deleted);
+
+    BOOST_REQUIRE(reg.Get(hnd2).Get() == NULL);
+    BOOST_REQUIRE(probe2.deleted);
+
+    HandleRegistry closedReg(0, 2);
+
+    closedReg.Close();
+
+    HandleRegistryTestProbe closedProbe;
+    HandleRegistryTestEntry* closedEntry = new HandleRegistryTestEntry(&closedProbe);
+
+    int64_t closedHnd = closedReg.Allocate(SharedPointer<HandleRegistryEntry>(closedEntry));
+    BOOST_REQUIRE(closedHnd == -1);
+    BOOST_REQUIRE(closedProbe.deleted);
+}
+
+BOOST_AUTO_TEST_SUITE_END()
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/core-test/src/ignition_test.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/core-test/src/ignition_test.cpp b/modules/platform/cpp/core-test/src/ignition_test.cpp
new file mode 100644
index 0000000..e0e26d3
--- /dev/null
+++ b/modules/platform/cpp/core-test/src/ignition_test.cpp
@@ -0,0 +1,102 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _MSC_VER
+    #define BOOST_TEST_DYN_LINK
+#endif
+
+#include <boost/test/unit_test.hpp>
+
+#include "ignite/ignite.h"
+#include "ignite/ignition.h"
+
+using namespace ignite;
+using namespace boost::unit_test;
+
+BOOST_AUTO_TEST_SUITE(IgnitionTestSuite)
+
+BOOST_AUTO_TEST_CASE(TestIgnition)
+{
+    IgniteConfiguration cfg;
+
+    IgniteJvmOption opts[5];
+
+    opts[0] = IgniteJvmOption("-Xdebug");
+    opts[1] = IgniteJvmOption("-Xnoagent");
+    opts[2] = IgniteJvmOption("-Djava.compiler=NONE");
+    opts[3] = IgniteJvmOption("-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005");
+    opts[4] = IgniteJvmOption("-XX:+HeapDumpOnOutOfMemoryError");
+
+    cfg.jvmOptsLen = 5;
+    cfg.jvmOpts = opts;
+
+#ifdef IGNITE_TESTS_32
+        cfg.jvmInitMem = 256;
+        cfg.jvmMaxMem = 768;
+#else
+        cfg.jvmInitMem = 1024;
+        cfg.jvmMaxMem = 4096;
+#endif
+
+    char* cfgPath = getenv("IGNITE_NATIVE_TEST_CPP_CONFIG_PATH");
+
+    std::string cfgPathStr = std::string(cfgPath).append("/").append("cache-test.xml");
+
+    cfg.springCfgPath = const_cast<char*>(cfgPathStr.c_str());
+
+    IgniteError err;
+
+    // Start two Ignite instances.
+    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);
+
+    if (err.GetCode() != IgniteError::IGNITE_SUCCESS)
+        BOOST_ERROR(err.GetText());
+
+    BOOST_REQUIRE(strcmp(grid2.GetName(), "ignitionTest-2") == 0);
+
+    // Test get
+    Ignite grid0 = Ignition::Get("ignitionTest-1", &err);
+    
+    if (err.GetCode() != IgniteError::IGNITE_SUCCESS)
+        BOOST_ERROR(err.GetText());
+
+    BOOST_REQUIRE(strcmp(grid0.GetName(), grid1.GetName()) == 0);
+
+    // Stop one grid
+    Ignition::Stop(grid1.GetName(), true);
+    
+    Ignition::Get("ignitionTest-1", &err);
+    BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_GENERIC);
+    
+    Ignition::Get("ignitionTest-2", &err);
+    BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_SUCCESS);
+
+    // Stop all
+    Ignition::StopAll(true);
+    
+    Ignition::Get("ignitionTest-2", &err);
+    BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_GENERIC);    
+}
+
+BOOST_AUTO_TEST_SUITE_END()
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/core-test/src/portable_reader_writer_raw_test.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/core-test/src/portable_reader_writer_raw_test.cpp b/modules/platform/cpp/core-test/src/portable_reader_writer_raw_test.cpp
new file mode 100644
index 0000000..c3a98aa
--- /dev/null
+++ b/modules/platform/cpp/core-test/src/portable_reader_writer_raw_test.cpp
@@ -0,0 +1,1532 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _MSC_VER
+    #define BOOST_TEST_DYN_LINK
+#endif
+
+#include <boost/test/unit_test.hpp>
+
+#include "ignite/impl/interop/interop.h"
+#include "ignite/portable/portable.h"
+
+#include "ignite/portable_test_defs.h"
+#include "ignite/portable_test_utils.h"
+
+using namespace ignite;
+using namespace ignite::impl::interop;
+using namespace ignite::impl::portable;
+using namespace ignite::portable;
+using namespace ignite_test::core::portable;
+
+template<typename T>
+void CheckRawPrimitive(T val)
+{
+    InteropUnpooledMemory mem(1024);
+
+    InteropOutputStream out(&mem);
+    PortableWriterImpl writer(&out, NULL);
+    PortableRawWriter rawWriter(&writer);
+
+    Write<T>(rawWriter, val);
+
+    out.Synchronize();
+
+    InteropInputStream in(&mem);
+    PortableReaderImpl reader(&in);
+    PortableRawReader rawReader(&reader);
+
+    T readVal = Read<T>(rawReader);
+    
+    BOOST_REQUIRE(readVal == val);
+}
+
+template<typename T>
+void CheckRawPrimitiveArray(T dflt, T val1, T val2)
+{
+    InteropUnpooledMemory mem(1024);
+
+    InteropOutputStream out(&mem);
+    PortableWriterImpl writer(&out, NULL);
+    PortableRawWriter rawWriter(&writer);
+    
+    InteropInputStream in(&mem);
+    PortableReaderImpl reader(&in);
+    PortableRawReader rawReader(&reader);
+
+    // 1. Write NULL and see what happens.
+    WriteArray<T>(rawWriter, NULL, 0);
+
+    out.Synchronize();
+    in.Synchronize();
+    
+    BOOST_REQUIRE(ReadArray<T>(rawReader, NULL, 0) == -1);
+
+    in.Position(0);
+    BOOST_REQUIRE(ReadArray<T>(rawReader, NULL, 2) == -1);
+
+    T arr1[2];
+    arr1[0] = dflt;
+    arr1[1] = dflt;
+
+    in.Position(0);
+    BOOST_REQUIRE(ReadArray<T>(rawReader, arr1, 1) == -1);
+
+    BOOST_REQUIRE(arr1[0] == dflt);
+    BOOST_REQUIRE(arr1[1] == dflt);
+
+    // 2. Write empty array.
+    T arr2[2];
+    arr2[0] = val1;
+    arr2[1] = val2;
+
+    out.Position(0);
+    in.Position(0);
+
+    WriteArray<T>(rawWriter, arr2, 0);
+
+    out.Synchronize();
+    in.Synchronize();
+
+    BOOST_REQUIRE(ReadArray<T>(rawReader, NULL, 0) == 0);
+
+    in.Position(0);
+    BOOST_REQUIRE(ReadArray<T>(rawReader, NULL, 2) == 0);
+
+    in.Position(0);
+    BOOST_REQUIRE(ReadArray<T>(rawReader, arr1, 0) == 0);
+    BOOST_REQUIRE(arr1[0] == dflt);
+    BOOST_REQUIRE(arr1[1] == dflt);
+
+    in.Position(0);
+    BOOST_REQUIRE(ReadArray<T>(rawReader, arr1, 2) == 0);
+    BOOST_REQUIRE(arr1[0] == dflt);
+    BOOST_REQUIRE(arr1[1] == dflt);
+
+    // 3. Partial array write.
+    out.Position(0);
+    in.Position(0);
+
+    WriteArray<T>(rawWriter, arr2, 1);
+
+    out.Synchronize();
+    in.Synchronize();
+
+    BOOST_REQUIRE(ReadArray<T>(rawReader, NULL, 0) == 1);
+    BOOST_REQUIRE(ReadArray<T>(rawReader, NULL, 2) == 1);
+
+    BOOST_REQUIRE(ReadArray<T>(rawReader, arr1, 0) == 1);
+    BOOST_REQUIRE(arr1[0] == dflt);
+    BOOST_REQUIRE(arr1[1] == dflt);
+
+    BOOST_REQUIRE(ReadArray<T>(rawReader, arr1, 1) == 1);
+    BOOST_REQUIRE(arr1[0] == val1);
+    BOOST_REQUIRE(arr1[1] == dflt);
+    arr1[0] = dflt;
+
+    in.Position(0);
+    BOOST_REQUIRE(ReadArray<T>(rawReader, arr1, 2) == 1);
+    BOOST_REQUIRE(arr1[0] == val1);
+    BOOST_REQUIRE(arr1[1] == dflt);
+    arr1[0] = dflt;
+
+    // 4. Full array write.
+    out.Position(0);
+    in.Position(0);
+
+    WriteArray<T>(rawWriter, arr2, 2);
+
+    out.Synchronize();
+    in.Synchronize();
+
+    BOOST_REQUIRE(ReadArray<T>(rawReader, NULL, 0) == 2);
+    BOOST_REQUIRE(ReadArray<T>(rawReader, NULL, 2) == 2);
+
+    BOOST_REQUIRE(ReadArray<T>(rawReader, arr1, 0) == 2);
+    BOOST_REQUIRE(arr1[0] == dflt);
+    BOOST_REQUIRE(arr1[1] == dflt);
+
+    BOOST_REQUIRE(ReadArray<T>(rawReader, arr1, 1) == 2);
+    BOOST_REQUIRE(arr1[0] == dflt);
+    BOOST_REQUIRE(arr1[1] == dflt);
+
+    BOOST_REQUIRE(ReadArray<T>(rawReader, arr1, 2) == 2);
+    BOOST_REQUIRE(arr1[0] == val1);
+    BOOST_REQUIRE(arr1[1] == val2);
+}
+
+void CheckRawWritesRestricted(PortableRawWriter& writer)
+{
+    try
+    {
+        writer.WriteInt8(1);
+
+        BOOST_FAIL("Not restricted.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+
+    try
+    {
+        int8_t arr[1];
+
+        writer.WriteInt8Array(arr, 1);
+
+        BOOST_FAIL("Not restricted.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+
+    try
+    {
+        Guid val(1, 1);
+
+        writer.WriteGuid(val);
+
+        BOOST_FAIL("Not restricted.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+
+    try
+    {
+        writer.WriteString("test");
+
+        BOOST_FAIL("Not restricted.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+
+    try 
+    {
+        writer.WriteArray<int8_t>();
+
+        BOOST_FAIL("Not restricted.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+
+    try 
+    {
+        writer.WriteCollection<int8_t>();
+
+        BOOST_FAIL("Not restricted.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+
+    try 
+    {
+        writer.WriteMap<int8_t, int8_t>();
+
+        BOOST_FAIL("Not restricted.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+}
+
+void CheckRawReadsRestricted(PortableRawReader& reader)
+{
+    try
+    {
+        reader.ReadInt8();
+
+        BOOST_FAIL("Not restricted.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+
+    try
+    {
+        int8_t arr[1];
+
+        reader.ReadInt8Array(arr, 1);
+
+        BOOST_FAIL("Not restricted.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+
+    try
+    {
+        reader.ReadGuid();
+
+        BOOST_FAIL("Not restricted.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+
+    try
+    {
+        reader.ReadString();
+
+        BOOST_FAIL("Not restricted.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+
+    try
+    {
+        reader.ReadArray<int8_t>();
+
+        BOOST_FAIL("Not restricted.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+
+    try
+    {
+        reader.ReadCollection<int8_t>();
+
+        BOOST_FAIL("Not restricted.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+
+    try
+    {
+        reader.ReadMap<int8_t, int8_t>();
+
+        BOOST_FAIL("Not restricted.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+}
+
+void CheckRawCollectionEmpty(CollectionType* colType)
+{
+    InteropUnpooledMemory mem(1024);
+
+    InteropOutputStream out(&mem);
+    PortableWriterImpl writer(&out, NULL);
+    PortableRawWriter rawWriter(&writer);
+
+    PortableCollectionWriter<PortableInner> colWriter = colType ?
+        rawWriter.WriteCollection<PortableInner>(*colType) : rawWriter.WriteCollection<PortableInner>();
+
+    CheckRawWritesRestricted(rawWriter);
+
+    colWriter.Close();
+
+    rawWriter.WriteInt8(1);
+
+    try
+    {
+        colWriter.Write(1);
+
+        BOOST_FAIL("Error expected.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+
+    try
+    {
+        colWriter.Close();
+
+        BOOST_FAIL("Error expected.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+
+    out.Synchronize();
+
+    InteropInputStream in(&mem);
+    PortableReaderImpl reader(&in);
+    PortableRawReader rawReader(&reader);
+
+    PortableCollectionReader<PortableInner> colReader = rawReader.ReadCollection<PortableInner>();
+
+    if (colType)
+        BOOST_REQUIRE(colReader.GetType() == *colType);
+    else
+        BOOST_REQUIRE(colReader.GetType() == IGNITE_COLLECTION_UNDEFINED);
+
+    BOOST_REQUIRE(colReader.GetSize() == 0);
+    BOOST_REQUIRE(!colReader.HasNext());
+    BOOST_REQUIRE(!colReader.IsNull());
+
+    try
+    {
+        colReader.GetNext();
+
+        BOOST_FAIL("Error expected.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+
+    BOOST_REQUIRE(rawReader.ReadInt8() == 1);
+}
+
+void CheckRawCollection(CollectionType* colType)
+{
+    PortableInner writeVal1 = PortableInner(1);
+    PortableInner writeVal2 = PortableInner(0);
+    PortableInner writeVal3 = PortableInner(2);
+
+    InteropUnpooledMemory mem(1024);
+
+    InteropOutputStream out(&mem);
+    PortableWriterImpl writer(&out, NULL);
+    PortableRawWriter rawWriter(&writer);
+
+    PortableCollectionWriter<PortableInner> colWriter = colType ?
+        rawWriter.WriteCollection<PortableInner>(*colType) : rawWriter.WriteCollection<PortableInner>();
+
+    colWriter.Write(writeVal1);
+    colWriter.Write(writeVal2);
+    colWriter.Write(writeVal3);
+
+    CheckRawWritesRestricted(rawWriter);
+
+    colWriter.Close();
+
+    rawWriter.WriteInt8(1);
+
+    try
+    {
+        colWriter.Write(1);
+
+        BOOST_FAIL("Error expected.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+
+    try
+    {
+        colWriter.Close();
+
+        BOOST_FAIL("Error expected.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+
+    out.Synchronize();
+
+    InteropInputStream in(&mem);
+    PortableReaderImpl reader(&in);
+    PortableRawReader rawReader(&reader);
+
+    PortableCollectionReader<PortableInner> colReader = rawReader.ReadCollection<PortableInner>();
+
+    CheckRawReadsRestricted(rawReader);
+
+    if (colType)
+        BOOST_REQUIRE(colReader.GetType() == *colType);
+    else
+        BOOST_REQUIRE(colReader.GetType() == IGNITE_COLLECTION_UNDEFINED);
+
+    BOOST_REQUIRE(colReader.GetSize() == 3);
+    BOOST_REQUIRE(!colReader.IsNull());
+
+    BOOST_REQUIRE(colReader.HasNext());
+    BOOST_REQUIRE(colReader.GetNext().GetValue() == writeVal1.GetValue());
+
+    BOOST_REQUIRE(colReader.HasNext());
+    BOOST_REQUIRE(colReader.GetNext().GetValue() == writeVal2.GetValue());
+
+    BOOST_REQUIRE(colReader.HasNext());
+    BOOST_REQUIRE(colReader.GetNext().GetValue() == writeVal3.GetValue());
+
+    BOOST_REQUIRE(!colReader.HasNext());
+
+    try
+    {
+        colReader.GetNext();
+
+        BOOST_FAIL("Error expected.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+
+    BOOST_REQUIRE(rawReader.ReadInt8() == 1);
+}
+
+void CheckRawMapEmpty(MapType* mapType)
+{
+    InteropUnpooledMemory mem(1024);
+
+    InteropOutputStream out(&mem);
+    PortableWriterImpl writer(&out, NULL);
+    PortableRawWriter rawWriter(&writer);
+
+    PortableMapWriter<int8_t, PortableInner> mapWriter = mapType ?
+        rawWriter.WriteMap<int8_t, PortableInner>(*mapType) : rawWriter.WriteMap<int8_t, PortableInner>();
+
+    CheckRawWritesRestricted(rawWriter);
+
+    mapWriter.Close();
+
+    rawWriter.WriteInt8(1);
+
+    try
+    {
+        mapWriter.Write(1, PortableInner(1));
+
+        BOOST_FAIL("Error expected.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+
+    try
+    {
+        mapWriter.Close();
+
+        BOOST_FAIL("Error expected.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+
+    out.Synchronize();
+
+    InteropInputStream in(&mem);
+    PortableReaderImpl reader(&in);
+    PortableRawReader rawReader(&reader);
+
+    PortableMapReader<int8_t, PortableInner> mapReader = rawReader.ReadMap<int8_t, PortableInner>();
+
+    if (mapType)
+        BOOST_REQUIRE(mapReader.GetType() == *mapType);
+    else
+        BOOST_REQUIRE(mapReader.GetType() == IGNITE_MAP_UNDEFINED);
+
+    BOOST_REQUIRE(mapReader.GetSize() == 0);
+    BOOST_REQUIRE(!mapReader.HasNext());
+    BOOST_REQUIRE(!mapReader.IsNull());
+
+    try
+    {
+        int8_t key;
+        PortableInner val;
+
+        mapReader.GetNext(&key, &val);
+
+        BOOST_FAIL("Error expected.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+
+    BOOST_REQUIRE(rawReader.ReadInt8() == 1);
+}
+
+void CheckRawMap(MapType* mapType)
+{
+    PortableInner writeVal1 = PortableInner(1);
+    PortableInner writeVal2 = PortableInner(0);
+    PortableInner writeVal3 = PortableInner(2);
+
+    InteropUnpooledMemory mem(1024);
+
+    InteropOutputStream out(&mem);
+    PortableWriterImpl writer(&out, NULL);
+    PortableRawWriter rawWriter(&writer);
+
+    PortableMapWriter<int8_t, PortableInner> mapWriter = mapType ?
+        rawWriter.WriteMap<int8_t, PortableInner>(*mapType) : rawWriter.WriteMap<int8_t, PortableInner>();
+
+    mapWriter.Write(1, writeVal1);
+    mapWriter.Write(2, writeVal2);
+    mapWriter.Write(3, writeVal3);
+
+    CheckRawWritesRestricted(rawWriter);
+
+    mapWriter.Close();
+
+    rawWriter.WriteInt8(1);
+
+    try
+    {
+        mapWriter.Write(4, PortableInner(4));
+
+        BOOST_FAIL("Error expected.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+
+    try
+    {
+        mapWriter.Close();
+
+        BOOST_FAIL("Error expected.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+
+    out.Synchronize();
+
+    InteropInputStream in(&mem);
+    PortableReaderImpl reader(&in);
+    PortableRawReader rawReader(&reader);
+
+    PortableMapReader<int8_t, PortableInner> mapReader = rawReader.ReadMap<int8_t, PortableInner>();
+
+    CheckRawReadsRestricted(rawReader);
+
+    if (mapType)
+        BOOST_REQUIRE(mapReader.GetType() == *mapType);
+    else
+        BOOST_REQUIRE(mapReader.GetType() == IGNITE_MAP_UNDEFINED);
+
+    BOOST_REQUIRE(mapReader.GetSize() == 3);
+    BOOST_REQUIRE(!mapReader.IsNull());
+
+    int8_t key;
+    PortableInner val;
+
+    BOOST_REQUIRE(mapReader.HasNext());
+
+    mapReader.GetNext(&key, &val);
+    BOOST_REQUIRE(key == 1);
+    BOOST_REQUIRE(val.GetValue() == writeVal1.GetValue());
+
+    mapReader.GetNext(&key, &val);
+    BOOST_REQUIRE(key == 2);
+    BOOST_REQUIRE(val.GetValue() == writeVal2.GetValue());
+
+    mapReader.GetNext(&key, &val);
+    BOOST_REQUIRE(key == 3);
+    BOOST_REQUIRE(val.GetValue() == writeVal3.GetValue());
+
+    BOOST_REQUIRE(!mapReader.HasNext());
+
+    try
+    {
+        mapReader.GetNext(&key, &val);
+
+        BOOST_FAIL("Error expected.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+
+    BOOST_REQUIRE(rawReader.ReadInt8() == 1);
+}
+
+BOOST_AUTO_TEST_SUITE(PortableReaderWriterRawTestSuite)
+
+BOOST_AUTO_TEST_CASE(TestPrimitiveInt8)
+{
+    CheckRawPrimitive<int8_t>(1);
+}
+
+BOOST_AUTO_TEST_CASE(TestPrimitiveBool)
+{
+    CheckRawPrimitive<bool>(true);
+}
+
+BOOST_AUTO_TEST_CASE(TestPrimitiveInt16)
+{
+    CheckRawPrimitive<int16_t>(1);
+}
+
+BOOST_AUTO_TEST_CASE(TestPrimitiveUInt16)
+{
+    CheckRawPrimitive<uint16_t>(1);
+}
+
+BOOST_AUTO_TEST_CASE(TestPrimitiveInt32)
+{
+    CheckRawPrimitive<int32_t>(1);
+}
+
+BOOST_AUTO_TEST_CASE(TestPrimitiveInt64)
+{
+    CheckRawPrimitive<int64_t>(1);
+}
+
+BOOST_AUTO_TEST_CASE(TestPrimitiveFloat)
+{
+    CheckRawPrimitive<float>(1.1f);
+}
+
+BOOST_AUTO_TEST_CASE(TestPrimitiveDouble)
+{
+    CheckRawPrimitive<double>(1.1);
+}
+
+BOOST_AUTO_TEST_CASE(TestPrimitiveGuid)
+{
+    Guid val(1, 2);
+
+    CheckRawPrimitive<Guid>(val);
+}
+
+BOOST_AUTO_TEST_CASE(TestPrimitiveArrayInt8)
+{
+    CheckRawPrimitiveArray<int8_t>(1, 2, 3);
+}
+
+BOOST_AUTO_TEST_CASE(TestPrimitiveArrayBool)
+{
+    CheckRawPrimitiveArray<bool>(false, true, false);
+}
+
+BOOST_AUTO_TEST_CASE(TestPrimitiveArrayInt16)
+{
+    CheckRawPrimitiveArray<int16_t>(1, 2, 3);
+}
+
+BOOST_AUTO_TEST_CASE(TestPrimitiveArrayUInt16)
+{
+    CheckRawPrimitiveArray<uint16_t>(1, 2, 3);
+}
+
+BOOST_AUTO_TEST_CASE(TestPrimitiveArrayInt32)
+{
+    CheckRawPrimitiveArray<int32_t>(1, 2, 3);
+}
+
+BOOST_AUTO_TEST_CASE(TestPrimitiveArrayInt64)
+{
+    CheckRawPrimitiveArray<int64_t>(1, 2, 3);
+}
+
+BOOST_AUTO_TEST_CASE(TestPrimitiveArrayFloat)
+{
+    CheckRawPrimitiveArray<float>(1.1f, 2.2f, 3.3f);
+}
+
+BOOST_AUTO_TEST_CASE(TestPrimitiveArrayDouble)
+{
+    CheckRawPrimitiveArray<double>(1.1, 2.2, 3.3);
+}
+
+BOOST_AUTO_TEST_CASE(TestPrimitiveArrayGuid)
+{
+    Guid dflt(1, 2);
+    Guid val1(3, 4);
+    Guid val2(5, 6);
+
+    CheckRawPrimitiveArray<Guid>(dflt, val1, val2);
+}
+
+BOOST_AUTO_TEST_CASE(TestGuidNull)
+{
+    InteropUnpooledMemory mem(1024);
+
+    InteropOutputStream out(&mem);
+    PortableWriterImpl writer(&out, NULL);
+    PortableRawWriter rawWriter(&writer);
+
+    rawWriter.WriteNull();
+
+    out.Synchronize();
+
+    InteropInputStream in(&mem);
+    PortableReaderImpl reader(&in);
+    PortableRawReader rawReader(&reader);
+
+    Guid expVal;
+    Guid actualVal = rawReader.ReadGuid();
+
+    BOOST_REQUIRE(actualVal == expVal);
+}
+
+BOOST_AUTO_TEST_CASE(TestString) {
+    InteropUnpooledMemory mem(1024);
+
+    InteropOutputStream out(&mem);
+    PortableWriterImpl writer(&out, NULL);
+    PortableRawWriter rawWriter(&writer);
+
+    const char* writeVal1 = "testtest";
+    const char* writeVal2 = "test";
+    std::string writeVal3 = writeVal1;
+
+    rawWriter.WriteString(writeVal1);
+    rawWriter.WriteString(writeVal1, 4);
+    rawWriter.WriteString(writeVal3);
+    rawWriter.WriteString(NULL);
+    rawWriter.WriteString(NULL, 4);
+
+    out.Synchronize();
+
+    InteropInputStream in(&mem);
+    PortableReaderImpl reader(&in);
+    PortableRawReader rawReader(&reader);
+
+    char readVal1[9];
+    char readVal2[5];
+    
+    BOOST_REQUIRE(rawReader.ReadString(NULL, 0) == 8);
+    BOOST_REQUIRE(rawReader.ReadString(NULL, 8) == 8);
+    BOOST_REQUIRE(rawReader.ReadString(readVal1, 0) == 8);
+    BOOST_REQUIRE(rawReader.ReadString(readVal1, 4) == 8);
+
+    BOOST_REQUIRE(rawReader.ReadString(readVal1, 9) == 8);
+    std::string writeVal1Str = writeVal1;
+    std::string readVal1Str = readVal1;
+    BOOST_REQUIRE(readVal1Str.compare(writeVal1Str) == 0);
+
+    BOOST_REQUIRE(rawReader.ReadString(readVal2, 5) == 4);
+    std::string writeVal2Str = writeVal2;
+    std::string readVal2Str = readVal2;
+    BOOST_REQUIRE(readVal2Str.compare(writeVal2Str) == 0);
+
+    std::string readVal3 = rawReader.ReadString();
+    BOOST_REQUIRE(readVal3.compare(writeVal3) == 0);
+
+    BOOST_REQUIRE(rawReader.ReadString(readVal1, 9) == -1);
+    BOOST_REQUIRE(rawReader.ReadString(readVal1, 9) == -1);
+}
+
+BOOST_AUTO_TEST_CASE(TestStringArrayNull)
+{
+    InteropUnpooledMemory mem(1024);
+
+    InteropOutputStream out(&mem);
+    PortableWriterImpl writer(&out, NULL);
+    PortableRawWriter rawWriter(&writer);
+
+    rawWriter.WriteNull();
+    rawWriter.WriteInt8(1);
+
+    out.Synchronize();
+
+    InteropInputStream in(&mem);
+    PortableReaderImpl reader(&in);
+    PortableRawReader rawReader(&reader);
+
+    PortableStringArrayReader arrReader = rawReader.ReadStringArray();
+
+    BOOST_REQUIRE(arrReader.GetSize() == -1);
+    BOOST_REQUIRE(!arrReader.HasNext());
+    BOOST_REQUIRE(arrReader.IsNull());
+
+    try
+    {
+        char res[100];
+
+        arrReader.GetNext(res, 100);
+
+        BOOST_FAIL("Error expected.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+
+    try
+    {
+        arrReader.GetNext();
+
+        BOOST_FAIL("Error expected.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+
+    BOOST_REQUIRE(rawReader.ReadInt8() == 1);
+}
+
+BOOST_AUTO_TEST_CASE(TestStringArrayEmpty)
+{
+    InteropUnpooledMemory mem(1024);
+
+    InteropOutputStream out(&mem);
+    PortableWriterImpl writer(&out, NULL);
+    PortableRawWriter rawWriter(&writer);
+
+    PortableStringArrayWriter arrWriter = rawWriter.WriteStringArray();
+
+    CheckRawWritesRestricted(rawWriter);
+
+    arrWriter.Close();
+
+    rawWriter.WriteInt8(1);
+
+    try
+    {
+        const char* val = "test";
+
+        arrWriter.Write(val, 4);
+
+        BOOST_FAIL("Error expected.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+
+    try
+    {
+        const char* val = "test";
+
+        arrWriter.Write(val);
+
+        BOOST_FAIL("Error expected.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+
+    try
+    {
+        std::string val = "test";
+
+        arrWriter.Write(val);
+
+        BOOST_FAIL("Error expected.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+
+    try
+    {
+        arrWriter.Close();
+
+        BOOST_FAIL("Error expected.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+
+    out.Synchronize();
+
+    InteropInputStream in(&mem);
+    PortableReaderImpl reader(&in);
+    PortableRawReader rawReader(&reader);
+
+    PortableStringArrayReader arrReader = rawReader.ReadStringArray();
+
+    BOOST_REQUIRE(arrReader.GetSize() == 0);
+    BOOST_REQUIRE(!arrReader.HasNext());
+    BOOST_REQUIRE(!arrReader.IsNull());
+
+    try
+    {
+        char res[100];
+
+        arrReader.GetNext(res, 100);
+
+        BOOST_FAIL("Error expected.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+
+    try
+    {
+        arrReader.GetNext();
+
+        BOOST_FAIL("Error expected.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+
+    BOOST_REQUIRE(rawReader.ReadInt8() == 1);
+}
+
+BOOST_AUTO_TEST_CASE(TestStringArray)
+{
+    const char* writeVal1 = "testtest";
+    const char* writeVal2 = "test";
+    std::string writeVal3 = "test2";
+
+    InteropUnpooledMemory mem(1024);
+
+    InteropOutputStream out(&mem);
+    PortableWriterImpl writer(&out, NULL);
+    PortableRawWriter rawWriter(&writer);
+
+    PortableStringArrayWriter arrWriter = rawWriter.WriteStringArray();
+
+    arrWriter.Write(writeVal1);
+    arrWriter.Write(writeVal1, 4);
+    arrWriter.Write(NULL); // NULL value.
+    arrWriter.Write(NULL, 100); // NULL value again.
+    arrWriter.Write(writeVal3);
+
+    CheckRawWritesRestricted(rawWriter);
+
+    arrWriter.Close();
+
+    rawWriter.WriteInt8(1);
+
+    try
+    {
+        const char* val = "test";
+
+        arrWriter.Write(val, 4);
+
+        BOOST_FAIL("Error expected.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+
+    try
+    {
+        const char* val = "test";
+
+        arrWriter.Write(val);
+
+        BOOST_FAIL("Error expected.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+
+    try
+    {
+        std::string val = "test";
+
+        arrWriter.Write(val);
+
+        BOOST_FAIL("Error expected.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+
+    try
+    {
+        arrWriter.Close();
+
+        BOOST_FAIL("Error expected.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+
+    out.Synchronize();
+
+    InteropInputStream in(&mem);
+    PortableReaderImpl reader(&in);
+    PortableRawReader rawReader(&reader);
+
+    PortableStringArrayReader arrReader = rawReader.ReadStringArray();
+
+    CheckRawReadsRestricted(rawReader);
+
+    BOOST_REQUIRE(arrReader.GetSize() == 5);
+    BOOST_REQUIRE(!arrReader.IsNull());
+
+    // 1. Read first value.
+    BOOST_REQUIRE(arrReader.HasNext());
+        
+    char readVal1[9];
+    
+    BOOST_REQUIRE(arrReader.GetNext(NULL, 0) == 8);
+    BOOST_REQUIRE(arrReader.GetNext(NULL, 8) == 8);
+    BOOST_REQUIRE(arrReader.GetNext(readVal1, 0) == 8);
+    BOOST_REQUIRE(arrReader.GetNext(readVal1, 4) == 8);
+
+    BOOST_REQUIRE(arrReader.GetNext(readVal1, 9) == 8);
+    std::string writeVal1Str = writeVal1;
+    std::string readVal1Str = readVal1;
+    BOOST_REQUIRE(readVal1Str.compare(writeVal1Str) == 0);
+
+    // 2. Read second value.
+    BOOST_REQUIRE(arrReader.HasNext());
+
+    char readVal2[5];
+
+    BOOST_REQUIRE(arrReader.GetNext(readVal2, 5) == 4);
+    std::string writeVal2Str = writeVal2;
+    std::string readVal2Str = readVal2;
+    BOOST_REQUIRE(readVal2Str.compare(writeVal2Str) == 0);
+
+    // 3. Read NULL.
+    BOOST_REQUIRE(arrReader.HasNext());
+
+    BOOST_REQUIRE(arrReader.GetNext(readVal1, 4) == -1);
+    readVal1Str = readVal1;
+    BOOST_REQUIRE(readVal1Str.compare(writeVal1Str) == 0);
+
+    // 4. Read NULL again, this time through another method.
+    BOOST_REQUIRE(arrReader.HasNext());
+
+    std::string readNullVal = arrReader.GetNext();
+
+    BOOST_REQUIRE(readNullVal.length() == 0);
+
+    // 5. Read third value.
+    BOOST_REQUIRE(arrReader.HasNext());
+
+    std::string readVal3 = arrReader.GetNext();
+    BOOST_REQUIRE(readVal3.compare(writeVal3) == 0);
+
+    BOOST_REQUIRE(!arrReader.HasNext());
+
+    try
+    {
+        char res[100];
+
+        arrReader.GetNext(res, 100);
+
+        BOOST_FAIL("Error expected.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+
+    try
+    {
+        arrReader.GetNext();
+
+        BOOST_FAIL("Error expected.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+
+    BOOST_REQUIRE(rawReader.ReadInt8() == 1);
+}
+
+BOOST_AUTO_TEST_CASE(TestObject)
+{
+    PortableInner writeVal1(1);
+    PortableInner writeVal2(0);
+
+    InteropUnpooledMemory mem(1024);
+
+    InteropOutputStream out(&mem);
+    PortableWriterImpl writer(&out, NULL);
+    PortableRawWriter rawWriter(&writer);
+
+    rawWriter.WriteObject(writeVal1);
+    rawWriter.WriteObject(writeVal2);
+    rawWriter.WriteNull();
+
+    out.Synchronize();
+
+    InteropInputStream in(&mem);
+    PortableReaderImpl reader(&in);
+    PortableRawReader rawReader(&reader);
+
+    PortableInner readVal1 = rawReader.ReadObject<PortableInner>();
+    BOOST_REQUIRE(writeVal1.GetValue() == readVal1.GetValue());
+
+    PortableInner readVal2 = rawReader.ReadObject<PortableInner>();
+    BOOST_REQUIRE(writeVal2.GetValue() == readVal2.GetValue());
+
+    PortableInner readVal3 = rawReader.ReadObject<PortableInner>();
+    BOOST_REQUIRE(0 == readVal3.GetValue());
+}
+
+BOOST_AUTO_TEST_CASE(TestNestedObject)
+{
+    PortableOuter writeVal1(1, 2);
+    PortableOuter writeVal2(0, 0);
+
+    InteropUnpooledMemory mem(1024);
+
+    InteropOutputStream out(&mem);
+    PortableWriterImpl writer(&out, NULL);
+    PortableRawWriter rawWriter(&writer);
+
+    rawWriter.WriteObject(writeVal1);
+    rawWriter.WriteObject(writeVal2);
+    rawWriter.WriteNull();
+
+    out.Synchronize();
+
+    InteropInputStream in(&mem);
+    PortableReaderImpl reader(&in);
+    PortableRawReader rawReader(&reader);
+
+    PortableOuter readVal1 = rawReader.ReadObject<PortableOuter>();
+    BOOST_REQUIRE(writeVal1.GetValue() == readVal1.GetValue());
+    BOOST_REQUIRE(writeVal1.GetInner().GetValue() == readVal1.GetInner().GetValue());
+
+    PortableOuter readVal2 = rawReader.ReadObject<PortableOuter>();
+    BOOST_REQUIRE(writeVal2.GetValue() == readVal2.GetValue());
+    BOOST_REQUIRE(writeVal2.GetInner().GetValue() == readVal2.GetInner().GetValue());
+
+    PortableOuter readVal3 = rawReader.ReadObject<PortableOuter>();
+    BOOST_REQUIRE(0 == readVal3.GetValue());
+    BOOST_REQUIRE(0 == readVal3.GetInner().GetValue());
+}
+
+BOOST_AUTO_TEST_CASE(TestArrayNull)
+{
+    InteropUnpooledMemory mem(1024);
+
+    InteropOutputStream out(&mem);
+    PortableWriterImpl writer(&out, NULL);
+    PortableRawWriter rawWriter(&writer);
+
+    rawWriter.WriteNull();
+    rawWriter.WriteInt8(1);
+
+    out.Synchronize();
+
+    InteropInputStream in(&mem);
+    PortableReaderImpl reader(&in);
+    PortableRawReader rawReader(&reader);
+
+    PortableArrayReader<PortableInner> arrReader = rawReader.ReadArray<PortableInner>();
+
+    BOOST_REQUIRE(arrReader.GetSize() == -1);
+    BOOST_REQUIRE(!arrReader.HasNext());
+    BOOST_REQUIRE(arrReader.IsNull());
+
+    try
+    {
+        arrReader.GetNext();
+
+        BOOST_FAIL("Error expected.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+
+    BOOST_REQUIRE(rawReader.ReadInt8() == 1);
+}
+
+BOOST_AUTO_TEST_CASE(TestArrayEmpty) 
+{
+    InteropUnpooledMemory mem(1024);
+
+    InteropOutputStream out(&mem);
+    PortableWriterImpl writer(&out, NULL);
+    PortableRawWriter rawWriter(&writer);
+
+    PortableArrayWriter<PortableInner> arrWriter = rawWriter.WriteArray<PortableInner>();
+
+    CheckRawWritesRestricted(rawWriter);
+
+    arrWriter.Close();
+
+    rawWriter.WriteInt8(1);
+
+    try
+    {
+        arrWriter.Write(1);
+
+        BOOST_FAIL("Error expected.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+
+    try
+    {
+        arrWriter.Close();
+
+        BOOST_FAIL("Error expected.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+
+    out.Synchronize();
+
+    InteropInputStream in(&mem);
+    PortableReaderImpl reader(&in);
+    PortableRawReader rawReader(&reader);
+
+    PortableArrayReader<PortableInner> arrReader = rawReader.ReadArray<PortableInner>();
+
+    BOOST_REQUIRE(arrReader.GetSize() == 0);
+    BOOST_REQUIRE(!arrReader.HasNext());
+    BOOST_REQUIRE(!arrReader.IsNull());
+
+    try
+    {
+        arrReader.GetNext();
+
+        BOOST_FAIL("Error expected.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+
+    BOOST_REQUIRE(rawReader.ReadInt8() == 1);
+}
+
+BOOST_AUTO_TEST_CASE(TestArray)
+{
+    PortableInner writeVal1 = PortableInner(1);
+    PortableInner writeVal2 = PortableInner(0);
+    PortableInner writeVal3 = PortableInner(2);
+
+    InteropUnpooledMemory mem(1024);
+
+    InteropOutputStream out(&mem);
+    PortableWriterImpl writer(&out, NULL);
+    PortableRawWriter rawWriter(&writer);
+
+    PortableArrayWriter<PortableInner> arrWriter = rawWriter.WriteArray<PortableInner>();
+
+    arrWriter.Write(writeVal1); 
+    arrWriter.Write(writeVal2);
+    arrWriter.Write(writeVal3);
+
+    CheckRawWritesRestricted(rawWriter);
+
+    arrWriter.Close();
+
+    rawWriter.WriteInt8(1);
+
+    try
+    {
+        arrWriter.Write(1);
+
+        BOOST_FAIL("Error expected.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+
+    try
+    {
+        arrWriter.Close();
+
+        BOOST_FAIL("Error expected.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+
+    out.Synchronize();
+
+    InteropInputStream in(&mem);
+    PortableReaderImpl reader(&in);
+    PortableRawReader rawReader(&reader);
+
+    PortableArrayReader<PortableInner> arrReader = rawReader.ReadArray<PortableInner>();
+
+    CheckRawReadsRestricted(rawReader);
+
+    BOOST_REQUIRE(arrReader.GetSize() == 3);
+    BOOST_REQUIRE(!arrReader.IsNull());
+
+    BOOST_REQUIRE(arrReader.HasNext());
+    BOOST_REQUIRE(arrReader.GetNext().GetValue() == writeVal1.GetValue());
+
+    BOOST_REQUIRE(arrReader.HasNext());
+    BOOST_REQUIRE(arrReader.GetNext().GetValue() == writeVal2.GetValue());
+
+    BOOST_REQUIRE(arrReader.HasNext());
+    BOOST_REQUIRE(arrReader.GetNext().GetValue() == writeVal3.GetValue());
+
+    BOOST_REQUIRE(!arrReader.HasNext());
+
+    try
+    {
+        arrReader.GetNext();
+
+        BOOST_FAIL("Error expected.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+
+    BOOST_REQUIRE(rawReader.ReadInt8() == 1);
+}
+
+BOOST_AUTO_TEST_CASE(TestCollectionNull)
+{
+    InteropUnpooledMemory mem(1024);
+
+    InteropOutputStream out(&mem);
+    PortableWriterImpl writer(&out, NULL);
+    PortableRawWriter rawWriter(&writer);
+
+    rawWriter.WriteNull();
+    rawWriter.WriteInt8(1);
+
+    out.Synchronize();
+
+    InteropInputStream in(&mem);
+    PortableReaderImpl reader(&in);
+    PortableRawReader rawReader(&reader);
+
+    PortableCollectionReader<PortableInner> colReader = rawReader.ReadCollection<PortableInner>();
+
+    BOOST_REQUIRE(colReader.GetType() == IGNITE_COLLECTION_UNDEFINED);
+    BOOST_REQUIRE(colReader.GetSize() == -1);
+    BOOST_REQUIRE(!colReader.HasNext());
+    BOOST_REQUIRE(colReader.IsNull()); 
+
+    try
+    {
+        colReader.GetNext();
+
+        BOOST_FAIL("Error expected.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+
+    BOOST_REQUIRE(rawReader.ReadInt8() == 1);
+}
+
+BOOST_AUTO_TEST_CASE(TestCollectionEmpty)
+{
+    CheckRawCollectionEmpty(NULL);
+}
+
+BOOST_AUTO_TEST_CASE(TestCollectionEmptyTyped)
+{
+    CollectionType typ = IGNITE_COLLECTION_CONCURRENT_SKIP_LIST_SET;
+
+    CheckRawCollectionEmpty(&typ);
+}
+
+BOOST_AUTO_TEST_CASE(TestCollection)
+{
+    CheckRawCollection(NULL);
+}
+
+BOOST_AUTO_TEST_CASE(testCollectionTyped)
+{
+    CollectionType typ = IGNITE_COLLECTION_CONCURRENT_SKIP_LIST_SET;
+
+    CheckRawCollection(&typ);
+}
+
+BOOST_AUTO_TEST_CASE(TestMapNull)
+{
+    InteropUnpooledMemory mem(1024);
+
+    InteropOutputStream out(&mem);
+    PortableWriterImpl writer(&out, NULL);
+    PortableRawWriter rawWriter(&writer);
+
+    rawWriter.WriteNull();
+    rawWriter.WriteInt8(1);
+
+    out.Synchronize();
+
+    InteropInputStream in(&mem);
+    PortableReaderImpl reader(&in);
+    PortableRawReader rawReader(&reader);
+
+    PortableMapReader<int8_t, PortableInner> mapReader = rawReader.ReadMap<int8_t, PortableInner>();
+
+    BOOST_REQUIRE(mapReader.GetType() == IGNITE_MAP_UNDEFINED);
+    BOOST_REQUIRE(mapReader.GetSize() == -1);
+    BOOST_REQUIRE(!mapReader.HasNext());
+    BOOST_REQUIRE(mapReader.IsNull());
+
+    try
+    {
+        int8_t key;
+        PortableInner val;
+
+        mapReader.GetNext(&key, &val);
+
+        BOOST_FAIL("Error expected.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+
+    BOOST_REQUIRE(rawReader.ReadInt8() == 1);
+}
+
+BOOST_AUTO_TEST_CASE(TestMapEmpty)
+{
+    CheckRawMapEmpty(NULL);
+}
+
+BOOST_AUTO_TEST_CASE(TestMapEmptyTyped)
+{
+    MapType typ = IGNITE_MAP_CONCURRENT_HASH_MAP;
+
+    CheckRawMapEmpty(&typ);
+}
+
+BOOST_AUTO_TEST_CASE(TestMap)
+{
+    CheckRawMap(NULL);
+}
+
+BOOST_AUTO_TEST_CASE(TestMapTyped)
+{
+    MapType typ = IGNITE_MAP_CONCURRENT_HASH_MAP;
+
+    CheckRawMap(&typ);
+}
+
+BOOST_AUTO_TEST_SUITE_END()
\ No newline at end of file


[15/28] ignite git commit: IGNITE-1513: Moved CPP.

Posted by vo...@apache.org.
http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/core/src/impl/portable/portable_writer_impl.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/core/src/impl/portable/portable_writer_impl.cpp b/modules/platform/cpp/core/src/impl/portable/portable_writer_impl.cpp
new file mode 100644
index 0000000..93aacd9
--- /dev/null
+++ b/modules/platform/cpp/core/src/impl/portable/portable_writer_impl.cpp
@@ -0,0 +1,600 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "ignite/impl/portable/portable_writer_impl.h"
+#include "ignite/ignite_error.h"
+
+using namespace ignite::impl::interop;
+using namespace ignite::impl::portable;
+using namespace ignite::portable;
+
+namespace ignite
+{
+    namespace impl
+    {
+        namespace portable
+        {
+            PortableWriterImpl::PortableWriterImpl(InteropOutputStream* stream, PortableIdResolver* idRslvr, 
+                PortableMetadataManager* metaMgr, PortableMetadataHandler* metaHnd) :
+                stream(stream), idRslvr(idRslvr), metaMgr(metaMgr), metaHnd(metaHnd), typeId(idRslvr->GetTypeId()),
+                elemIdGen(0), elemId(0), elemCnt(0), elemPos(-1), rawPos(-1)
+            {
+                // No-op.
+            }
+            
+            PortableWriterImpl::PortableWriterImpl(InteropOutputStream* stream, PortableMetadataManager* metaMgr) :
+                stream(stream), idRslvr(NULL), metaMgr(metaMgr), metaHnd(NULL), typeId(0), 
+                elemIdGen(0), elemId(0), elemCnt(0), elemPos(-1), rawPos(0)
+            {
+                // No-op.
+            }
+
+            void PortableWriterImpl::WriteInt8(const int8_t val)
+            {
+                WritePrimitiveRaw<int8_t>(val, PortableUtils::WriteInt8);
+            }
+
+            void PortableWriterImpl::WriteInt8Array(const int8_t* val, const int32_t len)
+            {
+                WritePrimitiveArrayRaw<int8_t>(val, len, PortableUtils::WriteInt8Array, IGNITE_TYPE_ARRAY_BYTE);
+            }
+
+            void PortableWriterImpl::WriteInt8(const char* fieldName, const int8_t val)
+            {
+                WritePrimitive<int8_t>(fieldName, val, PortableUtils::WriteInt8, IGNITE_TYPE_BYTE, 1);
+            }
+
+            void PortableWriterImpl::WriteInt8Array(const char* fieldName, const int8_t* val, const int32_t len)
+            {
+                WritePrimitiveArray<int8_t>(fieldName, val, len, PortableUtils::WriteInt8Array, IGNITE_TYPE_ARRAY_BYTE, 0);
+            }
+
+            void PortableWriterImpl::WriteBool(const bool val)
+            {
+                WritePrimitiveRaw<bool>(val, PortableUtils::WriteBool);
+            }
+
+            void PortableWriterImpl::WriteBoolArray(const bool* val, const int32_t len)
+            {
+                WritePrimitiveArrayRaw<bool>(val, len, PortableUtils::WriteBoolArray, IGNITE_TYPE_ARRAY_BOOL);
+            }
+
+            void PortableWriterImpl::WriteBool(const char* fieldName, const bool val)
+            {
+                WritePrimitive<bool>(fieldName, val, PortableUtils::WriteBool, IGNITE_TYPE_BOOL, 1);
+            }
+
+            void PortableWriterImpl::WriteBoolArray(const char* fieldName, const bool* val, const int32_t len)
+            {
+                WritePrimitiveArray<bool>(fieldName, val, len, PortableUtils::WriteBoolArray, IGNITE_TYPE_ARRAY_BOOL, 0);
+            }
+
+            void PortableWriterImpl::WriteInt16(const int16_t val)
+            {
+                WritePrimitiveRaw<int16_t>(val, PortableUtils::WriteInt16);
+            }
+
+            void PortableWriterImpl::WriteInt16Array(const int16_t* val, const int32_t len)
+            {
+                WritePrimitiveArrayRaw<int16_t>(val, len, PortableUtils::WriteInt16Array, IGNITE_TYPE_ARRAY_SHORT);
+            }
+
+            void PortableWriterImpl::WriteInt16(const char* fieldName, const int16_t val)
+            {
+                WritePrimitive<int16_t>(fieldName, val, PortableUtils::WriteInt16, IGNITE_TYPE_SHORT, 2);
+            }
+
+            void PortableWriterImpl::WriteInt16Array(const char* fieldName, const int16_t* val, const int32_t len)
+            {
+                WritePrimitiveArray<int16_t>(fieldName, val, len, PortableUtils::WriteInt16Array, IGNITE_TYPE_ARRAY_SHORT, 1);
+            }
+
+            void PortableWriterImpl::WriteUInt16(const uint16_t val)
+            {
+                WritePrimitiveRaw<uint16_t>(val, PortableUtils::WriteUInt16);
+            }
+
+            void PortableWriterImpl::WriteUInt16Array(const uint16_t* val, const int32_t len)
+            {
+                WritePrimitiveArrayRaw<uint16_t>(val, len, PortableUtils::WriteUInt16Array, IGNITE_TYPE_ARRAY_CHAR);
+            }
+
+            void PortableWriterImpl::WriteUInt16(const char* fieldName, const uint16_t val)
+            {
+                WritePrimitive<uint16_t>(fieldName, val, PortableUtils::WriteUInt16, IGNITE_TYPE_CHAR, 2);
+            }
+
+            void PortableWriterImpl::WriteUInt16Array(const char* fieldName, const uint16_t* val, const int32_t len)
+            {
+                WritePrimitiveArray<uint16_t>(fieldName, val, len, PortableUtils::WriteUInt16Array, IGNITE_TYPE_ARRAY_CHAR, 1);
+            }
+
+            void PortableWriterImpl::WriteInt32(const int32_t val)
+            {
+                WritePrimitiveRaw<int32_t>(val, PortableUtils::WriteInt32);
+            }
+
+            void PortableWriterImpl::WriteInt32Array(const int32_t* val, const int32_t len)
+            {
+                WritePrimitiveArrayRaw<int32_t>(val, len, PortableUtils::WriteInt32Array, IGNITE_TYPE_ARRAY_INT);
+            }
+
+            void PortableWriterImpl::WriteInt32(const char* fieldName, const int32_t val)
+            {
+                WritePrimitive<int32_t>(fieldName, val, PortableUtils::WriteInt32, IGNITE_TYPE_INT, 4);
+            }
+
+            void PortableWriterImpl::WriteInt32Array(const char* fieldName, const int32_t* val, const int32_t len)
+            {
+                WritePrimitiveArray<int32_t>(fieldName, val, len, PortableUtils::WriteInt32Array, IGNITE_TYPE_ARRAY_INT, 2);
+            }
+
+            void PortableWriterImpl::WriteInt64(const int64_t val)
+            {
+                WritePrimitiveRaw<int64_t>(val, PortableUtils::WriteInt64);
+            }
+
+            void PortableWriterImpl::WriteInt64Array(const int64_t* val, const int32_t len)
+            {
+                WritePrimitiveArrayRaw<int64_t>(val, len, PortableUtils::WriteInt64Array, IGNITE_TYPE_ARRAY_LONG);
+            }
+
+            void PortableWriterImpl::WriteInt64(const char* fieldName, const int64_t val)
+            {
+                WritePrimitive<int64_t>(fieldName, val, PortableUtils::WriteInt64, IGNITE_TYPE_LONG, 8);
+            }
+
+            void PortableWriterImpl::WriteInt64Array(const char* fieldName, const int64_t* val, const int32_t len)
+            {
+                WritePrimitiveArray<int64_t>(fieldName, val, len, PortableUtils::WriteInt64Array, IGNITE_TYPE_ARRAY_LONG, 3);
+            }
+
+            void PortableWriterImpl::WriteFloat(const float val)
+            {
+                WritePrimitiveRaw<float>(val, PortableUtils::WriteFloat);
+            }
+
+            void PortableWriterImpl::WriteFloatArray(const float* val, const int32_t len)
+            {
+                WritePrimitiveArrayRaw<float>(val, len, PortableUtils::WriteFloatArray, IGNITE_TYPE_ARRAY_FLOAT);
+            }
+
+            void PortableWriterImpl::WriteFloat(const char* fieldName, const float val)
+            {
+                WritePrimitive<float>(fieldName, val, PortableUtils::WriteFloat, IGNITE_TYPE_FLOAT, 4);
+            }
+
+            void PortableWriterImpl::WriteFloatArray(const char* fieldName, const float* val, const int32_t len)
+            {
+                WritePrimitiveArray<float>(fieldName, val, len, PortableUtils::WriteFloatArray, IGNITE_TYPE_ARRAY_FLOAT, 2);
+            }
+
+            void PortableWriterImpl::WriteDouble(const double val)
+            {
+                WritePrimitiveRaw<double>(val, PortableUtils::WriteDouble);
+            }
+
+            void PortableWriterImpl::WriteDoubleArray(const double* val, const int32_t len)
+            {
+                WritePrimitiveArrayRaw<double>(val, len, PortableUtils::WriteDoubleArray, IGNITE_TYPE_ARRAY_DOUBLE);
+            }
+
+            void PortableWriterImpl::WriteDouble(const char* fieldName, const double val)
+            {
+                WritePrimitive<double>(fieldName, val, PortableUtils::WriteDouble, IGNITE_TYPE_DOUBLE, 8);
+            }
+
+            void PortableWriterImpl::WriteDoubleArray(const char* fieldName, const double* val, const int32_t len)
+            {
+                WritePrimitiveArray<double>(fieldName, val, len, PortableUtils::WriteDoubleArray, IGNITE_TYPE_ARRAY_DOUBLE, 3);
+            }
+
+            void PortableWriterImpl::WriteGuid(const Guid val)
+            {                
+                CheckRawMode(true);
+                CheckSingleMode(true);
+
+                stream->WriteInt8(IGNITE_TYPE_UUID);
+
+                PortableUtils::WriteGuid(stream, val);
+            }
+
+            void PortableWriterImpl::WriteGuidArray(const Guid* val, const int32_t len)
+            {
+                CheckRawMode(true);
+                CheckSingleMode(true);
+                
+                if (val)
+                {
+                    stream->WriteInt8(IGNITE_TYPE_ARRAY_UUID);
+                    stream->WriteInt32(len);
+
+                    for (int i = 0; i < len; i++)
+                    {
+                        Guid elem = *(val + i);
+
+                        stream->WriteInt8(IGNITE_TYPE_UUID);
+                        PortableUtils::WriteGuid(stream, elem);
+                    }
+                }
+                else
+                    stream->WriteInt8(IGNITE_HDR_NULL);
+            }
+
+            void PortableWriterImpl::WriteGuid(const char* fieldName, const Guid val)
+            {
+                CheckRawMode(false);
+                CheckSingleMode(true);
+
+                WriteFieldIdAndLength(fieldName, IGNITE_TYPE_UUID, 1 + 16);
+
+                stream->WriteInt8(IGNITE_TYPE_UUID);
+
+                PortableUtils::WriteGuid(stream, val);
+            }
+
+            void PortableWriterImpl::WriteGuidArray(const char* fieldName, const Guid* val, const int32_t len)
+            {
+                CheckRawMode(false);
+                CheckSingleMode(true);
+
+                WriteFieldId(fieldName, IGNITE_TYPE_ARRAY_UUID);
+
+                if (val)
+                {
+                    stream->WriteInt32(5 + len * 17);
+                    stream->WriteInt8(IGNITE_TYPE_ARRAY_UUID);
+                    stream->WriteInt32(len);
+
+                    for (int i = 0; i < len; i++)
+                    {
+                        Guid elem = *(val + i);
+
+                        WriteTopObject(elem);
+                    }
+                }
+                else
+                {
+                    stream->WriteInt32(1);
+                    stream->WriteInt8(IGNITE_HDR_NULL);
+                }
+            }
+
+            void PortableWriterImpl::WriteString(const char* val, const int32_t len)
+            {
+                CheckRawMode(true);
+                CheckSingleMode(true);
+
+                if (val) 
+                {
+                    stream->WriteInt8(IGNITE_TYPE_STRING);
+
+                    PortableUtils::WriteString(stream, val, len);
+                }
+                else
+                    stream->WriteInt8(IGNITE_HDR_NULL);
+            }
+
+            void PortableWriterImpl::WriteString(const char* fieldName, const char* val, const int32_t len)
+            {
+                CheckRawMode(false);
+                CheckSingleMode(true);
+
+                WriteFieldId(fieldName, IGNITE_TYPE_STRING);
+                
+                if (val)
+                {
+                    int32_t lenPos = stream->Position();
+                    stream->Position(lenPos + 4);
+
+                    stream->WriteInt8(IGNITE_TYPE_STRING);
+                    stream->WriteBool(false);
+                    stream->WriteInt32(len);
+
+                    for (int i = 0; i < len; i++)
+                        stream->WriteUInt16(*(val + i));
+
+                    stream->WriteInt32(lenPos, stream->Position() - lenPos - 4);
+                }
+                else
+                {
+                    stream->WriteInt32(1);
+                    stream->WriteInt8(IGNITE_HDR_NULL);
+                }
+            }
+
+            int32_t PortableWriterImpl::WriteStringArray()
+            {
+                StartContainerSession(true);
+
+                stream->WriteInt8(IGNITE_TYPE_ARRAY_STRING);
+                stream->Position(stream->Position() + 4);
+
+                return elemId;
+            }
+
+            int32_t PortableWriterImpl::WriteStringArray(const char* fieldName)
+            {
+                StartContainerSession(false);
+
+                WriteFieldIdSkipLength(fieldName, IGNITE_TYPE_ARRAY_STRING);
+
+                stream->WriteInt8(IGNITE_TYPE_ARRAY_STRING);
+                stream->Position(stream->Position() + 4);
+
+                return elemId;
+            }
+
+            void PortableWriterImpl::WriteStringElement(int32_t id, const char* val, int32_t len)
+            {
+                CheckSession(id);
+
+                if (val)
+                {
+                    stream->WriteInt8(IGNITE_TYPE_STRING);
+
+                    PortableUtils::WriteString(stream, val, len);
+                }
+                else
+                    stream->WriteInt8(IGNITE_HDR_NULL);
+
+                elemCnt++;
+            }
+
+            void PortableWriterImpl::WriteNull()
+            {
+                CheckRawMode(true);
+                CheckSingleMode(true);
+
+                stream->WriteInt8(IGNITE_HDR_NULL);
+            }
+
+            void PortableWriterImpl::WriteNull(const char* fieldName)
+            {
+                CheckRawMode(false);
+                CheckSingleMode(true);
+
+                WriteFieldIdAndLength(fieldName, IGNITE_TYPE_OBJECT, 1);
+                stream->WriteInt8(IGNITE_HDR_NULL);
+            }
+
+            int32_t PortableWriterImpl::WriteArray()
+            {
+                StartContainerSession(true);
+                
+                stream->WriteInt8(IGNITE_TYPE_ARRAY);
+                stream->Position(stream->Position() + 4);
+
+                return elemId;
+            }
+
+            int32_t PortableWriterImpl::WriteArray(const char* fieldName)
+            {
+                StartContainerSession(false);
+
+                WriteFieldIdSkipLength(fieldName, IGNITE_TYPE_ARRAY);
+
+                stream->WriteInt8(IGNITE_TYPE_ARRAY);
+                stream->Position(stream->Position() + 4);
+
+                return elemId;
+            }
+
+            int32_t PortableWriterImpl::WriteCollection(CollectionType typ)
+            {
+                StartContainerSession(true);
+
+                stream->WriteInt8(IGNITE_TYPE_COLLECTION);
+                stream->Position(stream->Position() + 4);
+                stream->WriteInt8(typ);
+
+                return elemId;
+            }
+
+            int32_t PortableWriterImpl::WriteCollection(const char* fieldName, CollectionType typ)
+            {
+                StartContainerSession(false);
+                
+                WriteFieldIdSkipLength(fieldName, IGNITE_TYPE_COLLECTION);
+
+                stream->WriteInt8(IGNITE_TYPE_COLLECTION);
+                stream->Position(stream->Position() + 4);
+                stream->WriteInt8(typ);
+
+                return elemId;
+            }
+
+            int32_t PortableWriterImpl::WriteMap(ignite::portable::MapType typ)
+            {
+                StartContainerSession(true);
+
+                stream->WriteInt8(IGNITE_TYPE_MAP);
+                stream->Position(stream->Position() + 4);
+                stream->WriteInt8(typ);
+
+                return elemId;
+            }
+
+            int32_t PortableWriterImpl::WriteMap(const char* fieldName, ignite::portable::MapType typ)
+            {
+                StartContainerSession(false);
+
+                WriteFieldIdSkipLength(fieldName, IGNITE_TYPE_MAP);
+                
+                stream->WriteInt8(IGNITE_TYPE_MAP);
+                stream->Position(stream->Position() + 4);
+                stream->WriteInt8(typ);
+
+                return elemId;
+            }
+
+            void PortableWriterImpl::CommitContainer(int32_t id)
+            {
+                CheckSession(id);
+
+                if (rawPos == -1)
+                {
+                    int32_t len = stream->Position() - elemPos - 4;
+
+                    stream->WriteInt32(elemPos + 4, len);
+                    stream->WriteInt32(elemPos + 9, elemCnt);
+                }
+                else
+                    stream->WriteInt32(elemPos + 1, elemCnt);
+
+                elemId = 0;
+                elemCnt = 0;
+                elemPos = -1;
+            }
+            
+            void PortableWriterImpl::SetRawMode()
+            {
+                CheckRawMode(false);
+                CheckSingleMode(true);
+
+                rawPos = stream->Position();
+            }
+
+            int32_t PortableWriterImpl::GetRawPosition()
+            {
+                return rawPos == -1 ? stream->Position() : rawPos;
+            }
+
+            void PortableWriterImpl::CheckRawMode(bool expected)
+            {
+                bool rawMode = rawPos != -1;
+
+                if (expected && !rawMode) {
+                    IGNITE_ERROR_1(IgniteError::IGNITE_ERR_PORTABLE, "Operation can be performed only in raw mode.");
+                }
+                else if (!expected && rawMode) {
+                    IGNITE_ERROR_1(IgniteError::IGNITE_ERR_PORTABLE, "Operation cannot be performed in raw mode.");
+                }
+            }
+
+            void PortableWriterImpl::CheckSingleMode(bool expected)
+            {
+                if (expected && elemId != 0) {
+                    IGNITE_ERROR_1(IgniteError::IGNITE_ERR_PORTABLE, "Operation cannot be performed when container is being written.");
+                }
+                else if (!expected && elemId == 0) {
+                    IGNITE_ERROR_1(IgniteError::IGNITE_ERR_PORTABLE, "Operation can be performed only when container is being written.");
+                }
+            }
+
+            void PortableWriterImpl::StartContainerSession(bool expRawMode)
+            {
+                CheckRawMode(expRawMode);
+                CheckSingleMode(true);
+
+                elemId = ++elemIdGen;
+                elemPos = stream->Position();
+            }
+
+            void PortableWriterImpl::CheckSession(int32_t expSes)
+            {
+                if (elemId != expSes) 
+                {
+                    IGNITE_ERROR_1(IgniteError::IGNITE_ERR_PORTABLE, "Containter write session has been finished or is not started yet.");
+                }
+            }
+
+            void PortableWriterImpl::WriteFieldId(const char* fieldName, int32_t fieldTypeId)
+            {
+                int32_t fieldId = idRslvr->GetFieldId(typeId, fieldName);
+                
+                stream->WriteInt32(fieldId);
+
+                if (metaHnd)
+                    metaHnd->OnFieldWritten(fieldId, fieldName, fieldTypeId);
+            }
+
+            void PortableWriterImpl::WriteFieldIdSkipLength(const char* fieldName, int32_t fieldTypeId)
+            {
+                WriteFieldId(fieldName, fieldTypeId);
+
+                stream->Position(stream->Position() + 4);
+            }
+
+            void PortableWriterImpl::WriteFieldIdAndLength(const char* fieldName, int32_t fieldTypeId, int32_t len)
+            {
+                WriteFieldId(fieldName, fieldTypeId);
+
+                stream->WriteInt32(len);
+            }
+            
+            template <>
+            void PortableWriterImpl::WriteTopObject<int8_t>(const int8_t& obj)
+            {
+                WriteTopObject0<int8_t>(obj, PortableUtils::WriteInt8, IGNITE_TYPE_BYTE);
+            }
+
+            template <>
+            void PortableWriterImpl::WriteTopObject<bool>(const bool& obj)
+            {
+                WriteTopObject0<bool>(obj, PortableUtils::WriteBool, IGNITE_TYPE_BOOL);
+            }
+
+            template <>
+            void PortableWriterImpl::WriteTopObject<int16_t>(const int16_t& obj)
+            {
+                WriteTopObject0<int16_t>(obj, PortableUtils::WriteInt16, IGNITE_TYPE_SHORT);
+            }
+
+            template <>
+            void PortableWriterImpl::WriteTopObject<uint16_t>(const uint16_t& obj)
+            {
+                WriteTopObject0<uint16_t>(obj, PortableUtils::WriteUInt16, IGNITE_TYPE_CHAR);
+            }
+
+            template <>
+            void PortableWriterImpl::WriteTopObject<int32_t>(const int32_t& obj)
+            {
+                WriteTopObject0<int32_t>(obj, PortableUtils::WriteInt32, IGNITE_TYPE_INT);
+            }
+
+            template <>
+            void PortableWriterImpl::WriteTopObject<int64_t>(const int64_t& obj)
+            {
+                WriteTopObject0<int64_t>(obj, PortableUtils::WriteInt64, IGNITE_TYPE_LONG);
+            }
+
+            template <>
+            void PortableWriterImpl::WriteTopObject<float>(const float& obj)
+            {
+                WriteTopObject0<float>(obj, PortableUtils::WriteFloat, IGNITE_TYPE_FLOAT);
+            }
+
+            template <>
+            void PortableWriterImpl::WriteTopObject<double>(const double& obj)
+            {
+                WriteTopObject0<double>(obj, PortableUtils::WriteDouble, IGNITE_TYPE_DOUBLE);
+            }
+
+            template <>
+            void PortableWriterImpl::WriteTopObject<Guid>(const Guid& obj)
+            {
+                WriteTopObject0<Guid>(obj, PortableUtils::WriteGuid, IGNITE_TYPE_UUID);
+            }
+
+            InteropOutputStream* PortableWriterImpl::GetStream()
+            {
+                return stream;
+            }
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/core/src/portable/portable_containers.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/core/src/portable/portable_containers.cpp b/modules/platform/cpp/core/src/portable/portable_containers.cpp
new file mode 100644
index 0000000..8270a13
--- /dev/null
+++ b/modules/platform/cpp/core/src/portable/portable_containers.cpp
@@ -0,0 +1,76 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ 
+#include "ignite/portable/portable_containers.h"
+
+using namespace ignite::impl::portable;
+
+namespace ignite
+{
+    namespace portable
+    {
+        PortableStringArrayWriter::PortableStringArrayWriter(PortableWriterImpl* impl, const int32_t id) : 
+            impl(impl), id(id)
+        {
+            // No-op.
+        }
+
+        void PortableStringArrayWriter::Write(const char* val)
+        {
+            if (val)
+                Write(val, static_cast<int32_t>(strlen(val)));
+            else
+                Write(NULL, -1);
+        }
+
+        void PortableStringArrayWriter::Write(const char* val, const int32_t len)
+        {
+            impl->WriteStringElement(id, val, len);
+        }
+
+        void PortableStringArrayWriter::Close()
+        {
+            impl->CommitContainer(id);
+        }
+
+        PortableStringArrayReader::PortableStringArrayReader(impl::portable::PortableReaderImpl* impl, 
+            int32_t id, int32_t size) : impl(impl), id(id), size(size)
+        {
+            // No-op.
+        }
+
+        bool PortableStringArrayReader::HasNext()
+        {
+            return impl->HasNextElement(id);
+        }
+
+        int32_t PortableStringArrayReader::GetNext(char* res, const int32_t len)
+        {
+            return impl->ReadStringElement(id, res, len);
+        }
+
+        int32_t PortableStringArrayReader::GetSize()
+        {
+            return size;
+        }
+
+        bool PortableStringArrayReader::IsNull()
+        {
+            return size == -1;
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/core/src/portable/portable_raw_reader.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/core/src/portable/portable_raw_reader.cpp b/modules/platform/cpp/core/src/portable/portable_raw_reader.cpp
new file mode 100644
index 0000000..f659913
--- /dev/null
+++ b/modules/platform/cpp/core/src/portable/portable_raw_reader.cpp
@@ -0,0 +1,135 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#include "ignite/impl/portable/portable_reader_impl.h"
+#include "ignite/portable/portable_raw_reader.h"
+
+using namespace ignite::impl::portable;
+
+namespace ignite
+{
+    namespace portable
+    {        
+        PortableRawReader::PortableRawReader(PortableReaderImpl* impl) : impl(impl)
+        {
+            // No-op.
+        }
+        
+        int8_t PortableRawReader::ReadInt8()
+        {
+            return impl->ReadInt8();
+        }
+
+        int32_t PortableRawReader::ReadInt8Array(int8_t* res, const int32_t len)
+        {
+            return impl->ReadInt8Array(res, len);
+        }
+        
+        bool PortableRawReader::ReadBool()
+        {
+            return impl->ReadBool();
+        }
+
+        int32_t PortableRawReader::ReadBoolArray(bool* res, const int32_t len)
+        {
+            return impl->ReadBoolArray(res, len);
+        }
+
+        int16_t PortableRawReader::ReadInt16()
+        {
+            return impl->ReadInt16();
+        }
+        
+        int32_t PortableRawReader::ReadInt16Array(int16_t* res, const int32_t len)
+        {
+            return impl->ReadInt16Array(res, len);
+        }
+
+        uint16_t PortableRawReader::ReadUInt16()
+        {
+            return impl->ReadUInt16();
+        }
+
+        int32_t PortableRawReader::ReadUInt16Array(uint16_t* res, const int32_t len)
+        {
+            return impl->ReadUInt16Array(res, len);
+        }
+
+        int32_t PortableRawReader::ReadInt32()
+        {
+            return impl->ReadInt32();
+        }
+        
+        int32_t PortableRawReader::ReadInt32Array(int32_t* res, const int32_t len)
+        {
+            return impl->ReadInt32Array(res, len);
+        }
+
+        int64_t PortableRawReader::ReadInt64()
+        {
+            return impl->ReadInt64();
+        }
+
+        int32_t PortableRawReader::ReadInt64Array(int64_t* res, const int32_t len)
+        {
+            return impl->ReadInt64Array(res, len);
+        }
+
+        float PortableRawReader::ReadFloat()
+        {
+            return impl->ReadFloat();
+        }
+        
+        int32_t PortableRawReader::ReadFloatArray(float* res, const int32_t len)
+        {
+            return impl->ReadFloatArray(res, len);
+        }
+
+        double PortableRawReader::ReadDouble()
+        {
+            return impl->ReadDouble();
+        }
+        
+        int32_t PortableRawReader::ReadDoubleArray(double* res, const int32_t len)
+        {
+            return impl->ReadDoubleArray(res, len);
+        }
+        
+        Guid PortableRawReader::ReadGuid()
+        {
+            return impl->ReadGuid();
+        }
+
+        int32_t PortableRawReader::ReadGuidArray(Guid* res, const int32_t len)
+        {
+            return impl->ReadGuidArray(res, len);
+        }        
+
+        int32_t PortableRawReader::ReadString(char* res, const int32_t len)
+        {
+            return impl->ReadString(res, len);
+        }
+
+        PortableStringArrayReader PortableRawReader::ReadStringArray()
+        {
+            int32_t size;
+
+            int32_t id = impl->ReadStringArray(&size);
+
+            return PortableStringArrayReader(impl, id, size);
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/core/src/portable/portable_raw_writer.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/core/src/portable/portable_raw_writer.cpp b/modules/platform/cpp/core/src/portable/portable_raw_writer.cpp
new file mode 100644
index 0000000..c682abe
--- /dev/null
+++ b/modules/platform/cpp/core/src/portable/portable_raw_writer.cpp
@@ -0,0 +1,147 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "ignite/impl/portable/portable_writer_impl.h"
+#include "ignite/portable/portable_raw_writer.h"
+
+using namespace ignite::impl::portable;
+
+namespace ignite
+{
+    namespace portable
+    {
+        PortableRawWriter::PortableRawWriter(PortableWriterImpl* impl) : impl(impl)
+        {
+            // No-op.
+        }
+
+        void PortableRawWriter::WriteInt8(const int8_t val)
+        {
+            impl->WriteInt8(val);
+        }
+
+        void PortableRawWriter::WriteInt8Array(const int8_t* val, const int32_t len)
+        {
+            impl->WriteInt8Array(val, len);
+        }
+
+        void PortableRawWriter::WriteBool(const bool val)
+        {
+            impl->WriteBool(val);
+        }
+
+        void PortableRawWriter::WriteBoolArray(const bool* val, const int32_t len)
+        {            
+            impl->WriteBoolArray(val, len);
+        }
+
+        void PortableRawWriter::WriteInt16(const int16_t val)
+        {
+            impl->WriteInt16(val);
+        }
+
+        void PortableRawWriter::WriteInt16Array(const int16_t* val, const int32_t len)
+        {
+            impl->WriteInt16Array(val, len);
+        }
+
+        void PortableRawWriter::WriteUInt16(const uint16_t val)
+        {
+            impl->WriteUInt16(val);
+        }
+
+        void PortableRawWriter::WriteUInt16Array(const uint16_t* val, const int32_t len)
+        {
+            impl->WriteUInt16Array(val, len);
+        }
+
+        void PortableRawWriter::WriteInt32(const int32_t val)
+        {
+            impl->WriteInt32(val);
+        }
+
+        void PortableRawWriter::WriteInt32Array(const int32_t* val, const int32_t len)
+        {
+            impl->WriteInt32Array(val, len);
+        }
+
+        void PortableRawWriter::WriteInt64(const int64_t val)
+        {
+            impl->WriteInt64(val);
+        }
+
+        void PortableRawWriter::WriteInt64Array(const int64_t* val, const int32_t len)
+        {
+            impl->WriteInt64Array(val, len);
+        }
+
+        void PortableRawWriter::WriteFloat(const float val)
+        {
+            impl->WriteFloat(val);
+        }
+
+        void PortableRawWriter::WriteFloatArray(const float* val, const int32_t len)
+        {
+            impl->WriteFloatArray(val, len);
+        }
+
+        void PortableRawWriter::WriteDouble(const double val)
+        {
+            impl->WriteDouble(val);
+        }
+
+        void PortableRawWriter::WriteDoubleArray(const double* val, const int32_t len)
+        {
+            impl->WriteDoubleArray(val, len);
+        }
+
+        void PortableRawWriter::WriteGuid(const Guid val)
+        {
+            impl->WriteGuid(val);
+        }
+
+        void PortableRawWriter::WriteGuidArray(const Guid* val, const int32_t len)
+        {
+            impl->WriteGuidArray(val, len);
+        }
+
+        void PortableRawWriter::WriteString(const char* val)
+        {
+            if (val)
+                WriteString(val, static_cast<int32_t>(strlen(val)));
+            else
+                WriteNull();
+        }
+
+        void PortableRawWriter::WriteString(const char* val, const int32_t len)
+        {
+            impl->WriteString(val, len);
+        }
+
+        PortableStringArrayWriter PortableRawWriter::WriteStringArray()
+        {
+            int32_t id = impl->WriteStringArray();
+
+            return PortableStringArrayWriter(impl, id);
+        }
+
+        void PortableRawWriter::WriteNull()
+        {
+            impl->WriteNull();
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/core/src/portable/portable_reader.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/core/src/portable/portable_reader.cpp b/modules/platform/cpp/core/src/portable/portable_reader.cpp
new file mode 100644
index 0000000..515216d
--- /dev/null
+++ b/modules/platform/cpp/core/src/portable/portable_reader.cpp
@@ -0,0 +1,142 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#include "ignite/impl/portable/portable_reader_impl.h"
+#include "ignite/portable/portable_reader.h"
+
+using namespace ignite::impl::portable;
+
+namespace ignite
+{
+    namespace portable
+    {
+        PortableReader::PortableReader(PortableReaderImpl* impl) : impl(impl)
+        {
+            // No-op.
+        }
+        
+        int8_t PortableReader::ReadInt8(const char* fieldName)
+        {
+            return impl->ReadInt8(fieldName);
+        }
+
+        int32_t PortableReader::ReadInt8Array(const char* fieldName, int8_t* res, const int32_t len)
+        {
+            return impl->ReadInt8Array(fieldName, res, len);
+        }
+
+        bool PortableReader::ReadBool(const char* fieldName)
+        {
+            return impl->ReadBool(fieldName);
+        }
+
+        int32_t PortableReader::ReadBoolArray(const char* fieldName, bool* res, const int32_t len)
+        {
+            return impl->ReadBoolArray(fieldName, res, len);
+        }
+
+        int16_t PortableReader::ReadInt16(const char* fieldName)
+        {
+            return impl->ReadInt16(fieldName);
+        }
+
+        int32_t PortableReader::ReadInt16Array(const char* fieldName, int16_t* res, const int32_t len)
+        {
+            return impl->ReadInt16Array(fieldName, res, len);
+        }
+
+        uint16_t PortableReader::ReadUInt16(const char* fieldName)
+        {
+            return impl->ReadUInt16(fieldName);
+        }
+
+        int32_t PortableReader::ReadUInt16Array(const char* fieldName, uint16_t* res, const int32_t len)
+        {
+            return impl->ReadUInt16Array(fieldName, res, len);
+        }
+
+        int32_t PortableReader::ReadInt32(const char* fieldName)
+        {
+            return impl->ReadInt32(fieldName);
+        }
+
+        int32_t PortableReader::ReadInt32Array(const char* fieldName, int32_t* res, const int32_t len)
+        {
+            return impl->ReadInt32Array(fieldName, res, len);
+        }
+
+        int64_t PortableReader::ReadInt64(const char* fieldName)
+        {
+            return impl->ReadInt64(fieldName);
+        }
+
+        int32_t PortableReader::ReadInt64Array(const char* fieldName, int64_t* res, const int32_t len)
+        {
+            return impl->ReadInt64Array(fieldName, res, len);
+        }
+
+        float PortableReader::ReadFloat(const char* fieldName)
+        {
+            return impl->ReadFloat(fieldName);
+        }
+
+        int32_t PortableReader::ReadFloatArray(const char* fieldName, float* res, const int32_t len)
+        {
+            return impl->ReadFloatArray(fieldName, res, len);
+        }
+
+        double PortableReader::ReadDouble(const char* fieldName)
+        {
+            return impl->ReadDouble(fieldName);
+        }
+
+        int32_t PortableReader::ReadDoubleArray(const char* fieldName, double* res, const int32_t len)
+        {
+            return impl->ReadDoubleArray(fieldName, res, len);
+        }
+
+        Guid PortableReader::ReadGuid(const char* fieldName)
+        {
+            return impl->ReadGuid(fieldName);
+        }
+
+        int32_t PortableReader::ReadGuidArray(const char* fieldName, Guid* res, const int32_t len)
+        {
+            return impl->ReadGuidArray(fieldName, res, len);
+        }
+        
+        int32_t PortableReader::ReadString(const char* fieldName, char* res, const int32_t len)
+        {
+            return impl->ReadString(fieldName, res, len);
+        }
+
+        PortableStringArrayReader PortableReader::ReadStringArray(const char* fieldName)
+        {
+            int32_t size;
+
+            int32_t id = impl->ReadStringArray(fieldName, &size);
+
+            return PortableStringArrayReader(impl, id, size);
+        }
+
+        PortableRawReader PortableReader::RawReader()
+        {
+            impl->SetRawMode();
+
+            return PortableRawReader(impl);
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/core/src/portable/portable_type.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/core/src/portable/portable_type.cpp b/modules/platform/cpp/core/src/portable/portable_type.cpp
new file mode 100644
index 0000000..e22f869
--- /dev/null
+++ b/modules/platform/cpp/core/src/portable/portable_type.cpp
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "ignite/portable/portable_type.h"
+
+namespace ignite
+{
+    namespace portable
+    {
+        int32_t GetPortableStringHashCode(const char* val)
+        {
+            if (val)
+            {
+                int32_t hash = 0;
+
+                int i = 0;
+
+                while (true)
+                {
+                    char c = *(val + i++);
+
+                    if (c == '\0')
+                        break;
+
+                    if ('A' <= c && c <= 'Z')
+                        c = c | 0x20;
+
+                    hash = 31 * hash + c;
+                }
+
+                return hash;
+            }
+            else
+                return 0;
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/core/src/portable/portable_writer.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/core/src/portable/portable_writer.cpp b/modules/platform/cpp/core/src/portable/portable_writer.cpp
new file mode 100644
index 0000000..f31b9dd
--- /dev/null
+++ b/modules/platform/cpp/core/src/portable/portable_writer.cpp
@@ -0,0 +1,154 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "ignite/impl/portable/portable_writer_impl.h"
+#include "ignite/portable/portable_writer.h"
+
+using namespace ignite::impl::portable;
+
+namespace ignite
+{
+    namespace portable
+    {
+        PortableWriter::PortableWriter(PortableWriterImpl* impl) : impl(impl)
+        {
+            // No-op.
+        }
+
+        void PortableWriter::WriteInt8(const char* fieldName, const int8_t val)
+        {
+            impl->WriteInt8(fieldName, val);
+        }
+
+        void PortableWriter::WriteInt8Array(const char* fieldName, const int8_t* val, const int32_t len)
+        {
+            impl->WriteInt8Array(fieldName, val, len);
+        }
+
+        void PortableWriter::WriteBool(const char* fieldName, const bool val)
+        {
+            impl->WriteBool(fieldName, val);
+        }
+
+        void PortableWriter::WriteBoolArray(const char* fieldName, const bool* val, const int32_t len)
+        {
+            impl->WriteBoolArray(fieldName, val, len);
+        }
+
+        void PortableWriter::WriteInt16(const char* fieldName, const int16_t val)
+        {
+            impl->WriteInt16(fieldName, val);
+        }
+
+        void PortableWriter::WriteInt16Array(const char* fieldName, const int16_t* val, const int32_t len)
+        {
+            impl->WriteInt16Array(fieldName, val, len);
+        }
+
+        void PortableWriter::WriteUInt16(const char* fieldName, const uint16_t val)
+        {
+            impl->WriteUInt16(fieldName, val);
+        }
+
+        void PortableWriter::WriteUInt16Array(const char* fieldName, const uint16_t* val, const int32_t len)
+        {
+            impl->WriteUInt16Array(fieldName, val, len);
+        }
+
+        void PortableWriter::WriteInt32(const char* fieldName, const int32_t val)
+        {
+            impl->WriteInt32(fieldName, val);
+        }
+
+        void PortableWriter::WriteInt32Array(const char* fieldName, const int32_t* val, const int32_t len)
+        {
+            impl->WriteInt32Array(fieldName, val, len);
+        }
+
+        void PortableWriter::WriteInt64(const char* fieldName, const int64_t val)
+        {
+            impl->WriteInt64(fieldName, val);
+        }
+
+        void PortableWriter::WriteInt64Array(const char* fieldName, const int64_t* val, const int32_t len)
+        {
+            impl->WriteInt64Array(fieldName, val, len);
+        }
+
+        void PortableWriter::WriteFloat(const char* fieldName, const float val)
+        {
+            impl->WriteFloat(fieldName, val);
+        }
+
+        void PortableWriter::WriteFloatArray(const char* fieldName, const float* val, const int32_t len)
+        {
+            impl->WriteFloatArray(fieldName, val, len);
+        }
+
+        void PortableWriter::WriteDouble(const char* fieldName, const double val)
+        {
+            impl->WriteDouble(fieldName, val);
+        }
+
+        void PortableWriter::WriteDoubleArray(const char* fieldName, const double* val, const int32_t len)
+        {
+            impl->WriteDoubleArray(fieldName, val, len);
+        }
+
+        void PortableWriter::WriteGuid(const char* fieldName, const Guid val)
+        {
+            impl->WriteGuid(fieldName, val);
+        }
+
+        void PortableWriter::WriteGuidArray(const char* fieldName, const Guid* val, const int32_t len)
+        {
+            impl->WriteGuidArray(fieldName, val, len);
+        }
+
+        void PortableWriter::WriteString(const char* fieldName, const char* val)
+        {
+            if (val)
+                WriteString(fieldName, val, static_cast<int32_t>(strlen(val)));
+            else
+                WriteNull(fieldName);
+        }
+
+        void PortableWriter::WriteString(const char* fieldName, const char* val, const int32_t len)
+        {
+            impl->WriteString(fieldName, val, len);
+        }
+
+        PortableStringArrayWriter PortableWriter::WriteStringArray(const char* fieldName)
+        {
+            int32_t id = impl->WriteStringArray(fieldName);
+
+            return PortableStringArrayWriter(impl, id);
+        }
+
+        void PortableWriter::WriteNull(const char* fieldName)
+        {
+            impl->WriteNull(fieldName);
+        }
+
+        PortableRawWriter PortableWriter::RawWriter()
+        {
+            impl->SetRawMode();
+
+            return PortableRawWriter(impl);
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/examples/Makefile.am
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/examples/Makefile.am b/modules/platform/cpp/examples/Makefile.am
new file mode 100644
index 0000000..d99cd82
--- /dev/null
+++ b/modules/platform/cpp/examples/Makefile.am
@@ -0,0 +1,39 @@
+##
+## Licensed to the Apache Software Foundation (ASF) under one or more
+## contributor license agreements.  See the NOTICE file distributed with
+## this work for additional information regarding copyright ownership.
+## The ASF licenses this file to You under the Apache License, Version 2.0
+## (the "License"); you may not use this file except in compliance with
+## the License.  You may obtain a copy of the License at
+##
+##      http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS,
+## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+## See the License for the specific language governing permissions and
+## limitations under the License.
+##
+
+ACLOCAL_AMFLAGS = "-Im4"
+
+SUBDIRS = .
+DIST_SUBDIRS = . include
+
+AM_CPPFLAGS = -I$(srcdir)/include -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/linux -DIGNITE_IMPL
+AM_CXXFLAGS = -Wall -std=c++0x
+
+noinst_PROGRAMS = ignite-putgetexample
+
+ignite_putgetexample_SOURCES = src/putgetexample.cpp
+
+ignite_putgetexample_LDFLAGS = -static-libtool-libs -L/usr/local/lib -lignite
+
+run-check: check
+	./ignite-putgetexample -p
+
+clean-local: clean-check
+	$(RM) *.gcno *.gcda
+
+clean-check:
+	$(RM) $(ignite_putgetexample_OBJECTS)

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/examples/README.txt
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/examples/README.txt b/modules/platform/cpp/examples/README.txt
new file mode 100644
index 0000000..a00cb3b
--- /dev/null
+++ b/modules/platform/cpp/examples/README.txt
@@ -0,0 +1,42 @@
+Ignite C++ Examples
+==================================
+
+Common requirements
+----------------------------------
+ * Java Development Kit (JDK) must be installed: https://java.com/en/download/index.jsp
+ * JAVA_HOME environment variable must be set pointing to Java installation directory.
+ * IGNITE_HOME environment variable must be set to Ignite installation directory.
+ * Ignite must be build and packaged using Maven. You can use the followin Maven command: mvn clean package -DskipTests
+ * Ignite C++ must be built according to instructions for your platform.
+
+Running examples on Linux
+----------------------------------
+
+Prerequisites:
+ * GCC, g++, autotools, automake, and libtool must be installed.
+
+To build examples execute the following commands one by one from $IGNITE_HOME/platforms/cpp/examples directory:
+ * libtoolize
+ * aclocal
+ * autoheader
+ * automake --add-missing
+ * autoreconf
+ * ./configure
+ * make
+
+As a result several executables will appear in example's directory.
+
+Before running examples ensure that:
+ * LD_LIBRARY_PATH environment variable is set and pointing to a directory with "libjvm.so" library. Typically this
+   library is located in $JAVA_HOME/jre/lib/amd64/server directory.
+
+
+Running examples on Windows
+----------------------------------
+
+Prerequisites:
+ * Microsoft Visual Studio (tm) 2010 or higher must be installed.
+ * Windows SDK 7.1 must be installed.
+
+Open Visual Studio solution %IGNITE_HOME%\platforms\cpp\examples\project\vs\ignite-examples.sln and select proper
+platform (x64 or x86). Run the solution.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/examples/config/example-cache.xml
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/examples/config/example-cache.xml b/modules/platform/cpp/examples/config/example-cache.xml
new file mode 100644
index 0000000..beed238
--- /dev/null
+++ b/modules/platform/cpp/examples/config/example-cache.xml
@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:util="http://www.springframework.org/schema/util"
+       xsi:schemaLocation="
+        http://www.springframework.org/schema/beans
+        http://www.springframework.org/schema/beans/spring-beans.xsd
+        http://www.springframework.org/schema/util
+        http://www.springframework.org/schema/util/spring-util.xsd">
+    <bean id="grid.cfg" class="org.apache.ignite.configuration.IgniteConfiguration">
+        <!-- Set to true to enable distributed class loading for examples, default is false. -->
+        <property name="peerClassLoadingEnabled" value="true"/>
+
+        <property name="cacheConfiguration">
+            <list>
+                <!--
+                    Partitioned cache example configuration with portable objects enabled.
+                    Used in .NET example that is available only in enterprise edition.
+                -->
+                <bean class="org.apache.ignite.configuration.CacheConfiguration">
+                    <property name="atomicityMode" value="ATOMIC"/>
+                    <property name="backups" value="1"/>
+                </bean>
+
+                <!--
+                    Partitioned cache example configuration.
+                    Used in .NET cache store example that is available only in enterprise edition.
+                -->
+                <bean class="org.apache.ignite.configuration.CacheConfiguration">
+                    <property name="name" value="tx"/>
+                    <property name="atomicityMode" value="TRANSACTIONAL"/>
+                    <property name="backups" value="1"/>
+                </bean>
+            </list>
+        </property>
+
+        <!-- Explicitly configure TCP discovery SPI to provide list of initial nodes. -->
+        <property name="discoverySpi">
+            <bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
+                <property name="ipFinder">
+                    <!--
+                        Ignite provides several options for automatic discovery that can be used
+                        instead os static IP based discovery.
+                    -->
+                    <!-- Uncomment static IP finder to enable static-based discovery of initial nodes. -->
+                    <!--<bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder">-->
+                    <bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.multicast.TcpDiscoveryMulticastIpFinder">
+                        <property name="addresses">
+                            <list>
+                                <!-- In distributed environment, replace with actual host IP address. -->
+                                <value>127.0.0.1:47500..47501</value>
+                            </list>
+                        </property>
+                    </bean>
+                </property>
+            </bean>
+        </property>
+    </bean>
+</beans>

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/examples/configure.ac
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/examples/configure.ac b/modules/platform/cpp/examples/configure.ac
new file mode 100644
index 0000000..a5e902d
--- /dev/null
+++ b/modules/platform/cpp/examples/configure.ac
@@ -0,0 +1,38 @@
+#                                               -*- Autoconf -*-
+# Process this file with autoconf to produce a configure script.
+
+AC_PREREQ([2.69])
+AC_INIT([Ingnite C++ examples],[1.4.0],[dec@ignite.apache.org],[ignite-examples],[ignite.apache.org])
+AC_CONFIG_SRCDIR(src)
+
+AC_CANONICAL_SYSTEM
+AC_CONFIG_MACRO_DIR([m4])
+AC_LANG([C++])
+
+# Initialize automake
+AM_INIT_AUTOMAKE([-Wall foreign subdir-objects])
+AC_CONFIG_HEADER(config.h)
+
+AM_PROG_AR
+
+# Checks for programs.
+GXX="-g -O2"
+
+AC_PROG_CXX
+
+# Initialize Libtool
+LT_INIT
+
+AC_ARG_ENABLE([debug],
+ [AS_HELP_STRING([--enable-debug],[enable debug build [default=no]])],
+ [],[enable_debug=no])
+
+if test "x$enable_debug" = xyes; then
+    CXXFLAGS="-g -O0"
+else
+    CXXFLAGS="-g -O3"
+fi
+
+AC_CONFIG_FILES(Makefile)
+
+AC_OUTPUT

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/examples/include/Makefile.am
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/examples/include/Makefile.am b/modules/platform/cpp/examples/include/Makefile.am
new file mode 100644
index 0000000..13a8816
--- /dev/null
+++ b/modules/platform/cpp/examples/include/Makefile.am
@@ -0,0 +1,21 @@
+##
+## Licensed to the Apache Software Foundation (ASF) under one or more
+## contributor license agreements.  See the NOTICE file distributed with
+## this work for additional information regarding copyright ownership.
+## The ASF licenses this file to You under the Apache License, Version 2.0
+## (the "License"); you may not use this file except in compliance with
+## the License.  You may obtain a copy of the License at
+##
+##      http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS,
+## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+## See the License for the specific language governing permissions and
+## limitations under the License.
+##
+
+ACLOCAL_AMFLAGS = "-Im4"
+
+nobase_include_HEADERS = ignite/examples/address.h \
+                         ignite/examples/organization.h

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/examples/include/ignite/examples/address.h
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/examples/include/ignite/examples/address.h b/modules/platform/cpp/examples/include/ignite/examples/address.h
new file mode 100644
index 0000000..29dbb0c
--- /dev/null
+++ b/modules/platform/cpp/examples/include/ignite/examples/address.h
@@ -0,0 +1,109 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _IGNITE_EXAMPLES_ADDRESS
+#define _IGNITE_EXAMPLES_ADDRESS
+
+#include "ignite/portable/portable.h"
+
+namespace ignite
+{
+    namespace examples 
+    {
+        struct Address 
+        {
+            Address()
+            {
+                street = "";
+                zip = 0;
+            }
+            
+            Address(std::string street, int zip) : street(street), zip(zip) 
+            {
+                // No-op.
+            }
+            
+            std::string ToString() 
+            {
+                std::ostringstream oss;
+
+                oss << "Address [street=" << street << ", zip=" << zip << "]";
+
+                return oss.str();
+            }
+            
+            std::string street;
+            int zip;
+        };    
+    }
+}
+
+namespace ignite
+{
+    namespace portable 
+    {
+        template<>
+        struct PortableType<ignite::examples::Address>
+        {
+            int32_t GetTypeId()
+            {
+                return GetPortableStringHashCode("Address");
+            }
+
+            std::string GetTypeName()
+            {
+                return "Address";
+            }
+
+            int32_t GetFieldId(const char* name)
+            {
+                return GetPortableStringHashCode(name);
+            }
+
+            int32_t GetHashCode(ignite::examples::Address obj)
+            {
+                return 0;
+            }
+
+            bool IsNull(ignite::examples::Address obj)
+            {
+                return false;
+            }
+
+            ignite::examples::Address GetNull()
+            {
+                return ignite::examples::Address("", 0);
+            }
+
+            void Write(PortableWriter& writer, ignite::examples::Address obj)
+            {
+                writer.WriteString("street", obj.street);
+                writer.WriteInt32("zip", obj.zip);
+            }
+
+            ignite::examples::Address Read(PortableReader& reader)
+            {
+                std::string street = reader.ReadString("street");
+                int zip = reader.ReadInt32("zip");
+                
+                return ignite::examples::Address(street, zip);
+            }
+        };    
+    }    
+}
+
+#endif
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/examples/include/ignite/examples/organization.h
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/examples/include/ignite/examples/organization.h b/modules/platform/cpp/examples/include/ignite/examples/organization.h
new file mode 100644
index 0000000..c9137c9
--- /dev/null
+++ b/modules/platform/cpp/examples/include/ignite/examples/organization.h
@@ -0,0 +1,111 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _IGNITE_EXAMPLES_ORGANIZATION
+#define _IGNITE_EXAMPLES_ORGANIZATION
+
+#include "ignite/portable/portable.h"
+
+#include "ignite/examples/address.h"
+
+namespace ignite
+{
+    namespace examples 
+    {
+        struct Organization 
+        {
+            Organization()
+            {
+                name = "";
+                addr = Address();
+            }
+            
+            Organization(std::string name, Address addr) : name(name), addr(addr) 
+            {
+                // No-op.
+            }
+            
+            std::string ToString() 
+            {
+                std::ostringstream oss;
+
+                oss << "Organization [name=" << name << ", Address=" << addr.ToString() << "]";
+
+                return oss.str();
+            }
+            
+            std::string name;
+            Address addr;
+        };    
+    }
+}
+
+namespace ignite
+{
+    namespace portable 
+    {
+        template<>
+        struct PortableType<ignite::examples::Organization>
+        {
+            int32_t GetTypeId()
+            {
+                return GetPortableStringHashCode("Organization");
+            }
+
+            std::string GetTypeName()
+            {
+                return "Organization";
+            }
+
+            int32_t GetFieldId(const char* name)
+            {
+                return GetPortableStringHashCode(name);
+            }
+
+            int32_t GetHashCode(ignite::examples::Organization obj)
+            {
+                return 0;
+            }
+
+            bool IsNull(ignite::examples::Organization obj)
+            {
+                return false;
+            }
+
+            ignite::examples::Organization GetNull()
+            {
+                return ignite::examples::Organization("", ignite::examples::Address());
+            }
+
+            void Write(PortableWriter& writer, ignite::examples::Organization obj)
+            {
+                writer.WriteString("name", obj.name);
+                writer.WriteObject<ignite::examples::Address>("addr", obj.addr);
+            }
+
+            ignite::examples::Organization Read(PortableReader& reader)
+            {
+                std::string name = reader.ReadString("name");
+                ignite::examples::Address addr = reader.ReadObject<ignite::examples::Address>("addr");
+                                
+                return ignite::examples::Organization(name, addr);
+            }
+        };    
+    }    
+}
+
+#endif
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/examples/project/vs/ignite-examples.sln
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/examples/project/vs/ignite-examples.sln b/modules/platform/cpp/examples/project/vs/ignite-examples.sln
new file mode 100644
index 0000000..4970654
--- /dev/null
+++ b/modules/platform/cpp/examples/project/vs/ignite-examples.sln
@@ -0,0 +1,19 @@
+Microsoft Visual Studio Solution File, Format Version 11.00
+# Visual Studio 2010
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ignite-examples", "ignite-examples.vcxproj", "{34935DEC-80FC-4168-AA52-3DBFF4F79B6B}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Release|x64 = Release|x64
+		Release|x86 = Release|x86
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{34935DEC-80FC-4168-AA52-3DBFF4F79B6B}.Release|x64.ActiveCfg = Release|x64
+		{34935DEC-80FC-4168-AA52-3DBFF4F79B6B}.Release|x64.Build.0 = Release|x64
+		{34935DEC-80FC-4168-AA52-3DBFF4F79B6B}.Release|x86.ActiveCfg = Release|Win32
+		{34935DEC-80FC-4168-AA52-3DBFF4F79B6B}.Release|x86.Build.0 = Release|Win32
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/examples/project/vs/ignite-examples.vcxproj
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/examples/project/vs/ignite-examples.vcxproj b/modules/platform/cpp/examples/project/vs/ignite-examples.vcxproj
new file mode 100644
index 0000000..13ec564
--- /dev/null
+++ b/modules/platform/cpp/examples/project/vs/ignite-examples.vcxproj
@@ -0,0 +1,107 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup Label="ProjectConfigurations">
+    <ProjectConfiguration Include="Release|Win32">
+      <Configuration>Release</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|x64">
+      <Configuration>Release</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+  </ItemGroup>
+  <PropertyGroup Label="Globals">
+    <ProjectGuid>{34935DEC-80FC-4168-AA52-3DBFF4F79B6B}</ProjectGuid>
+    <Keyword>Win32Proj</Keyword>
+    <RootNamespace>igniteexamples</RootNamespace>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <PlatformToolset>v120</PlatformToolset>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <PlatformToolset>v120</PlatformToolset>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+  <ImportGroup Label="ExtensionSettings">
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <PropertyGroup Label="UserMacros" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <LinkIncremental>false</LinkIncremental>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <LinkIncremental>false</LinkIncremental>
+  </PropertyGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <Optimization>MaxSpeed</Optimization>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <IntrinsicFunctions>true</IntrinsicFunctions>
+      <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>$(JAVA_HOME)\include;$(JAVA_HOME)\include\win32;..\..\include;..\..\..\src\common\os\win\include;..\..\..\src\common\include;..\..\..\src\core\os\win\include;..\..\..\src\core\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+    </ClCompile>
+    <Link>
+      <SubSystem>Console</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <OptimizeReferences>true</OptimizeReferences>
+      <AdditionalDependencies>jvm.lib;ignite.common.lib;ignite.core.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalLibraryDirectories>..\..\..\src\project\vs\$(Platform)\$(Configuration)\;$(JAVA_HOME)\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+    </Link>
+    <PostBuildEvent>
+      <Command>copy "$(ProjectDir)..\..\..\src\project\vs\$(Platform)\$(Configuration)\ignite.common.dll" "$(OutDir)"
+copy "$(ProjectDir)..\..\..\src\\project\vs\$(Platform)\$(Configuration)\ignite.core.dll" "$(OutDir)"</Command>
+    </PostBuildEvent>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <Optimization>MaxSpeed</Optimization>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <IntrinsicFunctions>true</IntrinsicFunctions>
+      <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>$(JAVA_HOME)\include;$(JAVA_HOME)\include\win32;..\..\include;..\..\..\src\common\os\win\include;..\..\..\src\common\include;..\..\..\src\core\os\win\include;..\..\..\src\core\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+    </ClCompile>
+    <Link>
+      <SubSystem>Console</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <OptimizeReferences>true</OptimizeReferences>
+      <AdditionalDependencies>jvm.lib;ignite.common.lib;ignite.core.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalLibraryDirectories>..\..\..\src\project\vs\$(Platform)\$(Configuration)\;$(JAVA_HOME)\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+    </Link>
+    <PostBuildEvent>
+      <Command>copy "$(ProjectDir)..\..\..\src\project\vs\$(Platform)\$(Configuration)\ignite.common.dll" "$(OutDir)"
+copy "$(ProjectDir)..\..\..\src\project\vs\$(Platform)\$(Configuration)\ignite.core.dll" "$(OutDir)"</Command>
+    </PostBuildEvent>
+  </ItemDefinitionGroup>
+  <ItemGroup>
+    <ClCompile Include="..\..\src\putgetexample.cpp" />
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="..\..\include\ignite\examples\address.h" />
+    <ClInclude Include="..\..\include\ignite\examples\organization.h" />
+  </ItemGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+  <ImportGroup Label="ExtensionTargets">
+  </ImportGroup>
+</Project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/examples/project/vs/ignite-examples.vcxproj.filters
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/examples/project/vs/ignite-examples.vcxproj.filters b/modules/platform/cpp/examples/project/vs/ignite-examples.vcxproj.filters
new file mode 100644
index 0000000..ca62db7
--- /dev/null
+++ b/modules/platform/cpp/examples/project/vs/ignite-examples.vcxproj.filters
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup>
+    <Filter Include="Source Files">
+      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+    </Filter>
+    <Filter Include="Header Files">
+      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+      <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
+    </Filter>
+    <Filter Include="Resource Files">
+      <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+    </Filter>
+  </ItemGroup>
+  <ItemGroup>
+    <ClCompile Include="..\..\src\putgetexample.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="..\..\include\ignite\examples\address.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\include\ignite\examples\organization.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+  </ItemGroup>
+</Project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/examples/src/putgetexample.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/examples/src/putgetexample.cpp b/modules/platform/cpp/examples/src/putgetexample.cpp
new file mode 100644
index 0000000..206a2f4
--- /dev/null
+++ b/modules/platform/cpp/examples/src/putgetexample.cpp
@@ -0,0 +1,126 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <iostream>
+
+#include "ignite/ignite.h"
+#include "ignite/ignition.h"
+
+#include "ignite/examples/organization.h"
+
+using namespace ignite;
+using namespace cache;
+
+using namespace examples;
+
+/*
+ * Execute individual Put and Get operations.
+ * 
+ * @param cache Cache instance.
+ */
+void PutGet(Cache<int, Organization>& cache) 
+{
+    // Create new Organization to store in cache.
+    Organization org("Microsoft", Address("1096 Eddy Street, San Francisco, CA", 94109));
+    
+    // Put organization to cache.        
+    cache.Put(1, org);
+    
+    // Get recently created employee as a strongly-typed fully de-serialized instance.
+    Organization orgFromCache = cache.Get(1);
+
+    std::cout <<  ">>> Retrieved organization instance from cache: " << std::endl;
+    std::cout << orgFromCache.ToString() << std::endl;
+    std::cout << std::endl;
+}
+
+/*
+ * Execute bulk Put and Get operations.
+ */
+void PutGetAll(Cache<int, Organization>& cache) 
+{
+    // Create new Organizations to store in cache.
+    Organization org1("Microsoft", Address("1096 Eddy Street, San Francisco, CA", 94109));
+    Organization org2("Red Cross", Address("184 Fidler Drive, San Antonio, TX", 78205));
+    
+    // Put created data entries to cache.
+    std::map<int, Organization> vals;
+    
+    vals[1] = org1;
+    vals[2] = org2;
+    
+    cache.PutAll(vals);
+
+    // Get recently created organizations as a strongly-typed fully de-serialized instances.
+    std::set<int> keys;
+    
+    keys.insert(1);
+    keys.insert(2);
+    
+    std::map<int, Organization> valsFromCache = cache.GetAll(keys);
+
+    std::cout <<  ">>> Retrieved organization instances from cache: " << std::endl;
+    
+    for (std::map<int, Organization>::iterator it = valsFromCache.begin(); it != valsFromCache.end(); ++it) 
+        std::cout <<  it->second.ToString() << std::endl;
+    
+    std::cout << std::endl;
+}
+
+int main()
+{
+    IgniteConfiguration cfg;
+
+    cfg.jvmInitMem = 512;
+    cfg.jvmMaxMem = 512;
+    
+    cfg.springCfgPath = "platforms/cpp/examples/config/example-cache.xml";
+ 
+    try 
+    {
+        // Start a node.
+        Ignite grid = Ignition::Start(cfg);
+        
+        std::cout << std::endl;
+        std::cout << ">>> Cache put-get example started." << std::endl;
+        std::cout << std::endl;
+        
+        // Get cache instance.
+        Cache<int, Organization> cache = grid.GetCache<int, Organization>(NULL);
+        
+        // Clear cache.
+        cache.Clear();
+
+        PutGet(cache);
+        PutGetAll(cache);        
+        
+        // Stop node.
+        Ignition::StopAll(false);
+    }
+    catch (IgniteError& err)
+    {
+        std::cout << "An error occurred: " << err.GetText() << std::endl;
+    }
+    
+    std::cout << std::endl;
+    std::cout << ">>> Example finished, press any key to exit ..." << std::endl;
+    std::cout << std::endl;
+    
+    std::cin.get();
+    
+    return 0;
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/project/vs/ignite.sln
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/project/vs/ignite.sln b/modules/platform/cpp/project/vs/ignite.sln
new file mode 100644
index 0000000..f34d8e5
--- /dev/null
+++ b/modules/platform/cpp/project/vs/ignite.sln
@@ -0,0 +1,46 @@
+
+Microsoft Visual Studio Solution File, Format Version 11.00
+# Visual Studio 2010
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "common", "..\..\common\project\vs\common.vcxproj", "{4F7E4917-4612-4B96-9838-025711ADE391}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "core", "..\..\core\project\vs\core.vcxproj", "{E2DEA693-F2EA-43C2-A813-053378F6E4DB}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "core-test", "..\..\core-test\project\vs\core-test.vcxproj", "{133A22DB-FD60-44B9-B5E3-6CBB3EA5ABF0}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|Win32 = Debug|Win32
+		Debug|x64 = Debug|x64
+		Release|Win32 = Release|Win32
+		Release|x64 = Release|x64
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{4F7E4917-4612-4B96-9838-025711ADE391}.Debug|Win32.ActiveCfg = Debug|Win32
+		{4F7E4917-4612-4B96-9838-025711ADE391}.Debug|Win32.Build.0 = Debug|Win32
+		{4F7E4917-4612-4B96-9838-025711ADE391}.Debug|x64.ActiveCfg = Debug|x64
+		{4F7E4917-4612-4B96-9838-025711ADE391}.Debug|x64.Build.0 = Debug|x64
+		{4F7E4917-4612-4B96-9838-025711ADE391}.Release|Win32.ActiveCfg = Release|Win32
+		{4F7E4917-4612-4B96-9838-025711ADE391}.Release|Win32.Build.0 = Release|Win32
+		{4F7E4917-4612-4B96-9838-025711ADE391}.Release|x64.ActiveCfg = Release|x64
+		{4F7E4917-4612-4B96-9838-025711ADE391}.Release|x64.Build.0 = Release|x64
+		{E2DEA693-F2EA-43C2-A813-053378F6E4DB}.Debug|Win32.ActiveCfg = Debug|Win32
+		{E2DEA693-F2EA-43C2-A813-053378F6E4DB}.Debug|Win32.Build.0 = Debug|Win32
+		{E2DEA693-F2EA-43C2-A813-053378F6E4DB}.Debug|x64.ActiveCfg = Debug|x64
+		{E2DEA693-F2EA-43C2-A813-053378F6E4DB}.Debug|x64.Build.0 = Debug|x64
+		{E2DEA693-F2EA-43C2-A813-053378F6E4DB}.Release|Win32.ActiveCfg = Release|Win32
+		{E2DEA693-F2EA-43C2-A813-053378F6E4DB}.Release|Win32.Build.0 = Release|Win32
+		{E2DEA693-F2EA-43C2-A813-053378F6E4DB}.Release|x64.ActiveCfg = Release|x64
+		{E2DEA693-F2EA-43C2-A813-053378F6E4DB}.Release|x64.Build.0 = Release|x64
+		{133A22DB-FD60-44B9-B5E3-6CBB3EA5ABF0}.Debug|Win32.ActiveCfg = Debug|Win32
+		{133A22DB-FD60-44B9-B5E3-6CBB3EA5ABF0}.Debug|Win32.Build.0 = Debug|Win32
+		{133A22DB-FD60-44B9-B5E3-6CBB3EA5ABF0}.Debug|x64.ActiveCfg = Debug|x64
+		{133A22DB-FD60-44B9-B5E3-6CBB3EA5ABF0}.Debug|x64.Build.0 = Debug|x64
+		{133A22DB-FD60-44B9-B5E3-6CBB3EA5ABF0}.Release|Win32.ActiveCfg = Release|Win32
+		{133A22DB-FD60-44B9-B5E3-6CBB3EA5ABF0}.Release|Win32.Build.0 = Release|Win32
+		{133A22DB-FD60-44B9-B5E3-6CBB3EA5ABF0}.Release|x64.ActiveCfg = Release|x64
+		{133A22DB-FD60-44B9-B5E3-6CBB3EA5ABF0}.Release|x64.Build.0 = Release|x64
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/project/vs/ignite.slnrel
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/project/vs/ignite.slnrel b/modules/platform/cpp/project/vs/ignite.slnrel
new file mode 100644
index 0000000..7456097
--- /dev/null
+++ b/modules/platform/cpp/project/vs/ignite.slnrel
@@ -0,0 +1,33 @@
+
+Microsoft Visual Studio Solution File, Format Version 11.00
+# Visual Studio 2010
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "common", "..\..\common\project\vs\common.vcxproj", "{4F7E4917-4612-4B96-9838-025711ADE391}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "core", "..\..\core\project\vs\core.vcxproj", "{E2DEA693-F2EA-43C2-A813-053378F6E4DB}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Release|x64 = Release|x64
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{4F7E4917-4612-4B96-9838-025711ADE391}.Debug|Win32.ActiveCfg = Debug|Win32
+		{4F7E4917-4612-4B96-9838-025711ADE391}.Debug|Win32.Build.0 = Debug|Win32
+		{4F7E4917-4612-4B96-9838-025711ADE391}.Debug|x64.ActiveCfg = Debug|x64
+		{4F7E4917-4612-4B96-9838-025711ADE391}.Debug|x64.Build.0 = Debug|x64
+		{4F7E4917-4612-4B96-9838-025711ADE391}.Release|Win32.ActiveCfg = Release|Win32
+		{4F7E4917-4612-4B96-9838-025711ADE391}.Release|Win32.Build.0 = Release|Win32
+		{4F7E4917-4612-4B96-9838-025711ADE391}.Release|x64.ActiveCfg = Release|x64
+		{4F7E4917-4612-4B96-9838-025711ADE391}.Release|x64.Build.0 = Release|x64
+		{E2DEA693-F2EA-43C2-A813-053378F6E4DB}.Debug|Win32.ActiveCfg = Debug|Win32
+		{E2DEA693-F2EA-43C2-A813-053378F6E4DB}.Debug|Win32.Build.0 = Debug|Win32
+		{E2DEA693-F2EA-43C2-A813-053378F6E4DB}.Debug|x64.ActiveCfg = Debug|x64
+		{E2DEA693-F2EA-43C2-A813-053378F6E4DB}.Debug|x64.Build.0 = Debug|x64
+		{E2DEA693-F2EA-43C2-A813-053378F6E4DB}.Release|Win32.ActiveCfg = Release|Win32
+		{E2DEA693-F2EA-43C2-A813-053378F6E4DB}.Release|Win32.Build.0 = Release|Win32
+		{E2DEA693-F2EA-43C2-A813-053378F6E4DB}.Release|x64.ActiveCfg = Release|x64
+		{E2DEA693-F2EA-43C2-A813-053378F6E4DB}.Release|x64.Build.0 = Release|x64
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/project/vs/ignite_x86.slnrel
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/project/vs/ignite_x86.slnrel b/modules/platform/cpp/project/vs/ignite_x86.slnrel
new file mode 100644
index 0000000..b716b49
--- /dev/null
+++ b/modules/platform/cpp/project/vs/ignite_x86.slnrel
@@ -0,0 +1,33 @@
+
+Microsoft Visual Studio Solution File, Format Version 11.00
+# Visual Studio 2010
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "common", "..\..\common\project\vs\common.vcxproj", "{4F7E4917-4612-4B96-9838-025711ADE391}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "core", "..\..\core\project\vs\core.vcxproj", "{E2DEA693-F2EA-43C2-A813-053378F6E4DB}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Release|Win32 = Release|Win32
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{4F7E4917-4612-4B96-9838-025711ADE391}.Debug|Win32.ActiveCfg = Debug|Win32
+		{4F7E4917-4612-4B96-9838-025711ADE391}.Debug|Win32.Build.0 = Debug|Win32
+		{4F7E4917-4612-4B96-9838-025711ADE391}.Debug|x64.ActiveCfg = Debug|x64
+		{4F7E4917-4612-4B96-9838-025711ADE391}.Debug|x64.Build.0 = Debug|x64
+		{4F7E4917-4612-4B96-9838-025711ADE391}.Release|Win32.ActiveCfg = Release|Win32
+		{4F7E4917-4612-4B96-9838-025711ADE391}.Release|Win32.Build.0 = Release|Win32
+		{4F7E4917-4612-4B96-9838-025711ADE391}.Release|x64.ActiveCfg = Release|x64
+		{4F7E4917-4612-4B96-9838-025711ADE391}.Release|x64.Build.0 = Release|x64
+		{E2DEA693-F2EA-43C2-A813-053378F6E4DB}.Debug|Win32.ActiveCfg = Debug|Win32
+		{E2DEA693-F2EA-43C2-A813-053378F6E4DB}.Debug|Win32.Build.0 = Debug|Win32
+		{E2DEA693-F2EA-43C2-A813-053378F6E4DB}.Debug|x64.ActiveCfg = Debug|x64
+		{E2DEA693-F2EA-43C2-A813-053378F6E4DB}.Debug|x64.Build.0 = Debug|x64
+		{E2DEA693-F2EA-43C2-A813-053378F6E4DB}.Release|Win32.ActiveCfg = Release|Win32
+		{E2DEA693-F2EA-43C2-A813-053378F6E4DB}.Release|Win32.Build.0 = Release|Win32
+		{E2DEA693-F2EA-43C2-A813-053378F6E4DB}.Release|x64.ActiveCfg = Release|x64
+		{E2DEA693-F2EA-43C2-A813-053378F6E4DB}.Release|x64.Build.0 = Release|x64
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal


[22/28] ignite git commit: IGNITE-1513: Moved CPP.

Posted by vo...@apache.org.
http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/core/include/ignite/cache/cache.h
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/core/include/ignite/cache/cache.h b/modules/platform/cpp/core/include/ignite/cache/cache.h
new file mode 100644
index 0000000..dcc837b
--- /dev/null
+++ b/modules/platform/cpp/core/include/ignite/cache/cache.h
@@ -0,0 +1,1153 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _IGNITE_CACHE
+#define _IGNITE_CACHE
+
+#include <map>
+#include <set>
+
+#include <ignite/common/common.h>
+#include <ignite/common/concurrent.h>
+
+#include "ignite/cache/cache_peek_mode.h"
+#include "ignite/cache/query/query_cursor.h"
+#include "ignite/cache/query/query_scan.h"
+#include "ignite/cache/query/query_sql.h"
+#include "ignite/cache/query/query_text.h"
+#include "ignite/impl/cache/cache_impl.h"
+#include "ignite/impl/operations.h"
+#include "ignite/ignite_error.h"
+
+namespace ignite
+{
+    namespace cache
+    {
+        /**
+         * Main entry point for all Data Grid APIs.
+         */
+        template<typename K, typename V>
+        class IGNITE_IMPORT_EXPORT Cache
+        {
+        public:
+            /**
+             * Constructor.
+             */
+            Cache(impl::cache::CacheImpl* impl) : impl(ignite::common::concurrent::SharedPointer<impl::cache::CacheImpl>(impl))
+            {
+                // No-op.
+            }
+
+            /**
+             * Name of this cache (null for default cache).
+             */
+            char* GetName()
+            {
+                return impl.Get()->GetName();
+            }
+
+            /**
+             * Checks whether this cache contains no key-value mappings.
+             * Semantically equals to Cache.Size(IGNITE_PEEK_MODE_PRIMARY) == 0.
+             *
+             * @return True if cache is empty.
+             */
+            bool IsEmpty()
+            {
+                IgniteError err;
+
+                bool res = IsEmpty(err);
+
+                IgniteError::ThrowIfNeeded(err);
+
+                return res;
+            }
+
+            /**
+             * Checks whether this cache contains no key-value mappings.
+             * Semantically equals to Cache.Size(IGNITE_PEEK_MODE_PRIMARY) == 0.
+             *
+             * @param err Error.
+             * @return True if cache is empty.
+             */
+            bool IsEmpty(IgniteError& err)
+            {
+                return impl.Get()->IsEmpty(&err);
+            }
+
+            /**
+             * Check if cache contains mapping for this key.
+             *
+             * @param key Key.
+             * @return True if cache contains mapping for this key.
+             */
+            bool ContainsKey(const K& key)
+            {
+                IgniteError err;
+
+                bool res = ContainsKey(key, err);
+
+                IgniteError::ThrowIfNeeded(err);
+
+                return res;
+            }
+
+            /**
+             * Check if cache contains mapping for this key.
+             *
+             * @param key Key.
+             * @param err Error.
+             * @return True if cache contains mapping for this key.
+             */
+            bool ContainsKey(const K& key, IgniteError& err)
+            {
+                impl::In1Operation<K> op(&key);
+
+                return impl.Get()->ContainsKey(op, &err);
+            }
+
+            /**
+             * Check if cache contains mapping for these keys.
+             *
+             * @param keys Keys.
+             * @return True if cache contains mapping for all these keys.
+             */
+            bool ContainsKeys(const std::set<K>& keys)
+            {
+                IgniteError err;
+
+                bool res = ContainsKeys(keys, err);
+
+                IgniteError::ThrowIfNeeded(err);
+
+                return res;
+            }
+
+            /**
+             * Check if cache contains mapping for these keys.
+             *
+             * @param keys Keys.
+             * @param err Error.
+             * @return True if cache contains mapping for all these keys.
+             */
+            bool ContainsKeys(const std::set<K>& keys, IgniteError& err)
+            {
+                impl::InSetOperation<K> op(&keys);
+
+                return impl.Get()->ContainsKeys(op, &err);
+            }
+
+            /**
+             * Peeks at cached value using optional set of peek modes. This method will sequentially
+             * iterate over given peek modes, and try to peek at value using each peek mode. Once a
+             * non-null value is found, it will be immediately returned.
+             * This method does not participate in any transactions, however, it may peek at transactional
+             * value depending on the peek modes used.
+             *
+             * @param key Key.
+             * @param peekModes Peek modes.
+             * @return Value.
+             */
+            V LocalPeek(const K& key, int32_t peekModes)
+            {
+                IgniteError err;
+
+                V res = LocalPeek(key, peekModes, err);
+
+                IgniteError::ThrowIfNeeded(err);
+
+                return res;
+            }
+
+            /**
+             * Peeks at cached value using optional set of peek modes. This method will sequentially
+             * iterate over given peek modes, and try to peek at value using each peek mode. Once a
+             * non-null value is found, it will be immediately returned.
+             * This method does not participate in any transactions, however, it may peek at transactional
+             * value depending on the peek modes used.
+             *
+             * @param key Key.
+             * @param peekModes Peek modes.
+             * @param err Error.
+             * @return Value.
+             */
+            V LocalPeek(const K& key, int32_t peekModes, IgniteError& err)
+            {
+                impl::InCacheLocalPeekOperation<K> inOp(&key, peekModes);
+                impl::Out1Operation<V> outOp;
+
+                impl.Get()->LocalPeek(inOp, outOp, peekModes, &err);
+
+                return outOp.GetResult();
+            }
+
+            /**
+             * Retrieves value mapped to the specified key from cache.
+             * If the value is not present in cache, then it will be looked up from swap storage. If
+             * it's not present in swap, or if swap is disabled, and if read-through is allowed, value
+             * will be loaded from persistent store.
+             * This method is transactional and will enlist the entry into ongoing transaction if there is one.
+             *
+             * @param key Key.
+             * @return Value.
+             */
+            V Get(const K& key)
+            {
+                IgniteError err;
+
+                V res = Get(key, err);
+
+                IgniteError::ThrowIfNeeded(err);
+
+                return res;
+            }
+
+            /**
+             * Retrieves value mapped to the specified key from cache.
+             * If the value is not present in cache, then it will be looked up from swap storage. If
+             * it's not present in swap, or if swap is disabled, and if read-through is allowed, value
+             * will be loaded from persistent store.
+             * This method is transactional and will enlist the entry into ongoing transaction if there is one.
+             *
+             * @param key Key.
+             * @param err Error.
+             * @return Value.
+             */
+            V Get(const K& key, IgniteError& err)
+            {
+                impl::In1Operation<K> inOp(&key);
+                impl::Out1Operation<V> outOp;
+
+                impl.Get()->Get(inOp, outOp, &err);
+
+                return outOp.GetResult();
+            }
+
+            /**
+             * Retrieves values mapped to the specified keys from cache.
+             * If some value is not present in cache, then it will be looked up from swap storage. If
+             * it's not present in swap, or if swap is disabled, and if read-through is allowed, value
+             * will be loaded from persistent store.
+             * This method is transactional and will enlist the entry into ongoing transaction if there is one.
+             *
+             * @param keys Keys.
+             * @return Map of key-value pairs.
+             */
+            std::map<K, V> GetAll(const std::set<K>& keys)
+            {
+                IgniteError err;
+
+                std::map<K, V> res = GetAll(keys, err);
+
+                IgniteError::ThrowIfNeeded(err);
+
+                return res;
+            }
+
+            /**
+             * Retrieves values mapped to the specified keys from cache.
+             * If some value is not present in cache, then it will be looked up from swap storage. If
+             * it's not present in swap, or if swap is disabled, and if read-through is allowed, value
+             * will be loaded from persistent store.
+             * This method is transactional and will enlist the entry into ongoing transaction if there is one.
+             *
+             * @param keys Keys.
+             * @param err Error.
+             * @return Map of key-value pairs.
+             */
+            std::map<K, V> GetAll(const std::set<K>& keys, IgniteError& err)
+            {
+                impl::InSetOperation<K> inOp(&keys);
+                impl::OutMapOperation<K, V> outOp;
+
+                impl.Get()->GetAll(inOp, outOp, &err);
+
+                return outOp.GetResult();
+            }
+
+            /**
+             * Associates the specified value with the specified key in the cache.
+             * If the cache previously contained a mapping for the key,
+             * the old value is replaced by the specified value.
+             *
+             * @param key Key with which the specified value is to be associated.
+             * @param val Value to be associated with the specified key.
+             */
+            void Put(const K& key, const V& val)
+            {
+                IgniteError err;
+
+                Put(key, val, err);
+
+                IgniteError::ThrowIfNeeded(err);
+            }
+
+            /**
+             * Associates the specified value with the specified key in the cache.
+             * If the cache previously contained a mapping for the key,
+             * the old value is replaced by the specified value.
+             *
+             * @param key Key with which the specified value is to be associated.
+             * @param val Value to be associated with the specified key.
+             * @param err Error.
+             */
+            void Put(const K& key, const V& val, IgniteError& err)
+            {
+                impl::In2Operation<K, V> op(&key, &val);
+
+                impl.Get()->Put(op, &err);
+            }
+
+            /**
+             * Stores given key-value pairs in cache.
+             * If write-through is enabled, the stored values will be persisted to store.
+             * This method is transactional and will enlist the entry into ongoing transaction if there is one.
+             *
+             * @param vals Key-value pairs to store in cache.
+             */
+            void PutAll(const std::map<K, V>& vals)
+            {
+                IgniteError err;
+
+                PutAll(vals, err);
+
+                IgniteError::ThrowIfNeeded(err);
+            }
+
+            /**
+             * Stores given key-value pairs in cache.
+             * If write-through is enabled, the stored values will be persisted to store.
+             * This method is transactional and will enlist the entry into ongoing transaction if there is one.
+             *
+             * @param vals Key-value pairs to store in cache.
+             * @param err Error.
+             */
+            void PutAll(const std::map<K, V>& vals, IgniteError& err)
+            {
+                impl::InMapOperation<K, V> op(&vals);
+
+                impl.Get()->PutAll(op, &err);
+            }
+
+            /**
+             * Associates the specified value with the specified key in this cache,
+             * returning an existing value if one existed.
+             *
+             * @param key Key with which the specified value is to be associated.
+             * @param val Value to be associated with the specified key.
+             * @return The value associated with the key at the start of the
+             *     operation or null if none was associated.
+             */
+            V GetAndPut(const K& key, const V& val)
+            {
+                IgniteError err;
+
+                V res = GetAndPut(key, val, err);
+
+                IgniteError::ThrowIfNeeded(err);
+
+                return res;
+            }
+
+            /**
+             * Associates the specified value with the specified key in this cache,
+             * returning an existing value if one existed.
+             *
+             * @param key Key with which the specified value is to be associated.
+             * @param val Value to be associated with the specified key.
+             * @param err Error.
+             * @return The value associated with the key at the start of the
+             *     operation or null if none was associated.
+             */
+            V GetAndPut(const K& key, const V& val, IgniteError& err)
+            {
+                impl::In2Operation<K, V> inOp(&key, &val);
+                impl::Out1Operation<V> outOp;
+
+                impl.Get()->GetAndPut(inOp, outOp, &err);
+
+                return outOp.GetResult();
+            }
+
+            /**
+             * Atomically replaces the value for a given key if and only if there is
+             * a value currently mapped by the key.
+             *
+             * @param key Key with which the specified value is to be associated.
+             * @param val Value to be associated with the specified key.
+             * @return The previous value associated with the specified key, or
+             *     null if there was no mapping for the key.
+             */
+            V GetAndReplace(const K& key, const V& val)
+            {
+                IgniteError err;
+
+                V res = GetAndReplace(key, val, err);
+
+                IgniteError::ThrowIfNeeded(err);
+
+                return res;
+            }
+
+            /**
+             * Atomically replaces the value for a given key if and only if there is
+             * a value currently mapped by the key.
+             *
+             * @param key Key with which the specified value is to be associated.
+             * @param val Value to be associated with the specified key.
+             * @param err Error.
+             * @return The previous value associated with the specified key, or
+             *     null if there was no mapping for the key.
+             */
+            V GetAndReplace(const K& key, const V& val, IgniteError& err)
+            {
+                impl::In2Operation<K, V> inOp(&key, &val);
+                impl::Out1Operation<V> outOp;
+
+                impl.Get()->GetAndReplace(inOp, outOp, &err);
+
+                return outOp.GetResult();
+            }
+
+            /**
+             * Atomically removes the entry for a key only if currently mapped to some value.
+             *
+             * @param key Key with which the specified value is associated.
+             * @return The value if one existed or null if no mapping existed for this key.
+             */
+            V GetAndRemove(const K& key)
+            {
+                IgniteError err;
+
+                V res = GetAndRemove(key, err);
+
+                IgniteError::ThrowIfNeeded(err);
+
+                return res;
+            }
+
+            /**
+             * Atomically removes the entry for a key only if currently mapped to some value.
+             *
+             * @param key Key with which the specified value is associated.
+             * @param err Error.
+             * @return The value if one existed or null if no mapping existed for this key.
+             */
+            V GetAndRemove(const K& key, IgniteError& err)
+            {
+                impl::In1Operation<K> inOp(&key);
+                impl::Out1Operation<V> outOp;
+
+                impl.Get()->GetAndRemove(inOp, outOp, &err);
+
+                return outOp.GetResult();
+            }
+
+            /**
+             * Atomically associates the specified key with the given value if it is not
+             * already associated with a value.
+             *
+             * @param key Key with which the specified value is to be associated.
+             * @param val Value to be associated with the specified key.
+             * @return True if a value was set.
+             */
+            bool PutIfAbsent(const K& key, const V& val)
+            {
+                IgniteError err;
+
+                bool res = PutIfAbsent(key, val, err);
+
+                IgniteError::ThrowIfNeeded(err);
+
+                return res;
+            }
+
+            /**
+             * Atomically associates the specified key with the given value if it is not
+             * already associated with a value.
+             *
+             * @param key Key with which the specified value is to be associated.
+             * @param val Value to be associated with the specified key.
+             * @param err Error.
+             * @return True if a value was set.
+             */
+            bool PutIfAbsent(const K& key, const V& val, IgniteError& err)
+            {
+                impl::In2Operation<K, V> op(&key, &val);
+
+                return impl.Get()->PutIfAbsent(op, &err);
+            }
+
+            /**
+             * Stores given key-value pair in cache only if cache had no previous mapping for it.
+             * If cache previously contained value for the given key, then this value is returned.
+             * In case of PARTITIONED or REPLICATED caches, the value will be loaded from the primary node,
+             * which in its turn may load the value from the swap storage, and consecutively, if it's not
+             * in swap, from the underlying persistent storage.
+             * If the returned value is not needed, method putxIfAbsent() should be used instead of this one to
+             * avoid the overhead associated with returning of the previous value.
+             * If write-through is enabled, the stored value will be persisted to store.
+             * This method is transactional and will enlist the entry into ongoing transaction if there is one.
+             *
+             * @param key Key to store in cache.
+             * @param val Value to be associated with the given key.
+             * @return Previously contained value regardless of whether put happened or not
+             *     (null if there was no previous value).
+             */
+            V GetAndPutIfAbsent(const K& key, const V& val)
+            {
+                IgniteError err;
+
+                V res = GetAndPutIfAbsent(key, val, err);
+
+                IgniteError::ThrowIfNeeded(err);
+
+                return res;
+            }
+
+            /**
+             * Stores given key-value pair in cache only if cache had no previous mapping for it.
+             * If cache previously contained value for the given key, then this value is returned.
+             * In case of PARTITIONED or REPLICATED caches, the value will be loaded from the primary node,
+             * which in its turn may load the value from the swap storage, and consecutively, if it's not
+             * in swap, from the underlying persistent storage.
+             * If the returned value is not needed, method putxIfAbsent() should be used instead of this one to
+             * avoid the overhead associated with returning of the previous value.
+             * If write-through is enabled, the stored value will be persisted to store.
+             * This method is transactional and will enlist the entry into ongoing transaction if there is one.
+             *
+             * @param key Key to store in cache.
+             * @param val Value to be associated with the given key.
+             * @param err Error.
+             * @return Previously contained value regardless of whether put happened or not
+             *     (null if there was no previous value).
+             */
+            V GetAndPutIfAbsent(const K& key, const V& val, IgniteError& err)
+            {
+                impl::In2Operation<K, V> inOp(&key, &val);
+                impl::Out1Operation<V> outOp;
+
+                impl.Get()->GetAndPutIfAbsent(inOp, outOp, &err);
+
+                return outOp.GetResult();
+            }
+
+            /**
+             * Stores given key-value pair in cache only if there is a previous mapping for it.
+             * If cache previously contained value for the given key, then this value is returned.
+             * In case of PARTITIONED or REPLICATED caches, the value will be loaded from the primary node,
+             * which in its turn may load the value from the swap storage, and consecutively, if it's not
+             * in swap, rom the underlying persistent storage.
+             * If write-through is enabled, the stored value will be persisted to store.
+             * This method is transactional and will enlist the entry into ongoing transaction if there is one.
+             *
+             * @param key Key to store in cache.
+             * @param val Value to be associated with the given key.
+             * @return True if the value was replaced.
+             */
+            bool Replace(const K& key, const V& val)
+            {
+                IgniteError err;
+
+                bool res = Replace(key, val, err);
+
+                IgniteError::ThrowIfNeeded(err);
+
+                return res;
+            }
+
+            /**
+             * Stores given key-value pair in cache only if there is a previous mapping for it.
+             * If cache previously contained value for the given key, then this value is returned.
+             * In case of PARTITIONED or REPLICATED caches, the value will be loaded from the primary node,
+             * which in its turn may load the value from the swap storage, and consecutively, if it's not
+             * in swap, rom the underlying persistent storage.
+             * If write-through is enabled, the stored value will be persisted to store.
+             * This method is transactional and will enlist the entry into ongoing transaction if there is one.
+             *
+             * @param key Key to store in cache.
+             * @param val Value to be associated with the given key.
+             * @param err Error.
+             * @return True if the value was replaced.
+             */
+            bool Replace(const K& key, const V& val, IgniteError& err)
+            {
+                impl::In2Operation<K, V> op(&key, &val);
+
+                return impl.Get()->Replace(op, &err);
+            }
+
+            /**
+             * Stores given key-value pair in cache only if only if the previous value is equal to the
+             * old value passed as argument.
+             * This method is transactional and will enlist the entry into ongoing transaction if there is one.
+             *
+             * @param key Key to store in cache.
+             * @param oldVal Old value to match.
+             * @param newVal Value to be associated with the given key.
+             * @return True if replace happened, false otherwise.
+             */
+            bool Replace(const K& key, const V& oldVal, const V& newVal)
+            {
+                IgniteError err;
+
+                bool res = Replace(key, oldVal, newVal, err);
+
+                IgniteError::ThrowIfNeeded(err);
+
+                return res;
+            }
+
+            /**
+             * Stores given key-value pair in cache only if only if the previous value is equal to the
+             * old value passed as argument.
+             * This method is transactional and will enlist the entry into ongoing transaction if there is one.
+             *
+             * @param key Key to store in cache.
+             * @param oldVal Old value to match.
+             * @param newVal Value to be associated with the given key.
+             * @param err Error.
+             * @return True if replace happened, false otherwise.
+             */
+            bool Replace(const K& key, const V& oldVal, const V& newVal, IgniteError& err)
+            {
+                impl::In3Operation<K, V, V> op(&key, &oldVal, &newVal);
+
+                return impl.Get()->ReplaceIfEqual(op, &err);
+            }
+
+            /**
+             * Attempts to evict all entries associated with keys. Note, that entry will be evicted only
+             * if it's not used (not participating in any locks or transactions).
+             *
+             * @param keys Keys to evict from cache.
+             */
+            void LocalEvict(const std::set<K>& keys)
+            {
+                IgniteError err;
+
+                LocalEvict(keys, err);
+
+                IgniteError::ThrowIfNeeded(err);
+            }
+
+            /**
+             * Attempts to evict all entries associated with keys. Note, that entry will be evicted only
+             * if it's not used (not participating in any locks or transactions).
+             *
+             * @param keys Keys to evict from cache.
+             * @param err Error.
+             */
+            void LocalEvict(const std::set<K>& keys, IgniteError& err)
+            {
+                impl::InSetOperation<K> op(&keys);
+
+                impl.Get()->LocalEvict(op, &err);
+            }
+
+            /**
+             * Clear cache.
+             */
+            void Clear()
+            {
+                IgniteError err;
+
+                Clear(err);
+
+                IgniteError::ThrowIfNeeded(err);
+            }
+
+            /**
+             * Clear cache.
+             *
+             * @param err Error.
+             */
+            void Clear(IgniteError& err)
+            {
+                impl.Get()->Clear(&err);
+            }
+
+            /**
+             * Clear entry from the cache and swap storage, without notifying listeners or CacheWriters.
+             * Entry is cleared only if it is not currently locked, and is not participating in a transaction.
+             *
+             * @param key Key to clear.
+             */
+            void Clear(const K& key)
+            {
+                IgniteError err;
+
+                Clear(key, err);
+
+                IgniteError::ThrowIfNeeded(err);
+            }
+
+            /**
+             * Clear entry from the cache and swap storage, without notifying listeners or CacheWriters.
+             * Entry is cleared only if it is not currently locked, and is not participating in a transaction.
+             *
+             * @param key Key to clear.
+             * @param err Error.
+             */
+            void Clear(const K& key, IgniteError& err)
+            {
+                impl::In1Operation<K> op(&key);
+
+                impl.Get()->Clear(op, &err);
+            }
+
+            /**
+             * Clear entries from the cache and swap storage, without notifying listeners or CacheWriters.
+             * Entry is cleared only if it is not currently locked, and is not participating in a transaction.
+             *
+             * @param keys Keys to clear.
+             */
+            void ClearAll(const std::set<K>& keys)
+            {
+                IgniteError err;
+
+                ClearAll(keys, err);
+
+                IgniteError::ThrowIfNeeded(err);
+            }
+
+            /**
+             * Clear entries from the cache and swap storage, without notifying listeners or CacheWriters.
+             * Entry is cleared only if it is not currently locked, and is not participating in a transaction.
+             *
+             * @param keys Keys to clear.
+             * @param err Error.
+             */
+            void ClearAll(const std::set<K>& keys, IgniteError& err)
+            {
+                impl::InSetOperation<K> op(&keys);
+
+                impl.Get()->ClearAll(op, &err);
+            }
+
+            /**
+             * Clear entry from the cache and swap storage, without notifying listeners or CacheWriters.
+             * Entry is cleared only if it is not currently locked, and is not participating in a transaction.
+             * Note that this operation is local as it merely clears an entry from local cache, it does not
+             * remove entries from remote caches.
+             *
+             * @param key Key to clear.
+             */
+            void LocalClear(const K& key)
+            {
+                IgniteError err;
+
+                LocalClear(key, err);
+
+                IgniteError::ThrowIfNeeded(err);
+            }
+
+            /**
+             * Clear entry from the cache and swap storage, without notifying listeners or CacheWriters.
+             * Entry is cleared only if it is not currently locked, and is not participating in a transaction.
+             * Note that this operation is local as it merely clears an entry from local cache, it does not
+             * remove entries from remote caches.
+             *
+             * @param key Key to clear.
+             * @param err Error.
+             */
+            void LocalClear(const K& key, IgniteError& err)
+            {
+                impl::In1Operation<K> op(&key);
+
+                impl.Get()->LocalClear(op, &err);
+            }
+
+            /**
+             * Clear entries from the cache and swap storage, without notifying listeners or CacheWriters.
+             * Entry is cleared only if it is not currently locked, and is not participating in a transaction.
+             * Note that this operation is local as it merely clears entries from local cache, it does not
+             * remove entries from remote caches.
+             *
+             * @param keys Keys to clear.
+             */
+            void LocalClearAll(const std::set<K>& keys)
+            {
+                IgniteError err;
+
+                LocalClearAll(keys, err);
+
+                IgniteError::ThrowIfNeeded(err);
+            }
+
+            /**
+             * Clear entries from the cache and swap storage, without notifying listeners or CacheWriters.
+             * Entry is cleared only if it is not currently locked, and is not participating in a transaction.
+             * Note that this operation is local as it merely clears entries from local cache, it does not
+             * remove entries from remote caches.
+             *
+             * @param keys Keys to clear.
+             * @param err Error.
+             */
+            void LocalClearAll(const std::set<K>& keys, IgniteError& err)
+            {
+                impl::InSetOperation<K> op(&keys);
+
+                impl.Get()->LocalClearAll(op, &err);
+            }
+
+            /**
+             * Removes given key mapping from cache. If cache previously contained value for the given key,
+             * then this value is returned. In case of PARTITIONED or REPLICATED caches, the value will be
+             * loaded from the primary node, which in its turn may load the value from the disk-based swap
+             * storage, and consecutively, if it's not in swap, from the underlying persistent storage.
+             * If the returned value is not needed, method removex() should always be used instead of this
+             * one to avoid the overhead associated with returning of the previous value.
+             * If write-through is enabled, the value will be removed from store.
+             * This method is transactional and will enlist the entry into ongoing transaction if there is one.
+             *
+             * @param key Key whose mapping is to be removed from cache.
+             * @return False if there was no matching key.
+             */
+            bool Remove(const K& key)
+            {
+                IgniteError err;
+
+                bool res = Remove(key, err);
+
+                IgniteError::ThrowIfNeeded(err);
+
+                return res;
+            }
+
+            /**
+             * Removes given key mapping from cache. If cache previously contained value for the given key,
+             * then this value is returned. In case of PARTITIONED or REPLICATED caches, the value will be
+             * loaded from the primary node, which in its turn may load the value from the disk-based swap
+             * storage, and consecutively, if it's not in swap, from the underlying persistent storage.
+             * If the returned value is not needed, method removex() should always be used instead of this
+             * one to avoid the overhead associated with returning of the previous value.
+             * If write-through is enabled, the value will be removed from store.
+             * This method is transactional and will enlist the entry into ongoing transaction if there is one.
+             *
+             * @param key Key whose mapping is to be removed from cache.
+             * @param err Error.
+             * @return False if there was no matching key.
+             */
+            bool Remove(const K& key, IgniteError& err)
+            {
+                impl::In1Operation<K> op(&key);
+
+                return impl.Get()->Remove(op, &err);
+            }
+
+            /**
+             * Removes given key mapping from cache if one exists and value is equal to the passed in value.
+             * If write-through is enabled, the value will be removed from store.
+             * This method is transactional and will enlist the entry into ongoing transaction if there is one.
+             *
+             * @param key Key whose mapping is to be removed from cache.
+             * @param val Value to match against currently cached value.
+             * @return True if entry was removed, false otherwise.
+             */
+            bool Remove(const K& key, const V& val)
+            {
+                IgniteError err;
+
+                bool res = Remove(key, val, err);
+
+                IgniteError::ThrowIfNeeded(err);
+
+                return res;
+            }
+
+            /**
+             * Removes given key mapping from cache if one exists and value is equal to the passed in value.
+             * If write-through is enabled, the value will be removed from store.
+             * This method is transactional and will enlist the entry into ongoing transaction if there is one.
+             *
+             * @param key Key whose mapping is to be removed from cache.
+             * @param val Value to match against currently cached value.
+             * @param err Error.
+             * @return True if entry was removed, false otherwise.
+             */
+            bool Remove(const K& key, const V& val, IgniteError& err)
+            {
+                impl::In2Operation<K, V> op(&key, &val);
+
+                return impl.Get()->RemoveIfEqual(op, &err);
+            }
+
+            /**
+             * Removes given key mappings from cache.
+             * If write-through is enabled, the value will be removed from store.
+             * This method is transactional and will enlist the entry into ongoing transaction if there is one.
+             *
+             * @param keys Keys whose mappings are to be removed from cache.
+             */
+            void RemoveAll(const std::set<K>& keys)
+            {
+                IgniteError err;
+
+                RemoveAll(keys, err);
+
+                IgniteError::ThrowIfNeeded(err);
+            }
+
+            /**
+             * Removes given key mappings from cache.
+             * If write-through is enabled, the value will be removed from store.
+             * This method is transactional and will enlist the entry into ongoing transaction if there is one.
+             *
+             * @param keys Keys whose mappings are to be removed from cache.
+             * @param err Error.
+             */
+            void RemoveAll(const std::set<K>& keys, IgniteError& err)
+            {
+                impl::InSetOperation<K> op(&keys);
+
+                impl.Get()->RemoveAll(op, &err);
+            }
+
+            /**
+             * Removes all mappings from cache.
+             * If write-through is enabled, the value will be removed from store.
+             * This method is transactional and will enlist the entry into ongoing transaction if there is one.
+             *
+             * @param err Error.
+             */
+            void RemoveAll()
+            {
+                IgniteError err;
+
+                RemoveAll(err);
+
+                IgniteError::ThrowIfNeeded(err);
+            }
+
+            /**
+             * Removes all mappings from cache.
+             * If write-through is enabled, the value will be removed from store.
+             * This method is transactional and will enlist the entry into ongoing transaction if there is one.
+             *
+             * @param err Error.
+             */
+            void RemoveAll(IgniteError& err)
+            {
+                return impl.Get()->RemoveAll(&err);
+            }
+
+            /**
+             * Gets the number of all entries cached on this node.
+             *
+             * @return Cache size on this node.
+             */
+            int32_t LocalSize()
+            {
+                return LocalSize(IGNITE_PEEK_MODE_ALL);
+            }
+
+            /**
+             * Gets the number of all entries cached on this node.
+             *
+             * @param err Error.
+             * @return Cache size on this node.
+             */
+            int32_t LocalSize(IgniteError& err)
+            {
+                return LocalSize(IGNITE_PEEK_MODE_ALL, err);
+            }
+
+            /**
+             * Gets the number of all entries cached on this node.
+             *
+             * @param Peek modes.
+             * @return Cache size on this node.
+             */
+            int32_t LocalSize(int32_t peekModes)
+            {
+                IgniteError err;
+
+                int32_t res = LocalSize(peekModes, err);
+
+                IgniteError::ThrowIfNeeded(err);
+
+                return res;
+            }
+
+            /**
+             * Gets the number of all entries cached on this node.
+             *
+             * @param Peek modes.
+             * @param err Error.
+             * @return Cache size on this node.
+             */
+            int32_t LocalSize(int32_t peekModes, IgniteError& err)
+            {
+                return impl.Get()->LocalSize(peekModes, &err);
+            }
+
+            /**
+             * Gets the number of all entries cached across all nodes.
+             * NOTE: this operation is distributed and will query all participating nodes for their cache sizes.
+             *
+             * @return Cache size across all nodes.
+             */
+            int32_t Size()
+            {
+                return Size(ignite::cache::IGNITE_PEEK_MODE_ALL);
+            }
+
+            /**
+             * Gets the number of all entries cached across all nodes.
+             * NOTE: this operation is distributed and will query all participating nodes for their cache sizes.
+             *
+             * @param err Error.
+             * @return Cache size across all nodes.
+             */
+            int32_t Size(IgniteError& err)
+            {
+                return Size(ignite::cache::IGNITE_PEEK_MODE_ALL, err);
+            }
+
+            /**
+             * Gets the number of all entries cached across all nodes.
+             * NOTE: this operation is distributed and will query all participating nodes for their cache sizes.
+             *
+             * @param Peek modes.
+             * @return Cache size across all nodes.
+             */
+            int32_t Size(int32_t peekModes)
+            {
+                IgniteError err;
+
+                int32_t res = Size(peekModes, err);
+
+                IgniteError::ThrowIfNeeded(err);
+
+                return res;
+            }
+
+            /**
+             * Gets the number of all entries cached across all nodes.
+             * NOTE: this operation is distributed and will query all participating nodes for their cache sizes.
+             *
+             * @param Peek modes.
+             * @param err Error.
+             * @return Cache size across all nodes.
+             */
+            int32_t Size(int32_t peekModes, IgniteError& err)
+            {
+                return impl.Get()->Size(peekModes, &err);
+            }
+
+            /**
+             * Perform SQL query.
+             *
+             * @param qry Query.
+             * @return Query cursor.
+             */
+            query::QueryCursor<K, V> Query(const query::SqlQuery& qry)
+            {
+                IgniteError err;
+
+                query::QueryCursor<K, V> res = Query(qry, err);
+
+                IgniteError::ThrowIfNeeded(err);
+
+                return res;
+            }
+
+            /**
+             * Perform SQL query.
+             *
+             * @param qry Query.
+             * @param err Error.
+             * @return Query cursor.
+             */
+            query::QueryCursor<K, V> Query(const query::SqlQuery& qry, IgniteError& err)
+            {
+                impl::cache::query::QueryCursorImpl* cursorImpl = impl.Get()->QuerySql(qry, &err);
+
+                return query::QueryCursor<K, V>(cursorImpl);
+            }
+
+            /*
+             * Perform text query.
+             *
+             * @param qry Query.
+             * @return Query cursor.
+             */
+            query::QueryCursor<K, V> Query(const query::TextQuery& qry)
+            {
+                IgniteError err;
+
+                query::QueryCursor<K, V> res = Query(qry, err);
+
+                IgniteError::ThrowIfNeeded(err);
+
+                return res;
+            }
+
+            /*
+             * Perform text query.
+             *
+             * @param qry Query.
+             * @param err Error.
+             * @return Query cursor.
+             */
+            query::QueryCursor<K, V> Query(const query::TextQuery& qry, IgniteError& err)
+            {
+                impl::cache::query::QueryCursorImpl* cursorImpl = impl.Get()->QueryText(qry, &err);
+
+                return query::QueryCursor<K, V>(cursorImpl);
+            }
+
+            /*
+             * Perform scan query.
+             *
+             * @param qry Query.
+             * @return Query cursor.
+             */
+            query::QueryCursor<K, V> Query(const query::ScanQuery& qry)
+            {
+                IgniteError err;
+
+                query::QueryCursor<K, V> res = Query(qry, err);
+
+                IgniteError::ThrowIfNeeded(err);
+
+                return res;
+            }
+
+            /*
+             * Perform scan query.
+             *
+             * @param qry Query.
+             * @param err Error.
+             * @return Query cursor.
+             */
+            query::QueryCursor<K, V> Query(const query::ScanQuery& qry, IgniteError& err)
+            {
+                impl::cache::query::QueryCursorImpl* cursorImpl = impl.Get()->QueryScan(qry, &err);
+
+                return query::QueryCursor<K, V>(cursorImpl);
+            }
+
+        private:
+            /** Implementation delegate. */
+            ignite::common::concurrent::SharedPointer<impl::cache::CacheImpl> impl;
+        };
+    }
+}
+
+#endif

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/core/include/ignite/cache/cache_entry.h
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/core/include/ignite/cache/cache_entry.h b/modules/platform/cpp/core/include/ignite/cache/cache_entry.h
new file mode 100644
index 0000000..2b6c785
--- /dev/null
+++ b/modules/platform/cpp/core/include/ignite/cache/cache_entry.h
@@ -0,0 +1,118 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _IGNITE_CACHE_ENTRY
+#define _IGNITE_CACHE_ENTRY
+
+#include <ignite/common/common.h>
+
+namespace ignite
+{
+    namespace cache
+    {
+        /**
+         * Cache entry.
+         */
+        template<typename K, typename V>
+        class IGNITE_IMPORT_EXPORT CacheEntry
+        {
+        public:
+            /**
+             * Default constructor.
+             */
+            CacheEntry() : key(K()), val(V())
+            {
+                // No-op.
+            }
+
+            /**
+             * Constructor.
+             *
+             * @param key Key.
+             * @param val Value.
+             */
+            CacheEntry(const K& key, const V& val) : key(key), val(val)
+            {
+                // No-op.
+            }
+
+            /**
+             * Copy constructor.
+             *
+             * @param other Other instance.
+             */
+            CacheEntry(const CacheEntry& other)
+            {
+                key = other.key;
+                val = other.val;
+            }
+
+            /**
+             * Assignment operator.
+             *
+             * @param other Other instance.
+             */
+            CacheEntry& operator=(const CacheEntry& other) 
+            {
+                if (this != &other)
+                {
+                    CacheEntry tmp(other);
+
+                    K& key0 = key;
+                    V& val0 = val;
+
+                    key = tmp.key;
+                    val = tmp.val;
+
+                    tmp.key = key0;
+                    tmp.val = val0;
+                }
+
+                return *this;
+            }
+
+            /**
+             * Get key.
+             * 
+             * @return Key.
+             */
+            K GetKey()
+            {
+                return key;
+            }
+
+            /**
+             * Get value.
+             *
+             * @return Value.
+             */
+            V GetValue()
+            {
+                return val;
+            }
+
+        private:
+            /** Key. */
+            K key; 
+
+            /** Value. */
+            V val; 
+        };
+    }
+}
+
+#endif

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/core/include/ignite/cache/cache_peek_mode.h
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/core/include/ignite/cache/cache_peek_mode.h b/modules/platform/cpp/core/include/ignite/cache/cache_peek_mode.h
new file mode 100644
index 0000000..be61887
--- /dev/null
+++ b/modules/platform/cpp/core/include/ignite/cache/cache_peek_mode.h
@@ -0,0 +1,71 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _IGNITE_CACHE_PEEK_MODE
+#define _IGNITE_CACHE_PEEK_MODE
+
+namespace ignite
+{
+    namespace cache
+    {
+        /**
+         * Enumeration of all supported cache peek modes.
+         */
+        enum CachePeekMode
+        {
+            /**
+             * Peeks into all available cache storages.
+             */
+            IGNITE_PEEK_MODE_ALL = 0x01,
+
+            /**
+             * Peek into near cache only (don't peek into partitioned cache).
+             * In case of LOCAL cache, behaves as IGNITE_PEEK_MODE_ALL mode.
+             */
+            IGNITE_PEEK_MODE_NEAR = 0x02,
+
+            /**
+             * Peek value from primary copy of partitioned cache only (skip near cache).
+             * In case of LOCAL cache, behaves as IGNITE_PEEK_MODE_ALL mode.
+             */
+            IGNITE_PEEK_MODE_PRIMARY = 0x04,
+
+            /**
+             * Peek value from backup copies of partitioned cache only (skip near cache).
+             * In case of LOCAL cache, behaves as IGNITE_PEEK_MODE_ALL mode.
+             */
+            IGNITE_PEEK_MODE_BACKUP = 0x08,
+
+            /**
+             * Peeks value from the on-heap storage only.
+             */
+            IGNITE_PEEK_MODE_ONHEAP = 0x10,
+
+            /**
+             * Peeks value from the off-heap storage only, without loading off-heap value into cache.
+             */
+            IGNITE_PEEK_MODE_OFFHEAP = 0x20,
+
+            /**
+             * Peeks value from the swap storage only, without loading swapped value into cache.
+             */
+            IGNITE_PEEK_MODE_SWAP = 0x40
+        };
+    }
+}
+
+#endif
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/core/include/ignite/cache/query/query.h
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/core/include/ignite/cache/query/query.h b/modules/platform/cpp/core/include/ignite/cache/query/query.h
new file mode 100644
index 0000000..f2d19cd
--- /dev/null
+++ b/modules/platform/cpp/core/include/ignite/cache/query/query.h
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _IGNITE_QUERY
+#define _IGNITE_QUERY
+
+#include "ignite/cache/query/query_argument.h"
+#include "ignite/cache/query/query_cursor.h"
+#include "ignite/cache/query/query_scan.h"
+#include "ignite/cache/query/query_sql.h"
+#include "ignite/cache/query/query_text.h"
+
+#endif
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/core/include/ignite/cache/query/query_argument.h
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/core/include/ignite/cache/query/query_argument.h b/modules/platform/cpp/core/include/ignite/cache/query/query_argument.h
new file mode 100644
index 0000000..0f41c56
--- /dev/null
+++ b/modules/platform/cpp/core/include/ignite/cache/query/query_argument.h
@@ -0,0 +1,125 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _IGNITE_CACHE_QUERY_ARGUMENT
+#define _IGNITE_CACHE_QUERY_ARGUMENT
+
+#include "ignite/portable/portable_raw_writer.h"
+
+namespace ignite
+{    
+    namespace cache
+    {
+        namespace query
+        {            
+            /**
+             * Base class for all query arguments.
+             */
+            class QueryArgumentBase
+            {
+            public:
+                /**
+                 * Destructor.
+                 */
+                virtual ~QueryArgumentBase()
+                {
+                    // No-op.
+                }
+
+                /**
+                 * Copy argument. 
+                 *
+                 * @return Copy.
+                 */
+                virtual QueryArgumentBase* Copy() = 0;
+
+                /**
+                 * Write argument.
+                 */
+                virtual void Write(ignite::portable::PortableRawWriter& writer) = 0;
+            };
+
+            /**
+             * Query argument.
+             */
+            template<typename T>
+            class QueryArgument : public QueryArgumentBase
+            {
+            public:
+                /**
+                 * Constructor.
+                 *
+                 * @param val Value.
+                 */
+                QueryArgument(const T& val) : val(val)
+                {
+                    // No-op.
+                }
+
+                /**
+                 * Copy constructor.
+                 *
+                 * @param other Other instance.
+                 */
+                QueryArgument(const QueryArgument& other)
+                {
+                    val = other.val;
+                }
+
+                /**
+                 * Assignment operator.
+                 *
+                 * @param other Other instance.
+                 */
+                QueryArgument& operator=(const QueryArgument& other) 
+                {
+                    if (this != &other)
+                    {
+                        QueryArgument tmp(other);
+
+                        T val0 = val;
+                        val = tmp.val;
+                        tmp.val = val0;
+                    }
+
+                    return *this;
+                }
+
+                ~QueryArgument()
+                {
+                    // No-op.
+                }
+
+                QueryArgumentBase* Copy()
+                {
+                    return new QueryArgument(val);
+                }
+
+                void Write(ignite::portable::PortableRawWriter& writer)
+                {
+                    writer.WriteObject<T>(val);
+                }
+
+            private:
+                /** Value. */
+                T val; 
+            };
+        }
+    }    
+}
+
+#endif
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/core/include/ignite/cache/query/query_cursor.h
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/core/include/ignite/cache/query/query_cursor.h b/modules/platform/cpp/core/include/ignite/cache/query/query_cursor.h
new file mode 100644
index 0000000..23133e1
--- /dev/null
+++ b/modules/platform/cpp/core/include/ignite/cache/query/query_cursor.h
@@ -0,0 +1,191 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _IGNITE_CACHE_QUERY_CURSOR
+#define _IGNITE_CACHE_QUERY_CURSOR
+
+#include <vector>
+
+#include <ignite/common/concurrent.h>
+
+#include "ignite/cache/cache_entry.h"
+#include "ignite/ignite_error.h"
+#include "ignite/impl/cache/query/query_impl.h"
+#include "ignite/impl/operations.h"
+
+namespace ignite
+{    
+    namespace cache
+    {
+        namespace query
+        {            
+            /**
+             * Query cursor.
+             */
+            template<typename K, typename V>
+            class QueryCursor
+            {
+            public:
+                /**
+                 * Default constructor.
+                 */
+                QueryCursor() : impl(NULL)
+                {
+                    // No-op.
+                }
+
+                /**
+                 * Constructor.
+                 *
+                 * @param impl Implementation.
+                 */
+                QueryCursor(impl::cache::query::QueryCursorImpl* impl) : 
+                    impl(ignite::common::concurrent::SharedPointer<impl::cache::query::QueryCursorImpl>(impl))
+                {
+                    // No-op.
+                }
+                
+                /**
+                 * Check whether next entry exists.
+                 *
+                 * @return True if next entry exists.
+                 */
+                bool HasNext()
+                {
+                    IgniteError err;
+
+                    bool res = HasNext(err);
+
+                    IgniteError::ThrowIfNeeded(err);
+
+                    return res;
+                }
+
+                /**
+                 * Check whether next entry exists.
+                 *
+                 * @param err Error.
+                 * @return True if next entry exists.
+                 */
+                bool HasNext(IgniteError& err)
+                {
+                    impl::cache::query::QueryCursorImpl* impl0 = impl.Get();
+
+                    if (impl0)
+                        return impl0->HasNext(&err);
+                    else
+                    {
+                        err = IgniteError(IgniteError::IGNITE_ERR_GENERIC, 
+                            "Instance is not usable (did you check for error?).");
+
+                        return false;
+                    }
+                }
+
+                /**
+                 * Get next entry.
+                 *
+                 * @return Next entry.
+                 */
+                CacheEntry<K, V> GetNext()
+                {
+                    IgniteError err;
+
+                    CacheEntry<K, V> res = GetNext(err);
+
+                    IgniteError::ThrowIfNeeded(err);
+
+                    return res;                        
+                }
+
+                /**
+                 * Get next entry.
+                 *
+                 * @param err Error.
+                 * @return Next entry.
+                 */
+                CacheEntry<K, V> GetNext(IgniteError& err)
+                {
+                    impl::cache::query::QueryCursorImpl* impl0 = impl.Get();
+
+                    if (impl0) {
+                        impl::Out2Operation<K, V> outOp;
+
+                        impl0->GetNext(outOp, &err);
+
+                        if (err.GetCode() == IgniteError::IGNITE_SUCCESS) 
+                        {
+                            K& key = outOp.Get1();
+                            V& val = outOp.Get2();
+
+                            return CacheEntry<K, V>(key, val);
+                        }
+                        else 
+                            return CacheEntry<K, V>();
+                    }
+                    else
+                    {
+                        err = IgniteError(IgniteError::IGNITE_ERR_GENERIC,
+                            "Instance is not usable (did you check for error?).");
+
+                        return CacheEntry<K, V>();
+                    }
+                }
+
+                /**
+                 * Get all entries.
+                 * 
+                 * @param Vector where query entries will be stored.
+                 */
+                void GetAll(std::vector<CacheEntry<K, V>>& res)
+                {
+                    IgniteError err;
+
+                    GetAll(res, err);
+
+                    IgniteError::ThrowIfNeeded(err);
+                }
+
+                /**
+                 * Get all entries.
+                 * 
+                 * @param Vector where query entries will be stored.
+                 * @param err Error.                 
+                 */
+                void GetAll(std::vector<CacheEntry<K, V>>& res, IgniteError& err)
+                {
+                    impl::cache::query::QueryCursorImpl* impl0 = impl.Get();
+
+                    if (impl0) {
+                        impl::OutQueryGetAllOperation<K, V> outOp(&res);
+
+                        impl0->GetAll(outOp, &err);
+                    }
+                    else
+                        err = IgniteError(IgniteError::IGNITE_ERR_GENERIC,
+                            "Instance is not usable (did you check for error?).");
+                }
+
+            private:
+                /** Implementation delegate. */
+                ignite::common::concurrent::SharedPointer<impl::cache::query::QueryCursorImpl> impl;
+            };
+        }
+    }    
+}
+
+#endif
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/core/include/ignite/cache/query/query_scan.h
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/core/include/ignite/cache/query/query_scan.h b/modules/platform/cpp/core/include/ignite/cache/query/query_scan.h
new file mode 100644
index 0000000..c3ec845
--- /dev/null
+++ b/modules/platform/cpp/core/include/ignite/cache/query/query_scan.h
@@ -0,0 +1,151 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _IGNITE_CACHE_QUERY_SCAN
+#define _IGNITE_CACHE_QUERY_SCAN
+
+#include <stdint.h>
+#include <string>
+
+#include "ignite/portable/portable_raw_writer.h"
+
+namespace ignite
+{    
+    namespace cache
+    {
+        namespace query
+        {         
+            /*
+             * Scab query.
+             */
+            class ScanQuery
+            {
+            public:
+                /* 
+                 * Constructor.
+                 */
+                ScanQuery() : part(-1), pageSize(1024), loc(false)
+                {
+                    // No-op.
+                }
+                
+                /*
+                 * Constructor.
+                 *
+                 * @param part Partition.
+                 */
+                ScanQuery(int32_t part) : part(part), pageSize(1024), loc(false)
+                {
+                    // No-op.
+                }
+                
+                /*
+                 * Get partition to scan.
+                 *
+                 * @return Partition to scan.
+                 */
+                int32_t GetPartition()
+                {
+                    return part;
+                }
+
+                /*
+                 * Set partition to scan.
+                 *
+                 * @param part Partition to scan.
+                 */
+                void SetPartition(int32_t part)
+                {
+                    this->part = part;
+                }
+
+                /*
+                 * Get page size.
+                 *
+                 * @return Page size.
+                 */
+                int32_t GetPageSize()
+                {
+                    return pageSize;
+                }
+
+                /*
+                 * Set page size.
+                 *
+                 * @param pageSize Page size.
+                 */
+                void SetPageSize(int32_t pageSize)
+                {
+                    this->pageSize = pageSize;
+                }
+
+                /*
+                 * Get local flag.
+                 *
+                 * @return Local flag.
+                 */
+                bool IsLocal()
+                {
+                    return loc;
+                }
+
+                /*
+                 * Set local flag.
+                 *
+                 * @param loc Local flag.
+                 */
+                void SetLocal(bool loc)
+                {
+                    this->loc = loc;
+                }
+                
+                /*
+                 * Write query info to the stream.
+                 *
+                 * @param writer Writer.
+                 */
+                void Write(portable::PortableRawWriter& writer) const
+                {
+                    writer.WriteBool(loc);
+                    writer.WriteInt32(pageSize);
+
+                    if (part < 0)
+                        writer.WriteBool(false);
+                    else
+                    {
+                        writer.WriteBool(true);
+                        writer.WriteInt32(part);
+                    }
+
+                    writer.WriteNull(); // Predicates are not supported yet.
+                }
+
+            private:
+                /* Partition. */
+                int32_t part;
+
+                /* Page size. */
+                int32_t pageSize;
+
+                /* Local flag. */
+                bool loc;
+            };
+        }
+    }    
+}
+
+#endif
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/core/include/ignite/cache/query/query_sql.h
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/core/include/ignite/cache/query/query_sql.h b/modules/platform/cpp/core/include/ignite/cache/query/query_sql.h
new file mode 100644
index 0000000..a2e0f33
--- /dev/null
+++ b/modules/platform/cpp/core/include/ignite/cache/query/query_sql.h
@@ -0,0 +1,253 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _IGNITE_CACHE_QUERY_SQL
+#define _IGNITE_CACHE_QUERY_SQL
+
+#include <stdint.h>
+#include <string>
+#include <vector>
+
+#include "ignite/cache/query/query_argument.h"
+#include "ignite/portable/portable_raw_writer.h"
+
+namespace ignite
+{    
+    namespace cache
+    {
+        namespace query
+        {         
+            /**
+             * Sql query.
+             */
+            class SqlQuery
+            {
+            public:
+                /**
+                 * Constructor.
+                 *
+                 * @param type Type name.
+                 * @param sql SQL string.
+                 */
+                SqlQuery(std::string type, std::string sql) : type(type), sql(sql), pageSize(1024), 
+                    loc(false), args(NULL)
+                {
+                    // No-op.
+                }
+
+                /**
+                 * Copy constructor.
+                 *
+                 * @param other Other instance.
+                 */
+                SqlQuery(const SqlQuery& other)
+                {
+                    type = other.type;
+                    sql = other.sql;
+                    pageSize = other.pageSize;
+                    loc = other.loc;
+
+                    if (other.args)
+                    {
+                        args = new std::vector<QueryArgumentBase*>();
+
+                        for (std::vector<QueryArgumentBase*>::iterator it = other.args->begin();
+                            it != other.args->end(); ++it)
+                            args->push_back((*it)->Copy());
+                    }
+                    else
+                        args = NULL;
+                }
+
+                /**
+                 * Assignment operator.
+                 *
+                 * @param other Other instance.
+                 */
+                SqlQuery& operator=(const SqlQuery& other) 
+                {
+                    if (this != &other)
+                    {
+                        type = other.type;
+                        sql = other.sql;
+                        pageSize = other.pageSize;
+                        loc = other.loc;
+
+                        SqlQuery tmp(other);
+
+                        std::vector<QueryArgumentBase*>* args0 = args;
+
+                        args = tmp.args;
+
+                        tmp.args = args0; 
+                    }
+
+                    return *this;
+                }
+
+                /**
+                 * Destructor.
+                 */
+                ~SqlQuery()
+                {
+                    if (args) 
+                    {
+                        for (std::vector<QueryArgumentBase*>::iterator it = args->begin(); it != args->end(); ++it)
+                            delete (*it);
+
+                        delete args;
+                    }
+                }
+
+                /**
+                 * Get type name.
+                 *
+                 * @return Type name.
+                 */
+                std::string GetType()
+                {
+                    return type;
+                }
+
+                /**
+                 * Set type name.
+                 *
+                 * @param sql Type name.
+                 */
+                void SetType(std::string type)
+                {
+                    this->type = type;
+                }
+
+                /**
+                 * Get SQL string.
+                 *
+                 * @return SQL string.
+                 */
+                std::string GetSql()
+                {
+                    return sql;
+                }
+
+                /**
+                 * Set SQL string.
+                 *
+                 * @param sql SQL string.
+                 */
+                void SetSql(std::string sql)
+                {
+                    this->sql = sql;
+                }
+
+                /**
+                 * Get page size.
+                 *
+                 * @return Page size.
+                 */
+                int32_t GetPageSize()
+                {
+                    return pageSize;
+                }
+
+                /**
+                 * Set page size.
+                 *
+                 * @param pageSize Page size.
+                 */
+                void SetPageSize(int32_t pageSize)
+                {
+                    this->pageSize = pageSize;
+                }
+
+                /**
+                 * Get local flag.
+                 *
+                 * @return Local flag.
+                 */
+                bool IsLocal()
+                {
+                    return loc;
+                }
+
+                /**
+                 * Set local flag.
+                 *
+                 * @param loc Local flag.
+                 */
+                void SetLocal(bool loc)
+                {
+                    this->loc = loc;
+                }
+
+                /**
+                 * Add argument.
+                 *
+                 * @param arg Argument.
+                 */
+                template<typename T>
+                void AddArgument(const T& arg)
+                {
+                    if (!args)
+                        args = new std::vector<QueryArgumentBase*>();
+
+                    args->push_back(new QueryArgument<T>(arg));
+                }
+
+                /**
+                 * Write query info to the stream.
+                 *
+                 * @param writer Writer.
+                 */
+                void Write(portable::PortableRawWriter& writer) const
+                {
+                    writer.WriteBool(loc);
+                    writer.WriteString(sql);
+                    writer.WriteString(type);
+                    writer.WriteInt32(pageSize);
+
+                    if (args)
+                    {
+                        writer.WriteInt32(static_cast<int32_t>(args->size()));
+
+                        for (std::vector<QueryArgumentBase*>::iterator it = args->begin(); it != args->end(); ++it)
+                            (*it)->Write(writer);
+                    }
+                    else
+                        writer.WriteInt32(0);
+                }
+
+            private:
+                /** Type name. */
+                std::string type;
+
+                /** SQL string. */
+                std::string sql;
+
+                /** Page size. */
+                int32_t pageSize;
+
+                /** Local flag. */
+                bool loc;
+
+                /** Arguments. */
+                std::vector<QueryArgumentBase*>* args;
+            };
+        }
+    }    
+}
+
+#endif
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/core/include/ignite/cache/query/query_text.h
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/core/include/ignite/cache/query/query_text.h b/modules/platform/cpp/core/include/ignite/cache/query/query_text.h
new file mode 100644
index 0000000..67d3ecc
--- /dev/null
+++ b/modules/platform/cpp/core/include/ignite/cache/query/query_text.h
@@ -0,0 +1,159 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _IGNITE_CACHE_QUERY_TEXT
+#define _IGNITE_CACHE_QUERY_TEXT
+
+#include <stdint.h>
+#include <string>
+
+#include "ignite/portable/portable_raw_writer.h"
+
+namespace ignite
+{    
+    namespace cache
+    {
+        namespace query
+        {         
+            /*
+             * Text query.
+             */
+            class TextQuery
+            {
+            public:
+                /*
+                 * Constructor.
+                 *
+                 * @param type Type name.
+                 * @param text Text string.
+                 */
+                TextQuery(std::string type, std::string text) : type(type), text(text), pageSize(1024), loc(false)
+                {
+                    // No-op.
+                }
+                
+                /*
+                 * Get type name.
+                 *
+                 * @return Type name.
+                 */
+                std::string GetType()
+                {
+                    return type;
+                }
+
+                /*
+                 * Set type name.
+                 *
+                 * @param sql Type name.
+                 */
+                void SetType(std::string type)
+                {
+                    this->type = type;
+                }
+
+                /*
+                 * Get text string.
+                 *
+                 * @return text string.
+                 */
+                std::string GetText()
+                {
+                    return text;
+                }
+
+                /*
+                 * Set text string.
+                 *
+                 * @param text Text string.
+                 */
+                void SetText(std::string text)
+                {
+                    this->text = text;
+                }
+
+                /*
+                 * Get page size.
+                 *
+                 * @return Page size.
+                 */
+                int32_t GetPageSize()
+                {
+                    return pageSize;
+                }
+
+                /*
+                 * Set page size.
+                 *
+                 * @param pageSize Page size.
+                 */
+                void SetPageSize(int32_t pageSize)
+                {
+                    this->pageSize = pageSize;
+                }
+
+                /*
+                 * Get local flag.
+                 *
+                 * @return Local flag.
+                 */
+                bool IsLocal()
+                {
+                    return loc;
+                }
+
+                /*
+                    * Set local flag.
+                    *
+                    * @param loc Local flag.
+                    */
+                void SetLocal(bool loc)
+                {
+                    this->loc = loc;
+                }
+                
+                /*
+                 * Write query info to the stream.
+                 *
+                 * @param writer Writer.
+                 */
+                void Write(portable::PortableRawWriter& writer) const
+                {
+                    writer.WriteBool(loc);
+                    writer.WriteString(text);
+                    writer.WriteString(type);
+                    writer.WriteInt32(pageSize);
+                }
+
+            private:
+                /* Type name. */
+                std::string type;
+
+                /* Text string. */
+                std::string text;
+
+                /* Page size. */
+                int32_t pageSize;
+
+                /* Local flag. */
+                bool loc;
+            };
+        }
+    }    
+}
+
+#endif
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/core/include/ignite/guid.h
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/core/include/ignite/guid.h b/modules/platform/cpp/core/include/ignite/guid.h
new file mode 100644
index 0000000..9469769
--- /dev/null
+++ b/modules/platform/cpp/core/include/ignite/guid.h
@@ -0,0 +1,112 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _IGNITE_GUID
+#define _IGNITE_GUID
+
+#include <stdint.h>
+
+#include <ignite/common/common.h>
+
+namespace ignite
+{
+    /**
+     * Global universally unique identifier (GUID).
+     */
+    class IGNITE_IMPORT_EXPORT Guid
+    {
+    public:
+        /**
+         * Default constructor.
+         */
+        Guid();
+
+        /**
+         * Constructor.
+         *
+         * @param most Most significant bits.
+         * @param least Least significant bits.
+         */
+        Guid(int64_t most, int64_t least);
+
+        /**
+         * Returns the most significant 64 bits of this instance.
+         *
+         * @return The most significant 64 bits of this instance.
+         */
+        int64_t GetMostSignificantBits() const;
+
+        /**
+         * Returns the least significant 64 bits of this instance.
+         *  
+         * @return The least significant 64 bits of this instance.
+         */
+        int64_t GetLeastSignificantBits() const;
+
+        /**
+         * The version number associated with this instance.  The version
+         * number describes how this Guid was generated.
+         *
+         * The version number has the following meaning:
+         * 1    Time-based UUID;
+         * 2    DCE security UUID;
+         * 3    Name-based UUID;
+         * 4    Randomly generated UUID.
+         *
+         * @return The version number of this instance.
+         */
+        int32_t GetVersion() const;
+
+        /**
+         * The variant number associated with this instance. The variant
+         * number describes the layout of the Guid.
+         *
+         * The variant number has the following meaning:
+         * 0    Reserved for NCS backward compatibility;
+         * 2    IETF RFC 4122 (Leach-Salz), used by this class;
+         * 6    Reserved, Microsoft Corporation backward compatibility;
+         * 7    Reserved for future definition.
+         *
+         * @return The variant number of this instance.
+         */
+        int32_t GetVariant() const;
+
+        /**
+         * Get hash code of this instance (used in serialization).
+         *
+         * @return Hash code.
+         */
+        int32_t GetHashCode() const;
+
+        /**
+         * Comparison operator override.
+         *
+         * @param val1 First value.
+         * @param val2 Second value.
+         * @return True if equal.
+         */
+        friend bool IGNITE_IMPORT_EXPORT operator== (Guid& val1, Guid& val2);
+    private:
+        /** Most significant bits. */
+        int64_t most;  
+
+        /** Least significant bits. */
+        int64_t least; 
+    };
+}
+
+#endif
\ No newline at end of file


[09/28] ignite git commit: IGNITE-1513: Moved CPP.

Posted by vo...@apache.org.
http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/core-test/src/portable_reader_writer_test.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core-test/src/portable_reader_writer_test.cpp b/modules/platform/src/main/cpp/core-test/src/portable_reader_writer_test.cpp
deleted file mode 100644
index aff929b..0000000
--- a/modules/platform/src/main/cpp/core-test/src/portable_reader_writer_test.cpp
+++ /dev/null
@@ -1,1951 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef _MSC_VER
-    #define BOOST_TEST_DYN_LINK
-#endif
-
-#include <boost/test/unit_test.hpp>
-
-#include "ignite/impl/interop/interop.h"
-#include "ignite/portable/portable.h"
-
-#include "ignite/portable_test_defs.h"
-#include "ignite/portable_test_utils.h"
-
-using namespace ignite;
-using namespace ignite::impl::interop;
-using namespace ignite::impl::portable;
-using namespace ignite::portable;
-using namespace ignite_test::core::portable;
-
-template<typename T>
-void CheckPrimitive(T val)
-{
-    TemplatedPortableIdResolver<PortableDummy> idRslvr;
-
-    InteropUnpooledMemory mem(1024);
-
-    InteropOutputStream out(&mem);
-    out.Position(18);
-
-    PortableWriterImpl writerImpl(&out, &idRslvr, NULL, NULL);
-    PortableWriter writer(&writerImpl);
-
-    try
-    {
-        Write<T>(writer, NULL, val);
-
-        BOOST_FAIL("Not restricted.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-
-    Write<T>(writer, "test", val);
-
-    out.Synchronize();
-
-    InteropInputStream in(&mem);
-
-    in.Position(18);
-
-    PortableReaderImpl readerImpl(&in, &idRslvr, 0, true, idRslvr.GetTypeId(), 0, 100, 100);
-    PortableReader reader(&readerImpl);
-
-    try
-    {
-        Read<T>(reader, NULL);
-
-        BOOST_FAIL("Not restricted.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-
-    T readVal = Read<T>(reader, "test");
-    
-    BOOST_REQUIRE(readVal == val);
-}
-
-template<typename T>
-void CheckPrimitiveArray(T dflt, T val1, T val2)
-{
-    const char* fieldName = "test";
-
-    TemplatedPortableIdResolver<PortableDummy> idRslvr;
-
-    InteropUnpooledMemory mem(1024);
-
-    InteropOutputStream out(&mem);
-    PortableWriterImpl writerImpl(&out, &idRslvr, NULL, NULL);
-    PortableWriter writer(&writerImpl);
-    
-    InteropInputStream in(&mem);
-    PortableReaderImpl readerImpl(&in, &idRslvr, 0, true, idRslvr.GetTypeId(), 0, 100, 100);
-    PortableReader reader(&readerImpl);
-
-    out.Position(18);
-
-    try
-    {
-        T nullFieldArr[2];
-
-        nullFieldArr[0] = val1;
-        nullFieldArr[1] = val2;
-
-        WriteArray<T>(writer, NULL, nullFieldArr, 2);
-
-        BOOST_FAIL("Not restricted.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-    
-    // 1. Write NULL and see what happens.
-    WriteArray<T>(writer, fieldName, NULL, 0);
-
-    out.Synchronize();
-    in.Synchronize();
-    
-    in.Position(18);
-    BOOST_REQUIRE(ReadArray<T>(reader, fieldName, NULL, 0) == -1);
-
-    in.Position(18);
-    BOOST_REQUIRE(ReadArray<T>(reader, fieldName, NULL, 2) == -1);
-
-    T arr1[2];
-    arr1[0] = dflt;
-    arr1[1] = dflt;
-
-    in.Position(18);
-    BOOST_REQUIRE(ReadArray<T>(reader, fieldName, arr1, 1) == -1);
-
-    BOOST_REQUIRE(arr1[0] == dflt);
-    BOOST_REQUIRE(arr1[1] == dflt);
-
-    // 2. Write empty array.
-    T arr2[2];
-    arr2[0] = val1;
-    arr2[1] = val2;
-
-    out.Position(18);
-    
-    WriteArray<T>(writer, fieldName, arr2, 0);
-
-    out.Synchronize();
-    in.Synchronize();
-
-    in.Position(18);
-    BOOST_REQUIRE(ReadArray<T>(reader, fieldName, NULL, 0) == 0);
-
-    in.Position(18);
-    BOOST_REQUIRE(ReadArray<T>(reader, fieldName, NULL, 2) == 0);
-
-    in.Position(18);
-    BOOST_REQUIRE(ReadArray<T>(reader, fieldName, arr1, 0) == 0);
-    BOOST_REQUIRE(arr1[0] == dflt);
-    BOOST_REQUIRE(arr1[1] == dflt);
-
-    in.Position(18);
-    BOOST_REQUIRE(ReadArray<T>(reader, fieldName, arr1, 2) == 0);
-    BOOST_REQUIRE(arr1[0] == dflt);
-    BOOST_REQUIRE(arr1[1] == dflt);
-
-    // 3. Partial array write.
-    out.Position(18);
-    
-    WriteArray<T>(writer, fieldName, arr2, 1);
-
-    out.Synchronize();
-    in.Synchronize();
-
-    in.Position(18);
-    BOOST_REQUIRE(ReadArray<T>(reader, fieldName, NULL, 0) == 1);
-    BOOST_REQUIRE(ReadArray<T>(reader, fieldName, NULL, 2) == 1);
-    BOOST_REQUIRE(ReadArray<T>(reader, fieldName, arr1, 0) == 1);
-    BOOST_REQUIRE(arr1[0] == dflt);
-    BOOST_REQUIRE(arr1[1] == dflt);
-
-    in.Position(18);
-    BOOST_REQUIRE(ReadArray<T>(reader, fieldName, arr1, 1) == 1);
-    BOOST_REQUIRE(arr1[0] == val1);
-    BOOST_REQUIRE(arr1[1] == dflt);
-    arr1[0] = dflt;
-
-    in.Position(18);
-    BOOST_REQUIRE(ReadArray<T>(reader, fieldName, arr1, 2) == 1);
-    BOOST_REQUIRE(arr1[0] == val1);
-    BOOST_REQUIRE(arr1[1] == dflt);
-    arr1[0] = dflt;
-
-    // 4. Full array write.
-    out.Position(18);
-    
-    WriteArray<T>(writer, fieldName, arr2, 2);
-
-    out.Synchronize();
-    in.Synchronize();
-
-    in.Position(18);
-    BOOST_REQUIRE(ReadArray<T>(reader, fieldName, NULL, 0) == 2);
-
-    in.Position(18);
-    BOOST_REQUIRE(ReadArray<T>(reader, fieldName, NULL, 2) == 2);
-
-    try
-    {
-        ReadArray<T>(reader, NULL, arr1, 2);
-
-        BOOST_FAIL("Not restricted.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-
-    BOOST_REQUIRE(ReadArray<T>(reader, fieldName, arr1, 0) == 2);
-    BOOST_REQUIRE(arr1[0] == dflt);
-    BOOST_REQUIRE(arr1[1] == dflt);
-
-    BOOST_REQUIRE(ReadArray<T>(reader, fieldName, arr1, 1) == 2);
-    BOOST_REQUIRE(arr1[0] == dflt);
-    BOOST_REQUIRE(arr1[1] == dflt);
-
-    BOOST_REQUIRE(ReadArray<T>(reader, fieldName, arr1, 2) == 2);
-    BOOST_REQUIRE(arr1[0] == val1);
-    BOOST_REQUIRE(arr1[1] == val2);
-}
-
-void CheckWritesRestricted(PortableWriter& writer)
-{
-    try
-    {
-        writer.WriteInt8("field", 1);
-
-        BOOST_FAIL("Not restricted.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-
-    try
-    {
-        int8_t arr[1];
-
-        writer.WriteInt8Array("field", arr, 1);
-
-        BOOST_FAIL("Not restricted.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-
-    try
-    {
-        Guid val(1, 1);
-
-        writer.WriteGuid("field", val);
-
-        BOOST_FAIL("Not restricted.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-
-    try
-    {
-        writer.WriteString("field", "test");
-
-        BOOST_FAIL("Not restricted.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-
-    try 
-    {
-        writer.WriteArray<int8_t>("field");
-
-        BOOST_FAIL("Not restricted.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-
-    try 
-    {
-        writer.WriteCollection<int8_t>("field");
-
-        BOOST_FAIL("Not restricted.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-
-    try 
-    {
-        writer.WriteMap<int8_t, int8_t>("field");
-
-        BOOST_FAIL("Not restricted.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-}
-
-void CheckReadsRestricted(PortableReader& reader)
-{
-    try
-    {
-        reader.ReadInt8("field");
-
-        BOOST_FAIL("Not restricted.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-
-    try
-    {
-        int8_t arr[1];
-
-        reader.ReadInt8Array("field", arr, 1);
-
-        BOOST_FAIL("Not restricted.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-
-    try
-    {
-        reader.ReadGuid("field");
-
-        BOOST_FAIL("Not restricted.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-
-    try
-    {
-        reader.ReadString("field");
-
-        BOOST_FAIL("Not restricted.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-
-    try
-    {
-        reader.ReadArray<int8_t>("field");
-
-        BOOST_FAIL("Not restricted.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-
-    try
-    {
-        reader.ReadCollection<int8_t>("field");
-
-        BOOST_FAIL("Not restricted.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-
-    try
-    {
-        reader.ReadMap<int8_t, int8_t>("field");
-
-        BOOST_FAIL("Not restricted.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-}
-
-void CheckCollectionEmpty(CollectionType* colType)
-{
-    TemplatedPortableIdResolver<PortableDummy> idRslvr;
-
-    InteropUnpooledMemory mem(1024);
-
-    InteropOutputStream out(&mem);
-    PortableWriterImpl writerImpl(&out, &idRslvr, NULL, NULL);
-    PortableWriter writer(&writerImpl);
-
-    out.Position(18);
-
-    PortableCollectionWriter<PortableInner> colWriter = colType ?
-        writer.WriteCollection<PortableInner>("field1", *colType) : writer.WriteCollection<PortableInner>("field1");
-
-    CheckWritesRestricted(writer);
-
-    colWriter.Close();
-
-    writer.WriteInt8("field2", 1);
-
-    try
-    {
-        colWriter.Write(1);
-
-        BOOST_FAIL("Error expected.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-
-    try
-    {
-        colWriter.Close();
-
-        BOOST_FAIL("Error expected.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-
-    out.Synchronize();
-
-    InteropInputStream in(&mem);
-    PortableReaderImpl readerImpl(&in, &idRslvr, 0, true, idRslvr.GetTypeId(), 0, 1000, 1000);
-    PortableReader reader(&readerImpl);
-
-    in.Position(18);
-
-    PortableCollectionReader<PortableInner> colReader = reader.ReadCollection<PortableInner>("field1");
-
-    if (colType)
-        BOOST_REQUIRE(colReader.GetType() == *colType);
-    else
-        BOOST_REQUIRE(colReader.GetType() == IGNITE_COLLECTION_UNDEFINED);
-
-    BOOST_REQUIRE(colReader.GetSize() == 0);
-    BOOST_REQUIRE(!colReader.HasNext());
-    BOOST_REQUIRE(!colReader.IsNull());
-
-    try
-    {
-        colReader.GetNext();
-
-        BOOST_FAIL("Error expected.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-
-    BOOST_REQUIRE(reader.ReadInt8("field2") == 1);
-}
-
-void CheckCollection(CollectionType* colType)
-{
-    PortableInner writeVal1 = PortableInner(1);
-    PortableInner writeVal2 = PortableInner(0);
-    PortableInner writeVal3 = PortableInner(2);
-
-    TemplatedPortableIdResolver<PortableDummy> idRslvr;
-
-    InteropUnpooledMemory mem(1024);
-
-    InteropOutputStream out(&mem);
-    PortableWriterImpl writerImpl(&out, &idRslvr, NULL, NULL);
-    PortableWriter writer(&writerImpl);
-
-    out.Position(18);
-
-    PortableCollectionWriter<PortableInner> colWriter = colType ?
-        writer.WriteCollection<PortableInner>("field1", *colType) : writer.WriteCollection<PortableInner>("field1");
-
-    colWriter.Write(writeVal1);
-    colWriter.Write(writeVal2);
-    colWriter.Write(writeVal3);
-
-    CheckWritesRestricted(writer);
-
-    colWriter.Close();
-
-    writer.WriteInt8("field2", 1);
-
-    try
-    {
-        colWriter.Write(1);
-
-        BOOST_FAIL("Error expected.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-
-    try
-    {
-        colWriter.Close();
-
-        BOOST_FAIL("Error expected.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-
-    out.Synchronize();
-
-    InteropInputStream in(&mem);
-    PortableReaderImpl readerImpl(&in, &idRslvr, 0, true, idRslvr.GetTypeId(), 0, 1000, 1000);
-    PortableReader reader(&readerImpl);
-
-    in.Position(18);
-
-    PortableCollectionReader<PortableInner> colReader = reader.ReadCollection<PortableInner>("field1");
-
-    CheckReadsRestricted(reader);
-
-    if (colType)
-        BOOST_REQUIRE(colReader.GetType() == *colType);
-    else
-        BOOST_REQUIRE(colReader.GetType() == IGNITE_COLLECTION_UNDEFINED);
-
-    BOOST_REQUIRE(colReader.GetSize() == 3);
-    BOOST_REQUIRE(!colReader.IsNull());
-
-    BOOST_REQUIRE(colReader.HasNext());
-    BOOST_REQUIRE(colReader.GetNext().GetValue() == writeVal1.GetValue());
-
-    BOOST_REQUIRE(colReader.HasNext());
-    BOOST_REQUIRE(colReader.GetNext().GetValue() == writeVal2.GetValue());
-
-    BOOST_REQUIRE(colReader.HasNext());
-    BOOST_REQUIRE(colReader.GetNext().GetValue() == writeVal3.GetValue());
-
-    BOOST_REQUIRE(!colReader.HasNext());
-
-    try
-    {
-        colReader.GetNext();
-
-        BOOST_FAIL("Error expected.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-
-    BOOST_REQUIRE(reader.ReadInt8("field2") == 1);
-}
-
-void CheckMapEmpty(MapType* mapType)
-{
-    TemplatedPortableIdResolver<PortableDummy> idRslvr;
-
-    InteropUnpooledMemory mem(1024);
-
-    InteropOutputStream out(&mem);
-    PortableWriterImpl writerImpl(&out, &idRslvr, NULL, NULL);
-    PortableWriter writer(&writerImpl);
-
-    out.Position(18);
-
-    PortableMapWriter<int8_t, PortableInner> mapWriter = mapType ?
-        writer.WriteMap<int8_t, PortableInner>("field1", *mapType) : writer.WriteMap<int8_t, PortableInner>("field1");
-
-    CheckWritesRestricted(writer);
-
-    mapWriter.Close();
-
-    writer.WriteInt8("field2", 1);
-
-    try
-    {
-        mapWriter.Write(1, PortableInner(1));
-
-        BOOST_FAIL("Error expected.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-
-    try
-    {
-        mapWriter.Close();
-
-        BOOST_FAIL("Error expected.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-
-    out.Synchronize();
-
-    InteropInputStream in(&mem);
-    PortableReaderImpl readerImpl(&in, &idRslvr, 0, true, idRslvr.GetTypeId(), 0, 1000, 1000);
-    PortableReader reader(&readerImpl);
-
-    in.Position(18);
-
-    PortableMapReader<int8_t, PortableInner> mapReader = reader.ReadMap<int8_t, PortableInner>("field1");
-
-    if (mapType)
-        BOOST_REQUIRE(mapReader.GetType() == *mapType);
-    else
-        BOOST_REQUIRE(mapReader.GetType() == IGNITE_MAP_UNDEFINED);
-
-    BOOST_REQUIRE(mapReader.GetSize() == 0);
-    BOOST_REQUIRE(!mapReader.HasNext());
-    BOOST_REQUIRE(!mapReader.IsNull());
-
-    try
-    {
-        int8_t key;
-        PortableInner val;
-
-        mapReader.GetNext(&key, &val);
-
-        BOOST_FAIL("Error expected.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-
-    BOOST_REQUIRE(reader.ReadInt8("field2") == 1);
-}
-
-void CheckMap(MapType* mapType)
-{
-    PortableInner writeVal1 = PortableInner(1);
-    PortableInner writeVal2 = PortableInner(0);
-    PortableInner writeVal3 = PortableInner(2);
-
-    TemplatedPortableIdResolver<PortableDummy> idRslvr;
-
-    InteropUnpooledMemory mem(1024);
-
-    InteropOutputStream out(&mem);
-    PortableWriterImpl writerImpl(&out, &idRslvr, NULL, NULL);
-    PortableWriter writer(&writerImpl);
-
-    out.Position(18);
-
-    PortableMapWriter<int8_t, PortableInner> mapWriter = mapType ?
-        writer.WriteMap<int8_t, PortableInner>("field1", *mapType) : writer.WriteMap<int8_t, PortableInner>("field1");
-
-    mapWriter.Write(1, writeVal1);
-    mapWriter.Write(2, writeVal2);
-    mapWriter.Write(3, writeVal3);
-
-    CheckWritesRestricted(writer);
-
-    mapWriter.Close();
-
-    writer.WriteInt8("field2", 1);
-
-    try
-    {
-        mapWriter.Write(4, PortableInner(4));
-
-        BOOST_FAIL("Error expected.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-
-    try
-    {
-        mapWriter.Close();
-
-        BOOST_FAIL("Error expected.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-
-    out.Synchronize();
-
-    InteropInputStream in(&mem);
-    PortableReaderImpl readerImpl(&in, &idRslvr, 0, true, idRslvr.GetTypeId(), 0, 1000, 1000);
-    PortableReader reader(&readerImpl);
-
-    in.Position(18);
-
-    PortableMapReader<int8_t, PortableInner> mapReader = reader.ReadMap<int8_t, PortableInner>("field1");
-
-    CheckReadsRestricted(reader);
-
-    if (mapType)
-        BOOST_REQUIRE(mapReader.GetType() == *mapType);
-    else
-        BOOST_REQUIRE(mapReader.GetType() == IGNITE_MAP_UNDEFINED);
-
-    BOOST_REQUIRE(mapReader.GetSize() == 3);
-    BOOST_REQUIRE(!mapReader.IsNull());
-
-    int8_t key;
-    PortableInner val;
-
-    BOOST_REQUIRE(mapReader.HasNext());
-
-    mapReader.GetNext(&key, &val);
-    BOOST_REQUIRE(key == 1);
-    BOOST_REQUIRE(val.GetValue() == writeVal1.GetValue());
-
-    mapReader.GetNext(&key, &val);
-    BOOST_REQUIRE(key == 2);
-    BOOST_REQUIRE(val.GetValue() == writeVal2.GetValue());
-
-    mapReader.GetNext(&key, &val);
-    BOOST_REQUIRE(key == 3);
-    BOOST_REQUIRE(val.GetValue() == writeVal3.GetValue());
-
-    BOOST_REQUIRE(!mapReader.HasNext());
-
-    try
-    {
-        mapReader.GetNext(&key, &val);
-
-        BOOST_FAIL("Error expected.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-
-    BOOST_REQUIRE(reader.ReadInt8("field2") == 1);
-}
-
-BOOST_AUTO_TEST_SUITE(PortableReaderWriterTestSuite)
-
-BOOST_AUTO_TEST_CASE(TestPrimitiveInt8)
-{
-    CheckPrimitive<int8_t>(1);
-}
-
-BOOST_AUTO_TEST_CASE(TestPrimitiveBool)
-{
-    CheckPrimitive<bool>(true);
-}
-
-BOOST_AUTO_TEST_CASE(TestPrimitiveInt16)
-{
-    CheckPrimitive<int16_t>(1);
-}
-
-BOOST_AUTO_TEST_CASE(TestPrimitiveUInt16)
-{
-    CheckPrimitive<uint16_t>(1);
-}
-
-BOOST_AUTO_TEST_CASE(TestPrimitiveInt32)
-{
-    CheckPrimitive<int32_t>(1);
-}
-
-BOOST_AUTO_TEST_CASE(TestPrimitiveInt64)
-{
-    CheckPrimitive<int64_t>(1);
-}
-
-BOOST_AUTO_TEST_CASE(TestPrimitiveFloat)
-{
-    CheckPrimitive<float>(1.1f);
-}
-
-BOOST_AUTO_TEST_CASE(TestPrimitiveDouble)
-{
-    CheckPrimitive<double>(1.1);
-}
-
-BOOST_AUTO_TEST_CASE(TestPrimitiveGuid)
-{
-    Guid val(1, 2);
-
-    CheckPrimitive<Guid>(val);
-}
-
-BOOST_AUTO_TEST_CASE(TestPrimitiveArrayInt8)
-{
-    CheckPrimitiveArray<int8_t>(1, 2, 3);
-}
-
-BOOST_AUTO_TEST_CASE(TestPrimitiveArrayBool)
-{
-    CheckPrimitiveArray<bool>(false, true, false);
-}
-
-BOOST_AUTO_TEST_CASE(TestPrimitiveArrayInt16)
-{
-    CheckPrimitiveArray<int16_t>(1, 2, 3);
-}
-
-BOOST_AUTO_TEST_CASE(TestPrimitiveArrayUInt16)
-{
-    CheckPrimitiveArray<uint16_t>(1, 2, 3);
-}
-
-BOOST_AUTO_TEST_CASE(TestPrimitiveArrayInt32)
-{
-    CheckPrimitiveArray<int32_t>(1, 2, 3);
-}
-
-BOOST_AUTO_TEST_CASE(TestPrimitiveArrayInt64)
-{
-    CheckPrimitiveArray<int64_t>(1, 2, 3);
-}
-
-BOOST_AUTO_TEST_CASE(TestPrimitiveArrayFloat)
-{
-    CheckPrimitiveArray<float>(1.1f, 2.2f, 3.3f);
-}
-
-BOOST_AUTO_TEST_CASE(TestPrimitiveArrayDouble)
-{
-    CheckPrimitiveArray<double>(1.1, 2.2, 3.3);
-}
-
-BOOST_AUTO_TEST_CASE(TestPrimitiveArrayGuid)
-{
-    Guid dflt(1, 2);
-    Guid val1(3, 4);
-    Guid val2(5, 6);
-
-    CheckPrimitiveArray<Guid>(dflt, val1, val2);
-}
-
-BOOST_AUTO_TEST_CASE(TestGuidNull)
-{
-    TemplatedPortableIdResolver<PortableDummy> idRslvr;
-
-    InteropUnpooledMemory mem(1024);
-
-    InteropOutputStream out(&mem);
-    PortableWriterImpl writerImpl(&out, &idRslvr, NULL, NULL);
-    PortableWriter writer(&writerImpl);
-
-    out.Position(18);
-
-    try
-    {
-        writer.WriteNull(NULL);
-
-        BOOST_FAIL("Not restricted.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-
-    writer.WriteNull("test");
-
-    out.Synchronize();
-
-    InteropInputStream in(&mem);
-    PortableReaderImpl readerImpl(&in, &idRslvr, 0, true, idRslvr.GetTypeId(), 0, 100, 100);
-    PortableReader reader(&readerImpl);
-    
-    in.Position(18);
-
-    try
-    {
-        reader.ReadGuid(NULL);
-
-        BOOST_FAIL("Not restricted.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-
-    Guid expVal;
-    Guid actualVal = reader.ReadGuid("test");
-
-    BOOST_REQUIRE(actualVal == expVal);
-}
-
-BOOST_AUTO_TEST_CASE(TestString) {
-    TemplatedPortableIdResolver<PortableDummy> idRslvr;
-
-    InteropUnpooledMemory mem(1024);
-
-    InteropOutputStream out(&mem);
-    PortableWriterImpl writerImpl(&out, &idRslvr, NULL, NULL);
-    PortableWriter writer(&writerImpl);
-
-    out.Position(18);
-
-    const char* writeVal1 = "testtest";
-    const char* writeVal2 = "test";
-    std::string writeVal3 = writeVal1;
-
-    try
-    {
-        writer.WriteString(NULL, writeVal1);
-
-        BOOST_FAIL("Not restricted.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-
-    try
-    {
-        writer.WriteString(NULL, writeVal1, 4);
-
-        BOOST_FAIL("Not restricted.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-
-    try
-    {
-        writer.WriteString(NULL, writeVal3);
-
-        BOOST_FAIL("Not restricted.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-
-    writer.WriteString("field1", writeVal1);
-    writer.WriteString("field2", writeVal1, 4);
-    writer.WriteString("field3", writeVal3);
-    writer.WriteString("field4", NULL);
-    writer.WriteString("field5", NULL, 4);
-
-    out.Synchronize();
-
-    InteropInputStream in(&mem);
-    PortableReaderImpl readerImpl(&in, &idRslvr, 0, true, idRslvr.GetTypeId(), 0, 1000, 1000);
-    PortableReader reader(&readerImpl);
-
-    in.Position(18);
-
-    try
-    {
-        char nullCheckRes[9];
-
-        reader.ReadString(NULL, nullCheckRes, 9);
-
-        BOOST_FAIL("Not restricted.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-
-    try
-    {
-        reader.ReadString(NULL);
-
-        BOOST_FAIL("Not restricted.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-
-    char readVal1[9];
-    char readVal2[5];
-    
-    BOOST_REQUIRE(reader.ReadString("field1", NULL, 0) == 8);
-    BOOST_REQUIRE(reader.ReadString("field1", NULL, 8) == 8);
-    BOOST_REQUIRE(reader.ReadString("field1", readVal1, 0) == 8);
-    BOOST_REQUIRE(reader.ReadString("field1", readVal1, 4) == 8);
-
-    BOOST_REQUIRE(reader.ReadString("field1", readVal1, 9) == 8);
-    std::string writeVal1Str = writeVal1;
-    std::string readVal1Str = readVal1;
-    BOOST_REQUIRE(readVal1Str.compare(writeVal1Str) == 0);
-
-    BOOST_REQUIRE(reader.ReadString("field2", readVal2, 5) == 4);
-    std::string writeVal2Str = writeVal2;
-    std::string readVal2Str = readVal2;
-    BOOST_REQUIRE(readVal2Str.compare(writeVal2Str) == 0);
-
-    std::string readVal3 = reader.ReadString("field3");
-    BOOST_REQUIRE(readVal3.compare(writeVal3) == 0);
-
-    BOOST_REQUIRE(reader.ReadString("field4", readVal1, 9) == -1);
-    BOOST_REQUIRE(reader.ReadString("field5", readVal1, 9) == -1);
-}
-
-BOOST_AUTO_TEST_CASE(TestStringArrayNull)
-{
-    TemplatedPortableIdResolver<PortableDummy> idRslvr;
-
-    InteropUnpooledMemory mem(1024);
-
-    InteropOutputStream out(&mem);
-    PortableWriterImpl writerImpl(&out, &idRslvr, NULL, NULL);
-    PortableWriter writer(&writerImpl);
-
-    out.Position(18);
-
-    writer.WriteNull("field1");
-    writer.WriteInt8("field2", 1);
-
-    out.Synchronize();
-
-    InteropInputStream in(&mem);
-    PortableReaderImpl readerImpl(&in, &idRslvr, 0, true, idRslvr.GetTypeId(), 0, 1000, 1000);
-    PortableReader reader(&readerImpl);
-
-    in.Position(18);
-
-    PortableStringArrayReader arrReader = reader.ReadStringArray("field1");
-
-    BOOST_REQUIRE(arrReader.GetSize() == -1);
-    BOOST_REQUIRE(!arrReader.HasNext());
-    BOOST_REQUIRE(arrReader.IsNull());
-
-    try
-    {
-        char res[100];
-
-        arrReader.GetNext(res, 100);
-
-        BOOST_FAIL("Error expected.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-
-    try
-    {
-        arrReader.GetNext();
-
-        BOOST_FAIL("Error expected.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-
-    BOOST_REQUIRE(reader.ReadInt8("field2") == 1);
-}
-
-BOOST_AUTO_TEST_CASE(TestStringArrayEmpty)
-{
-    TemplatedPortableIdResolver<PortableDummy> idRslvr;
-
-    InteropUnpooledMemory mem(1024);
-
-    InteropOutputStream out(&mem);
-    PortableWriterImpl writerImpl(&out, &idRslvr, NULL, NULL);
-    PortableWriter writer(&writerImpl);
-
-    out.Position(18);
-
-    PortableStringArrayWriter arrWriter = writer.WriteStringArray("field1");
-    
-    CheckWritesRestricted(writer);
-
-    arrWriter.Close();
-
-    writer.WriteInt8("field2", 1);
-
-    try
-    {
-        const char* val = "test";
-
-        arrWriter.Write(val, 4);
-
-        BOOST_FAIL("Error expected.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-
-    try
-    {
-        const char* val = "test";
-
-        arrWriter.Write(val);
-
-        BOOST_FAIL("Error expected.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-
-    try
-    {
-        std::string val = "test";
-
-        arrWriter.Write(val);
-
-        BOOST_FAIL("Error expected.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-
-    try
-    {
-        arrWriter.Close();
-
-        BOOST_FAIL("Error expected.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-
-    out.Synchronize();
-
-    InteropInputStream in(&mem);
-    PortableReaderImpl readerImpl(&in, &idRslvr, 0, true, idRslvr.GetTypeId(), 0, 1000, 1000);
-    PortableReader reader(&readerImpl);
-
-    in.Position(18);
-
-    PortableStringArrayReader arrReader = reader.ReadStringArray("field1");
-
-    BOOST_REQUIRE(arrReader.GetSize() == 0);
-    BOOST_REQUIRE(!arrReader.HasNext());
-    BOOST_REQUIRE(!arrReader.IsNull());
-
-    try
-    {
-        char res[100];
-
-        arrReader.GetNext(res, 100);
-
-        BOOST_FAIL("Error expected.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-
-    try
-    {
-        arrReader.GetNext();
-
-        BOOST_FAIL("Error expected.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-
-    BOOST_REQUIRE(reader.ReadInt8("field2") == 1);
-}
-
-BOOST_AUTO_TEST_CASE(TestStringArray)
-{
-    const char* writeVal1 = "testtest";
-    const char* writeVal2 = "test";
-    std::string writeVal3 = "test2";
-
-    TemplatedPortableIdResolver<PortableDummy> idRslvr;
-
-    InteropUnpooledMemory mem(1024);
-
-    InteropOutputStream out(&mem);
-    PortableWriterImpl writerImpl(&out, &idRslvr, NULL, NULL);
-    PortableWriter writer(&writerImpl);
-
-    out.Position(18);
-
-    PortableStringArrayWriter arrWriter = writer.WriteStringArray("field1");
-
-    arrWriter.Write(writeVal1);
-    arrWriter.Write(writeVal1, 4);
-    arrWriter.Write(NULL); // NULL value.
-    arrWriter.Write(NULL, 100); // NULL value again.
-    arrWriter.Write(writeVal3);
-
-    CheckWritesRestricted(writer);
-
-    arrWriter.Close();
-
-    writer.WriteInt8("field2", 1);
-
-    try
-    {
-        const char* val = "test";
-
-        arrWriter.Write(val, 4);
-
-        BOOST_FAIL("Error expected.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-
-    try
-    {
-        const char* val = "test";
-
-        arrWriter.Write(val);
-
-        BOOST_FAIL("Error expected.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-
-    try
-    {
-        std::string val = "test";
-
-        arrWriter.Write(val);
-
-        BOOST_FAIL("Error expected.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-
-    try
-    {
-        arrWriter.Close();
-
-        BOOST_FAIL("Error expected.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-
-    out.Synchronize();
-
-    InteropInputStream in(&mem);
-    PortableReaderImpl readerImpl(&in, &idRslvr, 0, true, idRslvr.GetTypeId(), 0, 1000, 1000);
-    PortableReader reader(&readerImpl);
-
-    in.Position(18);
-
-    PortableStringArrayReader arrReader = reader.ReadStringArray("field1");
-
-    CheckReadsRestricted(reader);
-
-    BOOST_REQUIRE(arrReader.GetSize() == 5);
-    BOOST_REQUIRE(!arrReader.IsNull());
-
-    // 1. Read first value.
-    BOOST_REQUIRE(arrReader.HasNext());
-        
-    char readVal1[9];
-    
-    BOOST_REQUIRE(arrReader.GetNext(NULL, 0) == 8);
-    BOOST_REQUIRE(arrReader.GetNext(NULL, 8) == 8);
-    BOOST_REQUIRE(arrReader.GetNext(readVal1, 0) == 8);
-    BOOST_REQUIRE(arrReader.GetNext(readVal1, 4) == 8);
-
-    BOOST_REQUIRE(arrReader.GetNext(readVal1, 9) == 8);
-    std::string writeVal1Str = writeVal1;
-    std::string readVal1Str = readVal1;
-    BOOST_REQUIRE(readVal1Str.compare(writeVal1Str) == 0);
-
-    // 2. Read second value.
-    BOOST_REQUIRE(arrReader.HasNext());
-
-    char readVal2[5];
-
-    BOOST_REQUIRE(arrReader.GetNext(readVal2, 5) == 4);
-    std::string writeVal2Str = writeVal2;
-    std::string readVal2Str = readVal2;
-    BOOST_REQUIRE(readVal2Str.compare(writeVal2Str) == 0);
-
-    // 3. Read NULL.
-    BOOST_REQUIRE(arrReader.HasNext());
-
-    BOOST_REQUIRE(arrReader.GetNext(readVal1, 4) == -1);
-    readVal1Str = readVal1;
-    BOOST_REQUIRE(readVal1Str.compare(writeVal1Str) == 0);
-
-    // 4. Read NULL again, this time through another method.
-    BOOST_REQUIRE(arrReader.HasNext());
-
-    std::string readNullVal = arrReader.GetNext();
-
-    BOOST_REQUIRE(readNullVal.length() == 0);
-
-    // 5. Read third value.
-    BOOST_REQUIRE(arrReader.HasNext());
-
-    std::string readVal3 = arrReader.GetNext();
-    BOOST_REQUIRE(readVal3.compare(writeVal3) == 0);
-
-    BOOST_REQUIRE(!arrReader.HasNext());
-
-    try
-    {
-        char res[100];
-
-        arrReader.GetNext(res, 100);
-
-        BOOST_FAIL("Error expected.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-
-    try
-    {
-        arrReader.GetNext();
-
-        BOOST_FAIL("Error expected.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-
-    BOOST_REQUIRE(reader.ReadInt8("field2") == 1);
-}
-
-BOOST_AUTO_TEST_CASE(TestObject)
-{
-    PortableInner writeVal1(1);
-    PortableInner writeVal2(0);
-
-    TemplatedPortableIdResolver<PortableDummy> idRslvr;
-
-    InteropUnpooledMemory mem(1024);
-
-    InteropOutputStream out(&mem);
-    PortableWriterImpl writerImpl(&out, &idRslvr, NULL, NULL);
-    PortableWriter writer(&writerImpl);
-
-    out.Position(18);
-
-    writer.WriteObject("field1", writeVal1);
-    writer.WriteObject("field2", writeVal2);
-    writer.WriteNull("field3");
-
-    out.Synchronize();
-
-    InteropInputStream in(&mem);
-    PortableReaderImpl readerImpl(&in, &idRslvr, 0, true, idRslvr.GetTypeId(), 0, 1000, 1000);
-    PortableReader reader(&readerImpl);
-
-    in.Position(18);
-
-    PortableInner readVal1 = reader.ReadObject<PortableInner>("field1");
-    BOOST_REQUIRE(writeVal1.GetValue() == readVal1.GetValue());
-
-    PortableInner readVal2 = reader.ReadObject<PortableInner>("field2");
-    BOOST_REQUIRE(writeVal2.GetValue() == readVal2.GetValue());
-
-    PortableInner readVal3 = reader.ReadObject<PortableInner>("field3");
-    BOOST_REQUIRE(0 == readVal3.GetValue());
-}
-
-BOOST_AUTO_TEST_CASE(TestNestedObject)
-{
-    PortableOuter writeVal1(1, 2);
-    PortableOuter writeVal2(0, 0);
-
-    TemplatedPortableIdResolver<PortableDummy> idRslvr;
-
-    InteropUnpooledMemory mem(1024);
-
-    InteropOutputStream out(&mem);
-    PortableWriterImpl writerImpl(&out, &idRslvr, NULL, NULL);
-    PortableWriter writer(&writerImpl);
-
-    out.Position(18);
-
-    writer.WriteObject("field1", writeVal1);
-    writer.WriteObject("field2", writeVal2);
-    writer.WriteNull("field3");
-
-    out.Synchronize();
-
-    InteropInputStream in(&mem);
-    PortableReaderImpl readerImpl(&in, &idRslvr, 0, true, idRslvr.GetTypeId(), 0, 1000, 1000);
-    PortableReader reader(&readerImpl);
-
-    in.Position(18);
-
-    PortableOuter readVal1 = reader.ReadObject<PortableOuter>("field1");
-    BOOST_REQUIRE(writeVal1.GetValue() == readVal1.GetValue());
-    BOOST_REQUIRE(writeVal1.GetInner().GetValue() == readVal1.GetInner().GetValue());
-
-    PortableOuter readVal2 = reader.ReadObject<PortableOuter>("field2");
-    BOOST_REQUIRE(writeVal2.GetValue() == readVal2.GetValue());
-    BOOST_REQUIRE(writeVal2.GetInner().GetValue() == readVal2.GetInner().GetValue());
-
-    PortableOuter readVal3 = reader.ReadObject<PortableOuter>("field3");
-    BOOST_REQUIRE(0 == readVal3.GetValue());
-    BOOST_REQUIRE(0 == readVal3.GetInner().GetValue());
-}
-
-BOOST_AUTO_TEST_CASE(TestArrayNull)
-{
-    TemplatedPortableIdResolver<PortableDummy> idRslvr;
-
-    InteropUnpooledMemory mem(1024);
-
-    InteropOutputStream out(&mem);
-    PortableWriterImpl writerImpl(&out, &idRslvr, NULL, NULL);
-    PortableWriter writer(&writerImpl);
-
-    out.Position(18);
-
-    writer.WriteNull("field1");
-    writer.WriteInt8("field2", 1);
-
-    out.Synchronize();
-
-    InteropInputStream in(&mem);
-    PortableReaderImpl readerImpl(&in, &idRslvr, 0, true, idRslvr.GetTypeId(), 0, 1000, 1000);
-    PortableReader reader(&readerImpl);
-
-    in.Position(18);
-
-    PortableArrayReader<PortableInner> arrReader = reader.ReadArray<PortableInner>("field1");
-
-    BOOST_REQUIRE(arrReader.GetSize() == -1);
-    BOOST_REQUIRE(!arrReader.HasNext());
-    BOOST_REQUIRE(arrReader.IsNull());
-
-    try
-    {
-        arrReader.GetNext();
-
-        BOOST_FAIL("Error expected.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-
-    BOOST_REQUIRE(reader.ReadInt8("field2") == 1);
-}
-
-BOOST_AUTO_TEST_CASE(TestArrayEmpty) 
-{
-    TemplatedPortableIdResolver<PortableDummy> idRslvr;
-
-    InteropUnpooledMemory mem(1024);
-
-    InteropOutputStream out(&mem);
-    PortableWriterImpl writerImpl(&out, &idRslvr, NULL, NULL);
-    PortableWriter writer(&writerImpl);
-
-    out.Position(18);
-
-    PortableArrayWriter<PortableInner> arrWriter = writer.WriteArray<PortableInner>("field1");
-
-    CheckWritesRestricted(writer);
-
-    arrWriter.Close();
-
-    writer.WriteInt8("field2", 1);
-
-    try
-    {
-        arrWriter.Write(1);
-
-        BOOST_FAIL("Error expected.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-
-    try
-    {
-        arrWriter.Close();
-
-        BOOST_FAIL("Error expected.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-
-    out.Synchronize();
-
-    InteropInputStream in(&mem);
-    PortableReaderImpl readerImpl(&in, &idRslvr, 0, true, idRslvr.GetTypeId(), 0, 1000, 1000);
-    PortableReader reader(&readerImpl);
-
-    in.Position(18);
-
-    PortableArrayReader<PortableInner> arrReader = reader.ReadArray<PortableInner>("field1");
-
-    BOOST_REQUIRE(arrReader.GetSize() == 0);
-    BOOST_REQUIRE(!arrReader.HasNext());
-    BOOST_REQUIRE(!arrReader.IsNull());
-
-    try
-    {
-        arrReader.GetNext();
-
-        BOOST_FAIL("Error expected.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-
-    BOOST_REQUIRE(reader.ReadInt8("field2") == 1);
-}
-
-BOOST_AUTO_TEST_CASE(TestArray)
-{
-    PortableInner writeVal1 = PortableInner(1);
-    PortableInner writeVal2 = PortableInner(0);
-    PortableInner writeVal3 = PortableInner(2);
-
-    TemplatedPortableIdResolver<PortableDummy> idRslvr;
-
-    InteropUnpooledMemory mem(1024);
-
-    InteropOutputStream out(&mem);
-    PortableWriterImpl writerImpl(&out, &idRslvr, NULL, NULL);
-    PortableWriter writer(&writerImpl);
-
-    out.Position(18);
-
-    PortableArrayWriter<PortableInner> arrWriter = writer.WriteArray<PortableInner>("field1");
-
-    arrWriter.Write(writeVal1); 
-    arrWriter.Write(writeVal2);
-    arrWriter.Write(writeVal3);
-
-    CheckWritesRestricted(writer);
-
-    arrWriter.Close();
-
-    writer.WriteInt8("field2", 1);
-
-    try
-    {
-        arrWriter.Write(1);
-
-        BOOST_FAIL("Error expected.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-
-    try
-    {
-        arrWriter.Close();
-
-        BOOST_FAIL("Error expected.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-
-    out.Synchronize();
-
-    InteropInputStream in(&mem);
-    PortableReaderImpl readerImpl(&in, &idRslvr, 0, true, idRslvr.GetTypeId(), 0, 1000, 1000);
-    PortableReader reader(&readerImpl);
-
-    in.Position(18);
-
-    PortableArrayReader<PortableInner> arrReader = reader.ReadArray<PortableInner>("field1");
-
-    CheckReadsRestricted(reader);
-
-    BOOST_REQUIRE(arrReader.GetSize() == 3);
-    BOOST_REQUIRE(!arrReader.IsNull());
-
-    BOOST_REQUIRE(arrReader.HasNext());
-    BOOST_REQUIRE(arrReader.GetNext().GetValue() == writeVal1.GetValue());
-
-    BOOST_REQUIRE(arrReader.HasNext());
-    BOOST_REQUIRE(arrReader.GetNext().GetValue() == writeVal2.GetValue());
-
-    BOOST_REQUIRE(arrReader.HasNext());
-    BOOST_REQUIRE(arrReader.GetNext().GetValue() == writeVal3.GetValue());
-
-    BOOST_REQUIRE(!arrReader.HasNext());
-
-    try
-    {
-        arrReader.GetNext();
-
-        BOOST_FAIL("Error expected.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-
-    BOOST_REQUIRE(reader.ReadInt8("field2") == 1);
-}
-
-BOOST_AUTO_TEST_CASE(TestCollectionNull)
-{
-    TemplatedPortableIdResolver<PortableDummy> idRslvr;
-
-    InteropUnpooledMemory mem(1024);
-
-    InteropOutputStream out(&mem);
-    PortableWriterImpl writerImpl(&out, &idRslvr, NULL, NULL);
-    PortableWriter writer(&writerImpl);
-
-    out.Position(18);
-
-    writer.WriteNull("field1");
-    writer.WriteInt8("field2", 1);
-
-    out.Synchronize();
-
-    InteropInputStream in(&mem);
-    PortableReaderImpl readerImpl(&in, &idRslvr, 0, true, idRslvr.GetTypeId(), 0, 1000, 1000);
-    PortableReader reader(&readerImpl);
-
-    in.Position(18);
-
-    PortableCollectionReader<PortableInner> colReader = reader.ReadCollection<PortableInner>("field1");
-
-    BOOST_REQUIRE(colReader.GetType() == IGNITE_COLLECTION_UNDEFINED);
-    BOOST_REQUIRE(colReader.GetSize() == -1);
-    BOOST_REQUIRE(!colReader.HasNext());
-    BOOST_REQUIRE(colReader.IsNull()); 
-
-    try
-    {
-        colReader.GetNext();
-
-        BOOST_FAIL("Error expected.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-
-    BOOST_REQUIRE(reader.ReadInt8("field2") == 1);
-}
-
-BOOST_AUTO_TEST_CASE(TestCollectionEmpty)
-{
-    CheckCollectionEmpty(NULL);
-}
-
-BOOST_AUTO_TEST_CASE(TestCollectionEmptyTyped)
-{
-    CollectionType typ = IGNITE_COLLECTION_CONCURRENT_SKIP_LIST_SET;
-
-    CheckCollectionEmpty(&typ);
-}
-
-BOOST_AUTO_TEST_CASE(TestCollection)
-{
-    CheckCollection(NULL);
-}
-
-BOOST_AUTO_TEST_CASE(testCollectionTyped)
-{
-    CollectionType typ = IGNITE_COLLECTION_CONCURRENT_SKIP_LIST_SET;
-
-    CheckCollection(&typ);
-}
-
-BOOST_AUTO_TEST_CASE(TestMapNull)
-{
-    TemplatedPortableIdResolver<PortableDummy> idRslvr;
-
-    InteropUnpooledMemory mem(1024);
-
-    InteropOutputStream out(&mem);
-    PortableWriterImpl writerImpl(&out, &idRslvr, NULL, NULL);
-    PortableWriter writer(&writerImpl);
-
-    out.Position(18);
-
-    writer.WriteNull("field1");
-    writer.WriteInt8("field2", 1);
-
-    out.Synchronize();
-
-    InteropInputStream in(&mem);
-    PortableReaderImpl readerImpl(&in, &idRslvr, 0, true, idRslvr.GetTypeId(), 0, 1000, 1000);
-    PortableReader reader(&readerImpl);
-
-    in.Position(18);
-
-    PortableMapReader<int8_t, PortableInner> mapReader = reader.ReadMap<int8_t, PortableInner>("field1");
-
-    BOOST_REQUIRE(mapReader.GetType() == IGNITE_MAP_UNDEFINED);
-    BOOST_REQUIRE(mapReader.GetSize() == -1);
-    BOOST_REQUIRE(!mapReader.HasNext());
-    BOOST_REQUIRE(mapReader.IsNull());
-
-    try
-    {
-        int8_t key;
-        PortableInner val;
-
-        mapReader.GetNext(&key, &val);
-
-        BOOST_FAIL("Error expected.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-
-    BOOST_REQUIRE(reader.ReadInt8("field2") == 1);
-}
-
-BOOST_AUTO_TEST_CASE(TestMapEmpty)
-{
-    CheckMapEmpty(NULL);
-}
-
-BOOST_AUTO_TEST_CASE(TestMapEmptyTyped)
-{
-    MapType typ = IGNITE_MAP_CONCURRENT_HASH_MAP;
-
-    CheckMapEmpty(&typ);
-}
-
-BOOST_AUTO_TEST_CASE(TestMap)
-{
-    CheckMap(NULL);
-}
-
-BOOST_AUTO_TEST_CASE(TestMapTyped)
-{
-    MapType typ = IGNITE_MAP_CONCURRENT_HASH_MAP;
-
-    CheckMap(&typ);
-}
-
-BOOST_AUTO_TEST_CASE(TestRawMode)
-{
-    TemplatedPortableIdResolver<PortableDummy> idRslvr;
-
-    InteropUnpooledMemory mem(1024);
-
-    InteropOutputStream out(&mem);
-    PortableWriterImpl writerImpl(&out, &idRslvr, NULL, NULL);
-    PortableWriter writer(&writerImpl);
-
-    out.Position(18);
-
-    PortableRawWriter rawWriter = writer.RawWriter();
-
-    try
-    {
-        writer.RawWriter();
-
-        BOOST_FAIL("Error expected.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-
-    rawWriter.WriteInt8(1);
-
-    CheckWritesRestricted(writer);
-
-    out.Synchronize();
-
-    InteropInputStream in(&mem);
-    PortableReaderImpl readerImpl(&in, &idRslvr, 0, true, idRslvr.GetTypeId(), 0, 1000, 18);
-    PortableReader reader(&readerImpl);
-
-    in.Position(18);
-
-    PortableRawReader rawReader = reader.RawReader();
-
-    try
-    {
-        reader.RawReader();
-
-        BOOST_FAIL("Error expected.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-
-    BOOST_REQUIRE(rawReader.ReadInt8() == 1);
-
-    CheckReadsRestricted(reader);
-}
-
-BOOST_AUTO_TEST_CASE(TestFieldSeek)
-{
-    TemplatedPortableIdResolver<PortableFields> idRslvr;
-
-    InteropUnpooledMemory mem(1024);
-
-    InteropOutputStream out(&mem);
-    PortableWriterImpl writer(&out, NULL);
-
-    PortableFields writeVal(1, 2, 3, 4);
-
-    writer.WriteTopObject<PortableFields>(writeVal);
-
-    out.Synchronize();
-
-    InteropInputStream in(&mem);
-
-    int32_t pos = in.Position();
-    in.ReadInt8(); // We do not need a header here.
-    bool usrType = in.ReadBool();
-    int32_t typeId = in.ReadInt32();
-    int32_t hashCode = in.ReadInt32();
-    int32_t len = in.ReadInt32();
-    int32_t rawOff = in.ReadInt32();
-
-    PortableReaderImpl readerImpl(&in, &idRslvr, pos, usrType, typeId, hashCode, len, rawOff);
-    PortableReader reader(&readerImpl);
-
-    // 1. Clockwise.
-    BOOST_REQUIRE(reader.ReadInt32("val1") == 1);
-    BOOST_REQUIRE(reader.ReadInt32("val2") == 2);
-    BOOST_REQUIRE(reader.ReadInt32("val1") == 1);
-    BOOST_REQUIRE(reader.ReadInt32("val2") == 2);
-
-    // 2. Counter closkwise.
-    in.Position(18);
-    BOOST_REQUIRE(reader.ReadInt32("val2") == 2);
-    BOOST_REQUIRE(reader.ReadInt32("val1") == 1);
-    BOOST_REQUIRE(reader.ReadInt32("val2") == 2);
-    BOOST_REQUIRE(reader.ReadInt32("val1") == 1);
-
-    // 3. Same field twice.
-    in.Position(18);
-    BOOST_REQUIRE(reader.ReadInt32("val1") == 1);
-    BOOST_REQUIRE(reader.ReadInt32("val1") == 1);
-
-    in.Position(18);
-    BOOST_REQUIRE(reader.ReadInt32("val2") == 2);
-    BOOST_REQUIRE(reader.ReadInt32("val2") == 2);
-    
-    // 4. Read missing field in between.
-    in.Position(18);
-    BOOST_REQUIRE(reader.ReadInt32("val1") == 1);
-    BOOST_REQUIRE(reader.ReadInt32("missing") == 0);
-    BOOST_REQUIRE(reader.ReadInt32("val2") == 2);
-
-    in.Position(18);
-    BOOST_REQUIRE(reader.ReadInt32("val2") == 2);
-    BOOST_REQUIRE(reader.ReadInt32("missing") == 0);
-    BOOST_REQUIRE(reader.ReadInt32("val1") == 1);
-
-    // 5. Invalid field type.
-    in.Position(18);
-    BOOST_REQUIRE(reader.ReadInt32("val1") == 1);
-
-    try
-    {
-        reader.ReadInt64("val2");
-
-        BOOST_FAIL("Error expected.");
-    }
-    catch (IgniteError& err)
-    {
-        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
-    }
-
-    BOOST_REQUIRE(reader.ReadInt32("val2") == 2);
-
-    // 6. Read missing primitive fields.
-    BOOST_REQUIRE(reader.ReadInt8("missing") == 0);
-    BOOST_REQUIRE(reader.ReadBool("missing") == false);
-    BOOST_REQUIRE(reader.ReadInt16("missing") == 0);
-    BOOST_REQUIRE(reader.ReadUInt16("missing") == 0);
-    BOOST_REQUIRE(reader.ReadInt32("missing") == 0);
-    BOOST_REQUIRE(reader.ReadInt64("missing") == 0);
-    BOOST_REQUIRE(reader.ReadFloat("missing") == 0);
-    BOOST_REQUIRE(reader.ReadDouble("missing") == 0);
-
-    BOOST_REQUIRE(reader.ReadGuid("missing").GetMostSignificantBits() == 0);
-    BOOST_REQUIRE(reader.ReadGuid("missing").GetLeastSignificantBits() == 0);
-
-    // 7. Read missing primitive array fields.
-    BOOST_REQUIRE(reader.ReadInt8Array("missing", NULL, 1) == -1);
-    BOOST_REQUIRE(reader.ReadBoolArray("missing", NULL, 1) == -1);
-    BOOST_REQUIRE(reader.ReadInt16Array("missing", NULL, 1) == -1);
-    BOOST_REQUIRE(reader.ReadUInt16Array("missing", NULL, 1) == -1);
-    BOOST_REQUIRE(reader.ReadInt32Array("missing", NULL, 1) == -1);
-    BOOST_REQUIRE(reader.ReadInt64Array("missing", NULL, 1) == -1);
-    BOOST_REQUIRE(reader.ReadFloatArray("missing", NULL, 1) == -1);
-    BOOST_REQUIRE(reader.ReadDoubleArray("missing", NULL, 1) == -1);
-
-    BOOST_REQUIRE(reader.ReadGuidArray("missing", NULL, 1) == -1);
-
-    // 8. Read missing string fields.
-    BOOST_REQUIRE(reader.ReadString("missing", NULL, 1) == -1);
-    BOOST_REQUIRE(reader.ReadString("missing").length() == 0);
-
-    // 9. Read missing object fields.
-    BOOST_REQUIRE(reader.ReadObject<PortableFields*>("missing") == NULL);
-    
-    // 10. Read missing container fields.
-    PortableStringArrayReader stringArrReader = reader.ReadStringArray("missing");
-    BOOST_REQUIRE(stringArrReader.IsNull());
-
-    PortableArrayReader<PortableFields> arrReader = reader.ReadArray<PortableFields>("missing");
-    BOOST_REQUIRE(arrReader.IsNull());
-
-    PortableCollectionReader<PortableFields> colReader = reader.ReadCollection<PortableFields>("missing");
-    BOOST_REQUIRE(colReader.IsNull());
-
-    PortableMapReader<int32_t, PortableFields> mapReader = reader.ReadMap<int32_t, PortableFields>("missing");
-    BOOST_REQUIRE(mapReader.IsNull());
-}
-
-BOOST_AUTO_TEST_SUITE_END()
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/core-test/src/portable_session_test.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core-test/src/portable_session_test.cpp b/modules/platform/src/main/cpp/core-test/src/portable_session_test.cpp
deleted file mode 100644
index 9d84e48..0000000
--- a/modules/platform/src/main/cpp/core-test/src/portable_session_test.cpp
+++ /dev/null
@@ -1,257 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef _MSC_VER
-    #define BOOST_TEST_DYN_LINK
-#endif
-
-#include <boost/test/unit_test.hpp>
-
-#include "ignite/impl/interop/interop.h"
-#include "ignite/impl/portable/portable_reader_impl.h"
-#include "ignite/impl/portable/portable_writer_impl.h"
-
-#include "ignite/portable_test_defs.h"
-
-using namespace ignite;
-using namespace ignite::impl::interop;
-using namespace ignite::impl::portable;
-using namespace ignite::portable;
-using namespace ignite_test::core::portable;
-
-/*
- * Check primitive value serialization-deserialization.
- */
-template<typename T>
-void CheckRawPrimitive(T writeVal) 
-{
-    InteropUnpooledMemory mem(1024);
-
-    InteropOutputStream out(&mem); 
-    PortableWriterImpl writeSes(&out, NULL);
-    writeSes.WriteTopObject<T>(writeVal);
-    out.Synchronize();
-
-    InteropInputStream in(&mem); 
-    PortableReaderImpl reader(&in);
-    T readVal = reader.ReadTopObject<T>();
-
-    BOOST_REQUIRE(readVal == writeVal);
-}
-
-BOOST_AUTO_TEST_SUITE(PortableSessionTestSuite)
-
-BOOST_AUTO_TEST_CASE(TestByte)
-{
-    CheckRawPrimitive<int8_t>(-128);
-    CheckRawPrimitive<int8_t>(-1);
-    CheckRawPrimitive<int8_t>(0);
-    CheckRawPrimitive<int8_t>(1);
-    CheckRawPrimitive<int8_t>(127);
-}
-
-BOOST_AUTO_TEST_CASE(TestBool)
-{
-    CheckRawPrimitive<bool>(true);
-    CheckRawPrimitive<bool>(false);
-}
-
-BOOST_AUTO_TEST_CASE(TestShort)
-{
-    //CheckRawPrimitive<int16_t>(std::numeric_limits<int16_t>::min()); 
-    CheckRawPrimitive<int16_t>(-1);
-    CheckRawPrimitive<int16_t>(0);
-    CheckRawPrimitive<int16_t>(1);
-    //CheckRawPrimitive<int16_t>(std::numeric_limits<int16_t>::max());
-}
-
-BOOST_AUTO_TEST_CASE(TestChar)
-{
-    //CheckRawPrimitive<uint16_t>(std::numeric_limits<uint16_t>::min());
-    CheckRawPrimitive<uint16_t>(1);
-    //CheckRawPrimitive<uint16_t>(std::numeric_limits<uint16_t>::max());
-}
-
-BOOST_AUTO_TEST_CASE(TestInt)
-{
-    //CheckRawPrimitive<int32_t>(std::numeric_limits<int32_t>::min());
-    CheckRawPrimitive<int32_t>(-1);
-    CheckRawPrimitive<int32_t>(0);
-    CheckRawPrimitive<int32_t>(1);
-    //CheckRawPrimitive<int32_t>(std::numeric_limits<int32_t>::max());
-}
-
-BOOST_AUTO_TEST_CASE(TestLong)
-{
-    //CheckRawPrimitive<int64_t>(std::numeric_limits<int64_t>::min());
-    CheckRawPrimitive<int64_t>(-1);
-    CheckRawPrimitive<int64_t>(0);
-    CheckRawPrimitive<int64_t>(1);
-    //CheckRawPrimitive<int64_t>(std::numeric_limits<int64_t>::max());
-}
-
-BOOST_AUTO_TEST_CASE(TestFloat)
-{
-    CheckRawPrimitive<float>(-1.1f);
-    CheckRawPrimitive<float>(0);
-    CheckRawPrimitive<float>(1.1f);
-}
-
-BOOST_AUTO_TEST_CASE(TestDouble)
-{
-    CheckRawPrimitive<double>(-1.1);
-    CheckRawPrimitive<double>(0);
-    CheckRawPrimitive<double>(1.1);
-}
-
-BOOST_AUTO_TEST_CASE(TestGuid)
-{
-    Guid writeVal = Guid(1, 1);
-
-    InteropUnpooledMemory mem(1024);
-
-    InteropOutputStream out(&mem);
-    PortableWriterImpl writeSes(&out, NULL);
-    writeSes.WriteTopObject<Guid>(writeVal);
-    out.Synchronize();
-
-    InteropInputStream in(&mem);
-    PortableReaderImpl reader(&in);
-    Guid readVal = reader.ReadTopObject<Guid>();
-
-    BOOST_REQUIRE(readVal.GetMostSignificantBits() == writeVal.GetMostSignificantBits());
-    BOOST_REQUIRE(readVal.GetLeastSignificantBits() == writeVal.GetLeastSignificantBits());    
-}
-
-BOOST_AUTO_TEST_CASE(TestString)
-{
-    std::string writeVal = "MyString";
-
-    InteropUnpooledMemory mem(1024);
-
-    InteropOutputStream out(&mem);
-    PortableWriterImpl writeSes(&out, NULL);
-    writeSes.WriteTopObject<std::string>(writeVal);
-    out.Synchronize();
-
-    InteropInputStream in(&mem);
-    PortableReaderImpl reader(&in);
-    std::string readVal = reader.ReadTopObject<std::string>();
-
-    BOOST_REQUIRE(readVal.compare(writeVal) == 0);
-}
-
-BOOST_AUTO_TEST_CASE(TestObject)
-{
-    InteropUnpooledMemory mem(1024);
-    
-    InteropOutputStream out(&mem);
-    PortableWriterImpl writer(&out, NULL);
-
-    InteropInputStream in(&mem);
-    PortableReaderImpl reader(&in);
-
-    // 1. Test null object.
-    PortableInner writeVal(0);
-    
-    writer.WriteTopObject<PortableInner>(writeVal);
-    out.Synchronize();
-    
-    in.Synchronize();
-    PortableInner readVal = reader.ReadTopObject<PortableInner>();
-
-    BOOST_REQUIRE(readVal.GetValue() == 0);
-
-    // 2. Test non-null object.
-    out.Position(0);
-    in.Position(0);
-
-    writeVal = PortableInner(1);
-
-    writer.WriteTopObject<PortableInner>(writeVal);
-    out.Synchronize();
-
-    in.Synchronize();
-    readVal = reader.ReadTopObject<PortableInner>();
-
-    BOOST_REQUIRE(readVal.GetValue() == 1);
-}
-
-BOOST_AUTO_TEST_CASE(TestObjectWithRawFields)
-{
-    InteropUnpooledMemory mem(1024);
-
-    InteropOutputStream out(&mem);
-    PortableWriterImpl writer(&out, NULL);
-
-    InteropInputStream in(&mem);
-    PortableReaderImpl reader(&in);
-
-    out.Position(0);
-    in.Position(0);
-
-    PortableFields writeVal = PortableFields(1, 2, 3, 4);
-
-    writer.WriteTopObject<PortableFields>(writeVal);
-    out.Synchronize();
-
-    in.Synchronize();
-    PortableFields readVal = reader.ReadTopObject<PortableFields>();
-
-    BOOST_REQUIRE(readVal.val1 == 1);
-    BOOST_REQUIRE(readVal.val2 == 2);
-    BOOST_REQUIRE(readVal.rawVal1 == 3);
-    BOOST_REQUIRE(readVal.rawVal2 == 4);
-}
-
-BOOST_AUTO_TEST_CASE(TestPointer)
-{
-    InteropUnpooledMemory mem(1024);
-
-    InteropOutputStream out(&mem);
-    PortableWriterImpl writer(&out, NULL);
-
-    InteropInputStream in(&mem);
-    PortableReaderImpl reader(&in);
-
-    // 1. Test null object.
-    writer.WriteTopObject<PortableInner*>(NULL);
-    out.Synchronize();
-
-    in.Synchronize();
-    PortableInner* readVal = reader.ReadTopObject<PortableInner*>();
-
-    BOOST_REQUIRE(readVal == NULL);
-
-    // 2. Test non-null object.
-    out.Position(0);
-    in.Position(0);
-
-    PortableInner writeVal = PortableInner(1);
-
-    writer.WriteTopObject<PortableInner*>(&writeVal);
-    out.Synchronize();
-
-    in.Synchronize();
-    readVal = reader.ReadTopObject<PortableInner*>();
-
-    BOOST_REQUIRE(readVal->GetValue() == 1);
-
-    delete readVal;
-}
-
-BOOST_AUTO_TEST_SUITE_END()
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/core-test/src/portable_test_defs.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core-test/src/portable_test_defs.cpp b/modules/platform/src/main/cpp/core-test/src/portable_test_defs.cpp
deleted file mode 100644
index e818711..0000000
--- a/modules/platform/src/main/cpp/core-test/src/portable_test_defs.cpp
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "ignite/impl/interop/interop.h"
-#include "ignite/portable/portable.h"
-
-#include "ignite/portable_test_defs.h"
-
-using namespace ignite;
-using namespace ignite::impl::interop;
-using namespace ignite::impl::portable;
-using namespace ignite::portable;
-
-namespace ignite_test
-{
-    namespace core
-    {
-        namespace portable
-        {
-            PortableInner::PortableInner() : val(0)
-            {
-                // No-op.
-            }
-
-            PortableInner::PortableInner(int32_t val) : val(val)
-            {
-                // No-op.
-            }
-
-            int32_t PortableInner::GetValue() const
-            {
-                return val;
-            }
-
-            PortableOuter::PortableOuter(int32_t valIn, int32_t valOut) : inner(valIn), val(valOut)
-            {
-                // No-op.
-            }
-
-            PortableInner PortableOuter::GetInner() const
-            {
-                return inner;
-            }
-
-            int32_t PortableOuter::GetValue() const
-            {
-                return val;
-            }
-        }
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/core-test/src/teamcity_boost.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core-test/src/teamcity_boost.cpp b/modules/platform/src/main/cpp/core-test/src/teamcity_boost.cpp
deleted file mode 100644
index 45c666d..0000000
--- a/modules/platform/src/main/cpp/core-test/src/teamcity_boost.cpp
+++ /dev/null
@@ -1,159 +0,0 @@
-/* Copyright 2011 JetBrains s.r.o.
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * 
- * $Revision: 88625 $
-*/
-
-#define BOOST_TEST_MODULE IgniteCoreTest
-
-#include <sstream>
-
-#include <boost/test/unit_test_suite_impl.hpp>
-#include <boost/test/results_collector.hpp>
-#include <boost/test/utils/basic_cstring/io.hpp>
-#include <boost/test/unit_test_log.hpp>
-#include <boost/test/included/unit_test.hpp>
-
-#include "teamcity_messages.h"
-
-using namespace boost::unit_test;
-using namespace std;
-
-namespace JetBrains {
-
-// Custom formatter for TeamCity messages
-class TeamcityBoostLogFormatter: public boost::unit_test::unit_test_log_formatter {
-    TeamcityMessages messages;
-    std::string currentDetails;
-    std::string flowId;
-    
-public:
-    TeamcityBoostLogFormatter(const std::string &_flowId);
-    TeamcityBoostLogFormatter();
-    
-    void log_start(std::ostream&, boost::unit_test::counter_t test_cases_amount);
-    void log_finish(std::ostream&);
-    void log_build_info(std::ostream&);
-
-    void test_unit_start(std::ostream&, boost::unit_test::test_unit const& tu);
-    void test_unit_finish(std::ostream&,
-        boost::unit_test::test_unit const& tu,
-        unsigned long elapsed);
-    void test_unit_skipped(std::ostream&, boost::unit_test::test_unit const& tu);
-
-    void log_exception(std::ostream&,
-        boost::unit_test::log_checkpoint_data const&,
-        boost::unit_test::const_string explanation);
-
-    void log_entry_start(std::ostream&,
-        boost::unit_test::log_entry_data const&,
-        log_entry_types let);
-    void log_entry_value(std::ostream&, boost::unit_test::const_string value);
-    void log_entry_finish(std::ostream&);
-};
-
-// Fake fixture to register formatter
-struct TeamcityFormatterRegistrar {
-    TeamcityFormatterRegistrar() {
-        if (JetBrains::underTeamcity()) {
-            boost::unit_test::unit_test_log.set_formatter(new JetBrains::TeamcityBoostLogFormatter());
-            boost::unit_test::unit_test_log.set_threshold_level(boost::unit_test::log_successful_tests);
-        }
-    }
-};
-BOOST_GLOBAL_FIXTURE(TeamcityFormatterRegistrar);
-
-// Formatter implementation
-string toString(const_string bstr) {
-    stringstream ss;
-    
-    ss << bstr;
-    
-    return ss.str();
-}
-
-TeamcityBoostLogFormatter::TeamcityBoostLogFormatter(const std::string &_flowId)
-: flowId(_flowId)
-{}
-
-TeamcityBoostLogFormatter::TeamcityBoostLogFormatter()
-: flowId(getFlowIdFromEnvironment())
-{}
-
-void TeamcityBoostLogFormatter::log_start(ostream &out, counter_t test_cases_amount)
-{}
-
-void TeamcityBoostLogFormatter::log_finish(ostream &out)
-{}
-
-void TeamcityBoostLogFormatter::log_build_info(ostream &out)
-{}
-
-void TeamcityBoostLogFormatter::test_unit_start(ostream &out, test_unit const& tu) {
-    messages.setOutput(out);
-
-    if (tu.p_type == tut_case) {
-        messages.testStarted(tu.p_name, flowId);
-    } else {
-        messages.suiteStarted(tu.p_name, flowId);
-    }
-    
-    currentDetails.clear();
-}
-
-void TeamcityBoostLogFormatter::test_unit_finish(ostream &out, test_unit const& tu, unsigned long elapsed) {
-    messages.setOutput(out);
-
-    test_results const& tr = results_collector.results(tu.p_id);
-    if (tu.p_type == tut_case) {
-        if(!tr.passed()) {
-            if(tr.p_skipped) {
-                messages.testIgnored(tu.p_name, "ignored", flowId);
-            } else if (tr.p_aborted) {
-                messages.testFailed(tu.p_name, "aborted", currentDetails, flowId);
-            } else {
-                messages.testFailed(tu.p_name, "failed", currentDetails, flowId);
-            }
-        }
-        
-        messages.testFinished(tu.p_name, elapsed / 1000, flowId);
-    } else {
-        messages.suiteFinished(tu.p_name, flowId);
-    }
-}
-
-void TeamcityBoostLogFormatter::test_unit_skipped(ostream &out, test_unit const& tu)
-{}
-
-void TeamcityBoostLogFormatter::log_exception(ostream &out, log_checkpoint_data const&, const_string explanation) {
-    string what = toString(explanation);
-    
-    out << what << endl;
-    currentDetails += what + "\n";
-}
-
-void TeamcityBoostLogFormatter::log_entry_start(ostream&, log_entry_data const&, log_entry_types let)
-{}
-
-void TeamcityBoostLogFormatter::log_entry_value(ostream &out, const_string value) {
-    out << value;
-    currentDetails += toString(value);
-}
-
-void TeamcityBoostLogFormatter::log_entry_finish(ostream &out) {
-    out << endl;
-    currentDetails += "\n";
-}
-
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/core-test/src/teamcity_messages.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core-test/src/teamcity_messages.cpp b/modules/platform/src/main/cpp/core-test/src/teamcity_messages.cpp
deleted file mode 100644
index 087409e..0000000
--- a/modules/platform/src/main/cpp/core-test/src/teamcity_messages.cpp
+++ /dev/null
@@ -1,150 +0,0 @@
-/* Copyright 2011 JetBrains s.r.o.
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * $Revision: 88625 $
-*/
-
-#include <stdlib.h>
-#include <sstream>
-
-#include "teamcity_messages.h"
-
-using namespace std;
-
-namespace JetBrains {
-
-std::string getFlowIdFromEnvironment() {
-    const char *flowId = getenv("TEAMCITY_PROCESS_FLOW_ID");
-    return flowId == NULL ? "" : flowId;
-}
-
-bool underTeamcity() {
-    return getenv("TEAMCITY_PROJECT_NAME") != NULL;
-}
-
-TeamcityMessages::TeamcityMessages()
-: m_out(&cout)
-{}
-
-void TeamcityMessages::setOutput(ostream &out) {
-    m_out = &out;
-}
-
-string TeamcityMessages::escape(string s) {
-    string result;
-    
-    for (size_t i = 0; i < s.length(); i++) {
-        char c = s[i];
-        
-        switch (c) {
-        case '\n': result.append("|n"); break;
-        case '\r': result.append("|r"); break;
-        case '\'': result.append("|'"); break;
-        case '|':  result.append("||"); break;
-        case ']':  result.append("|]"); break;
-        default:   result.append(&c, 1);
-        }
-    }
-    
-    return result;
-}
-
-void TeamcityMessages::openMsg(const string &name) {
-    // endl for http://jetbrains.net/tracker/issue/TW-4412
-    *m_out << endl << "##teamcity[" << name;
-}
-
-void TeamcityMessages::closeMsg() {
-    *m_out << "]";
-    // endl for http://jetbrains.net/tracker/issue/TW-4412
-    *m_out << endl;
-    m_out->flush();
-}
-
-void TeamcityMessages::writeProperty(string name, string value) {
-    *m_out << " " << name << "='" << escape(value) << "'";
-}
-
-void TeamcityMessages::suiteStarted(string name, string flowid) {
-    openMsg("testSuiteStarted");
-    writeProperty("name", name);
-    if(flowid.length() > 0) {
-        writeProperty("flowId", flowid);
-    }
-    
-    closeMsg();
-}
-
-void TeamcityMessages::suiteFinished(string name, string flowid) {
-    openMsg("testSuiteFinished");
-    writeProperty("name", name);
-    if(flowid.length() > 0) {
-        writeProperty("flowId", flowid);
-    }
-    
-    closeMsg();
-}
-
-void TeamcityMessages::testStarted(string name, string flowid) {
-    openMsg("testStarted");
-    writeProperty("name", name);
-    if(flowid.length() > 0) {
-        writeProperty("flowId", flowid);
-    }
-    
-    closeMsg();
-}
-
-void TeamcityMessages::testFinished(string name, int durationMs, string flowid) {
-    openMsg("testFinished");
-
-    writeProperty("name", name);
-
-    if(flowid.length() > 0) {
-        writeProperty("flowId", flowid);
-    }
-
-    if(durationMs >= 0) {
-        stringstream out;
-        out << durationMs;
-        writeProperty("duration", out.str());
-    }
-    
-    closeMsg();
-}
-
-void TeamcityMessages::testFailed(string name, string message, string details, string flowid) {
-    openMsg("testFailed");
-    writeProperty("name", name);
-    writeProperty("message", message);
-    writeProperty("details", details);
-    if(flowid.length() > 0) {
-        writeProperty("flowId", flowid);
-    }
-    
-    closeMsg();
-}
-
-void TeamcityMessages::testIgnored(std::string name, std::string message, string flowid) {
-    openMsg("testIgnored");
-    writeProperty("name", name);
-    writeProperty("message", message);
-    if(flowid.length() > 0) {
-        writeProperty("flowId", flowid);
-    }
-    
-    closeMsg();
-}
-
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/core/Makefile.am
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/Makefile.am b/modules/platform/src/main/cpp/core/Makefile.am
deleted file mode 100644
index db50326..0000000
--- a/modules/platform/src/main/cpp/core/Makefile.am
+++ /dev/null
@@ -1,66 +0,0 @@
-##
-## Licensed to the Apache Software Foundation (ASF) under one or more
-## contributor license agreements.  See the NOTICE file distributed with
-## this work for additional information regarding copyright ownership.
-## The ASF licenses this file to You under the Apache License, Version 2.0
-## (the "License"); you may not use this file except in compliance with
-## the License.  You may obtain a copy of the License at
-##
-##      http://www.apache.org/licenses/LICENSE-2.0
-##
-## Unless required by applicable law or agreed to in writing, software
-## distributed under the License is distributed on an "AS IS" BASIS,
-## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-## See the License for the specific language governing permissions and
-## limitations under the License.
-##
-
-ACLOCAL_AMFLAGS = "-Im4"
-
-SUBDIRS = . include os/linux/include
-DIST_SUBDIRS = . include os/linux/include
-
-AM_CPPFLAGS = -I$(srcdir)/include -I$(srcdir)/os/linux/include -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/linux -DIGNITE_IMPL
-AM_CXXFLAGS = -Wall -std=c++0x
-LIB_LDFLAGS = -no-undefined -version-info 1
-
-COMMON_SRC = os/linux/src/impl/utils.cpp \
-             src/ignite_error.cpp \
-             src/guid.cpp \
-             src/impl/handle_registry.cpp \
-             src/impl/interop/interop_memory.cpp \
-             src/impl/interop/interop_input_stream.cpp \
-             src/impl/interop/interop_output_stream.cpp \
-             src/portable/portable_type.cpp \
-             src/impl/portable/portable_metadata_snapshot.cpp \
-             src/impl/portable/portable_metadata_handler.cpp \
-             src/impl/portable/portable_metadata_updater.cpp \
-             src/impl/portable/portable_metadata_manager.cpp \
-             src/impl/portable/portable_utils.cpp \
-             src/impl/portable/portable_reader_impl.cpp \
-             src/impl/portable/portable_writer_impl.cpp \
-             src/portable/portable_containers.cpp \
-             src/portable/portable_raw_reader.cpp \
-             src/portable/portable_raw_writer.cpp \
-             src/portable/portable_reader.cpp \
-             src/portable/portable_writer.cpp \
-             src/impl/portable/portable_metadata_updater_impl.cpp \
-             src/impl/ignite_environment.cpp \
-             src/impl/cache/query/query_impl.cpp \
-             src/impl/cache/cache_impl.cpp \
-             src/impl/ignite_impl.cpp \
-             src/ignite.cpp \
-             src/ignition.cpp
-
-lib_LTLIBRARIES = libignite.la
-libignite_la_SOURCES = $(COMMON_SRC)
-libignite_la_LDFLAGS = $(LIB_LDFLAGS) -L/usr/local/lib -lignite-common -ldl -version-info 0:0:0 -release $(PACKAGE_VERSION)
-
-pkgconfigdir = $(libdir)/pkgconfig
-pkgconfig_DATA = ignite.pc
-
-clean-local:
-	$(RM) *.gcno *.gcda
-
-clean-docs:
-	$(RM) $(DX_CLEANFILES)

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/core/configure.ac
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/configure.ac b/modules/platform/src/main/cpp/core/configure.ac
deleted file mode 100644
index c1657d3..0000000
--- a/modules/platform/src/main/cpp/core/configure.ac
+++ /dev/null
@@ -1,62 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-#                                               -*- Autoconf -*-
-# Process this file with autoconf to produce a configure script.
-
-AC_PREREQ([2.69])
-AC_INIT([Apache Ignite C++], [1.5.0], [dev@ignite.apache.org], [ignite], [ignite.apache.org])
-AC_CONFIG_SRCDIR(src)
-
-AC_CANONICAL_SYSTEM
-AC_CONFIG_MACRO_DIR([m4])
-AC_LANG([C++])
-
-# Initialize automake
-AM_INIT_AUTOMAKE([-Wall foreign subdir-objects])
-AC_CONFIG_HEADER(config.h)
-
-AM_PROG_AR
-
-# Checks for programs.
-GXX="-g -O2"
-
-AC_PROG_CXX
-
-# Initialize Libtool
-LT_INIT
-
-# Checks for libraries.
-AC_CHECK_LIB([pthread], [pthread_mutex_lock])
-
-# Checks for header files.
-
-# Checks for typedefs, structures, and compiler characteristics.
-AC_C_INLINE
-AC_TYPE_INT16_T
-AC_TYPE_INT32_T
-AC_TYPE_INT64_T
-AC_TYPE_INT8_T
-AC_TYPE_PID_T
-AC_TYPE_SIZE_T
-
-# Checks for library functions.
-AC_FUNC_ERROR_AT_LINE
-
-AC_CONFIG_FILES(Makefile include/Makefile os/linux/include/Makefile ignite.pc)
-
-AC_OUTPUT

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/core/ignite.pc.in
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/ignite.pc.in b/modules/platform/src/main/cpp/core/ignite.pc.in
deleted file mode 100644
index 613fd1a..0000000
--- a/modules/platform/src/main/cpp/core/ignite.pc.in
+++ /dev/null
@@ -1,9 +0,0 @@
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-libdir=@libdir@
-includedir=@includedir@
-
-Name: ignite
-Description: Apache Ignite C++.
-Version: @PACKAGE_VERSION@
-Libs: -L${libdir} -lignite

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/core/include/Makefile.am
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/Makefile.am b/modules/platform/src/main/cpp/core/include/Makefile.am
deleted file mode 100644
index da9d95e..0000000
--- a/modules/platform/src/main/cpp/core/include/Makefile.am
+++ /dev/null
@@ -1,61 +0,0 @@
-##
-## Licensed to the Apache Software Foundation (ASF) under one or more
-## contributor license agreements.  See the NOTICE file distributed with
-## this work for additional information regarding copyright ownership.
-## The ASF licenses this file to You under the Apache License, Version 2.0
-## (the "License"); you may not use this file except in compliance with
-## the License.  You may obtain a copy of the License at
-##
-##      http://www.apache.org/licenses/LICENSE-2.0
-##
-## Unless required by applicable law or agreed to in writing, software
-## distributed under the License is distributed on an "AS IS" BASIS,
-## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-## See the License for the specific language governing permissions and
-## limitations under the License.
-##
-
-ACLOCAL_AMFLAGS = "-Im4"
-
-nobase_include_HEADERS = ignite/cache/cache.h \
-                         ignite/cache/cache_entry.h \
-                         ignite/cache/cache_peek_mode.h \
-                         ignite/cache/query/query_argument.h \
-                         ignite/cache/query/query_cursor.h \
-                         ignite/cache/query/query_scan.h \
-                         ignite/cache/query/query_sql.h \
-                         ignite/cache/query/query_text.h \
-                         ignite/cache/query/query.h \
-                         ignite/impl/cache/cache_impl.h \
-                         ignite/impl/cache/query/query_impl.h \
-                         ignite/impl/interop/interop.h \
-                         ignite/impl/interop/interop_input_stream.h \
-                         ignite/impl/interop/interop_memory.h \
-                         ignite/impl/interop/interop_output_stream.h \
-                         ignite/impl/portable/portable_metadata_handler.h \
-                         ignite/impl/portable/portable_metadata_manager.h \
-                         ignite/impl/portable/portable_metadata_snapshot.h \
-                         ignite/impl/portable/portable_metadata_updater.h \
-                         ignite/impl/portable/portable_metadata_updater_impl.h \
-                         ignite/impl/portable/portable_common.h \
-                         ignite/impl/portable/portable_id_resolver.h \
-                         ignite/impl/portable/portable_reader_impl.h \
-                         ignite/impl/portable/portable_utils.h \
-                         ignite/impl/portable/portable_writer_impl.h \
-                         ignite/impl/ignite_environment.h \
-                         ignite/impl/ignite_impl.h \
-                         ignite/impl/handle_registry.h \
-                         ignite/impl/operations.h \
-                         ignite/portable/portable.h \
-                         ignite/portable/portable_consts.h \
-                         ignite/portable/portable_containers.h \
-                         ignite/portable/portable_type.h \
-                         ignite/portable/portable_raw_reader.h \
-                         ignite/portable/portable_raw_writer.h \
-                         ignite/portable/portable_reader.h \
-                         ignite/portable/portable_writer.h \
-                         ignite/ignite.h \
-                         ignite/ignite_configuration.h \
-                         ignite/ignite_error.h \
-                         ignite/ignition.h \
-                         ignite/guid.h


[14/28] ignite git commit: IGNITE-1513: Moved CPP.

Posted by vo...@apache.org.
http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/README.txt
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/README.txt b/modules/platform/src/main/cpp/README.txt
deleted file mode 100644
index c9e6999..0000000
--- a/modules/platform/src/main/cpp/README.txt
+++ /dev/null
@@ -1,101 +0,0 @@
-Apache Ignite for C++
-==================================
-
-Ignite C++ provides data grid functionality.
-Using Ignite C++ APIs you can execute perform concurrent operations on
-the data stored in cache.
-
-Ignite C++ can access cluster and share data with .Net and
-Java applications using portable object format.
-
-Support for the following will be added in next releases:
- * ACID transactions management.
- * Distributed locks.
- * Async operations.
- * Cache SQL queries and continuous queries.
- * Event listening.
- * Compute grid functionality.
-
-Full source code is provided. Users should build the library for intended platform.
-
-Building on Linux With Autotools
-----------------------------------
-
-Common Requirements:
-
- * GCC, g++, autotools, automake, and libtool must be installed
- * Java Development Kit (JDK) must be installed: https://java.com/en/download/index.jsp
- * JAVA_HOME environment variable must be set pointing to Java installation directory.
-
-Building the library:
-
- * Build Ignite C++ helper "common" library:
-     * Navigate to the directory $IGNITE_HOME/platforms/cpp/src/common
-     * Execute the following commands one by one:
-         * libtoolize
-         * aclocal
-         * autoheader
-         * automake --add-missing
-         * autoreconf
-         * ./configure
-         * make
-         * make install
- * Build Ignite C++ library:
-     * Navigate to the directory $IGNITE_HOME/platforms/cpp/src/core
-     * Execute the following commands one by one:
-         * libtoolize
-         * aclocal
-         * autoheader
-         * automake --add-missing
-         * autoreconf
-         * ./configure
-         * make
-         * make install
-
-NOTE: "make install" command may require superuser privileges. In this case it must be
-executed as "sudo make install".
-
-Development:
-
- * IGNITE_HOME environment variable must be set to Ignite installation directory.
- * Once both libraries are built and installed, required headers are placed in the
-   "/usr/local/include/ignite" directory.
- * Ignite C++ depends on jni.h file located inside ${JAVA_HOME}/include directory.
-   Add this directory to headers search path: "-I${JAVA_HOME}/include".
- * Library is placed in the "/usr/local/lib" directory. Link it to your project: "-lignite".
- * Ignite depends on "libjvm.so" library shipped with Java. Typically this library is located inside
-   $JAVA_HOME/jre/lib/amd64/server directory. Ensure that LD_LIBRARY_PATH environment variable points to this directory.
-
-
-Building on Windows with Visual Studio (tm)
-----------------------------------
-
-Common Requirements:
-
- * Microsoft Visual Studio (tm) 2010 or later
- * Windows SDK 7.1
- * Java Development Kit (JDK) must be installed: https://java.com/en/download/index.jsp
- * JAVA_HOME environment variable must be set pointing to Java installation directory.
-
-Building the library:
-
- * Open and build %IGNITE_HOME%\platforms\cpp\src\project\vs\ignite.sln (or ignite_86.sln if you are running
-   32-bit platform).
-
-Development:
-
- * IGNITE_HOME environment variable must be set to Ignite installation directory.
- * Update Include Directories in Project Properties with paths to:
-   * $(IGNITE_HOME)\platforms\cpp\src\core\include
-   * $(IGNITE_HOME)\platforms\cpp\src\core\os\win\include
-   * $(IGNITE_HOME)\platforms\cpp\src\common\include
-   * $(IGNITE_HOME)\platforms\cpp\src\common\os\win\include
-   * $(JAVA_HOME)\include
-   * $(JAVA_HOME)\include\win32
- * Update Library Directories with path to the built binaries
- * Update Linker\Input\Additional Dependencies in Project Properties with path to
-   * ignite.common.lib
-   * ignite.core.lib
- * Make sure that your application is aware about ignite.common.dll and ignite.core.dll libraries. The easiest way
-   to achieve this is to either make sure these files are in %PATH%, or to put them into the output directory of
-   your project with help of PostBuild events.

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/common/Makefile.am
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/common/Makefile.am b/modules/platform/src/main/cpp/common/Makefile.am
deleted file mode 100644
index f5ca5dd..0000000
--- a/modules/platform/src/main/cpp/common/Makefile.am
+++ /dev/null
@@ -1,45 +0,0 @@
-##
-## Licensed to the Apache Software Foundation (ASF) under one or more
-## contributor license agreements.  See the NOTICE file distributed with
-## this work for additional information regarding copyright ownership.
-## The ASF licenses this file to You under the Apache License, Version 2.0
-## (the "License"); you may not use this file except in compliance with
-## the License.  You may obtain a copy of the License at
-##
-##      http://www.apache.org/licenses/LICENSE-2.0
-##
-## Unless required by applicable law or agreed to in writing, software
-## distributed under the License is distributed on an "AS IS" BASIS,
-## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-## See the License for the specific language governing permissions and
-## limitations under the License.
-##
-
-ACLOCAL_AMFLAGS = "-Im4"
-
-SUBDIRS = . include os/linux/include
-DIST_SUBDIRS = . include os/linux/include
-
-AM_CPPFLAGS = -I$(srcdir)/include -I$(srcdir)/os/linux/include -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/linux -DIGNITE_IMPL
-AM_CXXFLAGS = -Wall -std=c++0x
-LIB_LDFLAGS = -no-undefined -version-info 1
-
-COMMON_SRC = os/linux/src/concurrent_os.cpp \
-             src/concurrent.cpp \
-             src/java.cpp \
-             src/exports.cpp \
-             os/linux/src/common.cpp
-
-lib_LTLIBRARIES = libignite-common.la
-libignite_common_la_SOURCES = $(COMMON_SRC)
-libignite_common_la_LIBADD = -L$(JAVA_HOME)/jre/lib/amd64/server
-libignite_common_la_LDFLAGS = $(LIB_LDFLAGS) -L/usr/local/lib -ljvm -version-info 0:0:0 -release $(PACKAGE_VERSION)
-
-pkgconfigdir = $(libdir)/pkgconfig
-pkgconfig_DATA = ignite-common.pc
-
-clean-local:
-	$(RM) *.gcno *.gcda
-
-clean-docs:
-	$(RM) $(DX_CLEANFILES)

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/common/configure.ac
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/common/configure.ac b/modules/platform/src/main/cpp/common/configure.ac
deleted file mode 100644
index 5cab969..0000000
--- a/modules/platform/src/main/cpp/common/configure.ac
+++ /dev/null
@@ -1,62 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-#                                               -*- Autoconf -*-
-# Process this file with autoconf to produce a configure script.
-
-AC_PREREQ([2.69])
-AC_INIT([Apache Ignite JNI bridge for C++], [1.5.0], [dev@ignite.apache.org], [ignite-common], [ignite.apache.org])
-AC_CONFIG_SRCDIR(src)
-
-AC_CANONICAL_SYSTEM
-AC_CONFIG_MACRO_DIR([m4])
-AC_LANG([C++])
-
-# Initialize automake
-AM_INIT_AUTOMAKE([-Wall foreign subdir-objects])
-AC_CONFIG_HEADER(config.h)
-
-AM_PROG_AR
-
-# Checks for programs.
-GXX="-g -O2"
-
-AC_PROG_CXX
-
-# Initialize Libtool
-LT_INIT
-
-# Checks for libraries.
-AC_CHECK_LIB([pthread], [pthread_mutex_lock])
-
-# Checks for header files.
-
-# Checks for typedefs, structures, and compiler characteristics.
-AC_C_INLINE
-AC_TYPE_INT16_T
-AC_TYPE_INT32_T
-AC_TYPE_INT64_T
-AC_TYPE_INT8_T
-AC_TYPE_PID_T
-AC_TYPE_SIZE_T
-
-# Checks for library functions.
-AC_FUNC_ERROR_AT_LINE
-
-AC_CONFIG_FILES(Makefile include/Makefile os/linux/include/Makefile ignite-common.pc)
-
-AC_OUTPUT

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/common/ignite-common.pc.in
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/common/ignite-common.pc.in b/modules/platform/src/main/cpp/common/ignite-common.pc.in
deleted file mode 100644
index b8c40d2..0000000
--- a/modules/platform/src/main/cpp/common/ignite-common.pc.in
+++ /dev/null
@@ -1,9 +0,0 @@
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-libdir=@libdir@
-includedir=@includedir@
-
-Name: ignite-common
-Description: Apache Ignite JNI bridge for C++.
-Version: @PACKAGE_VERSION@
-Libs: -L${libdir} -lignite-common

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/common/include/Makefile.am
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/common/include/Makefile.am b/modules/platform/src/main/cpp/common/include/Makefile.am
deleted file mode 100644
index 5db1d4a..0000000
--- a/modules/platform/src/main/cpp/common/include/Makefile.am
+++ /dev/null
@@ -1,22 +0,0 @@
-##
-## Licensed to the Apache Software Foundation (ASF) under one or more
-## contributor license agreements.  See the NOTICE file distributed with
-## this work for additional information regarding copyright ownership.
-## The ASF licenses this file to You under the Apache License, Version 2.0
-## (the "License"); you may not use this file except in compliance with
-## the License.  You may obtain a copy of the License at
-##
-##      http://www.apache.org/licenses/LICENSE-2.0
-##
-## Unless required by applicable law or agreed to in writing, software
-## distributed under the License is distributed on an "AS IS" BASIS,
-## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-## See the License for the specific language governing permissions and
-## limitations under the License.
-##
-
-ACLOCAL_AMFLAGS = "-Im4"
-
-nobase_include_HEADERS = ignite/common/concurrent.h \
-                         ignite/common/java.h \
-                         ignite/common/exports.h

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/common/include/ignite/common/concurrent.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/common/include/ignite/common/concurrent.h b/modules/platform/src/main/cpp/common/include/ignite/common/concurrent.h
deleted file mode 100644
index 1c9ab22..0000000
--- a/modules/platform/src/main/cpp/common/include/ignite/common/concurrent.h
+++ /dev/null
@@ -1,210 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef _IGNITE_COMMON_CONCURRENT
-#define _IGNITE_COMMON_CONCURRENT
-
-#include "ignite/common/concurrent_os.h"
-
-namespace ignite
-{
-    namespace common
-    {
-        namespace concurrent
-        {
-            /**
-             * Default deleter implementation.
-             *
-             * @param obj Object to be deleted.
-             */
-            template<typename T>
-            IGNITE_IMPORT_EXPORT void SharedPointerDefaultDeleter(T* obj)
-            {
-                delete obj;
-            }
-
-            /**
-             * Holder of shared pointer data.
-             */
-            class IGNITE_IMPORT_EXPORT SharedPointerImpl
-            {
-            public:
-                /**
-                 * Constructor.
-                 *
-                 * @param ptr Raw pointer.
-                 */
-                SharedPointerImpl(void* ptr);
-
-                /**
-                 * Get raw pointer.
-                 *
-                 * @return Raw pointer.
-                 */
-                void* Pointer();
-
-                /**
-                 * Increment usage counter.
-                 */
-                void Increment();
-
-                /**
-                 * Decrement usage counter.
-                 *
-                 * @return True if counter reached zero.
-                 */
-                bool Decrement();
-            private:
-                /** Raw pointer. */
-                void* ptr;
-
-                /** Reference count. */
-                int32_t refCnt;
-
-                IGNITE_NO_COPY_ASSIGNMENT(SharedPointerImpl)
-            };
-
-            /**
-             * Shared pointer.
-             */
-            template<typename T>
-            class IGNITE_IMPORT_EXPORT SharedPointer
-            {
-            public:
-                /**
-                 * Constructor.
-                 */
-                SharedPointer() : impl(NULL), deleter(NULL)
-                {
-                    // No-op.
-                }
-
-                /**
-                 * Constructor.
-                 *
-                 * @param ptr Raw pointer.
-                 */
-                explicit SharedPointer(T* ptr)
-                {
-                    if (ptr)
-                    {
-                        impl = new SharedPointerImpl(ptr);
-                        deleter = SharedPointerDefaultDeleter;
-                    }
-                    else
-                    {
-                        impl = NULL;
-                        deleter = NULL;
-                    }
-                }
-
-                /**
-                 * Constructor.
-                 *
-                 * @param ptr Raw pointer.
-                 * @param deleter Delete function.
-                 */
-                SharedPointer(T* ptr, void(*deleter)(T*))
-                {
-                    if (ptr)
-                    {
-                        this->impl = new SharedPointerImpl(ptr);
-                        this->deleter = deleter;
-                    }
-                    else
-                    {
-                        this->impl = NULL;
-                        this->deleter = NULL;
-                    }
-                }
-
-                /**
-                 * Copy constructor.
-                 *
-                 * @param other Instance to copy.
-                 */
-                SharedPointer(const SharedPointer& other)
-                {
-                    impl = other.impl;
-                    deleter = other.deleter;
-
-                    if (impl)
-                        impl->Increment();
-                }
-
-                /**
-                 * Assignment operator.
-                 *
-                 * @param other Other instance.
-                 */
-                SharedPointer& operator=(const SharedPointer& other)
-                {
-                    if (this != &other)
-                    {
-                        // 1. Create new instance.
-                        SharedPointer tmp(other);
-
-                        // 2. Swap with temp.
-                        SharedPointerImpl* impl0 = impl;
-                        void(*deleter0)(T*) = deleter;
-
-                        impl = tmp.impl;
-                        deleter = tmp.deleter;
-
-                        tmp.impl = impl0;
-                        tmp.deleter = deleter0;
-                    }
-
-                    return *this;
-                }
-
-                /**
-                 * Destructor.
-                 */
-                ~SharedPointer()
-                {
-                    if (impl && impl->Decrement())
-                    {
-                        T* ptr = Get();
-
-                        delete impl;
-
-                        deleter(ptr);
-                    }
-                }
-
-                /**
-                 * Get raw pointer.
-                 *
-                 * @return Raw pointer.
-                 */
-                T* Get()
-                {
-                    return impl ? static_cast<T*>(impl->Pointer()) : NULL;
-                }
-            private:
-                /** Implementation. */
-                SharedPointerImpl* impl;
-
-                /** Delete function. */
-                void(*deleter)(T*);
-            };
-        }
-    }
-}
-
-#endif
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/common/include/ignite/common/exports.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/common/include/ignite/common/exports.h b/modules/platform/src/main/cpp/common/include/ignite/common/exports.h
deleted file mode 100644
index 930fad3..0000000
--- a/modules/platform/src/main/cpp/common/include/ignite/common/exports.h
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef _IGNITE_COMMON_EXPORTS
-#define _IGNITE_COMMON_EXPORTS
-
-#include "ignite/common/java.h"
-
-namespace gcj = ignite::common::java;
-
-extern "C" {
-    int IGNITE_CALL IgniteReallocate(long long memPtr, int cap);
-
-    void* IGNITE_CALL IgniteIgnitionStart(gcj::JniContext* ctx, char* cfgPath, char* name, int factoryId, long long dataPtr);
-    void* IGNITE_CALL IgniteIgnitionInstance(gcj::JniContext* ctx, char* name);
-    long long IGNITE_CALL IgniteIgnitionEnvironmentPointer(gcj::JniContext* ctx, char* name);
-    bool IGNITE_CALL IgniteIgnitionStop(gcj::JniContext* ctx, char* name, bool cancel);
-    void IGNITE_CALL IgniteIgnitionStopAll(gcj::JniContext* ctx, bool cancel);
-
-    void IGNITE_CALL IgniteProcessorReleaseStart(gcj::JniContext* ctx, void* obj);
-    void* IGNITE_CALL IgniteProcessorProjection(gcj::JniContext* ctx, void* obj);
-    void* IGNITE_CALL IgniteProcessorCache(gcj::JniContext* ctx, void* obj, char* name);
-    void* IGNITE_CALL IgniteProcessorCreateCache(gcj::JniContext* ctx, void* obj, char* name);
-    void* IGNITE_CALL IgniteProcessorGetOrCreateCache(gcj::JniContext* ctx, void* obj, char* name);
-    void* IGNITE_CALL IgniteProcessorAffinity(gcj::JniContext* ctx, void* obj, char* name);
-    void* IGNITE_CALL IgniteProcessorDataStreamer(gcj::JniContext* ctx, void* obj, char* name, bool keepPortable);
-    void* IGNITE_CALL IgniteProcessorTransactions(gcj::JniContext* ctx, void* obj);
-    void* IGNITE_CALL IgniteProcessorCompute(gcj::JniContext* ctx, void* obj, void* prj);
-    void* IGNITE_CALL IgniteProcessorMessage(gcj::JniContext* ctx, void* obj, void* prj);
-    void* IGNITE_CALL IgniteProcessorEvents(gcj::JniContext* ctx, void* obj, void* prj);
-    void* IGNITE_CALL IgniteProcessorServices(gcj::JniContext* ctx, void* obj, void* prj);
-    void* IGNITE_CALL IgniteProcessorExtensions(gcj::JniContext* ctx, void* obj);
-    
-    long long IGNITE_CALL IgniteTargetInStreamOutLong(gcj::JniContext* ctx, void* obj, int opType, long long memPtr);
-    void IGNITE_CALL IgniteTargetInStreamOutStream(gcj::JniContext* ctx, void* obj, int opType, long long inMemPtr, long long outMemPtr);
-    void* IGNITE_CALL IgniteTargetInStreamOutObject(gcj::JniContext* ctx, void* obj, int opType, long long memPtr);
-    void IGNITE_CALL IgniteTargetInObjectStreamOutStream(gcj::JniContext* ctx, void* obj, int opType, void* arg, long long inMemPtr, long long outMemPtr);
-    long long IGNITE_CALL IgniteTargetOutLong(gcj::JniContext* ctx, void* obj, int opType);
-    void IGNITE_CALL IgniteTargetOutStream(gcj::JniContext* ctx, void* obj, int opType, long long memPtr);
-    void* IGNITE_CALL IgniteTargetOutObject(gcj::JniContext* ctx, void* obj, int opType);
-    void IGNITE_CALL IgniteTargetListenFuture(gcj::JniContext* ctx, void* obj, long long futId, int typ);
-    void IGNITE_CALL IgniteTargetListenFutureForOperation(gcj::JniContext* ctx, void* obj, long long futId, int typ, int opId);
-
-    int IGNITE_CALL IgniteAffinityPartitions(gcj::JniContext* ctx, void* obj);
-
-    void* IGNITE_CALL IgniteCacheWithSkipStore(gcj::JniContext* ctx, void* obj);
-    void* IGNITE_CALL IgniteCacheWithNoRetries(gcj::JniContext* ctx, void* obj);
-    void* IGNITE_CALL IgniteCacheWithExpiryPolicy(gcj::JniContext* ctx, void* obj, long long create, long long update, long long access);
-    void* IGNITE_CALL IgniteCacheWithAsync(gcj::JniContext* ctx, void* obj);
-    void* IGNITE_CALL IgniteCacheWithKeepPortable(gcj::JniContext* ctx, void* obj);
-    void IGNITE_CALL IgniteCacheClear(gcj::JniContext* ctx, void* obj);
-    void IGNITE_CALL IgniteCacheRemoveAll(gcj::JniContext* ctx, void* obj);
-    void* IGNITE_CALL IgniteCacheOutOpQueryCursor(gcj::JniContext* ctx, void* obj, int type, long long memPtr);
-    void* IGNITE_CALL IgniteCacheOutOpContinuousQuery(gcj::JniContext* ctx, void* obj, int type, long long memPtr);
-    void* IGNITE_CALL IgniteCacheIterator(gcj::JniContext* ctx, void* obj);
-    void* IGNITE_CALL IgniteCacheLocalIterator(gcj::JniContext* ctx, void* obj, int peekModes);
-    void IGNITE_CALL IgniteCacheEnterLock(gcj::JniContext* ctx, void* obj, long long id);
-    void IGNITE_CALL IgniteCacheExitLock(gcj::JniContext* ctx, void* obj, long long id);
-    bool IGNITE_CALL IgniteCacheTryEnterLock(gcj::JniContext* ctx, void* obj, long long id, long long timeout);
-    void IGNITE_CALL IgniteCacheCloseLock(gcj::JniContext* ctx, void* obj, long long id);
-    void IGNITE_CALL IgniteCacheRebalance(gcj::JniContext* ctx, void* obj, long long futId);
-    int IGNITE_CALL IgniteCacheSize(gcj::JniContext* ctx, void* obj, int peekModes, bool loc);
-
-    void IGNITE_CALL IgniteCacheStoreCallbackInvoke(gcj::JniContext* ctx, void* obj, long long memPtr);
-
-    void IGNITE_CALL IgniteComputeWithNoFailover(gcj::JniContext* ctx, void* obj);
-    void IGNITE_CALL IgniteComputeWithTimeout(gcj::JniContext* ctx, void* obj, long long timeout);
-    void IGNITE_CALL IgniteComputeExecuteNative(gcj::JniContext* ctx, void* obj, long long taskPtr, long long topVer);
-
-    void IGNITE_CALL IgniteContinuousQueryClose(gcj::JniContext* ctx, void* obj);
-    void* IGNITE_CALL IgniteContinuousQueryGetInitialQueryCursor(gcj::JniContext* ctx, void* obj);
-
-    void IGNITE_CALL IgniteDataStreamerListenTopology(gcj::JniContext* ctx, void* obj, long long ptr);
-    bool IGNITE_CALL IgniteDataStreamerAllowOverwriteGet(gcj::JniContext* ctx, void* obj);
-    void IGNITE_CALL IgniteDataStreamerAllowOverwriteSet(gcj::JniContext* ctx, void* obj, bool val);
-    bool IGNITE_CALL IgniteDataStreamerSkipStoreGet(gcj::JniContext* ctx, void* obj);
-    void IGNITE_CALL IgniteDataStreamerSkipStoreSet(gcj::JniContext* ctx, void* obj, bool val);
-    int IGNITE_CALL IgniteDataStreamerPerNodeBufferSizeGet(gcj::JniContext* ctx, void* obj);
-    void IGNITE_CALL IgniteDataStreamerPerNodeBufferSizeSet(gcj::JniContext* ctx, void* obj, int val);
-    int IGNITE_CALL IgniteDataStreamerPerNodeParallelOperationsGet(gcj::JniContext* ctx, void* obj);
-    void IGNITE_CALL IgniteDataStreamerPerNodeParallelOperationsSet(gcj::JniContext* ctx, void* obj, int val);
-
-    void* IGNITE_CALL IgniteMessagingWithAsync(gcj::JniContext* ctx, void* obj);
-
-    void* IGNITE_CALL IgniteProjectionForOthers(gcj::JniContext* ctx, void* obj, void* prj);
-    void* IGNITE_CALL IgniteProjectionForRemotes(gcj::JniContext* ctx, void* obj);
-    void* IGNITE_CALL IgniteProjectionForDaemons(gcj::JniContext* ctx, void* obj);
-    void* IGNITE_CALL IgniteProjectionForRandom(gcj::JniContext* ctx, void* obj);
-    void* IGNITE_CALL IgniteProjectionForOldest(gcj::JniContext* ctx, void* obj);
-    void* IGNITE_CALL IgniteProjectionForYoungest(gcj::JniContext* ctx, void* obj);
-    void IGNITE_CALL IgniteProjectionResetMetrics(gcj::JniContext* ctx, void* obj);
-    void* IGNITE_CALL IgniteProjectionOutOpRet(gcj::JniContext* ctx, void* obj, int type, long long memPtr);
-
-    void IGNITE_CALL IgniteQueryCursorIterator(gcj::JniContext* ctx, void* obj);
-    void IGNITE_CALL IgniteQueryCursorClose(gcj::JniContext* ctx, void* obj);
-
-    long long IGNITE_CALL IgniteTransactionsStart(gcj::JniContext* ctx, void* obj, int concurrency, int isolation, long long timeout, int txSize);
-    int IGNITE_CALL IgniteTransactionsCommit(gcj::JniContext* ctx, void* obj, long long id);
-    void IGNITE_CALL IgniteTransactionsCommitAsync(gcj::JniContext* ctx, void* obj, long long id, long long futId);
-    int IGNITE_CALL IgniteTransactionsRollback(gcj::JniContext* ctx, void* obj, long long id);
-    void IGNITE_CALL IgniteTransactionsRollbackAsync(gcj::JniContext* ctx, void* obj, long long id, long long futId);
-    int IGNITE_CALL IgniteTransactionsClose(gcj::JniContext* ctx, void* obj, long long id);
-    int IGNITE_CALL IgniteTransactionsState(gcj::JniContext* ctx, void* obj, long long id);
-    bool IGNITE_CALL IgniteTransactionsSetRollbackOnly(gcj::JniContext* ctx, void* obj, long long id);
-    void IGNITE_CALL IgniteTransactionsResetMetrics(gcj::JniContext* ctx, void* obj);
-
-    void* IGNITE_CALL IgniteAcquire(gcj::JniContext* ctx, void* obj);
-    void IGNITE_CALL IgniteRelease(void* obj);
-
-    void IGNITE_CALL IgniteThrowToJava(gcj::JniContext* ctx, char* errMsg);
-    
-    int IGNITE_CALL IgniteHandlersSize();
-
-    void* IGNITE_CALL IgniteCreateContext(char** opts, int optsLen, gcj::JniHandlers* cbs);
-    void IGNITE_CALL IgniteDeleteContext(gcj::JniContext* ctx);
-
-    void IGNITE_CALL IgniteDestroyJvm(gcj::JniContext* ctx);
-
-    void* IGNITE_CALL IgniteEventsWithAsync(gcj::JniContext* ctx, void* obj);
-    bool IGNITE_CALL IgniteEventsStopLocalListen(gcj::JniContext* ctx, void* obj, long long hnd);
-    void IGNITE_CALL IgniteEventsLocalListen(gcj::JniContext* ctx, void* obj, long long hnd, int type);
-    bool IGNITE_CALL IgniteEventsIsEnabled(gcj::JniContext* ctx, void* obj, int type);
-        
-	void* IGNITE_CALL IgniteServicesWithAsync(gcj::JniContext* ctx, void* obj);
-	void* IGNITE_CALL IgniteServicesWithServerKeepPortable(gcj::JniContext* ctx, void* obj);
-	void IGNITE_CALL IgniteServicesCancel(gcj::JniContext* ctx, void* obj, char* name);
-	void IGNITE_CALL IgniteServicesCancelAll(gcj::JniContext* ctx, void* obj);
-	void* IGNITE_CALL IgniteServicesGetServiceProxy(gcj::JniContext* ctx, void* obj, char* name, bool sticky);
-}
-
-#endif
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/common/include/ignite/common/java.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/common/include/ignite/common/java.h b/modules/platform/src/main/cpp/common/include/ignite/common/java.h
deleted file mode 100644
index 01ecbe3..0000000
--- a/modules/platform/src/main/cpp/common/include/ignite/common/java.h
+++ /dev/null
@@ -1,652 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef _IGNITE_COMMON_JVM
-#define _IGNITE_COMMON_JVM
-
-#include <jni.h>
-
-#include "ignite/common/common.h"
-
-namespace ignite
-{
-    namespace common
-    {
-        namespace java
-        {
-            /* Error constants. */
-            const int IGNITE_JNI_ERR_SUCCESS = 0;
-            const int IGNITE_JNI_ERR_GENERIC = 1;
-            const int IGNITE_JNI_ERR_JVM_INIT = 2;
-            const int IGNITE_JNI_ERR_JVM_ATTACH = 3;
-
-            /* Handlers for callbacks from Java. */
-            typedef long long(JNICALL *CacheStoreCreateHandler)(void* target, long long memPtr);
-            typedef int(JNICALL *CacheStoreInvokeHandler)(void* target, long long objPtr, long long memPtr, void* cb);
-            typedef void(JNICALL *CacheStoreDestroyHandler)(void* target, long long objPtr);
-            typedef long long(JNICALL *CacheStoreSessionCreateHandler)(void* target, long long storePtr);
-
-            typedef long long(JNICALL *CacheEntryFilterCreateHandler)(void* target, long long memPtr);
-            typedef int(JNICALL *CacheEntryFilterApplyHandler)(void* target, long long ptr, long long memPtr);
-            typedef void(JNICALL *CacheEntryFilterDestroyHandler)(void* target, long long ptr);
-
-            typedef void(JNICALL *CacheInvokeHandler)(void* target, long long inMemPtr, long long outMemPtr);
-
-            typedef void(JNICALL *ComputeTaskMapHandler)(void* target, long long taskPtr, long long inMemPtr, long long outMemPtr);
-            typedef int(JNICALL *ComputeTaskJobResultHandler)(void* target, long long taskPtr, long long jobPtr, long long memPtr);
-            typedef void(JNICALL *ComputeTaskReduceHandler)(void* target, long long taskPtr);
-            typedef void(JNICALL *ComputeTaskCompleteHandler)(void* target, long long taskPtr, long long memPtr);
-            typedef int(JNICALL *ComputeJobSerializeHandler)(void* target, long long jobPtr, long long memPtr);
-            typedef long long(JNICALL *ComputeJobCreateHandler)(void* target, long long memPtr);
-            typedef void(JNICALL *ComputeJobExecuteHandler)(void* target, long long jobPtr, int cancel, long long memPtr);
-            typedef void(JNICALL *ComputeJobCancelHandler)(void* target, long long jobPtr);
-            typedef void(JNICALL *ComputeJobDestroyHandler)(void* target, long long jobPtr);
-
-            typedef void(JNICALL *ContinuousQueryListenerApplyHandler)(void* target, long long lsnrPtr, long long memPtr);
-            typedef long long(JNICALL *ContinuousQueryFilterCreateHandler)(void* target, long long memPtr);
-            typedef int(JNICALL *ContinuousQueryFilterApplyHandler)(void* target, long long filterPtr, long long memPtr);
-            typedef void(JNICALL *ContinuousQueryFilterReleaseHandler)(void* target, long long filterPtr);
-
-			typedef void(JNICALL *DataStreamerTopologyUpdateHandler)(void* target, long long ldrPtr, long long topVer, int topSize);
-			typedef void(JNICALL *DataStreamerStreamReceiverInvokeHandler)(void* target, long long ptr, void* cache, long long memPtr, unsigned char keepPortable);
-
-            typedef void(JNICALL *FutureByteResultHandler)(void* target, long long futAddr, int res);
-            typedef void(JNICALL *FutureBoolResultHandler)(void* target, long long futAddr, int res);
-            typedef void(JNICALL *FutureShortResultHandler)(void* target, long long futAddr, int res);
-            typedef void(JNICALL *FutureCharResultHandler)(void* target, long long futAddr, int res);
-            typedef void(JNICALL *FutureIntResultHandler)(void* target, long long futAddr, int res);
-            typedef void(JNICALL *FutureFloatResultHandler)(void* target, long long futAddr, float res);
-            typedef void(JNICALL *FutureLongResultHandler)(void* target, long long futAddr, long long res);
-            typedef void(JNICALL *FutureDoubleResultHandler)(void* target, long long futAddr, double res);
-            typedef void(JNICALL *FutureObjectResultHandler)(void* target, long long futAddr, long long memPtr);
-            typedef void(JNICALL *FutureNullResultHandler)(void* target, long long futAddr);
-            typedef void(JNICALL *FutureErrorHandler)(void* target, long long futAddr, long long memPtr);
-
-            typedef void(JNICALL *LifecycleEventHandler)(void* target, long long ptr, int evt);
-
-            typedef void(JNICALL *MemoryReallocateHandler)(void* target, long long memPtr, int cap);
-
-            typedef long long(JNICALL *MessagingFilterCreateHandler)(void* target, long long memPtr);
-            typedef int(JNICALL *MessagingFilterApplyHandler)(void* target, long long ptr, long long memPtr);
-            typedef void(JNICALL *MessagingFilterDestroyHandler)(void* target, long long ptr);
-
-            typedef long long(JNICALL *EventFilterCreateHandler)(void* target, long long memPtr);
-            typedef int(JNICALL *EventFilterApplyHandler)(void* target, long long ptr, long long memPtr);
-            typedef void(JNICALL *EventFilterDestroyHandler)(void* target, long long ptr);
-
-			typedef long long(JNICALL *ServiceInitHandler)(void* target, long long memPtr);
-			typedef void(JNICALL *ServiceExecuteHandler)(void* target, long long svcPtr, long long memPtr);
-			typedef void(JNICALL *ServiceCancelHandler)(void* target, long long svcPtr, long long memPtr);
-			typedef void(JNICALL *ServiceInvokeMethodHandler)(void* target, long long svcPtr, long long inMemPtr, long long outMemPtr);
-			typedef int(JNICALL *ClusterNodeFilterApplyHandler)(void* target, long long memPtr);
-
-            typedef long long(JNICALL *NodeInfoHandler)(void* target, long long memPtr);
-
-            typedef void(JNICALL *OnStartHandler)(void* target, void* proc, long long memPtr);
-            typedef void(JNICALL *OnStopHandler)(void* target);
-            typedef void(JNICALL *ErrorHandler)(void* target, int errCode, const char* errClsChars, int errClsCharsLen, const char* errMsgChars, int errMsgCharsLen, void* errData, int errDataLen);
-
-            typedef long long(JNICALL *ExtensionCallbackInLongOutLongHandler)(void* target, int typ, long long arg1);
-            typedef long long(JNICALL *ExtensionCallbackInLongLongOutLongHandler)(void* target, int typ, long long arg1, long long arg2);
-
-            /**
-             * JNI handlers holder.
-             */
-            struct JniHandlers {
-                void* target;
-
-                CacheStoreCreateHandler cacheStoreCreate;
-                CacheStoreInvokeHandler cacheStoreInvoke;
-                CacheStoreDestroyHandler cacheStoreDestroy;
-                CacheStoreSessionCreateHandler cacheStoreSessionCreate;
-
-                CacheEntryFilterCreateHandler cacheEntryFilterCreate;
-                CacheEntryFilterApplyHandler cacheEntryFilterApply;
-                CacheEntryFilterDestroyHandler cacheEntryFilterDestroy;
-
-                CacheInvokeHandler cacheInvoke;
-
-                ComputeTaskMapHandler computeTaskMap;
-                ComputeTaskJobResultHandler computeTaskJobRes;
-                ComputeTaskReduceHandler computeTaskReduce;
-                ComputeTaskCompleteHandler computeTaskComplete;
-                ComputeJobSerializeHandler computeJobSerialize;
-                ComputeJobCreateHandler computeJobCreate;
-                ComputeJobExecuteHandler computeJobExec;
-                ComputeJobCancelHandler computeJobCancel;
-                ComputeJobDestroyHandler computeJobDestroy;
-
-                ContinuousQueryListenerApplyHandler contQryLsnrApply;
-                ContinuousQueryFilterCreateHandler contQryFilterCreate;
-                ContinuousQueryFilterApplyHandler contQryFilterApply;
-                ContinuousQueryFilterReleaseHandler contQryFilterRelease;
-
-				DataStreamerTopologyUpdateHandler dataStreamerTopologyUpdate;
-				DataStreamerStreamReceiverInvokeHandler streamReceiverInvoke;
-
-                FutureByteResultHandler futByteRes;
-                FutureBoolResultHandler futBoolRes;
-                FutureShortResultHandler futShortRes;
-                FutureCharResultHandler futCharRes;
-                FutureIntResultHandler futIntRes;
-                FutureFloatResultHandler futFloatRes;
-                FutureLongResultHandler futLongRes;
-                FutureDoubleResultHandler futDoubleRes;
-                FutureObjectResultHandler futObjRes;
-                FutureNullResultHandler futNullRes;
-                FutureErrorHandler futErr;
-
-                LifecycleEventHandler lifecycleEvt;
-
-                MemoryReallocateHandler memRealloc;
-
-                MessagingFilterCreateHandler messagingFilterCreate;
-                MessagingFilterApplyHandler messagingFilterApply;
-                MessagingFilterDestroyHandler messagingFilterDestroy;
-                
-                EventFilterCreateHandler eventFilterCreate;
-                EventFilterApplyHandler eventFilterApply;
-                EventFilterDestroyHandler eventFilterDestroy;
-
-				ServiceInitHandler serviceInit;
-				ServiceExecuteHandler serviceExecute;
-				ServiceCancelHandler serviceCancel;
-				ServiceInvokeMethodHandler serviceInvokeMethod;
-				
-				ClusterNodeFilterApplyHandler clusterNodeFilterApply;
-
-                NodeInfoHandler nodeInfo;
-
-                OnStartHandler onStart;
-                OnStopHandler onStop;
-                ErrorHandler error;
-
-                ExtensionCallbackInLongOutLongHandler extensionCallbackInLongOutLong;
-                ExtensionCallbackInLongLongOutLongHandler extensionCallbackInLongLongOutLong;
-            };
-
-            /**
-             * JNI Java members.
-             */
-            struct JniJavaMembers {
-                jclass c_Class;
-                jmethodID m_Class_getName;
-
-                jclass c_Throwable;
-                jmethodID m_Throwable_getMessage;
-                jmethodID m_Throwable_printStackTrace;
-
-                /**
-                 * Constructor.
-                 */
-                void Initialize(JNIEnv* env);
-
-                /**
-                 * Destroy members releasing all allocated classes.
-                 */
-                void Destroy(JNIEnv* env);
-
-                /**
-                 * Write error information.
-                 */
-                bool WriteErrorInfo(JNIEnv* env, char** errClsName, int* errClsNameLen, char** errMsg, int* errMsgLen);
-            };
-
-            /**
-             * JNI members.
-             */
-            struct JniMembers {
-                jclass c_PlatformAbstractQryCursor;
-                jmethodID m_PlatformAbstractQryCursor_iter;
-                jmethodID m_PlatformAbstractQryCursor_iterHasNext;
-                jmethodID m_PlatformAbstractQryCursor_close;
-
-                jclass c_PlatformAffinity;
-                jmethodID m_PlatformAffinity_partitions;
-
-                jclass c_PlatformCache;
-                jmethodID m_PlatformCache_withSkipStore;
-                jmethodID m_PlatformCache_withNoRetries;
-                jmethodID m_PlatformCache_withExpiryPolicy;
-                jmethodID m_PlatformCache_withAsync;
-                jmethodID m_PlatformCache_withKeepPortable;
-                jmethodID m_PlatformCache_clear;
-                jmethodID m_PlatformCache_removeAll;
-                jmethodID m_PlatformCache_iterator;
-                jmethodID m_PlatformCache_localIterator;
-                jmethodID m_PlatformCache_enterLock;
-                jmethodID m_PlatformCache_exitLock;
-                jmethodID m_PlatformCache_tryEnterLock;
-                jmethodID m_PlatformCache_closeLock;
-                jmethodID m_PlatformCache_rebalance;
-                jmethodID m_PlatformCache_size;
-
-                jclass c_PlatformCacheStoreCallback;
-                jmethodID m_PlatformCacheStoreCallback_invoke;
-
-                jclass c_IgniteException;
-
-                jclass c_PlatformClusterGroup;
-                jmethodID m_PlatformClusterGroup_forOthers;
-                jmethodID m_PlatformClusterGroup_forRemotes;
-                jmethodID m_PlatformClusterGroup_forDaemons;
-                jmethodID m_PlatformClusterGroup_forRandom;
-                jmethodID m_PlatformClusterGroup_forOldest;
-                jmethodID m_PlatformClusterGroup_forYoungest;
-                jmethodID m_PlatformClusterGroup_resetMetrics;
-
-                jclass c_PlatformCompute;
-                jmethodID m_PlatformCompute_withNoFailover;
-                jmethodID m_PlatformCompute_withTimeout;
-                jmethodID m_PlatformCompute_executeNative;
-
-                jclass c_PlatformContinuousQuery;
-                jmethodID m_PlatformContinuousQuery_close;
-                jmethodID m_PlatformContinuousQuery_getInitialQueryCursor;
-
-                jclass c_PlatformDataStreamer;
-                jmethodID m_PlatformDataStreamer_listenTopology;
-                jmethodID m_PlatformDataStreamer_getAllowOverwrite;
-                jmethodID m_PlatformDataStreamer_setAllowOverwrite;
-                jmethodID m_PlatformDataStreamer_getSkipStore;
-                jmethodID m_PlatformDataStreamer_setSkipStore;
-                jmethodID m_PlatformDataStreamer_getPerNodeBufSize;
-                jmethodID m_PlatformDataStreamer_setPerNodeBufSize;
-                jmethodID m_PlatformDataStreamer_getPerNodeParallelOps;
-                jmethodID m_PlatformDataStreamer_setPerNodeParallelOps;
-                
-                jclass c_PlatformEvents;
-                jmethodID m_PlatformEvents_withAsync;
-                jmethodID m_PlatformEvents_stopLocalListen;
-                jmethodID m_PlatformEvents_localListen;
-                jmethodID m_PlatformEvents_isEnabled;
-                
-				jclass c_PlatformServices;
-				jmethodID m_PlatformServices_withAsync;
-				jmethodID m_PlatformServices_withServerKeepPortable;
-				jmethodID m_PlatformServices_cancel;
-				jmethodID m_PlatformServices_cancelAll;
-				jmethodID m_PlatformServices_serviceProxy;
-
-				jclass c_PlatformIgnition;
-                jmethodID m_PlatformIgnition_start;
-                jmethodID m_PlatformIgnition_instance;
-                jmethodID m_PlatformIgnition_environmentPointer;
-                jmethodID m_PlatformIgnition_stop;
-                jmethodID m_PlatformIgnition_stopAll;
-
-                jclass c_PlatformMessaging;
-                jmethodID m_PlatformMessaging_withAsync;
-
-                jclass c_PlatformProcessor;
-                jmethodID m_PlatformProcessor_releaseStart;
-                jmethodID m_PlatformProcessor_cache;
-                jmethodID m_PlatformProcessor_createCache;
-                jmethodID m_PlatformProcessor_getOrCreateCache;
-                jmethodID m_PlatformProcessor_affinity;
-                jmethodID m_PlatformProcessor_dataStreamer;
-                jmethodID m_PlatformProcessor_transactions;
-                jmethodID m_PlatformProcessor_projection;
-                jmethodID m_PlatformProcessor_compute;
-                jmethodID m_PlatformProcessor_message;
-                jmethodID m_PlatformProcessor_events;
-                jmethodID m_PlatformProcessor_services;
-                jmethodID m_PlatformProcessor_extensions;
-
-                jclass c_PlatformTarget;
-                jmethodID m_PlatformTarget_inStreamOutLong;
-                jmethodID m_PlatformTarget_inStreamOutObject;
-                jmethodID m_PlatformTarget_outLong;
-                jmethodID m_PlatformTarget_outStream;
-                jmethodID m_PlatformTarget_outObject;
-                jmethodID m_PlatformTarget_inStreamOutStream;
-                jmethodID m_PlatformTarget_inObjectStreamOutStream;
-                jmethodID m_PlatformTarget_listenFuture;
-                jmethodID m_PlatformTarget_listenFutureForOperation;
-
-                jclass c_PlatformTransactions;
-                jmethodID m_PlatformTransactions_txStart;
-                jmethodID m_PlatformTransactions_txCommit;
-                jmethodID m_PlatformTransactions_txCommitAsync;
-                jmethodID m_PlatformTransactions_txRollback;
-                jmethodID m_PlatformTransactions_txRollbackAsync;
-                jmethodID m_PlatformTransactions_txState;
-                jmethodID m_PlatformTransactions_txSetRollbackOnly;
-                jmethodID m_PlatformTransactions_txClose;
-                jmethodID m_PlatformTransactions_resetMetrics;
-
-                jclass c_PlatformUtils;
-                jmethodID m_PlatformUtils_reallocate;
-                jmethodID m_PlatformUtils_errData;
-
-                /**
-                 * Constructor.
-                 */
-                void Initialize(JNIEnv* env);
-
-                /**
-                 * Destroy members releasing all allocated classes.
-                 */
-                void Destroy(JNIEnv* env);
-            };
-
-            /**
-             * JNI JVM wrapper.
-             */
-            class IGNITE_IMPORT_EXPORT JniJvm {
-            public:
-                /**
-                 * Default constructor for uninitialized JVM.
-                 */
-                JniJvm();
-
-                /**
-                 * Constructor.
-                 *
-                 * @param jvm JVM.
-                 * @param javaMembers Java members.
-                 * @param members Members.
-                 */
-                JniJvm(JavaVM* jvm, JniJavaMembers javaMembers, JniMembers members);
-
-                /**
-                 * Get JVM.
-                 *
-                 * @param JVM.
-                 */
-                JavaVM* GetJvm();
-
-                /**
-                 * Get Java members.
-                 *
-                 * @param Java members.
-                 */
-                JniJavaMembers& GetJavaMembers();
-
-                /**
-                 * Get members.
-                 *
-                 * @param Members.
-                 */
-                JniMembers& GetMembers();
-            private:
-                /** JVM. */
-                JavaVM* jvm;
-
-                /** Java members. */
-                JniJavaMembers javaMembers;
-
-                /** Members. */
-                JniMembers members;
-            };
-
-            /**
-             * JNI error information.
-             */
-            struct IGNITE_IMPORT_EXPORT JniErrorInfo
-            {
-                int code;
-                char* errCls;
-                char* errMsg;
-
-                /**
-                 * Default constructor. Creates empty error info.
-                 */
-                JniErrorInfo();
-
-                /**
-                 * Constructor.
-                 *
-                 * @param code Code.
-                 * @param errCls Error class.
-                 * @param errMsg Error message.
-                 */
-                JniErrorInfo(int code, const char* errCls, const char* errMsg);
-
-                /**
-                 * Copy constructor.
-                 *
-                 * @param other Other instance.
-                 */
-                JniErrorInfo(const JniErrorInfo& other);
-
-                /**
-                 * Assignment operator overload.
-                 *
-                 * @param other Other instance.
-                 * @return This instance.
-                 */
-                JniErrorInfo& operator=(const JniErrorInfo& other);
-
-                /**
-                 * Destructor.
-                 */
-                ~JniErrorInfo();
-            };
-
-            /**
-             * Unmanaged context.
-             */
-            class IGNITE_IMPORT_EXPORT JniContext {
-            public:
-                static JniContext* Create(char** opts, int optsLen, JniHandlers hnds);
-                static JniContext* Create(char** opts, int optsLen, JniHandlers hnds, JniErrorInfo* errInfo);
-                static int Reallocate(long long memPtr, int cap);
-                static void Detach();
-                static void Release(jobject obj);
-
-                jobject IgnitionStart(char* cfgPath, char* name, int factoryId, long long dataPtr);
-                jobject IgnitionStart(char* cfgPath, char* name, int factoryId, long long dataPtr, JniErrorInfo* errInfo);
-                jobject IgnitionInstance(char* name);
-                jobject IgnitionInstance(char* name, JniErrorInfo* errInfo);
-                long long IgnitionEnvironmentPointer(char* name);
-                long long IgnitionEnvironmentPointer(char* name, JniErrorInfo* errInfo);
-                bool IgnitionStop(char* name, bool cancel);
-                bool IgnitionStop(char* name, bool cancel, JniErrorInfo* errInfo);
-                void IgnitionStopAll(bool cancel);
-                void IgnitionStopAll(bool cancel, JniErrorInfo* errInfo);
-                
-                void ProcessorReleaseStart(jobject obj);
-                jobject ProcessorProjection(jobject obj);
-                jobject ProcessorCache(jobject obj, const char* name);
-                jobject ProcessorCache(jobject obj, const char* name, JniErrorInfo* errInfo);
-                jobject ProcessorCreateCache(jobject obj, const char* name);
-                jobject ProcessorCreateCache(jobject obj, const char* name, JniErrorInfo* errInfo);
-                jobject ProcessorGetOrCreateCache(jobject obj, const char* name);
-                jobject ProcessorGetOrCreateCache(jobject obj, const char* name, JniErrorInfo* errInfo);
-                jobject ProcessorAffinity(jobject obj, const char* name);
-                jobject ProcessorDataStreamer(jobject obj, const char* name, bool keepPortable);
-                jobject ProcessorTransactions(jobject obj);
-                jobject ProcessorCompute(jobject obj, jobject prj);
-                jobject ProcessorMessage(jobject obj, jobject prj);
-                jobject ProcessorEvents(jobject obj, jobject prj);
-                jobject ProcessorServices(jobject obj, jobject prj);
-                jobject ProcessorExtensions(jobject obj);
-                
-                long long TargetInStreamOutLong(jobject obj, int type, long long memPtr, JniErrorInfo* errInfo = NULL);
-                void TargetInStreamOutStream(jobject obj, int opType, long long inMemPtr, long long outMemPtr, JniErrorInfo* errInfo = NULL);
-                jobject TargetInStreamOutObject(jobject obj, int type, long long memPtr, JniErrorInfo* errInfo = NULL);
-                void TargetInObjectStreamOutStream(jobject obj, int opType, void* arg, long long inMemPtr, long long outMemPtr, JniErrorInfo* errInfo = NULL);
-                long long TargetOutLong(jobject obj, int opType, JniErrorInfo* errInfo = NULL);
-                void TargetOutStream(jobject obj, int opType, long long memPtr, JniErrorInfo* errInfo = NULL);
-                jobject TargetOutObject(jobject obj, int opType, JniErrorInfo* errInfo = NULL);
-                void TargetListenFuture(jobject obj, long long futId, int typ);
-                void TargetListenFutureForOperation(jobject obj, long long futId, int typ, int opId);
-                
-                int AffinityPartitions(jobject obj);
-
-                jobject CacheWithSkipStore(jobject obj);
-                jobject CacheWithNoRetries(jobject obj);
-                jobject CacheWithExpiryPolicy(jobject obj, long long create, long long update, long long access);
-                jobject CacheWithAsync(jobject obj);
-                jobject CacheWithKeepPortable(jobject obj);
-                void CacheClear(jobject obj, JniErrorInfo* errInfo = NULL);
-                void CacheRemoveAll(jobject obj, JniErrorInfo* errInfo = NULL);
-                jobject CacheOutOpQueryCursor(jobject obj, int type, long long memPtr, JniErrorInfo* errInfo = NULL);
-                jobject CacheOutOpContinuousQuery(jobject obj, int type, long long memPtr);
-                jobject CacheIterator(jobject obj);
-                jobject CacheLocalIterator(jobject obj, int peekModes);
-                void CacheEnterLock(jobject obj, long long id);
-                void CacheExitLock(jobject obj, long long id);
-                bool CacheTryEnterLock(jobject obj, long long id, long long timeout);
-                void CacheCloseLock(jobject obj, long long id);
-                void CacheRebalance(jobject obj, long long futId);
-                int CacheSize(jobject obj, int peekModes, bool loc, JniErrorInfo* errInfo = NULL);
-
-                void CacheStoreCallbackInvoke(jobject obj, long long memPtr);
-
-                void ComputeWithNoFailover(jobject obj);
-                void ComputeWithTimeout(jobject obj, long long timeout);
-                void ComputeExecuteNative(jobject obj, long long taskPtr, long long topVer);
-
-                void ContinuousQueryClose(jobject obj);
-                void* ContinuousQueryGetInitialQueryCursor(jobject obj);
-
-                void DataStreamerListenTopology(jobject obj, long long ptr);
-                bool DataStreamerAllowOverwriteGet(jobject obj);
-                void DataStreamerAllowOverwriteSet(jobject obj, bool val);
-                bool DataStreamerSkipStoreGet(jobject obj);
-                void DataStreamerSkipStoreSet(jobject obj, bool val);
-                int DataStreamerPerNodeBufferSizeGet(jobject obj);
-                void DataStreamerPerNodeBufferSizeSet(jobject obj, int val);
-                int DataStreamerPerNodeParallelOperationsGet(jobject obj);
-                void DataStreamerPerNodeParallelOperationsSet(jobject obj, int val);
-
-                jobject MessagingWithAsync(jobject obj);
-
-                jobject ProjectionForOthers(jobject obj, jobject prj);
-                jobject ProjectionForRemotes(jobject obj);
-                jobject ProjectionForDaemons(jobject obj);
-                jobject ProjectionForRandom(jobject obj);
-                jobject ProjectionForOldest(jobject obj);
-                jobject ProjectionForYoungest(jobject obj);
-                void ProjectionResetMetrics(jobject obj);
-                jobject ProjectionOutOpRet(jobject obj, int type, long long memPtr);
-
-                void QueryCursorIterator(jobject obj, JniErrorInfo* errInfo = NULL);
-                bool QueryCursorIteratorHasNext(jobject obj, JniErrorInfo* errInfo = NULL);
-                void QueryCursorClose(jobject obj, JniErrorInfo* errInfo = NULL);
-
-                long long TransactionsStart(jobject obj, int concurrency, int isolation, long long timeout, int txSize);
-                int TransactionsCommit(jobject obj, long long id);
-                void TransactionsCommitAsync(jobject obj, long long id, long long futId);
-                int TransactionsRollback(jobject obj, long long id);
-                void TransactionsRollbackAsync(jobject obj, long long id, long long futId);
-                int TransactionsClose(jobject obj, long long id);
-                int TransactionsState(jobject obj, long long id);
-                bool TransactionsSetRollbackOnly(jobject obj, long long id);
-                void TransactionsResetMetrics(jobject obj);
-
-                jobject EventsWithAsync(jobject obj);
-                bool EventsStopLocalListen(jobject obj, long long hnd);
-                void EventsLocalListen(jobject obj, long long hnd, int type);
-                bool EventsIsEnabled(jobject obj, int type);
-                
-				jobject ServicesWithAsync(jobject obj);
-                jobject ServicesWithServerKeepPortable(jobject obj);
-				void ServicesCancel(jobject obj, char* name);
-				void ServicesCancelAll(jobject obj);
-				void* ServicesGetServiceProxy(jobject obj, char* name, bool sticky);
-
-                jobject Acquire(jobject obj);
-
-                void DestroyJvm();
-                void ThrowToJava(char* errMsg);
-            private:
-                JniJvm* jvm;
-                JniHandlers hnds;
-
-                JniContext(JniJvm* jvm, JniHandlers hnds);
-
-                JNIEnv* Attach();
-                void ExceptionCheck(JNIEnv* env);
-                void ExceptionCheck(JNIEnv* env, JniErrorInfo* errInfo);
-                jobject LocalToGlobal(JNIEnv* env, jobject obj);
-                jobject ProcessorCache0(jobject proc, const char* name, jmethodID mthd, JniErrorInfo* errInfo);
-            };
-
-            JNIEXPORT jlong JNICALL JniCacheStoreCreate(JNIEnv *env, jclass cls, jlong envPtr, jlong memPtr);
-            JNIEXPORT jint JNICALL JniCacheStoreInvoke(JNIEnv *env, jclass cls, jlong envPtr, jlong objPtr, jlong memPtr, jobject cb);
-            JNIEXPORT void JNICALL JniCacheStoreDestroy(JNIEnv *env, jclass cls, jlong envPtr, jlong objPtr);
-            JNIEXPORT jlong JNICALL JniCacheStoreSessionCreate(JNIEnv *env, jclass cls, jlong envPtr, jlong storePtr);
-
-            JNIEXPORT jlong JNICALL JniCacheEntryFilterCreate(JNIEnv *env, jclass cls, jlong envPtr, jlong memPtr);
-            JNIEXPORT jint JNICALL JniCacheEntryFilterApply(JNIEnv *env, jclass cls, jlong envPtr, jlong objPtr, jlong memPtr);
-            JNIEXPORT void JNICALL JniCacheEntryFilterDestroy(JNIEnv *env, jclass cls, jlong envPtr, jlong objPtr);
-
-            JNIEXPORT void JNICALL JniCacheInvoke(JNIEnv *env, jclass cls, jlong envPtr, jlong inMemPtr, jlong outMemPtr);
-
-            JNIEXPORT void JNICALL JniComputeTaskMap(JNIEnv *env, jclass cls, jlong envPtr, jlong taskPtr, jlong inMemPtr, jlong outMemPtr);
-            JNIEXPORT jint JNICALL JniComputeTaskJobResult(JNIEnv *env, jclass cls, jlong envPtr, jlong taskPtr, jlong jobPtr, jlong memPtr);
-            JNIEXPORT void JNICALL JniComputeTaskReduce(JNIEnv *env, jclass cls, jlong envPtr, jlong taskPtr);
-            JNIEXPORT void JNICALL JniComputeTaskComplete(JNIEnv *env, jclass cls, jlong envPtr, jlong taskPtr, jlong memPtr);
-            JNIEXPORT jint JNICALL JniComputeJobSerialize(JNIEnv *env, jclass cls, jlong envPtr, jlong jobPtr, jlong memPtr);
-            JNIEXPORT jlong JNICALL JniComputeJobCreate(JNIEnv *env, jclass cls, jlong envPtr, jlong memPtr);
-            JNIEXPORT void JNICALL JniComputeJobExecute(JNIEnv *env, jclass cls, jlong envPtr, jlong jobPtr, jint cancel, jlong memPtr);
-            JNIEXPORT void JNICALL JniComputeJobCancel(JNIEnv *env, jclass cls, jlong envPtr, jlong jobPtr);
-            JNIEXPORT void JNICALL JniComputeJobDestroy(JNIEnv *env, jclass cls, jlong envPtr, jlong jobPtr);
-
-            JNIEXPORT void JNICALL JniContinuousQueryListenerApply(JNIEnv *env, jclass cls, jlong envPtr, jlong cbPtr, jlong memPtr);
-            JNIEXPORT jlong JNICALL JniContinuousQueryFilterCreate(JNIEnv *env, jclass cls, jlong envPtr, jlong memPtr);
-            JNIEXPORT jint JNICALL JniContinuousQueryFilterApply(JNIEnv *env, jclass cls, jlong envPtr, jlong filterPtr, jlong memPtr);
-            JNIEXPORT void JNICALL JniContinuousQueryFilterRelease(JNIEnv *env, jclass cls, jlong envPtr, jlong filterPtr);
-
-			JNIEXPORT void JNICALL JniDataStreamerTopologyUpdate(JNIEnv *env, jclass cls, jlong envPtr, jlong ldrPtr, jlong topVer, jint topSize);
-			JNIEXPORT void JNICALL JniDataStreamerStreamReceiverInvoke(JNIEnv *env, jclass cls, jlong envPtr, jlong ptr, jobject cache, jlong memPtr, jboolean keepPortable);
-
-            JNIEXPORT void JNICALL JniFutureByteResult(JNIEnv *env, jclass cls, jlong envPtr, jlong futPtr, jint res);
-            JNIEXPORT void JNICALL JniFutureBoolResult(JNIEnv *env, jclass cls, jlong envPtr, jlong futPtr, jint res);
-            JNIEXPORT void JNICALL JniFutureShortResult(JNIEnv *env, jclass cls, jlong envPtr, jlong futPtr, jint res);
-            JNIEXPORT void JNICALL JniFutureCharResult(JNIEnv *env, jclass cls, jlong envPtr, jlong futPtr, jint res);
-            JNIEXPORT void JNICALL JniFutureIntResult(JNIEnv *env, jclass cls, jlong envPtr, jlong futPtr, jint res);
-            JNIEXPORT void JNICALL JniFutureFloatResult(JNIEnv *env, jclass cls, jlong envPtr, jlong futPtr, jfloat res);
-            JNIEXPORT void JNICALL JniFutureLongResult(JNIEnv *env, jclass cls, jlong envPtr, jlong futPtr, jlong res);
-            JNIEXPORT void JNICALL JniFutureDoubleResult(JNIEnv *env, jclass cls, jlong envPtr, jlong futPtr, jdouble res);
-            JNIEXPORT void JNICALL JniFutureObjectResult(JNIEnv *env, jclass cls, jlong envPtr, jlong futPtr, jlong memPtr);
-            JNIEXPORT void JNICALL JniFutureNullResult(JNIEnv *env, jclass cls, jlong envPtr, jlong futPtr);
-            JNIEXPORT void JNICALL JniFutureError(JNIEnv *env, jclass cls, jlong envPtr, jlong futPtr, jlong memPtr);
-
-            JNIEXPORT void JNICALL JniLifecycleEvent(JNIEnv *env, jclass cls, jlong envPtr, jlong ptr, jint evt);
-
-            JNIEXPORT void JNICALL JniMemoryReallocate(JNIEnv *env, jclass cls, jlong envPtr, jlong memPtr, jint cap);
-
-            JNIEXPORT jlong JNICALL JniMessagingFilterCreate(JNIEnv *env, jclass cls, jlong envPtr, jlong memPtr);
-            JNIEXPORT jint JNICALL JniMessagingFilterApply(JNIEnv *env, jclass cls, jlong envPtr, jlong ptr, jlong memPtr);
-            JNIEXPORT void JNICALL JniMessagingFilterDestroy(JNIEnv *env, jclass cls, jlong envPtr, jlong ptr);
-            
-            JNIEXPORT jlong JNICALL JniEventFilterCreate(JNIEnv *env, jclass cls, jlong envPtr, jlong memPtr);
-            JNIEXPORT jint JNICALL JniEventFilterApply(JNIEnv *env, jclass cls, jlong envPtr, jlong ptr, jlong memPtr);
-            JNIEXPORT void JNICALL JniEventFilterDestroy(JNIEnv *env, jclass cls, jlong envPtr, jlong ptr);
-
-			JNIEXPORT jlong JNICALL JniServiceInit(JNIEnv *env, jclass cls, jlong envPtr, jlong memPtr);
-			JNIEXPORT void JNICALL JniServiceExecute(JNIEnv *env, jclass cls, jlong envPtr, jlong svcPtr, jlong memPtr);
-			JNIEXPORT void JNICALL JniServiceCancel(JNIEnv *env, jclass cls, jlong envPtr, jlong svcPtr, jlong memPtr);
-			JNIEXPORT void JNICALL JniServiceInvokeMethod(JNIEnv *env, jclass cls, jlong envPtr, jlong svcPtr, jlong inMemPtr, jlong outMemPtr);
-			JNIEXPORT jint JNICALL JniClusterNodeFilterApply(JNIEnv *env, jclass cls, jlong envPtr, jlong memPtr);
-
-            JNIEXPORT jlong JNICALL JniNodeInfo(JNIEnv *env, jclass cls, jlong envPtr, jlong memPtr);
-
-            JNIEXPORT void JNICALL JniOnStart(JNIEnv *env, jclass cls, jlong envPtr, jobject proc, jlong memPtr);
-            JNIEXPORT void JNICALL JniOnStop(JNIEnv *env, jclass cls, jlong envPtr);
-
-            JNIEXPORT jlong JNICALL JniExtensionCallbackInLongOutLong(JNIEnv *env, jclass cls, jlong envPtr, jint typ, jlong arg1);
-            JNIEXPORT jlong JNICALL JniExtensionCallbackInLongLongOutLong(JNIEnv *env, jclass cls, jlong envPtr, jint typ, jlong arg1, jlong arg2);
-        }
-    }
-}
-
-#endif
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/common/os/linux/include/Makefile.am
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/common/os/linux/include/Makefile.am b/modules/platform/src/main/cpp/common/os/linux/include/Makefile.am
deleted file mode 100644
index 68e45e6..0000000
--- a/modules/platform/src/main/cpp/common/os/linux/include/Makefile.am
+++ /dev/null
@@ -1,21 +0,0 @@
-##
-## Licensed to the Apache Software Foundation (ASF) under one or more
-## contributor license agreements.  See the NOTICE file distributed with
-## this work for additional information regarding copyright ownership.
-## The ASF licenses this file to You under the Apache License, Version 2.0
-## (the "License"); you may not use this file except in compliance with
-## the License.  You may obtain a copy of the License at
-##
-##      http://www.apache.org/licenses/LICENSE-2.0
-##
-## Unless required by applicable law or agreed to in writing, software
-## distributed under the License is distributed on an "AS IS" BASIS,
-## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-## See the License for the specific language governing permissions and
-## limitations under the License.
-##
-
-ACLOCAL_AMFLAGS = "-Im4"
-
-nobase_include_HEADERS = ignite/common/common.h \
-                         ignite/common/concurrent_os.h

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/common/os/linux/include/ignite/common/common.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/common/os/linux/include/ignite/common/common.h b/modules/platform/src/main/cpp/common/os/linux/include/ignite/common/common.h
deleted file mode 100644
index 6577ad8..0000000
--- a/modules/platform/src/main/cpp/common/os/linux/include/ignite/common/common.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef _IGNITE_COMMON_OS
-#define _IGNITE_COMMON_OS
-
-#ifndef __has_attribute
-  #define __has_attribute(x) 0
-#endif
-
-#if (defined(__GNUC__) && ((__GNUC__ > 4) || (__GNUC__ == 4) && (__GNUC_MINOR__ > 2))) || __has_attribute(visibility)
-  #define IGNITE_EXPORT __attribute__((visibility("default")))
-  #define IGNITE_IMPORT __attribute__((visibility("default")))
-#else
-  #define IGNITE_EXPORT
-  #define IGNITE_IMPORT
-#endif
-
-#define IGNITE_CALL
-
-#ifdef IGNITE_IMPL
-    #define IGNITE_IMPORT_EXPORT IGNITE_EXPORT
-#else
-    #define IGNITE_IMPORT_EXPORT IGNITE_IMPORT
-#endif
-
-/**
- * Common construction to disable copy constructor and assignment for class.
- */
-#define IGNITE_NO_COPY_ASSIGNMENT(cls) \
-    cls(const cls& src); \
-    cls& operator= (const cls& other);
-
-namespace ignite
-{
-    namespace common
-    {
-        /**
-         * Helper class to manage attached threads.
-         */
-        class AttachHelper 
-        {
-        public:            
-            /**
-             * Destructor.
-             */
-            ~AttachHelper();
-            
-            /**
-             * Callback invoked on successful thread attach ot JVM.
-             */
-            static void OnThreadAttach();
-        private:
-            /**
-             * Helper method to allocate attach key.
-             */
-            static void AllocateAttachKey();
-
-            /**
-             * Attach key destructor.
-             */
-            static void DestroyAttachKey(void* key);
-        };        
-    }
-}
-
-#endif
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/common/os/linux/include/ignite/common/concurrent_os.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/common/os/linux/include/ignite/common/concurrent_os.h b/modules/platform/src/main/cpp/common/os/linux/include/ignite/common/concurrent_os.h
deleted file mode 100644
index 63798b1..0000000
--- a/modules/platform/src/main/cpp/common/os/linux/include/ignite/common/concurrent_os.h
+++ /dev/null
@@ -1,394 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef _IGNITE_COMMON_CONCURRENT_OS
-#define _IGNITE_COMMON_CONCURRENT_OS
-
-#include <map>
-#include <stdint.h>
-#include <pthread.h>
-
-#include "ignite/common/common.h"
-
-namespace ignite
-{
-    namespace common
-    {
-        namespace concurrent
-        {
-            /**
-             * Static class to manage memory visibility semantics. 
-             */
-            class IGNITE_IMPORT_EXPORT Memory {
-            public:
-                /**
-                 * Full fence. 
-                 */
-                static void Fence();
-            };
-
-            /**
-             * Critical section.
-             */
-            class IGNITE_IMPORT_EXPORT CriticalSection {
-            public:
-                /**
-                 * Constructor.
-                 */
-                CriticalSection();
-
-                /**
-                 * Destructor. 
-                 */
-                ~CriticalSection();
-
-                /**
-                 * Enter critical section.
-                 */
-                void Enter();
-
-                /**
-                 * Leave critical section.
-                 */
-                void Leave();
-            private:
-                pthread_mutex_t mux;
-                
-                IGNITE_NO_COPY_ASSIGNMENT(CriticalSection)
-            };
-
-            /**
-             * Special latch with count = 1.
-             */
-            class IGNITE_IMPORT_EXPORT SingleLatch
-            {                
-            public:
-                /**
-                 * Constructor.
-                 */
-                SingleLatch();
-
-                /**
-                 * Destructor.
-                 */
-                ~SingleLatch();
-
-                /**
-                 * Perform the countdown.
-                 */
-                void CountDown();
-
-                /**
-                 * Await the countdown.
-                 */
-                void Await();
-            private:
-                /** Mutex. */
-                pthread_mutex_t mux;
-
-                /** Condition. */
-                pthread_cond_t cond;
-
-                /** Ready flag. */
-                bool ready;
-                
-                IGNITE_NO_COPY_ASSIGNMENT(SingleLatch)
-            };
-
-            /**
-             * Primitives for atomic access.
-             */
-            class IGNITE_IMPORT_EXPORT Atomics
-            {
-            public:
-                /**
-                 * Update the 32-bit integer value if it is equal to expected value.
-                 *
-                 * @param ptr Pointer.
-                 * @param expVal Expected value.
-                 * @param newVal New value.
-                 * @return True if update occurred as a result of this call, false otherwise.
-                 */
-                static bool CompareAndSet32(int32_t* ptr, int32_t expVal, int32_t newVal);
-
-                /**
-                 * Update the 32-bit integer value if it is equal to expected value.
-                 *
-                 * @param ptr Pointer.
-                 * @param expVal Expected value.
-                 * @param newVal New value.
-                 * @return Value which were observed during CAS attempt.
-                 */
-                static int32_t CompareAndSet32Val(int32_t* ptr, int32_t expVal, int32_t newVal);
-
-                /**
-                 * Increment 32-bit integer and return new value.
-                 *
-                 * @param ptr Pointer.
-                 * @return Value after increment.
-                 */
-                static int32_t IncrementAndGet32(int32_t* ptr);
-
-                /**
-                 * Decrement 32-bit integer and return new value.
-                 *
-                 * @param ptr Pointer.
-                 * @return Value after decrement.
-                 */
-                static int32_t DecrementAndGet32(int32_t* ptr);
-
-                /**
-                 * Update the 64-bit integer value if it is equal to expected value.
-                 *
-                 * @param ptr Pointer.
-                 * @param expVal Expected value.
-                 * @param newVal New value.
-                 * @return True if update occurred as a result of this call, false otherwise.
-                 */
-                static bool CompareAndSet64(int64_t* ptr, int64_t expVal, int64_t newVal);
-
-                /**
-                 * Update the 64-bit integer value if it is equal to expected value.
-                 *
-                 * @param ptr Pointer.
-                 * @param expVal Expected value.
-                 * @param newVal New value.
-                 * @return Value which were observed during CAS attempt.
-                 */
-                static int64_t CompareAndSet64Val(int64_t* ptr, int64_t expVal, int64_t newVal);
-
-                /**
-                 * Increment 64-bit integer and return new value.
-                 *
-                 * @param ptr Pointer.
-                 * @return Value after increment.
-                 */
-                static int64_t IncrementAndGet64(int64_t* ptr);
-
-                /**
-                 * Decrement 64-bit integer and return new value.
-                 *
-                 * @param ptr Pointer.
-                 * @return Value after decrement.
-                 */
-                static int64_t DecrementAndGet64(int64_t* ptr);
-            };
-
-            /**
-             * Thread-local entry.
-             */
-            class IGNITE_IMPORT_EXPORT ThreadLocalEntry
-            {
-            public:
-                /**
-                 * Virtual destructor to allow for correct typed entries cleanup.
-                 */
-                virtual ~ThreadLocalEntry()
-                {
-                    // No-op.
-                }
-            };
-
-            /**
-             * Typed thread-local entry.
-             */
-            template<typename T>
-            class IGNITE_IMPORT_EXPORT ThreadLocalTypedEntry : public ThreadLocalEntry
-            {
-            public:
-                /**
-                 * Constructor.
-                 *
-                 * @param val Value.
-                 */
-                ThreadLocalTypedEntry(T val) : val(val)
-                {
-                    // No-op.
-                }
-
-                ~ThreadLocalTypedEntry()
-                {
-                    // No-op.
-                }
-
-                /**
-                 * Get value.
-                 *
-                 * @return Value.
-                 */
-                T Get()
-                {
-                    return val;
-                }
-            private:
-                /** Value. */
-                T val;
-            };
-
-            /**
-             * Thread-local abstraction.
-             */
-            class IGNITE_IMPORT_EXPORT ThreadLocal
-            {
-            public:
-                /**
-                 * Get next available index to be used in thread-local storage.
-                 *
-                 * @return Index.
-                 */
-                static int32_t NextIndex();
-
-                /**
-                 * Get value by index.
-                 *
-                 * @param idx Index.
-                 * @return Value associated with the index or NULL.
-                 */
-                template<typename T>
-                static T Get(int32_t idx)
-                {
-                    void* linuxVal = Get0();
-
-                    if (linuxVal)
-                    {
-                        std::map<int32_t, ThreadLocalEntry*>* map =
-                            static_cast<std::map<int32_t, ThreadLocalEntry*>*>(linuxVal);
-
-                        ThreadLocalTypedEntry<T>* entry = static_cast<ThreadLocalTypedEntry<T>*>((*map)[idx]);
-
-                        if (entry)
-                            return entry->Get();
-                    }
-
-                    return T();
-                }
-
-                /**
-                 * Set value at the given index.
-                 *
-                 * @param idx Index.
-                 * @param val Value to be associated with the index.
-                 */
-                template<typename T>
-                static void Set(int32_t idx, const T& val)
-                {
-                    void* linuxVal = Get0();
-
-                    if (linuxVal)
-                    {
-                        std::map<int32_t, ThreadLocalEntry*>* map =
-                            static_cast<std::map<int32_t, ThreadLocalEntry*>*>(linuxVal);
-
-                        ThreadLocalEntry* appVal = (*map)[idx];
-
-                        if (appVal)
-                            delete appVal;
-
-                        (*map)[idx] = new ThreadLocalTypedEntry<T>(val);
-                    }
-                    else
-                    {
-                        std::map<int32_t, ThreadLocalEntry*>* map = new std::map<int32_t, ThreadLocalEntry*>();
-
-                        Set0(map);
-
-                        (*map)[idx] = new ThreadLocalTypedEntry<T>(val);
-                    }
-                }
-
-                /**
-                 * Remove value at the given index.
-                 *
-                 * @param idx Index.
-                 */
-                static void Remove(int32_t idx);
-
-                /**
-                 * Internal thread-local map clear routine.
-                 *
-                 * @param mapPtr Pointer to map.
-                 */
-                static void Clear0(void* mapPtr);
-
-            private:
-                /**
-                 * Internal get routine.
-                 *
-                 * @param Associated value.
-                 */
-                static void* Get0();
-
-                /**
-                 * Internal set routine.
-                 *
-                 * @param ptr Pointer.
-                 */
-                static void Set0(void* ptr);
-            };
-
-            /**
-             * Thread-local instance. Simplifies API avoiding direct index allocations.
-             */
-            template<typename T>
-            class IGNITE_IMPORT_EXPORT ThreadLocalInstance
-            {
-            public:
-                /**
-                 * Constructor.
-                 */
-                ThreadLocalInstance() : idx(ThreadLocal::NextIndex())
-                {
-                    // No-op.
-                }
-
-                /**
-                 * Get value.
-                 *
-                 * @return Value.
-                 */
-                T Get()
-                {
-                    return ThreadLocal::Get<T>(idx);
-                }
-
-                /**
-                 * Set instance.
-                 *
-                 * @param val Value.
-                 */
-                void Set(const T& val)
-                {
-                    ThreadLocal::Set<T>(idx, val);
-                }
-
-                /**
-                 * Remove instance.
-                 */
-                void Remove()
-                {
-                    ThreadLocal::Remove(idx);
-                }
-
-            private:
-                /** Index. */
-                int32_t idx;
-            };
-        }
-    }
-}
-
-#endif
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/common/os/linux/src/common.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/common/os/linux/src/common.cpp b/modules/platform/src/main/cpp/common/os/linux/src/common.cpp
deleted file mode 100644
index c0cccdc..0000000
--- a/modules/platform/src/main/cpp/common/os/linux/src/common.cpp
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#include <pthread.h>
-
-#include "ignite/common/common.h"
-#include "ignite/common/java.h"
-
-using namespace ignite::common::java;
-
-namespace ignite
-{
-    namespace common
-    {
-        /** Key indicating that the thread is attached. */
-        static pthread_key_t attachKey;
-
-        /** Helper to ensure that attach key is allocated only once. */
-        static pthread_once_t attachKeyInit = PTHREAD_ONCE_INIT;
-        
-        AttachHelper::~AttachHelper()
-        {
-            JniContext::Detach();
-        }
-        
-        void AttachHelper::OnThreadAttach()
-        {
-            pthread_once(&attachKeyInit, AllocateAttachKey);
-            
-            void* val = pthread_getspecific(attachKey);
-            
-            if (!val)
-                pthread_setspecific(attachKey, new AttachHelper());
-        }
-        
-        void AttachHelper::AllocateAttachKey()
-        {
-            pthread_key_create(&attachKey, DestroyAttachKey);
-        }   
-        
-        void AttachHelper::DestroyAttachKey(void* key)
-        {
-            delete reinterpret_cast<AttachHelper*>(key);
-        }             
-    }
-}


[28/28] ignite git commit: IGNITE-1513: Moved CPP.

Posted by vo...@apache.org.
IGNITE-1513: Moved CPP.


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

Branch: refs/heads/ignite-1513-final
Commit: 524f5653ec94e445946bda43b907259e21704360
Parents: 20a7918
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Tue Sep 22 09:40:19 2015 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Tue Sep 22 09:40:22 2015 +0300

----------------------------------------------------------------------
 modules/platform/cpp/README.txt                 |  101 +
 modules/platform/cpp/common/Makefile.am         |   45 +
 modules/platform/cpp/common/configure.ac        |   62 +
 modules/platform/cpp/common/ignite-common.pc.in |    9 +
 modules/platform/cpp/common/include/Makefile.am |   22 +
 .../common/include/ignite/common/concurrent.h   |  210 ++
 .../cpp/common/include/ignite/common/exports.h  |  145 ++
 .../cpp/common/include/ignite/common/java.h     |  652 ++++++
 .../cpp/common/os/linux/include/Makefile.am     |   21 +
 .../os/linux/include/ignite/common/common.h     |   81 +
 .../linux/include/ignite/common/concurrent_os.h |  394 ++++
 .../platform/cpp/common/os/linux/src/common.cpp |   59 +
 .../cpp/common/os/linux/src/concurrent_os.cpp   |  175 ++
 .../os/win/include/ignite/common/common.h       |   56 +
 .../win/include/ignite/common/concurrent_os.h   |  406 ++++
 .../platform/cpp/common/os/win/src/common.cpp   |   65 +
 .../cpp/common/os/win/src/concurrent_os.cpp     |  151 ++
 modules/platform/cpp/common/project/README.TXT  |    1 +
 .../platform/cpp/common/project/vs/README.TXT   |    1 +
 .../cpp/common/project/vs/common.vcxproj        |  202 ++
 .../common/project/vs/common.vcxproj.filters    |   54 +
 .../platform/cpp/common/project/vs/module.def   |   99 +
 .../platform/cpp/common/project/vs/targetver.h  |   25 +
 modules/platform/cpp/common/src/concurrent.cpp  |   94 +
 modules/platform/cpp/common/src/exports.cpp     |  413 ++++
 modules/platform/cpp/common/src/java.cpp        | 2205 ++++++++++++++++++
 modules/platform/cpp/core-test/Makefile.am      |   49 +
 .../cpp/core-test/config/cache-query.xml        |   91 +
 .../cpp/core-test/config/cache-test.xml         |  129 +
 modules/platform/cpp/core-test/configure.ac     |   62 +
 .../platform/cpp/core-test/include/Makefile.am  |   22 +
 .../include/ignite/portable_test_defs.h         |  320 +++
 .../include/ignite/portable_test_utils.h        |  516 ++++
 .../cpp/core-test/include/teamcity_messages.h   |   55 +
 .../platform/cpp/core-test/project/README.TXT   |    1 +
 .../cpp/core-test/project/vs/README.TXT         |    1 +
 .../cpp/core-test/project/vs/core-test.vcxproj  |  174 ++
 .../project/vs/core-test.vcxproj.filters        |   68 +
 .../cpp/core-test/src/cache_query_test.cpp      |  656 ++++++
 .../platform/cpp/core-test/src/cache_test.cpp   |  486 ++++
 .../cpp/core-test/src/concurrent_test.cpp       |  186 ++
 .../cpp/core-test/src/handle_registry_test.cpp  |  176 ++
 .../cpp/core-test/src/ignition_test.cpp         |  102 +
 .../src/portable_reader_writer_raw_test.cpp     | 1532 ++++++++++++
 .../src/portable_reader_writer_test.cpp         | 1951 ++++++++++++++++
 .../cpp/core-test/src/portable_session_test.cpp |  257 ++
 .../cpp/core-test/src/portable_test_defs.cpp    |   65 +
 .../cpp/core-test/src/teamcity_boost.cpp        |  159 ++
 .../cpp/core-test/src/teamcity_messages.cpp     |  150 ++
 modules/platform/cpp/core/Makefile.am           |   66 +
 modules/platform/cpp/core/configure.ac          |   62 +
 modules/platform/cpp/core/ignite.pc.in          |    9 +
 modules/platform/cpp/core/include/Makefile.am   |   61 +
 .../cpp/core/include/ignite/cache/cache.h       | 1153 +++++++++
 .../cpp/core/include/ignite/cache/cache_entry.h |  118 +
 .../core/include/ignite/cache/cache_peek_mode.h |   71 +
 .../cpp/core/include/ignite/cache/query/query.h |   27 +
 .../include/ignite/cache/query/query_argument.h |  125 +
 .../include/ignite/cache/query/query_cursor.h   |  191 ++
 .../include/ignite/cache/query/query_scan.h     |  151 ++
 .../core/include/ignite/cache/query/query_sql.h |  253 ++
 .../include/ignite/cache/query/query_text.h     |  159 ++
 modules/platform/cpp/core/include/ignite/guid.h |  112 +
 .../platform/cpp/core/include/ignite/ignite.h   |  154 ++
 .../core/include/ignite/ignite_configuration.h  |   92 +
 .../cpp/core/include/ignite/ignite_error.h      |  260 +++
 .../platform/cpp/core/include/ignite/ignition.h |  195 ++
 .../core/include/ignite/impl/cache/cache_impl.h |  418 ++++
 .../ignite/impl/cache/query/query_impl.h        |  115 +
 .../core/include/ignite/impl/handle_registry.h  |  202 ++
 .../include/ignite/impl/ignite_environment.h    |  130 ++
 .../cpp/core/include/ignite/impl/ignite_impl.h  |  146 ++
 .../core/include/ignite/impl/interop/interop.h  |   25 +
 .../ignite/impl/interop/interop_input_stream.h  |  234 ++
 .../ignite/impl/interop/interop_memory.h        |  280 +++
 .../ignite/impl/interop/interop_output_stream.h |  234 ++
 .../cpp/core/include/ignite/impl/operations.h   |  452 ++++
 .../ignite/impl/portable/portable_common.h      |  146 ++
 .../ignite/impl/portable/portable_id_resolver.h |  106 +
 .../impl/portable/portable_metadata_handler.h   |  102 +
 .../impl/portable/portable_metadata_manager.h   |  120 +
 .../impl/portable/portable_metadata_snapshot.h  |  122 +
 .../impl/portable/portable_metadata_updater.h   |   53 +
 .../portable/portable_metadata_updater_impl.h   |   65 +
 .../ignite/impl/portable/portable_reader_impl.h | 1130 +++++++++
 .../ignite/impl/portable/portable_utils.h       |  344 +++
 .../ignite/impl/portable/portable_writer_impl.h |  859 +++++++
 .../cpp/core/include/ignite/portable/portable.h |   29 +
 .../include/ignite/portable/portable_consts.h   |  106 +
 .../ignite/portable/portable_containers.h       |  525 +++++
 .../ignite/portable/portable_raw_reader.h       |  324 +++
 .../ignite/portable/portable_raw_writer.h       |  300 +++
 .../include/ignite/portable/portable_reader.h   |  355 +++
 .../include/ignite/portable/portable_type.h     |  293 +++
 .../include/ignite/portable/portable_writer.h   |  335 +++
 .../cpp/core/os/linux/include/Makefile.am       |   20 +
 .../core/os/linux/include/ignite/impl/utils.h   |  155 ++
 .../cpp/core/os/linux/src/impl/utils.cpp        |  439 ++++
 .../cpp/core/os/win/include/ignite/impl/utils.h |  155 ++
 .../platform/cpp/core/os/win/src/impl/utils.cpp |  453 ++++
 modules/platform/cpp/core/project/README.TXT    |    1 +
 modules/platform/cpp/core/project/vs/README.TXT |    1 +
 .../platform/cpp/core/project/vs/core.vcxproj   |  272 +++
 .../cpp/core/project/vs/core.vcxproj.filters    |  246 ++
 modules/platform/cpp/core/src/guid.cpp          |   65 +
 modules/platform/cpp/core/src/ignite.cpp        |   43 +
 modules/platform/cpp/core/src/ignite_error.cpp  |  222 ++
 modules/platform/cpp/core/src/ignition.cpp      |  468 ++++
 .../cpp/core/src/impl/cache/cache_impl.cpp      |  388 +++
 .../core/src/impl/cache/query/query_impl.cpp    |  193 ++
 .../cpp/core/src/impl/handle_registry.cpp       |  234 ++
 .../cpp/core/src/impl/ignite_environment.cpp    |  167 ++
 .../platform/cpp/core/src/impl/ignite_impl.cpp  |   42 +
 .../src/impl/interop/interop_input_stream.cpp   |  215 ++
 .../core/src/impl/interop/interop_memory.cpp    |  182 ++
 .../src/impl/interop/interop_output_stream.cpp  |  215 ++
 .../impl/portable/portable_metadata_handler.cpp |   78 +
 .../impl/portable/portable_metadata_manager.cpp |  201 ++
 .../portable/portable_metadata_snapshot.cpp     |   70 +
 .../impl/portable/portable_metadata_updater.cpp |   32 +
 .../portable/portable_metadata_updater_impl.cpp |   94 +
 .../src/impl/portable/portable_reader_impl.cpp  |  683 ++++++
 .../core/src/impl/portable/portable_utils.cpp   |  214 ++
 .../src/impl/portable/portable_writer_impl.cpp  |  600 +++++
 .../core/src/portable/portable_containers.cpp   |   76 +
 .../core/src/portable/portable_raw_reader.cpp   |  135 ++
 .../core/src/portable/portable_raw_writer.cpp   |  147 ++
 .../cpp/core/src/portable/portable_reader.cpp   |  142 ++
 .../cpp/core/src/portable/portable_type.cpp     |   51 +
 .../cpp/core/src/portable/portable_writer.cpp   |  154 ++
 modules/platform/cpp/examples/Makefile.am       |   39 +
 modules/platform/cpp/examples/README.txt        |   42 +
 .../cpp/examples/config/example-cache.xml       |   77 +
 modules/platform/cpp/examples/configure.ac      |   38 +
 .../platform/cpp/examples/include/Makefile.am   |   21 +
 .../examples/include/ignite/examples/address.h  |  109 +
 .../include/ignite/examples/organization.h      |  111 +
 .../cpp/examples/project/vs/ignite-examples.sln |   19 +
 .../examples/project/vs/ignite-examples.vcxproj |  107 +
 .../project/vs/ignite-examples.vcxproj.filters  |   30 +
 .../platform/cpp/examples/src/putgetexample.cpp |  126 +
 modules/platform/cpp/project/vs/ignite.sln      |   46 +
 modules/platform/cpp/project/vs/ignite.slnrel   |   33 +
 .../platform/cpp/project/vs/ignite_x86.slnrel   |   33 +
 modules/platform/src/main/cpp/README.txt        |  101 -
 .../platform/src/main/cpp/common/Makefile.am    |   45 -
 .../platform/src/main/cpp/common/configure.ac   |   62 -
 .../src/main/cpp/common/ignite-common.pc.in     |    9 -
 .../src/main/cpp/common/include/Makefile.am     |   22 -
 .../common/include/ignite/common/concurrent.h   |  210 --
 .../cpp/common/include/ignite/common/exports.h  |  145 --
 .../cpp/common/include/ignite/common/java.h     |  652 ------
 .../cpp/common/os/linux/include/Makefile.am     |   21 -
 .../os/linux/include/ignite/common/common.h     |   81 -
 .../linux/include/ignite/common/concurrent_os.h |  394 ----
 .../src/main/cpp/common/os/linux/src/common.cpp |   59 -
 .../cpp/common/os/linux/src/concurrent_os.cpp   |  175 --
 .../os/win/include/ignite/common/common.h       |   56 -
 .../win/include/ignite/common/concurrent_os.h   |  406 ----
 .../src/main/cpp/common/os/win/src/common.cpp   |   65 -
 .../cpp/common/os/win/src/concurrent_os.cpp     |  151 --
 .../src/main/cpp/common/project/README.TXT      |    1 -
 .../src/main/cpp/common/project/vs/README.TXT   |    1 -
 .../main/cpp/common/project/vs/common.vcxproj   |  202 --
 .../common/project/vs/common.vcxproj.filters    |   54 -
 .../src/main/cpp/common/project/vs/module.def   |   99 -
 .../src/main/cpp/common/project/vs/targetver.h  |   25 -
 .../src/main/cpp/common/src/concurrent.cpp      |   94 -
 .../src/main/cpp/common/src/exports.cpp         |  413 ----
 .../platform/src/main/cpp/common/src/java.cpp   | 2205 ------------------
 .../platform/src/main/cpp/core-test/Makefile.am |   49 -
 .../main/cpp/core-test/config/cache-query.xml   |   91 -
 .../main/cpp/core-test/config/cache-test.xml    |  129 -
 .../src/main/cpp/core-test/configure.ac         |   62 -
 .../src/main/cpp/core-test/include/Makefile.am  |   22 -
 .../include/ignite/portable_test_defs.h         |  320 ---
 .../include/ignite/portable_test_utils.h        |  516 ----
 .../cpp/core-test/include/teamcity_messages.h   |   55 -
 .../src/main/cpp/core-test/project/README.TXT   |    1 -
 .../main/cpp/core-test/project/vs/README.TXT    |    1 -
 .../cpp/core-test/project/vs/core-test.vcxproj  |  174 --
 .../project/vs/core-test.vcxproj.filters        |   68 -
 .../main/cpp/core-test/src/cache_query_test.cpp |  656 ------
 .../src/main/cpp/core-test/src/cache_test.cpp   |  486 ----
 .../main/cpp/core-test/src/concurrent_test.cpp  |  186 --
 .../cpp/core-test/src/handle_registry_test.cpp  |  176 --
 .../main/cpp/core-test/src/ignition_test.cpp    |  102 -
 .../src/portable_reader_writer_raw_test.cpp     | 1532 ------------
 .../src/portable_reader_writer_test.cpp         | 1951 ----------------
 .../cpp/core-test/src/portable_session_test.cpp |  257 --
 .../cpp/core-test/src/portable_test_defs.cpp    |   65 -
 .../main/cpp/core-test/src/teamcity_boost.cpp   |  159 --
 .../cpp/core-test/src/teamcity_messages.cpp     |  150 --
 modules/platform/src/main/cpp/core/Makefile.am  |   66 -
 modules/platform/src/main/cpp/core/configure.ac |   62 -
 modules/platform/src/main/cpp/core/ignite.pc.in |    9 -
 .../src/main/cpp/core/include/Makefile.am       |   61 -
 .../main/cpp/core/include/ignite/cache/cache.h  | 1153 ---------
 .../cpp/core/include/ignite/cache/cache_entry.h |  118 -
 .../core/include/ignite/cache/cache_peek_mode.h |   71 -
 .../cpp/core/include/ignite/cache/query/query.h |   27 -
 .../include/ignite/cache/query/query_argument.h |  125 -
 .../include/ignite/cache/query/query_cursor.h   |  191 --
 .../include/ignite/cache/query/query_scan.h     |  151 --
 .../core/include/ignite/cache/query/query_sql.h |  253 --
 .../include/ignite/cache/query/query_text.h     |  159 --
 .../src/main/cpp/core/include/ignite/guid.h     |  112 -
 .../src/main/cpp/core/include/ignite/ignite.h   |  154 --
 .../core/include/ignite/ignite_configuration.h  |   92 -
 .../main/cpp/core/include/ignite/ignite_error.h |  260 ---
 .../src/main/cpp/core/include/ignite/ignition.h |  195 --
 .../core/include/ignite/impl/cache/cache_impl.h |  418 ----
 .../ignite/impl/cache/query/query_impl.h        |  115 -
 .../core/include/ignite/impl/handle_registry.h  |  202 --
 .../include/ignite/impl/ignite_environment.h    |  130 --
 .../cpp/core/include/ignite/impl/ignite_impl.h  |  146 --
 .../core/include/ignite/impl/interop/interop.h  |   25 -
 .../ignite/impl/interop/interop_input_stream.h  |  234 --
 .../ignite/impl/interop/interop_memory.h        |  280 ---
 .../ignite/impl/interop/interop_output_stream.h |  234 --
 .../cpp/core/include/ignite/impl/operations.h   |  452 ----
 .../ignite/impl/portable/portable_common.h      |  146 --
 .../ignite/impl/portable/portable_id_resolver.h |  106 -
 .../impl/portable/portable_metadata_handler.h   |  102 -
 .../impl/portable/portable_metadata_manager.h   |  120 -
 .../impl/portable/portable_metadata_snapshot.h  |  122 -
 .../impl/portable/portable_metadata_updater.h   |   53 -
 .../portable/portable_metadata_updater_impl.h   |   65 -
 .../ignite/impl/portable/portable_reader_impl.h | 1130 ---------
 .../ignite/impl/portable/portable_utils.h       |  344 ---
 .../ignite/impl/portable/portable_writer_impl.h |  859 -------
 .../cpp/core/include/ignite/portable/portable.h |   29 -
 .../include/ignite/portable/portable_consts.h   |  106 -
 .../ignite/portable/portable_containers.h       |  525 -----
 .../ignite/portable/portable_raw_reader.h       |  324 ---
 .../ignite/portable/portable_raw_writer.h       |  300 ---
 .../include/ignite/portable/portable_reader.h   |  355 ---
 .../include/ignite/portable/portable_type.h     |  293 ---
 .../include/ignite/portable/portable_writer.h   |  335 ---
 .../main/cpp/core/os/linux/include/Makefile.am  |   20 -
 .../core/os/linux/include/ignite/impl/utils.h   |  155 --
 .../main/cpp/core/os/linux/src/impl/utils.cpp   |  439 ----
 .../cpp/core/os/win/include/ignite/impl/utils.h |  155 --
 .../src/main/cpp/core/os/win/src/impl/utils.cpp |  453 ----
 .../src/main/cpp/core/project/README.TXT        |    1 -
 .../src/main/cpp/core/project/vs/README.TXT     |    1 -
 .../src/main/cpp/core/project/vs/core.vcxproj   |  272 ---
 .../cpp/core/project/vs/core.vcxproj.filters    |  246 --
 modules/platform/src/main/cpp/core/src/guid.cpp |   65 -
 .../platform/src/main/cpp/core/src/ignite.cpp   |   43 -
 .../src/main/cpp/core/src/ignite_error.cpp      |  222 --
 .../platform/src/main/cpp/core/src/ignition.cpp |  468 ----
 .../main/cpp/core/src/impl/cache/cache_impl.cpp |  388 ---
 .../core/src/impl/cache/query/query_impl.cpp    |  193 --
 .../main/cpp/core/src/impl/handle_registry.cpp  |  234 --
 .../cpp/core/src/impl/ignite_environment.cpp    |  167 --
 .../src/main/cpp/core/src/impl/ignite_impl.cpp  |   42 -
 .../src/impl/interop/interop_input_stream.cpp   |  215 --
 .../core/src/impl/interop/interop_memory.cpp    |  182 --
 .../src/impl/interop/interop_output_stream.cpp  |  215 --
 .../impl/portable/portable_metadata_handler.cpp |   78 -
 .../impl/portable/portable_metadata_manager.cpp |  201 --
 .../portable/portable_metadata_snapshot.cpp     |   70 -
 .../impl/portable/portable_metadata_updater.cpp |   32 -
 .../portable/portable_metadata_updater_impl.cpp |   94 -
 .../src/impl/portable/portable_reader_impl.cpp  |  683 ------
 .../core/src/impl/portable/portable_utils.cpp   |  214 --
 .../src/impl/portable/portable_writer_impl.cpp  |  600 -----
 .../core/src/portable/portable_containers.cpp   |   76 -
 .../core/src/portable/portable_raw_reader.cpp   |  135 --
 .../core/src/portable/portable_raw_writer.cpp   |  147 --
 .../cpp/core/src/portable/portable_reader.cpp   |  142 --
 .../cpp/core/src/portable/portable_type.cpp     |   51 -
 .../cpp/core/src/portable/portable_writer.cpp   |  154 --
 .../platform/src/main/cpp/examples/Makefile.am  |   39 -
 .../platform/src/main/cpp/examples/README.txt   |   42 -
 .../main/cpp/examples/config/example-cache.xml  |   77 -
 .../platform/src/main/cpp/examples/configure.ac |   38 -
 .../src/main/cpp/examples/include/Makefile.am   |   21 -
 .../examples/include/ignite/examples/address.h  |  109 -
 .../include/ignite/examples/organization.h      |  111 -
 .../cpp/examples/project/vs/ignite-examples.sln |   19 -
 .../examples/project/vs/ignite-examples.vcxproj |  107 -
 .../project/vs/ignite-examples.vcxproj.filters  |   30 -
 .../src/main/cpp/examples/src/putgetexample.cpp |  126 -
 .../platform/src/main/cpp/project/vs/ignite.sln |   46 -
 .../src/main/cpp/project/vs/ignite.slnrel       |   33 -
 .../src/main/cpp/project/vs/ignite_x86.slnrel   |   33 -
 288 files changed, 31449 insertions(+), 31449 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/README.txt
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/README.txt b/modules/platform/cpp/README.txt
new file mode 100644
index 0000000..c9e6999
--- /dev/null
+++ b/modules/platform/cpp/README.txt
@@ -0,0 +1,101 @@
+Apache Ignite for C++
+==================================
+
+Ignite C++ provides data grid functionality.
+Using Ignite C++ APIs you can execute perform concurrent operations on
+the data stored in cache.
+
+Ignite C++ can access cluster and share data with .Net and
+Java applications using portable object format.
+
+Support for the following will be added in next releases:
+ * ACID transactions management.
+ * Distributed locks.
+ * Async operations.
+ * Cache SQL queries and continuous queries.
+ * Event listening.
+ * Compute grid functionality.
+
+Full source code is provided. Users should build the library for intended platform.
+
+Building on Linux With Autotools
+----------------------------------
+
+Common Requirements:
+
+ * GCC, g++, autotools, automake, and libtool must be installed
+ * Java Development Kit (JDK) must be installed: https://java.com/en/download/index.jsp
+ * JAVA_HOME environment variable must be set pointing to Java installation directory.
+
+Building the library:
+
+ * Build Ignite C++ helper "common" library:
+     * Navigate to the directory $IGNITE_HOME/platforms/cpp/src/common
+     * Execute the following commands one by one:
+         * libtoolize
+         * aclocal
+         * autoheader
+         * automake --add-missing
+         * autoreconf
+         * ./configure
+         * make
+         * make install
+ * Build Ignite C++ library:
+     * Navigate to the directory $IGNITE_HOME/platforms/cpp/src/core
+     * Execute the following commands one by one:
+         * libtoolize
+         * aclocal
+         * autoheader
+         * automake --add-missing
+         * autoreconf
+         * ./configure
+         * make
+         * make install
+
+NOTE: "make install" command may require superuser privileges. In this case it must be
+executed as "sudo make install".
+
+Development:
+
+ * IGNITE_HOME environment variable must be set to Ignite installation directory.
+ * Once both libraries are built and installed, required headers are placed in the
+   "/usr/local/include/ignite" directory.
+ * Ignite C++ depends on jni.h file located inside ${JAVA_HOME}/include directory.
+   Add this directory to headers search path: "-I${JAVA_HOME}/include".
+ * Library is placed in the "/usr/local/lib" directory. Link it to your project: "-lignite".
+ * Ignite depends on "libjvm.so" library shipped with Java. Typically this library is located inside
+   $JAVA_HOME/jre/lib/amd64/server directory. Ensure that LD_LIBRARY_PATH environment variable points to this directory.
+
+
+Building on Windows with Visual Studio (tm)
+----------------------------------
+
+Common Requirements:
+
+ * Microsoft Visual Studio (tm) 2010 or later
+ * Windows SDK 7.1
+ * Java Development Kit (JDK) must be installed: https://java.com/en/download/index.jsp
+ * JAVA_HOME environment variable must be set pointing to Java installation directory.
+
+Building the library:
+
+ * Open and build %IGNITE_HOME%\platforms\cpp\src\project\vs\ignite.sln (or ignite_86.sln if you are running
+   32-bit platform).
+
+Development:
+
+ * IGNITE_HOME environment variable must be set to Ignite installation directory.
+ * Update Include Directories in Project Properties with paths to:
+   * $(IGNITE_HOME)\platforms\cpp\src\core\include
+   * $(IGNITE_HOME)\platforms\cpp\src\core\os\win\include
+   * $(IGNITE_HOME)\platforms\cpp\src\common\include
+   * $(IGNITE_HOME)\platforms\cpp\src\common\os\win\include
+   * $(JAVA_HOME)\include
+   * $(JAVA_HOME)\include\win32
+ * Update Library Directories with path to the built binaries
+ * Update Linker\Input\Additional Dependencies in Project Properties with path to
+   * ignite.common.lib
+   * ignite.core.lib
+ * Make sure that your application is aware about ignite.common.dll and ignite.core.dll libraries. The easiest way
+   to achieve this is to either make sure these files are in %PATH%, or to put them into the output directory of
+   your project with help of PostBuild events.

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/common/Makefile.am
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/common/Makefile.am b/modules/platform/cpp/common/Makefile.am
new file mode 100644
index 0000000..f5ca5dd
--- /dev/null
+++ b/modules/platform/cpp/common/Makefile.am
@@ -0,0 +1,45 @@
+##
+## Licensed to the Apache Software Foundation (ASF) under one or more
+## contributor license agreements.  See the NOTICE file distributed with
+## this work for additional information regarding copyright ownership.
+## The ASF licenses this file to You under the Apache License, Version 2.0
+## (the "License"); you may not use this file except in compliance with
+## the License.  You may obtain a copy of the License at
+##
+##      http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS,
+## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+## See the License for the specific language governing permissions and
+## limitations under the License.
+##
+
+ACLOCAL_AMFLAGS = "-Im4"
+
+SUBDIRS = . include os/linux/include
+DIST_SUBDIRS = . include os/linux/include
+
+AM_CPPFLAGS = -I$(srcdir)/include -I$(srcdir)/os/linux/include -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/linux -DIGNITE_IMPL
+AM_CXXFLAGS = -Wall -std=c++0x
+LIB_LDFLAGS = -no-undefined -version-info 1
+
+COMMON_SRC = os/linux/src/concurrent_os.cpp \
+             src/concurrent.cpp \
+             src/java.cpp \
+             src/exports.cpp \
+             os/linux/src/common.cpp
+
+lib_LTLIBRARIES = libignite-common.la
+libignite_common_la_SOURCES = $(COMMON_SRC)
+libignite_common_la_LIBADD = -L$(JAVA_HOME)/jre/lib/amd64/server
+libignite_common_la_LDFLAGS = $(LIB_LDFLAGS) -L/usr/local/lib -ljvm -version-info 0:0:0 -release $(PACKAGE_VERSION)
+
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = ignite-common.pc
+
+clean-local:
+	$(RM) *.gcno *.gcda
+
+clean-docs:
+	$(RM) $(DX_CLEANFILES)

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/common/configure.ac
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/common/configure.ac b/modules/platform/cpp/common/configure.ac
new file mode 100644
index 0000000..5cab969
--- /dev/null
+++ b/modules/platform/cpp/common/configure.ac
@@ -0,0 +1,62 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+#                                               -*- Autoconf -*-
+# Process this file with autoconf to produce a configure script.
+
+AC_PREREQ([2.69])
+AC_INIT([Apache Ignite JNI bridge for C++], [1.5.0], [dev@ignite.apache.org], [ignite-common], [ignite.apache.org])
+AC_CONFIG_SRCDIR(src)
+
+AC_CANONICAL_SYSTEM
+AC_CONFIG_MACRO_DIR([m4])
+AC_LANG([C++])
+
+# Initialize automake
+AM_INIT_AUTOMAKE([-Wall foreign subdir-objects])
+AC_CONFIG_HEADER(config.h)
+
+AM_PROG_AR
+
+# Checks for programs.
+GXX="-g -O2"
+
+AC_PROG_CXX
+
+# Initialize Libtool
+LT_INIT
+
+# Checks for libraries.
+AC_CHECK_LIB([pthread], [pthread_mutex_lock])
+
+# Checks for header files.
+
+# Checks for typedefs, structures, and compiler characteristics.
+AC_C_INLINE
+AC_TYPE_INT16_T
+AC_TYPE_INT32_T
+AC_TYPE_INT64_T
+AC_TYPE_INT8_T
+AC_TYPE_PID_T
+AC_TYPE_SIZE_T
+
+# Checks for library functions.
+AC_FUNC_ERROR_AT_LINE
+
+AC_CONFIG_FILES(Makefile include/Makefile os/linux/include/Makefile ignite-common.pc)
+
+AC_OUTPUT

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/common/ignite-common.pc.in
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/common/ignite-common.pc.in b/modules/platform/cpp/common/ignite-common.pc.in
new file mode 100644
index 0000000..b8c40d2
--- /dev/null
+++ b/modules/platform/cpp/common/ignite-common.pc.in
@@ -0,0 +1,9 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: ignite-common
+Description: Apache Ignite JNI bridge for C++.
+Version: @PACKAGE_VERSION@
+Libs: -L${libdir} -lignite-common

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/common/include/Makefile.am
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/common/include/Makefile.am b/modules/platform/cpp/common/include/Makefile.am
new file mode 100644
index 0000000..5db1d4a
--- /dev/null
+++ b/modules/platform/cpp/common/include/Makefile.am
@@ -0,0 +1,22 @@
+##
+## Licensed to the Apache Software Foundation (ASF) under one or more
+## contributor license agreements.  See the NOTICE file distributed with
+## this work for additional information regarding copyright ownership.
+## The ASF licenses this file to You under the Apache License, Version 2.0
+## (the "License"); you may not use this file except in compliance with
+## the License.  You may obtain a copy of the License at
+##
+##      http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS,
+## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+## See the License for the specific language governing permissions and
+## limitations under the License.
+##
+
+ACLOCAL_AMFLAGS = "-Im4"
+
+nobase_include_HEADERS = ignite/common/concurrent.h \
+                         ignite/common/java.h \
+                         ignite/common/exports.h

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/common/include/ignite/common/concurrent.h
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/common/include/ignite/common/concurrent.h b/modules/platform/cpp/common/include/ignite/common/concurrent.h
new file mode 100644
index 0000000..1c9ab22
--- /dev/null
+++ b/modules/platform/cpp/common/include/ignite/common/concurrent.h
@@ -0,0 +1,210 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _IGNITE_COMMON_CONCURRENT
+#define _IGNITE_COMMON_CONCURRENT
+
+#include "ignite/common/concurrent_os.h"
+
+namespace ignite
+{
+    namespace common
+    {
+        namespace concurrent
+        {
+            /**
+             * Default deleter implementation.
+             *
+             * @param obj Object to be deleted.
+             */
+            template<typename T>
+            IGNITE_IMPORT_EXPORT void SharedPointerDefaultDeleter(T* obj)
+            {
+                delete obj;
+            }
+
+            /**
+             * Holder of shared pointer data.
+             */
+            class IGNITE_IMPORT_EXPORT SharedPointerImpl
+            {
+            public:
+                /**
+                 * Constructor.
+                 *
+                 * @param ptr Raw pointer.
+                 */
+                SharedPointerImpl(void* ptr);
+
+                /**
+                 * Get raw pointer.
+                 *
+                 * @return Raw pointer.
+                 */
+                void* Pointer();
+
+                /**
+                 * Increment usage counter.
+                 */
+                void Increment();
+
+                /**
+                 * Decrement usage counter.
+                 *
+                 * @return True if counter reached zero.
+                 */
+                bool Decrement();
+            private:
+                /** Raw pointer. */
+                void* ptr;
+
+                /** Reference count. */
+                int32_t refCnt;
+
+                IGNITE_NO_COPY_ASSIGNMENT(SharedPointerImpl)
+            };
+
+            /**
+             * Shared pointer.
+             */
+            template<typename T>
+            class IGNITE_IMPORT_EXPORT SharedPointer
+            {
+            public:
+                /**
+                 * Constructor.
+                 */
+                SharedPointer() : impl(NULL), deleter(NULL)
+                {
+                    // No-op.
+                }
+
+                /**
+                 * Constructor.
+                 *
+                 * @param ptr Raw pointer.
+                 */
+                explicit SharedPointer(T* ptr)
+                {
+                    if (ptr)
+                    {
+                        impl = new SharedPointerImpl(ptr);
+                        deleter = SharedPointerDefaultDeleter;
+                    }
+                    else
+                    {
+                        impl = NULL;
+                        deleter = NULL;
+                    }
+                }
+
+                /**
+                 * Constructor.
+                 *
+                 * @param ptr Raw pointer.
+                 * @param deleter Delete function.
+                 */
+                SharedPointer(T* ptr, void(*deleter)(T*))
+                {
+                    if (ptr)
+                    {
+                        this->impl = new SharedPointerImpl(ptr);
+                        this->deleter = deleter;
+                    }
+                    else
+                    {
+                        this->impl = NULL;
+                        this->deleter = NULL;
+                    }
+                }
+
+                /**
+                 * Copy constructor.
+                 *
+                 * @param other Instance to copy.
+                 */
+                SharedPointer(const SharedPointer& other)
+                {
+                    impl = other.impl;
+                    deleter = other.deleter;
+
+                    if (impl)
+                        impl->Increment();
+                }
+
+                /**
+                 * Assignment operator.
+                 *
+                 * @param other Other instance.
+                 */
+                SharedPointer& operator=(const SharedPointer& other)
+                {
+                    if (this != &other)
+                    {
+                        // 1. Create new instance.
+                        SharedPointer tmp(other);
+
+                        // 2. Swap with temp.
+                        SharedPointerImpl* impl0 = impl;
+                        void(*deleter0)(T*) = deleter;
+
+                        impl = tmp.impl;
+                        deleter = tmp.deleter;
+
+                        tmp.impl = impl0;
+                        tmp.deleter = deleter0;
+                    }
+
+                    return *this;
+                }
+
+                /**
+                 * Destructor.
+                 */
+                ~SharedPointer()
+                {
+                    if (impl && impl->Decrement())
+                    {
+                        T* ptr = Get();
+
+                        delete impl;
+
+                        deleter(ptr);
+                    }
+                }
+
+                /**
+                 * Get raw pointer.
+                 *
+                 * @return Raw pointer.
+                 */
+                T* Get()
+                {
+                    return impl ? static_cast<T*>(impl->Pointer()) : NULL;
+                }
+            private:
+                /** Implementation. */
+                SharedPointerImpl* impl;
+
+                /** Delete function. */
+                void(*deleter)(T*);
+            };
+        }
+    }
+}
+
+#endif
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/common/include/ignite/common/exports.h
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/common/include/ignite/common/exports.h b/modules/platform/cpp/common/include/ignite/common/exports.h
new file mode 100644
index 0000000..930fad3
--- /dev/null
+++ b/modules/platform/cpp/common/include/ignite/common/exports.h
@@ -0,0 +1,145 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _IGNITE_COMMON_EXPORTS
+#define _IGNITE_COMMON_EXPORTS
+
+#include "ignite/common/java.h"
+
+namespace gcj = ignite::common::java;
+
+extern "C" {
+    int IGNITE_CALL IgniteReallocate(long long memPtr, int cap);
+
+    void* IGNITE_CALL IgniteIgnitionStart(gcj::JniContext* ctx, char* cfgPath, char* name, int factoryId, long long dataPtr);
+    void* IGNITE_CALL IgniteIgnitionInstance(gcj::JniContext* ctx, char* name);
+    long long IGNITE_CALL IgniteIgnitionEnvironmentPointer(gcj::JniContext* ctx, char* name);
+    bool IGNITE_CALL IgniteIgnitionStop(gcj::JniContext* ctx, char* name, bool cancel);
+    void IGNITE_CALL IgniteIgnitionStopAll(gcj::JniContext* ctx, bool cancel);
+
+    void IGNITE_CALL IgniteProcessorReleaseStart(gcj::JniContext* ctx, void* obj);
+    void* IGNITE_CALL IgniteProcessorProjection(gcj::JniContext* ctx, void* obj);
+    void* IGNITE_CALL IgniteProcessorCache(gcj::JniContext* ctx, void* obj, char* name);
+    void* IGNITE_CALL IgniteProcessorCreateCache(gcj::JniContext* ctx, void* obj, char* name);
+    void* IGNITE_CALL IgniteProcessorGetOrCreateCache(gcj::JniContext* ctx, void* obj, char* name);
+    void* IGNITE_CALL IgniteProcessorAffinity(gcj::JniContext* ctx, void* obj, char* name);
+    void* IGNITE_CALL IgniteProcessorDataStreamer(gcj::JniContext* ctx, void* obj, char* name, bool keepPortable);
+    void* IGNITE_CALL IgniteProcessorTransactions(gcj::JniContext* ctx, void* obj);
+    void* IGNITE_CALL IgniteProcessorCompute(gcj::JniContext* ctx, void* obj, void* prj);
+    void* IGNITE_CALL IgniteProcessorMessage(gcj::JniContext* ctx, void* obj, void* prj);
+    void* IGNITE_CALL IgniteProcessorEvents(gcj::JniContext* ctx, void* obj, void* prj);
+    void* IGNITE_CALL IgniteProcessorServices(gcj::JniContext* ctx, void* obj, void* prj);
+    void* IGNITE_CALL IgniteProcessorExtensions(gcj::JniContext* ctx, void* obj);
+    
+    long long IGNITE_CALL IgniteTargetInStreamOutLong(gcj::JniContext* ctx, void* obj, int opType, long long memPtr);
+    void IGNITE_CALL IgniteTargetInStreamOutStream(gcj::JniContext* ctx, void* obj, int opType, long long inMemPtr, long long outMemPtr);
+    void* IGNITE_CALL IgniteTargetInStreamOutObject(gcj::JniContext* ctx, void* obj, int opType, long long memPtr);
+    void IGNITE_CALL IgniteTargetInObjectStreamOutStream(gcj::JniContext* ctx, void* obj, int opType, void* arg, long long inMemPtr, long long outMemPtr);
+    long long IGNITE_CALL IgniteTargetOutLong(gcj::JniContext* ctx, void* obj, int opType);
+    void IGNITE_CALL IgniteTargetOutStream(gcj::JniContext* ctx, void* obj, int opType, long long memPtr);
+    void* IGNITE_CALL IgniteTargetOutObject(gcj::JniContext* ctx, void* obj, int opType);
+    void IGNITE_CALL IgniteTargetListenFuture(gcj::JniContext* ctx, void* obj, long long futId, int typ);
+    void IGNITE_CALL IgniteTargetListenFutureForOperation(gcj::JniContext* ctx, void* obj, long long futId, int typ, int opId);
+
+    int IGNITE_CALL IgniteAffinityPartitions(gcj::JniContext* ctx, void* obj);
+
+    void* IGNITE_CALL IgniteCacheWithSkipStore(gcj::JniContext* ctx, void* obj);
+    void* IGNITE_CALL IgniteCacheWithNoRetries(gcj::JniContext* ctx, void* obj);
+    void* IGNITE_CALL IgniteCacheWithExpiryPolicy(gcj::JniContext* ctx, void* obj, long long create, long long update, long long access);
+    void* IGNITE_CALL IgniteCacheWithAsync(gcj::JniContext* ctx, void* obj);
+    void* IGNITE_CALL IgniteCacheWithKeepPortable(gcj::JniContext* ctx, void* obj);
+    void IGNITE_CALL IgniteCacheClear(gcj::JniContext* ctx, void* obj);
+    void IGNITE_CALL IgniteCacheRemoveAll(gcj::JniContext* ctx, void* obj);
+    void* IGNITE_CALL IgniteCacheOutOpQueryCursor(gcj::JniContext* ctx, void* obj, int type, long long memPtr);
+    void* IGNITE_CALL IgniteCacheOutOpContinuousQuery(gcj::JniContext* ctx, void* obj, int type, long long memPtr);
+    void* IGNITE_CALL IgniteCacheIterator(gcj::JniContext* ctx, void* obj);
+    void* IGNITE_CALL IgniteCacheLocalIterator(gcj::JniContext* ctx, void* obj, int peekModes);
+    void IGNITE_CALL IgniteCacheEnterLock(gcj::JniContext* ctx, void* obj, long long id);
+    void IGNITE_CALL IgniteCacheExitLock(gcj::JniContext* ctx, void* obj, long long id);
+    bool IGNITE_CALL IgniteCacheTryEnterLock(gcj::JniContext* ctx, void* obj, long long id, long long timeout);
+    void IGNITE_CALL IgniteCacheCloseLock(gcj::JniContext* ctx, void* obj, long long id);
+    void IGNITE_CALL IgniteCacheRebalance(gcj::JniContext* ctx, void* obj, long long futId);
+    int IGNITE_CALL IgniteCacheSize(gcj::JniContext* ctx, void* obj, int peekModes, bool loc);
+
+    void IGNITE_CALL IgniteCacheStoreCallbackInvoke(gcj::JniContext* ctx, void* obj, long long memPtr);
+
+    void IGNITE_CALL IgniteComputeWithNoFailover(gcj::JniContext* ctx, void* obj);
+    void IGNITE_CALL IgniteComputeWithTimeout(gcj::JniContext* ctx, void* obj, long long timeout);
+    void IGNITE_CALL IgniteComputeExecuteNative(gcj::JniContext* ctx, void* obj, long long taskPtr, long long topVer);
+
+    void IGNITE_CALL IgniteContinuousQueryClose(gcj::JniContext* ctx, void* obj);
+    void* IGNITE_CALL IgniteContinuousQueryGetInitialQueryCursor(gcj::JniContext* ctx, void* obj);
+
+    void IGNITE_CALL IgniteDataStreamerListenTopology(gcj::JniContext* ctx, void* obj, long long ptr);
+    bool IGNITE_CALL IgniteDataStreamerAllowOverwriteGet(gcj::JniContext* ctx, void* obj);
+    void IGNITE_CALL IgniteDataStreamerAllowOverwriteSet(gcj::JniContext* ctx, void* obj, bool val);
+    bool IGNITE_CALL IgniteDataStreamerSkipStoreGet(gcj::JniContext* ctx, void* obj);
+    void IGNITE_CALL IgniteDataStreamerSkipStoreSet(gcj::JniContext* ctx, void* obj, bool val);
+    int IGNITE_CALL IgniteDataStreamerPerNodeBufferSizeGet(gcj::JniContext* ctx, void* obj);
+    void IGNITE_CALL IgniteDataStreamerPerNodeBufferSizeSet(gcj::JniContext* ctx, void* obj, int val);
+    int IGNITE_CALL IgniteDataStreamerPerNodeParallelOperationsGet(gcj::JniContext* ctx, void* obj);
+    void IGNITE_CALL IgniteDataStreamerPerNodeParallelOperationsSet(gcj::JniContext* ctx, void* obj, int val);
+
+    void* IGNITE_CALL IgniteMessagingWithAsync(gcj::JniContext* ctx, void* obj);
+
+    void* IGNITE_CALL IgniteProjectionForOthers(gcj::JniContext* ctx, void* obj, void* prj);
+    void* IGNITE_CALL IgniteProjectionForRemotes(gcj::JniContext* ctx, void* obj);
+    void* IGNITE_CALL IgniteProjectionForDaemons(gcj::JniContext* ctx, void* obj);
+    void* IGNITE_CALL IgniteProjectionForRandom(gcj::JniContext* ctx, void* obj);
+    void* IGNITE_CALL IgniteProjectionForOldest(gcj::JniContext* ctx, void* obj);
+    void* IGNITE_CALL IgniteProjectionForYoungest(gcj::JniContext* ctx, void* obj);
+    void IGNITE_CALL IgniteProjectionResetMetrics(gcj::JniContext* ctx, void* obj);
+    void* IGNITE_CALL IgniteProjectionOutOpRet(gcj::JniContext* ctx, void* obj, int type, long long memPtr);
+
+    void IGNITE_CALL IgniteQueryCursorIterator(gcj::JniContext* ctx, void* obj);
+    void IGNITE_CALL IgniteQueryCursorClose(gcj::JniContext* ctx, void* obj);
+
+    long long IGNITE_CALL IgniteTransactionsStart(gcj::JniContext* ctx, void* obj, int concurrency, int isolation, long long timeout, int txSize);
+    int IGNITE_CALL IgniteTransactionsCommit(gcj::JniContext* ctx, void* obj, long long id);
+    void IGNITE_CALL IgniteTransactionsCommitAsync(gcj::JniContext* ctx, void* obj, long long id, long long futId);
+    int IGNITE_CALL IgniteTransactionsRollback(gcj::JniContext* ctx, void* obj, long long id);
+    void IGNITE_CALL IgniteTransactionsRollbackAsync(gcj::JniContext* ctx, void* obj, long long id, long long futId);
+    int IGNITE_CALL IgniteTransactionsClose(gcj::JniContext* ctx, void* obj, long long id);
+    int IGNITE_CALL IgniteTransactionsState(gcj::JniContext* ctx, void* obj, long long id);
+    bool IGNITE_CALL IgniteTransactionsSetRollbackOnly(gcj::JniContext* ctx, void* obj, long long id);
+    void IGNITE_CALL IgniteTransactionsResetMetrics(gcj::JniContext* ctx, void* obj);
+
+    void* IGNITE_CALL IgniteAcquire(gcj::JniContext* ctx, void* obj);
+    void IGNITE_CALL IgniteRelease(void* obj);
+
+    void IGNITE_CALL IgniteThrowToJava(gcj::JniContext* ctx, char* errMsg);
+    
+    int IGNITE_CALL IgniteHandlersSize();
+
+    void* IGNITE_CALL IgniteCreateContext(char** opts, int optsLen, gcj::JniHandlers* cbs);
+    void IGNITE_CALL IgniteDeleteContext(gcj::JniContext* ctx);
+
+    void IGNITE_CALL IgniteDestroyJvm(gcj::JniContext* ctx);
+
+    void* IGNITE_CALL IgniteEventsWithAsync(gcj::JniContext* ctx, void* obj);
+    bool IGNITE_CALL IgniteEventsStopLocalListen(gcj::JniContext* ctx, void* obj, long long hnd);
+    void IGNITE_CALL IgniteEventsLocalListen(gcj::JniContext* ctx, void* obj, long long hnd, int type);
+    bool IGNITE_CALL IgniteEventsIsEnabled(gcj::JniContext* ctx, void* obj, int type);
+        
+	void* IGNITE_CALL IgniteServicesWithAsync(gcj::JniContext* ctx, void* obj);
+	void* IGNITE_CALL IgniteServicesWithServerKeepPortable(gcj::JniContext* ctx, void* obj);
+	void IGNITE_CALL IgniteServicesCancel(gcj::JniContext* ctx, void* obj, char* name);
+	void IGNITE_CALL IgniteServicesCancelAll(gcj::JniContext* ctx, void* obj);
+	void* IGNITE_CALL IgniteServicesGetServiceProxy(gcj::JniContext* ctx, void* obj, char* name, bool sticky);
+}
+
+#endif
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/common/include/ignite/common/java.h
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/common/include/ignite/common/java.h b/modules/platform/cpp/common/include/ignite/common/java.h
new file mode 100644
index 0000000..01ecbe3
--- /dev/null
+++ b/modules/platform/cpp/common/include/ignite/common/java.h
@@ -0,0 +1,652 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _IGNITE_COMMON_JVM
+#define _IGNITE_COMMON_JVM
+
+#include <jni.h>
+
+#include "ignite/common/common.h"
+
+namespace ignite
+{
+    namespace common
+    {
+        namespace java
+        {
+            /* Error constants. */
+            const int IGNITE_JNI_ERR_SUCCESS = 0;
+            const int IGNITE_JNI_ERR_GENERIC = 1;
+            const int IGNITE_JNI_ERR_JVM_INIT = 2;
+            const int IGNITE_JNI_ERR_JVM_ATTACH = 3;
+
+            /* Handlers for callbacks from Java. */
+            typedef long long(JNICALL *CacheStoreCreateHandler)(void* target, long long memPtr);
+            typedef int(JNICALL *CacheStoreInvokeHandler)(void* target, long long objPtr, long long memPtr, void* cb);
+            typedef void(JNICALL *CacheStoreDestroyHandler)(void* target, long long objPtr);
+            typedef long long(JNICALL *CacheStoreSessionCreateHandler)(void* target, long long storePtr);
+
+            typedef long long(JNICALL *CacheEntryFilterCreateHandler)(void* target, long long memPtr);
+            typedef int(JNICALL *CacheEntryFilterApplyHandler)(void* target, long long ptr, long long memPtr);
+            typedef void(JNICALL *CacheEntryFilterDestroyHandler)(void* target, long long ptr);
+
+            typedef void(JNICALL *CacheInvokeHandler)(void* target, long long inMemPtr, long long outMemPtr);
+
+            typedef void(JNICALL *ComputeTaskMapHandler)(void* target, long long taskPtr, long long inMemPtr, long long outMemPtr);
+            typedef int(JNICALL *ComputeTaskJobResultHandler)(void* target, long long taskPtr, long long jobPtr, long long memPtr);
+            typedef void(JNICALL *ComputeTaskReduceHandler)(void* target, long long taskPtr);
+            typedef void(JNICALL *ComputeTaskCompleteHandler)(void* target, long long taskPtr, long long memPtr);
+            typedef int(JNICALL *ComputeJobSerializeHandler)(void* target, long long jobPtr, long long memPtr);
+            typedef long long(JNICALL *ComputeJobCreateHandler)(void* target, long long memPtr);
+            typedef void(JNICALL *ComputeJobExecuteHandler)(void* target, long long jobPtr, int cancel, long long memPtr);
+            typedef void(JNICALL *ComputeJobCancelHandler)(void* target, long long jobPtr);
+            typedef void(JNICALL *ComputeJobDestroyHandler)(void* target, long long jobPtr);
+
+            typedef void(JNICALL *ContinuousQueryListenerApplyHandler)(void* target, long long lsnrPtr, long long memPtr);
+            typedef long long(JNICALL *ContinuousQueryFilterCreateHandler)(void* target, long long memPtr);
+            typedef int(JNICALL *ContinuousQueryFilterApplyHandler)(void* target, long long filterPtr, long long memPtr);
+            typedef void(JNICALL *ContinuousQueryFilterReleaseHandler)(void* target, long long filterPtr);
+
+			typedef void(JNICALL *DataStreamerTopologyUpdateHandler)(void* target, long long ldrPtr, long long topVer, int topSize);
+			typedef void(JNICALL *DataStreamerStreamReceiverInvokeHandler)(void* target, long long ptr, void* cache, long long memPtr, unsigned char keepPortable);
+
+            typedef void(JNICALL *FutureByteResultHandler)(void* target, long long futAddr, int res);
+            typedef void(JNICALL *FutureBoolResultHandler)(void* target, long long futAddr, int res);
+            typedef void(JNICALL *FutureShortResultHandler)(void* target, long long futAddr, int res);
+            typedef void(JNICALL *FutureCharResultHandler)(void* target, long long futAddr, int res);
+            typedef void(JNICALL *FutureIntResultHandler)(void* target, long long futAddr, int res);
+            typedef void(JNICALL *FutureFloatResultHandler)(void* target, long long futAddr, float res);
+            typedef void(JNICALL *FutureLongResultHandler)(void* target, long long futAddr, long long res);
+            typedef void(JNICALL *FutureDoubleResultHandler)(void* target, long long futAddr, double res);
+            typedef void(JNICALL *FutureObjectResultHandler)(void* target, long long futAddr, long long memPtr);
+            typedef void(JNICALL *FutureNullResultHandler)(void* target, long long futAddr);
+            typedef void(JNICALL *FutureErrorHandler)(void* target, long long futAddr, long long memPtr);
+
+            typedef void(JNICALL *LifecycleEventHandler)(void* target, long long ptr, int evt);
+
+            typedef void(JNICALL *MemoryReallocateHandler)(void* target, long long memPtr, int cap);
+
+            typedef long long(JNICALL *MessagingFilterCreateHandler)(void* target, long long memPtr);
+            typedef int(JNICALL *MessagingFilterApplyHandler)(void* target, long long ptr, long long memPtr);
+            typedef void(JNICALL *MessagingFilterDestroyHandler)(void* target, long long ptr);
+
+            typedef long long(JNICALL *EventFilterCreateHandler)(void* target, long long memPtr);
+            typedef int(JNICALL *EventFilterApplyHandler)(void* target, long long ptr, long long memPtr);
+            typedef void(JNICALL *EventFilterDestroyHandler)(void* target, long long ptr);
+
+			typedef long long(JNICALL *ServiceInitHandler)(void* target, long long memPtr);
+			typedef void(JNICALL *ServiceExecuteHandler)(void* target, long long svcPtr, long long memPtr);
+			typedef void(JNICALL *ServiceCancelHandler)(void* target, long long svcPtr, long long memPtr);
+			typedef void(JNICALL *ServiceInvokeMethodHandler)(void* target, long long svcPtr, long long inMemPtr, long long outMemPtr);
+			typedef int(JNICALL *ClusterNodeFilterApplyHandler)(void* target, long long memPtr);
+
+            typedef long long(JNICALL *NodeInfoHandler)(void* target, long long memPtr);
+
+            typedef void(JNICALL *OnStartHandler)(void* target, void* proc, long long memPtr);
+            typedef void(JNICALL *OnStopHandler)(void* target);
+            typedef void(JNICALL *ErrorHandler)(void* target, int errCode, const char* errClsChars, int errClsCharsLen, const char* errMsgChars, int errMsgCharsLen, void* errData, int errDataLen);
+
+            typedef long long(JNICALL *ExtensionCallbackInLongOutLongHandler)(void* target, int typ, long long arg1);
+            typedef long long(JNICALL *ExtensionCallbackInLongLongOutLongHandler)(void* target, int typ, long long arg1, long long arg2);
+
+            /**
+             * JNI handlers holder.
+             */
+            struct JniHandlers {
+                void* target;
+
+                CacheStoreCreateHandler cacheStoreCreate;
+                CacheStoreInvokeHandler cacheStoreInvoke;
+                CacheStoreDestroyHandler cacheStoreDestroy;
+                CacheStoreSessionCreateHandler cacheStoreSessionCreate;
+
+                CacheEntryFilterCreateHandler cacheEntryFilterCreate;
+                CacheEntryFilterApplyHandler cacheEntryFilterApply;
+                CacheEntryFilterDestroyHandler cacheEntryFilterDestroy;
+
+                CacheInvokeHandler cacheInvoke;
+
+                ComputeTaskMapHandler computeTaskMap;
+                ComputeTaskJobResultHandler computeTaskJobRes;
+                ComputeTaskReduceHandler computeTaskReduce;
+                ComputeTaskCompleteHandler computeTaskComplete;
+                ComputeJobSerializeHandler computeJobSerialize;
+                ComputeJobCreateHandler computeJobCreate;
+                ComputeJobExecuteHandler computeJobExec;
+                ComputeJobCancelHandler computeJobCancel;
+                ComputeJobDestroyHandler computeJobDestroy;
+
+                ContinuousQueryListenerApplyHandler contQryLsnrApply;
+                ContinuousQueryFilterCreateHandler contQryFilterCreate;
+                ContinuousQueryFilterApplyHandler contQryFilterApply;
+                ContinuousQueryFilterReleaseHandler contQryFilterRelease;
+
+				DataStreamerTopologyUpdateHandler dataStreamerTopologyUpdate;
+				DataStreamerStreamReceiverInvokeHandler streamReceiverInvoke;
+
+                FutureByteResultHandler futByteRes;
+                FutureBoolResultHandler futBoolRes;
+                FutureShortResultHandler futShortRes;
+                FutureCharResultHandler futCharRes;
+                FutureIntResultHandler futIntRes;
+                FutureFloatResultHandler futFloatRes;
+                FutureLongResultHandler futLongRes;
+                FutureDoubleResultHandler futDoubleRes;
+                FutureObjectResultHandler futObjRes;
+                FutureNullResultHandler futNullRes;
+                FutureErrorHandler futErr;
+
+                LifecycleEventHandler lifecycleEvt;
+
+                MemoryReallocateHandler memRealloc;
+
+                MessagingFilterCreateHandler messagingFilterCreate;
+                MessagingFilterApplyHandler messagingFilterApply;
+                MessagingFilterDestroyHandler messagingFilterDestroy;
+                
+                EventFilterCreateHandler eventFilterCreate;
+                EventFilterApplyHandler eventFilterApply;
+                EventFilterDestroyHandler eventFilterDestroy;
+
+				ServiceInitHandler serviceInit;
+				ServiceExecuteHandler serviceExecute;
+				ServiceCancelHandler serviceCancel;
+				ServiceInvokeMethodHandler serviceInvokeMethod;
+				
+				ClusterNodeFilterApplyHandler clusterNodeFilterApply;
+
+                NodeInfoHandler nodeInfo;
+
+                OnStartHandler onStart;
+                OnStopHandler onStop;
+                ErrorHandler error;
+
+                ExtensionCallbackInLongOutLongHandler extensionCallbackInLongOutLong;
+                ExtensionCallbackInLongLongOutLongHandler extensionCallbackInLongLongOutLong;
+            };
+
+            /**
+             * JNI Java members.
+             */
+            struct JniJavaMembers {
+                jclass c_Class;
+                jmethodID m_Class_getName;
+
+                jclass c_Throwable;
+                jmethodID m_Throwable_getMessage;
+                jmethodID m_Throwable_printStackTrace;
+
+                /**
+                 * Constructor.
+                 */
+                void Initialize(JNIEnv* env);
+
+                /**
+                 * Destroy members releasing all allocated classes.
+                 */
+                void Destroy(JNIEnv* env);
+
+                /**
+                 * Write error information.
+                 */
+                bool WriteErrorInfo(JNIEnv* env, char** errClsName, int* errClsNameLen, char** errMsg, int* errMsgLen);
+            };
+
+            /**
+             * JNI members.
+             */
+            struct JniMembers {
+                jclass c_PlatformAbstractQryCursor;
+                jmethodID m_PlatformAbstractQryCursor_iter;
+                jmethodID m_PlatformAbstractQryCursor_iterHasNext;
+                jmethodID m_PlatformAbstractQryCursor_close;
+
+                jclass c_PlatformAffinity;
+                jmethodID m_PlatformAffinity_partitions;
+
+                jclass c_PlatformCache;
+                jmethodID m_PlatformCache_withSkipStore;
+                jmethodID m_PlatformCache_withNoRetries;
+                jmethodID m_PlatformCache_withExpiryPolicy;
+                jmethodID m_PlatformCache_withAsync;
+                jmethodID m_PlatformCache_withKeepPortable;
+                jmethodID m_PlatformCache_clear;
+                jmethodID m_PlatformCache_removeAll;
+                jmethodID m_PlatformCache_iterator;
+                jmethodID m_PlatformCache_localIterator;
+                jmethodID m_PlatformCache_enterLock;
+                jmethodID m_PlatformCache_exitLock;
+                jmethodID m_PlatformCache_tryEnterLock;
+                jmethodID m_PlatformCache_closeLock;
+                jmethodID m_PlatformCache_rebalance;
+                jmethodID m_PlatformCache_size;
+
+                jclass c_PlatformCacheStoreCallback;
+                jmethodID m_PlatformCacheStoreCallback_invoke;
+
+                jclass c_IgniteException;
+
+                jclass c_PlatformClusterGroup;
+                jmethodID m_PlatformClusterGroup_forOthers;
+                jmethodID m_PlatformClusterGroup_forRemotes;
+                jmethodID m_PlatformClusterGroup_forDaemons;
+                jmethodID m_PlatformClusterGroup_forRandom;
+                jmethodID m_PlatformClusterGroup_forOldest;
+                jmethodID m_PlatformClusterGroup_forYoungest;
+                jmethodID m_PlatformClusterGroup_resetMetrics;
+
+                jclass c_PlatformCompute;
+                jmethodID m_PlatformCompute_withNoFailover;
+                jmethodID m_PlatformCompute_withTimeout;
+                jmethodID m_PlatformCompute_executeNative;
+
+                jclass c_PlatformContinuousQuery;
+                jmethodID m_PlatformContinuousQuery_close;
+                jmethodID m_PlatformContinuousQuery_getInitialQueryCursor;
+
+                jclass c_PlatformDataStreamer;
+                jmethodID m_PlatformDataStreamer_listenTopology;
+                jmethodID m_PlatformDataStreamer_getAllowOverwrite;
+                jmethodID m_PlatformDataStreamer_setAllowOverwrite;
+                jmethodID m_PlatformDataStreamer_getSkipStore;
+                jmethodID m_PlatformDataStreamer_setSkipStore;
+                jmethodID m_PlatformDataStreamer_getPerNodeBufSize;
+                jmethodID m_PlatformDataStreamer_setPerNodeBufSize;
+                jmethodID m_PlatformDataStreamer_getPerNodeParallelOps;
+                jmethodID m_PlatformDataStreamer_setPerNodeParallelOps;
+                
+                jclass c_PlatformEvents;
+                jmethodID m_PlatformEvents_withAsync;
+                jmethodID m_PlatformEvents_stopLocalListen;
+                jmethodID m_PlatformEvents_localListen;
+                jmethodID m_PlatformEvents_isEnabled;
+                
+				jclass c_PlatformServices;
+				jmethodID m_PlatformServices_withAsync;
+				jmethodID m_PlatformServices_withServerKeepPortable;
+				jmethodID m_PlatformServices_cancel;
+				jmethodID m_PlatformServices_cancelAll;
+				jmethodID m_PlatformServices_serviceProxy;
+
+				jclass c_PlatformIgnition;
+                jmethodID m_PlatformIgnition_start;
+                jmethodID m_PlatformIgnition_instance;
+                jmethodID m_PlatformIgnition_environmentPointer;
+                jmethodID m_PlatformIgnition_stop;
+                jmethodID m_PlatformIgnition_stopAll;
+
+                jclass c_PlatformMessaging;
+                jmethodID m_PlatformMessaging_withAsync;
+
+                jclass c_PlatformProcessor;
+                jmethodID m_PlatformProcessor_releaseStart;
+                jmethodID m_PlatformProcessor_cache;
+                jmethodID m_PlatformProcessor_createCache;
+                jmethodID m_PlatformProcessor_getOrCreateCache;
+                jmethodID m_PlatformProcessor_affinity;
+                jmethodID m_PlatformProcessor_dataStreamer;
+                jmethodID m_PlatformProcessor_transactions;
+                jmethodID m_PlatformProcessor_projection;
+                jmethodID m_PlatformProcessor_compute;
+                jmethodID m_PlatformProcessor_message;
+                jmethodID m_PlatformProcessor_events;
+                jmethodID m_PlatformProcessor_services;
+                jmethodID m_PlatformProcessor_extensions;
+
+                jclass c_PlatformTarget;
+                jmethodID m_PlatformTarget_inStreamOutLong;
+                jmethodID m_PlatformTarget_inStreamOutObject;
+                jmethodID m_PlatformTarget_outLong;
+                jmethodID m_PlatformTarget_outStream;
+                jmethodID m_PlatformTarget_outObject;
+                jmethodID m_PlatformTarget_inStreamOutStream;
+                jmethodID m_PlatformTarget_inObjectStreamOutStream;
+                jmethodID m_PlatformTarget_listenFuture;
+                jmethodID m_PlatformTarget_listenFutureForOperation;
+
+                jclass c_PlatformTransactions;
+                jmethodID m_PlatformTransactions_txStart;
+                jmethodID m_PlatformTransactions_txCommit;
+                jmethodID m_PlatformTransactions_txCommitAsync;
+                jmethodID m_PlatformTransactions_txRollback;
+                jmethodID m_PlatformTransactions_txRollbackAsync;
+                jmethodID m_PlatformTransactions_txState;
+                jmethodID m_PlatformTransactions_txSetRollbackOnly;
+                jmethodID m_PlatformTransactions_txClose;
+                jmethodID m_PlatformTransactions_resetMetrics;
+
+                jclass c_PlatformUtils;
+                jmethodID m_PlatformUtils_reallocate;
+                jmethodID m_PlatformUtils_errData;
+
+                /**
+                 * Constructor.
+                 */
+                void Initialize(JNIEnv* env);
+
+                /**
+                 * Destroy members releasing all allocated classes.
+                 */
+                void Destroy(JNIEnv* env);
+            };
+
+            /**
+             * JNI JVM wrapper.
+             */
+            class IGNITE_IMPORT_EXPORT JniJvm {
+            public:
+                /**
+                 * Default constructor for uninitialized JVM.
+                 */
+                JniJvm();
+
+                /**
+                 * Constructor.
+                 *
+                 * @param jvm JVM.
+                 * @param javaMembers Java members.
+                 * @param members Members.
+                 */
+                JniJvm(JavaVM* jvm, JniJavaMembers javaMembers, JniMembers members);
+
+                /**
+                 * Get JVM.
+                 *
+                 * @param JVM.
+                 */
+                JavaVM* GetJvm();
+
+                /**
+                 * Get Java members.
+                 *
+                 * @param Java members.
+                 */
+                JniJavaMembers& GetJavaMembers();
+
+                /**
+                 * Get members.
+                 *
+                 * @param Members.
+                 */
+                JniMembers& GetMembers();
+            private:
+                /** JVM. */
+                JavaVM* jvm;
+
+                /** Java members. */
+                JniJavaMembers javaMembers;
+
+                /** Members. */
+                JniMembers members;
+            };
+
+            /**
+             * JNI error information.
+             */
+            struct IGNITE_IMPORT_EXPORT JniErrorInfo
+            {
+                int code;
+                char* errCls;
+                char* errMsg;
+
+                /**
+                 * Default constructor. Creates empty error info.
+                 */
+                JniErrorInfo();
+
+                /**
+                 * Constructor.
+                 *
+                 * @param code Code.
+                 * @param errCls Error class.
+                 * @param errMsg Error message.
+                 */
+                JniErrorInfo(int code, const char* errCls, const char* errMsg);
+
+                /**
+                 * Copy constructor.
+                 *
+                 * @param other Other instance.
+                 */
+                JniErrorInfo(const JniErrorInfo& other);
+
+                /**
+                 * Assignment operator overload.
+                 *
+                 * @param other Other instance.
+                 * @return This instance.
+                 */
+                JniErrorInfo& operator=(const JniErrorInfo& other);
+
+                /**
+                 * Destructor.
+                 */
+                ~JniErrorInfo();
+            };
+
+            /**
+             * Unmanaged context.
+             */
+            class IGNITE_IMPORT_EXPORT JniContext {
+            public:
+                static JniContext* Create(char** opts, int optsLen, JniHandlers hnds);
+                static JniContext* Create(char** opts, int optsLen, JniHandlers hnds, JniErrorInfo* errInfo);
+                static int Reallocate(long long memPtr, int cap);
+                static void Detach();
+                static void Release(jobject obj);
+
+                jobject IgnitionStart(char* cfgPath, char* name, int factoryId, long long dataPtr);
+                jobject IgnitionStart(char* cfgPath, char* name, int factoryId, long long dataPtr, JniErrorInfo* errInfo);
+                jobject IgnitionInstance(char* name);
+                jobject IgnitionInstance(char* name, JniErrorInfo* errInfo);
+                long long IgnitionEnvironmentPointer(char* name);
+                long long IgnitionEnvironmentPointer(char* name, JniErrorInfo* errInfo);
+                bool IgnitionStop(char* name, bool cancel);
+                bool IgnitionStop(char* name, bool cancel, JniErrorInfo* errInfo);
+                void IgnitionStopAll(bool cancel);
+                void IgnitionStopAll(bool cancel, JniErrorInfo* errInfo);
+                
+                void ProcessorReleaseStart(jobject obj);
+                jobject ProcessorProjection(jobject obj);
+                jobject ProcessorCache(jobject obj, const char* name);
+                jobject ProcessorCache(jobject obj, const char* name, JniErrorInfo* errInfo);
+                jobject ProcessorCreateCache(jobject obj, const char* name);
+                jobject ProcessorCreateCache(jobject obj, const char* name, JniErrorInfo* errInfo);
+                jobject ProcessorGetOrCreateCache(jobject obj, const char* name);
+                jobject ProcessorGetOrCreateCache(jobject obj, const char* name, JniErrorInfo* errInfo);
+                jobject ProcessorAffinity(jobject obj, const char* name);
+                jobject ProcessorDataStreamer(jobject obj, const char* name, bool keepPortable);
+                jobject ProcessorTransactions(jobject obj);
+                jobject ProcessorCompute(jobject obj, jobject prj);
+                jobject ProcessorMessage(jobject obj, jobject prj);
+                jobject ProcessorEvents(jobject obj, jobject prj);
+                jobject ProcessorServices(jobject obj, jobject prj);
+                jobject ProcessorExtensions(jobject obj);
+                
+                long long TargetInStreamOutLong(jobject obj, int type, long long memPtr, JniErrorInfo* errInfo = NULL);
+                void TargetInStreamOutStream(jobject obj, int opType, long long inMemPtr, long long outMemPtr, JniErrorInfo* errInfo = NULL);
+                jobject TargetInStreamOutObject(jobject obj, int type, long long memPtr, JniErrorInfo* errInfo = NULL);
+                void TargetInObjectStreamOutStream(jobject obj, int opType, void* arg, long long inMemPtr, long long outMemPtr, JniErrorInfo* errInfo = NULL);
+                long long TargetOutLong(jobject obj, int opType, JniErrorInfo* errInfo = NULL);
+                void TargetOutStream(jobject obj, int opType, long long memPtr, JniErrorInfo* errInfo = NULL);
+                jobject TargetOutObject(jobject obj, int opType, JniErrorInfo* errInfo = NULL);
+                void TargetListenFuture(jobject obj, long long futId, int typ);
+                void TargetListenFutureForOperation(jobject obj, long long futId, int typ, int opId);
+                
+                int AffinityPartitions(jobject obj);
+
+                jobject CacheWithSkipStore(jobject obj);
+                jobject CacheWithNoRetries(jobject obj);
+                jobject CacheWithExpiryPolicy(jobject obj, long long create, long long update, long long access);
+                jobject CacheWithAsync(jobject obj);
+                jobject CacheWithKeepPortable(jobject obj);
+                void CacheClear(jobject obj, JniErrorInfo* errInfo = NULL);
+                void CacheRemoveAll(jobject obj, JniErrorInfo* errInfo = NULL);
+                jobject CacheOutOpQueryCursor(jobject obj, int type, long long memPtr, JniErrorInfo* errInfo = NULL);
+                jobject CacheOutOpContinuousQuery(jobject obj, int type, long long memPtr);
+                jobject CacheIterator(jobject obj);
+                jobject CacheLocalIterator(jobject obj, int peekModes);
+                void CacheEnterLock(jobject obj, long long id);
+                void CacheExitLock(jobject obj, long long id);
+                bool CacheTryEnterLock(jobject obj, long long id, long long timeout);
+                void CacheCloseLock(jobject obj, long long id);
+                void CacheRebalance(jobject obj, long long futId);
+                int CacheSize(jobject obj, int peekModes, bool loc, JniErrorInfo* errInfo = NULL);
+
+                void CacheStoreCallbackInvoke(jobject obj, long long memPtr);
+
+                void ComputeWithNoFailover(jobject obj);
+                void ComputeWithTimeout(jobject obj, long long timeout);
+                void ComputeExecuteNative(jobject obj, long long taskPtr, long long topVer);
+
+                void ContinuousQueryClose(jobject obj);
+                void* ContinuousQueryGetInitialQueryCursor(jobject obj);
+
+                void DataStreamerListenTopology(jobject obj, long long ptr);
+                bool DataStreamerAllowOverwriteGet(jobject obj);
+                void DataStreamerAllowOverwriteSet(jobject obj, bool val);
+                bool DataStreamerSkipStoreGet(jobject obj);
+                void DataStreamerSkipStoreSet(jobject obj, bool val);
+                int DataStreamerPerNodeBufferSizeGet(jobject obj);
+                void DataStreamerPerNodeBufferSizeSet(jobject obj, int val);
+                int DataStreamerPerNodeParallelOperationsGet(jobject obj);
+                void DataStreamerPerNodeParallelOperationsSet(jobject obj, int val);
+
+                jobject MessagingWithAsync(jobject obj);
+
+                jobject ProjectionForOthers(jobject obj, jobject prj);
+                jobject ProjectionForRemotes(jobject obj);
+                jobject ProjectionForDaemons(jobject obj);
+                jobject ProjectionForRandom(jobject obj);
+                jobject ProjectionForOldest(jobject obj);
+                jobject ProjectionForYoungest(jobject obj);
+                void ProjectionResetMetrics(jobject obj);
+                jobject ProjectionOutOpRet(jobject obj, int type, long long memPtr);
+
+                void QueryCursorIterator(jobject obj, JniErrorInfo* errInfo = NULL);
+                bool QueryCursorIteratorHasNext(jobject obj, JniErrorInfo* errInfo = NULL);
+                void QueryCursorClose(jobject obj, JniErrorInfo* errInfo = NULL);
+
+                long long TransactionsStart(jobject obj, int concurrency, int isolation, long long timeout, int txSize);
+                int TransactionsCommit(jobject obj, long long id);
+                void TransactionsCommitAsync(jobject obj, long long id, long long futId);
+                int TransactionsRollback(jobject obj, long long id);
+                void TransactionsRollbackAsync(jobject obj, long long id, long long futId);
+                int TransactionsClose(jobject obj, long long id);
+                int TransactionsState(jobject obj, long long id);
+                bool TransactionsSetRollbackOnly(jobject obj, long long id);
+                void TransactionsResetMetrics(jobject obj);
+
+                jobject EventsWithAsync(jobject obj);
+                bool EventsStopLocalListen(jobject obj, long long hnd);
+                void EventsLocalListen(jobject obj, long long hnd, int type);
+                bool EventsIsEnabled(jobject obj, int type);
+                
+				jobject ServicesWithAsync(jobject obj);
+                jobject ServicesWithServerKeepPortable(jobject obj);
+				void ServicesCancel(jobject obj, char* name);
+				void ServicesCancelAll(jobject obj);
+				void* ServicesGetServiceProxy(jobject obj, char* name, bool sticky);
+
+                jobject Acquire(jobject obj);
+
+                void DestroyJvm();
+                void ThrowToJava(char* errMsg);
+            private:
+                JniJvm* jvm;
+                JniHandlers hnds;
+
+                JniContext(JniJvm* jvm, JniHandlers hnds);
+
+                JNIEnv* Attach();
+                void ExceptionCheck(JNIEnv* env);
+                void ExceptionCheck(JNIEnv* env, JniErrorInfo* errInfo);
+                jobject LocalToGlobal(JNIEnv* env, jobject obj);
+                jobject ProcessorCache0(jobject proc, const char* name, jmethodID mthd, JniErrorInfo* errInfo);
+            };
+
+            JNIEXPORT jlong JNICALL JniCacheStoreCreate(JNIEnv *env, jclass cls, jlong envPtr, jlong memPtr);
+            JNIEXPORT jint JNICALL JniCacheStoreInvoke(JNIEnv *env, jclass cls, jlong envPtr, jlong objPtr, jlong memPtr, jobject cb);
+            JNIEXPORT void JNICALL JniCacheStoreDestroy(JNIEnv *env, jclass cls, jlong envPtr, jlong objPtr);
+            JNIEXPORT jlong JNICALL JniCacheStoreSessionCreate(JNIEnv *env, jclass cls, jlong envPtr, jlong storePtr);
+
+            JNIEXPORT jlong JNICALL JniCacheEntryFilterCreate(JNIEnv *env, jclass cls, jlong envPtr, jlong memPtr);
+            JNIEXPORT jint JNICALL JniCacheEntryFilterApply(JNIEnv *env, jclass cls, jlong envPtr, jlong objPtr, jlong memPtr);
+            JNIEXPORT void JNICALL JniCacheEntryFilterDestroy(JNIEnv *env, jclass cls, jlong envPtr, jlong objPtr);
+
+            JNIEXPORT void JNICALL JniCacheInvoke(JNIEnv *env, jclass cls, jlong envPtr, jlong inMemPtr, jlong outMemPtr);
+
+            JNIEXPORT void JNICALL JniComputeTaskMap(JNIEnv *env, jclass cls, jlong envPtr, jlong taskPtr, jlong inMemPtr, jlong outMemPtr);
+            JNIEXPORT jint JNICALL JniComputeTaskJobResult(JNIEnv *env, jclass cls, jlong envPtr, jlong taskPtr, jlong jobPtr, jlong memPtr);
+            JNIEXPORT void JNICALL JniComputeTaskReduce(JNIEnv *env, jclass cls, jlong envPtr, jlong taskPtr);
+            JNIEXPORT void JNICALL JniComputeTaskComplete(JNIEnv *env, jclass cls, jlong envPtr, jlong taskPtr, jlong memPtr);
+            JNIEXPORT jint JNICALL JniComputeJobSerialize(JNIEnv *env, jclass cls, jlong envPtr, jlong jobPtr, jlong memPtr);
+            JNIEXPORT jlong JNICALL JniComputeJobCreate(JNIEnv *env, jclass cls, jlong envPtr, jlong memPtr);
+            JNIEXPORT void JNICALL JniComputeJobExecute(JNIEnv *env, jclass cls, jlong envPtr, jlong jobPtr, jint cancel, jlong memPtr);
+            JNIEXPORT void JNICALL JniComputeJobCancel(JNIEnv *env, jclass cls, jlong envPtr, jlong jobPtr);
+            JNIEXPORT void JNICALL JniComputeJobDestroy(JNIEnv *env, jclass cls, jlong envPtr, jlong jobPtr);
+
+            JNIEXPORT void JNICALL JniContinuousQueryListenerApply(JNIEnv *env, jclass cls, jlong envPtr, jlong cbPtr, jlong memPtr);
+            JNIEXPORT jlong JNICALL JniContinuousQueryFilterCreate(JNIEnv *env, jclass cls, jlong envPtr, jlong memPtr);
+            JNIEXPORT jint JNICALL JniContinuousQueryFilterApply(JNIEnv *env, jclass cls, jlong envPtr, jlong filterPtr, jlong memPtr);
+            JNIEXPORT void JNICALL JniContinuousQueryFilterRelease(JNIEnv *env, jclass cls, jlong envPtr, jlong filterPtr);
+
+			JNIEXPORT void JNICALL JniDataStreamerTopologyUpdate(JNIEnv *env, jclass cls, jlong envPtr, jlong ldrPtr, jlong topVer, jint topSize);
+			JNIEXPORT void JNICALL JniDataStreamerStreamReceiverInvoke(JNIEnv *env, jclass cls, jlong envPtr, jlong ptr, jobject cache, jlong memPtr, jboolean keepPortable);
+
+            JNIEXPORT void JNICALL JniFutureByteResult(JNIEnv *env, jclass cls, jlong envPtr, jlong futPtr, jint res);
+            JNIEXPORT void JNICALL JniFutureBoolResult(JNIEnv *env, jclass cls, jlong envPtr, jlong futPtr, jint res);
+            JNIEXPORT void JNICALL JniFutureShortResult(JNIEnv *env, jclass cls, jlong envPtr, jlong futPtr, jint res);
+            JNIEXPORT void JNICALL JniFutureCharResult(JNIEnv *env, jclass cls, jlong envPtr, jlong futPtr, jint res);
+            JNIEXPORT void JNICALL JniFutureIntResult(JNIEnv *env, jclass cls, jlong envPtr, jlong futPtr, jint res);
+            JNIEXPORT void JNICALL JniFutureFloatResult(JNIEnv *env, jclass cls, jlong envPtr, jlong futPtr, jfloat res);
+            JNIEXPORT void JNICALL JniFutureLongResult(JNIEnv *env, jclass cls, jlong envPtr, jlong futPtr, jlong res);
+            JNIEXPORT void JNICALL JniFutureDoubleResult(JNIEnv *env, jclass cls, jlong envPtr, jlong futPtr, jdouble res);
+            JNIEXPORT void JNICALL JniFutureObjectResult(JNIEnv *env, jclass cls, jlong envPtr, jlong futPtr, jlong memPtr);
+            JNIEXPORT void JNICALL JniFutureNullResult(JNIEnv *env, jclass cls, jlong envPtr, jlong futPtr);
+            JNIEXPORT void JNICALL JniFutureError(JNIEnv *env, jclass cls, jlong envPtr, jlong futPtr, jlong memPtr);
+
+            JNIEXPORT void JNICALL JniLifecycleEvent(JNIEnv *env, jclass cls, jlong envPtr, jlong ptr, jint evt);
+
+            JNIEXPORT void JNICALL JniMemoryReallocate(JNIEnv *env, jclass cls, jlong envPtr, jlong memPtr, jint cap);
+
+            JNIEXPORT jlong JNICALL JniMessagingFilterCreate(JNIEnv *env, jclass cls, jlong envPtr, jlong memPtr);
+            JNIEXPORT jint JNICALL JniMessagingFilterApply(JNIEnv *env, jclass cls, jlong envPtr, jlong ptr, jlong memPtr);
+            JNIEXPORT void JNICALL JniMessagingFilterDestroy(JNIEnv *env, jclass cls, jlong envPtr, jlong ptr);
+            
+            JNIEXPORT jlong JNICALL JniEventFilterCreate(JNIEnv *env, jclass cls, jlong envPtr, jlong memPtr);
+            JNIEXPORT jint JNICALL JniEventFilterApply(JNIEnv *env, jclass cls, jlong envPtr, jlong ptr, jlong memPtr);
+            JNIEXPORT void JNICALL JniEventFilterDestroy(JNIEnv *env, jclass cls, jlong envPtr, jlong ptr);
+
+			JNIEXPORT jlong JNICALL JniServiceInit(JNIEnv *env, jclass cls, jlong envPtr, jlong memPtr);
+			JNIEXPORT void JNICALL JniServiceExecute(JNIEnv *env, jclass cls, jlong envPtr, jlong svcPtr, jlong memPtr);
+			JNIEXPORT void JNICALL JniServiceCancel(JNIEnv *env, jclass cls, jlong envPtr, jlong svcPtr, jlong memPtr);
+			JNIEXPORT void JNICALL JniServiceInvokeMethod(JNIEnv *env, jclass cls, jlong envPtr, jlong svcPtr, jlong inMemPtr, jlong outMemPtr);
+			JNIEXPORT jint JNICALL JniClusterNodeFilterApply(JNIEnv *env, jclass cls, jlong envPtr, jlong memPtr);
+
+            JNIEXPORT jlong JNICALL JniNodeInfo(JNIEnv *env, jclass cls, jlong envPtr, jlong memPtr);
+
+            JNIEXPORT void JNICALL JniOnStart(JNIEnv *env, jclass cls, jlong envPtr, jobject proc, jlong memPtr);
+            JNIEXPORT void JNICALL JniOnStop(JNIEnv *env, jclass cls, jlong envPtr);
+
+            JNIEXPORT jlong JNICALL JniExtensionCallbackInLongOutLong(JNIEnv *env, jclass cls, jlong envPtr, jint typ, jlong arg1);
+            JNIEXPORT jlong JNICALL JniExtensionCallbackInLongLongOutLong(JNIEnv *env, jclass cls, jlong envPtr, jint typ, jlong arg1, jlong arg2);
+        }
+    }
+}
+
+#endif
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/common/os/linux/include/Makefile.am
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/common/os/linux/include/Makefile.am b/modules/platform/cpp/common/os/linux/include/Makefile.am
new file mode 100644
index 0000000..68e45e6
--- /dev/null
+++ b/modules/platform/cpp/common/os/linux/include/Makefile.am
@@ -0,0 +1,21 @@
+##
+## Licensed to the Apache Software Foundation (ASF) under one or more
+## contributor license agreements.  See the NOTICE file distributed with
+## this work for additional information regarding copyright ownership.
+## The ASF licenses this file to You under the Apache License, Version 2.0
+## (the "License"); you may not use this file except in compliance with
+## the License.  You may obtain a copy of the License at
+##
+##      http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS,
+## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+## See the License for the specific language governing permissions and
+## limitations under the License.
+##
+
+ACLOCAL_AMFLAGS = "-Im4"
+
+nobase_include_HEADERS = ignite/common/common.h \
+                         ignite/common/concurrent_os.h

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/common/os/linux/include/ignite/common/common.h
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/common/os/linux/include/ignite/common/common.h b/modules/platform/cpp/common/os/linux/include/ignite/common/common.h
new file mode 100644
index 0000000..6577ad8
--- /dev/null
+++ b/modules/platform/cpp/common/os/linux/include/ignite/common/common.h
@@ -0,0 +1,81 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _IGNITE_COMMON_OS
+#define _IGNITE_COMMON_OS
+
+#ifndef __has_attribute
+  #define __has_attribute(x) 0
+#endif
+
+#if (defined(__GNUC__) && ((__GNUC__ > 4) || (__GNUC__ == 4) && (__GNUC_MINOR__ > 2))) || __has_attribute(visibility)
+  #define IGNITE_EXPORT __attribute__((visibility("default")))
+  #define IGNITE_IMPORT __attribute__((visibility("default")))
+#else
+  #define IGNITE_EXPORT
+  #define IGNITE_IMPORT
+#endif
+
+#define IGNITE_CALL
+
+#ifdef IGNITE_IMPL
+    #define IGNITE_IMPORT_EXPORT IGNITE_EXPORT
+#else
+    #define IGNITE_IMPORT_EXPORT IGNITE_IMPORT
+#endif
+
+/**
+ * Common construction to disable copy constructor and assignment for class.
+ */
+#define IGNITE_NO_COPY_ASSIGNMENT(cls) \
+    cls(const cls& src); \
+    cls& operator= (const cls& other);
+
+namespace ignite
+{
+    namespace common
+    {
+        /**
+         * Helper class to manage attached threads.
+         */
+        class AttachHelper 
+        {
+        public:            
+            /**
+             * Destructor.
+             */
+            ~AttachHelper();
+            
+            /**
+             * Callback invoked on successful thread attach ot JVM.
+             */
+            static void OnThreadAttach();
+        private:
+            /**
+             * Helper method to allocate attach key.
+             */
+            static void AllocateAttachKey();
+
+            /**
+             * Attach key destructor.
+             */
+            static void DestroyAttachKey(void* key);
+        };        
+    }
+}
+
+#endif
\ No newline at end of file


[19/28] ignite git commit: IGNITE-1513: Moved CPP.

Posted by vo...@apache.org.
http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/core/include/ignite/impl/portable/portable_utils.h
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/core/include/ignite/impl/portable/portable_utils.h b/modules/platform/cpp/core/include/ignite/impl/portable/portable_utils.h
new file mode 100644
index 0000000..dd16686
--- /dev/null
+++ b/modules/platform/cpp/core/include/ignite/impl/portable/portable_utils.h
@@ -0,0 +1,344 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _IGNITE_IMPL_PORTABLE_UTILS
+#define _IGNITE_IMPL_PORTABLE_UTILS
+
+#include <stdint.h>
+
+#include "ignite/guid.h"
+
+namespace ignite
+{
+    namespace impl
+    {
+        namespace interop
+        {
+            class InteropInputStream;
+            class InteropOutputStream;
+        }
+
+        namespace portable
+        {
+            /**
+             * Portable uilts.
+             */
+            class IGNITE_IMPORT_EXPORT PortableUtils
+            {
+            public:
+                /**
+                 * Utility method to read signed 8-bit integer from stream.
+                 *
+                 * @param stream Stream.
+                 * @return Value.
+                 */
+                static int8_t ReadInt8(interop::InteropInputStream* stream);
+
+                /**
+                 * Utility method to write signed 8-bit integer to stream.
+                 *
+                 * @param stream Stream.
+                 * @param val Value.
+                 */
+                static void WriteInt8(interop::InteropOutputStream* stream, int8_t val);
+
+                /**
+                 * Utility method to read signed 8-bit integer array from stream.
+                 *
+                 * @param stream Stream.
+                 * @param res Target array.
+                 * @param len Array length.                 
+                 */
+                static void ReadInt8Array(interop::InteropInputStream* stream, int8_t* res, const int32_t len);
+
+                /**
+                 * Utility method to write signed 8-bit integer array to stream.
+                 *
+                 * @param stream Stream.
+                 * @param val Value.
+                 * @param len Array length.
+                 */
+                static void WriteInt8Array(interop::InteropOutputStream* stream, const int8_t* val, const int32_t len);
+
+                /**
+                 * Utility method to read boolean from stream.
+                 *
+                 * @param stream Stream.
+                 * @return Value.
+                 */
+                static bool ReadBool(interop::InteropInputStream* stream);
+
+                /**
+                 * Utility method to write bool to stream.
+                 *
+                 * @param stream Stream.
+                 * @param val Value.
+                 */
+                static void WriteBool(interop::InteropOutputStream* stream, bool val);
+
+                /**
+                 * Utility method to read bool array from stream.
+                 *
+                 * @param stream Stream.
+                 * @param res Target array.
+                 * @param len Array length.
+                 */
+                static void ReadBoolArray(interop::InteropInputStream* stream, bool* res, const int32_t len);
+
+                /**
+                 * Utility method to write bool array to stream.
+                 *
+                 * @param stream Stream.
+                 * @param val Value.
+                 * @param len Array length.
+                 */
+                static void WriteBoolArray(interop::InteropOutputStream* stream, const bool* val, const int32_t len);
+
+                /**
+                 * Utility method to read signed 16-bit integer from stream.
+                 *
+                 * @param stream Stream.
+                 * @return Value.
+                 */
+                static int16_t ReadInt16(interop::InteropInputStream* stream);
+
+                /**
+                 * Utility method to write signed 16-bit integer to stream.
+                 *
+                 * @param stream Stream.
+                 * @param val Value.
+                 */
+                static void WriteInt16(interop::InteropOutputStream* stream, int16_t val);
+
+                /**
+                 * Utility method to read signed 16-bit integer array from stream.
+                 *
+                 * @param stream Stream.
+                 * @param res Target array.
+                 * @param len Array length.                 
+                 */
+                static void ReadInt16Array(interop::InteropInputStream* stream, int16_t* res, const int32_t len);
+
+                /**
+                 * Utility method to write signed 16-bit integer array to stream.
+                 *
+                 * @param stream Stream.
+                 * @param val Value.
+                 * @param len Array length.
+                 */
+                static void WriteInt16Array(interop::InteropOutputStream* stream, const int16_t* val, const int32_t len);
+
+                /**
+                 * Utility method to read unsigned 16-bit integer from stream.
+                 *
+                 * @param stream Stream.
+                 * @return Value.
+                 */
+                static uint16_t ReadUInt16(interop::InteropInputStream* stream);
+
+                /**
+                 * Utility method to write unsigned 16-bit integer to stream.
+                 *
+                 * @param stream Stream.
+                 * @param val Value.
+                 */
+                static void WriteUInt16(interop::InteropOutputStream* stream, uint16_t val);
+
+                /**
+                 * Utility method to read unsigned 16-bit integer array from stream.
+                 *
+                 * @param stream Stream.
+                 * @param res Target array.
+                 * @param len Array length.
+                 */
+                static void ReadUInt16Array(interop::InteropInputStream* stream, uint16_t* res, const int32_t len);
+
+                /**
+                 * Utility method to write unsigned 16-bit integer array to stream.
+                 *
+                 * @param stream Stream.
+                 * @param val Value.
+                 * @param len Array length.
+                 */
+                static void WriteUInt16Array(interop::InteropOutputStream* stream, const uint16_t* val, const int32_t len);
+
+                /**
+                 * Utility method to read signed 32-bit integer from stream.
+                 *
+                 * @param stream Stream.
+                 * @return Value.
+                 */
+                static int32_t ReadInt32(interop::InteropInputStream* stream);
+
+                /**
+                 * Utility method to write signed 32-bit integer to stream.
+                 *
+                 * @param stream Stream.
+                 * @param val Value.
+                 */
+                static void WriteInt32(interop::InteropOutputStream* stream, int32_t val);
+
+                /**
+                 * Utility method to read signed 32-bit integer array from stream.
+                 *
+                 * @param stream Stream.
+                 * @param res Target array.
+                 * @param len Array length.
+                 */
+                static void ReadInt32Array(interop::InteropInputStream* stream, int32_t* res, const int32_t len);
+
+                /**
+                 * Utility method to write signed 32-bit integer array to stream.
+                 *
+                 * @param stream Stream.
+                 * @param val Value.
+                 * @param len Array length.
+                 */
+                static void WriteInt32Array(interop::InteropOutputStream* stream, const int32_t* val, const int32_t len);
+
+                /**
+                 * Utility method to read signed 64-bit integer from stream.
+                 *
+                 * @param stream Stream.
+                 * @return Value.
+                 */
+                static int64_t ReadInt64(interop::InteropInputStream* stream);
+
+                /**
+                 * Utility method to write signed 64-bit integer to stream.
+                 *
+                 * @param stream Stream.
+                 * @param val Value.
+                 */
+                static void WriteInt64(interop::InteropOutputStream* stream, int64_t val);
+
+                /**
+                 * Utility method to read signed 64-bit integer array from stream.
+                 *
+                 * @param stream Stream.
+                 * @param res Target array.
+                 * @param len Array length.
+                 */
+                static void ReadInt64Array(interop::InteropInputStream* stream, int64_t* res, const int32_t len);
+
+                /**
+                 * Utility method to write signed 64-bit integer array to stream.
+                 *
+                 * @param stream Stream.
+                 * @param val Value.
+                 * @param len Array length.
+                 */
+                static void WriteInt64Array(interop::InteropOutputStream* stream, const int64_t* val, const int32_t len);
+
+                /**
+                 * Utility method to read float from stream.
+                 *
+                 * @param stream Stream.
+                 * @return Value.
+                 */
+                static float ReadFloat(interop::InteropInputStream* stream);
+
+                /**
+                 * Utility method to write float to stream.
+                 *
+                 * @param stream Stream.
+                 * @param val Value.
+                 */
+                static void WriteFloat(interop::InteropOutputStream* stream, float val);
+
+                /**
+                 * Utility method to read float array from stream.
+                 *
+                 * @param stream Stream.
+                 * @param res Target array.
+                 * @param len Array length.
+                 */
+                static void ReadFloatArray(interop::InteropInputStream* stream, float* res, const int32_t len);
+
+                /**
+                 * Utility method to write float array to stream.
+                 *
+                 * @param stream Stream.
+                 * @param val Value.
+                 * @param len Array length.
+                 */
+                static void WriteFloatArray(interop::InteropOutputStream* stream, const float* val, const int32_t len);
+
+                /**
+                 * Utility method to read double from stream.
+                 *
+                 * @param stream Stream.
+                 * @return Value.
+                 */
+                static double ReadDouble(interop::InteropInputStream* stream);
+
+                /**
+                 * Utility method to write double to stream.
+                 *
+                 * @param stream Stream.
+                 * @param val Value.
+                 */
+                static void WriteDouble(interop::InteropOutputStream* stream, double val);
+
+                /**
+                 * Utility method to read double array from stream.
+                 *
+                 * @param stream Stream.
+                 * @param res Target array.
+                 * @param len Array length.
+                 */
+                static void ReadDoubleArray(interop::InteropInputStream* stream, double* res, const int32_t len);
+
+                /**
+                 * Utility method to write double array to stream.
+                 *
+                 * @param stream Stream.
+                 * @param val Value.
+                 * @param len Array length.
+                 */
+                static void WriteDoubleArray(interop::InteropOutputStream* stream, const double* val, const int32_t len);
+
+                /**
+                 * Utility method to read Guid from stream.
+                 *
+                 * @param stream Stream.
+                 * @param res Value.
+                 */
+                static Guid ReadGuid(interop::InteropInputStream* stream);
+
+                /**
+                 * Utility method to write Guid to stream.
+                 *
+                 * @param stream Stream.
+                 * @param val Value.
+                 */
+                static void WriteGuid(interop::InteropOutputStream* stream, const Guid val);
+
+                /**
+                 * Utility method to write string to stream.
+                 *
+                 * @param stream Stream.
+                 * @param val Value.
+                 * @param len Length.
+                 */
+                static void WriteString(interop::InteropOutputStream* stream, const char* val, const int32_t len);
+            };
+        }
+    }
+}
+
+#endif
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/core/include/ignite/impl/portable/portable_writer_impl.h
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/core/include/ignite/impl/portable/portable_writer_impl.h b/modules/platform/cpp/core/include/ignite/impl/portable/portable_writer_impl.h
new file mode 100644
index 0000000..b38dc1f
--- /dev/null
+++ b/modules/platform/cpp/core/include/ignite/impl/portable/portable_writer_impl.h
@@ -0,0 +1,859 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _IGNITE_IMPL_PORTABLE_WRITER
+#define _IGNITE_IMPL_PORTABLE_WRITER
+
+#include <cstring>
+#include <string>
+#include <stdint.h>
+
+#include <ignite/common/common.h>
+#include <ignite/common/concurrent.h>
+
+#include "ignite/impl/interop/interop_output_stream.h"
+#include "ignite/impl/portable/portable_common.h"
+#include "ignite/impl/portable/portable_id_resolver.h"
+#include "ignite/impl/portable/portable_metadata_manager.h"
+#include "ignite/impl/portable/portable_utils.h"
+#include "ignite/portable/portable_consts.h"
+#include "ignite/portable/portable_type.h"
+#include "ignite/guid.h"
+
+namespace ignite
+{
+    namespace impl
+    {
+        namespace portable
+        {
+            /**
+             * Internal implementation of portable reader.
+             */
+            class IGNITE_IMPORT_EXPORT PortableWriterImpl
+            {
+            public:
+                /**
+                 * Constructor.
+                 *
+                 * @param stream Interop stream.
+                 * @param idRslvr Portable ID resolver.
+                 * @param metaMgr Metadata manager.
+                 * @param metaHnd Metadata handler.
+                 */
+                PortableWriterImpl(ignite::impl::interop::InteropOutputStream* stream, PortableIdResolver* idRslvr, 
+                    PortableMetadataManager* metaMgr, PortableMetadataHandler* metaHnd);
+                
+                /**
+                 * Constructor used to construct light-weight writer allowing only raw operations 
+                 * and primitive objects.
+                 *
+                 * @param stream Interop stream.
+                 * @param metaMgr Metadata manager.
+                 */
+                PortableWriterImpl(ignite::impl::interop::InteropOutputStream* stream, PortableMetadataManager* metaMgr);
+
+                /**
+                 * Write 8-byte signed integer. Maps to "byte" type in Java.
+                 *
+                 * @param val Value.
+                 */
+                void WriteInt8(const int8_t val);
+
+                /**
+                 * Write array of 8-byte signed integers. Maps to "byte[]" type in Java.
+                 *
+                 * @param val Array.
+                 * @param len Array length.
+                 */
+                void WriteInt8Array(const int8_t* val, const int32_t len);
+
+                /**
+                 * Write 8-byte signed integer. Maps to "byte" type in Java.
+                 *
+                 * @param fieldName Field name.
+                 * @param val Value.
+                 */
+                void WriteInt8(const char* fieldName, const int8_t val);
+
+                /**
+                 * Write array of 8-byte signed integers. Maps to "byte[]" type in Java.
+                 *
+                 * @param fieldName Field name.
+                 * @param val Array.
+                 * @param len Array length.
+                 */
+                void WriteInt8Array(const char* fieldName, const int8_t* val, const int32_t len);
+
+                /**
+                 * Write bool. Maps to "short" type in Java.
+                 *
+                 * @param val Value.
+                 */
+                void WriteBool(const bool val);
+
+                /**
+                 * Write array of bools. Maps to "bool[]" type in Java.
+                 *
+                 * @param val Array.
+                 * @param len Array length.
+                 */
+                void WriteBoolArray(const bool* val, const int32_t len);
+
+                /**
+                 * Write bool. Maps to "short" type in Java.
+                 *
+                 * @param fieldName Field name.
+                 * @param val Value.
+                 */
+                void WriteBool(const char* fieldName, const bool val);
+
+                /**
+                 * Write array of bools. Maps to "bool[]" type in Java.
+                 *
+                 * @param fieldName Field name.
+                 * @param val Array.
+                 * @param len Array length.
+                 */
+                void WriteBoolArray(const char* fieldName, const bool* val, const int32_t len);
+
+                /**
+                 * Write 16-byte signed integer. Maps to "short" type in Java.
+                 *
+                 * @param val Value.
+                 */
+                void WriteInt16(const int16_t val);
+
+                /**
+                 * Write array of 16-byte signed integers. Maps to "short[]" type in Java.
+                 *
+                 * @param val Array.
+                 * @param len Array length.
+                 */
+                void WriteInt16Array(const int16_t* val, const int32_t len);
+
+                /**
+                 * Write 16-byte signed integer. Maps to "short" type in Java.
+                 *
+                 * @param fieldName Field name.
+                 * @param val Value.
+                 */
+                void WriteInt16(const char* fieldName, const int16_t val);
+
+                /**
+                 * Write array of 16-byte signed integers. Maps to "short[]" type in Java.
+                 *
+                 * @param fieldName Field name.
+                 * @param val Array.
+                 * @param len Array length.
+                 */
+                void WriteInt16Array(const char* fieldName, const int16_t* val, const int32_t len);
+
+                /**
+                 * Write 16-byte unsigned integer. Maps to "char" type in Java.
+                 *
+                 * @param val Value.
+                 */
+                void WriteUInt16(const uint16_t val);
+
+                /**
+                 * Write array of 16-byte unsigned integers. Maps to "char[]" type in Java.
+                 *
+                 * @param val Array.
+                 * @param len Array length.
+                 */
+                void WriteUInt16Array(const uint16_t* val, const int32_t len);
+
+                /**
+                 * Write 16-byte unsigned integer. Maps to "char" type in Java.
+                 *
+                 * @param fieldName Field name.
+                 * @param val Value.
+                 */
+                void WriteUInt16(const char* fieldName, const uint16_t val);
+
+                /**
+                 * Write array of 16-byte unsigned integers. Maps to "char[]" type in Java.
+                 *
+                 * @param fieldName Field name.
+                 * @param val Array.
+                 * @param len Array length.
+                 */
+                void WriteUInt16Array(const char* fieldName, const uint16_t* val, const int32_t len);
+
+                /**
+                 * Write 32-byte signed integer. Maps to "int" type in Java.
+                 *
+                 * @param val Value.
+                 */
+                void WriteInt32(const int32_t val);
+
+                /**
+                 * Write array of 32-byte signed integers. Maps to "int[]" type in Java.
+                 *
+                 * @param val Array.
+                 * @param len Array length.
+                 */
+                void WriteInt32Array(const int32_t* val, const int32_t len);
+
+                /**
+                 * Write 32-byte signed integer. Maps to "int" type in Java.
+                 *
+                 * @param fieldName Field name.
+                 * @param val Value.
+                 */
+                void WriteInt32(const char* fieldName, const int32_t val);
+
+                /**
+                 * Write array of 32-byte signed integers. Maps to "int[]" type in Java.
+                 *
+                 * @param fieldName Field name.
+                 * @param val Array.
+                 * @param len Array length.
+                 */
+                void WriteInt32Array(const char* fieldName, const int32_t* val, const int32_t len);
+
+                /**
+                 * Write 64-byte signed integer. Maps to "long" type in Java.
+                 *
+                 * @param val Value.
+                 */
+                void WriteInt64(const int64_t val);
+
+                /**
+                 * Write array of 64-byte signed integers. Maps to "long[]" type in Java.
+                 *
+                 * @param val Array.
+                 * @param len Array length.
+                 */
+                void WriteInt64Array(const int64_t* val, const int32_t len);
+
+                /**
+                 * Write 64-byte signed integer. Maps to "long" type in Java.
+                 *
+                 * @param fieldName Field name.
+                 * @param val Value.
+                 */
+                void WriteInt64(const char* fieldName, const int64_t val);
+
+                /**
+                 * Write array of 64-byte signed integers. Maps to "long[]" type in Java.
+                 *
+                 * @param fieldName Field name.
+                 * @param val Array.
+                 * @param len Array length.
+                 */
+                void WriteInt64Array(const char* fieldName, const int64_t* val, const int32_t len);
+
+                /**
+                 * Write float. Maps to "float" type in Java.
+                 *
+                 * @param val Value.
+                 */
+                void WriteFloat(const float val);
+
+                /**
+                 * Write array of floats. Maps to "float[]" type in Java.
+                 *
+                 * @param val Array.
+                 * @param len Array length.
+                 */
+                void WriteFloatArray(const float* val, const int32_t len);
+
+                /**
+                 * Write float. Maps to "float" type in Java.
+                 *
+                 * @param fieldName Field name.
+                 * @param val Value.
+                 */
+                void WriteFloat(const char* fieldName, const float val);
+
+                /**
+                 * Write array of floats. Maps to "float[]" type in Java.
+                 *
+                 * @param fieldName Field name.
+                 * @param val Array.
+                 * @param len Array length.
+                 */
+                void WriteFloatArray(const char* fieldName, const float* val, const int32_t len);
+
+                /**
+                 * Write double. Maps to "double" type in Java.
+                 *
+                 * @param val Value.
+                 */
+                void WriteDouble(const double val);
+
+                /**
+                 * Write array of doubles. Maps to "double[]" type in Java.
+                 *
+                 * @param val Array.
+                 * @param len Array length.
+                 */
+                void WriteDoubleArray(const double* val, const int32_t len);
+
+                /**
+                 * Write double. Maps to "double" type in Java.
+                 *
+                 * @param fieldName Field name.
+                 * @param val Value.
+                 */
+                void WriteDouble(const char* fieldName, const double val);
+
+                /**
+                 * Write array of doubles. Maps to "double[]" type in Java.
+                 *
+                 * @param fieldName Field name.
+                 * @param val Array.
+                 * @param len Array length.
+                 */
+                void WriteDoubleArray(const char* fieldName, const double* val, const int32_t len);
+
+                /**
+                 * Write Guid. Maps to "UUID" type in Java.
+                 *
+                 * @param val Value.
+                 */
+                void WriteGuid(const Guid val);
+
+                /**
+                 * Write array of Guids. Maps to "UUID[]" type in Java.
+                 *
+                 * @param val Array.
+                 * @param len Array length.
+                 */
+                void WriteGuidArray(const Guid* val, const int32_t len);
+
+                /**
+                 * Write Guid. Maps to "UUID" type in Java.
+                 *
+                 * @param fieldName Field name.
+                 * @param val Value.
+                 */
+                void WriteGuid(const char* fieldName, const Guid val);
+
+                /**
+                 * Write array of Guids. Maps to "UUID[]" type in Java.
+                 *
+                 * @param fieldName Field name.
+                 * @param val Array.
+                 * @param len Array length.
+                 */
+                void WriteGuidArray(const char* fieldName, const Guid* val, const int32_t len);
+
+                /**
+                 * Write string.
+                 *
+                 * @param val String.
+                 * @param len String length (characters).
+                 */
+                void WriteString(const char* val, const int32_t len);
+
+                /**
+                 * Write string.
+                 *
+                 * @param fieldName Field name.
+                 * @param val String.
+                 * @param len String length (characters).
+                 */
+                void WriteString(const char* fieldName, const char* val, const int32_t len);
+
+                /**
+                 * Start string array write.
+                 *
+                 * @param typ Collection type.
+                 * @return Session ID.
+                 */
+                int32_t WriteStringArray();
+
+                /**
+                 * Start string array write.
+                 *
+                 * @param fieldName Field name.
+                 * @return Session ID.
+                 */
+                int32_t WriteStringArray(const char* fieldName);
+
+                /**
+                 * Write string element.
+                 *
+                 * @param id Session ID.
+                 * @param val Value.
+                 * @param len Length.
+                 */
+                void WriteStringElement(int32_t id, const char* val, int32_t len);
+
+                /**
+                 * Write NULL value.
+                 */
+                void WriteNull();
+
+                /**
+                 * Write NULL value.
+                 *
+                 * @param fieldName Field name.
+                 */
+                void WriteNull(const char* fieldName);
+
+                /**
+                 * Start array write.
+                 *
+                 * @param typ Collection type.
+                 * @return Session ID.
+                 */
+                int32_t WriteArray();
+
+                /**
+                 * Start array write.
+                 *
+                 * @param fieldName Field name.
+                 * @return Session ID.
+                 */
+                int32_t WriteArray(const char* fieldName);
+                                
+                /**
+                 * Start collection write.
+                 *
+                 * @param typ Collection type.
+                 * @return Session ID.
+                 */
+                int32_t WriteCollection(ignite::portable::CollectionType typ);
+
+                /**
+                 * Start collection write.
+                 *
+                 * @param fieldName Field name.
+                 * @param typ Collection type.
+                 * @return Session ID.
+                 */
+                int32_t WriteCollection(const char* fieldName, ignite::portable::CollectionType typ);
+                
+                /**
+                 * Start map write.
+                 *
+                 * @param typ Map type.
+                 * @return Session ID.
+                 */
+                int32_t WriteMap(ignite::portable::MapType typ);
+
+                /**
+                 * Start map write.
+                 *
+                 * @param fieldName Field name.
+                 * @param typ Map type.
+                 * @return Session ID.
+                 */
+                int32_t WriteMap(const char* fieldName, ignite::portable::MapType typ);
+
+                /**
+                 * Write collection element.
+                 *
+                 * @param id Session ID.
+                 * @param val Value.
+                 */
+                template<typename T>
+                void WriteElement(int32_t id, T val)
+                {
+                    CheckSession(id);
+                                        
+                    WriteTopObject<T>(val);
+
+                    elemCnt++;
+                }
+
+                /**
+                 * Write map element.
+                 *
+                 * @param id Session ID.
+                 * @param key Key.
+                 * @param val Value.
+                 */
+                template<typename K, typename V>
+                void WriteElement(int32_t id, K key, V val)
+                {
+                    CheckSession(id);
+                    
+                    WriteTopObject<K>(key);
+                    WriteTopObject<V>(val);
+
+                    elemCnt++;
+                }
+
+                /**
+                 * Commit container write session.
+                 *
+                 * @param id Session ID.
+                 */
+                void CommitContainer(int32_t id);                
+
+                /**
+                 * Write object.
+                 *
+                 * @param val Object.
+                 */
+                template<typename T>
+                void WriteObject(T val)
+                {
+                    CheckRawMode(true);
+
+                    WriteTopObject(val);
+                }
+
+                /**
+                 * Write object.
+                 *
+                 * @param fieldName Field name.
+                 * @param val Object.
+                 */
+                template<typename T>
+                void WriteObject(const char* fieldName, T val)
+                {
+                    CheckRawMode(false); 
+                        
+                    // 1. Write field ID.
+                    WriteFieldId(fieldName, IGNITE_TYPE_OBJECT);
+
+                    // 2. Preserve space for length.
+                    int32_t lenPos = stream->Position();
+                    stream->Position(lenPos + 4);
+
+                    // 3. Actual write.
+                    WriteTopObject(val);
+
+                    // 4. Write field length.
+                    int32_t len = stream->Position() - lenPos - 4;
+                    stream->WriteInt32(lenPos, len);
+                }
+
+                /**
+                 * Set raw mode.
+                 */
+                void SetRawMode();
+
+                /**
+                 * Get raw position.
+                 */
+                int32_t GetRawPosition();
+
+                /**
+                 * Write object.
+                 *
+                 * @param obj Object to write.
+                 */
+                template<typename T>
+                void WriteTopObject(const T& obj)
+                {
+                    ignite::portable::PortableType<T> type;
+
+                    if (type.IsNull(obj))
+                        stream->WriteInt8(IGNITE_HDR_NULL);
+                    else
+                    {
+                        TemplatedPortableIdResolver<T> idRslvr(type);
+                        ignite::common::concurrent::SharedPointer<PortableMetadataHandler> metaHnd;
+
+                        if (metaMgr)                        
+                            metaHnd = metaMgr->GetHandler(idRslvr.GetTypeId());
+
+                        PortableWriterImpl writerImpl(stream, &idRslvr, metaMgr, metaHnd.Get());
+                        ignite::portable::PortableWriter writer(&writerImpl);
+
+                        int32_t pos = stream->Position();
+
+                        stream->WriteInt8(IGNITE_HDR_FULL);
+                        stream->WriteBool(true);
+                        stream->WriteInt32(idRslvr.GetTypeId());
+                        stream->WriteInt32(type.GetHashCode(obj));
+
+                        stream->Position(pos + IGNITE_FULL_HDR_LEN);
+
+                        type.Write(writer, obj);
+
+                        int32_t len = stream->Position() - pos;
+
+                        stream->WriteInt32(pos + 10, len);
+                        stream->WriteInt32(pos + 14, writerImpl.GetRawPosition() - pos);
+
+                        if (metaMgr)
+                            metaMgr->SubmitHandler(type.GetTypeName(), idRslvr.GetTypeId(), metaHnd.Get());
+                    }
+                }
+
+                /**
+                 * Get underlying stream.
+                 *
+                 * @return Stream.
+                 */
+                impl::interop::InteropOutputStream* GetStream();
+            private:
+                /** Underlying stream. */
+                ignite::impl::interop::InteropOutputStream* stream; 
+                
+                /** ID resolver. */
+                PortableIdResolver* idRslvr;                     
+                
+                /** Metadata manager. */
+                PortableMetadataManager* metaMgr;                   
+                
+                /** Metadata handler. */
+                PortableMetadataHandler* metaHnd;                  
+
+                /** Type ID. */
+                int32_t typeId;                                       
+
+                /** Elements write session ID generator. */
+                int32_t elemIdGen;                                   
+                
+                /** Elements write session ID. */
+                int32_t elemId;                                       
+                
+                /** Elements count. */
+                int32_t elemCnt;                                      
+                
+                /** Elements start position. */
+                int32_t elemPos;                                      
+
+                /** Raw data offset. */
+                int32_t rawPos;                                       
+
+                IGNITE_NO_COPY_ASSIGNMENT(PortableWriterImpl)
+
+                /**
+                 * Write a primitive value to stream in raw mode.
+                 *
+                 * @param val Value.
+                 * @param func Stream function.
+                 */
+                template<typename T>
+                void WritePrimitiveRaw(
+                    const T val, 
+                    void(*func)(interop::InteropOutputStream*, T)
+                )
+                {
+                    CheckRawMode(true);
+                    CheckSingleMode(true);
+
+                    func(stream, val);
+                }
+
+                /**
+                 * Write a primitive array to stream in raw mode.
+                 *
+                 * @param val Value.
+                 * @param len Array length.
+                 * @param func Stream function.
+                 * @param hdr Header.
+                 */
+                template<typename T>
+                void WritePrimitiveArrayRaw(
+                    const T* val,
+                    const int32_t len,
+                    void(*func)(interop::InteropOutputStream*, const T*, const int32_t),
+                    const int8_t hdr
+                )
+                {
+                    CheckRawMode(true);
+                    CheckSingleMode(true);
+
+                    if (val)
+                    {
+                        stream->WriteInt8(hdr);
+                        stream->WriteInt32(len);
+                        func(stream, val, len);
+                    }
+                    else
+                        stream->WriteInt8(IGNITE_HDR_NULL);
+                }
+
+                /**
+                 * Write a primitive value to stream.
+                 *
+                 * @param fieldName Field name.
+                 * @param val Value.
+                 * @param func Stream function.
+                 * @param typ Field type ID.
+                 * @param len Field length.
+                 */
+                template<typename T>
+                void WritePrimitive(
+                    const char* fieldName, 
+                    const T val, 
+                    void(*func)(interop::InteropOutputStream*, T), 
+                    const int8_t typ, 
+                    const int32_t len
+                )
+                {
+                    CheckRawMode(false);
+                    CheckSingleMode(true);
+
+                    WriteFieldId(fieldName, typ);
+
+                    stream->WriteInt32(1 + len);
+                    stream->WriteInt8(typ);
+
+                    func(stream, val);
+                }
+
+                /**
+                 * Write a primitive array to stream.
+                 *
+                 * @param fieldName Field name.
+                 * @param val Value.
+                 * @param len Array length.
+                 * @param func Stream function.
+                 * @param hdr Header.
+                 * @param lenShift Length shift.
+                 */
+                template<typename T>
+                void WritePrimitiveArray(
+                    const char* fieldName, 
+                    const T* val, 
+                    const int32_t len, 
+                    void(*func)(interop::InteropOutputStream*, const T*, const int32_t), 
+                    const int8_t hdr, 
+                    const int32_t lenShift
+                )
+                {
+                    CheckRawMode(false);
+                    CheckSingleMode(true);
+
+                    WriteFieldId(fieldName, hdr);
+
+                    if (val)
+                    {
+                        stream->WriteInt32(5 + (len << lenShift));
+                        stream->WriteInt8(hdr);
+                        stream->WriteInt32(len);
+                        func(stream, val, len);
+                    }
+                    else
+                    {
+                        stream->WriteInt32(1);
+                        stream->WriteInt8(IGNITE_HDR_NULL);
+                    }
+                }
+
+                /**
+                 * Check raw mode.
+                 *
+                 * @param expected Expected raw mode of the reader.
+                 */
+                void CheckRawMode(bool expected);
+
+                /**
+                 * Check whether writer is currently operating in single mode.
+                 *
+                 * @param expected Expected value.
+                 */
+                void CheckSingleMode(bool expected);
+
+                /**
+                 * Start new container writer session.
+                 *
+                 * @param expRawMode Expected raw mode.
+                 */
+                void StartContainerSession(bool expRawMode);
+
+                /**
+                 * Check whether session ID matches.
+                 *
+                 * @param ses Expected session ID.
+                 */
+                void CheckSession(int32_t expSes);
+
+                /**
+                 * Write field ID.
+                 *
+                 * @param fieldName Field name.
+                 * @param fieldTypeId Field type ID.
+                 */
+                void WriteFieldId(const char* fieldName, int32_t fieldTypeId);
+
+                /**
+                 * Write field ID and skip field length.
+                 *
+                 * @param fieldName Field name.
+                 * @param fieldTypeId Field type ID.
+                 */
+                void WriteFieldIdSkipLength(const char* fieldName, int32_t fieldTypeId);
+
+                /**
+                 * Write field ID and length.
+                 *
+                 * @param fieldName Field name.
+                 * @param fieldTypeId Field type ID.
+                 * @param len Length.
+                 */
+                void WriteFieldIdAndLength(const char* fieldName, int32_t fieldTypeId, int32_t len);
+
+                /**
+                 * Write primitive value.
+                 *
+                 * @param obj Value.
+                 * @param func Stream function.
+                 * @param hdr Header.
+                 */
+                template<typename T>
+                void WriteTopObject0(const T obj, void(*func)(impl::interop::InteropOutputStream*, T), const int8_t hdr)
+                {
+                    stream->WriteInt8(hdr);
+                    func(stream, obj);
+                }
+            };
+
+            template<>
+            void IGNITE_IMPORT_EXPORT PortableWriterImpl::WriteTopObject(const int8_t& obj);
+
+            template<>
+            void IGNITE_IMPORT_EXPORT PortableWriterImpl::WriteTopObject(const bool& obj);
+
+            template<>
+            void IGNITE_IMPORT_EXPORT PortableWriterImpl::WriteTopObject(const int16_t& obj);
+
+            template<>
+            void IGNITE_IMPORT_EXPORT PortableWriterImpl::WriteTopObject(const uint16_t& obj);
+
+            template<>
+            void IGNITE_IMPORT_EXPORT PortableWriterImpl::WriteTopObject(const int32_t& obj);
+
+            template<>
+            void IGNITE_IMPORT_EXPORT PortableWriterImpl::WriteTopObject(const int64_t& obj);
+
+            template<>
+            void IGNITE_IMPORT_EXPORT PortableWriterImpl::WriteTopObject(const float& obj);
+
+            template<>
+            void IGNITE_IMPORT_EXPORT PortableWriterImpl::WriteTopObject(const double& obj);
+
+            template<>
+            void IGNITE_IMPORT_EXPORT PortableWriterImpl::WriteTopObject(const Guid& obj);
+
+            template<>
+            inline void IGNITE_IMPORT_EXPORT PortableWriterImpl::WriteTopObject(const std::string& obj)
+            {
+                const char* obj0 = obj.c_str();
+
+                int32_t len = static_cast<int32_t>(strlen(obj0));
+
+                stream->WriteInt8(IGNITE_TYPE_STRING);
+
+                PortableUtils::WriteString(stream, obj0, len);
+            }
+        }
+    }
+}
+
+#endif
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/core/include/ignite/portable/portable.h
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/core/include/ignite/portable/portable.h b/modules/platform/cpp/core/include/ignite/portable/portable.h
new file mode 100644
index 0000000..1a7c3dd
--- /dev/null
+++ b/modules/platform/cpp/core/include/ignite/portable/portable.h
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _IGNITE_PORTABLE
+#define _IGNITE_PORTABLE
+
+#include "ignite/portable/portable_consts.h"
+#include "ignite/portable/portable_containers.h"
+#include "ignite/portable/portable_type.h"
+#include "ignite/portable/portable_raw_reader.h"
+#include "ignite/portable/portable_raw_writer.h"
+#include "ignite/portable/portable_reader.h"
+#include "ignite/portable/portable_writer.h"
+
+#endif
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/core/include/ignite/portable/portable_consts.h
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/core/include/ignite/portable/portable_consts.h b/modules/platform/cpp/core/include/ignite/portable/portable_consts.h
new file mode 100644
index 0000000..ef6db45
--- /dev/null
+++ b/modules/platform/cpp/core/include/ignite/portable/portable_consts.h
@@ -0,0 +1,106 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _IGNITE_PORTABLE_CONSTS
+#define _IGNITE_PORTABLE_CONSTS
+
+#include <ignite/common/common.h>
+
+namespace ignite 
+{
+    namespace portable 
+    {
+        /**
+         * Portable collection types.
+         */
+        enum CollectionType 
+        {
+            /** 
+             * Undefined. Maps to ArrayList in Java.
+             */
+            IGNITE_COLLECTION_UNDEFINED = 0,
+
+            /** 
+             * Array list. Maps to ArrayList in Java.
+             */
+            IGNITE_COLLECTION_ARRAY_LIST = 1,
+            
+            /**
+             * Linked list. Maps to LinkedList in Java.
+             */
+            IGNITE_COLLECTION_LINKED_LIST = 2,
+            
+            /**
+             * Hash set. Maps to HashSet in Java.
+             */
+            IGNITE_COLLECTION_HASH_SET = 3,
+            
+            /**
+             * Linked hash set. Maps to LinkedHashSet in Java.
+             */
+            IGNITE_COLLECTION_LINKED_HASH_SET = 4,
+
+            /**
+             * Tree set. Maps to TreeSet in Java.
+             */
+            IGNITE_COLLECTION_TREE_SET = 5,
+
+            /**
+             * Concurrent skip list set. Maps to ConcurrentSkipListSet in Java.
+             */
+            IGNITE_COLLECTION_CONCURRENT_SKIP_LIST_SET = 6
+        };
+
+        /**
+         * Portable map types.
+         */
+        enum MapType 
+        {
+            /**
+             * Undefined. Maps to HashMap in Java.
+             */
+            IGNITE_MAP_UNDEFINED = 0,
+            
+            /**
+             * Hash map. Maps to HashMap in Java.
+             */
+            IGNITE_MAP_HASH_MAP = 1,
+            
+            /**
+             * Linked hash map. Maps to LinkedHashMap in Java.
+             */
+            IGNITE_MAP_LINKED_HASH_MAP = 2,
+
+            /**
+             * Tree map. Maps to TreeMap in Java.
+             */
+            IGNITE_MAP_TREE_MAP = 3,
+            
+            /**
+             * Concurrent hash map. Maps to ConcurrentHashMap in Java.
+             */
+            IGNITE_MAP_CONCURRENT_HASH_MAP = 4,
+            
+            /**
+             * Properties map. Maps to Properties in Java.
+             */
+            IGNITE_MAP_PROPERTIES_MAP = 5
+        };
+    }
+}
+
+#endif
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/core/include/ignite/portable/portable_containers.h
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/core/include/ignite/portable/portable_containers.h b/modules/platform/cpp/core/include/ignite/portable/portable_containers.h
new file mode 100644
index 0000000..f93a11a
--- /dev/null
+++ b/modules/platform/cpp/core/include/ignite/portable/portable_containers.h
@@ -0,0 +1,525 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _IGNITE_PORTABLE_CONTAINERS
+#define _IGNITE_PORTABLE_CONTAINERS
+
+#include <stdint.h>
+
+#include "ignite/impl/portable/portable_writer_impl.h"
+#include "ignite/impl/portable/portable_reader_impl.h"
+#include "ignite/impl/utils.h"
+#include "ignite/portable/portable_consts.h"
+
+namespace ignite
+{
+    namespace portable
+    {
+        /**
+         * Portable string array writer.
+         */
+        class IGNITE_IMPORT_EXPORT PortableStringArrayWriter
+        {
+        public:
+            /**
+             * Constructor.
+             * 
+             * @param id Identifier.
+             * @param impl Writer.
+             */
+            PortableStringArrayWriter(impl::portable::PortableWriterImpl* impl, const int32_t id);
+
+            /**
+             * Write string.
+             *
+             * @param val Null-terminated character sequence.
+             */
+            void Write(const char* val);
+
+            /**
+             * Write string.
+             *
+             * @param val String.
+             * @param len String length (characters).
+             */
+            void Write(const char* val, const int32_t len);
+
+            /**
+             * Write string.
+             *
+             * @param val String.
+             */
+            void Write(const std::string& val)
+            {
+                Write(val.c_str());
+            }
+
+            /**
+             * Close the writer.
+             */
+            void Close();
+        private:
+            /** Implementation delegate. */
+            impl::portable::PortableWriterImpl* impl; 
+
+            /** Idnetifier. */
+            const int32_t id;    
+        };
+
+        /**
+         * Portable collection writer.
+         */
+        template<typename T>
+        class IGNITE_IMPORT_EXPORT PortableArrayWriter
+        {
+        public:
+            /**
+             * Constructor.
+             *
+             * @param impl Writer.
+             * @param id Identifier.
+             */
+            PortableArrayWriter(impl::portable::PortableWriterImpl* impl, const int32_t id) : impl(impl), id(id)
+            {
+                // No-op.
+            }
+
+            /**
+             * Write a value.
+             *
+             * @param val Value.
+             */
+            void Write(const T& val)
+            {
+                impl->WriteElement<T>(id, val);
+            }
+
+            /**
+             * Close the writer.
+             */
+            void Close()
+            {
+                impl->CommitContainer(id);
+            }
+        private:
+            /** Implementation delegate. */
+            impl::portable::PortableWriterImpl* impl; 
+
+            /** Idnetifier. */
+            const int32_t id;      
+        };
+
+        /**
+         * Portable collection writer.
+         */
+        template<typename T>
+        class IGNITE_IMPORT_EXPORT PortableCollectionWriter
+        {
+        public:
+            /**
+             * Constructor.
+             *
+             * @param impl Writer.
+             * @param id Identifier.
+             */
+            PortableCollectionWriter(impl::portable::PortableWriterImpl* impl, const int32_t id) : impl(impl), id(id)
+            {
+                // No-op.
+            }
+
+            /**
+             * Write a value.
+             *
+             * @param val Value.
+             */
+            void Write(const T& val)
+            {
+                impl->WriteElement<T>(id, val);
+            }
+
+            /**
+             * Close the writer.
+             */
+            void Close()
+            {
+                impl->CommitContainer(id);
+            }
+        private:
+            /** Implementation delegate. */
+            impl::portable::PortableWriterImpl* impl; 
+
+            /** Identifier. */
+            const int32_t id;    
+        };
+
+        /**
+         * Portable map writer.
+         */
+        template<typename K, typename V>
+        class IGNITE_IMPORT_EXPORT PortableMapWriter
+        {
+        public:
+            /**
+             * Constructor.
+             *
+             * @param impl Writer.
+             */
+            PortableMapWriter(impl::portable::PortableWriterImpl* impl, const int32_t id) : impl(impl), id(id)
+            {
+                // No-op.
+            }
+
+            /**
+             * Write a value.
+             *
+             * @param key Key.
+             * @param val Value.
+             */
+            void Write(const K& key, const V& val)
+            {
+                impl->WriteElement<K, V>(id, key, val);
+            }
+
+            /**
+             * Close the writer.
+             */
+            void Close()
+            {
+                impl->CommitContainer(id);
+            }
+        private:
+            /** Implementation delegate. */
+            impl::portable::PortableWriterImpl* impl; 
+
+            /** Identifier. */
+            const int32_t id;      
+        };
+
+        /**
+         * Portable string array reader.
+         */
+        class IGNITE_IMPORT_EXPORT PortableStringArrayReader
+        {
+        public:
+            /**
+             * Constructor.
+             *
+             * @param impl Reader.
+             * @param id Identifier.
+             * @param size Array size.
+             */
+            PortableStringArrayReader(impl::portable::PortableReaderImpl* impl, const int32_t id, const int32_t size);
+
+            /**
+             * Check whether next element is available for read.
+             *
+             * @return True if available.
+             */
+            bool HasNext();
+
+            /**
+             * Get next element.
+             *
+             * @param res Array to store data to. 
+             * @param len Expected length of string. NULL terminator will be set in case len is 
+             *     greater than real string length.
+             * @return Actual amount of elements read. If "len" argument is less than actual
+             *     array size or resulting array is set to null, nothing will be written
+             *     to resulting array and returned value will contain required array length.
+             *     -1 will be returned in case array in stream was null.
+             */
+            int32_t GetNext(char* res, const int32_t len);
+
+            /**
+             * Get next element.
+             *
+             * @return String. 
+             */
+            std::string GetNext()
+            {
+                int32_t len = GetNext(NULL, 0);
+
+                if (len != -1)
+                {
+                    impl::utils::SafeArray<char> arr(len + 1);
+
+                    GetNext(arr.target, len + 1);
+
+                    return std::string(arr.target);
+                }
+                else
+                    return std::string();
+            }
+
+            /**
+             * Get array size.
+             *
+             * @return Size or -1 if array is NULL.
+             */
+            int32_t GetSize();
+
+            /**
+             * Whether array is NULL.
+             */
+            bool IsNull();
+        private:
+            /** Implementation delegate. */
+            impl::portable::PortableReaderImpl* impl;  
+
+            /** Identifier. */
+            const int32_t id;    
+
+            /** Size. */
+            const int32_t size;                              
+        };
+
+        /**
+         * Portable array reader.
+         */
+        template<typename T>
+        class PortableArrayReader
+        {
+        public:
+            /**
+             * Constructor.
+             *
+             * @param impl Reader.
+             * @param id Identifier.
+             * @param size Array size.
+             */
+            PortableArrayReader(impl::portable::PortableReaderImpl* impl, const int32_t id, const int32_t size) : 
+                impl(impl), id(id), size(size)
+            {
+                // No-op.
+            }
+
+            /**
+             * Check whether next element is available for read.
+             *
+             * @return True if available.
+             */
+            bool HasNext()
+            {
+                return impl->HasNextElement(id);
+            }
+
+            /**
+             * Read next element.
+             *
+             * @return Next element.
+             */
+            T GetNext()
+            {
+                return impl->ReadElement<T>(id);
+            }
+
+            /**
+             * Get array size.
+             *
+             * @return Size or -1 if array is NULL.
+             */
+            int32_t GetSize()
+            {
+                return size;
+            }
+
+            /**
+             * Whether array is NULL.
+             */
+            bool IsNull()
+            {
+                return size == -1;
+            }
+        private:
+            /** Implementation delegate. */
+            impl::portable::PortableReaderImpl* impl;
+
+            /** Identifier. */
+            const int32_t id;
+
+            /** Size. */
+            const int32_t size;
+        };
+
+        /**
+         * Portable collection reader.
+         */
+        template<typename T>
+        class PortableCollectionReader
+        {
+        public:
+            /**
+             * Constructor.
+             *
+             * @param impl Reader.
+             * @param id Identifier.
+             * @param type Collection type.
+             * @param size Collection size.
+             */
+            PortableCollectionReader(impl::portable::PortableReaderImpl* impl, const int32_t id, 
+                const CollectionType type,  const int32_t size) : impl(impl), id(id), type(type), size(size)
+            {
+                // No-op.
+            }
+
+            /**
+             * Check whether next element is available for read.
+             *
+             * @return True if available.
+             */
+            bool HasNext()
+            {
+                return impl->HasNextElement(id);
+            }
+
+            /**
+             * Read next element.
+             *
+             * @return Next element.
+             */
+            T GetNext()
+            {
+                return impl->ReadElement<T>(id);
+            }
+            
+            /**
+             * Get collection type.
+             *
+             * @return Type.
+             */
+            CollectionType GetType()
+            {
+                return type;
+            }
+
+            /**
+             * Get collection size.
+             *
+             * @return Size or -1 if collection is NULL.
+             */
+            int32_t GetSize()
+            {
+                return size;
+            }
+
+            /**
+             * Whether collection is NULL.
+             */
+            bool IsNull()
+            {
+                return size == -1;
+            }
+        private:
+            /** Implementation delegate. */
+            impl::portable::PortableReaderImpl* impl;  
+
+            /** Identifier. */
+            const int32_t id;     
+            
+            /** Collection type. */
+            const CollectionType type;  
+
+            /** Size. */
+            const int32_t size;                              
+        };    
+
+        /**
+         * Portable map reader.
+         */
+        template<typename K, typename V>
+        class PortableMapReader
+        {
+        public:
+            /**
+             * Constructor.
+             *
+             * @param impl Reader.
+             * @param id Identifier.
+             * @param type Map type.
+             * @param size Map size.
+            */
+            PortableMapReader(impl::portable::PortableReaderImpl* impl, const int32_t id, const MapType type,
+                const int32_t size) : impl(impl), id(id), type(type), size(size)
+            {
+                // No-op.
+            }
+
+            /**
+             * Check whether next element is available for read.
+             *
+             * @return True if available.
+             */
+            bool HasNext()
+            {
+                return impl->HasNextElement(id);
+            }
+
+            /**
+             * Read next element.
+             *
+             * @param key Key.
+             * @param val Value.
+             */
+            void GetNext(K* key, V* val)
+            {
+                return impl->ReadElement<K, V>(id, key, val);
+            }
+
+            /**
+             * Get map type.
+             *
+             * @return Type.
+             */
+            MapType GetType()
+            {
+                return type;
+            }
+
+            /**
+             * Get map size.
+             *
+             * @return Size or -1 if map is NULL.
+             */
+            int32_t GetSize()
+            {
+                return size;
+            }
+
+            /**
+             * Whether map is NULL.
+             */
+            bool IsNull()
+            {
+                return size == -1;
+            }
+        private:
+            /** Implementation delegate. */
+            impl::portable::PortableReaderImpl* impl;  
+
+            /** Identifier. */
+            const int32_t id;     
+
+            /** Map type. */
+            const MapType type;
+
+            /** Size. */
+            const int32_t size;
+        };
+    }
+}
+
+#endif
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/core/include/ignite/portable/portable_raw_reader.h
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/core/include/ignite/portable/portable_raw_reader.h b/modules/platform/cpp/core/include/ignite/portable/portable_raw_reader.h
new file mode 100644
index 0000000..9f1d74c
--- /dev/null
+++ b/modules/platform/cpp/core/include/ignite/portable/portable_raw_reader.h
@@ -0,0 +1,324 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _IGNITE_PORTABLE_RAW_READER
+#define _IGNITE_PORTABLE_RAW_READER
+
+#include <stdint.h>
+#include <string>
+
+#include <ignite/common/common.h>
+
+#include "ignite/impl/portable/portable_reader_impl.h"
+#include "ignite/portable/portable_consts.h"
+#include "ignite/portable/portable_containers.h"
+#include "ignite/guid.h"
+
+namespace ignite
+{    
+    namespace portable
+    {
+        /**
+         * Portable raw reader.
+         */
+        class IGNITE_IMPORT_EXPORT PortableRawReader
+        {
+        public:
+            /**
+             * Constructor.
+             *
+             * @param impl Implementation.
+             */
+            PortableRawReader(ignite::impl::portable::PortableReaderImpl* impl);
+                        
+            /**
+             * Read 8-byte signed integer. Maps to "byte" type in Java.
+             *
+             * @return Result.
+             */
+            int8_t ReadInt8();
+
+            /**
+             * Read array of 8-byte signed integers. Maps to "byte[]" type in Java.
+             *
+             * @param res Array to store data to.
+             * @param len Expected length of array.             
+             * @return Actual amount of elements read. If "len" argument is less than actual
+             *     array size or resulting array is set to null, nothing will be written 
+             *     to resulting array and returned value will contain required array length.
+             *     -1 will be returned in case array in stream was null.
+             */
+            int32_t ReadInt8Array(int8_t* res, const int32_t len);
+
+            /**
+             * Read bool. Maps to "boolean" type in Java.
+             *
+             * @return Result.
+             */
+            bool ReadBool();
+
+            /**
+             * Read array of bools. Maps to "boolean[]" type in Java.
+             *
+             * @param res Array to store data to.
+             * @param len Expected length of array.             
+             * @return Actual amount of elements read. If "len" argument is less than actual
+             *     array size or resulting array is set to null, nothing will be written
+             *     to resulting array and returned value will contain required array length.
+             *     -1 will be returned in case array in stream was null.
+             */
+            int32_t ReadBoolArray(bool* res, const int32_t len);
+            
+            /**
+             * Read 16-byte signed integer. Maps to "short" type in Java.
+             *
+             * @return Result.
+             */
+            int16_t ReadInt16();
+
+            /**
+             * Read array of 16-byte signed integers. Maps to "short[]" type in Java.
+             *
+             * @param res Array to store data to.
+             * @param len Expected length of array.             
+             * @return Actual amount of elements read. If "len" argument is less than actual
+             *     array size or resulting array is set to null, nothing will be written
+             *     to resulting array and returned value will contain required array length.
+             *     -1 will be returned in case array in stream was null.
+             */
+            int32_t ReadInt16Array(int16_t* res, const int32_t len);
+
+            /**
+             * Read 16-byte unsigned integer. Maps to "char" type in Java.
+             *
+             * @return Result.
+             */
+            uint16_t ReadUInt16();
+
+            /**
+             * Read array of 16-byte unsigned integers. Maps to "char[]" type in Java.
+             *
+             * @param res Array to store data to.
+             * @param len Expected length of array.             
+             * @return Actual amount of elements read. If "len" argument is less than actual
+             *     array size or resulting array is set to null, nothing will be written
+             *     to resulting array and returned value will contain required array length.
+             *     -1 will be returned in case array in stream was null.
+             */
+            int32_t ReadUInt16Array(uint16_t* res, const int32_t len);
+
+            /**
+             * Read 32-byte signed integer. Maps to "int" type in Java.
+             *
+             * @return Result.
+             */
+            int32_t ReadInt32();
+            
+            /**
+             * Read array of 32-byte signed integers. Maps to "int[]" type in Java.
+             *
+             * @param res Array to store data to.
+             * @param len Expected length of array.             
+             * @return Actual amount of elements read. If "len" argument is less than actual
+             *     array size or resulting array is set to null, nothing will be written
+             *     to resulting array and returned value will contain required array length.
+             *     -1 will be returned in case array in stream was null.
+             */
+            int32_t ReadInt32Array(int32_t* res, const int32_t len);
+
+            /**
+             * Read 64-byte signed integer. Maps to "long" type in Java.
+             *
+             * @return Result.
+             */
+            int64_t ReadInt64();
+
+            /**
+             * Read array of 64-byte signed integers. Maps to "long[]" type in Java.
+             *
+             * @param res Array to store data to.
+             * @param len Expected length of array.
+             * @return Actual amount of elements read. If "len" argument is less than actual
+             *     array size or resulting array is set to null, nothing will be written
+             *     to resulting array and returned value will contain required array length.
+             *     -1 will be returned in case array in stream was null.
+             */
+            int32_t ReadInt64Array(int64_t* res, const int32_t len);
+
+            /**
+             * Read float. Maps to "float" type in Java.
+             *
+             * @return Result.
+             */
+            float ReadFloat();
+            
+            /**
+             * Read array of floats. Maps to "float[]" type in Java.
+             *
+             * @param res Array to store data to.
+             * @param len Expected length of array.             
+             * @return Actual amount of elements read. If "len" argument is less than actual
+             *     array size or resulting array is set to null, nothing will be written
+             *     to resulting array and returned value will contain required array length.
+             *     -1 will be returned in case array in stream was null.
+             */
+            int32_t ReadFloatArray(float* res, const int32_t len);
+
+            /**
+             * Read double. Maps to "double" type in Java.
+             *
+             * @return Result.
+             */
+            double ReadDouble();
+            
+            /**
+             * Read array of doubles. Maps to "double[]" type in Java.
+             *
+             * @param res Array to store data to.
+             * @param len Expected length of array.             
+             * @return Actual amount of elements read. If "len" argument is less than actual
+             *     array size or resulting array is set to null, nothing will be written
+             *     to resulting array and returned value will contain required array length.
+             *     -1 will be returned in case array in stream was null.
+             */
+            int32_t ReadDoubleArray(double* res, const int32_t len);
+            
+            /**
+             * Read Guid. Maps to "UUID" type in Java.
+             *
+             * @return Result.
+             */
+            Guid ReadGuid();
+
+            /**
+             * Read array of Guids. Maps to "UUID[]" type in Java.
+             *
+             * @param res Array to store data to.
+             * @param len Expected length of array.             
+             * @return Actual amount of elements read. If "len" argument is less than actual
+             *     array size or resulting array is set to null, nothing will be written
+             *     to resulting array and returned value will contain required array length.
+             *     -1 will be returned in case array in stream was null.
+             */
+            int32_t ReadGuidArray(Guid* res, const int32_t len);
+
+            /**
+             * Read string.
+             *
+             * @param res Array to store data to. 
+             * @param len Expected length of string. NULL terminator will be set in case len is 
+             *     greater than real string length.
+             * @return Actual amount of elements read. If "len" argument is less than actual
+             *     array size or resulting array is set to null, nothing will be written
+             *     to resulting array and returned value will contain required array length.
+             *     -1 will be returned in case array in stream was null.
+             */
+            int32_t ReadString(char* res, const int32_t len);
+
+            /**
+             * Read string from the stream.
+             *
+             * @return String. 
+             */
+            std::string ReadString()
+            {
+                int32_t len = ReadString(NULL, 0);
+
+                if (len != -1)
+                {
+                    ignite::impl::utils::SafeArray<char> arr(len + 1);
+
+                    ReadString(arr.target, len + 1);
+
+                    return std::string(arr.target);
+                }
+                else
+                    return std::string();
+            }
+
+            /**
+             * Start string array read.
+             *
+             * @return String array reader.
+             */
+            PortableStringArrayReader ReadStringArray();
+
+            /**
+             * Start array read.
+             *
+             * @return Array reader.
+             */
+            template<typename T>
+            PortableArrayReader<T> ReadArray()
+            {
+                int32_t size;
+
+                int32_t id = impl->ReadArray(&size);
+
+                return PortableArrayReader<T>(impl, id, size);
+            }
+
+            /**
+             * Start collection read.
+             *
+             * @return Collection reader.
+             */
+            template<typename T>
+            PortableCollectionReader<T> ReadCollection()
+            {
+                CollectionType typ;
+                int32_t size;
+
+                int32_t id = impl->ReadCollection(&typ, &size);
+
+                return PortableCollectionReader<T>(impl, id, typ, size);
+            }
+
+            /**
+             * Start map read.
+             *
+             * @return Map reader.
+             */
+            template<typename K, typename V>
+            PortableMapReader<K, V> ReadMap()
+            {
+                MapType typ;
+                int32_t size;
+
+                int32_t id = impl->ReadMap(&typ, &size);
+
+                return PortableMapReader<K, V>(impl, id, typ, size);
+            }
+
+            /**
+             * Read object.
+             *
+             * @return Object.
+             */
+            template<typename T>
+            T ReadObject()
+            {
+                return impl->ReadObject<T>();
+            }
+        private:
+            /** Implementation delegate. */
+            ignite::impl::portable::PortableReaderImpl* impl;  
+        };
+    }
+}
+
+#endif
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/core/include/ignite/portable/portable_raw_writer.h
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/core/include/ignite/portable/portable_raw_writer.h b/modules/platform/cpp/core/include/ignite/portable/portable_raw_writer.h
new file mode 100644
index 0000000..47b5880
--- /dev/null
+++ b/modules/platform/cpp/core/include/ignite/portable/portable_raw_writer.h
@@ -0,0 +1,300 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _IGNITE_PORTABLE_RAW_WRITER
+#define _IGNITE_PORTABLE_RAW_WRITER
+
+#include <stdint.h>
+
+#include <ignite/common/common.h>
+
+#include "ignite/impl/portable/portable_writer_impl.h"
+#include "ignite/portable/portable_consts.h"
+#include "ignite/portable/portable_containers.h"
+#include "ignite/guid.h"
+
+namespace ignite
+{
+    namespace portable
+    {
+        /**
+         * Portable raw writer.
+         */
+        class IGNITE_IMPORT_EXPORT PortableRawWriter
+        {
+        public:
+            /**
+             * Constructor.
+             *
+             * @param impl Implementation.
+             */
+            PortableRawWriter(ignite::impl::portable::PortableWriterImpl* impl);
+
+            /**
+             * Write 8-byte signed integer. Maps to "byte" type in Java.
+             *
+             * @param val Value.
+             */
+            void WriteInt8(const int8_t val);
+
+            /**
+             * Write array of 8-byte signed integers. Maps to "byte[]" type in Java.
+             *
+             * @param val Array.
+             * @param len Array length.
+             */
+            void WriteInt8Array(const int8_t* val, const int32_t len);
+
+            /**
+             * Write bool. Maps to "short" type in Java.
+             *
+             * @param val Value.
+             */
+            void WriteBool(const bool val);
+
+            /**
+             * Write array of bools. Maps to "bool[]" type in Java.
+             *
+             * @param val Array.
+             * @param len Array length.
+             */
+            void WriteBoolArray(const bool* val, const int32_t len);
+
+            /**
+             * Write 16-byte signed integer. Maps to "short" type in Java.
+             *
+             * @param val Value.
+             */
+            void WriteInt16(const int16_t val);
+
+            /**
+             * Write array of 16-byte signed integers. Maps to "short[]" type in Java.
+             *
+             * @param val Array.
+             * @param len Array length.
+             */
+            void WriteInt16Array(const int16_t* val, const int32_t len);
+
+            /**
+             * Write 16-byte unsigned integer. Maps to "char" type in Java.
+             *
+             * @param val Value.
+             */
+            void WriteUInt16(const uint16_t val);
+
+            /**
+             * Write array of 16-byte unsigned integers. Maps to "char[]" type in Java.
+             *
+             * @param val Array.
+             * @param len Array length.
+             */
+            void WriteUInt16Array(const uint16_t* val, const int32_t len);
+
+            /**
+             * Write 32-byte signed integer. Maps to "int" type in Java.
+             *
+             * @param val Value.
+             */
+            void WriteInt32(const int32_t val);
+
+            /**
+             * Write array of 32-byte signed integers. Maps to "int[]" type in Java.
+             *
+             * @param val Array.
+             * @param len Array length.
+             */
+            void WriteInt32Array(const int32_t* val, const int32_t len);
+
+            /**
+             * Write 64-byte signed integer. Maps to "long" type in Java.
+             *
+             * @param val Value.
+             */
+            void WriteInt64(const int64_t val);
+
+            /**
+             * Write array of 64-byte signed integers. Maps to "long[]" type in Java.
+             *
+             * @param val Array.
+             * @param len Array length.
+             */
+            void WriteInt64Array(const int64_t* val, const int32_t len);
+
+            /**
+             * Write float. Maps to "float" type in Java.
+             *
+             * @param val Value.
+             */
+            void WriteFloat(const float val);
+
+            /**
+             * Write array of floats. Maps to "float[]" type in Java.
+             *
+             * @param val Array.
+             * @param len Array length.
+             */
+            void WriteFloatArray(const float* val, const int32_t len);
+
+            /**
+             * Write double. Maps to "double" type in Java.
+             *
+             * @param val Value.
+             */
+            void WriteDouble(const double val);
+
+            /**
+             * Write array of doubles. Maps to "double[]" type in Java.
+             *
+             * @param val Array.
+             * @param len Array length.
+             */
+            void WriteDoubleArray(const double* val, const int32_t len);
+
+            /**
+             * Write Guid. Maps to "UUID" type in Java.
+             *
+             * @param val Value.
+             */
+            void WriteGuid(const Guid val);
+
+            /**
+             * Write array of Guids. Maps to "UUID[]" type in Java.
+             *
+             * @param val Array.
+             * @param len Array length.
+             */
+            void WriteGuidArray(const Guid* val, const int32_t len);
+
+            /**
+             * Write string.
+             *
+             * @param val Null-terminated character array.
+             */
+            void WriteString(const char* val);
+
+            /**
+             * Write string.
+             *
+             * @param val String.
+             * @param len String length (characters).
+             */
+            void WriteString(const char* val, const int32_t len);
+            
+            /**
+             * Write string.
+             *
+             * @param val String.
+             */
+            void WriteString(const std::string& val)
+            {
+                WriteString(val.c_str());
+            }
+            
+            /**
+             * Start string array write.
+             *
+             * @return String array writer.
+             */
+            PortableStringArrayWriter WriteStringArray();
+
+            /**
+             * Write NULL value.
+             */
+            void WriteNull();
+
+            /**
+             * Start array write.
+             *
+             * @return Array writer.
+             */
+            template<typename T>
+            PortableArrayWriter<T> WriteArray()
+            {
+                int32_t id = impl->WriteArray();
+
+                return PortableArrayWriter<T>(impl, id);
+            }
+
+            /**
+             * Start collection write.
+             *
+             * @return Collection writer.
+             */
+            template<typename T>
+            PortableCollectionWriter<T> WriteCollection()
+            {
+                return WriteCollection<T>(IGNITE_COLLECTION_UNDEFINED);
+            }
+
+            /**
+             * Start collection write.
+             *
+             * @param type Collection type.
+             * @return Collection writer.
+             */
+            template<typename T>
+            PortableCollectionWriter<T> WriteCollection(ignite::portable::CollectionType typ)
+            {
+                int32_t id = impl->WriteCollection(typ);
+
+                return PortableCollectionWriter<T>(impl, id);
+            }
+
+            /**
+             * Start map write.
+             *
+             * @param typ Map type.
+             * @return Map writer.
+             */
+            template<typename K, typename V>
+            PortableMapWriter<K, V> WriteMap()
+            {
+                return WriteMap<K, V>(IGNITE_MAP_UNDEFINED);
+            }
+
+            /**
+             * Start map write.
+             *
+             * @param typ Map type.
+             * @return Map writer.
+             */
+            template<typename K, typename V>
+            PortableMapWriter<K, V> WriteMap(ignite::portable::MapType typ)
+            {
+                int32_t id = impl->WriteMap(typ);
+
+                return PortableMapWriter<K, V>(impl, id);
+            }
+
+            /**
+             * Write object.
+             *
+             * @param val Object.
+             */
+            template<typename T>
+            void WriteObject(T val)
+            {
+                impl->WriteObject<T>(val);
+            }
+        private:
+            /** Implementation delegate. */
+            ignite::impl::portable::PortableWriterImpl* impl; 
+        };
+    }
+}
+
+#endif
\ No newline at end of file


[07/28] ignite git commit: IGNITE-1513: Moved CPP.

Posted by vo...@apache.org.
http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/core/include/ignite/ignite.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/ignite/ignite.h b/modules/platform/src/main/cpp/core/include/ignite/ignite.h
deleted file mode 100644
index 6c1263e..0000000
--- a/modules/platform/src/main/cpp/core/include/ignite/ignite.h
+++ /dev/null
@@ -1,154 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef _IGNITE
-#define _IGNITE
-
-#include "ignite/cache/cache.h"
-#include "ignite/impl/ignite_impl.h"
-#include "ignite/ignite_configuration.h"
-
-namespace ignite
-{
-    /**
-     * Main interface to operate with Ignite.
-     */
-    class IGNITE_IMPORT_EXPORT Ignite
-    {
-    public:
-        /**
-         * Default constructor.
-         */
-        Ignite();
-
-        /**
-         * Constructor.
-         */
-        Ignite(impl::IgniteImpl* impl);
-        
-        /**
-         * Get Ignite instance name.
-         *
-         * @return Name.
-         */
-        char* GetName();
-
-        /**
-         * Get cache.
-         *
-         * @param name Cache name.
-         * @return Cache.
-         */
-        template<typename K, typename V>
-        cache::Cache<K, V> GetCache(const char* name)
-        {
-            IgniteError err;
-
-            cache::Cache<K, V> res = GetCache<K, V>(name, &err);
-
-            IgniteError::ThrowIfNeeded(err);
-
-            return res;
-        }
-
-        /**
-         * Get cache.
-         *
-         * @param name Cache name.
-         * @param err Error;
-         * @return Cache.
-         */
-        template<typename K, typename V>
-        cache::Cache<K, V> GetCache(const char* name, IgniteError* err)
-        {
-            impl::cache::CacheImpl* cacheImpl = impl.Get()->GetCache<K, V>(name, err);
-
-            return cache::Cache<K, V>(cacheImpl);
-        }
-
-        /**
-         * Get or create cache.
-         *
-         * @param name Cache name.
-         * @return Cache.
-         */
-        template<typename K, typename V>
-        cache::Cache<K, V> GetOrCreateCache(const char* name)
-        {
-            IgniteError err;
-
-            cache::Cache<K, V> res = GetOrCreateCache<K, V>(name, &err);
-
-            IgniteError::ThrowIfNeeded(err);
-
-            return res;
-        }
-
-        /**
-         * Get or create cache.
-         *
-         * @param name Cache name.
-         * @param err Error;
-         * @return Cache.
-         */
-        template<typename K, typename V>
-        cache::Cache<K, V> GetOrCreateCache(const char* name, IgniteError* err)
-        {
-            impl::cache::CacheImpl* cacheImpl = impl.Get()->GetOrCreateCache<K, V>(name, err);
-
-            return cache::Cache<K, V>(cacheImpl);
-        }
-
-        /**
-         * Create cache.
-         *
-         * @param name Cache name.
-         * @return Cache.
-         */
-        template<typename K, typename V>
-        cache::Cache<K, V> CreateCache(const char* name)
-        {
-            IgniteError err;
-
-            cache::Cache<K, V> res = CreateCache<K, V>(name, &err);
-
-            IgniteError::ThrowIfNeeded(err);
-
-            return res;
-        }
-
-        /**
-         * Create cache.
-         *
-         * @param name Cache name.
-         * @param err Error;
-         * @return Cache.
-         */
-        template<typename K, typename V>
-        cache::Cache<K, V> CreateCache(const char* name, IgniteError* err)
-        {
-            impl::cache::CacheImpl* cacheImpl = impl.Get()->CreateCache<K, V>(name, err);
-
-            return cache::Cache<K, V>(cacheImpl);
-        }
-    private:
-        /** Implementation delegate. */
-        ignite::common::concurrent::SharedPointer<impl::IgniteImpl> impl;
-    };
-}
-
-#endif

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/core/include/ignite/ignite_configuration.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/ignite/ignite_configuration.h b/modules/platform/src/main/cpp/core/include/ignite/ignite_configuration.h
deleted file mode 100644
index ce2d730..0000000
--- a/modules/platform/src/main/cpp/core/include/ignite/ignite_configuration.h
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef _IGNITE_CONFIGURATION
-#define _IGNITE_CONFIGURATION
-
-#include <stdint.h>
-
-namespace ignite
-{    
-    /**
-     * Single JVM option.
-     */
-    struct IgniteJvmOption
-    {
-        /** Option. */
-        char* opt;
-
-        /**
-         * Default constructor.
-         */
-        IgniteJvmOption() : opt(NULL)
-        {
-            // No-op.    
-        }
-
-        /**
-         * Constructor.
-         *
-         * @param opt Option.
-         */
-        IgniteJvmOption(char* opt) : opt(opt)
-        {
-            // No-op.
-        }
-    };
-
-    /**
-     * Ignite configuration.
-     */
-    struct IgniteConfiguration
-    {
-        /** Path to Ignite home. */
-        char* igniteHome;
-
-        /** Path to Spring configuration file. */
-        char* springCfgPath;
-
-        /** Path ot JVM libbrary. */
-        char* jvmLibPath;
-
-        /** JVM classpath. */
-        char* jvmClassPath;
-
-        /** Initial amount of JVM memory. */
-        int32_t jvmInitMem;
-
-        /** Maximum amount of JVM memory. */
-        int32_t jvmMaxMem;
-
-        /** Additional JVM options. */
-        IgniteJvmOption* jvmOpts;
-
-        /** Additional JVM options count. */
-        int32_t jvmOptsLen;
-
-        /**
-         * Constructor.
-         */
-        IgniteConfiguration() : igniteHome(NULL), springCfgPath(NULL), jvmLibPath(NULL), jvmClassPath(NULL),
-            jvmInitMem(512), jvmMaxMem(1024), jvmOpts(NULL), jvmOptsLen(0)
-        {
-            // No-op.
-        }
-    };    
-}
-
-#endif
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/core/include/ignite/ignite_error.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/ignite/ignite_error.h b/modules/platform/src/main/cpp/core/include/ignite/ignite_error.h
deleted file mode 100644
index 4438a0e..0000000
--- a/modules/platform/src/main/cpp/core/include/ignite/ignite_error.h
+++ /dev/null
@@ -1,260 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef _IGNITE_ERROR
-#define _IGNITE_ERROR
-
-#include <sstream>
-#include <stdint.h>
-
-#include <ignite/common/common.h>
-
-#define IGNITE_ERROR_1(code, part1) { \
-    std::stringstream stream; \
-    stream << (part1); \
-    throw ignite::IgniteError(code, stream.str().c_str()); \
-}
-
-#define IGNITE_ERROR_2(code, part1, part2) { \
-    std::stringstream stream; \
-    stream << (part1) << (part2); \
-    throw ignite::IgniteError(code, stream.str().c_str()); \
-}
-
-#define IGNITE_ERROR_3(code, part1, part2, part3) { \
-    std::stringstream stream; \
-    stream << (part1) << (part2) << (part3); \
-    throw ignite::IgniteError(code, stream.str().c_str()); \
-}
-
-#define IGNITE_ERROR_FORMATTED_1(code, msg, key1, val1) { \
-    std::stringstream stream; \
-    stream << msg << " [" << key1 << "=" << (val1) << "]"; \
-    throw ignite::IgniteError(code, stream.str().c_str()); \
-}
-
-#define IGNITE_ERROR_FORMATTED_2(code, msg, key1, val1, key2, val2) { \
-    std::stringstream stream; \
-    stream << msg << " [" << key1 << "=" << (val1) << ", " << key2 << "=" << (val2) << "]"; \
-    throw ignite::IgniteError(code, stream.str().c_str()); \
-}
-
-#define IGNITE_ERROR_FORMATTED_3(code, msg, key1, val1, key2, val2, key3, val3) { \
-    std::stringstream stream; \
-    stream << msg << " [" << key1 << "=" << (val1) << ", " << key2 << "=" << (val2) << ", " << key3 << "=" << (val3) << "]"; \
-    throw ignite::IgniteError(code, stream.str().c_str()); \
-}
-
-#define IGNITE_ERROR_FORMATTED_4(code, msg, key1, val1, key2, val2, key3, val3, key4, val4) { \
-    std::stringstream stream; \
-    stream << msg << " [" << key1 << "=" << (val1) << ", " << key2 << "=" << (val2) << ", " << key3 << "=" << (val3) << ", " << key4 << "=" << (val4) << "]"; \
-    throw ignite::IgniteError(code, stream.str().c_str()); \
-}
-
-namespace ignite
-{
-    /**
-     * Ignite error information.
-     */
-    class IGNITE_IMPORT_EXPORT IgniteError
-    {
-    public:
-        /** Success. */
-        static const int IGNITE_SUCCESS = 0;
-
-        /** Failed to initialize JVM. */
-        static const int IGNITE_ERR_JVM_INIT = 1;
-
-        /** Failed to attach to JVM. */
-        static const int IGNITE_ERR_JVM_ATTACH = 2;
-        
-        /** JVM library is not found. */
-        static const int IGNITE_ERR_JVM_LIB_NOT_FOUND = 3;
-
-        /** Failed to load JVM library. */
-        static const int IGNITE_ERR_JVM_LIB_LOAD_FAILED = 4;
-        
-        /** JVM classpath is not provided. */
-        static const int IGNITE_ERR_JVM_NO_CLASSPATH = 5;
-
-        /** JVM error: no class definition found. */
-        static const int IGNITE_ERR_JVM_NO_CLASS_DEF_FOUND = 6;
-
-        /** JVM error: no such method. */
-        static const int IGNITE_ERR_JVM_NO_SUCH_METHOD = 7;
-
-        /** Memory operation error. */
-        static const int IGNITE_ERR_MEMORY = 1001;
-
-        /** Portable error. */
-        static const int IGNITE_ERR_PORTABLE = 1002;
-
-        /** Generic Ignite error. */
-        static const int IGNITE_ERR_GENERIC = 2000;
-
-        /** Illegal argument passed. */
-        static const int IGNITE_ERR_ILLEGAL_ARGUMENT = 2001;
-
-        /** Illegal state. */
-        static const int IGNITE_ERR_ILLEGAL_STATE = 2002;
-
-        /** Unsupported operation. */
-        static const int IGNITE_ERR_UNSUPPORTED_OPERATION = 2003;
-
-        /** Thread has been interrup. */
-        static const int IGNITE_ERR_INTERRUPTED = 2004;
-
-        /** Cluster group is empty. */
-        static const int IGNITE_ERR_CLUSTER_GROUP_EMPTY = 2005;
-
-        /** Cluster topology problem. */
-        static const int IGNITE_ERR_CLUSTER_TOPOLOGY = 2006;
-
-        /** Compute execution rejected. */
-        static const int IGNITE_ERR_COMPUTE_EXECUTION_REJECTED = 2007;
-
-        /** Compute job failover. */
-        static const int IGNITE_ERR_COMPUTE_JOB_FAILOVER = 2008;
-
-        /** Compute task cancelled. */
-        static const int IGNITE_ERR_COMPUTE_TASK_CANCELLED = 2009;
-
-        /** Compute task timeout. */
-        static const int IGNITE_ERR_COMPUTE_TASK_TIMEOUT = 2010;
-
-        /** Compute user undeclared exception. */
-        static const int IGNITE_ERR_COMPUTE_USER_UNDECLARED_EXCEPTION = 2011;
-
-        /** Generic cache error. */
-        static const int IGNITE_ERR_CACHE = 2012;
-
-        /** Generic cache loader error. */
-        static const int IGNITE_ERR_CACHE_LOADER = 2013;
-
-        /** Generic cache writer error. */
-        static const int IGNITE_ERR_CACHE_WRITER = 2014;
-        
-        /** Generic cache entry processor error. */
-        static const int IGNITE_ERR_ENTRY_PROCESSOR = 2015;
-
-        /** Cache atomic update timeout. */
-        static const int IGNITE_ERR_CACHE_ATOMIC_UPDATE_TIMEOUT = 2016;
-
-        /** Cache partial update. */
-        static const int IGNITE_ERR_CACHE_PARTIAL_UPDATE = 2017;
-        
-        /** Transaction optimisitc exception. */
-        static const int IGNITE_ERR_TX_OPTIMISTIC = 2018;
-
-        /** Transaction timeout. */
-        static const int IGNITE_ERR_TX_TIMEOUT = 2019;
-
-        /** Transaction rollback. */
-        static const int IGNITE_ERR_TX_ROLLBACK = 2020;
-
-        /** Transaction heuristic exception. */
-        static const int IGNITE_ERR_TX_HEURISTIC = 2021;
-
-        /** Authentication error. */
-        static const int IGNITE_ERR_AUTHENTICATION = 2022;
-
-        /** Security error. */
-        static const int IGNITE_ERR_SECURITY = 2023;
-        
-        /** Unknown error. */
-        static const int IGNITE_ERR_UNKNOWN = -1;
-
-        /**
-         * Throw an error if code is not IGNITE_SUCCESS.
-         *
-         * @param err Error.
-         */
-        static void ThrowIfNeeded(IgniteError& err);
-
-        /**
-         * Create empty error.
-         */
-        IgniteError();
-
-        /**
-         * Create error with specific code.
-         *
-         * @param code Error code.
-         */
-        IgniteError(const int32_t code);
-
-        /**
-         * Create error with specific code and message.
-         *
-         * @param code Error code.
-         * @param msg Message.
-         */
-        IgniteError(const int32_t code, const char* msg);
-        
-        /**
-         * Copy constructor.
-         *
-         * @param other Other instance.
-         */
-        IgniteError(const IgniteError& other);
-
-        /**
-         * Assignment operator.
-         *
-         * @param other Other instance.
-         * @return Assignment result.
-         */
-        IgniteError& operator=(const IgniteError& other);
-
-        /**
-         * Destructor.
-         */
-        ~IgniteError();
-
-        /**
-         * Get error code.
-         *
-         * @return Error code.
-         */
-        int32_t GetCode();
-
-        /**
-         * Get error message.
-         *
-         * @return Error message.
-         */
-        const char* GetText();
-        
-        /**
-         * Set error.
-         *
-         * @param jniCode Error code.
-         * @param jniCls Error class.
-         * @param jniMsg Error message.
-         * @param err Error.
-         */
-        static void SetError(const int jniCode, const char* jniCls, const char* jniMsg, IgniteError* err);
-    private:
-        /** Error code. */
-        int32_t code;    
-        
-        /** Error message. */
-        char* msg;       
-    };    
-}
-
-#endif
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/core/include/ignite/ignition.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/ignite/ignition.h b/modules/platform/src/main/cpp/core/include/ignite/ignition.h
deleted file mode 100644
index 8d32448..0000000
--- a/modules/platform/src/main/cpp/core/include/ignite/ignition.h
+++ /dev/null
@@ -1,195 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/**
- * \mainpage Apache Ignite C++ Library
- *
- * The Apache Ignite is a proven software solution, which delivers unprecedented speed
- * and unlimited scale to accelerate your business and time to insights. It enables high-performance transactions,
- * real-time streaming and fast analytics in a single, comprehensive data access and processing layer. The In-Memory
- * Data Fabric is designed to easily power both existing and new applications in a distributed, massively
- * parallel architecture on affordable, industry-standard hardware.
- * <p>
- * The Apache Ignite provides a unified API that spans all key types of applications
- * (Java, .NET, C++) and connects them with multiple data stores containing structured, semi-structured and
- * unstructured data (SQL, NoSQL, Hadoop). It offers a secure, highly available and manageable data environment
- * that allows companies to process full ACID transactions and generate valuable insights from real-time,
- * interactive and batch queries.
- * <p>
- * The In-Memory Data Fabric offers a strategic approach to in-memory computing that delivers performance,
- * scale and comprehensive capabilities far above and beyond what traditional in-memory databases,
- * data grids or other in-memory-based point solutions can offer by themselves.
- *
- * \section ultimate_speed_and_scale Ultimate Speed and Scale
- *
- * The Apache Ignite accesses and processes data from distributed enterprise and
- * cloud-based data stores orders of magnitudes faster, and shares them with today's most demanding transactional,
- * analytical and hybrid applications. The In-Memory Data Fabric delivers unprecedented throughput
- * and low latency performance in a virtually unlimited, global scale-out architecture for both new and
- * existing applications.
- *
- * \section comprehensive_and_proven Comprehensive and Proven
- *
- * The Apache Ignite is the product of seven years of meticulous research and development,
- * built from the ground up (i.e. no bolt-on's), and run successfully by hundreds of organizations worldwide.
- * It is a comprehensive in-memory solution that includes a clustering and compute grid, a database-agnostic data grid,
- * a real-time streaming engine as well as plug-and-play Hadoop acceleration. The In-Memory Data Fabric
- * connects multiple data sources (relational, NoSQL, Hadoop) with Java, .NET and C++ applications, and offers
- * a secure and highly available architecture; it also provides a fully-featured, graphical management interface.
- * <p>
- * The Apache Ignite is used today by Fortune 500 companies, top government agencies as well as
- * innovative mobile and web companies in a broad range of business scenarios, such as automated trading systems,
- * fraud detection, big data analytics, social networks, online gaming, and bioinformatics.
- */
-
-#ifndef _IGNITE_IGNITION
-#define _IGNITE_IGNITION
-
-#include "ignite/ignite.h"
-#include "ignite/ignite_configuration.h"
-#include "ignite/ignite_error.h"
-
-namespace ignite
-{
-    /**
-     * This class defines a factory for the main Ignite API.
-     */
-    class IGNITE_IMPORT_EXPORT Ignition
-    {
-    public:
-        /**
-         * Start Ignite instance.
-         *
-         * @param cfg Configuration.
-         * @return Ignite instance or null in case of error.
-         */
-        static Ignite Start(const IgniteConfiguration& cfg);
-
-        /*
-         * Start Ignite instance.
-         *
-         * @param cfg Configuration.
-         * @param err Error.
-         * @return Ignite instance or null in case of error.
-         */
-        static Ignite Start(const IgniteConfiguration& cfg, IgniteError* err);
-
-        /**
-         * Start Ignite instance with specific name.
-         *
-         * @param cfg Configuration.
-         * @param name Ignite name.
-         * @return Ignite instance or null in case of error.
-         */
-        static Ignite Start(const IgniteConfiguration& cfg, const char* name);
-
-        /**
-         * Start Ignite instance with specific name.
-         *
-         * @param cfg Configuration.
-         * @param name Ignite name.
-         * @param err Error.
-         * @return Ignite instance or null in case of error.
-         */
-        static Ignite Start(const IgniteConfiguration& cfg, const char* name, IgniteError* err);
-
-        /**
-         * Get default Ignite instance.
-         *
-         * @return Default Ignite instance.
-         */
-        static Ignite Get();
-
-        /**
-         * Get default Ignite instance.
-         *
-         * @param err Error.
-         * @return Default Ignite instance.
-         */
-        static Ignite Get(IgniteError* err);
-
-        /**
-         * Get Ignite instance with the given name.
-         *
-         * @param name Ignite name.
-         * @return Ignite instance.
-         */
-        static Ignite Get(const char* name);
-
-        /**
-         * Get Ignite instance with the given name.
-         *
-         * @param name Ignite name.
-         * @param err Error.
-         * @return Ignite instance.
-         */
-        static Ignite Get(const char* name, IgniteError* err);
-
-        /**
-         * Stop default Ignite instance.
-         *
-         * @param cancel Cancel flag.
-         * @return True if default Ignite instance was stopped by this call.
-         */
-        static bool Stop(const bool cancel);
-
-        /**
-         * Stop default Ignite instance.
-         *
-         * @param cancel Cancel flag.
-         * @param err Error.
-         * @return True if Ignite instance was stopped by this call.
-         */
-        static bool Stop(const bool cancel, IgniteError* err);
-
-        /**
-         * Stop Ignite instance with the given name.
-         *
-         * @param name Ignite name.
-         * @param cancel Cancel flag.
-         * @return True if Ignite instance was stopped by this call.
-         */
-        static bool Stop(const char* name, const bool cancel);
-
-        /**
-         * Stop Ignite instance with the given name.
-         *
-         * @param name Ignite name.
-         * @param cancel Cancel flag.
-         * @param err Error.
-         * @return True if Ignite instance was stopped by this call.
-         */
-        static bool Stop(const char* name, const bool cancel, IgniteError* err);
-
-        /**
-         * Stop all running Ignite instances.
-         *
-         * @param cancel Cancel flag.
-         */
-        static void StopAll(const bool cancel);
-
-        /**
-         * Stop all running Ignite instances.
-         *
-         * @param cancel Cancel flag.
-         * @param err Error.
-         */
-        static void StopAll(const bool cancel, IgniteError* err);
-    };    
-}
-
-#endif
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/core/include/ignite/impl/cache/cache_impl.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/ignite/impl/cache/cache_impl.h b/modules/platform/src/main/cpp/core/include/ignite/impl/cache/cache_impl.h
deleted file mode 100644
index 8c744e0..0000000
--- a/modules/platform/src/main/cpp/core/include/ignite/impl/cache/cache_impl.h
+++ /dev/null
@@ -1,418 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef _IGNITE_CACHE_IMPL
-#define _IGNITE_CACHE_IMPL
-
-#include "ignite/cache/query/query_scan.h"
-#include "ignite/cache/query/query_sql.h"
-#include "ignite/cache/query/query_text.h"
-#include "ignite/impl/ignite_environment.h"
-#include "ignite/impl/cache/query/query_impl.h"
-#include "ignite/impl/operations.h"
-
-namespace ignite
-{    
-    namespace impl 
-    {
-        namespace cache
-        {
-            /**
-             * Cache implementation.
-             */
-            class IGNITE_IMPORT_EXPORT CacheImpl
-            {
-            public:
-                /**
-                 * Constructor used to create new instance.
-                 *
-                 * @param name Name.
-                 * @param env Environment.
-                 * @param javaRef Reference to java object.
-                 */
-                CacheImpl(char* name, ignite::common::concurrent::SharedPointer<IgniteEnvironment> env, jobject javaRef);
-                
-                /**
-                 * Destructor.
-                 */
-                ~CacheImpl();
-                
-                /**
-                 * Get name.
-                 *
-                 * @return Cache name.
-                 */
-                char* GetName();
-
-                /**
-                 * Perform IsEmpty.
-                 *
-                 * @param err Error.
-                 * @return Result.
-                 */
-                bool IsEmpty(IgniteError* err);
-
-                /**
-                 * Perform ContainsKey.
-                 *
-                 * @param inOp Input.
-                 * @param err Error.
-                 * @return Result.
-                 */
-                bool ContainsKey(InputOperation& inOp, IgniteError* err);
-
-                /**
-                 * Perform ContainsKeys.
-                 *
-                 * @param inOp Input.
-                 * @param err Error.
-                 * @return Result.
-                 */
-                bool ContainsKeys(InputOperation& inOp, IgniteError* err);
-
-                /**
-                 * Perform LocalPeek.
-                 *
-                 * @param inOp Input.
-                 * @param outOp Output.
-                 * @param peekModes Peek modes.
-                 * @param err Error.
-                 */
-                void LocalPeek(InputOperation& inOp, OutputOperation& outOp, 
-                    int32_t peekModes, IgniteError* err);
-
-                /**
-                 * Perform Get.
-                 *
-                 * @param inOp Input.
-                 * @param outOp Output.
-                 * @param err Error.
-                 */
-                void Get(InputOperation& inOp, OutputOperation& outOp, IgniteError* err);
-                
-                /**
-                 * Perform GetAll.
-                 *
-                 * @param inOp Input.
-                 * @param outOp Output.
-                 * @param err Error.
-                 */
-                void GetAll(InputOperation& inOp, OutputOperation& outOp, IgniteError* err);
-
-                /**
-                 * Perform Put.
-                 *
-                 * @param inOp Input.
-                 * @param err Error.
-                 */
-                void Put(InputOperation& inOp, IgniteError* err);
-
-                /**
-                 * Perform PutAll.
-                 *
-                 * @param inOp Input.
-                 * @param err Error.
-                 */
-                void PutAll(InputOperation& inOp, IgniteError* err);
-
-                /**
-                 * Perform GetAndPut.
-                 *
-                 * @param inOp Input.
-                 * @param outOp Output.
-                 * @param err Error.
-                 */
-                void GetAndPut(InputOperation& inOp, OutputOperation& outOp, IgniteError* err);
-
-                /**
-                 * Perform GetAndReplace.
-                 *
-                 * @param inOp Input.
-                 * @param outOp Output.
-                 * @param err Error.
-                 */
-                void GetAndReplace(InputOperation& inOp, OutputOperation& outOp, IgniteError* err);
-
-                /**
-                 * Perform GetAndRemove.
-                 *
-                 * @param inOp Input.
-                 * @param outOp Output.
-                 * @param err Error.
-                 */
-                void GetAndRemove(InputOperation& inOp, OutputOperation& outOp, IgniteError* err);
-
-                /**
-                 * Perform PutIfAbsent.
-                 *
-                 * @param inOp Input.
-                 * @param err Error.
-                 * @return Result
-                 */
-                bool PutIfAbsent(InputOperation& inOp, IgniteError* err);
-
-                /**
-                 * Perform GetAndPutIfAbsent.
-                 *
-                 * @param inOp Input.
-                 * @param outOp Output.
-                 * @param err Error.
-                 */
-                void GetAndPutIfAbsent(InputOperation& inOp, OutputOperation& outOp, IgniteError* err);
-
-                /**
-                 * Perform Replace(K, V).
-                 *
-                 * @param inOp Input.
-                 * @param err Error.
-                 * @return Result
-                 */
-                bool Replace(InputOperation& inOp, IgniteError* err);
-
-                /**
-                 * Perform Replace(K, V, V).
-                 *
-                 * @param inOp Input.
-                 * @param err Error.
-                 * @return Result
-                 */
-                bool ReplaceIfEqual(InputOperation& inOp, IgniteError* err);
-
-                /**
-                 * Perform LocalEvict.
-                 *
-                 * @param inOp Input.
-                 * @param err Error.
-                 */
-                void LocalEvict(InputOperation& inOp, IgniteError* err);
-
-                /**
-                 * Perform Clear.
-                 *
-                 * @param err Error.
-                 */
-                void Clear(IgniteError* err);
-
-                /**
-                 * Perform Clear.
-                 *
-                 * @param inOp Input.
-                 * @param err Error.
-                 */
-                void Clear(InputOperation& inOp, IgniteError* err);
-
-                /**
-                 * Perform ClearAll.
-                 *
-                 * @param inOp Input.
-                 * @param err Error.
-                 */
-                void ClearAll(InputOperation& inOp, IgniteError* err);
-
-                /**
-                 * Perform LocalClear.
-                 *
-                 * @param inOp Input.
-                 * @param err Error.
-                 */
-                void LocalClear(InputOperation& inOp, IgniteError* err);
-
-                /**
-                 * Perform LocalClearAll.
-                 *
-                 * @param inOp Input.
-                 * @param err Error.
-                 */
-                void LocalClearAll(InputOperation& inOp, IgniteError* err);
-
-                /**
-                 * Perform Remove(K).
-                 *
-                 * @param inOp Input.
-                 * @param err Error.
-                 * @return Result
-                 */
-                bool Remove(InputOperation& inOp, IgniteError* err);
-
-                /**
-                 * Perform Remove(K, V).
-                 *
-                 * @param inOp Input.
-                 * @param err Error.
-                 * @return Result
-                 */
-                bool RemoveIfEqual(InputOperation& inOp, IgniteError* err);
-
-                /**
-                 * Perform RemoveAll.
-                 *
-                 * @param inOp Input.
-                 * @param err Error.
-                 */
-                void RemoveAll(InputOperation& inOp, IgniteError* err);
-
-                /**
-                 * Perform RemoveAll.
-                 *
-                 * @param err Error.
-                 */
-                void RemoveAll(IgniteError* err);
-
-                /**
-                 * Perform Size.
-                 *
-                 * @param peekModes Peek modes.
-                 * @param err Error.
-                 * @return Result.
-                 */
-                int32_t Size(const int32_t peekModes, IgniteError* err);
-
-                /**
-                 * Perform LocalSize.
-                 * 
-                 * @param peekModes Peek modes.
-                 * @param err Error.
-                 * @return Result.
-                 */
-                int32_t LocalSize(const int32_t peekModes, IgniteError* err);
-
-                /**
-                 * Invoke query.
-                 *
-                 * @param qry Query.
-                 * @param err Error.
-                 * @return Query cursor.
-                 */
-                query::QueryCursorImpl* QuerySql(const ignite::cache::query::SqlQuery& qry, IgniteError* err);
-
-                /*
-                 * Invoke text query.
-                 *
-                 * @param qry Query.
-                 * @param err Error.
-                 * @return Query cursor.
-                 */
-                query::QueryCursorImpl* QueryText(const ignite::cache::query::TextQuery& qry, IgniteError* err);
-
-                /*
-                 * Invoke scan query.
-                 *
-                 * @param qry Query.
-                 * @param err Error.
-                 * @return Query cursor.
-                 */
-                query::QueryCursorImpl* QueryScan(const ignite::cache::query::ScanQuery& qry, IgniteError* err);
-                
-            private:
-                /** Name. */
-                char* name; 
-                
-                /** Environment. */
-                ignite::common::concurrent::SharedPointer<IgniteEnvironment> env;
-                
-                /** Handle to Java object. */
-                jobject javaRef;                     
-
-                IGNITE_NO_COPY_ASSIGNMENT(CacheImpl)
-
-                /**
-                 * Write data to memory.
-                 *
-                 * @param mem Memory.
-                 * @param inOp Input opeartion.
-                 * @param err Error.
-                 * @return Memory pointer.
-                 */
-                int64_t WriteTo(interop::InteropMemory* mem, InputOperation& inOp, IgniteError* err);
-
-                /**
-                 * Read data from memory.
-                 *
-                 * @param mem Memory.
-                 * @param outOp Output operation.
-                 */
-                void ReadFrom(interop::InteropMemory* mem, OutputOperation& outOp);
-
-                /**
-                 * Internal cache size routine.
-                 *
-                 * @param peekModes Peek modes.
-                 * @param loc Local flag.
-                 * @param err Error.
-                 * @return Size.
-                 */
-                int SizeInternal(const int32_t peekModes, const bool loc, IgniteError* err);
-
-                /**
-                 * Internal out operation.
-                 *
-                 * @param opType Operation type.
-                 * @param inOp Input.
-                 * @param err Error.
-                 * @return Result.
-                 */
-                bool OutOpInternal(const int32_t opType, InputOperation& inOp, IgniteError* err);
-
-                /**
-                 * Internal out-in operation.
-                 *
-                 * @param opType Operation type.
-                 * @param inOp Input.
-                 * @param outOp Output.
-                 * @param err Error.
-                 */
-                void OutInOpInternal(const int32_t opType, InputOperation& inOp, OutputOperation& outOp, 
-                    IgniteError* err);
-
-                /**
-                 * Internal query execution routine.
-                 *
-                 * @param qry Query.
-                 * @param typ Query type.
-                 * @param err Error.
-                 */
-                template<typename T>
-                query::QueryCursorImpl* QueryInternal(const T& qry, int32_t typ, IgniteError* err)
-                {
-                    ignite::common::java::JniErrorInfo jniErr;
-
-                    ignite::common::concurrent::SharedPointer<interop::InteropMemory> mem = env.Get()->AllocateMemory();
-                    interop::InteropMemory* mem0 = mem.Get();
-                    interop::InteropOutputStream out(mem0);
-                    portable::PortableWriterImpl writer(&out, env.Get()->GetMetadataManager());
-                    ignite::portable::PortableRawWriter rawWriter(&writer);
-
-                    qry.Write(rawWriter);
-
-                    out.Synchronize();
-
-                    jobject qryJavaRef = env.Get()->Context()->CacheOutOpQueryCursor(javaRef, typ, mem.Get()->PointerLong(), 
-                        &jniErr);
-
-                    IgniteError::SetError(jniErr.code, jniErr.errCls, jniErr.errMsg, err);
-
-                    if (jniErr.code == ignite::common::java::IGNITE_JNI_ERR_SUCCESS)
-                        return new query::QueryCursorImpl(env, qryJavaRef);
-                    else
-                        return NULL;
-                }
-            };
-        }
-    }    
-}
-
-#endif
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/core/include/ignite/impl/cache/query/query_impl.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/ignite/impl/cache/query/query_impl.h b/modules/platform/src/main/cpp/core/include/ignite/impl/cache/query/query_impl.h
deleted file mode 100644
index e65eeb6..0000000
--- a/modules/platform/src/main/cpp/core/include/ignite/impl/cache/query/query_impl.h
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef _IGNITE_CACHE_QUERY_IMPL
-#define _IGNITE_CACHE_QUERY_IMPL
-
-#include "ignite/ignite_error.h"
-#include "ignite/impl/ignite_environment.h"
-#include "ignite/impl/operations.h"
-
-namespace ignite
-{
-    namespace impl
-    {
-        namespace cache
-        {
-            namespace query
-            {
-                /**
-                 * Query cursor implementation.
-                 */
-                class IGNITE_IMPORT_EXPORT QueryCursorImpl
-                {
-                public:
-                    /**
-                     * Constructor.
-                     * 
-                     * @param env Environment.
-                     * @param javaRef Java reference.
-                     */
-                    QueryCursorImpl(ignite::common::concurrent::SharedPointer<IgniteEnvironment> env, jobject javaRef);
-
-                    /**
-                     * Destructor.
-                     */
-                    ~QueryCursorImpl();
-
-                    /**
-                     * Check whether next result exists.
-                     *
-                     * @param err Error.
-                     * @return True if exists.
-                     */
-                    bool HasNext(IgniteError* err);
-
-                    /**
-                     * Get next object.
-                     * 
-                     * @param op Operation.
-                     * @param err Error.
-                     */
-                    void GetNext(OutputOperation& op, IgniteError* err);
-
-                    /**
-                     * Get all cursor entries.
-                     *
-                     * @param op Operation.
-                     * @param err Error.
-                     */
-                    void GetAll(OutputOperation& op, IgniteError* err);
-
-                private:
-                    /** Environment. */
-                    ignite::common::concurrent::SharedPointer<impl::IgniteEnvironment> env;
-
-                    /** Handle to Java object. */
-                    jobject javaRef;
-
-                    /** Whether iteration methods were called. */
-                    bool iterCalled;
-
-                    /** Whether GetAll() method was called. */
-                    bool getAllCalled;
-
-                    /** Whether next entry is available. */
-                    bool hasNext;
-
-                    IGNITE_NO_COPY_ASSIGNMENT(QueryCursorImpl);
-
-                    /**
-                     * Create Java-side iterator if needed.
-                     *
-                     * @param err Error.
-                     * @return True in case of success, false if an error is thrown.
-                     */
-                    bool CreateIteratorIfNeeded(IgniteError* err);
-
-                    /**
-                     * Check whether Java-side iterator has next element.
-                     *
-                     * @param err Error.
-                     * @return True if the next element is available.
-                     */
-                    bool IteratorHasNext(IgniteError* err);
-                };
-            }
-        }
-    }
-}
-
-#endif
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/core/include/ignite/impl/handle_registry.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/ignite/impl/handle_registry.h b/modules/platform/src/main/cpp/core/include/ignite/impl/handle_registry.h
deleted file mode 100644
index 5e1b60a..0000000
--- a/modules/platform/src/main/cpp/core/include/ignite/impl/handle_registry.h
+++ /dev/null
@@ -1,202 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef _IGNITE_HANDLE_REGISTRY
-#define _IGNITE_HANDLE_REGISTRY
-
-#include <map>
-#include <stdint.h>
-
-#include <ignite/common/concurrent.h>
-
-namespace ignite
-{
-    namespace impl
-    {
-        /**
-         * Something what can be registered inside handle registry.
-         */
-        class IGNITE_IMPORT_EXPORT HandleRegistryEntry
-        {
-        public:
-            /**
-             * Destructor.
-             */
-            virtual ~HandleRegistryEntry();
-        };
-
-        /**
-         * Handle registry segment containing thread-specific data for slow-path access.
-         */
-        class IGNITE_IMPORT_EXPORT HandleRegistrySegment
-        {
-        public:
-            /**
-             * Constructor.
-             */
-            HandleRegistrySegment();
-
-            /**
-             * Destructor.
-             */
-            ~HandleRegistrySegment();
-
-            /**
-             * Get entry from segment.
-             *
-             * @param hnd Handle.
-             * @return Associated entry or NULL if it doesn't exists.
-             */
-            ignite::common::concurrent::SharedPointer<HandleRegistryEntry> Get(int64_t hnd);
-
-            /**
-             * Put entry into segment.
-             *
-             * @param hnd Handle.
-             * @param entry Associated entry (cannot be NULL).
-             */
-            void Put(int64_t hnd, const ignite::common::concurrent::SharedPointer<HandleRegistryEntry>& entry);
-
-            /**
-             * Remove entry from the segment.
-             *
-             * @param hnd Handle.
-             */
-            void Remove(int64_t hnd);            
-
-            /**
-             * Clear all entries from the segment.
-             */
-            void Clear();
-        private:
-            /** Map with data. */
-            std::map<int64_t, ignite::common::concurrent::SharedPointer<HandleRegistryEntry>>* map;
-
-            /** Mutex. */
-            ignite::common::concurrent::CriticalSection* mux;
-
-            IGNITE_NO_COPY_ASSIGNMENT(HandleRegistrySegment);
-        };
-
-        /**
-         * Handle registry.
-         */
-        class IGNITE_IMPORT_EXPORT HandleRegistry
-        {
-        public:
-            /**
-             * Constructor.
-             *
-             * @param fastCap Fast-path capacity.
-             * @param segmentCnt Slow-path segments count.
-             */
-            HandleRegistry(int32_t fastCap, int32_t slowSegmentCnt);
-
-            /**
-             * Destructor.
-             */
-            ~HandleRegistry();
-
-            /**
-             * Allocate handle.
-             *
-             * @param target Target.
-             * @return Handle.
-             */
-            int64_t Allocate(const ignite::common::concurrent::SharedPointer<HandleRegistryEntry>& target);
-
-            /**
-             * Allocate handle in critical mode.
-             *
-             * @param target Target.
-             * @return Handle.
-             */
-            int64_t AllocateCritical(const ignite::common::concurrent::SharedPointer<HandleRegistryEntry>& target);
-
-            /**
-             * Allocate handle in safe mode.
-             *
-             * @param target Target.
-             * @return Handle.
-             */
-            int64_t AllocateSafe(const ignite::common::concurrent::SharedPointer<HandleRegistryEntry>& target);
-
-            /**
-             * Allocate handle in critical and safe modes.
-             *
-             * @param target Target.
-             * @return Handle.
-             */
-            int64_t AllocateCriticalSafe(const ignite::common::concurrent::SharedPointer<HandleRegistryEntry>& target);
-
-            /**
-             * Release handle.
-             *
-             * @param hnd Handle.
-             */
-            void Release(int64_t hnd);
-
-            /**
-             * Get target.
-             *
-             * @param hnd Handle.
-             * @param Target.
-             */
-            ignite::common::concurrent::SharedPointer<HandleRegistryEntry> Get(int64_t hnd);
-
-            /**
-             * Close the registry.
-             */
-            void Close();
-        private:
-            /** Fast-path container capacity. */
-            int32_t fastCap;                     
-
-            /** Fast-path counter. */
-            int32_t fastCtr;               
-
-            /** Fast-path container. */
-            ignite::common::concurrent::SharedPointer<HandleRegistryEntry>* fast;
-
-            /** Amount of slow-path segments. */
-            int32_t slowSegmentCnt;            
-
-            /** Slow-path counter. */
-            int64_t slowCtr;                                                         
-            
-            /** Slow-path segments. */
-            HandleRegistrySegment** slow;                                            
-
-            /** Close flag. */
-            int32_t closed;                                                           
-
-            IGNITE_NO_COPY_ASSIGNMENT(HandleRegistry);
-
-            /**
-             * Internal allocation routine.
-             *
-             * @param target Target.
-             * @param Critical mode flag.
-             * @param Safe mode flag.
-             */
-            int64_t Allocate0(const ignite::common::concurrent::SharedPointer<HandleRegistryEntry>& target,
-                bool critical, bool safe);
-        };
-    }
-}
-
-#endif
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/core/include/ignite/impl/ignite_environment.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/ignite/impl/ignite_environment.h b/modules/platform/src/main/cpp/core/include/ignite/impl/ignite_environment.h
deleted file mode 100644
index 2f195b2..0000000
--- a/modules/platform/src/main/cpp/core/include/ignite/impl/ignite_environment.h
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef _IGNITE_ENVIRONMENT
-#define _IGNITE_ENVIRONMENT
-
-#include <ignite/common/concurrent.h>
-#include <ignite/common/java.h>
-
-#include "ignite/impl/interop/interop_memory.h"
-#include "portable/portable_metadata_manager.h"
-
-namespace ignite 
-{    
-    namespace impl 
-    {
-        /**
-         * Defines environment in which Ignite operates.
-         */
-        class IGNITE_IMPORT_EXPORT IgniteEnvironment
-        {                
-        public:
-            /**
-             * Default constructor.
-             */
-            IgniteEnvironment();
-
-            /**
-             * Destructor.
-             */
-            ~IgniteEnvironment();
-
-            /**
-             * Populate callback handlers.
-             *
-             * @param Target (current env wrapped into a shared pointer).
-             * @return JNI handlers.
-             */
-            ignite::common::java::JniHandlers GetJniHandlers(ignite::common::concurrent::SharedPointer<IgniteEnvironment>* target);
-                
-            /**
-             * Perform initialization on successful start.
-             *
-             * @param ctx Context.
-             */
-            void Initialize(ignite::common::concurrent::SharedPointer<ignite::common::java::JniContext> ctx);
-
-            /**
-             * Start callback.
-             *
-             * @param memPtr Memory pointer.
-             */
-            void OnStartCallback(long long memPtr);        
-            
-            /**
-             * Get name of Ignite instance.
-             *
-             * @return Name.
-             */
-            char* InstanceName();
-
-            /**
-             * Get JNI context.
-             *
-             * @return Context.
-             */
-            ignite::common::java::JniContext* Context();
-
-            /**
-             * Get memory for interop operations.
-             *
-             * @return Memory.
-             */
-            ignite::common::concurrent::SharedPointer<interop::InteropMemory> AllocateMemory();
-
-            /**
-             * Get memory chunk for interop operations with desired capacity.
-             *
-             * @param cap Capacity.
-             * @return Memory.
-             */
-            ignite::common::concurrent::SharedPointer<interop::InteropMemory> AllocateMemory(int32_t cap);
-
-            /**
-             * Get memory chunk located at the given pointer.
-             *
-             * @param memPtr Memory pointer.
-             * @retrun Memory.
-             */
-            ignite::common::concurrent::SharedPointer<interop::InteropMemory> GetMemory(int64_t memPtr);
-
-            /**
-             * Get metadata manager.
-             *
-             * @param Metadata manager.
-             */
-            portable::PortableMetadataManager* GetMetadataManager();
-        private:
-            /** Context to access Java. */
-            ignite::common::concurrent::SharedPointer<ignite::common::java::JniContext> ctx;
-
-            /** Startup latch. */
-            ignite::common::concurrent::SingleLatch* latch;
-
-            /** Ignite name. */
-            char* name;
-
-            /** Metadata manager. */
-            portable::PortableMetadataManager* metaMgr;       
-
-            IGNITE_NO_COPY_ASSIGNMENT(IgniteEnvironment);
-        };
-    }    
-}
-
-#endif
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/core/include/ignite/impl/ignite_impl.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/ignite/impl/ignite_impl.h b/modules/platform/src/main/cpp/core/include/ignite/impl/ignite_impl.h
deleted file mode 100644
index 52472c6..0000000
--- a/modules/platform/src/main/cpp/core/include/ignite/impl/ignite_impl.h
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef _IGNITE_IMPL
-#define _IGNITE_IMPL
-
-#include <ignite/common/concurrent.h>
-#include <ignite/common/java.h>
-
-#include "ignite/impl/cache/cache_impl.h"
-#include "ignite/impl/ignite_environment.h"
-#include "ignite/impl/utils.h"
-
-namespace ignite 
-{    
-    namespace impl 
-    {            
-        /**
-         * Ignite implementation.
-         */
-        class IgniteImpl
-        {
-            friend class Ignite;
-        public:
-            /**
-             * Constructor used to create new instance.
-             *
-             * @param env Environment.
-             * @param javaRef Reference to java object.
-             */
-            IgniteImpl(ignite::common::concurrent::SharedPointer<IgniteEnvironment> env, jobject javaRef);
-            
-            /**
-             * Destructor.
-             */
-            ~IgniteImpl();
-
-            /**
-             * Get name of the Ignite.
-             *
-             * @param Name.
-             */
-            char* GetName();
-
-            /**
-             * Get cache.
-             *
-             * @param name Cache name.
-             * @param err Error.
-             */
-            template<typename K, typename V> 
-            cache::CacheImpl* GetCache(const char* name, IgniteError* err)
-            {
-                ignite::common::java::JniErrorInfo jniErr;
-
-                jobject cacheJavaRef = env.Get()->Context()->ProcessorCache(javaRef, name, &jniErr);
-
-                if (!cacheJavaRef)
-                {
-                    IgniteError::SetError(jniErr.code, jniErr.errCls, jniErr.errMsg, err);
-
-                    return NULL;
-                }
-
-                char* name0 = utils::CopyChars(name);
-
-                return new cache::CacheImpl(name0, env, cacheJavaRef);
-            }
-
-            /**
-             * Get or create cache.
-             *
-             * @param name Cache name.
-             * @param err Error.
-             */
-            template<typename K, typename V>
-            cache::CacheImpl* GetOrCreateCache(const char* name, IgniteError* err)
-            {
-                ignite::common::java::JniErrorInfo jniErr;
-
-                jobject cacheJavaRef = env.Get()->Context()->ProcessorGetOrCreateCache(javaRef, name, &jniErr);
-
-                if (!cacheJavaRef)
-                {
-                    IgniteError::SetError(jniErr.code, jniErr.errCls, jniErr.errMsg, err);
-
-                    return NULL;
-                }
-
-                char* name0 = utils::CopyChars(name);
-
-                return new cache::CacheImpl(name0, env, cacheJavaRef);
-            }
-
-            /**
-             * Create cache.
-             *
-             * @param name Cache name.
-             * @param err Error.
-             */
-            template<typename K, typename V>
-            cache::CacheImpl* CreateCache(const char* name, IgniteError* err)
-            {
-                ignite::common::java::JniErrorInfo jniErr;
-
-                jobject cacheJavaRef = env.Get()->Context()->ProcessorCreateCache(javaRef, name, &jniErr);
-
-                if (!cacheJavaRef)
-                {
-                    IgniteError::SetError(jniErr.code, jniErr.errCls, jniErr.errMsg, err);
-
-                    return NULL;
-                }
-
-                char* name0 = utils::CopyChars(name);
-
-                return new cache::CacheImpl(name0, env, cacheJavaRef);
-            }
-        private:
-            /** Environment. */
-            ignite::common::concurrent::SharedPointer<IgniteEnvironment> env;
-            
-            /** Native Java counterpart. */
-            jobject javaRef;   
-            
-            IGNITE_NO_COPY_ASSIGNMENT(IgniteImpl)
-        };
-    }
-    
-}
-
-#endif
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/core/include/ignite/impl/interop/interop.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/ignite/impl/interop/interop.h b/modules/platform/src/main/cpp/core/include/ignite/impl/interop/interop.h
deleted file mode 100644
index da4fdb9..0000000
--- a/modules/platform/src/main/cpp/core/include/ignite/impl/interop/interop.h
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef _IGNITE_IMPL_INTEROP
-#define _IGNITE_IMPL_INTEROP
-
-#include "ignite/impl/interop/interop_memory.h"
-#include "ignite/impl/interop/interop_output_stream.h"
-#include "ignite/impl/interop/interop_input_stream.h"
-
-#endif
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/core/include/ignite/impl/interop/interop_input_stream.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/ignite/impl/interop/interop_input_stream.h b/modules/platform/src/main/cpp/core/include/ignite/impl/interop/interop_input_stream.h
deleted file mode 100644
index d8fcfc3..0000000
--- a/modules/platform/src/main/cpp/core/include/ignite/impl/interop/interop_input_stream.h
+++ /dev/null
@@ -1,234 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef _IGNITE_IMPL_INTEROP_INPUT_STREAM
-#define _IGNITE_IMPL_INTEROP_INPUT_STREAM
-
-#include "ignite/impl/interop/interop_memory.h"
-
-namespace ignite
-{    
-    namespace impl
-    {
-        namespace interop
-        {
-            /**
-             * Interop input stream implementation.
-             */
-            class IGNITE_IMPORT_EXPORT InteropInputStream {
-            public:
-                /**
-                 * Constructor.
-                 *
-                 * @param mem Memory.
-                 */
-                InteropInputStream(InteropMemory* mem);
-
-                /**
-                 * Read signed 8-byte int.
-                 *
-                 * @return Value.
-                 */
-                int8_t ReadInt8();
-                    
-                /**
-                 * Read signed 8-byte int array.
-                 *
-                 * @param res Allocated array.
-                 * @param len Length.                 
-                 */
-                void ReadInt8Array(int8_t* const res, const int32_t len);
-
-                /**
-                 * Read bool.
-                 *
-                 * @return Value.
-                 */
-                bool ReadBool();
-
-                /**
-                 * Read bool array.
-                 *
-                 * @param res Allocated array.
-                 * @param len Length.
-                 */
-                void ReadBoolArray(bool* const res, const int32_t len);
-
-                /**
-                 * Read signed 16-byte int.
-                 *
-                 * @return Value.
-                 */
-                int16_t ReadInt16();
-
-                /**
-                 * Read signed 16-byte int array.
-                 *
-                 * @param res Allocated array.
-                 * @param len Length.
-                 */
-                void ReadInt16Array(int16_t* const res, const int32_t len);
-
-                /**
-                 * Read unsigned 16-byte int.
-                 *
-                 * @return Value.
-                 */
-                uint16_t ReadUInt16();
-
-                /**
-                 * Read unsigned 16-byte int array.
-                 *
-                 * @param res Allocated array.
-                 * @param len Length.
-                 */
-                void ReadUInt16Array(uint16_t* const res, const int32_t len);
-
-                /**
-                 * Read signed 32-byte int.
-                 *
-                 * @return Value.
-                 */
-                int32_t ReadInt32();
-
-                /**
-                 * Read signed 32-byte int at the given position.
-                 *
-                 * @param pos Position.
-                 * @return Value.
-                 */
-                int32_t ReadInt32(int32_t pos);
-                    
-                /**
-                 * Read signed 32-byte int array.
-                 *
-                 * @param res Allocated array.
-                 * @param len Length.
-                 */
-                void ReadInt32Array(int32_t* const res, const int32_t len);
-
-                /**
-                 * Read signed 64-byte int.
-                 *
-                 * @return Value.
-                 */
-                int64_t ReadInt64();
-
-                /**
-                 * Read signed 64-byte int array.
-                 *
-                 * @param res Allocated array.
-                 * @param len Length.
-                 */
-                void ReadInt64Array(int64_t* const res, const int32_t len);
-
-                /**
-                 * Read float.
-                 *
-                 * @return Value.
-                 */
-                float ReadFloat();
-
-                /**
-                 * Read float array.
-                 *
-                 * @param res Allocated array.
-                 * @param len Length.
-                 */
-                void ReadFloatArray(float* const res, const int32_t len);
-
-                /**
-                 * Read double.
-                 *
-                 * @return Value.
-                 */
-                double ReadDouble();
-
-                /**
-                 * Read double array.
-                 *
-                 * @param res Allocated array.
-                 * @param len Length.
-                 */
-                void ReadDoubleArray(double* const res, const int32_t len);
-
-                /**
-                 * Get remaining bytes.
-                 *
-                 * @return Remaining bytes.
-                 */
-                int32_t Remaining();
-
-                /**
-                 * Get position.
-                 *
-                 * @return Position.
-                 */
-                int32_t Position();
-
-                /**
-                 * Set position.
-                 *
-                 * @param Position.
-                 */
-                void Position(int32_t pos);
-
-                /**
-                 * Synchronize data from underlying memory.
-                 */
-                void Synchronize();
-            private:
-                /** Memory. */
-                InteropMemory* mem; 
-                
-                /** Pointer to data. */
-                int8_t* data;       
-                
-                /** Length. */
-                int len;            
-                
-                /** Current position. */
-                int pos;            
-                    
-                /**
-                 * Ensure there is enough data in the stream.
-                 *
-                 * @param cnt Amount of byte expected to be available.
-                 */
-                void EnsureEnoughData(int32_t cnt);
-
-                /**
-                 * Copy data from the stream shifting it along the way.
-                 *
-                 * @param ptr Pointer to data.
-                 * @param off Offset.
-                 * @param cnt Amount of data to copy.
-                 */
-                void CopyAndShift(int8_t* dest, int32_t off, int32_t cnt);
-
-                /**
-                 * Shift stream to the right.
-                 *
-                 * @param cnt Amount of bytes to shift the stream to.
-                 */
-                void Shift(int32_t cnt);
-            };
-        }
-    }    
-}
-
-#endif
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/core/include/ignite/impl/interop/interop_memory.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/ignite/impl/interop/interop_memory.h b/modules/platform/src/main/cpp/core/include/ignite/impl/interop/interop_memory.h
deleted file mode 100644
index 00cba43..0000000
--- a/modules/platform/src/main/cpp/core/include/ignite/impl/interop/interop_memory.h
+++ /dev/null
@@ -1,280 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef _IGNITE_IMPL_INTEROP_MEMORY
-#define _IGNITE_IMPL_INTEROP_MEMORY
-
-#include <stdint.h>
-
-#include <ignite/common/common.h>
-
-namespace ignite 
-{
-    namespace impl 
-    {
-        namespace interop 
-        {
-            /** Memory header length. */
-            const int IGNITE_MEM_HDR_LEN = 20;
-
-            /** Memory header offset: capacity. */
-            const int IGNITE_MEM_HDR_OFF_CAP = 8;
-
-            /** Memory header offset: length. */
-            const int IGNITE_MEM_HDR_OFF_LEN = 12;
-
-            /** Memory header offset: flags. */
-            const int IGNITE_MEM_HDR_OFF_FLAGS = 16;
-
-            /** Flag: external. */
-            const int IGNITE_MEM_FLAG_EXT = 0x1;
-
-            /** Flag: pooled. */
-            const int IGNITE_MEM_FLAG_POOLED = 0x2;
-
-            /** Flag: acquired. */
-            const int IGNITE_MEM_FLAG_ACQUIRED = 0x4;
-                
-            /**
-             * Interop memory.
-             */
-            class IGNITE_IMPORT_EXPORT InteropMemory
-            {
-            public:
-                /**
-                 * Get raw data pointer.
-                 *
-                 * @param memPtr Memory pointer.
-                 * @return Raw data pointer.
-                 */
-                static int8_t* Data(int8_t* memPtr);
-
-                /**
-                 * Set raw data pointer.
-                 *
-                 * @param memPtr Memory pointer.
-                 * @param ptr Raw data pointer.
-                 */
-                static void Data(int8_t* memPtr, void* ptr);
-
-                /**
-                 * Get capacity.
-                 *
-                 * @param memPtr Memory pointer.
-                 * @return Capacity.
-                 */
-                static int32_t Capacity(int8_t* memPtr);
-
-                /**
-                 * Set capacity.
-                 *
-                 * @param memPtr Memory pointer.
-                 * @param val Value.
-                 */
-                static void Capacity(int8_t* memPtr, int32_t val);
-
-                /**
-                 * Get length.
-                 *
-                 * @param memPtr Memory pointer.
-                 * @return Length.
-                 */
-                static int32_t Length(int8_t* memPtr);
-
-                /**
-                 * Set length.
-                 *
-                 * @param memPtr Memory pointer.
-                 * @param val Value.
-                 */
-                static void Length(int8_t* memPtr, int32_t val);
-
-                /**
-                 * Get flags.
-                 *
-                 * @param memPtr Memory pointer.
-                 * @return Flags.
-                 */
-                static int32_t Flags(int8_t* memPtr);
-
-                /**
-                 * Set flags.
-                 *
-                 * @param memPtr Memory pointer.
-                 * @param val Value.
-                 */
-                static void Flags(int8_t* memPtr, int32_t val);
-
-                /**
-                 * Get "external" flag state.
-                 *
-                 * @param memPtr Memory pointer.
-                 * @return Flag state.
-                 */
-                static bool IsExternal(int8_t* memPtr);
-
-                /**
-                 * Get "external" flag state.
-                 *
-                 * @param flags Flags.
-                 * @return Flag state.
-                 */
-                static bool IsExternal(int32_t flags);
-
-                /**
-                 * Get "pooled" flag state.
-                 *
-                 * @param memPtr Memory pointer.
-                 * @return Flag state.
-                 */
-                static bool IsPooled(int8_t* memPtr);
-
-                /**
-                 * Get "pooled" flag state.
-                 *
-                 * @param flags Flags.
-                 * @return Flag state.
-                 */
-                static bool IsPooled(int32_t flags);
-
-                /**
-                 * Get "acquired" flag state.
-                 *
-                 * @param memPtr Memory pointer.
-                 * @return Flag state.
-                 */
-                static bool IsAcquired(int8_t* memPtr);
-
-                /**
-                 * Get "acquired" flag state.
-                 *
-                 * @param flags Flags.
-                 * @return Flag state.
-                 */
-                static bool IsAcquired(int32_t flags);
-
-                /**
-                 * Destructor.
-                 */
-                virtual ~InteropMemory() { }
-                    
-                /**
-                 * Get cross-platform memory pointer.
-                 *
-                 * @return Memory pointer.
-                 */
-                int8_t* Pointer();
-
-                /**
-                 * Get cross-platform pointer in long form.
-                 */
-                int64_t PointerLong();
-
-                /**
-                 * Get raw data pointer.
-                 *
-                 * @return Data pointer.
-                 */
-                int8_t* Data();
-
-                /**
-                 * Get capacity.
-                 *
-                 * @return Capacity.
-                 */
-                int32_t Capacity();
-
-                /**
-                 * Get length.
-                 *
-                 * @return Length.
-                 */
-                int32_t Length();
-
-                /**
-                 * Set length.
-                 *
-                 * @param val Length.
-                 */
-                void Length(int32_t val);
-
-                /**
-                 * Reallocate memory.
-                 *
-                 * @param cap Desired capactiy.
-                 */
-                virtual void Reallocate(int32_t cap) = 0;
-            protected:
-                /** Memory pointer. */
-                int8_t* memPtr; 
-            };
-
-            /**
-             * Interop unpooled memory.
-             */
-            class IGNITE_IMPORT_EXPORT InteropUnpooledMemory : public InteropMemory
-            {
-            public:
-                /**
-                 * Constructor create new unpooled memory object from scratch.
-                 *
-                 * @param cap Capacity.
-                 */
-                explicit InteropUnpooledMemory(int32_t cap);
-
-                /**
-                 * Constructor creating unpooled memory object from existing memory pointer.
-                 *
-                 * @param memPtr Memory pointer.
-                 */
-                explicit InteropUnpooledMemory(int8_t* memPtr);
-
-                /**
-                 * Destructor.
-                 */
-                ~InteropUnpooledMemory();
-
-                virtual void Reallocate(int32_t cap);
-            private:
-                /** Whether this instance is owner of memory chunk. */
-                bool owning; 
-
-                IGNITE_NO_COPY_ASSIGNMENT(InteropUnpooledMemory)
-            };
-
-            /**
-             * Interop external memory.
-             */
-            class IGNITE_IMPORT_EXPORT InteropExternalMemory : public InteropMemory
-            {
-            public:
-                /**
-                 * Constructor.
-                 *
-                 * @param memPtr External memory pointer.
-                 */
-                explicit InteropExternalMemory(int8_t* memPtr);
-
-                virtual void Reallocate(int32_t cap);
-            private:
-                IGNITE_NO_COPY_ASSIGNMENT(InteropExternalMemory)
-            };
-        }
-    }
-}
-
-#endif
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/core/include/ignite/impl/interop/interop_output_stream.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/ignite/impl/interop/interop_output_stream.h b/modules/platform/src/main/cpp/core/include/ignite/impl/interop/interop_output_stream.h
deleted file mode 100644
index 5a08aed..0000000
--- a/modules/platform/src/main/cpp/core/include/ignite/impl/interop/interop_output_stream.h
+++ /dev/null
@@ -1,234 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef _IGNITE_IMPL_INTEROP_OUTPUT_STREAM
-#define _IGNITE_IMPL_INTEROP_OUTPUT_STREAM
-
-#include "ignite/impl/interop/interop_memory.h"
-
-namespace ignite
-{    
-    namespace impl
-    {
-        namespace interop
-        {
-            /**
-             * Interop output stream.
-             */
-            class IGNITE_IMPORT_EXPORT InteropOutputStream {
-            public:
-                /**
-                 * Create new output stream with the given capacity.
-                 *
-                 * @param mem Memory.
-                 */
-                InteropOutputStream(InteropMemory* mem);
-
-                /**
-                 * Write signed 8-byte integer.
-                 *
-                 * @param val Value.
-                 */
-                void WriteInt8(const int8_t val);
-
-                /**
-                 * Write signed 8-byte integer at the given position.
-                 *
-                 * @param val Value.
-                 */
-                void WriteInt8(const int8_t val, const int32_t pos);
-
-                /**
-                 * Write signed 8-byte integer array.
-                 *
-                 * @param val Value.
-                 * @param len Length.
-                 */
-                void WriteInt8Array(const int8_t* val, const int32_t len);
-
-                /**
-                 * Write bool.
-                 *
-                 * @param val Value.
-                 */
-                void WriteBool(const bool val);
-
-                /**
-                 * Write bool array.
-                 *
-                 * @param val Value.
-                 * @param len Length.
-                 */
-                void WriteBoolArray(const bool* val, const int32_t len);
-
-                /**
-                 * Write signed 16-byte integer.
-                 *
-                 * @param val Value.
-                 */
-                void WriteInt16(const int16_t val);
-
-                /**
-                 * Write signed 16-byte integer array.
-                 *
-                 * @param val Value.
-                 * @param len Length.
-                 */
-                void WriteInt16Array(const int16_t* val, const int32_t len);
-
-                /**
-                 * Write unsigned 16-byte integer.
-                 *
-                 * @param val Value.
-                 */
-                void WriteUInt16(const uint16_t val);
-
-                /**
-                 * Write unsigned 16-byte integer array.
-                 *
-                 * @param val Value.
-                 * @param len Length.
-                 */
-                void WriteUInt16Array(const uint16_t* val, const int32_t len);
-
-                /**
-                 * Write signed 32-byte integer.
-                 *
-                 * @param val Value.
-                 */
-                void WriteInt32(const int32_t val);
-
-                /**
-                 * Write signed 32-byte integer at the given position.
-                 *
-                 * @param pos Position.
-                 * @param val Value.
-                 */
-                void WriteInt32(const int32_t pos, const int32_t val);
-
-                /**
-                 * Write signed 32-byte integer array.
-                 *
-                 * @param val Value.
-                 * @param len Length.
-                 */
-                void WriteInt32Array(const int32_t* val, const int32_t len);
-
-                /**
-                 * Write signed 64-byte integer.
-                 *
-                 * @param val Value.
-                 */
-                void WriteInt64(const int64_t val);
-
-                /**
-                 * Write signed 64-byte integer array.
-                 *
-                 * @param val Value.
-                 * @param len Length.
-                 */
-                void WriteInt64Array(const int64_t* val, const int32_t len);
-
-                /**
-                 * Write float.
-                 *
-                 * @param val Value.
-                 */
-                void WriteFloat(const float val);
-
-                /**
-                 * Write float array.
-                 *
-                 * @param val Value.
-                 * @param len Length.
-                 */
-                void WriteFloatArray(const float* val, const int32_t len);
-
-                /**
-                 * Write double.
-                 *
-                 * @param val Value.
-                 */
-                void WriteDouble(const double val);
-
-                /**
-                 * Write double array.
-                 *
-                 * @param val Value.
-                 * @param len Length.
-                 */
-                void WriteDoubleArray(const double* val, const int32_t len);
-
-                /**
-                 * Get current stream position.
-                 */
-                int32_t Position();
-
-                /**
-                 * Set current stream position (absolute).
-                 *
-                 * @param val Position (absolute).
-                 */
-                void Position(const int32_t val);
-
-                /**
-                 * Synchronize data with underlying memory.
-                 */
-                void Synchronize();
-            private:
-                /** Memory. */
-                InteropMemory* mem; 
-
-                /** Pointer to data. */
-                int8_t* data;       
-
-                /** Capacity. */
-                int cap;            
-
-                /** Current position. */
-                int pos;            
-
-                IGNITE_NO_COPY_ASSIGNMENT(InteropOutputStream)
-
-                /**
-                 * Ensure that stream enough capacity optionally extending it.
-                 *
-                 * @param reqCap Requsted capacity.
-                 */
-                void EnsureCapacity(int32_t reqCap);
-
-                /**
-                 * Shift stream to the right.
-                 *
-                 * @param cnt Amount of bytes to shift the stream to.
-                 */
-                void Shift(int32_t cnt);
-
-                /**
-                 * Copy data to the stream shifting it along the way.
-                 *
-                 * @param ptr Pointer to data.
-                 * @param off Offset.
-                 * @param len Length.
-                 */
-                void CopyAndShift(const int8_t* src, int32_t off, int32_t len);
-            };
-        }
-    }
-}
-
-#endif
\ No newline at end of file


[18/28] ignite git commit: IGNITE-1513: Moved CPP.

Posted by vo...@apache.org.
http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/core/include/ignite/portable/portable_reader.h
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/core/include/ignite/portable/portable_reader.h b/modules/platform/cpp/core/include/ignite/portable/portable_reader.h
new file mode 100644
index 0000000..5e4b7ad
--- /dev/null
+++ b/modules/platform/cpp/core/include/ignite/portable/portable_reader.h
@@ -0,0 +1,355 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _IGNITE_PORTABLE_READER
+#define _IGNITE_PORTABLE_READER
+
+#include <stdint.h>
+#include <string>
+
+#include <ignite/common/common.h>
+
+#include "ignite/portable/portable_raw_reader.h"
+#include "ignite/guid.h"
+
+namespace ignite
+{    
+    namespace portable
+    {
+        /**
+         * Portable reader.
+         */
+        class IGNITE_IMPORT_EXPORT PortableReader
+        {
+        public:
+            /**
+             * Constructor.
+             *
+             * @param impl Implementation.
+             */
+            PortableReader(ignite::impl::portable::PortableReaderImpl* impl);
+
+            /**
+             * Read 8-byte signed integer. Maps to "byte" type in Java.
+             *
+             * @param fieldName Field name.
+             * @param fieldName Field name.
+             * @return Result.
+             */
+            int8_t ReadInt8(const char* fieldName);
+
+            /**
+             * Read array of 8-byte signed integers. Maps to "byte[]" type in Java.
+             *
+             * @param fieldName Field name.
+             * @param res Array to store data to.
+             * @param len Expected length of array.
+             * @return Actual amount of elements read. If "len" argument is less than actual
+             *     array size or resulting array is set to null, nothing will be written
+             *     to resulting array and returned value will contain required array length.
+             *     -1 will be returned in case array in stream was null.
+             */
+            int32_t ReadInt8Array(const char* fieldName, int8_t* res, const int32_t len);
+
+            /**
+             * Read bool. Maps to "short" type in Java.
+             *
+             * @param fieldName Field name.
+             * @return Result.
+             */
+            bool ReadBool(const char* fieldName);
+
+            /**
+             * Read array of bools. Maps to "bool[]" type in Java.
+             *
+             * @param fieldName Field name.
+             * @param res Array to store data to.
+             * @param len Expected length of array.             
+             * @return Actual amount of elements read. If "len" argument is less than actual
+             *     array size or resulting array is set to null, nothing will be written
+             *     to resulting array and returned value will contain required array length.
+             *     -1 will be returned in case array in stream was null.
+             */
+            int32_t ReadBoolArray(const char* fieldName, bool* res, const int32_t len);
+
+            /**
+             * Read 16-byte signed integer. Maps to "short" type in Java.
+             *
+             * @param fieldName Field name.
+             * @return Result.
+             */
+            int16_t ReadInt16(const char* fieldName);
+
+            /**
+             * Read array of 16-byte signed integers. Maps to "short[]" type in Java.
+             *
+             * @param fieldName Field name.
+             * @param res Array to store data to.
+             * @param len Expected length of array.
+             * @return Actual amount of elements read. If "len" argument is less than actual
+             *     array size or resulting array is set to null, nothing will be written
+             *     to resulting array and returned value will contain required array length.
+             *     -1 will be returned in case array in stream was null.
+             */
+            int32_t ReadInt16Array(const char* fieldName, int16_t* res, const int32_t len);
+
+            /**
+             * Read 16-byte unsigned integer. Maps to "char" type in Java.
+             *
+             * @param fieldName Field name.
+             * @return Result.
+             */
+            uint16_t ReadUInt16(const char* fieldName);
+
+            /**
+             * Read array of 16-byte unsigned integers. Maps to "char[]" type in Java.
+             *
+             * @param fieldName Field name.
+             * @param res Array to store data to.
+             * @param len Expected length of array.             
+             * @return Actual amount of elements read. If "len" argument is less than actual
+             *     array size or resulting array is set to null, nothing will be written
+             *     to resulting array and returned value will contain required array length.
+             *     -1 will be returned in case array in stream was null.
+             */
+            int32_t ReadUInt16Array(const char* fieldName, uint16_t* res, const int32_t len);
+
+            /**
+             * Read 32-byte signed integer. Maps to "int" type in Java.
+             *
+             * @param fieldName Field name.
+             * @return Result.
+             */
+            int32_t ReadInt32(const char* fieldName);
+
+            /**
+             * Read array of 32-byte signed integers. Maps to "int[]" type in Java.
+             *
+             * @param fieldName Field name.
+             * @param res Array to store data to.
+             * @param len Expected length of array.             
+             * @return Actual amount of elements read. If "len" argument is less than actual
+             *     array size or resulting array is set to null, nothing will be written
+             *     to resulting array and returned value will contain required array length.
+             *     -1 will be returned in case array in stream was null.
+             */
+            int32_t ReadInt32Array(const char* fieldName, int32_t* res, const int32_t len);
+
+            /**
+             * Read 64-byte signed integer. Maps to "long" type in Java.
+             *
+             * @param fieldName Field name.
+             * @return Result.
+             */
+            int64_t ReadInt64(const char* fieldName);
+
+            /**
+             * Read array of 64-byte signed integers. Maps to "long[]" type in Java.
+             *
+             * @param fieldName Field name.
+             * @param res Array to store data to.
+             * @param len Expected length of array.             
+             * @return Actual amount of elements read. If "len" argument is less than actual
+             *     array size or resulting array is set to null, nothing will be written
+             *     to resulting array and returned value will contain required array length.
+             *     -1 will be returned in case array in stream was null.
+             */
+            int32_t ReadInt64Array(const char* fieldName, int64_t* res, const int32_t len);
+
+            /**
+             * Read float. Maps to "float" type in Java.
+             *
+             * @param fieldName Field name.
+             * @return Result.
+             */
+            float ReadFloat(const char* fieldName);
+
+            /**
+             * Read array of floats. Maps to "float[]" type in Java.
+             * 
+             * @param fieldName Field name.
+             * @param res Array to store data to.
+             * @param len Expected length of array.             
+             * @return Actual amount of elements read. If "len" argument is less than actual
+             *     array size or resulting array is set to null, nothing will be written
+             *     to resulting array and returned value will contain required array length.
+             *     -1 will be returned in case array in stream was null.
+             */
+            int32_t ReadFloatArray(const char* fieldName, float* res, const int32_t len);
+
+            /**
+             * Read double. Maps to "double" type in Java.
+             *
+             * @param fieldName Field name.
+             * @return Result.
+             */
+            double ReadDouble(const char* fieldName);
+
+            /**
+             * Read array of doubles. Maps to "double[]" type in Java.
+             *
+             * @param fieldName Field name.
+             * @param res Array to store data to.
+             * @param len Expected length of array.             
+             * @return Actual amount of elements read. If "len" argument is less than actual
+             *     array size or resulting array is set to null, nothing will be written
+             *     to resulting array and returned value will contain required array length.
+             *     -1 will be returned in case array in stream was null.
+             */
+            int32_t ReadDoubleArray(const char* fieldName, double* res, const int32_t len);
+
+            /**
+             * Read Guid. Maps to "UUID" type in Java.
+             *
+             * @param fieldName Field name.
+             * @return Result.
+             */
+            Guid ReadGuid(const char* fieldName);
+
+            /**
+             * Read array of Guids. Maps to "UUID[]" type in Java.
+             *
+             * @param fieldName Field name.
+             * @param res Array to store data to.
+             * @param len Expected length of array.             
+             * @return Actual amount of elements read. If "len" argument is less than actual
+             *     array size or resulting array is set to null, nothing will be written
+             *     to resulting array and returned value will contain required array length.
+             *     -1 will be returned in case array in stream was null.
+             */
+            int32_t ReadGuidArray(const char* fieldName, Guid* res, const int32_t len);
+
+            /**
+             * Read string.
+             *
+             * @param fieldName Field name.
+             * @param res Array to store data to.
+             * @param len Expected length of string. NULL terminator will be set in case len is
+             *     greater than real string length.             
+             * @return Actual amount of elements read. If "len" argument is less than actual
+             *     array size or resulting array is set to null, nothing will be written
+             *     to resulting array and returned value will contain required array length.
+             *     -1 will be returned in case array in stream was null.
+             */
+            int32_t ReadString(const char* fieldName, char* res, const int32_t len);
+
+            /**
+             * Read string from the stream.
+             *
+             * @param fieldName Field name.
+             * @return String.
+             */
+            std::string ReadString(const char* fieldName)
+            {
+                int32_t len = ReadString(fieldName, NULL, 0);
+
+                if (len != -1)
+                {
+                    ignite::impl::utils::SafeArray<char> arr(len + 1);
+
+                    ReadString(fieldName, arr.target, len + 1);
+
+                    return std::string(arr.target);
+                }
+                else
+                    return std::string();
+            }
+
+            /**
+             * Start string array read.
+             *
+             * @param fieldName Field name.
+             * @return String array reader.
+             */
+            PortableStringArrayReader ReadStringArray(const char* fieldName);
+
+            /**
+             * Start array read.
+             *
+             * @param fieldName Field name.
+             * @return Array reader.
+             */
+            template<typename T>
+            PortableArrayReader<T> ReadArray(const char* fieldName)
+            {
+                int32_t size;
+
+                int32_t id = impl->ReadArray(fieldName, &size);
+
+                return PortableArrayReader<T>(impl, id, size);
+            }
+
+            /**
+             * Start collection read.
+             *
+             * @param fieldName Field name.
+             * @return Collection reader.
+             */
+            template<typename T>
+            PortableCollectionReader<T> ReadCollection(const char* fieldName)
+            {
+                CollectionType typ;
+                int32_t size;
+
+                int32_t id = impl->ReadCollection(fieldName, &typ, &size);
+
+                return PortableCollectionReader<T>(impl, id, typ, size);
+            }
+
+            /**
+             * Start map read.
+             *
+             * @param fieldName Field name.
+             * @return Map reader.
+             */
+            template<typename K, typename V>
+            PortableMapReader<K, V> ReadMap(const char* fieldName)
+            {
+                MapType typ;
+                int32_t size;
+
+                int32_t id = impl->ReadMap(fieldName, &typ, &size);
+
+                return PortableMapReader<K, V>(impl, id, typ, size);
+            }
+
+            /**
+             * Read object.
+             *
+             * @param fieldName Field name.
+             * @return Object.
+             */
+            template<typename T>
+            T ReadObject(const char* fieldName)
+            {
+                return impl->ReadObject<T>(fieldName);
+            }
+
+            /**
+             * Get raw reader for this reader.
+             *
+             * @return Raw reader.
+             */
+            PortableRawReader RawReader();
+        private:
+            /** Implementation delegate. */
+            ignite::impl::portable::PortableReaderImpl* impl;
+        };            
+    }
+}
+
+#endif
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/core/include/ignite/portable/portable_type.h
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/core/include/ignite/portable/portable_type.h b/modules/platform/cpp/core/include/ignite/portable/portable_type.h
new file mode 100644
index 0000000..fb086ef
--- /dev/null
+++ b/modules/platform/cpp/core/include/ignite/portable/portable_type.h
@@ -0,0 +1,293 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _IGNITE_PORTABLE_TYPE
+#define _IGNITE_PORTABLE_TYPE
+
+#include <stdint.h>
+
+#include <ignite/common/common.h>
+
+#include "ignite/ignite_error.h"
+
+/**
+ * Start portable type definition.
+ */
+#define IGNITE_PORTABLE_TYPE_START(T) \
+template<> \
+struct PortableType<T> \
+{
+
+/**
+ * End portable type definition.
+ */
+#define IGNITE_PORTABLE_TYPE_END \
+};
+
+/**
+ * Implementation of GetTypeId() which returns predefined constant.
+ */
+#define IGNITE_PORTABLE_GET_TYPE_ID_AS_CONST(id) \
+int32_t GetTypeId() \
+{ \
+    return id; \
+}
+
+/**
+ * Implementation of GetTypeId() which returns hash of passed type name.
+ */
+#define IGNITE_PORTABLE_GET_TYPE_ID_AS_HASH(typeName) \
+int32_t GetTypeId() \
+{ \
+    return GetPortableStringHashCode(#typeName); \
+}
+
+/**
+ * Implementation of GetTypeName() which returns type name as is.
+ */
+#define IGNITE_PORTABLE_GET_TYPE_NAME_AS_IS(typeName) \
+std::string GetTypeName() \
+{ \
+    return #typeName; \
+}
+
+/**
+ * Default implementation of GetFieldId() function which returns Java-way hash code of the string.
+ */
+#define IGNITE_PORTABLE_GET_FIELD_ID_AS_HASH \
+int32_t GetFieldId(const char* name) \
+{ \
+    return GetPortableStringHashCode(name); \
+}
+
+/**
+ * Implementation of GetHashCode() function which always returns 0.
+ */
+#define IGNITE_PORTABLE_GET_HASH_CODE_ZERO(T) \
+int32_t GetHashCode(const T& obj) \
+{ \
+    return 0; \
+}
+
+/**
+ * Implementation of IsNull() function which always returns false.
+ */
+#define IGNITE_PORTABLE_IS_NULL_FALSE(T) \
+bool IsNull(const T& obj) \
+{ \
+    return false; \
+}
+
+/**
+ * Implementation of IsNull() function which return true if passed object is null pointer.
+ */
+#define IGNITE_PORTABLE_IS_NULL_IF_NULLPTR(T) \
+bool IsNull(const T& obj) \
+{ \
+    return obj; \
+}
+
+/**
+ * Implementation of GetNull() function which returns an instance created with defult constructor.
+ */
+#define IGNITE_PORTABLE_GET_NULL_DEFAULT_CTOR(T) \
+T GetNull() \
+{ \
+    return T(); \
+}
+
+/**
+ * Implementation of GetNull() function which returns NULL pointer.
+ */
+#define IGNITE_PORTABLE_GET_NULL_NULLPTR(T) \
+T GetNull() \
+{ \
+    return NULL; \
+}
+
+namespace ignite
+{
+    namespace portable
+    {
+        class PortableWriter;
+        class PortableReader;
+
+        /**
+         * Get portable string hash code.
+         *
+         * @param val Value.
+         * @return Hash code.
+         */
+        IGNITE_IMPORT_EXPORT int32_t GetPortableStringHashCode(const char* val);
+
+        /**
+         * Portable type structure. Defines a set of functions required for type to be serialized and deserialized.
+         */
+        template<typename T>
+        struct IGNITE_IMPORT_EXPORT PortableType
+        {
+            /**
+             * Get portable object type ID.
+             *
+             * @return Type ID.
+             */
+            int32_t GetTypeId()
+            {
+                IGNITE_ERROR_1(IgniteError::IGNITE_ERR_PORTABLE, "GetTypeId function is not defined for portable type.");
+            }
+
+            /**
+             * Get portable object type name.
+             *
+             * @return Type name.
+             */
+            std::string GetTypeName() 
+            {
+                IGNITE_ERROR_1(IgniteError::IGNITE_ERR_PORTABLE, "GetTypeName function is not defined for portable type.");
+            }
+
+            /**
+             * Get portable object field ID.
+             *
+             * @param name Field name.
+             * @return Field ID.
+             */
+            int32_t GetFieldId(const char* name)
+            {
+                return GetPortableStringHashCode(name);
+            }
+
+            /**
+             * Get portable object hash code.
+             *
+             * @param obj Portable object.
+             * @return Hash code.
+             */
+            int32_t GetHashCode(const T& obj)
+            {
+                return 0;
+            }
+
+            /**
+             * Write portable object.
+             *
+             * @param writer Writer.
+             * @param obj Object.
+             */
+            void Write(PortableWriter& writer, const T& obj)
+            {
+                IGNITE_ERROR_1(IgniteError::IGNITE_ERR_PORTABLE, "Write function is not defined for portable type.");
+            }
+
+            /**
+             * Read portable object.
+             *
+             * @param reader Reader.
+             * @return Object.
+             */
+            T Read(PortableReader& reader)
+            {
+                IGNITE_ERROR_1(IgniteError::IGNITE_ERR_PORTABLE, "Read function is not defined for portable type.");
+            }
+
+            /**
+             * Check whether passed portable object should be interpreted as NULL.
+             *
+             * @param obj Portable object to test.
+             * @return True if portable object should be interpreted as NULL.
+             */
+            bool IsNull(const T& obj)
+            {
+                return false;
+            }
+
+            /**
+             * Get NULL value for the given portable type.
+             *
+             * @return NULL value.
+             */
+            T GetNull()
+            {
+                IGNITE_ERROR_1(IgniteError::IGNITE_ERR_PORTABLE, "GetNull function is not defined for portable type.");
+            }
+        };
+
+        /*
+         * Templated portable type for pointers.
+         */
+        template <typename T>
+        struct IGNITE_IMPORT_EXPORT PortableType<T*>
+        {
+            /** Actual type. */
+            PortableType<T> typ;
+
+            /**
+             * Constructor.
+             */
+            PortableType()
+            {
+                typ = PortableType<T>();
+            }
+
+            int32_t GetTypeId()
+            {
+                return typ.GetTypeId();
+            }
+
+            std::string GetTypeName()
+            {
+                return typ.GetTypeName();
+            }
+
+            int32_t GetFieldId(const char* name)
+            {
+                return typ.GetFieldId(name);
+            }
+
+            int32_t GetHashCode(T* const& obj)
+            {
+                return typ.GetHashCode(*obj);
+            }
+
+            void Write(PortableWriter& writer, T* const& obj)
+            {
+                typ.Write(writer, *obj);
+            }
+
+            T* Read(PortableReader& reader)
+            {
+                T* res = new T();
+
+                *res = typ.Read(reader);
+
+                return res;
+            }
+
+            bool IsNull(T* const& obj)
+            {
+                return !obj || typ.IsNull(*obj);
+            }
+
+            T* GetNull()
+            {
+                return NULL;
+            }
+        };
+    }
+}
+
+#endif

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/core/include/ignite/portable/portable_writer.h
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/core/include/ignite/portable/portable_writer.h b/modules/platform/cpp/core/include/ignite/portable/portable_writer.h
new file mode 100644
index 0000000..5dc9494
--- /dev/null
+++ b/modules/platform/cpp/core/include/ignite/portable/portable_writer.h
@@ -0,0 +1,335 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _IGNITE_PORTABLE_WRITER
+#define _IGNITE_PORTABLE_WRITER
+
+#include <string>
+#include <stdint.h>
+
+#include <ignite/common/common.h>
+
+#include "ignite/portable/portable_raw_writer.h"
+
+namespace ignite
+{
+    namespace portable 
+    {
+        /**
+         * Portable writer.
+         */
+        class IGNITE_IMPORT_EXPORT PortableWriter
+        {
+        public:
+            /**
+             * Constructor.
+             *
+             * @param impl Implementation.
+             */
+            PortableWriter(ignite::impl::portable::PortableWriterImpl* impl);
+
+            /**
+             * Write 8-byte signed integer. Maps to "byte" type in Java.
+             *
+             * @param fieldName Field name.
+             * @param val Value.
+             */
+            void WriteInt8(const char* fieldName, const int8_t val);
+
+            /**
+             * Write array of 8-byte signed integers. Maps to "byte[]" type in Java.
+             *
+             * @param fieldName Field name.
+             * @param val Array.
+             * @param len Array length.
+             */
+            void WriteInt8Array(const char* fieldName, const int8_t* val, const int32_t len);
+
+            /**
+             * Write bool. Maps to "short" type in Java.
+             *
+             * @param fieldName Field name.
+             * @param val Value.
+             */
+            void WriteBool(const char* fieldName, const bool val);
+
+            /**
+             * Write array of bools. Maps to "bool[]" type in Java.
+             *
+             * @param fieldName Field name.
+             * @param val Array.
+             * @param len Array length.
+             */
+            void WriteBoolArray(const char* fieldName, const bool* val, const int32_t len);
+
+            /**
+             * Write 16-byte signed integer. Maps to "short" type in Java.
+             *
+             * @param fieldName Field name.
+             * @param val Value.
+             */
+            void WriteInt16(const char* fieldName, const int16_t val);
+
+            /**
+             * Write array of 16-byte signed integers. Maps to "short[]" type in Java.
+             *
+             * @param fieldName Field name.
+             * @param val Array.
+             * @param len Array length.
+             */
+            void WriteInt16Array(const char* fieldName, const int16_t* val, const int32_t len);
+
+            /**
+             * Write 16-byte unsigned integer. Maps to "char" type in Java.
+             *
+             * @param fieldName Field name.
+             * @param val Value.
+             */
+            void WriteUInt16(const char* fieldName, const uint16_t val);
+
+            /**
+             * Write array of 16-byte unsigned integers. Maps to "char[]" type in Java.
+             *
+             * @param fieldName Field name.
+             * @param val Array.
+             * @param len Array length.
+             */
+            void WriteUInt16Array(const char* fieldName, const uint16_t* val, const int32_t len);
+
+            /**
+             * Write 32-byte signed integer. Maps to "int" type in Java.
+             *
+             * @param fieldName Field name.
+             * @param val Value.
+             */
+            void WriteInt32(const char* fieldName, const int32_t val);
+
+            /**
+             * Write array of 32-byte signed integers. Maps to "int[]" type in Java.
+             *
+             * @param fieldName Field name.
+             * @param val Array.
+             * @param len Array length.
+             */
+            void WriteInt32Array(const char* fieldName, const int32_t* val, const int32_t len);
+
+            /**
+             * Write 64-byte signed integer. Maps to "long" type in Java.
+             *
+             * @param fieldName Field name.
+             * @param val Value.
+             */
+            void WriteInt64(const char* fieldName, const int64_t val);
+
+            /**
+             * Write array of 64-byte signed integers. Maps to "long[]" type in Java.
+             *
+             * @param fieldName Field name.
+             * @param val Array.
+             * @param len Array length.
+             */
+            void WriteInt64Array(const char* fieldName, const int64_t* val, const int32_t len);
+
+            /**
+             * Write float. Maps to "float" type in Java.
+             *
+             * @param fieldName Field name.
+             * @param val Value.
+             */
+            void WriteFloat(const char* fieldName, const float val);
+
+            /**
+             * Write array of floats. Maps to "float[]" type in Java.
+             *
+             * @param fieldName Field name.
+             * @param val Array.
+             * @param len Array length.
+             */
+            void WriteFloatArray(const char* fieldName, const float* val, const int32_t len);
+
+            /**
+             * Write double. Maps to "double" type in Java.
+             *
+             * @param fieldName Field name.
+             * @param val Value.
+             */
+            void WriteDouble(const char* fieldName, const double val);
+
+            /**
+             * Write array of doubles. Maps to "double[]" type in Java.
+             *
+             * @param fieldName Field name.
+             * @param val Array.
+             * @param len Array length.
+             */
+            void WriteDoubleArray(const char* fieldName, const double* val, const int32_t len);
+
+            /**
+             * Write Guid. Maps to "UUID" type in Java.
+             *
+             * @param fieldName Field name.
+             * @param val Value.
+             */
+            void WriteGuid(const char* fieldName, const Guid val);
+
+            /**
+             * Write array of Guids. Maps to "UUID[]" type in Java.
+             *
+             * @param fieldName Field name.
+             * @param val Array.
+             * @param len Array length.
+             */
+            void WriteGuidArray(const char* fieldName, const Guid* val, const int32_t len);
+
+            /**
+             * Write string.
+             *
+             * @param fieldName Field name.
+             * @param val Null-terminated character sequence.
+             */
+            void WriteString(const char* fieldName, const char* val);
+
+            /**
+             * Write string.
+             *
+             * @param fieldName Field name.
+             * @param val String.
+             * @param len String length (characters).
+             */
+            void WriteString(const char* fieldName, const char* val, const int32_t len);
+
+            /**
+             * Write string.
+             *
+             * @param fieldName Field name.
+             * @param val String.
+             */
+            void WriteString(const char* fieldName, const std::string& val)
+            {
+                WriteString(fieldName, val.c_str());
+            }
+
+            /**
+             * Start string array write.
+             *
+             * @param fieldName Field name.
+             * @return String array writer.
+             */
+            PortableStringArrayWriter WriteStringArray(const char* fieldName);
+
+            /**
+             * Write NULL value.
+             *
+             * @param fieldName Field name.
+             */
+            void WriteNull(const char* fieldName);
+
+            /**
+             * Start array write.
+             *
+             * @param fieldName Field name.
+             * @return Array writer.
+             */
+            template<typename T>
+            PortableArrayWriter<T> WriteArray(const char* fieldName)
+            {
+                int32_t id = impl->WriteArray(fieldName);
+
+                return PortableArrayWriter<T>(impl, id);
+            }
+
+            /**
+             * Start collection write.
+             *
+             * @param fieldName Field name.
+             * @return Collection writer.
+             */
+            template<typename T>
+            PortableCollectionWriter<T> WriteCollection(const char* fieldName)
+            {
+                return WriteCollection<T>(fieldName, IGNITE_COLLECTION_UNDEFINED);
+            }
+
+            /**
+             * Start collection write.
+             *
+             * @param fieldName Field name.
+             * @param type Collection type.
+             * @return Collection writer.
+             */
+            template<typename T>
+            PortableCollectionWriter<T> WriteCollection(const char* fieldName, ignite::portable::CollectionType typ)
+            {
+                int32_t id = impl->WriteCollection(fieldName, typ);
+
+                return PortableCollectionWriter<T>(impl, id);
+            }
+
+            /**
+             * Start map write.
+             *
+             * @param fieldName Field name.
+             * @param typ Map type.
+             * @return Map writer.
+             */
+            template<typename K, typename V>
+            PortableMapWriter<K, V> WriteMap(const char* fieldName)
+            {
+                return WriteMap<K, V>(fieldName, IGNITE_MAP_UNDEFINED);
+            }
+
+            /**
+             * Start map write.
+             *
+             * @param fieldName Field name.
+             * @param typ Map type.
+             * @return Map writer.
+             */
+            template<typename K, typename V>
+            PortableMapWriter<K, V> WriteMap(const char* fieldName, ignite::portable::MapType typ)
+            {
+                int32_t id = impl->WriteMap(fieldName, typ);
+
+                return PortableMapWriter<K, V>(impl, id);
+            }
+
+            /**
+             * Write object.
+             *
+             * @param fieldName Field name.
+             * @param val Value.
+             */
+            template<typename T>
+            void WriteObject(const char* fieldName, T val)
+            {
+                impl->WriteObject<T>(fieldName, val);
+            }
+
+            /**
+             * Get raw writer for this reader.
+             *
+             * @return Raw writer.
+             */
+            PortableRawWriter RawWriter();
+        private:
+            /** Implementation delegate. */
+            ignite::impl::portable::PortableWriterImpl* impl;
+        };
+    }
+}
+
+#endif
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/core/os/linux/include/Makefile.am
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/core/os/linux/include/Makefile.am b/modules/platform/cpp/core/os/linux/include/Makefile.am
new file mode 100644
index 0000000..2ee13eff
--- /dev/null
+++ b/modules/platform/cpp/core/os/linux/include/Makefile.am
@@ -0,0 +1,20 @@
+##
+## Licensed to the Apache Software Foundation (ASF) under one or more
+## contributor license agreements.  See the NOTICE file distributed with
+## this work for additional information regarding copyright ownership.
+## The ASF licenses this file to You under the Apache License, Version 2.0
+## (the "License"); you may not use this file except in compliance with
+## the License.  You may obtain a copy of the License at
+##
+##      http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS,
+## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+## See the License for the specific language governing permissions and
+## limitations under the License.
+##
+
+ACLOCAL_AMFLAGS = "-Im4"
+
+nobase_include_HEADERS = ignite/impl/utils.h

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/core/os/linux/include/ignite/impl/utils.h
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/core/os/linux/include/ignite/impl/utils.h b/modules/platform/cpp/core/os/linux/include/ignite/impl/utils.h
new file mode 100644
index 0000000..8bbd2f7
--- /dev/null
+++ b/modules/platform/cpp/core/os/linux/include/ignite/impl/utils.h
@@ -0,0 +1,155 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _IGNITE_UTILS
+#define _IGNITE_UTILS
+
+#include <cstring>
+#include <string>
+
+#include <ignite/common/common.h>
+
+#ifdef IGNITE_FRIEND
+    #define IGNITE_FRIEND_EXPORT IGNITE_EXPORT
+#else
+    #define IGNITE_FRIEND_EXPORT
+#endif
+
+namespace ignite
+{    
+    namespace impl
+    {
+        namespace utils
+        {                
+            /**
+             * Copy characters.
+             *
+             * @param val Value.
+             * @return Result.
+             */
+            IGNITE_FRIEND_EXPORT char* CopyChars(const char* val);
+
+            /**
+             * Release characters.
+             *
+             * @param val Value.
+             */
+            IGNITE_FRIEND_EXPORT void ReleaseChars(char* val);
+            
+            /**
+             * Read system environment variable taking thread-safety in count.
+             *
+             * @param name Environment variable name.
+             * @param found Whether environment variable with such name was found.
+             * @return Environment variable value.
+             */
+            IGNITE_FRIEND_EXPORT std::string GetEnv(const std::string& name, bool* found);
+                                
+            /**
+             * Ensure that file on the given path exists in the system.
+             *
+             * @param path Path.
+             * @return True if file exists, false otherwise.
+             */
+            IGNITE_FRIEND_EXPORT bool FileExists(const std::string& path);
+
+            /**
+             * Attempts to find JVM library to load it into the process later.
+             * First search is performed using the passed path argument (is not NULL).
+             * Then JRE_HOME is evaluated. Last, JAVA_HOME is evaluated.
+             *
+             * @param Explicitly defined path (optional).
+             * @param found Whether library was found.
+             * @return Path to the file.
+             */
+            IGNITE_FRIEND_EXPORT std::string FindJvmLibrary(const std::string* path, bool* found);
+
+            /**
+             * Load JVM library into the process.
+             *
+             * @param path Optional path to the library.
+             * @return Whether load was successful.
+             */
+            IGNITE_FRIEND_EXPORT bool LoadJvmLibrary(const std::string& path);
+
+            /**
+             * Resolve IGNITE_HOME directory. Resolution is performed in several
+             * steps:
+             * 1) Check for path provided as argument.
+             * 2) Check for environment variable.
+             * 3) Check for current working directory.
+             * Result of these 3 checks are evaluated based on existence of certain
+             * predefined folders inside possible GG home. If they are found, 
+             * IGNITE_HOME is considered resolved.
+             *
+             * @param path Optional path to evaluate.
+             * @param found Whether IGNITE_HOME home was found.
+             * @return Resolved GG home.
+             */
+            IGNITE_FRIEND_EXPORT std::string ResolveIgniteHome(const std::string* path, bool* found);
+
+            /**
+             * Create Ignite classpath based on user input and home directory.
+             *
+             * @param usrCp User's classpath.
+             * @param home Ignite home directory.
+             * @return Classpath.
+             */
+            IGNITE_FRIEND_EXPORT std::string CreateIgniteClasspath(const std::string* usrCp, const std::string* home);
+
+            /**
+             * Create Ignite classpath based on user input and home directory.
+             *
+             * @param usrCp User's classpath.
+             * @param home Ignite home directory.
+             * @param test Whether test classpath must be used.
+             * @return Classpath.
+             */
+            IGNITE_FRIEND_EXPORT std::string CreateIgniteClasspath(const std::string* usrCp, const std::string* home, bool test);
+
+            /**
+             * Safe array which automatically reclaims occupied memory when out of scope.
+             */
+            template<typename T>
+            struct IGNITE_FRIEND_EXPORT SafeArray
+            {
+                /**
+                 * Constructor.
+                 */
+                SafeArray(int cap)
+                {
+                    target = new T[cap];
+                }
+
+                /**
+                 * Destructor.
+                 */
+                ~SafeArray()
+                {
+                    delete[] target;
+                }
+
+                IGNITE_NO_COPY_ASSIGNMENT(SafeArray);
+
+                /** Target array. */
+                T* target;
+            };
+        }
+    }    
+}
+
+#endif

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/core/os/linux/src/impl/utils.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/core/os/linux/src/impl/utils.cpp b/modules/platform/cpp/core/os/linux/src/impl/utils.cpp
new file mode 100644
index 0000000..ec45eb6
--- /dev/null
+++ b/modules/platform/cpp/core/os/linux/src/impl/utils.cpp
@@ -0,0 +1,439 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#include <sys/stat.h>
+#include <dirent.h>
+#include <dlfcn.h>
+
+#include "ignite/impl/utils.h"
+
+namespace ignite
+{
+    namespace impl
+    {
+        namespace utils
+        {
+            const char* JAVA_HOME = "JAVA_HOME";
+            const char* JAVA_DLL = "/jre/lib/amd64/server/libjvm.so";
+
+            const char* IGNITE_HOME = "IGNITE_HOME";
+
+            const char* PROBE_BIN = "/bin";
+            const char* PROBE_EXAMPLES = "/examples";
+
+            const char* IGNITE_NATIVE_TEST_CLASSPATH = "IGNITE_NATIVE_TEST_CLASSPATH";
+
+            /**
+             * Helper method to set boolean result to reference with proper NULL-check.
+             *
+             * @param res Result.
+             * @param outRes Where to set the result.
+             */
+            inline void SetBoolResult(bool res, bool* outRes)
+            {
+                if (outRes)
+                    *outRes = res;
+            }
+
+            /**
+             * Check if string ends with the given ending.
+             *
+             * @param str String to check.
+             * @param ending Ending.
+             * @return Result.
+             */
+            inline bool StringEndsWith(const std::string& str, const std::string& ending)
+            {
+                if (str.length() > ending.length())
+                    return str.compare(str.length() - ending.length(), ending.length(), ending) == 0;
+
+                return false;
+            }
+                
+            /**
+             * Helper function for GG home resolution. Checks whether certain folders
+             * exist in the path. Optionally goes upwards in directory hierarchy.
+             *
+             * @param path Path to evaluate.
+             * @param up Whether to go upwards.
+             * @res Resolution result.
+             * @return Resolved directory.
+             */
+            std::string ResolveIgniteHome0(const std::string& path, bool up, bool* res)
+            {
+                struct stat pathStat;
+                
+                if (stat(path.c_str(), &pathStat) != -1 && S_ISDIR(pathStat.st_mode)) 
+                {
+                    // Remove trailing slashes, otherwise we will have an infinite loop.
+                    std::string path0 = path;
+
+                    while (true) {
+                        char lastChar = *path0.rbegin();
+
+                        if (lastChar == '/' || lastChar == ' ') {
+                            size_t off = path0.find_last_of(lastChar);
+
+                            path0.erase(off, 1);
+                        }
+                        else
+                            break;
+                    }
+
+                    std::string binStr = path0 + PROBE_BIN;
+                    struct stat binStat;
+
+                    std::string examplesStr = path0 + PROBE_EXAMPLES;
+                    struct stat examplesStat;
+
+                    if (stat(binStr.c_str(), &binStat) != -1 && S_ISDIR(binStat.st_mode) &&
+                        stat(examplesStr.c_str(), &examplesStat) != -1 && S_ISDIR(examplesStat.st_mode))
+                    {
+                        SetBoolResult(true, res);
+
+                        return std::string(path0);
+                    }
+
+                    if (up)
+                    {
+                        // Evaluate parent directory.
+                        size_t slashPos = path0.find_last_of("/");
+
+                        if (slashPos != std::string::npos)
+                        {
+                            std::string parent = path0.substr(0, slashPos);
+
+                            return ResolveIgniteHome0(parent, true, res);
+                        }
+                    }
+
+                }
+
+                SetBoolResult(false, res);
+
+                return std::string();
+            }
+
+            /**
+             * Create classpath picking JARs from the given path.
+             *
+             * @path Path.
+             * @return Classpath;
+             */
+            std::string ClasspathJars(const std::string& path)
+            {
+                std::string res = std::string();
+
+                DIR* dir = opendir(path.c_str());
+
+                if (dir)
+                {
+                    struct dirent* entry;
+
+                    while ((entry = readdir(dir)) != NULL)
+                    {
+                        if (strstr(entry->d_name, ".jar"))
+                        {
+                            res.append(path);
+                            res.append("/");
+                            res.append(entry->d_name);
+                            res.append(":");
+                        }
+                    }
+
+                    closedir(dir);
+                }
+
+                return res;
+            }
+
+            /**
+             * Create classpath picking compiled classes from the given path.
+             *
+             * @path Path.
+             * @return Classpath;
+             */
+            std::string ClasspathExploded(const std::string& path, bool down)
+            {
+                std::string res = std::string();
+
+                if (FileExists(path))
+                {
+                    // 1. Append "target\classes".
+                    std::string classesPath = path + "/target/classes";
+
+                    if (FileExists(classesPath)) {
+                        res += classesPath;
+                        res += ":";
+                    }
+
+                    // 2. Append "target\test-classes"
+                    std::string testClassesPath = path + "/target/test-classes";
+
+                    if (FileExists(testClassesPath)) {
+                        res += testClassesPath;
+                        res += ":";
+                    }
+
+                    // 3. Append "target\libs"
+                    std::string libsPath = path + "/target/libs";
+
+                    if (FileExists(libsPath)) {
+                        std::string libsCp = ClasspathJars(libsPath);
+                        res += libsCp;
+                    }
+
+                    // 4. Do the same for child if needed.
+                    if (down)
+                    {
+                        DIR* dir = opendir(path.c_str());
+
+                        if (dir)
+                        {
+                            struct dirent* entry;
+
+                            while ((entry = readdir(dir)) != NULL)
+                            {
+                                std::string entryPath = entry->d_name;
+
+                                if (entryPath.compare(".") != 0 && entryPath.compare("..") != 0)
+                                {
+                                    std::string entryFullPath = path + "/" + entryPath;
+
+                                    struct stat entryFullStat;
+
+                                    if (stat(entryFullPath.c_str(), &entryFullStat) != -1 && S_ISDIR(entryFullStat.st_mode))
+                                    {
+                                        std::string childCp = ClasspathExploded(entryFullPath, false);
+
+                                        res += childCp;
+                                    }
+                                }
+                            }
+
+                            closedir(dir);
+                        }
+                    }
+                }
+
+                return res;
+            }
+
+            /**
+             * Helper function to create classpath based on Ignite home directory.
+             *
+             * @param home Home directory; expected to be valid.
+             * @param forceTest Force test classpath.
+             */
+            std::string CreateIgniteHomeClasspath(const std::string& home, bool forceTest)
+            {
+                std::string res = std::string();
+
+                // 1. Add exploded test directories.
+                if (forceTest)
+                {
+                    std::string examplesPath = home + "/examples";
+                    std::string examplesCp = ClasspathExploded(examplesPath, true);
+                    res.append(examplesCp);
+
+                    std::string modulesPath = home + "/modules";
+                    std::string modulesCp = ClasspathExploded(modulesPath, true);
+                    res.append(modulesCp);
+                }
+
+                // 2. Add regular jars from "libs" folder excluding "optional".
+                std::string libsPath = home + "/libs";
+
+                if (FileExists(libsPath))
+                {
+                    res.append(ClasspathJars(libsPath));
+
+                    // Append inner directories.
+                    DIR* dir = opendir(libsPath.c_str());
+
+                    if (dir)
+                    {
+                        struct dirent* entry;
+
+                        while ((entry = readdir(dir)) != NULL)
+                        {
+                            std::string entryPath = entry->d_name;
+
+                            if (entryPath.compare(".") != 0 && entryPath.compare("..") != 0 &&
+                                entryPath.compare("optional") != 0)
+                            {
+                                std::string entryFullPath = libsPath;
+
+                                entryFullPath.append("/");
+                                entryFullPath.append(entryPath);
+
+                                struct stat entryFullStat;
+
+                                if (stat(entryFullPath.c_str(), &entryFullStat) != -1 && 
+                                    S_ISDIR(entryFullStat.st_mode)) 
+                                    res.append(ClasspathJars(entryFullPath));
+                            }                                                              
+                        }
+
+                        closedir(dir);
+                    }
+                }
+
+                // 3. Return.
+                return res;
+            }
+
+            char* CopyChars(const char* val)
+            {
+                if (val) {
+                    size_t len = strlen(val);
+                    char* dest = new char[len + 1];
+                    strcpy(dest, val);
+                    *(dest + len) = 0;
+                    return dest;
+                }
+                else
+                    return NULL;
+            }
+
+            void ReleaseChars(char* val)
+            {
+                if (val)
+                    delete[] val;
+            }
+
+            std::string GetEnv(const std::string& name, bool* found)
+            {
+                char* val = std::getenv(name.c_str());
+                
+                if (val) {
+                    SetBoolResult(true, found);
+                    
+                    return std::string(val);
+                }
+                else {
+                    SetBoolResult(false, found);
+                    
+                    return std::string();
+                }
+            }
+
+            bool FileExists(const std::string& path)
+            {
+                struct stat s;
+                
+                int res = stat(path.c_str(), &s);
+
+                return res != -1;
+            }
+
+            std::string FindJvmLibrary(const std::string* path, bool* found)
+            {
+                SetBoolResult(true, found); // Optimistically assume that we will find it.
+
+                if (path) {
+                    // If path is provided explicitly, then check only it.
+                    if (FileExists(*path))                            
+                        return std::string(path->data());
+                }
+                else
+                {
+                    bool javaEnvFound;
+                    std::string javaEnv = GetEnv(JAVA_HOME, &javaEnvFound);
+
+                    if (javaEnvFound)
+                    {
+                        std::string javaDll = javaEnv + JAVA_DLL;
+
+                        if (FileExists(javaDll))
+                            return std::string(javaDll);
+                    }
+                }
+
+                SetBoolResult(false, found);
+
+                return std::string();
+            }
+
+            bool LoadJvmLibrary(const std::string& path)
+            {
+                void* hnd = dlopen(path.c_str(), RTLD_LAZY);
+                
+                return hnd != NULL;
+            }                
+
+            std::string ResolveIgniteHome(const std::string* path, bool* found)
+            {
+                if (path)
+                    // 1. Check passed argument.
+                    return ResolveIgniteHome0(*path, false, found);
+                else
+                {
+                    // 2. Check environment variable.
+                    bool envFound;
+                    std::string env = GetEnv(IGNITE_HOME, &envFound);
+
+                    if (envFound)
+                        return ResolveIgniteHome0(env, false, found);
+                }
+
+                SetBoolResult(false, found);
+                        
+                return std::string();
+            }
+
+            std::string CreateIgniteClasspath(const std::string* usrCp, const std::string* home)
+            {
+                bool forceTest = false;
+
+                if (home)
+                {
+                    bool envFound;
+                    std::string env = GetEnv(IGNITE_NATIVE_TEST_CLASSPATH, &envFound);
+
+                    forceTest = envFound && env.compare("true") == 0;
+                }
+
+                return CreateIgniteClasspath(usrCp, home, forceTest);
+            }
+
+            std::string CreateIgniteClasspath(const std::string* usrCp, const std::string* home, bool forceTest)
+            {
+                // 1. Append user classpath if it exists.
+                std::string cp = std::string();
+
+                if (usrCp)
+                {
+                    cp.append(*usrCp);
+
+                    if (*cp.rbegin() != ':')
+                        cp.append(":");
+                }
+
+                // 2. Append home classpath if home is defined.
+                if (home)
+                {
+                    std::string homeCp = CreateIgniteHomeClasspath(*home, forceTest);
+
+                    cp.append(homeCp);
+                }
+
+                // 3. Return.
+                return cp;
+            }
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/core/os/win/include/ignite/impl/utils.h
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/core/os/win/include/ignite/impl/utils.h b/modules/platform/cpp/core/os/win/include/ignite/impl/utils.h
new file mode 100644
index 0000000..08e76ee
--- /dev/null
+++ b/modules/platform/cpp/core/os/win/include/ignite/impl/utils.h
@@ -0,0 +1,155 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _IGNITE_UTILS
+#define _IGNITE_UTILS
+
+#include <cstring>
+#include <string>
+
+#include <ignite/common/common.h>
+
+#ifdef IGNITE_FRIEND
+    #define IGNITE_FRIEND_EXPORT IGNITE_EXPORT
+#else
+    #define IGNITE_FRIEND_EXPORT
+#endif
+
+namespace ignite
+{    
+    namespace impl
+    {
+        namespace utils
+        {                
+            /**
+             * Copy characters.
+             *
+             * @param val Value.
+             * @return Result.
+             */
+            IGNITE_FRIEND_EXPORT char* CopyChars(const char* val);
+
+            /**
+             * Release characters.
+             *
+             * @param val Value.
+             */
+            IGNITE_FRIEND_EXPORT void ReleaseChars(char* val);
+            
+            /**
+             * Read system environment variable taking thread-safety in count.
+             *
+             * @param name Environment variable name.
+             * @param found Whether environment variable with such name was found.
+             * @return Environment variable value.
+             */
+            IGNITE_FRIEND_EXPORT std::string GetEnv(const std::string& name, bool* found);
+                                
+            /**
+             * Ensure that file on the given path exists in the system.
+             *
+             * @param path Path.
+             * @return True if file exists, false otherwise.
+             */
+            IGNITE_FRIEND_EXPORT bool FileExists(const std::string& path);
+
+            /**
+             * Attempts to find JVM library to load it into the process later.
+             * First search is performed using the passed path argument (is not NULL).
+             * Then JRE_HOME is evaluated. Last, JAVA_HOME is evaluated.
+             *
+             * @param Explicitly defined path (optional).
+             * @param found Whether library was found.
+             * @return Path to the file.
+             */
+            IGNITE_FRIEND_EXPORT std::string FindJvmLibrary(const std::string* path, bool* found);
+
+            /**
+             * Load JVM library into the process.
+             *
+             * @param path Optional path to the library.
+             * @return Whether load was successful.
+             */
+            IGNITE_FRIEND_EXPORT bool LoadJvmLibrary(const std::string& path);
+
+            /**
+             * Resolve IGNITE_HOME directory. Resolution is performed in several
+             * steps:
+             * 1) Check for path provided as argument.
+             * 2) Check for environment variable.
+             * 3) Check for current working directory.
+             * Result of these 3 checks are evaluated based on existence of certain
+             * predefined folders inside possible GG home. If they are found, 
+             * IGNITE_HOME is considered resolved.
+             *
+             * @param path Optional path to evaluate.
+             * @param found Whether IGNITE_HOME home was found.
+             * @return Resolved GG home.
+             */
+            IGNITE_FRIEND_EXPORT std::string ResolveIgniteHome(const std::string* path, bool* found);
+
+            /**
+             * Create Ignite classpath based on user input and home directory.
+             *
+             * @param usrCp User's classpath.
+             * @param home Ignite home directory.
+             * @return Classpath.
+             */
+            IGNITE_FRIEND_EXPORT std::string CreateIgniteClasspath(const std::string* usrCp, const std::string* home);
+
+            /**
+             * Create Ignite classpath based on user input and home directory.
+             *
+             * @param usrCp User's classpath.
+             * @param home Ignite home directory.
+             * @param test Whether test classpath must be used.
+             * @return Classpath.
+             */
+            IGNITE_FRIEND_EXPORT std::string CreateIgniteClasspath(const std::string* usrCp, const std::string* home, bool test);
+
+            /**
+             * Safe array which automatically reclaims occupied memory when out of scope.
+             */
+            template<typename T>
+            struct IGNITE_FRIEND_EXPORT SafeArray
+            {
+                /** Target array. */
+                T* target;
+
+                /**
+                 * Constructor.
+                 */
+                SafeArray(int cap)
+                {
+                    target = new T[cap];
+                }
+
+                /**
+                 * Destructor.
+                 */
+                ~SafeArray()
+                {
+                    delete[] target;
+                }
+
+                IGNITE_NO_COPY_ASSIGNMENT(SafeArray);
+            };
+        }
+    }    
+}
+
+#endif
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/core/os/win/src/impl/utils.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/core/os/win/src/impl/utils.cpp b/modules/platform/cpp/core/os/win/src/impl/utils.cpp
new file mode 100644
index 0000000..5a450c3
--- /dev/null
+++ b/modules/platform/cpp/core/os/win/src/impl/utils.cpp
@@ -0,0 +1,453 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <windows.h>
+
+#include "ignite/impl/utils.h"
+
+namespace ignite
+{
+    namespace impl
+    {
+        namespace utils
+        {
+            const char* JAVA_HOME = "JAVA_HOME";
+            const char* JAVA_DLL = "\\jre\\bin\\server\\jvm.dll";
+
+            const char* IGNITE_HOME = "IGNITE_HOME";
+
+            const char* PROBE_BIN = "\\bin";
+            const char* PROBE_EXAMPLES = "\\examples";
+
+            const char* IGNITE_NATIVE_TEST_CLASSPATH = "IGNITE_NATIVE_TEST_CLASSPATH";
+
+            /**
+             * Helper method to set boolean result to reference with proper NULL-check.
+             *
+             * @param res Result.
+             * @param outRes Where to set the result.
+             */
+            inline void SetBoolResult(bool res, bool* outRes)
+            {
+                if (outRes)
+                    *outRes = res;
+            }
+
+            /**
+             * Check if string ends with the given ending.
+             *
+             * @param str String to check.
+             * @param ending Ending.
+             * @return Result.
+             */
+            inline bool StringEndsWith(const std::string& str, const std::string& ending)
+            {
+                if (str.length() > ending.length())
+                    return str.compare(str.length() - ending.length(), ending.length(), ending) == 0;
+
+                return false;
+            }
+                
+            /**
+             * Helper function for GG home resolution. Checks whether certain folders
+             * exist in the path. Optionally goes upwards in directory hierarchy.
+             *
+             * @param path Path to evaluate.
+             * @param up Whether to go upwards.
+             * @res Resolution result.
+             * @return Resolved directory.
+             */
+            std::string ResolveIgniteHome0(const std::string& path, bool up, bool* res)
+            {
+                DWORD attrs = GetFileAttributesA(path.c_str());
+
+                if (attrs != INVALID_FILE_ATTRIBUTES && (attrs & FILE_ATTRIBUTE_DIRECTORY))
+                {
+                    // Remove trailing slashes, otherwise we will have an infinite loop.
+                    std::string path0 = path;
+
+                    while (true) {
+                        char lastChar = *path0.rbegin();
+
+                        if (lastChar == '/' || lastChar == '\\' || lastChar == ' ') {
+                            size_t off = path0.find_last_of(lastChar);
+
+                            path0.erase(off, 1);
+                        }
+                        else
+                            break;
+                    }
+
+                    std::string binStr = path0 + PROBE_BIN;
+                    DWORD binAttrs = GetFileAttributesA(binStr.c_str());
+
+                    std::string examplesStr = path0 + PROBE_EXAMPLES;
+                    DWORD examplesAttrs = GetFileAttributesA(examplesStr.c_str());
+
+                    if (binAttrs != INVALID_FILE_ATTRIBUTES && (binAttrs & FILE_ATTRIBUTE_DIRECTORY) &&
+                        examplesAttrs != INVALID_FILE_ATTRIBUTES && (examplesAttrs & FILE_ATTRIBUTE_DIRECTORY))
+                    {
+                        SetBoolResult(true, res);
+                        return std::string(path0);
+                    }
+
+                    if (up)
+                    {
+                        // Evaluate parent directory.
+                        size_t slashPos = path0.find_last_of("/\\");
+
+                        if (slashPos != std::string::npos)
+                        {
+                            std::string parent = path0.substr(0, slashPos);
+
+                            return ResolveIgniteHome0(parent, true, res);
+                        }
+                    }
+                }
+
+                SetBoolResult(false, res);
+
+                return std::string();
+            }
+
+            /**
+             * Create classpath picking JARs from the given path.
+             *
+             * @path Path.
+             * @return Classpath;
+             */
+            std::string ClasspathJars(const std::string& path)
+            {
+                std::string searchPath = path + "\\*.jar";
+
+                std::string res = std::string();
+
+                WIN32_FIND_DATAA findData;
+
+                HANDLE hnd = FindFirstFileA(searchPath.c_str(), &findData);
+
+                if (hnd != INVALID_HANDLE_VALUE)
+                {
+                    do
+                    {
+                        res.append(path);
+                        res.append("\\");
+                        res.append(findData.cFileName);
+                        res.append(";");
+                    } while (FindNextFileA(hnd, &findData) != 0);
+
+                    FindClose(hnd);
+                }
+
+                return res;
+            }
+
+            /**
+             * Create classpath picking compiled classes from the given path.
+             *
+             * @path Path.
+             * @return Classpath;
+             */
+            std::string ClasspathExploded(const std::string& path, bool down)
+            {
+                std::string res = std::string();
+
+                if (FileExists(path))
+                {
+                    // 1. Append "target\classes".
+                    std::string classesPath = path + "\\target\\classes";
+
+                    if (FileExists(classesPath)) {
+                        res.append(classesPath);
+                        res.append(";");
+                    }
+
+                    // 2. Append "target\test-classes"
+                    std::string testClassesPath = path + "\\target\\test-classes";
+
+                    if (FileExists(testClassesPath)) {
+                        res.append(testClassesPath);
+                        res.append(";");
+                    }
+
+                    // 3. Append "target\libs"
+                    std::string libsPath = path + "\\target\\libs";
+
+                    if (FileExists(libsPath)) {
+                        std::string libsCp = ClasspathJars(libsPath);
+                        res.append(libsCp);
+                    }
+
+                    // 4. Do the same for child if needed.
+                    if (down)
+                    {
+                        std::string searchPath = path + "\\*";
+
+                        WIN32_FIND_DATAA findData;
+
+                        HANDLE hnd = FindFirstFileA(searchPath.c_str(), &findData);
+
+                        if (hnd != INVALID_HANDLE_VALUE)
+                        {
+                            do
+                            {
+                                if (findData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
+                                {
+                                    std::string childPath = findData.cFileName;
+
+                                    if (childPath.compare(".") != 0 &&
+                                        childPath.compare("..") != 0)
+                                    {
+                                        std::string childCp =
+                                            ClasspathExploded(path + "\\" + childPath, false);
+
+                                        res.append(childCp);
+                                    }
+                                }
+                            } while (FindNextFileA(hnd, &findData) != 0);
+
+                            FindClose(hnd);
+                        }
+                    }
+                }
+
+                return res;
+            }
+
+            /**
+             * Helper function to create classpath based on Ignite home directory.
+             *
+             * @param home Home directory; expected to be valid.
+             * @param forceTest Force test classpath.
+             */
+            std::string CreateIgniteHomeClasspath(const std::string& home, bool forceTest)
+            {
+                std::string res = std::string();
+
+                // 1. Add exploded test directories.
+                if (forceTest)
+                {
+                    std::string examplesPath = home + "\\examples";
+                    std::string examplesCp = ClasspathExploded(examplesPath, true);
+                    res.append(examplesCp);
+
+                    std::string modulesPath = home + "\\modules";
+                    std::string modulesCp = ClasspathExploded(modulesPath, true);
+                    res.append(modulesCp);
+                }
+
+                // 2. Add regular jars from "libs" folder excluding "optional".
+                std::string libsPath = home + "\\libs";
+
+                if (FileExists(libsPath))
+                {
+                    res.append(ClasspathJars(libsPath));
+
+                    // Append inner directories.
+                    std::string libsSearchPath = libsPath + "\\*";
+
+                    WIN32_FIND_DATAA libsFindData;
+
+                    HANDLE libsHnd = FindFirstFileA(libsSearchPath.c_str(), &libsFindData);
+
+                    if (libsHnd != INVALID_HANDLE_VALUE)
+                    {
+                        do
+                        {
+                            if (libsFindData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
+                            {
+                                std::string libsChildPath = libsFindData.cFileName;
+
+                                if (libsChildPath.compare(".") != 0 &&
+                                    libsChildPath.compare("..") != 0 &&
+                                    libsChildPath.compare("optional") != 0) {
+                                    std::string libsFolder = libsPath + "\\" + libsChildPath;
+
+                                    res.append(ClasspathJars(libsFolder));
+                                }
+                            }
+                        } while (FindNextFileA(libsHnd, &libsFindData) != 0);
+
+                        FindClose(libsHnd);
+                    }
+                }
+
+                // 3. Return.
+                return res;
+            }
+
+            char* CopyChars(const char* val)
+            {
+                if (val) {
+                    size_t len = strlen(val);
+                    char* dest = new char[len + 1];
+                    strcpy(dest, val);
+                    *(dest + len) = 0;
+                    return dest;
+                }
+                else
+                    return NULL;
+            }
+
+            void ReleaseChars(char* val)
+            {
+                if (val)
+                    delete[] val;
+            }
+
+            std::string GetEnv(const std::string& name, bool* found)
+            {
+                char res0[32767];
+
+                DWORD envRes = GetEnvironmentVariableA(name.c_str(), res0, 32767);
+
+                if (envRes != 0)
+                {
+                    SetBoolResult(true, found);
+
+                    return std::string(res0);
+                }
+                else 
+                {
+                    SetBoolResult(false, found);
+
+                    return std::string();
+                }
+            }
+
+            bool FileExists(const std::string& path)
+            {
+                WIN32_FIND_DATAA findres;
+
+                HANDLE hnd = FindFirstFileA(path.c_str(), &findres);
+
+                if (hnd == INVALID_HANDLE_VALUE)
+                    return false;
+                else
+                {
+                    FindClose(hnd);
+
+                    return true;
+                }
+            }
+
+            std::string FindJvmLibrary(const std::string* path, bool* found)
+            {
+                SetBoolResult(true, found); // Optimistically assume that we will find it.
+
+                if (path) {
+                    // If path is provided explicitly, then check only it.
+                    if (FileExists(*path))                            
+                        return std::string(path->data());
+                }
+                else
+                {
+                    bool javaEnvFound;
+                    std::string javaEnv = GetEnv(JAVA_HOME, &javaEnvFound);
+
+                    if (javaEnvFound)
+                    {
+                        std::string javaDll = javaEnv + JAVA_DLL;
+
+                        if (FileExists(javaDll))
+                            return std::string(javaDll);
+                    }
+                }
+
+                *found = false; 
+
+                return std::string();
+            }
+
+            bool LoadJvmLibrary(const std::string& path)
+            {
+                HMODULE mod = LoadLibraryA(path.c_str());
+
+                return mod != NULL;
+            }                
+
+            std::string ResolveIgniteHome(const std::string* path, bool* found)
+            {
+                if (path)
+                    // 1. Check passed argument.
+                    return ResolveIgniteHome0(*path, false, found);
+                else
+                {
+                    // 2. Check environment variable.
+                    bool envFound;
+                    std::string env = GetEnv(IGNITE_HOME, &envFound);
+
+                    if (envFound)
+                        return ResolveIgniteHome0(env, false, found);
+
+                    // 3. Check current work dir.
+                    const DWORD curDirLen = GetCurrentDirectory(0, NULL);
+                        
+                    char* curDir = new char[curDirLen];
+
+                    GetCurrentDirectoryA(curDirLen, curDir);
+
+                    std::string curDirStr = curDir;
+
+                    delete[] curDir;
+
+                    return ResolveIgniteHome0(curDirStr, true, found);
+                }
+            }
+
+            std::string CreateIgniteClasspath(const std::string* usrCp, const std::string* home)
+            {
+                bool forceTest = false;
+
+                if (home)
+                {
+                    bool envFound;
+                    std::string env = GetEnv(IGNITE_NATIVE_TEST_CLASSPATH, &envFound);
+
+                    forceTest = envFound && env.compare("true") == 0;
+                }
+
+                return CreateIgniteClasspath(usrCp, home, forceTest);
+            }
+
+            std::string CreateIgniteClasspath(const std::string* usrCp, const std::string* home, bool forceTest)
+            {
+                // 1. Append user classpath if it exists.
+                std::string cp = std::string();
+
+                if (usrCp)
+                {
+                    cp.append(*usrCp);
+
+                    if (*cp.rbegin() != ';')
+                        cp.append(";");
+                }
+
+                // 2. Append home classpath if home is defined.
+                if (home)
+                {
+                    std::string homeCp = CreateIgniteHomeClasspath(*home, forceTest);
+
+                    cp.append(homeCp);
+                }
+
+                // 3. Return.
+                return cp;
+            }
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/core/project/README.TXT
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/core/project/README.TXT b/modules/platform/cpp/core/project/README.TXT
new file mode 100644
index 0000000..97f4c64
--- /dev/null
+++ b/modules/platform/cpp/core/project/README.TXT
@@ -0,0 +1 @@
+Contains IDE projects artifacts.

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/core/project/vs/README.TXT
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/core/project/vs/README.TXT b/modules/platform/cpp/core/project/vs/README.TXT
new file mode 100644
index 0000000..f4fb456
--- /dev/null
+++ b/modules/platform/cpp/core/project/vs/README.TXT
@@ -0,0 +1 @@
+Contains Visual Studio project artifacts.
\ No newline at end of file


[16/28] ignite git commit: IGNITE-1513: Moved CPP.

Posted by vo...@apache.org.
http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/core/src/impl/ignite_environment.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/core/src/impl/ignite_environment.cpp b/modules/platform/cpp/core/src/impl/ignite_environment.cpp
new file mode 100644
index 0000000..8fb1a02
--- /dev/null
+++ b/modules/platform/cpp/core/src/impl/ignite_environment.cpp
@@ -0,0 +1,167 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "ignite/impl/portable/portable_reader_impl.h"
+#include "ignite/impl/ignite_environment.h"
+#include "ignite/portable/portable.h"
+
+using namespace ignite::common::concurrent;
+using namespace ignite::common::java;
+using namespace ignite::impl::interop;
+using namespace ignite::impl::portable;
+using namespace ignite::portable;
+
+namespace ignite 
+{
+    namespace impl 
+    {
+        /**
+         * OnStart callback.
+         *
+         * @param target Target environment.
+         * @param proc Processor instance (not used for now).
+         * @param memPtr Memory pointer.
+         */
+        void IGNITE_CALL OnStart(void* target, void* proc, long long memPtr)
+        {
+            SharedPointer<IgniteEnvironment>* ptr = static_cast<SharedPointer<IgniteEnvironment>*>(target);
+
+            ptr->Get()->OnStartCallback(memPtr);
+        }
+
+        /**
+         * OnStop callback.
+         *
+         * @param target Target environment.
+         */
+        void IGNITE_CALL OnStop(void* target)
+        {
+            SharedPointer<IgniteEnvironment>* ptr = static_cast<SharedPointer<IgniteEnvironment>*>(target);
+
+            delete ptr;
+        } 
+
+        IgniteEnvironment::IgniteEnvironment() : ctx(SharedPointer<JniContext>()), latch(new SingleLatch), name(NULL),
+            metaMgr(new PortableMetadataManager())
+        {
+            // No-op.
+        }
+
+        IgniteEnvironment::~IgniteEnvironment()
+        {
+            delete latch;
+
+            if (name)
+                delete name;
+
+            delete metaMgr;
+        }
+
+        JniHandlers IgniteEnvironment::GetJniHandlers(SharedPointer<IgniteEnvironment>* target)
+        {
+            JniHandlers hnds = JniHandlers();
+
+            hnds.target = target;
+
+            hnds.onStart = OnStart;
+            hnds.onStop = OnStop;
+
+            hnds.error = NULL;
+
+            return hnds;
+        }
+            
+        void IgniteEnvironment::Initialize(SharedPointer<JniContext> ctx)
+        {
+            this->ctx = ctx;
+                
+            latch->CountDown();
+        }
+        
+        char* IgniteEnvironment::InstanceName()
+        {
+            return name;
+        }
+
+        JniContext* IgniteEnvironment::Context()
+        {
+            return ctx.Get();
+        }
+
+        SharedPointer<InteropMemory> IgniteEnvironment::AllocateMemory()
+        {
+            SharedPointer<InteropMemory> ptr(new InteropUnpooledMemory(1024));
+
+            return ptr;
+        }
+
+        SharedPointer<InteropMemory> IgniteEnvironment::AllocateMemory(int32_t cap)
+        {
+            SharedPointer<InteropMemory> ptr(new InteropUnpooledMemory(cap));
+
+            return ptr;
+        }
+
+        SharedPointer<InteropMemory> IgniteEnvironment::GetMemory(int64_t memPtr)
+        {
+            int8_t* memPtr0 = reinterpret_cast<int8_t*>(memPtr);
+
+            int32_t flags = InteropMemory::Flags(memPtr0);
+
+            if (InteropMemory::IsExternal(flags))
+            {
+                SharedPointer<InteropMemory> ptr(new InteropExternalMemory(memPtr0));
+
+                return ptr;
+            }
+            else
+            {
+                SharedPointer<InteropMemory> ptr(new InteropUnpooledMemory(memPtr0));
+
+                return ptr;
+            }
+        }
+
+        PortableMetadataManager* IgniteEnvironment::GetMetadataManager()
+        {
+            return metaMgr;
+        }
+
+        void IgniteEnvironment::OnStartCallback(long long memPtr)
+        {
+            InteropExternalMemory mem(reinterpret_cast<int8_t*>(memPtr));
+            InteropInputStream stream(&mem);
+
+            PortableReaderImpl reader(&stream);
+            
+            int32_t nameLen = reader.ReadString(NULL, 0);
+
+            if (nameLen >= 0)
+            {
+                name = new char[nameLen + 1];
+                reader.ReadString(name, nameLen + 1);
+            }
+            else
+                name = NULL;
+        }
+    }
+}
+
+
+
+
+

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/core/src/impl/ignite_impl.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/core/src/impl/ignite_impl.cpp b/modules/platform/cpp/core/src/impl/ignite_impl.cpp
new file mode 100644
index 0000000..1aad309
--- /dev/null
+++ b/modules/platform/cpp/core/src/impl/ignite_impl.cpp
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "ignite/impl/ignite_impl.h"
+
+using namespace ignite::common::concurrent;
+using namespace ignite::common::java;
+
+namespace ignite
+{    
+    namespace impl
+    {
+        IgniteImpl::IgniteImpl(SharedPointer<IgniteEnvironment> env, jobject javaRef) : env(env), javaRef(javaRef)
+        {
+            // No-op.
+        }
+
+        IgniteImpl::~IgniteImpl()
+        {
+            JniContext::Release(javaRef);
+        }
+
+        char* IgniteImpl::GetName()
+        {
+            return env.Get()->InstanceName();
+        }
+    }    
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/core/src/impl/interop/interop_input_stream.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/core/src/impl/interop/interop_input_stream.cpp b/modules/platform/cpp/core/src/impl/interop/interop_input_stream.cpp
new file mode 100644
index 0000000..72340ee
--- /dev/null
+++ b/modules/platform/cpp/core/src/impl/interop/interop_input_stream.cpp
@@ -0,0 +1,215 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <cstring>
+
+#include "ignite/impl/interop/interop_input_stream.h"
+#include "ignite/ignite_error.h"
+
+/**
+ * Common macro to read a single value.
+ */
+#define IGNITE_INTEROP_IN_READ(type, len) { \
+    EnsureEnoughData(len); \
+    type res = *reinterpret_cast<type*>(data + pos); \
+    Shift(len); \
+    return res; \
+}
+
+/**
+ * Common macro to read an array.
+ */
+#define IGNITE_INTEROP_IN_READ_ARRAY(len, shift) { \
+    CopyAndShift(reinterpret_cast<int8_t*>(res), 0, len << shift); \
+}
+
+namespace ignite
+{    
+    namespace impl
+    {
+        namespace interop 
+        {
+            union PortableInt32Float
+            {
+                int32_t i;
+                float f;
+            };
+
+            union PortableInt64Double
+            {
+                int64_t i;
+                double d;
+            };
+
+            InteropInputStream::InteropInputStream(InteropMemory* mem)
+            {
+                this->mem = mem;
+
+                data = mem->Data();
+                len = mem->Length();
+                pos = 0;
+            }
+
+            int8_t InteropInputStream::ReadInt8()
+            {
+                IGNITE_INTEROP_IN_READ(int8_t, 1);
+            }
+
+            void InteropInputStream::ReadInt8Array(int8_t* const res, const int32_t len)
+            {
+                IGNITE_INTEROP_IN_READ_ARRAY(len, 0);
+            }
+
+            bool InteropInputStream::ReadBool()
+            {
+                return ReadInt8() == 1;
+            }
+
+            void InteropInputStream::ReadBoolArray(bool* const res, const int32_t len)
+            {
+                for (int i = 0; i < len; i++)
+                    *(res + i) = ReadBool();
+            }
+                
+            int16_t InteropInputStream::ReadInt16()
+            {
+                IGNITE_INTEROP_IN_READ(int16_t, 2);
+            }
+
+            void InteropInputStream::ReadInt16Array(int16_t* const res, const int32_t len)
+            {
+                IGNITE_INTEROP_IN_READ_ARRAY(len, 1);
+            }
+
+            uint16_t InteropInputStream::ReadUInt16()
+            {
+                IGNITE_INTEROP_IN_READ(uint16_t, 2);
+            }
+
+            void InteropInputStream::ReadUInt16Array(uint16_t* const res, const int32_t len)
+            {
+                IGNITE_INTEROP_IN_READ_ARRAY(len, 1);
+            }
+
+            int32_t InteropInputStream::ReadInt32()
+            {
+                IGNITE_INTEROP_IN_READ(int32_t, 4);
+            }
+
+            int32_t InteropInputStream::ReadInt32(int32_t pos)
+            {
+                int delta = pos + 4 - this->pos;
+
+                if (delta > 0)
+                    EnsureEnoughData(delta);
+
+                return *reinterpret_cast<int32_t*>(data + pos);
+            }
+
+            void InteropInputStream::ReadInt32Array(int32_t* const res, const int32_t len)
+            {
+                IGNITE_INTEROP_IN_READ_ARRAY(len, 2);
+            }
+
+            int64_t InteropInputStream::ReadInt64()
+            {
+                IGNITE_INTEROP_IN_READ(int64_t, 8);
+            }
+
+            void InteropInputStream::ReadInt64Array(int64_t* const res, const int32_t len)
+            {
+                IGNITE_INTEROP_IN_READ_ARRAY(len, 3);
+            }
+
+            float InteropInputStream::ReadFloat()
+            {
+                PortableInt32Float u;
+
+                u.i = ReadInt32();
+
+                return u.f;
+            }
+
+            void InteropInputStream::ReadFloatArray(float* const res, const int32_t len)
+            {
+                IGNITE_INTEROP_IN_READ_ARRAY(len, 2);
+            }
+
+            double InteropInputStream::ReadDouble()
+            {
+                PortableInt64Double u;
+
+                u.i = ReadInt64();
+
+                return u.d;
+            }
+
+            void InteropInputStream::ReadDoubleArray(double* const res, const int32_t len)
+            {
+                IGNITE_INTEROP_IN_READ_ARRAY(len, 3);
+            }
+                
+            int32_t InteropInputStream::Remaining()
+            {
+                return len - pos;
+            }
+
+            int32_t InteropInputStream::Position()
+            {
+                return pos;
+            }
+
+            void InteropInputStream::Position(int32_t pos)
+            {
+                if (pos > len) {
+                    IGNITE_ERROR_FORMATTED_3(IgniteError::IGNITE_ERR_MEMORY, "Requested input stream position is out of bounds",
+                        "memPtr", mem->PointerLong(), "len", len, "pos", pos);
+                }
+
+                this->pos = pos;
+            }
+
+            void InteropInputStream::Synchronize()
+            {
+                data = mem->Data();
+                len = mem->Length();
+            }
+            
+            void InteropInputStream::EnsureEnoughData(int32_t cnt)
+            {
+                if (len - pos < cnt) {
+                    IGNITE_ERROR_FORMATTED_4(IgniteError::IGNITE_ERR_MEMORY, "Not enough data in the stream",
+                        "memPtr", mem->PointerLong(), "len", len, "pos", pos, "requested", cnt);
+                }
+            }
+
+            void InteropInputStream::CopyAndShift(int8_t* dest, int32_t off, int32_t cnt)
+            {
+                EnsureEnoughData(cnt);
+
+                memcpy(dest + off, data + pos, cnt);
+
+                Shift(cnt);
+            }
+
+            void InteropInputStream::Shift(int32_t cnt)
+            {
+                pos += cnt;
+            }
+        }
+    }
+}        

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/core/src/impl/interop/interop_memory.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/core/src/impl/interop/interop_memory.cpp b/modules/platform/cpp/core/src/impl/interop/interop_memory.cpp
new file mode 100644
index 0000000..05ba8b6
--- /dev/null
+++ b/modules/platform/cpp/core/src/impl/interop/interop_memory.cpp
@@ -0,0 +1,182 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <ignite/common/java.h>
+
+#include "ignite/impl/interop/interop_memory.h"
+#include "ignite/ignite_error.h"
+
+using namespace ignite::common::java;
+
+namespace ignite
+{    
+    namespace impl
+    {
+        namespace interop 
+        {
+            int8_t* InteropMemory::Data(int8_t* memPtr)
+            {
+                return reinterpret_cast<int8_t*>(*reinterpret_cast<int64_t*>(memPtr));
+            }
+
+            void InteropMemory::Data(int8_t* memPtr, void* ptr)
+            {
+                *reinterpret_cast<int64_t*>(memPtr) = reinterpret_cast<int64_t>(ptr);
+            }
+
+            int32_t InteropMemory::Capacity(int8_t* memPtr)
+            {
+                return *reinterpret_cast<int32_t*>(memPtr + IGNITE_MEM_HDR_OFF_CAP);
+            }
+
+            void InteropMemory::Capacity(int8_t* memPtr, int32_t val)
+            {
+                *reinterpret_cast<int32_t*>(memPtr + IGNITE_MEM_HDR_OFF_CAP) = val;
+            }
+
+            int32_t InteropMemory::Length(int8_t* memPtr)
+            {
+                return *reinterpret_cast<int32_t*>(memPtr + IGNITE_MEM_HDR_OFF_LEN);
+            }
+
+            void InteropMemory::Length(int8_t* memPtr, int32_t val)
+            {
+                *reinterpret_cast<int32_t*>(memPtr + IGNITE_MEM_HDR_OFF_LEN) = val;
+            }
+
+            int32_t InteropMemory::Flags(int8_t* memPtr)
+            {
+                return *reinterpret_cast<int32_t*>(memPtr + IGNITE_MEM_HDR_OFF_FLAGS);
+            }
+
+            void InteropMemory::Flags(int8_t* memPtr, int32_t val)
+            {
+                *reinterpret_cast<int32_t*>(memPtr + IGNITE_MEM_HDR_OFF_FLAGS) = val;
+            }
+
+            bool InteropMemory::IsExternal(int8_t* memPtr)
+            {
+                return IsExternal(Flags(memPtr));
+            }
+
+            bool InteropMemory::IsExternal(int32_t flags)
+            {
+                return (flags & IGNITE_MEM_FLAG_EXT) != IGNITE_MEM_FLAG_EXT;
+            }
+
+            bool InteropMemory::IsPooled(int8_t* memPtr)
+            {
+                return IsPooled(Flags(memPtr));
+            }
+
+            bool InteropMemory::IsPooled(int32_t flags)
+            {
+                return (flags & IGNITE_MEM_FLAG_POOLED) != 0;
+            }
+
+            bool InteropMemory::IsAcquired(int8_t* memPtr)
+            {
+                return IsAcquired(Flags(memPtr));
+            }
+
+            bool InteropMemory::IsAcquired(int32_t flags)
+            {
+                return (flags & IGNITE_MEM_FLAG_ACQUIRED) != 0;
+            }
+                
+            int8_t* InteropMemory::Pointer()
+            {
+                return memPtr;
+            }
+
+            int64_t InteropMemory::PointerLong()
+            {
+                return reinterpret_cast<int64_t>(memPtr);
+            }
+
+            int8_t* InteropMemory::Data()
+            {
+                return Data(memPtr);
+            }
+
+            int32_t InteropMemory::Capacity()
+            {
+                return Capacity(memPtr);
+            }
+
+            int32_t InteropMemory::Length()
+            {
+                return Length(memPtr);
+            }
+
+            void InteropMemory::Length(int32_t val)
+            {
+                Length(memPtr, val);
+            }
+                
+            InteropUnpooledMemory::InteropUnpooledMemory(int32_t cap)
+            {
+                memPtr = static_cast<int8_t*>(malloc(IGNITE_MEM_HDR_LEN));
+                
+                Data(memPtr, malloc(cap));
+                Capacity(memPtr, cap);
+                Length(memPtr, 0);
+                Flags(memPtr, IGNITE_MEM_FLAG_EXT);
+
+                owning = true;
+            }
+
+            InteropUnpooledMemory::InteropUnpooledMemory(int8_t* memPtr)
+            {
+                this->memPtr = memPtr;
+                this->owning = false;
+            }
+
+            InteropUnpooledMemory::~InteropUnpooledMemory()
+            {
+                if (owning) {
+                    free(Data());
+                    free(memPtr);
+                }
+            }
+
+            void InteropUnpooledMemory::Reallocate(int32_t cap)
+            {
+                int doubledCap = Capacity() << 1;
+
+                if (doubledCap > cap)
+                    cap = doubledCap;
+
+                Data(memPtr, realloc(Data(memPtr), cap));
+                Capacity(memPtr, cap);
+            }
+
+            InteropExternalMemory::InteropExternalMemory(int8_t* memPtr) 
+            {
+                this->memPtr = memPtr;
+            }
+
+            void InteropExternalMemory::Reallocate(int32_t cap)
+            {
+                if (JniContext::Reallocate(reinterpret_cast<int64_t>(memPtr), cap) == -1) {
+                    IGNITE_ERROR_FORMATTED_2(IgniteError::IGNITE_ERR_MEMORY, "Failed to reallocate external memory", 
+                        "memPtr", PointerLong(), "requestedCapacity", cap)
+                }
+            }
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/core/src/impl/interop/interop_output_stream.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/core/src/impl/interop/interop_output_stream.cpp b/modules/platform/cpp/core/src/impl/interop/interop_output_stream.cpp
new file mode 100644
index 0000000..ecdfd42
--- /dev/null
+++ b/modules/platform/cpp/core/src/impl/interop/interop_output_stream.cpp
@@ -0,0 +1,215 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <cstring>
+
+#include "ignite/impl/interop/interop_output_stream.h"
+#include "ignite/ignite_error.h"
+
+/**
+ * Common macro to write a single value.
+ */
+#define IGNITE_INTEROP_OUT_WRITE(val, type, len) { \
+    EnsureCapacity(pos + len); \
+    *reinterpret_cast<type*>(data + pos) = val; \
+    Shift(len); \
+}
+
+/**
+ * Common macro to write an array.
+ */
+#define IGNITE_INTEROP_OUT_WRITE_ARRAY(val, len) { \
+    CopyAndShift(reinterpret_cast<const int8_t*>(val), 0, len); \
+}
+
+namespace ignite
+{
+    namespace impl
+    {
+        namespace interop 
+        {
+            union PortableFloatInt32
+            {
+                float f;
+                int32_t i;                
+            };
+
+            union PortableDoubleInt64
+            {
+                double d;
+                int64_t i;                
+            };
+
+            InteropOutputStream::InteropOutputStream(InteropMemory* mem)
+            {
+                this->mem = mem;
+
+                data = mem->Data();
+                cap = mem->Capacity();
+                pos = 0;
+            }
+
+            void InteropOutputStream::WriteInt8(const int8_t val)
+            {
+                IGNITE_INTEROP_OUT_WRITE(val, int8_t, 1);
+            }
+
+            void InteropOutputStream::WriteInt8(const int8_t val, const int32_t pos)
+            {
+                EnsureCapacity(pos + 1);
+
+                *(data + pos) = val;
+            }
+
+            void InteropOutputStream::WriteInt8Array(const int8_t* val, const int32_t len)
+            {
+                IGNITE_INTEROP_OUT_WRITE_ARRAY(val, len);
+            }
+
+            void InteropOutputStream::WriteBool(const bool val)
+            {
+                WriteInt8(val ? 1 : 0);
+            }
+
+            void InteropOutputStream::WriteBoolArray(const bool* val, const int32_t len)
+            {
+                for (int i = 0; i < len; i++)
+                    WriteBool(*(val + i));
+            }
+
+            void InteropOutputStream::WriteInt16(const int16_t val)
+            {
+                IGNITE_INTEROP_OUT_WRITE(val, int16_t, 2);
+            }
+
+            void InteropOutputStream::WriteInt16Array(const int16_t* val, const int32_t len)
+            {
+                IGNITE_INTEROP_OUT_WRITE_ARRAY(val, len << 1);
+            }
+
+            void InteropOutputStream::WriteUInt16(const uint16_t val)
+            {
+                IGNITE_INTEROP_OUT_WRITE(val, uint16_t, 2);
+            }
+
+            void InteropOutputStream::WriteUInt16Array(const uint16_t* val, const int32_t len)
+            {
+                IGNITE_INTEROP_OUT_WRITE_ARRAY(val, len << 1);
+            }
+
+            void InteropOutputStream::WriteInt32(const int32_t val)
+            {
+                IGNITE_INTEROP_OUT_WRITE(val, int32_t, 4);
+            }
+
+            void InteropOutputStream::WriteInt32(const int32_t pos, const int32_t val)
+            {
+                EnsureCapacity(pos + 4);
+
+                *reinterpret_cast<int32_t*>(data + pos) = val;
+            }
+
+            void InteropOutputStream::WriteInt32Array(const int32_t* val, const int32_t len)
+            {
+                IGNITE_INTEROP_OUT_WRITE_ARRAY(val, len << 2);
+            }
+
+            void InteropOutputStream::WriteInt64(const int64_t val)
+            {
+                IGNITE_INTEROP_OUT_WRITE(val, int64_t, 8);
+            }
+
+            void InteropOutputStream::WriteInt64Array(const int64_t* val, const int32_t len)
+            {
+                IGNITE_INTEROP_OUT_WRITE_ARRAY(val, len << 3);
+            }
+
+            void InteropOutputStream::WriteFloat(const float val)
+            {
+                PortableFloatInt32 u;
+
+                u.f = val;
+
+                WriteInt32(u.i);
+            }
+
+            void InteropOutputStream::WriteFloatArray(const float* val, const int32_t len)
+            {
+                for (int i = 0; i < len; i++)
+                    WriteFloat(*(val + i));
+            }
+
+            void InteropOutputStream::WriteDouble(const double val)
+            {
+                PortableDoubleInt64 u;
+
+                u.d = val;
+
+                WriteInt64(u.i);
+            }
+
+            void InteropOutputStream::WriteDoubleArray(const double* val, const int32_t len)
+            {
+                for (int i = 0; i < len; i++)
+                    WriteDouble(*(val + i));
+            }
+
+            int32_t InteropOutputStream::Position()
+            {
+                return pos;
+            }
+
+            void InteropOutputStream::Position(const int32_t val)
+            {
+                EnsureCapacity(val);
+
+                pos = val;
+            }
+
+            void InteropOutputStream::Synchronize()
+            {
+                mem->Length(pos);
+            }
+
+            void InteropOutputStream::EnsureCapacity(int32_t reqCap) {
+                if (reqCap > cap) {
+                    int newCap = cap << 1;
+
+                    if (newCap < reqCap)
+                        newCap = reqCap;
+
+                    mem->Reallocate(newCap);
+                    data = mem->Data();
+                    cap = newCap;
+                }
+            }
+
+            void InteropOutputStream::Shift(int32_t cnt) {
+                pos += cnt;
+            }
+
+            void InteropOutputStream::CopyAndShift(const int8_t* src, int32_t off, int32_t len) {
+                EnsureCapacity(pos + len);
+
+                memcpy(data + pos, src + off, len);
+
+                Shift(len);
+            }
+        }
+    }
+}
+

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/core/src/impl/portable/portable_metadata_handler.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/core/src/impl/portable/portable_metadata_handler.cpp b/modules/platform/cpp/core/src/impl/portable/portable_metadata_handler.cpp
new file mode 100644
index 0000000..5ca91dc
--- /dev/null
+++ b/modules/platform/cpp/core/src/impl/portable/portable_metadata_handler.cpp
@@ -0,0 +1,78 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "ignite/impl/portable/portable_metadata_handler.h"
+
+using namespace ignite::common::concurrent;
+
+namespace ignite
+{    
+    namespace impl
+    {
+        namespace portable
+        {
+            PortableMetadataHandler::PortableMetadataHandler(SPSnap snap) : snap(snap), fieldIds(NULL), fields(NULL)
+            {
+                // No-op.
+            }
+            
+            PortableMetadataHandler::~PortableMetadataHandler()
+            {
+                if (fieldIds)
+                    delete fieldIds;
+
+                if (fields)
+                    delete fields;
+            }
+
+            void PortableMetadataHandler::OnFieldWritten(int32_t fieldId, std::string fieldName, int32_t fieldTypeId)
+            {
+                if (!snap.Get() || !snap.Get()->ContainsFieldId(fieldId))
+                {
+                    if (!HasDifference())
+                    {
+                        fieldIds = new std::set<int32_t>();
+                        fields = new std::map<std::string, int32_t>();
+                    }
+
+                    fieldIds->insert(fieldId);
+                    (*fields)[fieldName] = fieldTypeId;
+                }
+            }
+
+            SPSnap PortableMetadataHandler::GetSnapshot()
+            {
+                return snap;
+            }
+
+            bool PortableMetadataHandler::HasDifference()
+            {
+                return fieldIds ? true : false;
+            }
+
+            std::set<int32_t>* PortableMetadataHandler::GetFieldIds()
+            {
+                return fieldIds;
+            }
+
+            std::map<std::string, int32_t>* PortableMetadataHandler::GetFields()
+            {
+                return fields;
+            }
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/core/src/impl/portable/portable_metadata_manager.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/core/src/impl/portable/portable_metadata_manager.cpp b/modules/platform/cpp/core/src/impl/portable/portable_metadata_manager.cpp
new file mode 100644
index 0000000..63e92a9
--- /dev/null
+++ b/modules/platform/cpp/core/src/impl/portable/portable_metadata_manager.cpp
@@ -0,0 +1,201 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <ignite/common/concurrent.h>
+
+#include "ignite/impl/portable/portable_metadata_manager.h"
+
+using namespace ignite::common::concurrent;
+
+namespace ignite
+{    
+    namespace impl
+    {
+        namespace portable
+        {
+            PortableMetadataManager::PortableMetadataManager() : 
+                snapshots(SharedPointer<std::map<int32_t, SPSnap>>(new std::map<int32_t, SPSnap>)),
+                pending(new std::vector<SPSnap>()), 
+                cs(new CriticalSection()), 
+                pendingVer(0), ver(0)
+            {
+                // No-op.
+            }
+
+            PortableMetadataManager::~PortableMetadataManager()
+            {
+                pending->erase(pending->begin(), pending->end());
+
+                delete pending;
+                delete cs;
+            }
+
+            SharedPointer<PortableMetadataHandler> PortableMetadataManager::GetHandler(int32_t typeId)
+            {
+                SharedPointer<std::map<int32_t, SPSnap>> snapshots0 = snapshots;
+
+                SPSnap snapshot = (*snapshots0.Get())[typeId];
+
+                return SharedPointer<PortableMetadataHandler>(new PortableMetadataHandler(snapshot));
+            }
+
+            void PortableMetadataManager::SubmitHandler(std::string typeName, int32_t typeId, 
+                PortableMetadataHandler* hnd)
+            {
+                Snap* snap = hnd->GetSnapshot().Get();
+
+                // If this is the very first write of a class or difference exists, 
+                // we need to enqueue it for write.
+                if (!snap || hnd->HasDifference())
+                {
+                    std::set<int32_t>* newFieldIds = new std::set<int32_t>();
+                    std::map<std::string, int32_t>* newFields = new std::map<std::string, int32_t>();
+                    
+                    CopyFields(snap, newFieldIds, newFields);
+
+                    if (hnd->HasDifference())
+                    {
+                        std::set<int32_t>* diffFieldIds = hnd->GetFieldIds();
+                        std::map<std::string, int32_t>* diffFields = hnd->GetFields();
+
+                        for (std::set<int32_t>::iterator it = diffFieldIds->begin(); it != diffFieldIds->end(); ++it)
+                            newFieldIds->insert(*it);
+
+                        for (std::map<std::string, int32_t>::iterator it = diffFields->begin(); it != diffFields->end(); ++it)
+                            (*newFields)[it->first] = it->second;
+                    }
+
+                    Snap* diffSnap = new Snap(typeName, typeId, newFieldIds, newFields);
+
+                    cs->Enter();
+
+                    pending->push_back(SPSnap(diffSnap));
+
+                    pendingVer++;
+
+                    cs->Leave();
+                }
+            }
+
+            int32_t PortableMetadataManager::GetVersion()
+            {
+                Memory::Fence();
+
+                return ver;
+            }
+
+            bool PortableMetadataManager::IsUpdatedSince(int32_t oldVer)
+            {
+                Memory::Fence();
+
+                return pendingVer > oldVer;
+            }
+
+            bool PortableMetadataManager::ProcessPendingUpdates(PortableMetadataUpdater* updater, IgniteError* err)
+            {
+                bool success = true; // Optimistically assume that all will be fine.
+                
+                cs->Enter();
+
+                for (std::vector<SPSnap>::iterator it = pending->begin(); it != pending->end(); ++it)
+                {
+                    Snap* pendingSnap = (*it).Get();
+
+                    if (updater->Update(pendingSnap, err))
+                    {
+                        // Perform copy-on-write update of snapshot collection.
+                        std::map<int32_t, SPSnap>* newSnapshots = new std::map<int32_t, SPSnap>();
+                        
+                        bool snapshotFound = false;
+
+                        for (std::map<int32_t, SPSnap>::iterator snapIt = snapshots.Get()->begin();
+                            snapIt != snapshots.Get()->end(); ++snapIt)
+                        {
+                            int32_t curTypeId = snapIt->first;
+                            Snap* curSnap = snapIt->second.Get();
+
+                            if (pendingSnap->GetTypeId() == curTypeId)
+                            {
+                                // Have to create snapshot with updated fields.
+                                std::set<int32_t>* newFieldIds = new std::set<int32_t>();
+                                std::map<std::string, int32_t>* newFields = new std::map<std::string, int32_t>();
+
+                                // Add old fields.
+                                CopyFields(curSnap, newFieldIds, newFields);
+
+                                // Add new fields.
+                                CopyFields(pendingSnap, newFieldIds, newFields);
+                                
+                                // Create new snapshot.
+                                Snap* newSnap = new Snap(pendingSnap->GetTypeName(), pendingSnap->GetTypeId(), 
+                                    newFieldIds, newFields);
+
+                                (*newSnapshots)[curTypeId] = SPSnap(newSnap);
+
+                                snapshotFound = true;
+                            }
+                            else 
+                                (*newSnapshots)[curTypeId] = snapIt->second; // Just transfer exising snapshot.
+                        }
+
+                        // Handle situation when completely new snapshot is found.
+                        if (!snapshotFound)
+                            (*newSnapshots)[pendingSnap->GetTypeId()] = *it;
+
+                        snapshots = SharedPointer<std::map<int32_t, SPSnap>>(newSnapshots);
+                    }
+                    else
+                    {
+                        // Stop as we cannot move further.
+                        success = false;
+
+                        break;
+                    }
+                }
+
+                if (success) 
+                {
+                    pending->erase(pending->begin(), pending->end());
+
+                    ver = pendingVer;
+                }
+
+                cs->Leave();
+
+                return success;
+            }
+
+            void PortableMetadataManager::CopyFields(Snap* snap, std::set<int32_t>* fieldIds, 
+                std::map<std::string, int32_t>* fields)
+            {
+                if (snap && snap->HasFields())
+                {
+                    std::set<int32_t>* snapFieldIds = snap->GetFieldIds();
+                    std::map<std::string, int32_t>* snapFields = snap->GetFields();
+
+                    for (std::set<int32_t>::iterator oldIt = snapFieldIds->begin();
+                        oldIt != snapFieldIds->end(); ++oldIt)
+                        fieldIds->insert(*oldIt);
+
+                    for (std::map<std::string, int32_t>::iterator newFieldsIt = snapFields->begin();
+                        newFieldsIt != snapFields->end(); ++newFieldsIt)
+                        (*fields)[newFieldsIt->first] = newFieldsIt->second;
+                }
+            }
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/core/src/impl/portable/portable_metadata_snapshot.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/core/src/impl/portable/portable_metadata_snapshot.cpp b/modules/platform/cpp/core/src/impl/portable/portable_metadata_snapshot.cpp
new file mode 100644
index 0000000..6ce5ab5
--- /dev/null
+++ b/modules/platform/cpp/core/src/impl/portable/portable_metadata_snapshot.cpp
@@ -0,0 +1,70 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "ignite/impl/portable/portable_metadata_snapshot.h"
+
+namespace ignite
+{    
+    namespace impl
+    {
+        namespace portable
+        {
+            PortableMetadataSnapshot::PortableMetadataSnapshot(std::string typeName, int32_t typeId, 
+                std::set<int32_t>* fieldIds, std::map<std::string, int32_t>* fields) : 
+                typeName(typeName), typeId(typeId), fieldIds(fieldIds), fields(fields)
+            {
+                // No-op.
+            }
+
+            PortableMetadataSnapshot::~PortableMetadataSnapshot()
+            {
+                delete fieldIds;
+                delete fields;
+            }
+
+            bool PortableMetadataSnapshot::ContainsFieldId(int32_t fieldId)
+            {
+                return fieldIds && fieldIds->count(fieldId) == 1;
+            }
+
+            std::string PortableMetadataSnapshot::GetTypeName()
+            {
+                return typeName;
+            }
+
+            int32_t PortableMetadataSnapshot::GetTypeId()
+            {
+                return typeId;
+            }
+
+            bool PortableMetadataSnapshot::HasFields()
+            {
+                return !fieldIds->empty();
+            }
+
+            std::set<int32_t>* PortableMetadataSnapshot::GetFieldIds()
+            {
+                return fieldIds;
+            }
+
+            std::map<std::string, int32_t>* PortableMetadataSnapshot::GetFields()
+            {
+                return fields;
+            }
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/core/src/impl/portable/portable_metadata_updater.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/core/src/impl/portable/portable_metadata_updater.cpp b/modules/platform/cpp/core/src/impl/portable/portable_metadata_updater.cpp
new file mode 100644
index 0000000..81c96d7
--- /dev/null
+++ b/modules/platform/cpp/core/src/impl/portable/portable_metadata_updater.cpp
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "ignite/impl/portable/portable_metadata_updater.h"
+
+namespace ignite
+{    
+    namespace impl
+    {
+        namespace portable
+        {
+            PortableMetadataUpdater::~PortableMetadataUpdater()
+            {
+                // No-op.
+            }
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/core/src/impl/portable/portable_metadata_updater_impl.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/core/src/impl/portable/portable_metadata_updater_impl.cpp b/modules/platform/cpp/core/src/impl/portable/portable_metadata_updater_impl.cpp
new file mode 100644
index 0000000..07a1758
--- /dev/null
+++ b/modules/platform/cpp/core/src/impl/portable/portable_metadata_updater_impl.cpp
@@ -0,0 +1,94 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "ignite/impl/portable/portable_metadata_updater_impl.h"
+#include "ignite/impl/interop/interop_output_stream.h"
+#include "ignite/impl/portable/portable_writer_impl.h"
+#include "ignite/portable/portable_raw_writer.h"
+
+using namespace ignite::common::concurrent;
+using namespace ignite::common::java;
+using namespace ignite::impl;
+using namespace ignite::impl::interop;
+using namespace ignite::portable;
+
+namespace ignite
+{    
+    namespace impl
+    {
+        namespace portable
+        {
+            /** Operation: Clear. */
+            const int32_t OP_METADATA = -1;
+
+            PortableMetadataUpdaterImpl::PortableMetadataUpdaterImpl(SharedPointer<IgniteEnvironment> env,
+                jobject javaRef) :  env(env), javaRef(javaRef)
+            {
+                // No-op.
+            }
+
+            PortableMetadataUpdaterImpl::~PortableMetadataUpdaterImpl()
+            {
+                // No-op.
+            }
+
+            bool PortableMetadataUpdaterImpl::Update(Snap* snap, IgniteError* err)
+            {
+                JniErrorInfo jniErr;
+
+                SharedPointer<InteropMemory> mem = env.Get()->AllocateMemory();
+
+                InteropOutputStream out(mem.Get());
+                PortableWriterImpl writer(&out, NULL);
+                PortableRawWriter rawWriter(&writer);
+
+                // We always pass only one meta at a time in current implementation for simplicity.
+                rawWriter.WriteInt32(1);
+
+                rawWriter.WriteInt32(snap->GetTypeId());
+                rawWriter.WriteString(snap->GetTypeName());
+                rawWriter.WriteString(NULL); // Affinity key is not supported for now.
+                
+                if (snap->HasFields())
+                {
+                    std::map<std::string, int32_t>* fields = snap->GetFields();
+
+                    rawWriter.WriteInt32(static_cast<int32_t>(fields->size()));
+
+                    for (std::map<std::string, int32_t>::iterator it = fields->begin(); it != fields->end(); ++it)
+                    {
+                        rawWriter.WriteString(it->first);
+                        rawWriter.WriteInt32(it->second);
+                    }
+                }
+                else
+                    rawWriter.WriteInt32(0);
+
+                out.Synchronize();
+
+                long long res = env.Get()->Context()->TargetInStreamOutLong(javaRef, OP_METADATA, mem.Get()->PointerLong(), &jniErr);
+
+                IgniteError::SetError(jniErr.code, jniErr.errCls, jniErr.errMsg, err);
+
+                if (jniErr.code == IGNITE_JNI_ERR_SUCCESS)
+                    return res == 1;
+                else
+                    return false;
+            }
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/core/src/impl/portable/portable_reader_impl.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/core/src/impl/portable/portable_reader_impl.cpp b/modules/platform/cpp/core/src/impl/portable/portable_reader_impl.cpp
new file mode 100644
index 0000000..753ec25
--- /dev/null
+++ b/modules/platform/cpp/core/src/impl/portable/portable_reader_impl.cpp
@@ -0,0 +1,683 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "ignite/impl/interop/interop.h"
+#include "ignite/impl/portable/portable_common.h"
+#include "ignite/impl/portable/portable_id_resolver.h"
+#include "ignite/impl/portable/portable_reader_impl.h"
+#include "ignite/impl/portable/portable_utils.h"
+#include "ignite/portable/portable_type.h"
+#include "ignite/ignite_error.h"
+
+using namespace ignite::impl::interop;
+using namespace ignite::impl::portable;
+using namespace ignite::portable;
+
+namespace ignite
+{
+    namespace impl
+    {
+        namespace portable
+        {
+            PortableReaderImpl::PortableReaderImpl(InteropInputStream* stream, PortableIdResolver* idRslvr,
+                int32_t pos, bool usrType, int32_t typeId, int32_t hashCode, int32_t len, int32_t rawOff) :
+                stream(stream), idRslvr(idRslvr), pos(pos), usrType(usrType), typeId(typeId), 
+                hashCode(hashCode), len(len), rawOff(rawOff), rawMode(false), 
+                elemIdGen(0), elemId(0), elemCnt(-1), elemRead(0)
+            {
+                // No-op.
+            }
+
+            PortableReaderImpl::PortableReaderImpl(InteropInputStream* stream) :
+                stream(stream), idRslvr(NULL), pos(0), usrType(false), typeId(0), hashCode(0), 
+                len(0), rawOff(0), rawMode(true),
+                elemIdGen(0), elemId(0), elemCnt(-1), elemRead(0)
+            {
+                // No-op.
+            }
+
+            int8_t PortableReaderImpl::ReadInt8()
+            {
+                return ReadRaw<int8_t>(PortableUtils::ReadInt8);                
+            }
+            
+            int32_t PortableReaderImpl::ReadInt8Array(int8_t* res, const int32_t len)
+            {
+                return ReadRawArray<int8_t>(res, len, PortableUtils::ReadInt8Array, IGNITE_TYPE_ARRAY_BYTE);
+            }
+
+            int8_t PortableReaderImpl::ReadInt8(const char* fieldName)
+            {
+                return Read(fieldName, PortableUtils::ReadInt8, IGNITE_TYPE_BYTE, static_cast<int8_t>(0));
+            }
+
+            int32_t PortableReaderImpl::ReadInt8Array(const char* fieldName, int8_t* res, const int32_t len)
+            {
+                return ReadArray<int8_t>(fieldName, res, len,PortableUtils::ReadInt8Array, IGNITE_TYPE_ARRAY_BYTE);
+            }
+
+            bool PortableReaderImpl::ReadBool()
+            {
+                return ReadRaw<bool>(PortableUtils::ReadBool);
+            }
+
+            int32_t PortableReaderImpl::ReadBoolArray(bool* res, const int32_t len)
+            {
+                return ReadRawArray<bool>(res, len, PortableUtils::ReadBoolArray, IGNITE_TYPE_ARRAY_BOOL);
+            }
+
+            bool PortableReaderImpl::ReadBool(const char* fieldName)
+            {
+                return Read(fieldName, PortableUtils::ReadBool, IGNITE_TYPE_BOOL, static_cast<bool>(0));
+            }
+
+            int32_t PortableReaderImpl::ReadBoolArray(const char* fieldName, bool* res, const int32_t len)
+            {
+                return ReadArray<bool>(fieldName, res, len,PortableUtils::ReadBoolArray, IGNITE_TYPE_ARRAY_BOOL);
+            }
+
+            int16_t PortableReaderImpl::ReadInt16()
+            {
+                return ReadRaw<int16_t>(PortableUtils::ReadInt16);
+            }
+
+            int32_t PortableReaderImpl::ReadInt16Array(int16_t* res, const int32_t len)
+            {
+                return ReadRawArray<int16_t>(res, len, PortableUtils::ReadInt16Array, IGNITE_TYPE_ARRAY_SHORT);
+            }
+
+            int16_t PortableReaderImpl::ReadInt16(const char* fieldName)
+            {
+                return Read(fieldName, PortableUtils::ReadInt16, IGNITE_TYPE_SHORT, static_cast<int16_t>(0));
+            }
+
+            int32_t PortableReaderImpl::ReadInt16Array(const char* fieldName, int16_t* res, const int32_t len)
+            {
+                return ReadArray<int16_t>(fieldName, res, len, PortableUtils::ReadInt16Array, IGNITE_TYPE_ARRAY_SHORT);
+            }
+
+            uint16_t PortableReaderImpl::ReadUInt16()
+            {
+                return ReadRaw<uint16_t>(PortableUtils::ReadUInt16);
+            }
+
+            int32_t PortableReaderImpl::ReadUInt16Array(uint16_t* res, const int32_t len)
+            {
+                return ReadRawArray<uint16_t>(res, len, PortableUtils::ReadUInt16Array, IGNITE_TYPE_ARRAY_CHAR);
+            }
+
+            uint16_t PortableReaderImpl::ReadUInt16(const char* fieldName)
+            {
+                return Read(fieldName, PortableUtils::ReadUInt16, IGNITE_TYPE_CHAR, static_cast<uint16_t>(0));
+            }
+
+            int32_t PortableReaderImpl::ReadUInt16Array(const char* fieldName, uint16_t* res, const int32_t len)
+            {
+                return ReadArray<uint16_t>(fieldName, res, len,PortableUtils::ReadUInt16Array, IGNITE_TYPE_ARRAY_CHAR);
+            }
+
+            int32_t PortableReaderImpl::ReadInt32()
+            {
+                return ReadRaw<int32_t>(PortableUtils::ReadInt32);
+            }
+
+            int32_t PortableReaderImpl::ReadInt32Array(int32_t* res, const int32_t len)
+            {
+                return ReadRawArray<int32_t>(res, len, PortableUtils::ReadInt32Array, IGNITE_TYPE_ARRAY_INT);
+            }
+
+            int32_t PortableReaderImpl::ReadInt32(const char* fieldName)
+            {
+                return Read(fieldName, PortableUtils::ReadInt32, IGNITE_TYPE_INT, static_cast<int32_t>(0));
+            }
+
+            int32_t PortableReaderImpl::ReadInt32Array(const char* fieldName, int32_t* res, const int32_t len)
+            {
+                return ReadArray<int32_t>(fieldName, res, len,PortableUtils::ReadInt32Array, IGNITE_TYPE_ARRAY_INT);
+            }
+
+            int64_t PortableReaderImpl::ReadInt64()
+            {
+                return ReadRaw<int64_t>(PortableUtils::ReadInt64);
+            }
+
+            int32_t PortableReaderImpl::ReadInt64Array(int64_t* res, const int32_t len)
+            {
+                return ReadRawArray<int64_t>(res, len, PortableUtils::ReadInt64Array, IGNITE_TYPE_ARRAY_LONG);
+            }
+
+            int64_t PortableReaderImpl::ReadInt64(const char* fieldName)
+            {
+                return Read(fieldName, PortableUtils::ReadInt64, IGNITE_TYPE_LONG, static_cast<int64_t>(0));
+            }
+
+            int32_t PortableReaderImpl::ReadInt64Array(const char* fieldName, int64_t* res, const int32_t len)
+            {
+                return ReadArray<int64_t>(fieldName, res, len,PortableUtils::ReadInt64Array, IGNITE_TYPE_ARRAY_LONG);
+            }
+
+            float PortableReaderImpl::ReadFloat()
+            {
+                return ReadRaw<float>(PortableUtils::ReadFloat);
+            }
+
+            int32_t PortableReaderImpl::ReadFloatArray(float* res, const int32_t len)
+            {
+                return ReadRawArray<float>(res, len, PortableUtils::ReadFloatArray, IGNITE_TYPE_ARRAY_FLOAT);
+            }
+
+            float PortableReaderImpl::ReadFloat(const char* fieldName)
+            {
+                return Read(fieldName, PortableUtils::ReadFloat, IGNITE_TYPE_FLOAT, static_cast<float>(0));
+            }
+
+            int32_t PortableReaderImpl::ReadFloatArray(const char* fieldName, float* res, const int32_t len)
+            {
+                return ReadArray<float>(fieldName, res, len,PortableUtils::ReadFloatArray, IGNITE_TYPE_ARRAY_FLOAT);
+            }
+
+            double PortableReaderImpl::ReadDouble()
+            {
+                return ReadRaw<double>(PortableUtils::ReadDouble);
+            }
+
+            int32_t PortableReaderImpl::ReadDoubleArray(double* res, const int32_t len)
+            {
+                return ReadRawArray<double>(res, len, PortableUtils::ReadDoubleArray, IGNITE_TYPE_ARRAY_DOUBLE);
+            }
+
+            double PortableReaderImpl::ReadDouble(const char* fieldName)
+            {
+                return Read(fieldName, PortableUtils::ReadDouble, IGNITE_TYPE_DOUBLE, static_cast<double>(0));
+            }
+
+            int32_t PortableReaderImpl::ReadDoubleArray(const char* fieldName, double* res, const int32_t len)
+            {
+                return ReadArray<double>(fieldName, res, len,PortableUtils::ReadDoubleArray, IGNITE_TYPE_ARRAY_DOUBLE);
+            }
+
+            Guid PortableReaderImpl::ReadGuid()
+            {
+                CheckRawMode(true);
+                CheckSingleMode(true);
+
+                return ReadNullable(stream, PortableUtils::ReadGuid, IGNITE_TYPE_UUID);
+            }
+
+            int32_t PortableReaderImpl::ReadGuidArray(Guid* res, const int32_t len)
+            {
+                CheckRawMode(true);
+                CheckSingleMode(true);
+
+                return ReadArrayInternal<Guid>(res, len, stream, ReadGuidArrayInternal, IGNITE_TYPE_ARRAY_UUID);
+            }
+
+            Guid PortableReaderImpl::ReadGuid(const char* fieldName)
+            {
+                CheckRawMode(false);
+                CheckSingleMode(true);
+
+                int32_t fieldId = idRslvr->GetFieldId(typeId, fieldName);
+                int32_t fieldLen = SeekField(fieldId);
+
+                if (fieldLen > 0)
+                    return ReadNullable(stream, PortableUtils::ReadGuid, IGNITE_TYPE_UUID);
+
+                return Guid();
+            }
+
+            int32_t PortableReaderImpl::ReadGuidArray(const char* fieldName, Guid* res, const int32_t len)
+            {
+                CheckRawMode(false);
+                CheckSingleMode(true);
+
+                int32_t pos = stream->Position();
+
+                int32_t fieldId = idRslvr->GetFieldId(typeId, fieldName);
+                int32_t fieldLen = SeekField(fieldId);
+
+                if (fieldLen > 0) {
+                    int32_t realLen = ReadArrayInternal<Guid>(res, len, stream, ReadGuidArrayInternal, IGNITE_TYPE_ARRAY_UUID);
+
+                    // If actual read didn't occur return to initial position so that we do not perform 
+                    // N jumps to find the field again, where N is total amount of fields.
+                    if (realLen != -1 && (!res || realLen > len))
+                        stream->Position(pos);
+
+                    return realLen;
+                }
+
+                return -1;
+            }
+
+            void PortableReaderImpl::ReadGuidArrayInternal(InteropInputStream* stream, Guid* res, const int32_t len)
+            {
+                for (int i = 0; i < len; i++)
+                    *(res + i) = ReadNullable<Guid>(stream, PortableUtils::ReadGuid, IGNITE_TYPE_UUID);
+            }
+
+            int32_t PortableReaderImpl::ReadString(char* res, const int32_t len)
+            {
+                CheckRawMode(true);
+                CheckSingleMode(true);
+
+                return ReadStringInternal(res, len);
+            }
+
+            int32_t PortableReaderImpl::ReadString(const char* fieldName, char* res, const int32_t len)
+            {
+                CheckRawMode(false);
+                CheckSingleMode(true);
+
+                int32_t pos = stream->Position();
+                
+                int32_t fieldId = idRslvr->GetFieldId(typeId, fieldName);
+                int32_t fieldLen = SeekField(fieldId);
+
+                if (fieldLen > 0) {
+                    int32_t realLen = ReadStringInternal(res, len);
+
+                    // If actual read didn't occur return to initial position so that we do not perform 
+                    // N jumps to find the field again, where N is total amount of fields.
+                    if (realLen != -1 && (!res || realLen > len))
+                        stream->Position(pos);
+
+                    return realLen;
+                }
+
+                return -1;
+            }
+
+            int32_t PortableReaderImpl::ReadStringArray(int32_t* size)
+            {
+                return StartContainerSession(true, IGNITE_TYPE_ARRAY_STRING, size);
+            }
+
+            int32_t PortableReaderImpl::ReadStringArray(const char* fieldName, int32_t* size)
+            {
+                CheckRawMode(false);
+                CheckSingleMode(true);
+
+                int32_t fieldId = idRslvr->GetFieldId(typeId, fieldName);
+                int32_t fieldLen = SeekField(fieldId);
+
+                if (fieldLen > 0)
+                    return StartContainerSession(false, IGNITE_TYPE_ARRAY_STRING, size);
+                else {
+                    *size = -1;
+
+                    return ++elemIdGen;
+                }
+            }
+
+            int32_t PortableReaderImpl::ReadStringElement(int32_t id, char* res, const int32_t len)
+            {
+                CheckSession(id);
+
+                int32_t posBefore = stream->Position();
+
+                int32_t realLen = ReadStringInternal(res, len);
+
+                int32_t posAfter = stream->Position();
+
+                if (posAfter > posBefore && ++elemRead == elemCnt) {
+                    elemId = 0;
+                    elemCnt = -1;
+                    elemRead = 0;
+                }
+
+                return realLen;
+            }
+
+            int32_t PortableReaderImpl::ReadStringInternal(char* res, const int32_t len)
+            {
+                int8_t hdr = stream->ReadInt8();
+
+                if (hdr == IGNITE_TYPE_STRING) {
+                    bool utf8Mode = stream->ReadBool();
+                    int32_t realLen = stream->ReadInt32();
+
+                    if (res && len >= realLen) {
+                        if (utf8Mode)
+                        {
+                            for (int i = 0; i < realLen; i++)
+                                *(res + i) = static_cast<char>(stream->ReadInt8());
+                        }
+                        else
+                        {
+                            for (int i = 0; i < realLen; i++)
+                                *(res + i) = static_cast<char>(stream->ReadUInt16());
+                        }
+
+                        if (len > realLen)
+                            *(res + realLen) = 0; // Set NULL terminator if possible.
+                    }
+                    else
+                        stream->Position(stream->Position() - 6);
+
+                    return realLen;
+                }
+                else if (hdr != IGNITE_HDR_NULL)
+                    ThrowOnInvalidHeader(IGNITE_TYPE_ARRAY, hdr);
+
+                return -1;
+            }
+
+            int32_t PortableReaderImpl::ReadArray(int32_t* size)
+            {
+                return StartContainerSession(true, IGNITE_TYPE_ARRAY, size);
+            }
+
+            int32_t PortableReaderImpl::ReadArray(const char* fieldName, int32_t* size)
+            {
+                CheckRawMode(false);
+                CheckSingleMode(true);
+
+                int32_t fieldId = idRslvr->GetFieldId(typeId, fieldName);
+                int32_t fieldLen = SeekField(fieldId);
+
+                if (fieldLen > 0)
+                    return StartContainerSession(false, IGNITE_TYPE_ARRAY, size);
+                else {
+                    *size = -1;
+
+                    return ++elemIdGen;
+                }
+            }
+
+            int32_t PortableReaderImpl::ReadCollection(CollectionType* typ, int32_t* size)
+            {
+                int32_t id = StartContainerSession(true, IGNITE_TYPE_COLLECTION, size);
+
+                if (*size == -1)
+                    *typ = IGNITE_COLLECTION_UNDEFINED;
+                else
+                    *typ = static_cast<CollectionType>(stream->ReadInt8());
+
+                return id;
+            }
+
+            int32_t PortableReaderImpl::ReadCollection(const char* fieldName, CollectionType* typ, int32_t* size)
+            {
+                CheckRawMode(false);
+                CheckSingleMode(true);
+
+                int32_t fieldId = idRslvr->GetFieldId(typeId, fieldName);
+                int32_t fieldLen = SeekField(fieldId);
+
+                if (fieldLen > 0)
+                {
+                    int32_t id = StartContainerSession(false, IGNITE_TYPE_COLLECTION, size);
+
+                    if (*size == -1)
+                        *typ = IGNITE_COLLECTION_UNDEFINED;
+                    else
+                        *typ = static_cast<CollectionType>(stream->ReadInt8());
+
+                    return id;
+                }                    
+                else {
+                    *typ = IGNITE_COLLECTION_UNDEFINED;
+                    *size = -1;
+
+                    return ++elemIdGen;
+                }
+            }
+
+            int32_t PortableReaderImpl::ReadMap(MapType* typ, int32_t* size)
+            {
+                int32_t id = StartContainerSession(true, IGNITE_TYPE_MAP, size);
+
+                if (*size == -1)
+                    *typ = IGNITE_MAP_UNDEFINED;
+                else
+                    *typ = static_cast<MapType>(stream->ReadInt8());
+
+                return id;
+            }
+
+            int32_t PortableReaderImpl::ReadMap(const char* fieldName, MapType* typ, int32_t* size)
+            {
+                CheckRawMode(false);
+                CheckSingleMode(true);
+
+                int32_t fieldId = idRslvr->GetFieldId(typeId, fieldName);
+                int32_t fieldLen = SeekField(fieldId);
+
+                if (fieldLen > 0)
+                {
+                    int32_t id = StartContainerSession(false, IGNITE_TYPE_MAP, size);
+
+                    if (*size == -1)
+                        *typ = IGNITE_MAP_UNDEFINED;
+                    else
+                        *typ = static_cast<MapType>(stream->ReadInt8());
+
+                    return id;
+                }
+                else {
+                    *typ = IGNITE_MAP_UNDEFINED;
+                    *size = -1;
+
+                    return ++elemIdGen;
+                }
+            }
+
+            bool PortableReaderImpl::HasNextElement(int32_t id)
+            {
+                return elemId == id && elemRead < elemCnt;
+            }
+
+            void PortableReaderImpl::SetRawMode()
+            {
+                CheckRawMode(false);
+                CheckSingleMode(true);
+
+                stream->Position(pos + rawOff);
+                rawMode = true;
+            }
+
+            template <>
+            int8_t PortableReaderImpl::ReadTopObject<int8_t>()
+            {
+                return ReadTopObject0(IGNITE_TYPE_BYTE, PortableUtils::ReadInt8, static_cast<int8_t>(0));
+            }
+
+            template <>
+            bool PortableReaderImpl::ReadTopObject<bool>()
+            {
+                return ReadTopObject0(IGNITE_TYPE_BOOL, PortableUtils::ReadBool, static_cast<bool>(0));
+            }
+
+            template <>
+            int16_t PortableReaderImpl::ReadTopObject<int16_t>()
+            {
+                return ReadTopObject0(IGNITE_TYPE_SHORT, PortableUtils::ReadInt16, static_cast<int16_t>(0));
+            }
+
+            template <>
+            uint16_t PortableReaderImpl::ReadTopObject<uint16_t>()
+            {
+                return ReadTopObject0(IGNITE_TYPE_CHAR, PortableUtils::ReadUInt16, static_cast<uint16_t>(0));
+            }
+
+            template <>
+            int32_t PortableReaderImpl::ReadTopObject<int32_t>()
+            {
+                return ReadTopObject0(IGNITE_TYPE_INT, PortableUtils::ReadInt32, static_cast<int32_t>(0));
+            }
+
+            template <>
+            int64_t PortableReaderImpl::ReadTopObject<int64_t>()
+            {
+                return ReadTopObject0(IGNITE_TYPE_LONG, PortableUtils::ReadInt64, static_cast<int64_t>(0));
+            }
+
+            template <>
+            float PortableReaderImpl::ReadTopObject<float>()
+            {
+                return ReadTopObject0(IGNITE_TYPE_FLOAT, PortableUtils::ReadFloat, static_cast<float>(0));
+            }
+
+            template <>
+            double PortableReaderImpl::ReadTopObject<double>()
+            {
+                return ReadTopObject0(IGNITE_TYPE_DOUBLE, PortableUtils::ReadDouble, static_cast<double>(0));
+            }
+
+            template <>
+            Guid PortableReaderImpl::ReadTopObject<Guid>()
+            {
+                int8_t typeId = stream->ReadInt8();
+
+                if (typeId == IGNITE_TYPE_UUID)
+                    return PortableUtils::ReadGuid(stream);
+                else if (typeId == IGNITE_HDR_NULL)
+                    return Guid();
+                else {
+                    int32_t pos = stream->Position() - 1;
+
+                    IGNITE_ERROR_FORMATTED_3(IgniteError::IGNITE_ERR_PORTABLE, "Invalid header", "position", pos, "expected", IGNITE_TYPE_UUID, "actual", typeId)
+                }
+            }
+
+            InteropInputStream* PortableReaderImpl::GetStream()
+            {
+                return stream;
+            }
+
+            int32_t PortableReaderImpl::SeekField(const int32_t fieldId)
+            {
+                // We assume that it is very likely that fields are read in the same
+                // order as they were initially written. So we start seeking field
+                // from current stream position making a "loop" up to this position.
+                int32_t marker = stream->Position();
+
+                for (int32_t curPos = marker; curPos < pos + rawOff;)
+                {
+                    int32_t curFieldId = stream->ReadInt32();
+                    int32_t curFieldLen = stream->ReadInt32();
+
+                    if (fieldId == curFieldId)
+                        return curFieldLen;
+                    else {
+                        curPos = stream->Position() + curFieldLen;
+
+                        stream->Position(curPos);
+                    }
+                }
+
+                stream->Position(pos + IGNITE_FULL_HDR_LEN);
+
+                for (int32_t curPos = stream->Position(); curPos < marker;)
+                {
+                    int32_t curFieldId = stream->ReadInt32();
+                    int32_t curFieldLen = stream->ReadInt32();
+
+                    if (fieldId == curFieldId)
+                        return curFieldLen;
+                    else {
+                        curPos = stream->Position() + curFieldLen;
+
+                        stream->Position(curPos);
+                    }
+                }
+
+                return -1;
+            }
+
+            void PortableReaderImpl::CheckRawMode(bool expected)
+            {
+                if (expected && !rawMode) {
+                    IGNITE_ERROR_1(IgniteError::IGNITE_ERR_PORTABLE, "Operation can be performed only in raw mode.")
+                }
+                else if (!expected && rawMode) {
+                    IGNITE_ERROR_1(IgniteError::IGNITE_ERR_PORTABLE, "Operation cannot be performed in raw mode.")
+                }
+            }
+
+            void PortableReaderImpl::CheckSingleMode(bool expected)
+            {
+                if (expected && elemId != 0) {
+                    IGNITE_ERROR_1(IgniteError::IGNITE_ERR_PORTABLE, "Operation cannot be performed when container is being read.");
+                }
+                else if (!expected && elemId == 0) {
+                    IGNITE_ERROR_1(IgniteError::IGNITE_ERR_PORTABLE, "Operation can be performed only when container is being read.");
+                }
+            }
+
+            int32_t PortableReaderImpl::StartContainerSession(bool expRawMode, int8_t expHdr, int32_t* size)
+            {
+                CheckRawMode(expRawMode);
+                CheckSingleMode(true);
+
+                int8_t hdr = stream->ReadInt8();
+
+                if (hdr == expHdr)
+                {
+                    int32_t cnt = stream->ReadInt32();
+
+                    if (cnt != 0) 
+                    {
+                        elemId = ++elemIdGen;
+                        elemCnt = cnt;
+                        elemRead = 0;
+
+                        *size = cnt;
+
+                        return elemId;
+                    }
+                    else
+                    {
+                        *size = 0;
+
+                        return ++elemIdGen;
+                    }
+                }
+                else if (hdr == IGNITE_HDR_NULL) {
+                    *size = -1;
+
+                    return ++elemIdGen;
+                }
+                else {
+                    ThrowOnInvalidHeader(expHdr, hdr);
+
+                    return 0;
+                }
+            }
+
+            void PortableReaderImpl::CheckSession(int32_t expSes)
+            {
+                if (elemId != expSes) {
+                    IGNITE_ERROR_1(IgniteError::IGNITE_ERR_PORTABLE, "Containter read session has been finished or is not started yet.");
+                }
+            }
+
+            void PortableReaderImpl::ThrowOnInvalidHeader(int32_t pos, int8_t expHdr, int8_t hdr)
+            {
+                IGNITE_ERROR_FORMATTED_3(IgniteError::IGNITE_ERR_PORTABLE, "Invalid header", "position", pos, "expected", expHdr, "actual", hdr)
+            }
+
+            void PortableReaderImpl::ThrowOnInvalidHeader(int8_t expHdr, int8_t hdr)
+            {
+                int32_t pos = stream->Position() - 1;
+
+                ThrowOnInvalidHeader(pos, expHdr, hdr);
+            }
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/core/src/impl/portable/portable_utils.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/core/src/impl/portable/portable_utils.cpp b/modules/platform/cpp/core/src/impl/portable/portable_utils.cpp
new file mode 100644
index 0000000..2f9c259
--- /dev/null
+++ b/modules/platform/cpp/core/src/impl/portable/portable_utils.cpp
@@ -0,0 +1,214 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "ignite/impl/interop/interop.h"
+#include "ignite/impl/portable/portable_utils.h"
+
+using namespace ignite::impl::interop;
+using namespace ignite::impl::portable;
+
+namespace ignite
+{
+    namespace impl
+    {
+        namespace portable
+        {
+            int8_t PortableUtils::ReadInt8(InteropInputStream* stream)
+            {
+                return stream->ReadInt8();
+            }
+
+            void PortableUtils::WriteInt8(InteropOutputStream* stream, int8_t val)
+            {
+                stream->WriteInt8(val); 
+            }
+
+            void PortableUtils::ReadInt8Array(InteropInputStream* stream, int8_t* res, const int32_t len)
+            {
+                stream->ReadInt8Array(res, len);
+            }
+
+            void PortableUtils::WriteInt8Array(InteropOutputStream* stream, const int8_t* val, const int32_t len)
+            {
+                stream->WriteInt8Array(val, len);
+            }
+
+            bool PortableUtils::ReadBool(InteropInputStream* stream)
+            {
+                return stream->ReadBool();
+            }
+
+            void PortableUtils::WriteBool(InteropOutputStream* stream, bool val)
+            {
+                stream->WriteBool(val);
+            }
+
+            void PortableUtils::ReadBoolArray(InteropInputStream* stream, bool* res, const int32_t len)
+            {
+                stream->ReadBoolArray(res, len);
+            }
+
+            void PortableUtils::WriteBoolArray(InteropOutputStream* stream, const bool* val, const int32_t len)
+            {
+                stream->WriteBoolArray(val, len);
+            }
+
+            int16_t PortableUtils::ReadInt16(InteropInputStream* stream)
+            {
+                return stream->ReadInt16();
+            }
+
+            void PortableUtils::WriteInt16(InteropOutputStream* stream, int16_t val)
+            {
+                stream->WriteInt16(val);
+            }
+
+            void PortableUtils::ReadInt16Array(InteropInputStream* stream, int16_t* res, const int32_t len)
+            {
+                stream->ReadInt16Array(res, len);
+            }
+            
+            void PortableUtils::WriteInt16Array(InteropOutputStream* stream, const int16_t* val, const int32_t len)
+            {
+                stream->WriteInt16Array(val, len);
+            }
+
+            uint16_t PortableUtils::ReadUInt16(InteropInputStream* stream)
+            {
+                return stream->ReadUInt16();
+            }
+
+            void PortableUtils::WriteUInt16(InteropOutputStream* stream, uint16_t val)
+            {
+                stream->WriteUInt16(val);
+            }
+
+            void PortableUtils::ReadUInt16Array(InteropInputStream* stream, uint16_t* res, const int32_t len)
+            {
+                stream->ReadUInt16Array(res, len);
+            }
+
+            void PortableUtils::WriteUInt16Array(InteropOutputStream* stream, const uint16_t* val, const int32_t len)
+            {
+                stream->WriteUInt16Array(val, len);
+            }
+
+            int32_t PortableUtils::ReadInt32(InteropInputStream* stream)
+            {
+                return stream->ReadInt32();
+            }
+
+            void PortableUtils::WriteInt32(InteropOutputStream* stream, int32_t val)
+            {
+                stream->WriteInt32(val);
+            }
+
+            void PortableUtils::ReadInt32Array(InteropInputStream* stream, int32_t* res, const int32_t len)
+            {
+                stream->ReadInt32Array(res, len);
+            }
+
+            void PortableUtils::WriteInt32Array(InteropOutputStream* stream, const int32_t* val, const int32_t len)
+            {
+                stream->WriteInt32Array(val, len);
+            }
+
+            int64_t PortableUtils::ReadInt64(InteropInputStream* stream)
+            {
+                return stream->ReadInt64();
+            }
+
+            void PortableUtils::WriteInt64(InteropOutputStream* stream, int64_t val)
+            {
+                stream->WriteInt64(val);
+            }
+
+            void PortableUtils::ReadInt64Array(InteropInputStream* stream, int64_t* res, const int32_t len)
+            {
+                stream->ReadInt64Array(res, len);
+            }
+
+            void PortableUtils::WriteInt64Array(InteropOutputStream* stream, const int64_t* val, const int32_t len)
+            {
+                stream->WriteInt64Array(val, len);
+            }
+
+            float PortableUtils::ReadFloat(InteropInputStream* stream)
+            {
+                return stream->ReadFloat();
+            }
+
+            void PortableUtils::WriteFloat(InteropOutputStream* stream, float val)
+            {
+                stream->WriteFloat(val);
+            }
+
+            void PortableUtils::ReadFloatArray(InteropInputStream* stream, float* res, const int32_t len)
+            {
+                stream->ReadFloatArray(res, len);
+            }
+
+            void PortableUtils::WriteFloatArray(InteropOutputStream* stream, const float* val, const int32_t len)
+            {
+                stream->WriteFloatArray(val, len);
+            }
+
+            double PortableUtils::ReadDouble(InteropInputStream* stream)
+            {
+                return stream->ReadDouble();
+            }
+
+            void PortableUtils::WriteDouble(InteropOutputStream* stream, double val)
+            {
+                stream->WriteDouble(val);
+            }
+
+            void PortableUtils::ReadDoubleArray(InteropInputStream* stream, double* res, const int32_t len)
+            {
+                stream->ReadDoubleArray(res, len);
+            }
+
+            void PortableUtils::WriteDoubleArray(InteropOutputStream* stream, const double* val, const int32_t len)
+            {
+                stream->WriteDoubleArray(val, len);
+            }
+
+            Guid PortableUtils::ReadGuid(interop::InteropInputStream* stream)
+            {
+                int64_t most = stream->ReadInt64();
+                int64_t least = stream->ReadInt64();
+
+                return Guid(most, least);
+            }
+
+            void PortableUtils::WriteGuid(interop::InteropOutputStream* stream, const Guid val)
+            {
+                stream->WriteInt64(val.GetMostSignificantBits());
+                stream->WriteInt64(val.GetLeastSignificantBits());
+            }
+
+            void PortableUtils::WriteString(interop::InteropOutputStream* stream, const char* val, const int32_t len)
+            {
+                stream->WriteBool(false);
+                stream->WriteInt32(len);
+
+                for (int i = 0; i < len; i++)
+                    stream->WriteUInt16(*(val + i));
+            }
+        }
+    }
+}
\ No newline at end of file


[06/28] ignite git commit: IGNITE-1513: Moved CPP.

Posted by vo...@apache.org.
http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/core/include/ignite/impl/operations.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/ignite/impl/operations.h b/modules/platform/src/main/cpp/core/include/ignite/impl/operations.h
deleted file mode 100644
index 8f32922..0000000
--- a/modules/platform/src/main/cpp/core/include/ignite/impl/operations.h
+++ /dev/null
@@ -1,452 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef _IGNITE_IMPL_OPERATION
-#define _IGNITE_IMPL_OPERATION
-
-#include <map>
-#include <set>
-#include <vector>
-
-#include <ignite/common/common.h>
-
-#include "ignite/cache/cache_entry.h"
-#include "ignite/impl/portable/portable_reader_impl.h"
-#include "ignite/impl/portable/portable_writer_impl.h"
-#include "ignite/portable/portable.h"
-
-namespace ignite
-{
-    namespace impl
-    {
-        /**
-         * Input operation.
-         */
-        class InputOperation
-        {
-        public:
-            /**
-             * Destructor.
-             */
-            virtual ~InputOperation()
-            {
-                // No-op.
-            }
-
-            /**
-             * Process input.
-             *
-             * @param writer Writer.
-             */
-            virtual void ProcessInput(ignite::impl::portable::PortableWriterImpl& writer) = 0;
-        };
-
-        /**
-         * Input operation accepting a single argument.
-         */
-        template<typename T>
-        class In1Operation : public InputOperation
-        {
-        public:
-            /**
-             * Constructor.
-             * 
-             * @param val Value.
-             */
-            In1Operation(const T* val) : val(val)
-            {
-                // No-op.
-            }
-
-            virtual void ProcessInput(ignite::impl::portable::PortableWriterImpl& writer)
-            {
-                writer.WriteTopObject<T>(*val);
-            }
-        private:
-            /** Value. */
-            const T* val; 
-
-            IGNITE_NO_COPY_ASSIGNMENT(In1Operation)
-        };
-
-        /**
-         * Input operation accepting two single objects.
-         */
-        template<typename T1, typename T2>
-        class In2Operation : public InputOperation
-        {
-        public:
-            /**
-             * Constructor.
-             *
-             * @param val1 First value.
-             * @param val2 Second value.
-             */
-            In2Operation(const T1* val1, const T2* val2) : val1(val1), val2(val2)
-            {
-                // No-op.
-            }
-
-            virtual void ProcessInput(ignite::impl::portable::PortableWriterImpl& writer)
-            {
-                writer.WriteTopObject<T1>(*val1);
-                writer.WriteTopObject<T2>(*val2);
-            }
-        private:
-            /** First value. */
-            const T1* val1; 
-
-            /** Second value. */
-            const T2* val2; 
-
-            IGNITE_NO_COPY_ASSIGNMENT(In2Operation)
-        };
-
-        /**
-         * Input operation accepting three single objects.
-         */
-        template<typename T1, typename T2, typename T3>
-        class In3Operation : public InputOperation
-        {
-        public:
-            /**
-             * Constructor.
-             *
-             * @param val1 First value.
-             * @param val2 Second value.
-             * @param val3 Third value.
-             */
-            In3Operation(const T1* val1, const T2* val2, const T3* val3) : val1(val1), val2(val2), val3(val3)
-            {
-                // No-op.
-            }
-
-            virtual void ProcessInput(ignite::impl::portable::PortableWriterImpl& writer)
-            {
-                writer.WriteTopObject<T1>(*val1);
-                writer.WriteTopObject<T2>(*val2);
-                writer.WriteTopObject<T3>(*val3);
-            }
-        private:
-            /** First value. */
-            const T1* val1;
-
-            /** Second value. */
-            const T2* val2;
-
-            /** Third value. */
-            const T3* val3;
-
-            IGNITE_NO_COPY_ASSIGNMENT(In3Operation)
-        };
-
-        /*
-         * Input set operation.
-         */
-        template<typename T>
-        class InSetOperation : public InputOperation
-        {
-        public:
-            /**
-             * Constructor.
-             *
-             * @param val Value.
-             */
-            InSetOperation(const std::set<T>* val) : val(val)
-            {
-                // No-op.
-            }
-
-            virtual void ProcessInput(ignite::impl::portable::PortableWriterImpl& writer)
-            {
-                writer.GetStream()->WriteInt32(static_cast<int32_t>(val->size()));
-
-                for (typename std::set<T>::const_iterator it = val->begin(); it != val->end(); ++it)
-                    writer.WriteTopObject<T>(*it);
-            }
-        private:
-            /** Value. */
-            const std::set<T>* val; 
-
-            IGNITE_NO_COPY_ASSIGNMENT(InSetOperation)
-        };
-
-        /**
-         * Input map operation.
-         */
-        template<typename K, typename V>
-        class InMapOperation : public InputOperation
-        {
-        public:
-            /*
-             * Constructor.
-             *
-             * @param val Value.
-             */
-            InMapOperation(const std::map<K, V>* val) : val(val)
-            {
-                // No-op.
-            }
-
-            virtual void ProcessInput(ignite::impl::portable::PortableWriterImpl& writer)
-            {
-                writer.GetStream()->WriteInt32(static_cast<int32_t>(val->size()));
-
-                for (typename std::map<K, V>::const_iterator it = val->begin(); it != val->end(); ++it) {
-                    writer.WriteTopObject<K>(it->first);
-                    writer.WriteTopObject<V>(it->second);
-                }
-            }
-        private:
-            /** Value. */
-            const std::map<K, V>* val; 
-
-            IGNITE_NO_COPY_ASSIGNMENT(InMapOperation)
-        };
-
-        /**
-         * Cache LocalPeek input operation.
-         */
-        template<typename T>
-        class InCacheLocalPeekOperation : public InputOperation
-        {
-        public:
-            /**
-             * Constructor.
-             *
-             * @param key Key.
-             * @param peekModes Peek modes.
-             */
-            InCacheLocalPeekOperation(const T* key, int32_t peekModes) : key(key), peekModes(peekModes)
-            {
-                // No-op.
-            }
-
-            virtual void ProcessInput(ignite::impl::portable::PortableWriterImpl& writer)
-            {
-                writer.WriteTopObject<T>(*key);
-                writer.GetStream()->WriteInt32(peekModes);
-            }
-        private:
-            /** Key. */
-            const T* key;   
-
-            /** Peek modes. */
-            int32_t peekModes; 
-
-            IGNITE_NO_COPY_ASSIGNMENT(InCacheLocalPeekOperation)
-        };
-
-        /**
-         * Output operation.
-         */
-        class OutputOperation
-        {
-        public:
-            /**
-             * Destructor.
-             */
-            virtual ~OutputOperation()
-            {
-                // No-op.
-            }
-
-            /**
-             * Process output.
-             *
-             * @param reader Reader.
-             */
-            virtual void ProcessOutput(ignite::impl::portable::PortableReaderImpl& reader) = 0;
-        };
-
-        /**
-         * Output operation returning single object.
-         */
-        template<typename T>
-        class Out1Operation : public OutputOperation
-        {
-        public:
-            /**
-             * Constructor.
-             */
-            Out1Operation()
-            {
-                // No-op.
-            }
-
-            virtual void ProcessOutput(ignite::impl::portable::PortableReaderImpl& reader)
-            {
-                val = reader.ReadTopObject<T>();
-            }
-
-            /**
-             * Get value.
-             *
-             * @param Value.
-             */
-            T GetResult()
-            {
-                return val;
-            }
-        private:
-            /** Value. */
-            T val; 
-
-            IGNITE_NO_COPY_ASSIGNMENT(Out1Operation)
-        };
-
-        /**
-         * Output operation returning single object.
-         */
-        template<typename T1, typename T2>
-        class Out2Operation : public OutputOperation
-        {
-        public:
-            /**
-             * Constructor.
-             */
-            Out2Operation()
-            {
-                // No-op.
-            }
-
-            virtual void ProcessOutput(ignite::impl::portable::PortableReaderImpl& reader)
-            {
-                val1 = reader.ReadTopObject<T1>();
-                val2 = reader.ReadTopObject<T2>();
-            }
-
-            /**
-             * Get value 1.
-             *
-             * @param Value 1.
-             */
-            T1& Get1()
-            {
-                return val1;
-            }
-
-            /**
-             * Get value 2.
-             *
-             * @param Value 2.
-             */
-            T2& Get2()
-            {
-                return val2;
-            }
-
-        private:
-            /** Value 1. */
-            T1 val1; 
-            
-            /** Value 2. */
-            T2 val2; 
-
-            IGNITE_NO_COPY_ASSIGNMENT(Out2Operation)
-        };
-        
-        /*
-         * Output map operation.
-         */
-        template<typename T1, typename T2>
-        class OutMapOperation :public OutputOperation
-        {
-        public:
-            /**
-             * Constructor.
-             */
-            OutMapOperation()
-            {
-                // No-op.
-            }
-
-            virtual void ProcessOutput(ignite::impl::portable::PortableReaderImpl& reader)
-            {
-                bool exists = reader.GetStream()->ReadBool();
-
-                if (exists)
-                {
-                    int32_t cnt = reader.GetStream()->ReadInt32();
-
-                    std::map<T1, T2> val0;
-
-                    for (int i = 0; i < cnt; i++) {
-                        T1 t1 = reader.ReadTopObject<T1>();
-                        T2 t2 = reader.ReadTopObject<T2>();
-
-                        val0[t1] = t2;
-                    }
-
-                    val = val0;
-                }
-            }
-
-            /**
-             * Get value.
-             *
-             * @param Value.
-             */
-            std::map<T1, T2> GetResult()
-            {
-                return val;
-            }
-        private:
-            /** Value. */
-            std::map<T1, T2> val;
-
-            IGNITE_NO_COPY_ASSIGNMENT(OutMapOperation)
-        };
-
-        /*
-         * Output query GET ALL operation.
-         */
-        template<typename K, typename V>
-        class OutQueryGetAllOperation : public OutputOperation
-        {
-        public:
-            /**
-             * Constructor.
-             */
-            OutQueryGetAllOperation(std::vector<ignite::cache::CacheEntry<K, V>>* res) : res(res)
-            {
-                // No-op.
-            }
-
-            virtual void ProcessOutput(ignite::impl::portable::PortableReaderImpl& reader)
-            {
-                int32_t cnt = reader.ReadInt32();
-
-                for (int i = 0; i < cnt; i++) 
-                {
-                    K key = reader.ReadTopObject<K>();
-                    V val = reader.ReadTopObject<V>();
-
-                    res->push_back(ignite::cache::CacheEntry<K, V>(key, val));
-                }
-            }
-
-        private:
-            /** Entries. */
-            std::vector<ignite::cache::CacheEntry<K, V>>* res;
-            
-            IGNITE_NO_COPY_ASSIGNMENT(OutQueryGetAllOperation)
-        };
-    }
-}
-
-#endif
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/core/include/ignite/impl/portable/portable_common.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/ignite/impl/portable/portable_common.h b/modules/platform/src/main/cpp/core/include/ignite/impl/portable/portable_common.h
deleted file mode 100644
index 622cb54..0000000
--- a/modules/platform/src/main/cpp/core/include/ignite/impl/portable/portable_common.h
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef _IGNITE_IMPL_PORTABLE_COMMON
-#define _IGNITE_IMPL_PORTABLE_COMMON
-
-#include <stdint.h>
-
-namespace ignite
-{    
-    namespace impl
-    {
-        namespace portable
-        {
-            /** Header: null. */
-            const int8_t IGNITE_HDR_NULL = 101;
-
-            /** Header: handle. */
-            const int8_t IGNITE_HDR_HND = 102;
-
-            /** Header: fulle form. */
-            const int8_t IGNITE_HDR_FULL = 103;
-
-            /** Full header length. */
-            const int32_t IGNITE_FULL_HDR_LEN = 18;
-
-            /** Type: object. */
-            const int8_t IGNITE_TYPE_OBJECT = IGNITE_HDR_FULL;
-
-            /** Type: unsigned byte. */
-            const int8_t IGNITE_TYPE_BYTE = 1;
-
-            /** Type: short. */
-            const int8_t IGNITE_TYPE_SHORT = 2;
-
-            /** Type: int. */
-            const int8_t IGNITE_TYPE_INT = 3;
-
-            /** Type: long. */
-            const int8_t IGNITE_TYPE_LONG = 4;
-
-            /** Type: float. */
-            const int8_t IGNITE_TYPE_FLOAT = 5;
-
-            /** Type: double. */
-            const int8_t IGNITE_TYPE_DOUBLE = 6;
-
-            /** Type: char. */
-            const int8_t IGNITE_TYPE_CHAR = 7;
-
-            /** Type: boolean. */
-            const int8_t IGNITE_TYPE_BOOL = 8;
-
-            /** Type: decimal. */
-            const int8_t IGNITE_TYPE_DECIMAL = 30;
-
-            /** Type: string. */
-            const int8_t IGNITE_TYPE_STRING = 9;
-
-            /** Type: UUID. */
-            const int8_t IGNITE_TYPE_UUID = 10;
-
-            /** Type: date. */
-            const int8_t IGNITE_TYPE_DATE = 11;
-
-            /** Type: unsigned byte array. */
-            const int8_t IGNITE_TYPE_ARRAY_BYTE = 12;
-
-            /** Type: short array. */
-            const int8_t IGNITE_TYPE_ARRAY_SHORT = 13;
-
-            /** Type: int array. */
-            const int8_t IGNITE_TYPE_ARRAY_INT = 14;
-
-            /** Type: long array. */
-            const int8_t IGNITE_TYPE_ARRAY_LONG = 15;
-
-            /** Type: float array. */
-            const int8_t IGNITE_TYPE_ARRAY_FLOAT = 16;
-
-            /** Type: double array. */
-            const int8_t IGNITE_TYPE_ARRAY_DOUBLE = 17;
-
-            /** Type: char array. */
-            const int8_t IGNITE_TYPE_ARRAY_CHAR = 18;
-
-            /** Type: boolean array. */
-            const int8_t IGNITE_TYPE_ARRAY_BOOL = 19;
-
-            /** Type: decimal array. */
-            const int8_t IGNITE_TYPE_ARRAY_DECIMAL = 31;
-
-            /** Type: string array. */
-            const int8_t IGNITE_TYPE_ARRAY_STRING = 20;
-
-            /** Type: UUID array. */
-            const int8_t IGNITE_TYPE_ARRAY_UUID = 21;
-
-            /** Type: date array. */
-            const int8_t IGNITE_TYPE_ARRAY_DATE = 22;
-
-            /** Type: object array. */
-            const int8_t IGNITE_TYPE_ARRAY = 23;
-
-            /** Type: collection. */
-            const int8_t IGNITE_TYPE_COLLECTION = 24;
-
-            /** Type: map. */
-            const int8_t IGNITE_TYPE_MAP = 25;
-
-            /** Type: map entry. */
-            const int8_t IGNITE_TYPE_MAP_ENTRY = 26;
-
-            /** Type: portable object. */
-            const int8_t IGNITE_TYPE_PORTABLE = 27;
-
-            /** Read/write single object. */
-            const int32_t IGNITE_PORTABLE_MODE_SINGLE = 0;
-
-            /** Read/write array. */
-            const int32_t IGNITE_PORTABLE_MODE_ARRAY = 1;
-
-            /** Read/write collection. */
-            const int32_t IGNITE_PORTABLE_MODE_COL = 2;
-
-            /** Read/write map. */
-            const int32_t IGNITE_PORTABLE_MODE_MAP = 3;
-        }
-    }    
-}
-
-#endif
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/core/include/ignite/impl/portable/portable_id_resolver.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/ignite/impl/portable/portable_id_resolver.h b/modules/platform/src/main/cpp/core/include/ignite/impl/portable/portable_id_resolver.h
deleted file mode 100644
index d8f7883..0000000
--- a/modules/platform/src/main/cpp/core/include/ignite/impl/portable/portable_id_resolver.h
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef _IGNITE_IMPL_PORTABLE_ID_RESOLVER
-#define _IGNITE_IMPL_PORTABLE_ID_RESOLVER
-
-#include "ignite/portable/portable_type.h"
-
-namespace ignite
-{
-    namespace impl
-    {
-        namespace portable
-        {
-            /**
-             * Portable type id resolver.
-             */
-            class PortableIdResolver
-            {
-            public:
-                /**
-                 * Destructor.
-                 */
-                virtual ~PortableIdResolver()
-                {
-                    // No-op.
-                }
-
-                /**
-                 * Get portable object type ID.
-                 *
-                 * @return Type ID.
-                 */
-                virtual int32_t GetTypeId() = 0;
-
-                /**
-                 * Get portable object field ID.
-                 *
-                 * @param typeId Type ID.
-                 * @param name Field name.
-                 * @return Field ID.
-                 */
-                virtual int32_t GetFieldId(const int32_t typeId, const char* name) = 0;
-            };
-
-            /**
-             * Templated portable type descriptor.
-             */
-            template<typename T>
-            class TemplatedPortableIdResolver : public PortableIdResolver
-            {
-            public:
-                /**
-                 * Constructor.
-                 */
-                TemplatedPortableIdResolver()
-                {
-                    type = ignite::portable::PortableType<T>();
-                }
-
-                /**
-                 * Constructor.
-                 *
-                 * @param type Portable type.
-                 */
-                TemplatedPortableIdResolver(ignite::portable::PortableType<T> type) : type(type)
-                {
-                    // No-op.
-                }
-
-                virtual int32_t GetTypeId()
-                {
-                    return type.GetTypeId();
-                }
-
-                virtual int32_t GetFieldId(const int32_t typeId, const char* name) {
-                    if (!name)
-                    {
-                        IGNITE_ERROR_1(IgniteError::IGNITE_ERR_PORTABLE, "Field name cannot be NULL.");
-                    }
-
-                    return type.GetFieldId(name);
-                }
-            private:
-                /** Actual type.  */
-                ignite::portable::PortableType<T> type; 
-            };
-        }
-    }
-}
-
-#endif
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/core/include/ignite/impl/portable/portable_metadata_handler.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/ignite/impl/portable/portable_metadata_handler.h b/modules/platform/src/main/cpp/core/include/ignite/impl/portable/portable_metadata_handler.h
deleted file mode 100644
index a557129..0000000
--- a/modules/platform/src/main/cpp/core/include/ignite/impl/portable/portable_metadata_handler.h
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef _IGNITE_IMPL_PORTABLE_METADATA_HANDLER
-#define _IGNITE_IMPL_PORTABLE_METADATA_HANDLER
-
-#include <ignite/common/concurrent.h>
-
-#include "ignite/impl/portable/portable_metadata_snapshot.h"
-
-namespace ignite
-{    
-    namespace impl
-    {
-        namespace portable
-        {
-            /**
-             * Metadata handler. Tracks all metadata updates during write session.
-             */
-            class PortableMetadataHandler 
-            {
-            public:
-                /**
-                 * Constructor.
-                 *
-                 * @param snap Snapshot.
-                 */
-                PortableMetadataHandler(SPSnap snap);
-                
-                /**
-                 * Destructor.
-                 */
-                ~PortableMetadataHandler();
-
-                /**
-                 * Callback invoked when field is being written.
-                 *
-                 * @param fieldId Field ID.
-                 * @param fieldName Field name.
-                 * @param fieldTypeId Field type ID.
-                 */
-                void OnFieldWritten(int32_t fieldId, std::string fieldName, int32_t fieldTypeId);
-
-                /**
-                 * Get initial snapshot.
-                 *
-                 * @param Snapshot.
-                 */
-                SPSnap GetSnapshot();
-
-                /**
-                 * Whether any difference exists.
-                 *
-                 * @param True if difference exists.
-                 */
-                bool HasDifference();
-
-                /**
-                 * Get recorded field IDs difference.
-                 *
-                 * @param Recorded field IDs difference.
-                 */
-                std::set<int32_t>* GetFieldIds();
-
-                /**
-                 * Get recorded fields difference.
-                 *
-                 * @param Recorded fields difference.
-                 */
-                std::map<std::string, int32_t>* GetFields();
-
-            private:
-                /** Snapshot. */
-                SPSnap snap;                          
-
-                /** Recorded field IDs difference. */
-                std::set<int32_t>* fieldIds;           
-                
-                /** Recorded fields difference. */
-                std::map<std::string, int32_t>* fields; 
-
-                IGNITE_NO_COPY_ASSIGNMENT(PortableMetadataHandler)
-            };
-        }
-    }    
-}
-
-#endif
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/core/include/ignite/impl/portable/portable_metadata_manager.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/ignite/impl/portable/portable_metadata_manager.h b/modules/platform/src/main/cpp/core/include/ignite/impl/portable/portable_metadata_manager.h
deleted file mode 100644
index 3e2b770..0000000
--- a/modules/platform/src/main/cpp/core/include/ignite/impl/portable/portable_metadata_manager.h
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef _IGNITE_IMPL_PORTABLE_METADATA_MANAGER
-#define _IGNITE_IMPL_PORTABLE_METADATA_MANAGER
-
-#include <vector>
-
-#include "ignite/ignite_error.h"
-#include "ignite/impl/portable/portable_metadata_handler.h"
-#include "ignite/impl/portable/portable_metadata_updater.h"
-
-namespace ignite
-{    
-    namespace impl
-    {
-        namespace portable
-        {
-            /**
-             * Metadata manager.
-             */
-            class IGNITE_IMPORT_EXPORT PortableMetadataManager
-            {
-            public:
-                /**
-                 * Constructor.
-                 */
-                PortableMetadataManager();
-
-                /**
-                 * Destructor.
-                 */
-                ~PortableMetadataManager();
-
-                /**
-                 * Get handler.
-                 *
-                 * @param typeId Type ID.
-                 */
-                ignite::common::concurrent::SharedPointer<PortableMetadataHandler> GetHandler(int32_t typeId);
-
-                /**
-                 * Submit handler for processing.
-                 * 
-                 * @param typeName Type name.
-                 * @param typeId Type ID.
-                 * @param hnd Handler.
-                 */
-                void SubmitHandler(std::string typeName, int32_t typeId, PortableMetadataHandler* hnd);
-
-                /**
-                 * Get current metadata manager version.
-                 *
-                 * @param Version.
-                 */
-                int32_t GetVersion();
-
-                /**
-                 * Check whether something is updated since the given version.
-                 *
-                 * @param oldVer Old version.
-                 * @return True if updated and it is very likely that pending metadata exists.
-                 */
-                bool IsUpdatedSince(int32_t oldVer);
-
-                /**
-                 * Process pending updates.
-                 *
-                 * @param updated Updater.
-                 * @param err Error.
-                 * @return In case of success.
-                 */
-                bool ProcessPendingUpdates(PortableMetadataUpdater* updater, IgniteError* err);
-
-            private:
-                /** Current snapshots. */
-                ignite::common::concurrent::SharedPointer<std::map<int32_t, SPSnap>> snapshots;
-                
-                /** Pending snapshots. */
-                std::vector<SPSnap>* pending;                                          
-
-                /** Critical section. */
-                ignite::common::concurrent::CriticalSection* cs;
-
-                /** Version of pending changes. */
-                int32_t pendingVer;                                                    
-                
-                /** Latest version. */
-                int32_t ver;          
-
-                IGNITE_NO_COPY_ASSIGNMENT(PortableMetadataManager);
-
-                /**
-                 * Copy fields from a snapshot into relevant collections.
-                 *
-                 * @param snap Target snapshot.
-                 * @param fieldIds Field IDs.
-                 * @param fields Fields.
-                 */
-                void CopyFields(Snap* snap, std::set<int32_t>* fieldIds, std::map<std::string, int32_t>* fields);
-            };
-        }
-    }    
-}
-
-#endif
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/core/include/ignite/impl/portable/portable_metadata_snapshot.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/ignite/impl/portable/portable_metadata_snapshot.h b/modules/platform/src/main/cpp/core/include/ignite/impl/portable/portable_metadata_snapshot.h
deleted file mode 100644
index 1e000fc..0000000
--- a/modules/platform/src/main/cpp/core/include/ignite/impl/portable/portable_metadata_snapshot.h
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef _IGNITE_IMPL_PORTABLE_METADATA_SNAPSHOT
-#define _IGNITE_IMPL_PORTABLE_METADATA_SNAPSHOT
-
-#include <map>
-#include <set>
-#include <stdint.h>
-#include <string>
-
-#include <ignite/common/common.h>
-#include <ignite/common/concurrent.h>
-
-namespace ignite
-{    
-    namespace impl
-    {
-        namespace portable
-        {
-            /**
-             * Metadata snapshot. 
-             */
-            class PortableMetadataSnapshot
-            {
-            public:
-                /**
-                 * Constructor.
-                 *
-                 * @param typeName Type name.
-                 * @param typeId Type ID.
-                 * @param fieldIds Field IDs.
-                 * @param fields Fields.
-                 */
-                PortableMetadataSnapshot(std::string typeName, int32_t typeId, std::set<int32_t>* fieldIds, 
-                    std::map<std::string, int32_t>* fields);
-                
-                /**
-                 * Destructor.
-                 */
-                ~PortableMetadataSnapshot();
-
-                /**
-                 * Check whether snapshot contains a field with the given ID.
-                 *
-                 * @param fieldId Field ID.
-                 * @return True if contains, false otherwise.
-                 */
-                bool ContainsFieldId(int32_t fieldId);
-
-                /**
-                 * Get type name.
-                 *
-                 * @param Type name.
-                 */
-                std::string GetTypeName();
-
-                /**
-                 * Get type ID.
-                 *
-                 * @return Type ID.
-                 */
-                int32_t GetTypeId();
-
-                /**
-                 * Whether snapshot contains any fields.
-                 *
-                 * @param True if fields exist.
-                 */
-                bool HasFields();
-
-                /** 
-                 * Get field IDs.
-                 *
-                 * @param Field IDs.
-                 */
-                std::set<int32_t>* GetFieldIds();
-
-                /**
-                 * Get fields.
-                 *
-                 * @return Fields.
-                 */
-                std::map<std::string, int32_t>* GetFields();
-
-            private:
-                /** Type name. */
-                std::string typeName;                   
-                
-                /** Type ID. */
-                int32_t typeId;
-
-                /** Known field IDs. */
-                std::set<int32_t>* fieldIds;
-
-                /** Field name-type mappings. */
-                std::map<std::string, int32_t>* fields; 
-
-                IGNITE_NO_COPY_ASSIGNMENT(PortableMetadataSnapshot)
-            };
-
-            typedef PortableMetadataSnapshot Snap;
-            typedef ignite::common::concurrent::SharedPointer<Snap> SPSnap;
-        }
-    }    
-}
-
-#endif
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/core/include/ignite/impl/portable/portable_metadata_updater.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/ignite/impl/portable/portable_metadata_updater.h b/modules/platform/src/main/cpp/core/include/ignite/impl/portable/portable_metadata_updater.h
deleted file mode 100644
index a734db7..0000000
--- a/modules/platform/src/main/cpp/core/include/ignite/impl/portable/portable_metadata_updater.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef _IGNITE_IMPL_PORTABLE_METADATA_UPDATER
-#define _IGNITE_IMPL_PORTABLE_METADATA_UPDATER
-
-#include "ignite/ignite_error.h"
-#include "ignite/impl/portable/portable_metadata_snapshot.h"
-
-namespace ignite
-{    
-    namespace impl
-    {
-        namespace portable
-        {
-            /**
-             * Metadata updater interface.
-             */
-            class IGNITE_IMPORT_EXPORT PortableMetadataUpdater
-            {
-            public:
-                /**
-                 * Destructor.
-                 */
-                virtual ~PortableMetadataUpdater();
-
-                /**
-                 * Update metadata using provided snapshot.
-                 *
-                 * @param snapshot Snapshot.
-                 * @param err Error.
-                 */
-                virtual bool Update(Snap* snapshot, IgniteError* err) = 0;
-            };
-        }
-    }    
-}
-
-#endif
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/core/include/ignite/impl/portable/portable_metadata_updater_impl.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/ignite/impl/portable/portable_metadata_updater_impl.h b/modules/platform/src/main/cpp/core/include/ignite/impl/portable/portable_metadata_updater_impl.h
deleted file mode 100644
index 832c2a3..0000000
--- a/modules/platform/src/main/cpp/core/include/ignite/impl/portable/portable_metadata_updater_impl.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef _IGNITE_IMPL_PORTABLE_METADATA_UPDATER_IMPL
-#define _IGNITE_IMPL_PORTABLE_METADATA_UPDATER_IMPL
-
-#include <ignite/common/exports.h>
-
-#include "ignite/impl/ignite_environment.h"
-#include "ignite/impl/portable/portable_metadata_updater.h"
-
-namespace ignite
-{    
-    namespace impl
-    {
-        namespace portable
-        {
-            /**
-             * Metadata updater implementation.
-             */
-            class IGNITE_IMPORT_EXPORT PortableMetadataUpdaterImpl : public PortableMetadataUpdater
-            {
-            public:
-                /**
-                 * Constructor.
-                 *
-                 * @param env Environment.
-                 * @param javaRef Reference to Java object which is able to process metadata request.
-                 */
-                PortableMetadataUpdaterImpl(ignite::common::concurrent::SharedPointer<IgniteEnvironment> env, jobject javaRef);
-
-                /**
-                 * Destructor.
-                 */
-                ~PortableMetadataUpdaterImpl();
-
-                bool Update(Snap* snapshot, IgniteError* err);
-            private:
-                /** Environment. */
-                ignite::common::concurrent::SharedPointer<IgniteEnvironment> env;
-                
-                /** Handle to Java object. */
-                jobject javaRef;                 
-
-                IGNITE_NO_COPY_ASSIGNMENT(PortableMetadataUpdaterImpl)
-            };
-        }
-    }    
-}
-
-#endif
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/core/include/ignite/impl/portable/portable_reader_impl.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/ignite/impl/portable/portable_reader_impl.h b/modules/platform/src/main/cpp/core/include/ignite/impl/portable/portable_reader_impl.h
deleted file mode 100644
index 7d82aa2..0000000
--- a/modules/platform/src/main/cpp/core/include/ignite/impl/portable/portable_reader_impl.h
+++ /dev/null
@@ -1,1130 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef _IGNITE_IMPL_PORTABLE_READER
-#define _IGNITE_IMPL_PORTABLE_READER
-
-#include <stdint.h>
-
-#include <ignite/common/common.h>
-
-#include "ignite/impl/interop/interop_input_stream.h"
-#include "ignite/impl/portable/portable_common.h"
-#include "ignite/impl/portable/portable_id_resolver.h"
-#include "ignite/impl/portable/portable_utils.h"
-#include "ignite/impl/utils.h"
-#include "ignite/portable/portable_consts.h"
-#include "ignite/portable/portable_type.h"
-#include "ignite/guid.h"
-
-namespace ignite
-{
-    namespace impl
-    {
-        namespace portable
-        {
-            /**
-             * Internal implementation of portable reader.
-             */
-            class IGNITE_IMPORT_EXPORT PortableReaderImpl
-            {
-            public:
-                /**
-                 * Constructor.
-                 *
-                 * @param stream Interop stream.
-                 * @param idRslvr Portable ID resolver.
-                 * @param pos Object position in the stream.
-                 * @param usrType user type flag.
-                 * @param typeId Type ID.
-                 * @param hashcode Hash code.
-                 * @param len Length in bytes.
-                 * @param rawOff Raw data offset.
-                 */
-                PortableReaderImpl(interop::InteropInputStream* stream, PortableIdResolver* idRslvr,                     
-                    int32_t pos, bool usrType, int32_t typeId, int32_t hashCode, int32_t len, int32_t rawOff);
-
-                /**
-                 * Constructor used to construct light-weight reader allowing only raw operations 
-                 * and read of primitives.
-                 *
-                 * @param stream Interop stream.
-                 */
-                PortableReaderImpl(interop::InteropInputStream* stream);
-
-                /**
-                 * Read 8-byte signed integer. Maps to "byte" type in Java.
-                 *
-                 * @return Result.
-                 */
-                int8_t ReadInt8();
-
-                /**
-                 * Read array of 8-byte signed integers. Maps to "byte[]" type in Java.
-                 *
-                 * @param res Array to store data to.
-                 * @param len Expected length of array.
-                 * @return Actual amount of elements read. If "len" argument is less than actual
-                 *     array size or resulting array is set to null, nothing will be written
-                 *     to resulting array and returned value will contain required array length.
-                 *     -1 will be returned in case array in stream was null.
-                 */
-                int32_t ReadInt8Array(int8_t* res, const int32_t len);
-
-                /**
-                 * Read 8-byte signed integer. Maps to "byte" type in Java.
-                 *
-                 * @param fieldName Field name.
-                 * @return Result.
-                 */
-                int8_t ReadInt8(const char* fieldName);
-
-                /**
-                 * Read array of 8-byte signed integers. Maps to "byte[]" type in Java.
-                 *
-                 * @param fieldName Field name.
-                 * @param res Array to store data to.
-                 * @param len Expected length of array.                 
-                 * @return Actual amount of elements read. If "len" argument is less than actual
-                 *     array size or resulting array is set to null, nothing will be written
-                 *     to resulting array and returned value will contain required array length.
-                 *     -1 will be returned in case array in stream was null.
-                 */
-                int32_t ReadInt8Array(const char* fieldName, int8_t* res, const int32_t len);
-
-                /**
-                 * Read bool. Maps to "boolean" type in Java.
-                 *
-                 * @return Result.
-                 */
-                bool ReadBool();
-
-                /**
-                 * Read bool array. Maps to "boolean[]" type in Java.
-                 *
-                 * @param res Array to store data to.
-                 * @param len Expected length of array.                 
-                 * @return Actual amount of elements read. If "len" argument is less than actual
-                 *     array size or resulting array is set to null, nothing will be written
-                 *     to resulting array and returned value will contain required array length.
-                 *     -1 will be returned in case array in stream was null.
-                 */
-                int32_t ReadBoolArray(bool* res, const int32_t len);
-
-                /**
-                 * Read bool. Maps to "short" type in Java.
-                 *
-                 * @param fieldName Field name.
-                 * @return Result.
-                 */
-                bool ReadBool(const char* fieldName);
-
-                /**
-                 * Read bool array. Maps to "bool[]" type in Java.
-                 *
-                 * @param fieldName Field name.
-                 * @param res Array to store data to.
-                 * @param len Expected length of array.                 
-                 * @return Actual amount of elements read. If "len" argument is less than actual
-                 *     array size or resulting array is set to null, nothing will be written
-                 *     to resulting array and returned value will contain required array length.
-                 *     -1 will be returned in case array in stream was null.
-                 */
-                int32_t ReadBoolArray(const char* fieldName, bool* res, const int32_t len);
-
-                /**
-                 * Read 16-byte signed integer. Maps to "short" type in Java.
-                 *
-                 * @return Result.
-                 */
-                int16_t ReadInt16();
-
-                /**
-                 * Read array of 16-byte signed integers. Maps to "short[]" type in Java.
-                 *
-                 * @param res Array to store data to.
-                 * @param len Expected length of array.                 
-                 * @return Actual amount of elements read. If "len" argument is less than actual
-                 *     array size or resulting array is set to null, nothing will be written
-                 *     to resulting array and returned value will contain required array length.
-                 *     -1 will be returned in case array in stream was null.
-                 */
-                int32_t ReadInt16Array(int16_t* res, const int32_t len);
-
-                /**
-                 * Read 16-byte signed integer. Maps to "short" type in Java.
-                 *
-                 * @param fieldName Field name.
-                 * @return Result.
-                 */
-                int16_t ReadInt16(const char* fieldName);
-
-                /**
-                 * Read array of 16-byte signed integers. Maps to "short[]" type in Java.
-                 *
-                 * @param fieldName Field name.
-                 * @param res Array to store data to.
-                 * @param len Expected length of array.                 
-                 * @return Actual amount of elements read. If "len" argument is less than actual
-                 *     array size or resulting array is set to null, nothing will be written
-                 *     to resulting array and returned value will contain required array length.
-                 *      -1 will be returned in case array in stream was null.
-                 */
-                int32_t ReadInt16Array(const char* fieldName, int16_t* res, const int32_t len);
-
-                /**
-                 * Read 16-byte unsigned integer. Maps to "char" type in Java.
-                 *
-                 * @return Result.
-                 */
-                uint16_t ReadUInt16();
-
-                /**
-                 * Read array of 16-byte unsigned integers. Maps to "char[]" type in Java.
-                 *
-                 * @param res Array to store data to.
-                 * @param len Expected length of array.                 
-                 * @return Actual amount of elements read. If "len" argument is less than actual
-                 *     array size or resulting array is set to null, nothing will be written
-                 *     to resulting array and returned value will contain required array length.
-                 *     -1 will be returned in case array in stream was null.
-                 */
-                int32_t ReadUInt16Array(uint16_t* res, const int32_t len);
-
-                /**
-                 * Read 16-byte unsigned integer. Maps to "char" type in Java.
-                 *
-                 * @param fieldName Field name.
-                 * @return Result.
-                 */
-                uint16_t ReadUInt16(const char* fieldName);
-
-                /**
-                 * Read array of 16-byte unsigned integers. Maps to "char[]" type in Java.
-                 *
-                 * @param fieldName Field name.
-                 * @param res Array to store data to.
-                 * @param len Expected length of array.                 
-                 * @return Actual amount of elements read. If "len" argument is less than actual
-                 *     array size or resulting array is set to null, nothing will be written
-                 *     to resulting array and returned value will contain required array length.
-                 *     -1 will be returned in case array in stream was null.
-                 */
-                int32_t ReadUInt16Array(const char* fieldName, uint16_t* res, const int32_t len);
-
-                /**
-                 * Read 32-byte signed integer. Maps to "int" type in Java.
-                 *
-                 * @return Result.
-                 */
-                int32_t ReadInt32();
-
-                /**
-                 * Read array of 32-byte signed integers. Maps to "int[]" type in Java.
-                 *
-                 * @param res Array to store data to.
-                 * @param len Expected length of array.                 
-                 * @return Actual amount of elements read. If "len" argument is less than actual
-                 *     array size or resulting array is set to null, nothing will be written
-                 *     to resulting array and returned value will contain required array length.
-                 *     -1 will be returned in case array in stream was null.
-                 */
-                int32_t ReadInt32Array(int32_t* res, const int32_t len);
-
-                /**
-                 * Read 32-byte signed integer. Maps to "int" type in Java.
-                 *
-                 * @param fieldName Field name.
-                 * @return Result.
-                 */
-                int32_t ReadInt32(const char* fieldName);
-
-                /**
-                 * Read array of 32-byte signed integers. Maps to "int[]" type in Java.
-                 *
-                 * @param fieldName Field name.
-                 * @param res Array to store data to.
-                 * @param len Expected length of array.                 
-                 * @return Actual amount of elements read. If "len" argument is less than actual
-                 *     array size or resulting array is set to null, nothing will be written
-                 *     to resulting array and returned value will contain required array length.
-                 *     -1 will be returned in case array in stream was null.
-                 */
-                int32_t ReadInt32Array(const char* fieldName, int32_t* res, const int32_t len);
-
-                /**
-                 * Read 64-byte signed integer. Maps to "long" type in Java.
-                 *
-                 * @return Result.
-                 */
-                int64_t ReadInt64();
-
-                /**
-                 * Read array of 64-byte signed integers. Maps to "long[]" type in Java.
-                 *
-                 * @param res Array to store data to.
-                 * @param len Expected length of array.                 
-                 * @return Actual amount of elements read. If "len" argument is less than actual
-                 *     array size or resulting array is set to null, nothing will be written
-                 *     to resulting array and returned value will contain required array length.
-                 *     -1 will be returned in case array in stream was null.
-                 */
-                int32_t ReadInt64Array(int64_t* res, const int32_t len);
-
-                /**
-                 * Read 64-byte signed integer. Maps to "long" type in Java.
-                 *
-                 * @param fieldName Field name.
-                 * @return Result.
-                 */
-                int64_t ReadInt64(const char* fieldName);
-
-                /**
-                 * Read array of 64-byte signed integers. Maps to "long[]" type in Java.
-                 *
-                 * @param fieldName Field name.
-                 * @param res Array to store data to.
-                 * @param len Expected length of array.                 
-                 * @return Actual amount of elements read. If "len" argument is less than actual
-                 *     array size or resulting array is set to null, nothing will be written
-                 *     to resulting array and returned value will contain required array length.
-                 *     -1 will be returned in case array in stream was null.
-                 */
-                int32_t ReadInt64Array(const char* fieldName, int64_t* res, const int32_t len);
-
-                /**
-                 * Read float. Maps to "float" type in Java.
-                 *
-                 * @return Result.
-                 */
-                float ReadFloat();
-
-                /**
-                 * Read float array. Maps to "float[]" type in Java.
-                 *
-                 * @param res Array to store data to.
-                 * @param len Expected length of array.                 
-                 * @return Actual amount of elements read. If "len" argument is less than actual
-                 *     array size or resulting array is set to null, nothing will be written
-                 *     to resulting array and returned value will contain required array length.
-                 *     -1 will be returned in case array in stream was null.
-                 */
-                int32_t ReadFloatArray(float* res, const int32_t len);
-
-                /**
-                 * Read float. Maps to "float" type in Java.
-                 *
-                 * @param fieldName Field name.
-                 * @return Result.
-                 */
-                float ReadFloat(const char* fieldName);
-
-                /**
-                 * Read float array. Maps to "float[]" type in Java.
-                 *
-                 * @param fieldName Field name.
-                 * @param res Array to store data to.
-                 * @param len Expected length of array.                 
-                 * @return Actual amount of elements read. If "len" argument is less than actual
-                 *     array size or resulting array is set to null, nothing will be written
-                 *     to resulting array and returned value will contain required array length.
-                 *     -1 will be returned in case array in stream was null.
-                 */
-                int32_t ReadFloatArray(const char* fieldName, float* res, const int32_t len);
-
-                /**
-                 * Read double. Maps to "double" type in Java.
-                 *
-                 * @return Result.
-                 */
-                double ReadDouble();
-                
-                /**
-                 * Read double array. Maps to "double[]" type in Java.
-                 *
-                 * @param res Array to store data to.
-                 * @param len Expected length of array.                 
-                 * @return Actual amount of elements read. If "len" argument is less than actual
-                 *     array size or resulting array is set to null, nothing will be written
-                 *     to resulting array and returned value will contain required array length.
-                 *     -1 will be returned in case array in stream was null.
-                 */
-                int32_t ReadDoubleArray(double* res, const int32_t len);
-
-                /**
-                 * Read double. Maps to "double" type in Java.
-                 *
-                 * @param fieldName Field name.
-                 * @return Result.
-                 */
-                double ReadDouble(const char* fieldName);
-
-                /**
-                 * Read double array. Maps to "double[]" type in Java.
-                 *
-                 * @param fieldName Field name.
-                 * @param res Array to store data to.
-                 * @param len Expected length of array.                 
-                 * @return Actual amount of elements read. If "len" argument is less than actual
-                 *     array size or resulting array is set to null, nothing will be written
-                 *     to resulting array and returned value will contain required array length.
-                 *     -1 will be returned in case array in stream was null.
-                 */
-                int32_t ReadDoubleArray(const char* fieldName, double* res, const int32_t len);
-
-                /**
-                 * Read Guid. Maps to "UUID" type in Java.
-                 *
-                 * @return Result.
-                 */
-                Guid ReadGuid();
-
-                /**
-                 * Read array of Guids. Maps to "UUID[]" type in Java.
-                 *
-                 * @param res Array to store data to.
-                 * @param len Expected length of array.                 
-                 * @return Actual amount of elements read. If "len" argument is less than actual
-                 *     array size or resulting array is set to null, nothing will be written
-                 *     to resulting array and returned value will contain required array length.
-                 *     -1 will be returned in case array in stream was null.
-                 */
-                int32_t ReadGuidArray(Guid* res, const int32_t len);
-
-                /**
-                 * Read Guid. Maps to "UUID" type in Java.
-                 *
-                 * @param fieldName Field name.
-                 * @return Result.
-                 */
-                Guid ReadGuid(const char* fieldName);
-
-                /**
-                 * Read array of Guids. Maps to "UUID[]" type in Java.
-                 *
-                 * @param fieldName Field name.
-                 * @param res Array to store data to.
-                 * @param len Expected length of array.                 
-                 * @return Actual amount of elements read. If "len" argument is less than actual
-                 *     array size or resulting array is set to null, nothing will be written
-                 *     to resulting array and returned value will contain required array length.
-                 *     -1 will be returned in case array in stream was null.
-                 */
-                int32_t ReadGuidArray(const char* fieldName, Guid* res, const int32_t len);
-
-                /**
-                 * Read string.
-                 *
-                 * @param len Expected length of string.
-                 * @param res Array to store data to (should be able to acocmodate null-terminator).
-                 * @return Actual amount of elements read. If "len" argument is less than actual
-                 *     array size or resulting array is set to null, nothing will be written
-                 *     to resulting array and returned value will contain required array length.
-                 *     -1 will be returned in case array in stream was null.
-                 */
-                int32_t ReadString(char* res, const int32_t len);
-
-                /**
-                 * Read string.
-                 *
-                 * @param fieldName Field name.                 
-                 * @param res Array to store data to (should be able to acocmodate null-terminator).
-                 * @param len Expected length of string.
-                 * @return Actual amount of elements read. If "len" argument is less than actual
-                 *     array size or resulting array is set to null, nothing will be written
-                 *     to resulting array and returned value will contain required array length.
-                 *     -1 will be returned in case array in stream was null.
-                 */
-                int32_t ReadString(const char* fieldName, char* res, const int32_t len);
-                
-                /**
-                 * Start string array read.
-                 *
-                 * @param size Array size.
-                 * @return Read session ID.
-                 */
-                int32_t ReadStringArray(int32_t* size);
-
-                /**
-                 * Start string array read.
-                 *
-                 * @param fieldName Field name.
-                 * @param size Array size.
-                 * @return Read session ID.
-                 */
-                int32_t ReadStringArray(const char* fieldName, int32_t* size);
-
-                /**
-                 * Read string element.
-                 *
-                 * @param id Session ID.
-                 * @param len Expected length of string.
-                 * @param res Array to store data to (should be able to acocmodate null-terminator).
-                 * @return Actual amount of elements read. If "len" argument is less than actual
-                 *     array size or resulting array is set to null, nothing will be written
-                 *     to resulting array and returned value will contain required array length.
-                 *     -1 will be returned in case array in stream was null.
-                 */
-                int32_t ReadStringElement(int32_t id, char* res, const int32_t len);
-
-                /**
-                 * Start array read.
-                 *
-                 * @param size Array size.
-                 * @return Read session ID.
-                 */
-                int32_t ReadArray(int32_t* size);
-
-                /**
-                 * Start array read.
-                 *
-                 * @param fieldName Field name.
-                 * @param size Array size.
-                 * @return Read session ID.
-                 */
-                int32_t ReadArray(const char* fieldName, int32_t* size);
-
-                /**
-                 * Start collection read.
-                 *
-                 * @param typ Collection type.
-                 * @param size Collection size.
-                 * @return Read session ID.
-                 */
-                int32_t ReadCollection(ignite::portable::CollectionType* typ, int32_t* size);
-
-                /**
-                 * Start collection read.
-                 *
-                 * @param fieldName Field name.
-                 * @param typ Collection type.
-                 * @param size Collection size.
-                 * @return Read session ID.
-                 */
-                int32_t ReadCollection(const char* fieldName, ignite::portable::CollectionType* typ, int32_t* size);
-
-                /**
-                 * Start map read.
-                 *
-                 * @param typ Map type.
-                 * @param size Map size.
-                 * @return Read session ID.
-                 */
-                int32_t ReadMap(ignite::portable::MapType* typ, int32_t* size);
-
-                /**
-                 * Start map read.
-                 *
-                 * @param fieldName Field name.
-                 * @param typ Map type.
-                 * @param size Map size.
-                 * @return Read session ID.
-                 */
-                int32_t ReadMap(const char* fieldName, ignite::portable::MapType* typ, int32_t* size);
-
-                /**
-                 * Check whether next value exists.
-                 *
-                 * @param id Session ID.
-                 * @return True if next element exists for the given session.
-                 */
-                bool HasNextElement(int32_t id);
-
-                /**
-                 * Read element.
-                 *
-                 * @param id Session ID.
-                 * @return Value.
-                 */
-                template<typename T>
-                T ReadElement(const int32_t id)
-                {
-                    CheckSession(id);
-
-                    if (++elemRead == elemCnt) {
-                        elemId = 0;
-                        elemCnt = -1;
-                        elemRead = 0;
-                    }
-
-                    return ReadTopObject<T>();
-                }
-
-                /**
-                 * Read element.
-                 *
-                 * @param id Session ID.
-                 * @param key Key.
-                 * @param val Value.
-                 */
-                template<typename K, typename V>
-                void ReadElement(const int32_t id, K* key, V* val)
-                {
-                    CheckSession(id);
-
-                    if (++elemRead == elemCnt) {
-                        elemId = 0;
-                        elemCnt = -1;
-                        elemRead = 0;
-                    }
-
-                    *key = ReadTopObject<K>();
-                    *val = ReadTopObject<V>();
-                }
-                
-                /**
-                 * Read object.
-                 *
-                 * @return Object.
-                 */
-                template<typename T>
-                T ReadObject()
-                {
-                    CheckRawMode(true);
-
-                    return ReadTopObject<T>();
-                }
-
-                /**
-                 * Read object.
-                 *
-                 * @param fieldName Field name.
-                 * @return Object.
-                 */
-                template<typename T>
-                T ReadObject(const char* fieldName)
-                {
-                    CheckRawMode(false);
-
-                    int32_t fieldId = idRslvr->GetFieldId(typeId, fieldName); 
-                        
-                    int32_t fieldLen = SeekField(fieldId); 
-                        
-                    if (fieldLen > 0) 
-                        return ReadTopObject<T>();
-                    
-                    return GetNull<T>();
-                }
-
-                /**
-                 * Set raw mode.
-                 */
-                void SetRawMode();
-
-                /**
-                 * Read object.
-                 *
-                 * @param obj Object to write.
-                 */
-                template<typename T>
-                T ReadTopObject()
-                {
-                    int32_t pos = stream->Position();
-                    int8_t hdr = stream->ReadInt8();
-
-                    if (hdr == IGNITE_HDR_NULL)
-                        return GetNull<T>();
-                    else if (hdr == IGNITE_HDR_HND) {
-                        IGNITE_ERROR_1(ignite::IgniteError::IGNITE_ERR_PORTABLE, "Circular references are not supported.");
-                    }
-                    else if (hdr == IGNITE_TYPE_PORTABLE)
-                    {
-                        int32_t portLen = stream->ReadInt32(); // Total length of portable object.
-                        int32_t curPos = stream->Position();
-                        int32_t portOff = stream->ReadInt32(curPos + portLen);
-
-                        stream->Position(curPos + portOff); // Position stream right on the object.
-
-                        T val = ReadTopObject<T>();
-
-                        stream->Position(curPos + portLen + 4); // Position stream after portable.
-
-                        return val;
-                    }
-                    else
-                    {
-                        bool usrType = stream->ReadBool();
-                        int32_t typeId = stream->ReadInt32();
-                        int32_t hashCode = stream->ReadInt32();
-                        int32_t len = stream->ReadInt32();
-                        int32_t rawOff = stream->ReadInt32();
-
-                        ignite::portable::PortableType<T> type;
-                        TemplatedPortableIdResolver<T> idRslvr(type);
-                        PortableReaderImpl readerImpl(stream, &idRslvr, pos, usrType, typeId, hashCode, len, rawOff);
-                        ignite::portable::PortableReader reader(&readerImpl);
-
-                        T val = type.Read(reader);
-
-                        stream->Position(pos + len);
-
-                        return val;
-                    }
-                }
-
-                /**
-                 * Get NULL value for the given type.
-                 */
-                template<typename T>
-                T GetNull()
-                {
-                    ignite::portable::PortableType<T> type;
-
-                    return type.GetNull();
-                }
-
-                /**
-                 * Get underlying stream.
-                 *
-                 * @return Stream.
-                 */
-                impl::interop::InteropInputStream* GetStream();
-            private:
-                /** Underlying stream. */
-                interop::InteropInputStream* stream;   
-                
-                /** ID resolver. */
-                PortableIdResolver* idRslvr;           
-
-                /** Position in the stream where this object starts. */
-                int32_t pos;       
-                
-                /** Whether this is user type or system type. */
-                bool usrType;      
-                
-                /** Type ID as defined in the stream. */
-                int32_t typeId;    
-                
-                /** Hash code. */
-                int32_t hashCode;  
-                
-                /** Total object length in the stream. */
-                int32_t len;       
-                
-                /** Raw data offset. */
-                int32_t rawOff;    
-
-                /** Raw mode flag. */
-                bool rawMode;      
-
-                /** Elements read session ID generator. */
-                int32_t elemIdGen; 
-                
-                /** Elements read session ID. */
-                int32_t elemId;    
-                
-                /** Total amount of elements in collection. */
-                int32_t elemCnt;   
-                
-                /** Amount of elements read. */
-                int32_t elemRead;  
-
-                IGNITE_NO_COPY_ASSIGNMENT(PortableReaderImpl)
-
-                /**
-                 * Internal routine to read Guid array.
-                 *
-                 * @param stream Stream.
-                 * @param res Resulting array.
-                 * @param len Length.
-                 */
-                static void ReadGuidArrayInternal(
-                    interop::InteropInputStream* stream, 
-                    Guid* res,
-                    const int32_t len
-                );
-
-                /**
-                 * Read single value in raw mode.
-                 * 
-                 * @param stream Stream.
-                 * @param func Function to be invoked on stream.
-                 * @return Result.
-                 */
-                template<typename T>
-                T ReadRaw(
-                    T(*func) (interop::InteropInputStream*)
-                )
-                {
-                    {
-                        CheckRawMode(true);
-                        CheckSingleMode(true);
-
-                        return func(stream);
-                    }
-                }
-
-                /**
-                 * Read single value.
-                 *
-                 * @param fieldName Field name.
-                 * @param func Function to be invoked on stream.
-                 * @param epxHdr Expected header.
-                 * @param dflt Default value returned if field is not found.
-                 * @return Result.
-                 */
-                template<typename T>
-                T Read(
-                    const char* fieldName, 
-                    T(*func) (interop::InteropInputStream*), 
-                    const int8_t expHdr, 
-                    T dflt
-                )
-                {
-                    {
-                        CheckRawMode(false);
-                        CheckSingleMode(true);
-
-                        int32_t fieldId = idRslvr->GetFieldId(typeId, fieldName);
-                        int32_t fieldLen = SeekField(fieldId);
-
-                        if (fieldLen > 0)
-                        {
-                            int8_t typeId = stream->ReadInt8();
-
-                            if (typeId == expHdr)
-                                return func(stream);
-                            else if (typeId != IGNITE_HDR_NULL)
-                            {
-                                int32_t pos = stream->Position();
-
-                                IGNITE_ERROR_FORMATTED_3(IgniteError::IGNITE_ERR_PORTABLE, "Invalid type ID", 
-                                    "position", pos, "expected", expHdr, "actual", typeId)
-                            }
-                        }
-
-                        return dflt;
-                    }
-                }
-
-                /**
-                 * Read array in raw mode.
-                 *
-                 * @param res Resulting array.
-                 * @param len Length.                 
-                 * @param func Function to be invoked on stream.
-                 * @param expHdr Expected header.
-                 * @return Length.
-                 */
-                template<typename T>
-                int32_t ReadRawArray(
-                    T* res,
-                    const int32_t len,
-                    void(*func)(interop::InteropInputStream*, T* const, const int32_t),
-                    const int8_t expHdr
-                )
-                {
-                    {
-                        CheckRawMode(true);
-                        CheckSingleMode(true);
-
-                        return ReadArrayInternal(res, len, stream, func, expHdr);
-                    }
-                }
-
-                /**
-                 * Read array.
-                 *
-                 * @param fieldName Field name.
-                 * @param res Resulting array.
-                 * @param len Length.
-                 * @param func Function to be invoked on stream.
-                 * @param expHdr Expected header.
-                 * @return Length.
-                 */
-                template<typename T>
-                int32_t ReadArray(
-                    const char* fieldName,
-                    T* res,
-                    const int32_t len,                    
-                    void(*func)(interop::InteropInputStream*, T* const, const int32_t),
-                    const int8_t expHdr
-                )
-                {
-                    {
-                        CheckRawMode(false);
-                        CheckSingleMode(true);
-
-                        int32_t pos = stream->Position();
-
-                        int32_t fieldId = idRslvr->GetFieldId(typeId, fieldName);
-                        int32_t fieldLen = SeekField(fieldId);
-
-                        if (fieldLen > 0) {
-                            int32_t realLen = ReadArrayInternal(res, len, stream, func, expHdr);
-
-                            // If actual read didn't occur return to initial position so that we do not perform 
-                            // N jumps to find the field again, where N is total amount of fields.
-                            if (realLen != -1 && (!res || realLen > len))
-                                stream->Position(pos);
-
-                            return realLen;
-                        }
-
-                        return -1;
-                    }
-                }
-
-                /**
-                 * Internal read array routine.
-                 *
-                 * @param res Resulting array.
-                 * @param len Length.                 
-                 * @param stream Stream.
-                 * @param func Function to be invoked on stream.
-                 * @param expHdr Expected header.
-                 * @return Length.
-                 */
-                template<typename T>
-                static int32_t ReadArrayInternal(
-                    T* res,
-                    const int32_t len,
-                    interop::InteropInputStream* stream,
-                    void(*func)(interop::InteropInputStream*, T* const, const int32_t),
-                    const int8_t expHdr
-                )
-                {
-                    {
-                        int8_t hdr = stream->ReadInt8();
-
-                        if (hdr == expHdr)
-                        {
-                            int32_t realLen = stream->ReadInt32();
-
-                            if (realLen == 0 || (res && len >= realLen))
-                                func(stream, res, realLen);
-                            else
-                                stream->Position(stream->Position() - 5);
-
-                            return realLen;
-                        }
-                        else if (hdr != IGNITE_HDR_NULL)
-                            ThrowOnInvalidHeader(stream->Position() - 1, expHdr, hdr);
-
-                        return -1;
-                    }
-                }
-
-                /**
-                 * Read nullable value.
-                 *
-                 * @param stream Stream.
-                 * @param func Function to be invoked on stream.
-                 * @param expHdr Expected header.
-                 */
-                template<typename T>
-                static T ReadNullable(
-                    interop::InteropInputStream* stream,
-                    T(*func)(interop::InteropInputStream*), 
-                    const int8_t expHdr
-                )
-                {
-                    {
-                        int8_t hdr = stream->ReadInt8();
-
-                        if (hdr == expHdr)
-                            return func(stream);
-                        else if (hdr == IGNITE_HDR_NULL)
-                            return Guid();
-                        else {
-                            ThrowOnInvalidHeader(stream->Position() - 1, expHdr, hdr);
-
-                            return Guid();
-                        }
-                    }
-                }
-
-                /**
-                 * Seek field with the given ID.
-                 *
-                 * @param fieldId Field ID.
-                 * @return Field length or -1 if field is not found.
-                 */
-                int32_t SeekField(const int32_t fieldId);
-
-                /**
-                 * Check raw mode.
-                 * 
-                 * @param expected Expected raw mode of the reader.
-                 */
-                void CheckRawMode(bool expected);
-
-                /**
-                 * Check whether reader is currently operating in single mode.
-                 *
-                 * @param expected Expected value.
-                 */
-                void CheckSingleMode(bool expected);
-
-                /**
-                 * Start new container reader session.
-                 *
-                 * @param expRawMode Expected raw mode.
-                 * @param expHdr Expected header.
-                 * @param size Container size.
-                 * @return Session ID.
-                 */
-                int32_t StartContainerSession(const bool expRawMode, const int8_t expHdr, int32_t* size);
-
-                /**
-                 * Check whether session ID matches.
-                 *
-                 * @param ses Expected session ID.
-                 */
-                void CheckSession(int32_t expSes);
-
-                /**
-                 * Throw an error due to invalid header.
-                 *
-                 * @param pos Position in the stream.
-                 * @param expHdr Expected header.
-                 * @param hdr Actual header.
-                 */
-                static void ThrowOnInvalidHeader(int32_t pos, int8_t expHdr, int8_t hdr);
-
-                /**
-                 * Throw an error due to invalid header.
-                 *
-                 * @param expHdr Expected header.
-                 * @param hdr Actual header.
-                 */
-                void ThrowOnInvalidHeader(int8_t expHdr, int8_t hdr);
-
-                /**
-                 * Internal string read routine.
-                 *
-                 * @param res Resulting array.
-                 * @param len Length of array.
-                 * @return Real array length.
-                 */
-                int32_t ReadStringInternal(char* res, const int32_t len);
-
-                /**
-                 * Read value.
-                 *
-                 * @param expHdr Expected header.
-                 * @param func Function to be applied to the stream.
-                 */
-                template<typename T>
-                T ReadTopObject0(const int8_t expHdr, T(*func) (ignite::impl::interop::InteropInputStream*))
-                {
-                    int8_t typeId = stream->ReadInt8();
-
-                    if (typeId == expHdr)
-                        return func(stream);
-                    else if (typeId == IGNITE_HDR_NULL)
-                        return GetNull<T>();
-                    else {
-                        int32_t pos = stream->Position() - 1;
-
-                        IGNITE_ERROR_FORMATTED_3(IgniteError::IGNITE_ERR_PORTABLE, "Invalid header", "position", pos, "expected", expHdr, "actual", typeId)
-                    }
-                }
-
-                /**
-                 * Read value.
-                 *
-                 * @param expHdr Expected header.
-                 * @param func Function to be applied to the stream.
-                 * @param dflt Default value.
-                 */
-                template<typename T>
-                T ReadTopObject0(const int8_t expHdr, T(*func) (ignite::impl::interop::InteropInputStream*), T dflt)
-                {
-                    int8_t typeId = stream->ReadInt8();
-
-                    if (typeId == expHdr)
-                        return func(stream);
-                    else if (typeId == IGNITE_HDR_NULL)
-                        return dflt;
-                    else {
-                        int32_t pos = stream->Position() - 1;
-
-                        IGNITE_ERROR_FORMATTED_3(IgniteError::IGNITE_ERR_PORTABLE, "Invalid header", "position", pos, "expected", expHdr, "actual", typeId)
-                    }
-                }
-            };
-
-            template<>
-            int8_t IGNITE_IMPORT_EXPORT PortableReaderImpl::ReadTopObject<int8_t>();
-
-            template<>
-            bool IGNITE_IMPORT_EXPORT PortableReaderImpl::ReadTopObject<bool>();
-
-            template<>
-            int16_t IGNITE_IMPORT_EXPORT PortableReaderImpl::ReadTopObject<int16_t>();
-
-            template<>
-            uint16_t IGNITE_IMPORT_EXPORT PortableReaderImpl::ReadTopObject<uint16_t>();
-
-            template<>
-            int32_t IGNITE_IMPORT_EXPORT PortableReaderImpl::ReadTopObject<int32_t>();
-
-            template<>
-            int64_t IGNITE_IMPORT_EXPORT PortableReaderImpl::ReadTopObject<int64_t>();
-
-            template<>
-            float IGNITE_IMPORT_EXPORT PortableReaderImpl::ReadTopObject<float>();
-
-            template<>
-            double IGNITE_IMPORT_EXPORT PortableReaderImpl::ReadTopObject<double>();
-
-            
-            template<>
-            Guid IGNITE_IMPORT_EXPORT PortableReaderImpl::ReadTopObject<Guid>();
-
-            template<>
-            inline std::string IGNITE_IMPORT_EXPORT PortableReaderImpl::ReadTopObject<std::string>()
-            {
-                int8_t typeId = stream->ReadInt8();
-
-                if (typeId == IGNITE_TYPE_STRING)
-                {
-                    bool utf8Mode = stream->ReadBool();
-                    int32_t realLen = stream->ReadInt32();
-
-                    ignite::impl::utils::SafeArray<char> arr(realLen + 1);
-
-                    if (utf8Mode)
-                    {
-                        for (int i = 0; i < realLen; i++)
-                            *(arr.target + i) = static_cast<char>(stream->ReadInt8());
-                    }
-                    else
-                    {
-                        for (int i = 0; i < realLen; i++)
-                            *(arr.target + i) = static_cast<char>(stream->ReadUInt16());
-                    }
-
-                    *(arr.target + realLen) = 0;
-
-                    return std::string(arr.target);
-                }
-
-                else if (typeId == IGNITE_HDR_NULL)
-                    return std::string();
-                else {
-                    int32_t pos = stream->Position() - 1;
-
-                    IGNITE_ERROR_FORMATTED_3(IgniteError::IGNITE_ERR_PORTABLE, "Invalid header", "position", pos, "expected", IGNITE_TYPE_STRING, "actual", typeId)
-                }
-            }
-        }
-    }
-}
-
-#endif
\ No newline at end of file


[13/28] ignite git commit: IGNITE-1513: Moved CPP.

Posted by vo...@apache.org.
http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/common/os/linux/src/concurrent_os.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/common/os/linux/src/concurrent_os.cpp b/modules/platform/src/main/cpp/common/os/linux/src/concurrent_os.cpp
deleted file mode 100644
index 44f0b22..0000000
--- a/modules/platform/src/main/cpp/common/os/linux/src/concurrent_os.cpp
+++ /dev/null
@@ -1,175 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "ignite/common/concurrent_os.h"
-
-namespace ignite
-{
-    namespace common
-    {
-        namespace concurrent
-        {
-            /** Key indicating that the thread is attached. */
-            static pthread_key_t tlsKey;
-
-            /** Helper to ensure that attach key is allocated only once. */
-            static pthread_once_t tlsKeyInit = PTHREAD_ONCE_INIT;
-            
-            /**
-             * Routine to destroy TLS key.
-             * 
-             * @param key Key.
-             */
-            void DestroyTlsKey(void* key) {
-                ThreadLocal::Clear0(key);
-            }
-            
-            /**
-             * Routine to allocate TLS key.
-             */
-            void AllocateTlsKey() {
-                pthread_key_create(&tlsKey, DestroyTlsKey);
-            }
-            
-            void Memory::Fence() {
-                __asm__ volatile ("" ::: "memory");
-            }
-
-            CriticalSection::CriticalSection() {
-                pthread_mutex_init(&mux, NULL);
-                
-                Memory::Fence();
-            }
-
-            CriticalSection::~CriticalSection() {
-                Memory::Fence();
-                
-                pthread_mutex_destroy(&mux);
-            }
-
-            void CriticalSection::Enter() {
-                Memory::Fence();
-                
-                pthread_mutex_lock(&mux);
-            }
-
-            void CriticalSection::Leave() {
-                Memory::Fence();
-                
-                pthread_mutex_unlock(&mux);
-            }
-
-            SingleLatch::SingleLatch()
-            {
-                pthread_mutex_init(&mux, NULL);
-                pthread_cond_init(&cond, NULL);
-                ready = false;
-                
-                Memory::Fence();
-            }
-
-            SingleLatch::~SingleLatch()
-            {
-                Memory::Fence();
-
-                pthread_cond_destroy(&cond);
-                pthread_mutex_destroy(&mux);
-            }
-
-            void SingleLatch::CountDown()
-            {
-                pthread_mutex_lock(&mux);
-                
-                if (!ready) {
-                    ready = true;
-                    
-                    pthread_cond_broadcast(&cond);
-                }
-                
-                pthread_mutex_unlock(&mux);
-                
-                Memory::Fence();
-            }
-
-            void SingleLatch::Await()
-            {
-                pthread_mutex_lock(&mux);
-                
-                while (!ready)
-                    pthread_cond_wait(&cond, &mux);
-                
-                pthread_mutex_unlock(&mux);
-                
-                Memory::Fence();
-            }
-
-            bool Atomics::CompareAndSet32(int32_t* ptr, int32_t expVal, int32_t newVal)
-            {
-                return __sync_bool_compare_and_swap(ptr, expVal, newVal);
-            }
-
-            int32_t Atomics::CompareAndSet32Val(int32_t* ptr, int32_t expVal, int32_t newVal)
-            {
-                return __sync_val_compare_and_swap(ptr, expVal, newVal);
-            }
-
-            int32_t Atomics::IncrementAndGet32(int32_t* ptr)
-            {
-               return __sync_fetch_and_add(ptr, 1) + 1;
-            }
-
-            int32_t Atomics::DecrementAndGet32(int32_t* ptr)
-            {
-               return __sync_fetch_and_sub(ptr, 1) - 1;
-            }
-
-            bool Atomics::CompareAndSet64(int64_t* ptr, int64_t expVal, int64_t newVal)
-            {
-               return __sync_bool_compare_and_swap(ptr, expVal, newVal);
-            }
-
-            int64_t Atomics::CompareAndSet64Val(int64_t* ptr, int64_t expVal, int64_t newVal)
-            {
-               return __sync_val_compare_and_swap(ptr, expVal, newVal);
-            }
-
-            int64_t Atomics::IncrementAndGet64(int64_t* ptr)
-            {
-               return __sync_fetch_and_add(ptr, 1) + 1;
-            }
-
-            int64_t Atomics::DecrementAndGet64(int64_t* ptr)
-            {
-               return __sync_fetch_and_sub(ptr, 1) - 1;
-            }
-
-            void* ThreadLocal::Get0()
-            {
-                pthread_once(&tlsKeyInit, AllocateTlsKey);
-                                
-                return pthread_getspecific(tlsKey);
-            }
-
-            void ThreadLocal::Set0(void* ptr)
-            {
-                pthread_once(&tlsKeyInit, AllocateTlsKey);
-                
-                pthread_setspecific(tlsKey, ptr);
-            }
-        }
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/common/os/win/include/ignite/common/common.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/common/os/win/include/ignite/common/common.h b/modules/platform/src/main/cpp/common/os/win/include/ignite/common/common.h
deleted file mode 100644
index 9e57bde..0000000
--- a/modules/platform/src/main/cpp/common/os/win/include/ignite/common/common.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#ifndef _IGNITE_COMMON_COMMON
-#define _IGNITE_COMMON_COMMON
-
-#define IGNITE_EXPORT __declspec(dllexport)
-#define IGNITE_IMPORT __declspec(dllimport)
-#define IGNITE_CALL __stdcall
-
-#define IGNITE_IMPORT_EXPORT IGNITE_EXPORT
-
-#include <iostream>
-
-#define IGNITE_TRACE_ALLOC(addr) \
-    std::cout << "ALLOC " << __FILE__ << "(" << __LINE__ << "): 0x" << (void*)addr << std::endl;
-
-/**
- * Common construction to disable copy constructor and assignment for class.
- */
-#define IGNITE_NO_COPY_ASSIGNMENT(cls) \
-    cls(const cls& src); \
-    cls& operator= (const cls& other); 
-
-namespace ignite
-{
-    namespace common
-    {
-        /**
-         * Helper class to manage attached threads.
-         */
-        class AttachHelper 
-        {
-        public:                       
-            /**
-             * Callback invoked on successful thread attach ot JVM.
-             */
-            static void OnThreadAttach();
-        };   
-    }
-}
-
-#endif
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/common/os/win/include/ignite/common/concurrent_os.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/common/os/win/include/ignite/common/concurrent_os.h b/modules/platform/src/main/cpp/common/os/win/include/ignite/common/concurrent_os.h
deleted file mode 100644
index 0a47beb..0000000
--- a/modules/platform/src/main/cpp/common/os/win/include/ignite/common/concurrent_os.h
+++ /dev/null
@@ -1,406 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef _IGNITE_COMMON_CONCURRENT_OS
-#define _IGNITE_COMMON_CONCURRENT_OS
-
-#include <map>
-#include <stdint.h>
-#include <windows.h>
-
-#include "ignite/common/common.h"
-
-namespace ignite
-{
-    namespace common 
-    {
-        namespace concurrent 
-        {
-            /**
-             * Static class to manage memory visibility semantics. 
-             */
-            class IGNITE_IMPORT_EXPORT Memory {
-            public:
-                /**
-                 * Full fence. 
-                 */
-                static void Fence();
-            };
-
-            /**
-             * Critical section.
-             */
-            class IGNITE_IMPORT_EXPORT CriticalSection {
-            public:
-                /**
-                 * Constructor.
-                 */
-                CriticalSection();
-
-                /**
-                 * Destructor. 
-                 */
-                ~CriticalSection();
-
-                /**
-                 * Enter critical section.
-                 */
-                void Enter();
-
-                /**
-                 * Leave critical section.
-                 */
-                void Leave();
-            private:
-                /** Handle. */
-                CRITICAL_SECTION* hnd;
-
-                IGNITE_NO_COPY_ASSIGNMENT(CriticalSection)
-            };
-
-            /**
-             * Special latch with count = 1.
-             */
-            class IGNITE_IMPORT_EXPORT SingleLatch
-            {                
-            public:
-                /**
-                 * Constructor.
-                 */
-                SingleLatch();
-
-                /**
-                 * Destructor.
-                 */
-                ~SingleLatch();
-
-                /**
-                 * Perform the countdown.
-                 */
-                void CountDown();
-
-                /**
-                 * Await the countdown.
-                 */
-                void Await();
-            private:
-                /** Handle. */
-                void* hnd;
-
-                IGNITE_NO_COPY_ASSIGNMENT(SingleLatch)
-            };
-
-            /**
-             * Primitives for atomic access.
-             */
-            class IGNITE_IMPORT_EXPORT Atomics
-            {
-            public:
-                /**
-                 * Update the 32-bit integer value if it is equal to expected value.
-                 *
-                 * @param ptr Pointer.
-                 * @param expVal Expected value.
-                 * @param newVal New value.
-                 * @return True if update occurred as a result of this call, false otherwise.
-                 */
-                static bool CompareAndSet32(int32_t* ptr, int32_t expVal, int32_t newVal);
-
-                /**
-                 * Update the 32-bit integer value if it is equal to expected value.
-                 *
-                 * @param ptr Pointer.
-                 * @param expVal Expected value.
-                 * @param newVal New value.
-                 * @return Value which were observed during CAS attempt.
-                 */
-                static int32_t CompareAndSet32Val(int32_t* ptr, int32_t expVal, int32_t newVal);
-                
-                /**
-                 * Increment 32-bit integer and return new value.
-                 *
-                 * @param ptr Pointer.
-                 * @return Value after increment.
-                 */
-                static int32_t IncrementAndGet32(int32_t* ptr);
-
-                /**
-                 * Decrement 32-bit integer and return new value.
-                 *
-                 * @param ptr Pointer.
-                 * @return Value after decrement.
-                 */
-                static int32_t DecrementAndGet32(int32_t* ptr);
-
-                /**
-                 * Update the 64-bit integer value if it is equal to expected value.
-                 *
-                 * @param ptr Pointer.
-                 * @param expVal Expected value.
-                 * @param newVal New value.
-                 * @return True if update occurred as a result of this call, false otherwise.
-                 */
-                static bool CompareAndSet64(int64_t* ptr, int64_t expVal, int64_t newVal);
-
-                /**
-                 * Update the 64-bit integer value if it is equal to expected value.
-                 *
-                 * @param ptr Pointer.
-                 * @param expVal Expected value.
-                 * @param newVal New value.
-                 * @return Value which were observed during CAS attempt.
-                 */
-                static int64_t CompareAndSet64Val(int64_t* ptr, int64_t expVal, int64_t newVal);
-                
-                /**
-                 * Increment 64-bit integer and return new value.
-                 *
-                 * @param ptr Pointer.
-                 * @return Value after increment.
-                 */
-                static int64_t IncrementAndGet64(int64_t* ptr);
-
-                /**
-                 * Decrement 64-bit integer and return new value.
-                 *
-                 * @param ptr Pointer.
-                 * @return Value after decrement.
-                 */
-                static int64_t DecrementAndGet64(int64_t* ptr);
-            };
-
-            /**
-             * Thread-local entry.
-             */
-            class IGNITE_IMPORT_EXPORT ThreadLocalEntry
-            {
-            public:
-                /**
-                 * Virtual destructor to allow for correct typed entries cleanup.
-                 */
-                virtual ~ThreadLocalEntry()
-                {
-                    // No-op.
-                }
-            };
-
-            /**
-             * Typed thread-local entry.
-             */
-            template<typename T>
-            class IGNITE_IMPORT_EXPORT ThreadLocalTypedEntry : public ThreadLocalEntry
-            {
-            public:
-                /**
-                 * Constructor.
-                 *
-                 * @param val Value.
-                 */
-                ThreadLocalTypedEntry(T val) : val(val)
-                {
-                    // No-op.
-                }
-                
-                ~ThreadLocalTypedEntry()
-                {
-                    // No-op.
-                }
-
-                /**
-                 * Get value.
-                 *
-                 * @return Value.
-                 */
-                T Get()
-                {
-                    return val;
-                }
-            private:
-                /** Value. */
-                T val; 
-            };
-
-            /**
-             * Thread-local abstraction.
-             */
-            class IGNITE_IMPORT_EXPORT ThreadLocal
-            {
-            public:
-                /**
-                 * Allocate thread-local index. Invoked once on DLL process attach.
-                 *
-                 * @return True if allocation was successful.
-                 */
-                static bool OnProcessAttach();
-
-                /**
-                 * Release thread-local entry. Invoked on DLL thread detach.
-                 */
-                static void OnThreadDetach();
-
-                /**
-                 * Release thread-local index. Invoked once on DLL process detach.
-                 */
-                static void OnProcessDetach();
-
-                /**
-                 * Get next available index to be used in thread-local storage.
-                 *
-                 * @return Index.
-                 */
-                static int32_t NextIndex();
-
-                /**
-                 * Get value by index.
-                 *
-                 * @param idx Index.
-                 * @return Value associated with the index or NULL.
-                 */
-                template<typename T>
-                static T Get(int32_t idx)
-                {
-                    void* winVal = Get0();
-
-                    if (winVal)
-                    {
-                        std::map<int32_t, ThreadLocalEntry*>* map = 
-                            static_cast<std::map<int32_t, ThreadLocalEntry*>*>(winVal);
-
-                        ThreadLocalTypedEntry<T>* entry = static_cast<ThreadLocalTypedEntry<T>*>((*map)[idx]);
-                        
-                        if (entry)
-                            return entry->Get();
-                    }
-
-                    return T();
-                }
-
-                /**
-                 * Set value at the given index.
-                 *
-                 * @param idx Index.
-                 * @param val Value to be associated with the index.
-                 */
-                template<typename T>
-                static void Set(int32_t idx, const T& val)
-                {
-                    void* winVal = Get0();
-
-                    if (winVal)
-                    {
-                        std::map<int32_t, ThreadLocalEntry*>* map = 
-                            static_cast<std::map<int32_t, ThreadLocalEntry*>*>(winVal);
-
-                        ThreadLocalEntry* appVal = (*map)[idx];
-
-                        if (appVal)
-                            delete appVal;
-
-                        (*map)[idx] = new ThreadLocalTypedEntry<T>(val);
-                    }
-                    else
-                    {
-                        std::map<int32_t, ThreadLocalEntry*>* map = new std::map<int32_t, ThreadLocalEntry*>();
-
-                        Set0(map);
-
-                        (*map)[idx] = new ThreadLocalTypedEntry<T>(val);
-                    }
-                }
-
-                /**
-                 * Remove value at the given index.
-                 *
-                 * @param idx Index.
-                 */
-                static void Remove(int32_t idx);
-
-            private:
-                /**
-                 * Internal get routine.
-                 *
-                 * @param Associated value.
-                 */
-                static void* Get0();
-
-                /**
-                 * Internal set routine.
-                 *
-                 * @param ptr Pointer.
-                 */
-                static void Set0(void* ptr);
-
-                /**
-                 * Internal thread-local map clear routine.
-                 *
-                 * @param mapPtr Pointer to map.
-                 */
-                static void Clear0(void* mapPtr);
-            };
-
-            /**
-             * Thread-local instance. Simplifies API avoiding direct index allocations.
-             */
-            template<typename T>
-            class IGNITE_IMPORT_EXPORT ThreadLocalInstance
-            {
-            public:
-                /**
-                 * Constructor.
-                 */
-                ThreadLocalInstance() : idx(ThreadLocal::NextIndex())
-                {
-                    // No-op.
-                }
-
-                /**
-                 * Get value.
-                 *
-                 * @return Value.
-                 */
-                T Get()
-                {
-                    return ThreadLocal::Get<T>(idx);
-                }
-
-                /**
-                 * Set instance.
-                 *
-                 * @param val Value.
-                 */
-                void Set(const T& val)
-                {
-                    ThreadLocal::Set<T>(idx, val);
-                }
-
-                /**
-                 * Remove instance.
-                 */
-                void Remove()
-                {
-                    ThreadLocal::Remove(idx);
-                }
-
-            private:
-                /** Index. */
-                int32_t idx; 
-            };
-        }
-    }
-}
-
-#endif
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/common/os/win/src/common.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/common/os/win/src/common.cpp b/modules/platform/src/main/cpp/common/os/win/src/common.cpp
deleted file mode 100644
index e83e736..0000000
--- a/modules/platform/src/main/cpp/common/os/win/src/common.cpp
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <windows.h>
-
-#include "ignite/common/common.h"
-#include "ignite/common/concurrent.h"
-#include "ignite/common/java.h"
-
-using namespace ignite::common::concurrent;
-using namespace ignite::common::java;
-
-namespace ignite
-{
-    namespace common
-    {
-        void AttachHelper::OnThreadAttach()
-        {
-            // No-op.
-        }
-    }
-}
-
-BOOL WINAPI DllMain(_In_ HINSTANCE hinstDLL, _In_ DWORD fdwReason, _In_ LPVOID lpvReserved)
-{
-    switch (fdwReason)
-    {
-        case DLL_PROCESS_ATTACH:
-            if (!ThreadLocal::OnProcessAttach())
-                return FALSE;
-
-            break;
-
-        case DLL_THREAD_DETACH:
-            ThreadLocal::OnThreadDetach();
-
-            JniContext::Detach();
-
-            break;
-
-        case DLL_PROCESS_DETACH:
-            ThreadLocal::OnProcessDetach();
-
-            break;
-
-        default:
-            break;
-    }
-
-    return TRUE;
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/common/os/win/src/concurrent_os.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/common/os/win/src/concurrent_os.cpp b/modules/platform/src/main/cpp/common/os/win/src/concurrent_os.cpp
deleted file mode 100644
index a21f7ec..0000000
--- a/modules/platform/src/main/cpp/common/os/win/src/concurrent_os.cpp
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "ignite/common/concurrent_os.h"
-
-namespace ignite
-{
-    namespace common
-    {
-        namespace concurrent
-        {
-            /** Thread-local index for Windows. */
-            DWORD winTlsIdx;
-
-            void Memory::Fence() {
-                MemoryBarrier();
-            }
-
-            CriticalSection::CriticalSection() : hnd(new CRITICAL_SECTION) {
-                InitializeCriticalSection(hnd);
-
-                Memory::Fence();
-            }
-
-            CriticalSection::~CriticalSection() {
-                Memory::Fence();
-
-                delete hnd;
-            }
-
-            void CriticalSection::Enter() {
-                Memory::Fence();
-
-                EnterCriticalSection(hnd);
-            }
-
-            void CriticalSection::Leave() {
-                Memory::Fence();
-
-                LeaveCriticalSection(hnd);
-            }
-
-            SingleLatch::SingleLatch() : hnd(CreateEvent(NULL, TRUE, FALSE, NULL))
-            {
-                Memory::Fence();
-            }
-
-            SingleLatch::~SingleLatch()
-            {
-                Memory::Fence();
-
-                CloseHandle(hnd);
-            }
-
-            void SingleLatch::CountDown()
-            {
-                SetEvent(hnd);
-            }
-
-            void SingleLatch::Await()
-            {
-                WaitForSingleObject(hnd, INFINITE);
-            }
-
-            bool Atomics::CompareAndSet32(int32_t* ptr, int32_t expVal, int32_t newVal)
-            {
-                return CompareAndSet32Val(ptr, expVal, newVal) == expVal;
-            }
-
-            int32_t Atomics::CompareAndSet32Val(int32_t* ptr, int32_t expVal, int32_t newVal)
-            {
-                return InterlockedCompareExchange(reinterpret_cast<LONG*>(ptr), newVal, expVal);
-            }
-
-            int32_t Atomics::IncrementAndGet32(int32_t* ptr)
-            {
-                return InterlockedIncrement(reinterpret_cast<LONG*>(ptr));
-            }
-
-            int32_t Atomics::DecrementAndGet32(int32_t* ptr)
-            {
-                return InterlockedDecrement(reinterpret_cast<LONG*>(ptr));
-            }
-
-            bool Atomics::CompareAndSet64(int64_t* ptr, int64_t expVal, int64_t newVal)
-            {
-                return CompareAndSet64Val(ptr, expVal, newVal) == expVal;
-            }
-
-            int64_t Atomics::CompareAndSet64Val(int64_t* ptr, int64_t expVal, int64_t newVal)
-            {
-                return InterlockedCompareExchange64(reinterpret_cast<LONG64*>(ptr), newVal, expVal);
-            }
-
-            int64_t Atomics::IncrementAndGet64(int64_t* ptr)
-            {
-                return InterlockedIncrement64(reinterpret_cast<LONG64*>(ptr));
-            }
-
-            int64_t Atomics::DecrementAndGet64(int64_t* ptr)
-            {
-                return InterlockedDecrement64(reinterpret_cast<LONG64*>(ptr));
-            }
-            
-            bool ThreadLocal::OnProcessAttach()
-            {
-                return (winTlsIdx = TlsAlloc()) != TLS_OUT_OF_INDEXES;
-            }
-
-            void ThreadLocal::OnThreadDetach()
-            {
-                if (winTlsIdx != TLS_OUT_OF_INDEXES)
-                {
-                    void* mapPtr = Get0();
-
-                    Clear0(mapPtr);
-                }
-            }
-
-            void ThreadLocal::OnProcessDetach()
-            {
-                if (winTlsIdx != TLS_OUT_OF_INDEXES)
-                    TlsFree(winTlsIdx);
-            }
-
-            void* ThreadLocal::Get0()
-            {
-                return TlsGetValue(winTlsIdx);
-            }
-
-            void ThreadLocal::Set0(void* ptr)
-            {
-                TlsSetValue(winTlsIdx, ptr);
-            }
-        }
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/common/project/README.TXT
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/common/project/README.TXT b/modules/platform/src/main/cpp/common/project/README.TXT
deleted file mode 100644
index 97f4c64..0000000
--- a/modules/platform/src/main/cpp/common/project/README.TXT
+++ /dev/null
@@ -1 +0,0 @@
-Contains IDE projects artifacts.

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/common/project/vs/README.TXT
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/common/project/vs/README.TXT b/modules/platform/src/main/cpp/common/project/vs/README.TXT
deleted file mode 100644
index f4fb456..0000000
--- a/modules/platform/src/main/cpp/common/project/vs/README.TXT
+++ /dev/null
@@ -1 +0,0 @@
-Contains Visual Studio project artifacts.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/common/project/vs/common.vcxproj
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/common/project/vs/common.vcxproj b/modules/platform/src/main/cpp/common/project/vs/common.vcxproj
deleted file mode 100644
index b7cfb8a..0000000
--- a/modules/platform/src/main/cpp/common/project/vs/common.vcxproj
+++ /dev/null
@@ -1,202 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="Debug|Win32">
-      <Configuration>Debug</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Debug|x64">
-      <Configuration>Debug</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|Win32">
-      <Configuration>Release</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|x64">
-      <Configuration>Release</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectGuid>{4F7E4917-4612-4B96-9838-025711ADE391}</ProjectGuid>
-    <Keyword>Win32Proj</Keyword>
-    <RootNamespace>common</RootNamespace>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
-    <ConfigurationType>DynamicLibrary</ConfigurationType>
-    <UseDebugLibraries>true</UseDebugLibraries>
-    <PlatformToolset>v100</PlatformToolset>
-    <CharacterSet>Unicode</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
-    <ConfigurationType>DynamicLibrary</ConfigurationType>
-    <UseDebugLibraries>true</UseDebugLibraries>
-    <PlatformToolset>v100</PlatformToolset>
-    <CharacterSet>Unicode</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
-    <ConfigurationType>DynamicLibrary</ConfigurationType>
-    <UseDebugLibraries>false</UseDebugLibraries>
-    <PlatformToolset>v100</PlatformToolset>
-    <WholeProgramOptimization>true</WholeProgramOptimization>
-    <CharacterSet>Unicode</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-    <ConfigurationType>DynamicLibrary</ConfigurationType>
-    <UseDebugLibraries>false</UseDebugLibraries>
-    <PlatformToolset>v100</PlatformToolset>
-    <WholeProgramOptimization>true</WholeProgramOptimization>
-    <CharacterSet>Unicode</CharacterSet>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
-    <LinkIncremental>true</LinkIncremental>
-    <TargetName>ignite.common</TargetName>
-    <OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
-    <IntDir>$(Platform)\$(Configuration)\</IntDir>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <TargetName>ignite.common</TargetName>
-    <OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
-    <IntDir>$(Platform)\$(Configuration)\</IntDir>
-    <LinkIncremental>true</LinkIncremental>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
-    <LinkIncremental>false</LinkIncremental>
-    <TargetName>ignite.common</TargetName>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <TargetName>ignite.common</TargetName>
-    <OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
-    <IntDir>$(Platform)\$(Configuration)\</IntDir>
-    <LinkIncremental>false</LinkIncremental>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
-    <ClCompile>
-      <PrecompiledHeader>NotUsing</PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <Optimization>Disabled</Optimization>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;IGNITEJVM_EXPORTS;_CRT_SECURE_NO_WARNINGS;IGNITE_IMPL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <AdditionalIncludeDirectories>$(JAVA_HOME)\include;$(JAVA_HOME)\include\win32;$(ProjectDir)\..\..\include;$(ProjectDir)\..\..\os\win\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-    </ClCompile>
-    <Link>
-      <SubSystem>Windows</SubSystem>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <AdditionalDependencies>$(JAVA_HOME)\lib\jvm.lib;%(AdditionalDependencies)</AdditionalDependencies>
-      <AdditionalLibraryDirectories>$(JAVA_HOME)\lib\jvm.lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
-      <DelayLoadDLLs>jvm.dll</DelayLoadDLLs>
-      <ModuleDefinitionFile>module.def</ModuleDefinitionFile>
-      <OptimizeReferences>false</OptimizeReferences>
-      <EnableCOMDATFolding>false</EnableCOMDATFolding>
-      <LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <ClCompile>
-      <WarningLevel>Level3</WarningLevel>
-      <SDLCheck>false</SDLCheck>
-      <AdditionalIncludeDirectories>$(JAVA_HOME)\include;$(JAVA_HOME)\include\win32;$(ProjectDir)\..\..\include;$(ProjectDir)\..\..\os\win\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;IGNITEJVM_EXPORTS;_CRT_SECURE_NO_WARNINGS;IGNITE_IMPL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
-    </ClCompile>
-    <Link>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <AdditionalLibraryDirectories>$(JAVA_HOME)\lib\jvm.lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
-      <AdditionalDependencies>$(JAVA_HOME)\lib\jvm.lib;%(AdditionalDependencies)</AdditionalDependencies>
-      <OptimizeReferences>true</OptimizeReferences>
-      <EnableCOMDATFolding>true</EnableCOMDATFolding>
-      <DelayLoadDLLs>jvm.dll</DelayLoadDLLs>
-      <LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
-      <ModuleDefinitionFile>module.def</ModuleDefinitionFile>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
-    <ClCompile>
-      <WarningLevel>Level3</WarningLevel>
-      <PrecompiledHeader>NotUsing</PrecompiledHeader>
-      <Optimization>MaxSpeed</Optimization>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <IntrinsicFunctions>true</IntrinsicFunctions>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;IGNITEJVM_EXPORTS;_CRT_SECURE_NO_WARNINGS;IGNITE_IMPL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <AdditionalIncludeDirectories>$(JAVA_HOME)\include;$(JAVA_HOME)\include\win32;$(ProjectDir)\..\..\include;$(ProjectDir)\..\..\os\win\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
-      <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
-      <OmitFramePointers>true</OmitFramePointers>
-      <BufferSecurityCheck>false</BufferSecurityCheck>
-      <StringPooling>true</StringPooling>
-    </ClCompile>
-    <Link>
-      <SubSystem>Windows</SubSystem>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <EnableCOMDATFolding>true</EnableCOMDATFolding>
-      <OptimizeReferences>true</OptimizeReferences>
-      <AdditionalDependencies>$(JAVA_HOME)\lib\jvm.lib;%(AdditionalDependencies)</AdditionalDependencies>
-      <AdditionalLibraryDirectories>$(JAVA_HOME)\lib\jvm.lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
-      <DelayLoadDLLs>jvm.dll</DelayLoadDLLs>
-      <ModuleDefinitionFile>module.def</ModuleDefinitionFile>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <ClCompile>
-      <WarningLevel>Level3</WarningLevel>
-      <Optimization>Full</Optimization>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <IntrinsicFunctions>true</IntrinsicFunctions>
-      <SDLCheck>false</SDLCheck>
-      <AdditionalIncludeDirectories>$(JAVA_HOME)\include;$(JAVA_HOME)\include\win32;$(ProjectDir)\..\..\include;$(ProjectDir)\..\..\os\win\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
-      <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
-      <OmitFramePointers>true</OmitFramePointers>
-      <StringPooling>true</StringPooling>
-      <BufferSecurityCheck>false</BufferSecurityCheck>
-      <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;IGNITE_IMPL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-    </ClCompile>
-    <Link>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <EnableCOMDATFolding>true</EnableCOMDATFolding>
-      <OptimizeReferences>true</OptimizeReferences>
-      <AdditionalLibraryDirectories>$(JAVA_HOME)\lib\jvm.lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
-      <AdditionalDependencies>$(JAVA_HOME)\lib\jvm.lib;%(AdditionalDependencies)</AdditionalDependencies>
-      <DelayLoadDLLs>jvm.dll</DelayLoadDLLs>
-      <ModuleDefinitionFile>module.def</ModuleDefinitionFile>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <ClInclude Include="..\..\include\ignite\common\concurrent.h" />
-    <ClInclude Include="..\..\include\ignite\common\exports.h" />
-    <ClInclude Include="..\..\include\ignite\common\java.h" />
-    <ClInclude Include="..\..\os\win\include\ignite\common\common.h" />
-    <ClInclude Include="..\..\os\win\include\ignite\common\concurrent_os.h" />
-    <ClInclude Include="targetver.h" />
-  </ItemGroup>
-  <ItemGroup>
-    <ClCompile Include="..\..\os\win\src\common.cpp" />
-    <ClCompile Include="..\..\os\win\src\concurrent_os.cpp" />
-    <ClCompile Include="..\..\src\concurrent.cpp" />
-    <ClCompile Include="..\..\src\exports.cpp" />
-    <ClCompile Include="..\..\src\java.cpp" />
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-  <ItemGroup>
-    <None Include="module.def" />
-  </ItemGroup>
-</Project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/common/project/vs/common.vcxproj.filters
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/common/project/vs/common.vcxproj.filters b/modules/platform/src/main/cpp/common/project/vs/common.vcxproj.filters
deleted file mode 100644
index 3d4ae54..0000000
--- a/modules/platform/src/main/cpp/common/project/vs/common.vcxproj.filters
+++ /dev/null
@@ -1,54 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup>
-    <Filter Include="Misc">
-      <UniqueIdentifier>{1dbec2be-5cb4-4f70-aef6-b4627d39b99b}</UniqueIdentifier>
-    </Filter>
-    <Filter Include="Code">
-      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
-      <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
-    </Filter>
-  </ItemGroup>
-  <ItemGroup>
-    <ClInclude Include="..\..\os\win\include\ignite\common\common.h">
-      <Filter>Code</Filter>
-    </ClInclude>
-    <ClInclude Include="..\..\os\win\include\ignite\common\concurrent_os.h">
-      <Filter>Code</Filter>
-    </ClInclude>
-    <ClInclude Include="..\..\include\ignite\common\exports.h">
-      <Filter>Code</Filter>
-    </ClInclude>
-    <ClInclude Include="..\..\include\ignite\common\java.h">
-      <Filter>Code</Filter>
-    </ClInclude>
-    <ClInclude Include="..\..\include\ignite\common\concurrent.h">
-      <Filter>Code</Filter>
-    </ClInclude>
-    <ClInclude Include="targetver.h">
-      <Filter>Misc</Filter>
-    </ClInclude>
-  </ItemGroup>
-  <ItemGroup>
-    <ClCompile Include="..\..\os\win\src\common.cpp">
-      <Filter>Code</Filter>
-    </ClCompile>
-    <ClCompile Include="..\..\src\concurrent.cpp">
-      <Filter>Code</Filter>
-    </ClCompile>
-    <ClCompile Include="..\..\os\win\src\concurrent_os.cpp">
-      <Filter>Code</Filter>
-    </ClCompile>
-    <ClCompile Include="..\..\src\exports.cpp">
-      <Filter>Code</Filter>
-    </ClCompile>
-    <ClCompile Include="..\..\src\java.cpp">
-      <Filter>Code</Filter>
-    </ClCompile>
-  </ItemGroup>
-  <ItemGroup>
-    <None Include="module.def">
-      <Filter>Misc</Filter>
-    </None>
-  </ItemGroup>
-</Project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/common/project/vs/module.def
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/common/project/vs/module.def b/modules/platform/src/main/cpp/common/project/vs/module.def
deleted file mode 100644
index d9e8d2b..0000000
--- a/modules/platform/src/main/cpp/common/project/vs/module.def
+++ /dev/null
@@ -1,99 +0,0 @@
-LIBRARY ignite.common.dll
-EXPORTS
-IgniteReallocate @1 
-IgniteIgnitionStart @2 
-IgniteIgnitionInstance @3 
-IgniteIgnitionEnvironmentPointer @4 
-IgniteIgnitionStop @5 
-IgniteIgnitionStopAll @6 
-IgniteTargetOutLong @7
-IgniteProcessorReleaseStart @8 
-IgniteProcessorProjection @9 
-IgniteProcessorCache @10 
-IgniteProcessorCreateCache @11 
-IgniteProcessorGetOrCreateCache @12 
-IgniteProcessorAffinity @13 
-IgniteProcessorDataStreamer @14 
-IgniteProcessorTransactions @15 
-IgniteProcessorServices @16
-IgniteTargetInStreamOutObject @17 
-IgniteTargetInStreamOutLong @18 
-IgniteTargetOutStream @19 
-IgniteTargetInStreamOutStream @20 
-IgniteTargetInObjectStreamOutStream @21 
-IgniteTargetListenFuture @22 
-IgniteTargetListenFutureForOperation @23 
-IgniteAffinityPartitions @24 
-IgniteCacheWithSkipStore @25 
-IgniteCacheWithNoRetries @26 
-IgniteCacheWithExpiryPolicy @27 
-IgniteCacheWithAsync @28 
-IgniteCacheWithKeepPortable @29 
-IgniteCacheClear @30 
-IgniteCacheRemoveAll @31 
-IgniteCacheOutOpQueryCursor @32 
-IgniteCacheOutOpContinuousQuery @33 
-IgniteCacheIterator @34 
-IgniteCacheLocalIterator @35 
-IgniteCacheEnterLock @36 
-IgniteCacheExitLock @37 
-IgniteCacheTryEnterLock @38 
-IgniteCacheCloseLock @39 
-IgniteCacheRebalance @40 
-IgniteCacheSize @41 
-IgniteCacheStoreCallbackInvoke @42 
-IgniteComputeWithNoFailover @43 
-IgniteComputeWithTimeout @44 
-IgniteComputeExecuteNative @45 
-IgniteContinuousQueryClose @46 
-IgniteContinuousQueryGetInitialQueryCursor @47 
-IgniteDataStreamerListenTopology @48 
-IgniteDataStreamerAllowOverwriteGet @49 
-IgniteDataStreamerAllowOverwriteSet @50 
-IgniteDataStreamerSkipStoreGet @51 
-IgniteDataStreamerSkipStoreSet @52 
-IgniteDataStreamerPerNodeBufferSizeGet @53 
-IgniteDataStreamerPerNodeBufferSizeSet @54 
-IgniteDataStreamerPerNodeParallelOperationsGet @55 
-IgniteDataStreamerPerNodeParallelOperationsSet @56 
-IgniteMessagingWithAsync @57 
-IgniteProjectionForOthers @58 
-IgniteProjectionForRemotes @59 
-IgniteProjectionForDaemons @60 
-IgniteProjectionForRandom @61 
-IgniteProjectionForOldest @62 
-IgniteProjectionForYoungest @63 
-IgniteProcessorCompute @64 
-IgniteProcessorMessage @65 
-IgniteProcessorEvents @66 
-IgniteProjectionResetMetrics @67 
-IgniteProjectionOutOpRet @68 
-IgniteQueryCursorIterator @69 
-IgniteQueryCursorClose @70 
-IgniteTransactionsStart @71 
-IgniteTransactionsCommit @72 
-IgniteTransactionsCommitAsync @73 
-IgniteTransactionsRollback @74 
-IgniteTransactionsRollbackAsync @75 
-IgniteTransactionsClose @76 
-IgniteTransactionsState @77 
-IgniteTransactionsSetRollbackOnly @78 
-IgniteTransactionsResetMetrics @79 
-IgniteAcquire @80 
-IgniteRelease @81 
-IgniteThrowToJava @82 
-IgniteHandlersSize @83 
-IgniteCreateContext @84 
-IgniteDeleteContext @85 
-IgniteDestroyJvm @86 
-IgniteEventsWithAsync @87 
-IgniteEventsStopLocalListen @88 
-IgniteEventsLocalListen @89 
-IgniteEventsIsEnabled @90 
-IgniteTargetOutObject @91 
-IgniteServicesWithAsync @92
-IgniteServicesWithServerKeepPortable @93
-IgniteServicesCancel @94
-IgniteServicesCancelAll @95
-IgniteServicesGetServiceProxy @96
-IgniteProcessorExtensions @97
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/common/project/vs/targetver.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/common/project/vs/targetver.h b/modules/platform/src/main/cpp/common/project/vs/targetver.h
deleted file mode 100644
index 4bea158..0000000
--- a/modules/platform/src/main/cpp/common/project/vs/targetver.h
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#pragma once
-
-// Including SDKDDKVer.h defines the highest available Windows platform.
-
-// If you wish to build your application for a previous Windows platform, include WinSDKVer.h and
-// set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h.
-
-#include <SDKDDKVer.h>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/common/src/concurrent.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/common/src/concurrent.cpp b/modules/platform/src/main/cpp/common/src/concurrent.cpp
deleted file mode 100644
index 3f85b65..0000000
--- a/modules/platform/src/main/cpp/common/src/concurrent.cpp
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "ignite/common/concurrent.h"
-
-namespace ignite
-{
-    namespace common
-    {
-        namespace concurrent
-        {
-            /** Thread-local index generator for application. */
-            int32_t appTlsIdxGen = 0;
-
-            int32_t ThreadLocal::NextIndex()
-            {
-                return Atomics::IncrementAndGet32(&appTlsIdxGen);
-            }
-
-            void ThreadLocal::Remove(int32_t idx)
-            {
-                void* val = Get0();
-
-                if (val)
-                {
-                    std::map<int32_t, ThreadLocalEntry*>* map =
-                        static_cast<std::map<int32_t, ThreadLocalEntry*>*>(val);
-
-                    ThreadLocalEntry* appVal = (*map)[idx];
-
-                    if (appVal)
-                        delete appVal;
-
-                    map->erase(idx);
-
-                    if (map->size() == 0)
-                    {
-                        delete map;
-
-                        Set0(NULL);
-                    }
-                }
-            }
-
-            void ThreadLocal::Clear0(void* mapPtr)
-            {
-                if (mapPtr)
-                {
-                    std::map<int32_t, ThreadLocalEntry*>* map =
-                        static_cast<std::map<int32_t, ThreadLocalEntry*>*>(mapPtr);
-
-                    for (std::map<int32_t, ThreadLocalEntry*>::iterator it = map->begin(); it != map->end(); ++it)
-                        delete it->second;
-
-                    delete map;
-                }
-            }
-
-            SharedPointerImpl::SharedPointerImpl(void* ptr) : ptr(ptr), refCnt(1)
-            {
-                Memory::Fence();
-            }
-
-            void* SharedPointerImpl::Pointer()
-            {
-                return ptr;
-            }
-
-            void SharedPointerImpl::Increment()
-            {
-                Atomics::IncrementAndGet32(&refCnt);
-            }
-
-            bool SharedPointerImpl::Decrement()
-            {
-                return Atomics::DecrementAndGet32(&refCnt) == 0;
-            }
-        }
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/common/src/exports.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/common/src/exports.cpp b/modules/platform/src/main/cpp/common/src/exports.cpp
deleted file mode 100644
index 2ac3340..0000000
--- a/modules/platform/src/main/cpp/common/src/exports.cpp
+++ /dev/null
@@ -1,413 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "ignite/common/exports.h"
-#include "ignite/common/java.h"
-
-namespace gcj = ignite::common::java;
-
-/* --- Target methods. --- */
-extern "C" {
-    int IGNITE_CALL IgniteReallocate(long long memPtr, int cap) {
-        return gcj::JniContext::Reallocate(memPtr, cap);
-    }
-
-    void* IGNITE_CALL IgniteIgnitionStart(gcj::JniContext* ctx, char* cfgPath, char* name, int factoryId, long long dataPtr) {
-        return ctx->IgnitionStart(cfgPath, name, factoryId, dataPtr);
-    }
-
-	void* IGNITE_CALL IgniteIgnitionInstance(gcj::JniContext* ctx, char* name) {
-        return ctx->IgnitionInstance(name);
-    }
-
-    long long IGNITE_CALL IgniteIgnitionEnvironmentPointer(gcj::JniContext* ctx, char* name) {
-        return ctx->IgnitionEnvironmentPointer(name);
-    }
-
-	bool IGNITE_CALL IgniteIgnitionStop(gcj::JniContext* ctx, char* name, bool cancel) {
-        return ctx->IgnitionStop(name, cancel);
-    }
-
-	void IGNITE_CALL IgniteIgnitionStopAll(gcj::JniContext* ctx, bool cancel) {
-        return ctx->IgnitionStopAll(cancel);
-    }
-
-    void IGNITE_CALL IgniteProcessorReleaseStart(gcj::JniContext* ctx, void* obj) {
-        return ctx->ProcessorReleaseStart(static_cast<jobject>(obj));
-    }
-
-    void* IGNITE_CALL IgniteProcessorProjection(gcj::JniContext* ctx, void* obj) {
-        return ctx->ProcessorProjection(static_cast<jobject>(obj));
-    }
-
-    void* IGNITE_CALL IgniteProcessorCache(gcj::JniContext* ctx, void* obj, char* name) {
-        return ctx->ProcessorCache(static_cast<jobject>(obj), name);
-    }
-
-    void* IGNITE_CALL IgniteProcessorCreateCache(gcj::JniContext* ctx, void* obj, char* name) {
-        return ctx->ProcessorCreateCache(static_cast<jobject>(obj), name);
-    }
-
-    void* IGNITE_CALL IgniteProcessorGetOrCreateCache(gcj::JniContext* ctx, void* obj, char* name) {
-        return ctx->ProcessorGetOrCreateCache(static_cast<jobject>(obj), name);
-    }
-
-    void* IGNITE_CALL IgniteProcessorAffinity(gcj::JniContext* ctx, void* obj, char* name) {
-        return ctx->ProcessorAffinity(static_cast<jobject>(obj), name);
-    }
-
-    void*IGNITE_CALL IgniteProcessorDataStreamer(gcj::JniContext* ctx, void* obj, char* name, bool keepPortable) {
-        return ctx->ProcessorDataStreamer(static_cast<jobject>(obj), name, keepPortable);
-    }
-    
-    void* IGNITE_CALL IgniteProcessorTransactions(gcj::JniContext* ctx, void* obj) {
-        return ctx->ProcessorTransactions(static_cast<jobject>(obj));
-    }
-        
-    void* IGNITE_CALL IgniteProcessorCompute(gcj::JniContext* ctx, void* obj, void* prj) {
-        return ctx->ProcessorCompute(static_cast<jobject>(obj), static_cast<jobject>(prj));
-    }
-
-    void* IGNITE_CALL IgniteProcessorMessage(gcj::JniContext* ctx, void* obj, void* prj) {
-        return ctx->ProcessorMessage(static_cast<jobject>(obj), static_cast<jobject>(prj));
-    }
-
-    void* IGNITE_CALL IgniteProcessorEvents(gcj::JniContext* ctx, void* obj, void* prj) {
-        return ctx->ProcessorEvents(static_cast<jobject>(obj), static_cast<jobject>(prj));
-    }
-
-    void* IGNITE_CALL IgniteProcessorServices(gcj::JniContext* ctx, void* obj, void* prj) {
-        return ctx->ProcessorServices(static_cast<jobject>(obj), static_cast<jobject>(prj));
-    }
-
-    void* IGNITE_CALL IgniteProcessorExtensions(gcj::JniContext* ctx, void* obj) {
-        return ctx->ProcessorExtensions(static_cast<jobject>(obj));
-    }
-
-    long long IGNITE_CALL IgniteTargetInStreamOutLong(gcj::JniContext* ctx, void* obj, int opType, long long memPtr) {
-        return ctx->TargetInStreamOutLong(static_cast<jobject>(obj), opType, memPtr);
-    }
-
-    void IGNITE_CALL IgniteTargetInStreamOutStream(gcj::JniContext* ctx, void* obj, int opType, long long inMemPtr, long long outMemPtr) {
-        ctx->TargetInStreamOutStream(static_cast<jobject>(obj), opType, inMemPtr, outMemPtr);
-    }
-
-    void* IGNITE_CALL IgniteTargetInStreamOutObject(gcj::JniContext* ctx, void* obj, int opType, long long memPtr) {
-        return ctx->TargetInStreamOutObject(static_cast<jobject>(obj), opType, memPtr);
-    }
-
-    void IGNITE_CALL IgniteTargetInObjectStreamOutStream(gcj::JniContext* ctx, void* obj, int opType, void* arg, long long inMemPtr, long long outMemPtr) {
-        ctx->TargetInObjectStreamOutStream(static_cast<jobject>(obj), opType, arg, inMemPtr, outMemPtr);
-    }
-    
-    long long IGNITE_CALL IgniteTargetOutLong(gcj::JniContext* ctx, void* obj, int opType) {
-        return ctx->TargetOutLong(static_cast<jobject>(obj), opType);
-    }
-
-    void IGNITE_CALL IgniteTargetOutStream(gcj::JniContext* ctx, void* obj, int opType, long long memPtr) {
-        ctx->TargetOutStream(static_cast<jobject>(obj), opType, memPtr);
-    }
-
-    void* IGNITE_CALL IgniteTargetOutObject(gcj::JniContext* ctx, void* obj, int opType) {
-        return ctx->TargetOutObject(static_cast<jobject>(obj), opType);
-    }
-
-    void IGNITE_CALL IgniteTargetListenFuture(gcj::JniContext* ctx, void* obj, long long futId, int typ) {
-        ctx->TargetListenFuture(static_cast<jobject>(obj), futId, typ);
-    }
-
-    void IGNITE_CALL IgniteTargetListenFutureForOperation(gcj::JniContext* ctx, void* obj, long long futId, int typ, int opId) {
-        ctx->TargetListenFutureForOperation(static_cast<jobject>(obj), futId, typ, opId);
-    }
-
-    int IGNITE_CALL IgniteAffinityPartitions(gcj::JniContext* ctx, void* obj) {
-        return ctx->AffinityPartitions(static_cast<jobject>(obj));
-    }
-
-    void* IGNITE_CALL IgniteCacheWithSkipStore(gcj::JniContext* ctx, void* obj) {
-        return ctx->CacheWithSkipStore(static_cast<jobject>(obj));
-    }
-
-    void* IGNITE_CALL IgniteCacheWithNoRetries(gcj::JniContext* ctx, void* obj) {
-        return ctx->CacheWithNoRetries(static_cast<jobject>(obj));
-    }
-
-    void* IGNITE_CALL IgniteCacheWithExpiryPolicy(gcj::JniContext* ctx, void* obj, long long create, long long update, long long access) {
-        return ctx->CacheWithExpiryPolicy(static_cast<jobject>(obj), create, update, access);
-    }
-
-    void* IGNITE_CALL IgniteCacheWithAsync(gcj::JniContext* ctx, void* obj) {
-        return ctx->CacheWithAsync(static_cast<jobject>(obj));
-    }
-
-    void* IGNITE_CALL IgniteCacheWithKeepPortable(gcj::JniContext* ctx, void* obj)
-    {
-        return ctx->CacheWithKeepPortable(static_cast<jobject>(obj));
-    }
-
-    void IGNITE_CALL IgniteCacheClear(gcj::JniContext* ctx, void* obj) {
-        ctx->CacheClear(static_cast<jobject>(obj));
-    }
-
-    void IGNITE_CALL IgniteCacheRemoveAll(gcj::JniContext* ctx, void* obj) {
-        ctx->CacheRemoveAll(static_cast<jobject>(obj));
-    }
-
-    void* IGNITE_CALL IgniteCacheOutOpQueryCursor(gcj::JniContext* ctx, void* obj, int type, long long memPtr) {
-        return ctx->CacheOutOpQueryCursor(static_cast<jobject>(obj), type, memPtr);
-    }
-
-    void* IGNITE_CALL IgniteCacheOutOpContinuousQuery(gcj::JniContext* ctx, void* obj, int type, long long memPtr) {
-        return ctx->CacheOutOpContinuousQuery(static_cast<jobject>(obj), type, memPtr);
-    }
-
-    void* IGNITE_CALL IgniteCacheIterator(gcj::JniContext* ctx, void* obj) {
-        return ctx->CacheIterator(static_cast<jobject>(obj));
-    }
-
-    void* IGNITE_CALL IgniteCacheLocalIterator(gcj::JniContext* ctx, void* obj, int peekModes) {
-        return ctx->CacheLocalIterator(static_cast<jobject>(obj), peekModes);
-    }
-
-    void IGNITE_CALL IgniteCacheEnterLock(gcj::JniContext* ctx, void* obj, long long id) {
-        ctx->CacheEnterLock(static_cast<jobject>(obj), id);
-    }
-
-    void IGNITE_CALL IgniteCacheExitLock(gcj::JniContext* ctx, void* obj, long long id) {
-        ctx->CacheExitLock(static_cast<jobject>(obj), id);
-    }
-
-    bool IGNITE_CALL IgniteCacheTryEnterLock(gcj::JniContext* ctx, void* obj, long long id, long long timeout) {
-        return ctx->CacheTryEnterLock(static_cast<jobject>(obj), id, timeout);
-    }
-
-    void IGNITE_CALL IgniteCacheCloseLock(gcj::JniContext* ctx, void* obj, long long id) {
-        ctx->CacheCloseLock(static_cast<jobject>(obj), id);
-    }
-
-    void IGNITE_CALL IgniteCacheRebalance(gcj::JniContext* ctx, void* obj, long long futId) {
-        ctx->CacheRebalance(static_cast<jobject>(obj), futId);
-    }
-
-    int IGNITE_CALL IgniteCacheSize(gcj::JniContext* ctx, void* obj, int peekModes, bool loc) {
-        return ctx->CacheSize(static_cast<jobject>(obj), peekModes, loc);
-    }
-
-    void IGNITE_CALL IgniteComputeWithNoFailover(gcj::JniContext* ctx, void* obj) {
-        ctx->ComputeWithNoFailover(static_cast<jobject>(obj));
-    }
-
-    void IGNITE_CALL IgniteComputeWithTimeout(gcj::JniContext* ctx, void* obj, long long timeout) {
-        ctx->ComputeWithTimeout(static_cast<jobject>(obj), timeout);
-    }
-
-    void IGNITE_CALL IgniteComputeExecuteNative(gcj::JniContext* ctx, void* obj, long long taskPtr, long long topVer) {
-        ctx->ComputeExecuteNative(static_cast<jobject>(obj), taskPtr, topVer);
-    }
-
-    void IGNITE_CALL IgniteContinuousQueryClose(gcj::JniContext* ctx, void* obj) {
-        ctx->ContinuousQueryClose(static_cast<jobject>(obj));
-    }
-
-    void* IGNITE_CALL IgniteContinuousQueryGetInitialQueryCursor(gcj::JniContext* ctx, void* obj) {
-        return ctx->ContinuousQueryGetInitialQueryCursor(static_cast<jobject>(obj));
-    }
-
-    void IGNITE_CALL IgniteCacheStoreCallbackInvoke(gcj::JniContext* ctx, void* obj, long long memPtr) {
-        ctx->CacheStoreCallbackInvoke(static_cast<jobject>(obj), memPtr);
-    }
-
-    void IGNITE_CALL IgniteDataStreamerListenTopology(gcj::JniContext* ctx, void* obj, long long ptr) {
-        ctx->DataStreamerListenTopology(static_cast<jobject>(obj), ptr);
-    }
-
-    bool IGNITE_CALL IgniteDataStreamerAllowOverwriteGet(gcj::JniContext* ctx, void* obj) {
-        return ctx->DataStreamerAllowOverwriteGet(static_cast<jobject>(obj));
-    }
-
-    void IGNITE_CALL IgniteDataStreamerAllowOverwriteSet(gcj::JniContext* ctx, void* obj, bool val) {
-        ctx->DataStreamerAllowOverwriteSet(static_cast<jobject>(obj), val);
-    }
-
-    bool IGNITE_CALL IgniteDataStreamerSkipStoreGet(gcj::JniContext* ctx, void* obj) {
-        return ctx->DataStreamerSkipStoreGet(static_cast<jobject>(obj));
-    }
-
-    void IGNITE_CALL IgniteDataStreamerSkipStoreSet(gcj::JniContext* ctx, void* obj, bool val) {
-        ctx->DataStreamerSkipStoreSet(static_cast<jobject>(obj), val);
-    }
-
-    int IGNITE_CALL IgniteDataStreamerPerNodeBufferSizeGet(gcj::JniContext* ctx, void* obj) {
-        return ctx->DataStreamerPerNodeBufferSizeGet(static_cast<jobject>(obj));
-    }
-
-    void IGNITE_CALL IgniteDataStreamerPerNodeBufferSizeSet(gcj::JniContext* ctx, void* obj, int val) {
-        ctx->DataStreamerPerNodeBufferSizeSet(static_cast<jobject>(obj), val);
-    }
-
-    int IGNITE_CALL IgniteDataStreamerPerNodeParallelOperationsGet(gcj::JniContext* ctx, void* obj) {
-        return ctx->DataStreamerPerNodeParallelOperationsGet(static_cast<jobject>(obj));
-    }
-
-    void IGNITE_CALL IgniteDataStreamerPerNodeParallelOperationsSet(gcj::JniContext* ctx, void* obj, int val) {
-        ctx->DataStreamerPerNodeParallelOperationsSet(static_cast<jobject>(obj), val);
-    }
-
-    void* IGNITE_CALL IgniteMessagingWithAsync(gcj::JniContext* ctx, void* obj) {
-        return ctx->MessagingWithAsync(static_cast<jobject>(obj));
-    }
-
-    void* IGNITE_CALL IgniteProjectionForOthers(gcj::JniContext* ctx, void* obj, void* prj) {
-        return ctx->ProjectionForOthers(static_cast<jobject>(obj), static_cast<jobject>(prj));
-    }
-
-    void* IGNITE_CALL IgniteProjectionForRemotes(gcj::JniContext* ctx, void* obj) {
-        return ctx->ProjectionForRemotes(static_cast<jobject>(obj));
-    }
-
-    void* IGNITE_CALL IgniteProjectionForDaemons(gcj::JniContext* ctx, void* obj) {
-        return ctx->ProjectionForDaemons(static_cast<jobject>(obj));
-    }
-
-    void* IGNITE_CALL IgniteProjectionForRandom(gcj::JniContext* ctx, void* obj) {
-        return ctx->ProjectionForRandom(static_cast<jobject>(obj));
-    }
-
-    void* IGNITE_CALL IgniteProjectionForOldest(gcj::JniContext* ctx, void* obj) {
-        return ctx->ProjectionForOldest(static_cast<jobject>(obj));
-    }
-
-    void* IGNITE_CALL IgniteProjectionForYoungest(gcj::JniContext* ctx, void* obj) {
-        return ctx->ProjectionForYoungest(static_cast<jobject>(obj));
-    }
-
-    void IGNITE_CALL IgniteProjectionResetMetrics(gcj::JniContext* ctx, void* obj) {
-        ctx->ProjectionResetMetrics(static_cast<jobject>(obj));
-    }
-
-    void* IGNITE_CALL IgniteProjectionOutOpRet(gcj::JniContext* ctx, void* obj, int type, long long memPtr) {
-        return ctx->ProjectionOutOpRet(static_cast<jobject>(obj), type, memPtr);
-    }
-
-    void IGNITE_CALL IgniteQueryCursorIterator(gcj::JniContext* ctx, void* obj) {
-        ctx->QueryCursorIterator(static_cast<jobject>(obj));
-    }
-
-    void IGNITE_CALL IgniteQueryCursorClose(gcj::JniContext* ctx, void* obj) {
-        ctx->QueryCursorClose(static_cast<jobject>(obj));
-    }
-
-    long long IGNITE_CALL IgniteTransactionsStart(gcj::JniContext* ctx, void* obj, int concurrency, int isolation, long long timeout, int txSize) {
-        return ctx->TransactionsStart(static_cast<jobject>(obj), concurrency, isolation, timeout, txSize);
-    }   
-
-    int IGNITE_CALL IgniteTransactionsCommit(gcj::JniContext* ctx, void* obj, long long id) {
-        return ctx->TransactionsCommit(static_cast<jobject>(obj), id);
-    }
-
-    void IGNITE_CALL IgniteTransactionsCommitAsync(gcj::JniContext* ctx, void* obj, long long id, long long futId) {
-        return ctx->TransactionsCommitAsync(static_cast<jobject>(obj), id, futId);
-    }
-
-    int IGNITE_CALL IgniteTransactionsRollback(gcj::JniContext* ctx, void* obj, long long id) {
-        return ctx->TransactionsRollback(static_cast<jobject>(obj), id);
-    }
-
-    void IGNITE_CALL IgniteTransactionsRollbackAsync(gcj::JniContext* ctx, void* obj, long long id, long long futId) {
-        return ctx->TransactionsRollbackAsync(static_cast<jobject>(obj), id, futId);
-    }
-
-    int IGNITE_CALL IgniteTransactionsClose(gcj::JniContext* ctx, void* obj, long long id) {
-        return ctx->TransactionsClose(static_cast<jobject>(obj), id);
-    }
-
-    int IGNITE_CALL IgniteTransactionsState(gcj::JniContext* ctx, void* obj, long long id) {
-        return ctx->TransactionsState(static_cast<jobject>(obj), id);
-    }
-
-    bool IGNITE_CALL IgniteTransactionsSetRollbackOnly(gcj::JniContext* ctx, void* obj, long long id) {
-        return ctx->TransactionsSetRollbackOnly(static_cast<jobject>(obj), id);
-    }
-
-    void IGNITE_CALL IgniteTransactionsResetMetrics(gcj::JniContext* ctx, void* obj) {
-        ctx->TransactionsResetMetrics(static_cast<jobject>(obj));
-    }
-
-    void* IGNITE_CALL IgniteAcquire(gcj::JniContext* ctx, void* obj) {
-        return ctx->Acquire(static_cast<jobject>(obj));
-    }
-
-    void IGNITE_CALL IgniteRelease(void* obj) {
-        gcj::JniContext::Release(static_cast<jobject>(obj));
-    }
-
-    void IGNITE_CALL IgniteThrowToJava(gcj::JniContext* ctx, char* err) {
-        ctx->ThrowToJava(err);
-    }
-    
-    int IGNITE_CALL IgniteHandlersSize() {
-        return sizeof(gcj::JniHandlers);
-    }
-
-    void* IGNITE_CALL IgniteCreateContext(char** opts, int optsLen, gcj::JniHandlers* cbs) {
-        return gcj::JniContext::Create(opts, optsLen, *cbs);
-    }
-
-    void IGNITE_CALL IgniteDeleteContext(gcj::JniContext* ctx) {
-        delete ctx;
-    }
-
-    void IGNITE_CALL IgniteDestroyJvm(gcj::JniContext* ctx) {
-        ctx->DestroyJvm();
-    }
-
-    void* IGNITE_CALL IgniteEventsWithAsync(gcj::JniContext* ctx, void* obj) {
-        return ctx->EventsWithAsync(static_cast<jobject>(obj));
-    }
-
-    bool IGNITE_CALL IgniteEventsStopLocalListen(gcj::JniContext* ctx, void* obj, long long hnd) {
-        return ctx->EventsStopLocalListen(static_cast<jobject>(obj), hnd);
-    }
-
-    void IGNITE_CALL IgniteEventsLocalListen(gcj::JniContext* ctx, void* obj, long long hnd, int type) {
-        ctx->EventsLocalListen(static_cast<jobject>(obj), hnd, type);
-    }
-
-    bool IGNITE_CALL IgniteEventsIsEnabled(gcj::JniContext* ctx, void* obj, int type) {
-        return ctx->EventsIsEnabled(static_cast<jobject>(obj), type);
-    }    
-    
-	void* IGNITE_CALL IgniteServicesWithAsync(gcj::JniContext* ctx, void* obj) {
-		return ctx->ServicesWithAsync(static_cast<jobject>(obj));
-    }
-
-    void* IGNITE_CALL IgniteServicesWithServerKeepPortable(gcj::JniContext* ctx, void* obj) {
-    		return ctx->ServicesWithServerKeepPortable(static_cast<jobject>(obj));
-        }
-
-	void IGNITE_CALL IgniteServicesCancel(gcj::JniContext* ctx, void* obj, char* name) {
-		ctx->ServicesCancel(static_cast<jobject>(obj), name);
-    }
-
-	void IGNITE_CALL IgniteServicesCancelAll(gcj::JniContext* ctx, void* obj) {
-		ctx->ServicesCancelAll(static_cast<jobject>(obj));
-    }
-
-	void* IGNITE_CALL IgniteServicesGetServiceProxy(gcj::JniContext* ctx, void* obj, char* name, bool sticky) {
-		return ctx->ServicesGetServiceProxy(static_cast<jobject>(obj), name, sticky);
-    }
-}
\ No newline at end of file


[21/28] ignite git commit: IGNITE-1513: Moved CPP.

Posted by vo...@apache.org.
http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/core/include/ignite/ignite.h
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/core/include/ignite/ignite.h b/modules/platform/cpp/core/include/ignite/ignite.h
new file mode 100644
index 0000000..6c1263e
--- /dev/null
+++ b/modules/platform/cpp/core/include/ignite/ignite.h
@@ -0,0 +1,154 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _IGNITE
+#define _IGNITE
+
+#include "ignite/cache/cache.h"
+#include "ignite/impl/ignite_impl.h"
+#include "ignite/ignite_configuration.h"
+
+namespace ignite
+{
+    /**
+     * Main interface to operate with Ignite.
+     */
+    class IGNITE_IMPORT_EXPORT Ignite
+    {
+    public:
+        /**
+         * Default constructor.
+         */
+        Ignite();
+
+        /**
+         * Constructor.
+         */
+        Ignite(impl::IgniteImpl* impl);
+        
+        /**
+         * Get Ignite instance name.
+         *
+         * @return Name.
+         */
+        char* GetName();
+
+        /**
+         * Get cache.
+         *
+         * @param name Cache name.
+         * @return Cache.
+         */
+        template<typename K, typename V>
+        cache::Cache<K, V> GetCache(const char* name)
+        {
+            IgniteError err;
+
+            cache::Cache<K, V> res = GetCache<K, V>(name, &err);
+
+            IgniteError::ThrowIfNeeded(err);
+
+            return res;
+        }
+
+        /**
+         * Get cache.
+         *
+         * @param name Cache name.
+         * @param err Error;
+         * @return Cache.
+         */
+        template<typename K, typename V>
+        cache::Cache<K, V> GetCache(const char* name, IgniteError* err)
+        {
+            impl::cache::CacheImpl* cacheImpl = impl.Get()->GetCache<K, V>(name, err);
+
+            return cache::Cache<K, V>(cacheImpl);
+        }
+
+        /**
+         * Get or create cache.
+         *
+         * @param name Cache name.
+         * @return Cache.
+         */
+        template<typename K, typename V>
+        cache::Cache<K, V> GetOrCreateCache(const char* name)
+        {
+            IgniteError err;
+
+            cache::Cache<K, V> res = GetOrCreateCache<K, V>(name, &err);
+
+            IgniteError::ThrowIfNeeded(err);
+
+            return res;
+        }
+
+        /**
+         * Get or create cache.
+         *
+         * @param name Cache name.
+         * @param err Error;
+         * @return Cache.
+         */
+        template<typename K, typename V>
+        cache::Cache<K, V> GetOrCreateCache(const char* name, IgniteError* err)
+        {
+            impl::cache::CacheImpl* cacheImpl = impl.Get()->GetOrCreateCache<K, V>(name, err);
+
+            return cache::Cache<K, V>(cacheImpl);
+        }
+
+        /**
+         * Create cache.
+         *
+         * @param name Cache name.
+         * @return Cache.
+         */
+        template<typename K, typename V>
+        cache::Cache<K, V> CreateCache(const char* name)
+        {
+            IgniteError err;
+
+            cache::Cache<K, V> res = CreateCache<K, V>(name, &err);
+
+            IgniteError::ThrowIfNeeded(err);
+
+            return res;
+        }
+
+        /**
+         * Create cache.
+         *
+         * @param name Cache name.
+         * @param err Error;
+         * @return Cache.
+         */
+        template<typename K, typename V>
+        cache::Cache<K, V> CreateCache(const char* name, IgniteError* err)
+        {
+            impl::cache::CacheImpl* cacheImpl = impl.Get()->CreateCache<K, V>(name, err);
+
+            return cache::Cache<K, V>(cacheImpl);
+        }
+    private:
+        /** Implementation delegate. */
+        ignite::common::concurrent::SharedPointer<impl::IgniteImpl> impl;
+    };
+}
+
+#endif

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/core/include/ignite/ignite_configuration.h
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/core/include/ignite/ignite_configuration.h b/modules/platform/cpp/core/include/ignite/ignite_configuration.h
new file mode 100644
index 0000000..ce2d730
--- /dev/null
+++ b/modules/platform/cpp/core/include/ignite/ignite_configuration.h
@@ -0,0 +1,92 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _IGNITE_CONFIGURATION
+#define _IGNITE_CONFIGURATION
+
+#include <stdint.h>
+
+namespace ignite
+{    
+    /**
+     * Single JVM option.
+     */
+    struct IgniteJvmOption
+    {
+        /** Option. */
+        char* opt;
+
+        /**
+         * Default constructor.
+         */
+        IgniteJvmOption() : opt(NULL)
+        {
+            // No-op.    
+        }
+
+        /**
+         * Constructor.
+         *
+         * @param opt Option.
+         */
+        IgniteJvmOption(char* opt) : opt(opt)
+        {
+            // No-op.
+        }
+    };
+
+    /**
+     * Ignite configuration.
+     */
+    struct IgniteConfiguration
+    {
+        /** Path to Ignite home. */
+        char* igniteHome;
+
+        /** Path to Spring configuration file. */
+        char* springCfgPath;
+
+        /** Path ot JVM libbrary. */
+        char* jvmLibPath;
+
+        /** JVM classpath. */
+        char* jvmClassPath;
+
+        /** Initial amount of JVM memory. */
+        int32_t jvmInitMem;
+
+        /** Maximum amount of JVM memory. */
+        int32_t jvmMaxMem;
+
+        /** Additional JVM options. */
+        IgniteJvmOption* jvmOpts;
+
+        /** Additional JVM options count. */
+        int32_t jvmOptsLen;
+
+        /**
+         * Constructor.
+         */
+        IgniteConfiguration() : igniteHome(NULL), springCfgPath(NULL), jvmLibPath(NULL), jvmClassPath(NULL),
+            jvmInitMem(512), jvmMaxMem(1024), jvmOpts(NULL), jvmOptsLen(0)
+        {
+            // No-op.
+        }
+    };    
+}
+
+#endif
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/core/include/ignite/ignite_error.h
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/core/include/ignite/ignite_error.h b/modules/platform/cpp/core/include/ignite/ignite_error.h
new file mode 100644
index 0000000..4438a0e
--- /dev/null
+++ b/modules/platform/cpp/core/include/ignite/ignite_error.h
@@ -0,0 +1,260 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _IGNITE_ERROR
+#define _IGNITE_ERROR
+
+#include <sstream>
+#include <stdint.h>
+
+#include <ignite/common/common.h>
+
+#define IGNITE_ERROR_1(code, part1) { \
+    std::stringstream stream; \
+    stream << (part1); \
+    throw ignite::IgniteError(code, stream.str().c_str()); \
+}
+
+#define IGNITE_ERROR_2(code, part1, part2) { \
+    std::stringstream stream; \
+    stream << (part1) << (part2); \
+    throw ignite::IgniteError(code, stream.str().c_str()); \
+}
+
+#define IGNITE_ERROR_3(code, part1, part2, part3) { \
+    std::stringstream stream; \
+    stream << (part1) << (part2) << (part3); \
+    throw ignite::IgniteError(code, stream.str().c_str()); \
+}
+
+#define IGNITE_ERROR_FORMATTED_1(code, msg, key1, val1) { \
+    std::stringstream stream; \
+    stream << msg << " [" << key1 << "=" << (val1) << "]"; \
+    throw ignite::IgniteError(code, stream.str().c_str()); \
+}
+
+#define IGNITE_ERROR_FORMATTED_2(code, msg, key1, val1, key2, val2) { \
+    std::stringstream stream; \
+    stream << msg << " [" << key1 << "=" << (val1) << ", " << key2 << "=" << (val2) << "]"; \
+    throw ignite::IgniteError(code, stream.str().c_str()); \
+}
+
+#define IGNITE_ERROR_FORMATTED_3(code, msg, key1, val1, key2, val2, key3, val3) { \
+    std::stringstream stream; \
+    stream << msg << " [" << key1 << "=" << (val1) << ", " << key2 << "=" << (val2) << ", " << key3 << "=" << (val3) << "]"; \
+    throw ignite::IgniteError(code, stream.str().c_str()); \
+}
+
+#define IGNITE_ERROR_FORMATTED_4(code, msg, key1, val1, key2, val2, key3, val3, key4, val4) { \
+    std::stringstream stream; \
+    stream << msg << " [" << key1 << "=" << (val1) << ", " << key2 << "=" << (val2) << ", " << key3 << "=" << (val3) << ", " << key4 << "=" << (val4) << "]"; \
+    throw ignite::IgniteError(code, stream.str().c_str()); \
+}
+
+namespace ignite
+{
+    /**
+     * Ignite error information.
+     */
+    class IGNITE_IMPORT_EXPORT IgniteError
+    {
+    public:
+        /** Success. */
+        static const int IGNITE_SUCCESS = 0;
+
+        /** Failed to initialize JVM. */
+        static const int IGNITE_ERR_JVM_INIT = 1;
+
+        /** Failed to attach to JVM. */
+        static const int IGNITE_ERR_JVM_ATTACH = 2;
+        
+        /** JVM library is not found. */
+        static const int IGNITE_ERR_JVM_LIB_NOT_FOUND = 3;
+
+        /** Failed to load JVM library. */
+        static const int IGNITE_ERR_JVM_LIB_LOAD_FAILED = 4;
+        
+        /** JVM classpath is not provided. */
+        static const int IGNITE_ERR_JVM_NO_CLASSPATH = 5;
+
+        /** JVM error: no class definition found. */
+        static const int IGNITE_ERR_JVM_NO_CLASS_DEF_FOUND = 6;
+
+        /** JVM error: no such method. */
+        static const int IGNITE_ERR_JVM_NO_SUCH_METHOD = 7;
+
+        /** Memory operation error. */
+        static const int IGNITE_ERR_MEMORY = 1001;
+
+        /** Portable error. */
+        static const int IGNITE_ERR_PORTABLE = 1002;
+
+        /** Generic Ignite error. */
+        static const int IGNITE_ERR_GENERIC = 2000;
+
+        /** Illegal argument passed. */
+        static const int IGNITE_ERR_ILLEGAL_ARGUMENT = 2001;
+
+        /** Illegal state. */
+        static const int IGNITE_ERR_ILLEGAL_STATE = 2002;
+
+        /** Unsupported operation. */
+        static const int IGNITE_ERR_UNSUPPORTED_OPERATION = 2003;
+
+        /** Thread has been interrup. */
+        static const int IGNITE_ERR_INTERRUPTED = 2004;
+
+        /** Cluster group is empty. */
+        static const int IGNITE_ERR_CLUSTER_GROUP_EMPTY = 2005;
+
+        /** Cluster topology problem. */
+        static const int IGNITE_ERR_CLUSTER_TOPOLOGY = 2006;
+
+        /** Compute execution rejected. */
+        static const int IGNITE_ERR_COMPUTE_EXECUTION_REJECTED = 2007;
+
+        /** Compute job failover. */
+        static const int IGNITE_ERR_COMPUTE_JOB_FAILOVER = 2008;
+
+        /** Compute task cancelled. */
+        static const int IGNITE_ERR_COMPUTE_TASK_CANCELLED = 2009;
+
+        /** Compute task timeout. */
+        static const int IGNITE_ERR_COMPUTE_TASK_TIMEOUT = 2010;
+
+        /** Compute user undeclared exception. */
+        static const int IGNITE_ERR_COMPUTE_USER_UNDECLARED_EXCEPTION = 2011;
+
+        /** Generic cache error. */
+        static const int IGNITE_ERR_CACHE = 2012;
+
+        /** Generic cache loader error. */
+        static const int IGNITE_ERR_CACHE_LOADER = 2013;
+
+        /** Generic cache writer error. */
+        static const int IGNITE_ERR_CACHE_WRITER = 2014;
+        
+        /** Generic cache entry processor error. */
+        static const int IGNITE_ERR_ENTRY_PROCESSOR = 2015;
+
+        /** Cache atomic update timeout. */
+        static const int IGNITE_ERR_CACHE_ATOMIC_UPDATE_TIMEOUT = 2016;
+
+        /** Cache partial update. */
+        static const int IGNITE_ERR_CACHE_PARTIAL_UPDATE = 2017;
+        
+        /** Transaction optimisitc exception. */
+        static const int IGNITE_ERR_TX_OPTIMISTIC = 2018;
+
+        /** Transaction timeout. */
+        static const int IGNITE_ERR_TX_TIMEOUT = 2019;
+
+        /** Transaction rollback. */
+        static const int IGNITE_ERR_TX_ROLLBACK = 2020;
+
+        /** Transaction heuristic exception. */
+        static const int IGNITE_ERR_TX_HEURISTIC = 2021;
+
+        /** Authentication error. */
+        static const int IGNITE_ERR_AUTHENTICATION = 2022;
+
+        /** Security error. */
+        static const int IGNITE_ERR_SECURITY = 2023;
+        
+        /** Unknown error. */
+        static const int IGNITE_ERR_UNKNOWN = -1;
+
+        /**
+         * Throw an error if code is not IGNITE_SUCCESS.
+         *
+         * @param err Error.
+         */
+        static void ThrowIfNeeded(IgniteError& err);
+
+        /**
+         * Create empty error.
+         */
+        IgniteError();
+
+        /**
+         * Create error with specific code.
+         *
+         * @param code Error code.
+         */
+        IgniteError(const int32_t code);
+
+        /**
+         * Create error with specific code and message.
+         *
+         * @param code Error code.
+         * @param msg Message.
+         */
+        IgniteError(const int32_t code, const char* msg);
+        
+        /**
+         * Copy constructor.
+         *
+         * @param other Other instance.
+         */
+        IgniteError(const IgniteError& other);
+
+        /**
+         * Assignment operator.
+         *
+         * @param other Other instance.
+         * @return Assignment result.
+         */
+        IgniteError& operator=(const IgniteError& other);
+
+        /**
+         * Destructor.
+         */
+        ~IgniteError();
+
+        /**
+         * Get error code.
+         *
+         * @return Error code.
+         */
+        int32_t GetCode();
+
+        /**
+         * Get error message.
+         *
+         * @return Error message.
+         */
+        const char* GetText();
+        
+        /**
+         * Set error.
+         *
+         * @param jniCode Error code.
+         * @param jniCls Error class.
+         * @param jniMsg Error message.
+         * @param err Error.
+         */
+        static void SetError(const int jniCode, const char* jniCls, const char* jniMsg, IgniteError* err);
+    private:
+        /** Error code. */
+        int32_t code;    
+        
+        /** Error message. */
+        char* msg;       
+    };    
+}
+
+#endif
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/core/include/ignite/ignition.h
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/core/include/ignite/ignition.h b/modules/platform/cpp/core/include/ignite/ignition.h
new file mode 100644
index 0000000..8d32448
--- /dev/null
+++ b/modules/platform/cpp/core/include/ignite/ignition.h
@@ -0,0 +1,195 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * \mainpage Apache Ignite C++ Library
+ *
+ * The Apache Ignite is a proven software solution, which delivers unprecedented speed
+ * and unlimited scale to accelerate your business and time to insights. It enables high-performance transactions,
+ * real-time streaming and fast analytics in a single, comprehensive data access and processing layer. The In-Memory
+ * Data Fabric is designed to easily power both existing and new applications in a distributed, massively
+ * parallel architecture on affordable, industry-standard hardware.
+ * <p>
+ * The Apache Ignite provides a unified API that spans all key types of applications
+ * (Java, .NET, C++) and connects them with multiple data stores containing structured, semi-structured and
+ * unstructured data (SQL, NoSQL, Hadoop). It offers a secure, highly available and manageable data environment
+ * that allows companies to process full ACID transactions and generate valuable insights from real-time,
+ * interactive and batch queries.
+ * <p>
+ * The In-Memory Data Fabric offers a strategic approach to in-memory computing that delivers performance,
+ * scale and comprehensive capabilities far above and beyond what traditional in-memory databases,
+ * data grids or other in-memory-based point solutions can offer by themselves.
+ *
+ * \section ultimate_speed_and_scale Ultimate Speed and Scale
+ *
+ * The Apache Ignite accesses and processes data from distributed enterprise and
+ * cloud-based data stores orders of magnitudes faster, and shares them with today's most demanding transactional,
+ * analytical and hybrid applications. The In-Memory Data Fabric delivers unprecedented throughput
+ * and low latency performance in a virtually unlimited, global scale-out architecture for both new and
+ * existing applications.
+ *
+ * \section comprehensive_and_proven Comprehensive and Proven
+ *
+ * The Apache Ignite is the product of seven years of meticulous research and development,
+ * built from the ground up (i.e. no bolt-on's), and run successfully by hundreds of organizations worldwide.
+ * It is a comprehensive in-memory solution that includes a clustering and compute grid, a database-agnostic data grid,
+ * a real-time streaming engine as well as plug-and-play Hadoop acceleration. The In-Memory Data Fabric
+ * connects multiple data sources (relational, NoSQL, Hadoop) with Java, .NET and C++ applications, and offers
+ * a secure and highly available architecture; it also provides a fully-featured, graphical management interface.
+ * <p>
+ * The Apache Ignite is used today by Fortune 500 companies, top government agencies as well as
+ * innovative mobile and web companies in a broad range of business scenarios, such as automated trading systems,
+ * fraud detection, big data analytics, social networks, online gaming, and bioinformatics.
+ */
+
+#ifndef _IGNITE_IGNITION
+#define _IGNITE_IGNITION
+
+#include "ignite/ignite.h"
+#include "ignite/ignite_configuration.h"
+#include "ignite/ignite_error.h"
+
+namespace ignite
+{
+    /**
+     * This class defines a factory for the main Ignite API.
+     */
+    class IGNITE_IMPORT_EXPORT Ignition
+    {
+    public:
+        /**
+         * Start Ignite instance.
+         *
+         * @param cfg Configuration.
+         * @return Ignite instance or null in case of error.
+         */
+        static Ignite Start(const IgniteConfiguration& cfg);
+
+        /*
+         * Start Ignite instance.
+         *
+         * @param cfg Configuration.
+         * @param err Error.
+         * @return Ignite instance or null in case of error.
+         */
+        static Ignite Start(const IgniteConfiguration& cfg, IgniteError* err);
+
+        /**
+         * Start Ignite instance with specific name.
+         *
+         * @param cfg Configuration.
+         * @param name Ignite name.
+         * @return Ignite instance or null in case of error.
+         */
+        static Ignite Start(const IgniteConfiguration& cfg, const char* name);
+
+        /**
+         * Start Ignite instance with specific name.
+         *
+         * @param cfg Configuration.
+         * @param name Ignite name.
+         * @param err Error.
+         * @return Ignite instance or null in case of error.
+         */
+        static Ignite Start(const IgniteConfiguration& cfg, const char* name, IgniteError* err);
+
+        /**
+         * Get default Ignite instance.
+         *
+         * @return Default Ignite instance.
+         */
+        static Ignite Get();
+
+        /**
+         * Get default Ignite instance.
+         *
+         * @param err Error.
+         * @return Default Ignite instance.
+         */
+        static Ignite Get(IgniteError* err);
+
+        /**
+         * Get Ignite instance with the given name.
+         *
+         * @param name Ignite name.
+         * @return Ignite instance.
+         */
+        static Ignite Get(const char* name);
+
+        /**
+         * Get Ignite instance with the given name.
+         *
+         * @param name Ignite name.
+         * @param err Error.
+         * @return Ignite instance.
+         */
+        static Ignite Get(const char* name, IgniteError* err);
+
+        /**
+         * Stop default Ignite instance.
+         *
+         * @param cancel Cancel flag.
+         * @return True if default Ignite instance was stopped by this call.
+         */
+        static bool Stop(const bool cancel);
+
+        /**
+         * Stop default Ignite instance.
+         *
+         * @param cancel Cancel flag.
+         * @param err Error.
+         * @return True if Ignite instance was stopped by this call.
+         */
+        static bool Stop(const bool cancel, IgniteError* err);
+
+        /**
+         * Stop Ignite instance with the given name.
+         *
+         * @param name Ignite name.
+         * @param cancel Cancel flag.
+         * @return True if Ignite instance was stopped by this call.
+         */
+        static bool Stop(const char* name, const bool cancel);
+
+        /**
+         * Stop Ignite instance with the given name.
+         *
+         * @param name Ignite name.
+         * @param cancel Cancel flag.
+         * @param err Error.
+         * @return True if Ignite instance was stopped by this call.
+         */
+        static bool Stop(const char* name, const bool cancel, IgniteError* err);
+
+        /**
+         * Stop all running Ignite instances.
+         *
+         * @param cancel Cancel flag.
+         */
+        static void StopAll(const bool cancel);
+
+        /**
+         * Stop all running Ignite instances.
+         *
+         * @param cancel Cancel flag.
+         * @param err Error.
+         */
+        static void StopAll(const bool cancel, IgniteError* err);
+    };    
+}
+
+#endif
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/core/include/ignite/impl/cache/cache_impl.h
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/core/include/ignite/impl/cache/cache_impl.h b/modules/platform/cpp/core/include/ignite/impl/cache/cache_impl.h
new file mode 100644
index 0000000..8c744e0
--- /dev/null
+++ b/modules/platform/cpp/core/include/ignite/impl/cache/cache_impl.h
@@ -0,0 +1,418 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _IGNITE_CACHE_IMPL
+#define _IGNITE_CACHE_IMPL
+
+#include "ignite/cache/query/query_scan.h"
+#include "ignite/cache/query/query_sql.h"
+#include "ignite/cache/query/query_text.h"
+#include "ignite/impl/ignite_environment.h"
+#include "ignite/impl/cache/query/query_impl.h"
+#include "ignite/impl/operations.h"
+
+namespace ignite
+{    
+    namespace impl 
+    {
+        namespace cache
+        {
+            /**
+             * Cache implementation.
+             */
+            class IGNITE_IMPORT_EXPORT CacheImpl
+            {
+            public:
+                /**
+                 * Constructor used to create new instance.
+                 *
+                 * @param name Name.
+                 * @param env Environment.
+                 * @param javaRef Reference to java object.
+                 */
+                CacheImpl(char* name, ignite::common::concurrent::SharedPointer<IgniteEnvironment> env, jobject javaRef);
+                
+                /**
+                 * Destructor.
+                 */
+                ~CacheImpl();
+                
+                /**
+                 * Get name.
+                 *
+                 * @return Cache name.
+                 */
+                char* GetName();
+
+                /**
+                 * Perform IsEmpty.
+                 *
+                 * @param err Error.
+                 * @return Result.
+                 */
+                bool IsEmpty(IgniteError* err);
+
+                /**
+                 * Perform ContainsKey.
+                 *
+                 * @param inOp Input.
+                 * @param err Error.
+                 * @return Result.
+                 */
+                bool ContainsKey(InputOperation& inOp, IgniteError* err);
+
+                /**
+                 * Perform ContainsKeys.
+                 *
+                 * @param inOp Input.
+                 * @param err Error.
+                 * @return Result.
+                 */
+                bool ContainsKeys(InputOperation& inOp, IgniteError* err);
+
+                /**
+                 * Perform LocalPeek.
+                 *
+                 * @param inOp Input.
+                 * @param outOp Output.
+                 * @param peekModes Peek modes.
+                 * @param err Error.
+                 */
+                void LocalPeek(InputOperation& inOp, OutputOperation& outOp, 
+                    int32_t peekModes, IgniteError* err);
+
+                /**
+                 * Perform Get.
+                 *
+                 * @param inOp Input.
+                 * @param outOp Output.
+                 * @param err Error.
+                 */
+                void Get(InputOperation& inOp, OutputOperation& outOp, IgniteError* err);
+                
+                /**
+                 * Perform GetAll.
+                 *
+                 * @param inOp Input.
+                 * @param outOp Output.
+                 * @param err Error.
+                 */
+                void GetAll(InputOperation& inOp, OutputOperation& outOp, IgniteError* err);
+
+                /**
+                 * Perform Put.
+                 *
+                 * @param inOp Input.
+                 * @param err Error.
+                 */
+                void Put(InputOperation& inOp, IgniteError* err);
+
+                /**
+                 * Perform PutAll.
+                 *
+                 * @param inOp Input.
+                 * @param err Error.
+                 */
+                void PutAll(InputOperation& inOp, IgniteError* err);
+
+                /**
+                 * Perform GetAndPut.
+                 *
+                 * @param inOp Input.
+                 * @param outOp Output.
+                 * @param err Error.
+                 */
+                void GetAndPut(InputOperation& inOp, OutputOperation& outOp, IgniteError* err);
+
+                /**
+                 * Perform GetAndReplace.
+                 *
+                 * @param inOp Input.
+                 * @param outOp Output.
+                 * @param err Error.
+                 */
+                void GetAndReplace(InputOperation& inOp, OutputOperation& outOp, IgniteError* err);
+
+                /**
+                 * Perform GetAndRemove.
+                 *
+                 * @param inOp Input.
+                 * @param outOp Output.
+                 * @param err Error.
+                 */
+                void GetAndRemove(InputOperation& inOp, OutputOperation& outOp, IgniteError* err);
+
+                /**
+                 * Perform PutIfAbsent.
+                 *
+                 * @param inOp Input.
+                 * @param err Error.
+                 * @return Result
+                 */
+                bool PutIfAbsent(InputOperation& inOp, IgniteError* err);
+
+                /**
+                 * Perform GetAndPutIfAbsent.
+                 *
+                 * @param inOp Input.
+                 * @param outOp Output.
+                 * @param err Error.
+                 */
+                void GetAndPutIfAbsent(InputOperation& inOp, OutputOperation& outOp, IgniteError* err);
+
+                /**
+                 * Perform Replace(K, V).
+                 *
+                 * @param inOp Input.
+                 * @param err Error.
+                 * @return Result
+                 */
+                bool Replace(InputOperation& inOp, IgniteError* err);
+
+                /**
+                 * Perform Replace(K, V, V).
+                 *
+                 * @param inOp Input.
+                 * @param err Error.
+                 * @return Result
+                 */
+                bool ReplaceIfEqual(InputOperation& inOp, IgniteError* err);
+
+                /**
+                 * Perform LocalEvict.
+                 *
+                 * @param inOp Input.
+                 * @param err Error.
+                 */
+                void LocalEvict(InputOperation& inOp, IgniteError* err);
+
+                /**
+                 * Perform Clear.
+                 *
+                 * @param err Error.
+                 */
+                void Clear(IgniteError* err);
+
+                /**
+                 * Perform Clear.
+                 *
+                 * @param inOp Input.
+                 * @param err Error.
+                 */
+                void Clear(InputOperation& inOp, IgniteError* err);
+
+                /**
+                 * Perform ClearAll.
+                 *
+                 * @param inOp Input.
+                 * @param err Error.
+                 */
+                void ClearAll(InputOperation& inOp, IgniteError* err);
+
+                /**
+                 * Perform LocalClear.
+                 *
+                 * @param inOp Input.
+                 * @param err Error.
+                 */
+                void LocalClear(InputOperation& inOp, IgniteError* err);
+
+                /**
+                 * Perform LocalClearAll.
+                 *
+                 * @param inOp Input.
+                 * @param err Error.
+                 */
+                void LocalClearAll(InputOperation& inOp, IgniteError* err);
+
+                /**
+                 * Perform Remove(K).
+                 *
+                 * @param inOp Input.
+                 * @param err Error.
+                 * @return Result
+                 */
+                bool Remove(InputOperation& inOp, IgniteError* err);
+
+                /**
+                 * Perform Remove(K, V).
+                 *
+                 * @param inOp Input.
+                 * @param err Error.
+                 * @return Result
+                 */
+                bool RemoveIfEqual(InputOperation& inOp, IgniteError* err);
+
+                /**
+                 * Perform RemoveAll.
+                 *
+                 * @param inOp Input.
+                 * @param err Error.
+                 */
+                void RemoveAll(InputOperation& inOp, IgniteError* err);
+
+                /**
+                 * Perform RemoveAll.
+                 *
+                 * @param err Error.
+                 */
+                void RemoveAll(IgniteError* err);
+
+                /**
+                 * Perform Size.
+                 *
+                 * @param peekModes Peek modes.
+                 * @param err Error.
+                 * @return Result.
+                 */
+                int32_t Size(const int32_t peekModes, IgniteError* err);
+
+                /**
+                 * Perform LocalSize.
+                 * 
+                 * @param peekModes Peek modes.
+                 * @param err Error.
+                 * @return Result.
+                 */
+                int32_t LocalSize(const int32_t peekModes, IgniteError* err);
+
+                /**
+                 * Invoke query.
+                 *
+                 * @param qry Query.
+                 * @param err Error.
+                 * @return Query cursor.
+                 */
+                query::QueryCursorImpl* QuerySql(const ignite::cache::query::SqlQuery& qry, IgniteError* err);
+
+                /*
+                 * Invoke text query.
+                 *
+                 * @param qry Query.
+                 * @param err Error.
+                 * @return Query cursor.
+                 */
+                query::QueryCursorImpl* QueryText(const ignite::cache::query::TextQuery& qry, IgniteError* err);
+
+                /*
+                 * Invoke scan query.
+                 *
+                 * @param qry Query.
+                 * @param err Error.
+                 * @return Query cursor.
+                 */
+                query::QueryCursorImpl* QueryScan(const ignite::cache::query::ScanQuery& qry, IgniteError* err);
+                
+            private:
+                /** Name. */
+                char* name; 
+                
+                /** Environment. */
+                ignite::common::concurrent::SharedPointer<IgniteEnvironment> env;
+                
+                /** Handle to Java object. */
+                jobject javaRef;                     
+
+                IGNITE_NO_COPY_ASSIGNMENT(CacheImpl)
+
+                /**
+                 * Write data to memory.
+                 *
+                 * @param mem Memory.
+                 * @param inOp Input opeartion.
+                 * @param err Error.
+                 * @return Memory pointer.
+                 */
+                int64_t WriteTo(interop::InteropMemory* mem, InputOperation& inOp, IgniteError* err);
+
+                /**
+                 * Read data from memory.
+                 *
+                 * @param mem Memory.
+                 * @param outOp Output operation.
+                 */
+                void ReadFrom(interop::InteropMemory* mem, OutputOperation& outOp);
+
+                /**
+                 * Internal cache size routine.
+                 *
+                 * @param peekModes Peek modes.
+                 * @param loc Local flag.
+                 * @param err Error.
+                 * @return Size.
+                 */
+                int SizeInternal(const int32_t peekModes, const bool loc, IgniteError* err);
+
+                /**
+                 * Internal out operation.
+                 *
+                 * @param opType Operation type.
+                 * @param inOp Input.
+                 * @param err Error.
+                 * @return Result.
+                 */
+                bool OutOpInternal(const int32_t opType, InputOperation& inOp, IgniteError* err);
+
+                /**
+                 * Internal out-in operation.
+                 *
+                 * @param opType Operation type.
+                 * @param inOp Input.
+                 * @param outOp Output.
+                 * @param err Error.
+                 */
+                void OutInOpInternal(const int32_t opType, InputOperation& inOp, OutputOperation& outOp, 
+                    IgniteError* err);
+
+                /**
+                 * Internal query execution routine.
+                 *
+                 * @param qry Query.
+                 * @param typ Query type.
+                 * @param err Error.
+                 */
+                template<typename T>
+                query::QueryCursorImpl* QueryInternal(const T& qry, int32_t typ, IgniteError* err)
+                {
+                    ignite::common::java::JniErrorInfo jniErr;
+
+                    ignite::common::concurrent::SharedPointer<interop::InteropMemory> mem = env.Get()->AllocateMemory();
+                    interop::InteropMemory* mem0 = mem.Get();
+                    interop::InteropOutputStream out(mem0);
+                    portable::PortableWriterImpl writer(&out, env.Get()->GetMetadataManager());
+                    ignite::portable::PortableRawWriter rawWriter(&writer);
+
+                    qry.Write(rawWriter);
+
+                    out.Synchronize();
+
+                    jobject qryJavaRef = env.Get()->Context()->CacheOutOpQueryCursor(javaRef, typ, mem.Get()->PointerLong(), 
+                        &jniErr);
+
+                    IgniteError::SetError(jniErr.code, jniErr.errCls, jniErr.errMsg, err);
+
+                    if (jniErr.code == ignite::common::java::IGNITE_JNI_ERR_SUCCESS)
+                        return new query::QueryCursorImpl(env, qryJavaRef);
+                    else
+                        return NULL;
+                }
+            };
+        }
+    }    
+}
+
+#endif
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/core/include/ignite/impl/cache/query/query_impl.h
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/core/include/ignite/impl/cache/query/query_impl.h b/modules/platform/cpp/core/include/ignite/impl/cache/query/query_impl.h
new file mode 100644
index 0000000..e65eeb6
--- /dev/null
+++ b/modules/platform/cpp/core/include/ignite/impl/cache/query/query_impl.h
@@ -0,0 +1,115 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _IGNITE_CACHE_QUERY_IMPL
+#define _IGNITE_CACHE_QUERY_IMPL
+
+#include "ignite/ignite_error.h"
+#include "ignite/impl/ignite_environment.h"
+#include "ignite/impl/operations.h"
+
+namespace ignite
+{
+    namespace impl
+    {
+        namespace cache
+        {
+            namespace query
+            {
+                /**
+                 * Query cursor implementation.
+                 */
+                class IGNITE_IMPORT_EXPORT QueryCursorImpl
+                {
+                public:
+                    /**
+                     * Constructor.
+                     * 
+                     * @param env Environment.
+                     * @param javaRef Java reference.
+                     */
+                    QueryCursorImpl(ignite::common::concurrent::SharedPointer<IgniteEnvironment> env, jobject javaRef);
+
+                    /**
+                     * Destructor.
+                     */
+                    ~QueryCursorImpl();
+
+                    /**
+                     * Check whether next result exists.
+                     *
+                     * @param err Error.
+                     * @return True if exists.
+                     */
+                    bool HasNext(IgniteError* err);
+
+                    /**
+                     * Get next object.
+                     * 
+                     * @param op Operation.
+                     * @param err Error.
+                     */
+                    void GetNext(OutputOperation& op, IgniteError* err);
+
+                    /**
+                     * Get all cursor entries.
+                     *
+                     * @param op Operation.
+                     * @param err Error.
+                     */
+                    void GetAll(OutputOperation& op, IgniteError* err);
+
+                private:
+                    /** Environment. */
+                    ignite::common::concurrent::SharedPointer<impl::IgniteEnvironment> env;
+
+                    /** Handle to Java object. */
+                    jobject javaRef;
+
+                    /** Whether iteration methods were called. */
+                    bool iterCalled;
+
+                    /** Whether GetAll() method was called. */
+                    bool getAllCalled;
+
+                    /** Whether next entry is available. */
+                    bool hasNext;
+
+                    IGNITE_NO_COPY_ASSIGNMENT(QueryCursorImpl);
+
+                    /**
+                     * Create Java-side iterator if needed.
+                     *
+                     * @param err Error.
+                     * @return True in case of success, false if an error is thrown.
+                     */
+                    bool CreateIteratorIfNeeded(IgniteError* err);
+
+                    /**
+                     * Check whether Java-side iterator has next element.
+                     *
+                     * @param err Error.
+                     * @return True if the next element is available.
+                     */
+                    bool IteratorHasNext(IgniteError* err);
+                };
+            }
+        }
+    }
+}
+
+#endif
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/core/include/ignite/impl/handle_registry.h
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/core/include/ignite/impl/handle_registry.h b/modules/platform/cpp/core/include/ignite/impl/handle_registry.h
new file mode 100644
index 0000000..5e1b60a
--- /dev/null
+++ b/modules/platform/cpp/core/include/ignite/impl/handle_registry.h
@@ -0,0 +1,202 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _IGNITE_HANDLE_REGISTRY
+#define _IGNITE_HANDLE_REGISTRY
+
+#include <map>
+#include <stdint.h>
+
+#include <ignite/common/concurrent.h>
+
+namespace ignite
+{
+    namespace impl
+    {
+        /**
+         * Something what can be registered inside handle registry.
+         */
+        class IGNITE_IMPORT_EXPORT HandleRegistryEntry
+        {
+        public:
+            /**
+             * Destructor.
+             */
+            virtual ~HandleRegistryEntry();
+        };
+
+        /**
+         * Handle registry segment containing thread-specific data for slow-path access.
+         */
+        class IGNITE_IMPORT_EXPORT HandleRegistrySegment
+        {
+        public:
+            /**
+             * Constructor.
+             */
+            HandleRegistrySegment();
+
+            /**
+             * Destructor.
+             */
+            ~HandleRegistrySegment();
+
+            /**
+             * Get entry from segment.
+             *
+             * @param hnd Handle.
+             * @return Associated entry or NULL if it doesn't exists.
+             */
+            ignite::common::concurrent::SharedPointer<HandleRegistryEntry> Get(int64_t hnd);
+
+            /**
+             * Put entry into segment.
+             *
+             * @param hnd Handle.
+             * @param entry Associated entry (cannot be NULL).
+             */
+            void Put(int64_t hnd, const ignite::common::concurrent::SharedPointer<HandleRegistryEntry>& entry);
+
+            /**
+             * Remove entry from the segment.
+             *
+             * @param hnd Handle.
+             */
+            void Remove(int64_t hnd);            
+
+            /**
+             * Clear all entries from the segment.
+             */
+            void Clear();
+        private:
+            /** Map with data. */
+            std::map<int64_t, ignite::common::concurrent::SharedPointer<HandleRegistryEntry>>* map;
+
+            /** Mutex. */
+            ignite::common::concurrent::CriticalSection* mux;
+
+            IGNITE_NO_COPY_ASSIGNMENT(HandleRegistrySegment);
+        };
+
+        /**
+         * Handle registry.
+         */
+        class IGNITE_IMPORT_EXPORT HandleRegistry
+        {
+        public:
+            /**
+             * Constructor.
+             *
+             * @param fastCap Fast-path capacity.
+             * @param segmentCnt Slow-path segments count.
+             */
+            HandleRegistry(int32_t fastCap, int32_t slowSegmentCnt);
+
+            /**
+             * Destructor.
+             */
+            ~HandleRegistry();
+
+            /**
+             * Allocate handle.
+             *
+             * @param target Target.
+             * @return Handle.
+             */
+            int64_t Allocate(const ignite::common::concurrent::SharedPointer<HandleRegistryEntry>& target);
+
+            /**
+             * Allocate handle in critical mode.
+             *
+             * @param target Target.
+             * @return Handle.
+             */
+            int64_t AllocateCritical(const ignite::common::concurrent::SharedPointer<HandleRegistryEntry>& target);
+
+            /**
+             * Allocate handle in safe mode.
+             *
+             * @param target Target.
+             * @return Handle.
+             */
+            int64_t AllocateSafe(const ignite::common::concurrent::SharedPointer<HandleRegistryEntry>& target);
+
+            /**
+             * Allocate handle in critical and safe modes.
+             *
+             * @param target Target.
+             * @return Handle.
+             */
+            int64_t AllocateCriticalSafe(const ignite::common::concurrent::SharedPointer<HandleRegistryEntry>& target);
+
+            /**
+             * Release handle.
+             *
+             * @param hnd Handle.
+             */
+            void Release(int64_t hnd);
+
+            /**
+             * Get target.
+             *
+             * @param hnd Handle.
+             * @param Target.
+             */
+            ignite::common::concurrent::SharedPointer<HandleRegistryEntry> Get(int64_t hnd);
+
+            /**
+             * Close the registry.
+             */
+            void Close();
+        private:
+            /** Fast-path container capacity. */
+            int32_t fastCap;                     
+
+            /** Fast-path counter. */
+            int32_t fastCtr;               
+
+            /** Fast-path container. */
+            ignite::common::concurrent::SharedPointer<HandleRegistryEntry>* fast;
+
+            /** Amount of slow-path segments. */
+            int32_t slowSegmentCnt;            
+
+            /** Slow-path counter. */
+            int64_t slowCtr;                                                         
+            
+            /** Slow-path segments. */
+            HandleRegistrySegment** slow;                                            
+
+            /** Close flag. */
+            int32_t closed;                                                           
+
+            IGNITE_NO_COPY_ASSIGNMENT(HandleRegistry);
+
+            /**
+             * Internal allocation routine.
+             *
+             * @param target Target.
+             * @param Critical mode flag.
+             * @param Safe mode flag.
+             */
+            int64_t Allocate0(const ignite::common::concurrent::SharedPointer<HandleRegistryEntry>& target,
+                bool critical, bool safe);
+        };
+    }
+}
+
+#endif
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/core/include/ignite/impl/ignite_environment.h
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/core/include/ignite/impl/ignite_environment.h b/modules/platform/cpp/core/include/ignite/impl/ignite_environment.h
new file mode 100644
index 0000000..2f195b2
--- /dev/null
+++ b/modules/platform/cpp/core/include/ignite/impl/ignite_environment.h
@@ -0,0 +1,130 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _IGNITE_ENVIRONMENT
+#define _IGNITE_ENVIRONMENT
+
+#include <ignite/common/concurrent.h>
+#include <ignite/common/java.h>
+
+#include "ignite/impl/interop/interop_memory.h"
+#include "portable/portable_metadata_manager.h"
+
+namespace ignite 
+{    
+    namespace impl 
+    {
+        /**
+         * Defines environment in which Ignite operates.
+         */
+        class IGNITE_IMPORT_EXPORT IgniteEnvironment
+        {                
+        public:
+            /**
+             * Default constructor.
+             */
+            IgniteEnvironment();
+
+            /**
+             * Destructor.
+             */
+            ~IgniteEnvironment();
+
+            /**
+             * Populate callback handlers.
+             *
+             * @param Target (current env wrapped into a shared pointer).
+             * @return JNI handlers.
+             */
+            ignite::common::java::JniHandlers GetJniHandlers(ignite::common::concurrent::SharedPointer<IgniteEnvironment>* target);
+                
+            /**
+             * Perform initialization on successful start.
+             *
+             * @param ctx Context.
+             */
+            void Initialize(ignite::common::concurrent::SharedPointer<ignite::common::java::JniContext> ctx);
+
+            /**
+             * Start callback.
+             *
+             * @param memPtr Memory pointer.
+             */
+            void OnStartCallback(long long memPtr);        
+            
+            /**
+             * Get name of Ignite instance.
+             *
+             * @return Name.
+             */
+            char* InstanceName();
+
+            /**
+             * Get JNI context.
+             *
+             * @return Context.
+             */
+            ignite::common::java::JniContext* Context();
+
+            /**
+             * Get memory for interop operations.
+             *
+             * @return Memory.
+             */
+            ignite::common::concurrent::SharedPointer<interop::InteropMemory> AllocateMemory();
+
+            /**
+             * Get memory chunk for interop operations with desired capacity.
+             *
+             * @param cap Capacity.
+             * @return Memory.
+             */
+            ignite::common::concurrent::SharedPointer<interop::InteropMemory> AllocateMemory(int32_t cap);
+
+            /**
+             * Get memory chunk located at the given pointer.
+             *
+             * @param memPtr Memory pointer.
+             * @retrun Memory.
+             */
+            ignite::common::concurrent::SharedPointer<interop::InteropMemory> GetMemory(int64_t memPtr);
+
+            /**
+             * Get metadata manager.
+             *
+             * @param Metadata manager.
+             */
+            portable::PortableMetadataManager* GetMetadataManager();
+        private:
+            /** Context to access Java. */
+            ignite::common::concurrent::SharedPointer<ignite::common::java::JniContext> ctx;
+
+            /** Startup latch. */
+            ignite::common::concurrent::SingleLatch* latch;
+
+            /** Ignite name. */
+            char* name;
+
+            /** Metadata manager. */
+            portable::PortableMetadataManager* metaMgr;       
+
+            IGNITE_NO_COPY_ASSIGNMENT(IgniteEnvironment);
+        };
+    }    
+}
+
+#endif
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/core/include/ignite/impl/ignite_impl.h
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/core/include/ignite/impl/ignite_impl.h b/modules/platform/cpp/core/include/ignite/impl/ignite_impl.h
new file mode 100644
index 0000000..52472c6
--- /dev/null
+++ b/modules/platform/cpp/core/include/ignite/impl/ignite_impl.h
@@ -0,0 +1,146 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _IGNITE_IMPL
+#define _IGNITE_IMPL
+
+#include <ignite/common/concurrent.h>
+#include <ignite/common/java.h>
+
+#include "ignite/impl/cache/cache_impl.h"
+#include "ignite/impl/ignite_environment.h"
+#include "ignite/impl/utils.h"
+
+namespace ignite 
+{    
+    namespace impl 
+    {            
+        /**
+         * Ignite implementation.
+         */
+        class IgniteImpl
+        {
+            friend class Ignite;
+        public:
+            /**
+             * Constructor used to create new instance.
+             *
+             * @param env Environment.
+             * @param javaRef Reference to java object.
+             */
+            IgniteImpl(ignite::common::concurrent::SharedPointer<IgniteEnvironment> env, jobject javaRef);
+            
+            /**
+             * Destructor.
+             */
+            ~IgniteImpl();
+
+            /**
+             * Get name of the Ignite.
+             *
+             * @param Name.
+             */
+            char* GetName();
+
+            /**
+             * Get cache.
+             *
+             * @param name Cache name.
+             * @param err Error.
+             */
+            template<typename K, typename V> 
+            cache::CacheImpl* GetCache(const char* name, IgniteError* err)
+            {
+                ignite::common::java::JniErrorInfo jniErr;
+
+                jobject cacheJavaRef = env.Get()->Context()->ProcessorCache(javaRef, name, &jniErr);
+
+                if (!cacheJavaRef)
+                {
+                    IgniteError::SetError(jniErr.code, jniErr.errCls, jniErr.errMsg, err);
+
+                    return NULL;
+                }
+
+                char* name0 = utils::CopyChars(name);
+
+                return new cache::CacheImpl(name0, env, cacheJavaRef);
+            }
+
+            /**
+             * Get or create cache.
+             *
+             * @param name Cache name.
+             * @param err Error.
+             */
+            template<typename K, typename V>
+            cache::CacheImpl* GetOrCreateCache(const char* name, IgniteError* err)
+            {
+                ignite::common::java::JniErrorInfo jniErr;
+
+                jobject cacheJavaRef = env.Get()->Context()->ProcessorGetOrCreateCache(javaRef, name, &jniErr);
+
+                if (!cacheJavaRef)
+                {
+                    IgniteError::SetError(jniErr.code, jniErr.errCls, jniErr.errMsg, err);
+
+                    return NULL;
+                }
+
+                char* name0 = utils::CopyChars(name);
+
+                return new cache::CacheImpl(name0, env, cacheJavaRef);
+            }
+
+            /**
+             * Create cache.
+             *
+             * @param name Cache name.
+             * @param err Error.
+             */
+            template<typename K, typename V>
+            cache::CacheImpl* CreateCache(const char* name, IgniteError* err)
+            {
+                ignite::common::java::JniErrorInfo jniErr;
+
+                jobject cacheJavaRef = env.Get()->Context()->ProcessorCreateCache(javaRef, name, &jniErr);
+
+                if (!cacheJavaRef)
+                {
+                    IgniteError::SetError(jniErr.code, jniErr.errCls, jniErr.errMsg, err);
+
+                    return NULL;
+                }
+
+                char* name0 = utils::CopyChars(name);
+
+                return new cache::CacheImpl(name0, env, cacheJavaRef);
+            }
+        private:
+            /** Environment. */
+            ignite::common::concurrent::SharedPointer<IgniteEnvironment> env;
+            
+            /** Native Java counterpart. */
+            jobject javaRef;   
+            
+            IGNITE_NO_COPY_ASSIGNMENT(IgniteImpl)
+        };
+    }
+    
+}
+
+#endif
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/core/include/ignite/impl/interop/interop.h
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/core/include/ignite/impl/interop/interop.h b/modules/platform/cpp/core/include/ignite/impl/interop/interop.h
new file mode 100644
index 0000000..da4fdb9
--- /dev/null
+++ b/modules/platform/cpp/core/include/ignite/impl/interop/interop.h
@@ -0,0 +1,25 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _IGNITE_IMPL_INTEROP
+#define _IGNITE_IMPL_INTEROP
+
+#include "ignite/impl/interop/interop_memory.h"
+#include "ignite/impl/interop/interop_output_stream.h"
+#include "ignite/impl/interop/interop_input_stream.h"
+
+#endif
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/core/include/ignite/impl/interop/interop_input_stream.h
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/core/include/ignite/impl/interop/interop_input_stream.h b/modules/platform/cpp/core/include/ignite/impl/interop/interop_input_stream.h
new file mode 100644
index 0000000..d8fcfc3
--- /dev/null
+++ b/modules/platform/cpp/core/include/ignite/impl/interop/interop_input_stream.h
@@ -0,0 +1,234 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _IGNITE_IMPL_INTEROP_INPUT_STREAM
+#define _IGNITE_IMPL_INTEROP_INPUT_STREAM
+
+#include "ignite/impl/interop/interop_memory.h"
+
+namespace ignite
+{    
+    namespace impl
+    {
+        namespace interop
+        {
+            /**
+             * Interop input stream implementation.
+             */
+            class IGNITE_IMPORT_EXPORT InteropInputStream {
+            public:
+                /**
+                 * Constructor.
+                 *
+                 * @param mem Memory.
+                 */
+                InteropInputStream(InteropMemory* mem);
+
+                /**
+                 * Read signed 8-byte int.
+                 *
+                 * @return Value.
+                 */
+                int8_t ReadInt8();
+                    
+                /**
+                 * Read signed 8-byte int array.
+                 *
+                 * @param res Allocated array.
+                 * @param len Length.                 
+                 */
+                void ReadInt8Array(int8_t* const res, const int32_t len);
+
+                /**
+                 * Read bool.
+                 *
+                 * @return Value.
+                 */
+                bool ReadBool();
+
+                /**
+                 * Read bool array.
+                 *
+                 * @param res Allocated array.
+                 * @param len Length.
+                 */
+                void ReadBoolArray(bool* const res, const int32_t len);
+
+                /**
+                 * Read signed 16-byte int.
+                 *
+                 * @return Value.
+                 */
+                int16_t ReadInt16();
+
+                /**
+                 * Read signed 16-byte int array.
+                 *
+                 * @param res Allocated array.
+                 * @param len Length.
+                 */
+                void ReadInt16Array(int16_t* const res, const int32_t len);
+
+                /**
+                 * Read unsigned 16-byte int.
+                 *
+                 * @return Value.
+                 */
+                uint16_t ReadUInt16();
+
+                /**
+                 * Read unsigned 16-byte int array.
+                 *
+                 * @param res Allocated array.
+                 * @param len Length.
+                 */
+                void ReadUInt16Array(uint16_t* const res, const int32_t len);
+
+                /**
+                 * Read signed 32-byte int.
+                 *
+                 * @return Value.
+                 */
+                int32_t ReadInt32();
+
+                /**
+                 * Read signed 32-byte int at the given position.
+                 *
+                 * @param pos Position.
+                 * @return Value.
+                 */
+                int32_t ReadInt32(int32_t pos);
+                    
+                /**
+                 * Read signed 32-byte int array.
+                 *
+                 * @param res Allocated array.
+                 * @param len Length.
+                 */
+                void ReadInt32Array(int32_t* const res, const int32_t len);
+
+                /**
+                 * Read signed 64-byte int.
+                 *
+                 * @return Value.
+                 */
+                int64_t ReadInt64();
+
+                /**
+                 * Read signed 64-byte int array.
+                 *
+                 * @param res Allocated array.
+                 * @param len Length.
+                 */
+                void ReadInt64Array(int64_t* const res, const int32_t len);
+
+                /**
+                 * Read float.
+                 *
+                 * @return Value.
+                 */
+                float ReadFloat();
+
+                /**
+                 * Read float array.
+                 *
+                 * @param res Allocated array.
+                 * @param len Length.
+                 */
+                void ReadFloatArray(float* const res, const int32_t len);
+
+                /**
+                 * Read double.
+                 *
+                 * @return Value.
+                 */
+                double ReadDouble();
+
+                /**
+                 * Read double array.
+                 *
+                 * @param res Allocated array.
+                 * @param len Length.
+                 */
+                void ReadDoubleArray(double* const res, const int32_t len);
+
+                /**
+                 * Get remaining bytes.
+                 *
+                 * @return Remaining bytes.
+                 */
+                int32_t Remaining();
+
+                /**
+                 * Get position.
+                 *
+                 * @return Position.
+                 */
+                int32_t Position();
+
+                /**
+                 * Set position.
+                 *
+                 * @param Position.
+                 */
+                void Position(int32_t pos);
+
+                /**
+                 * Synchronize data from underlying memory.
+                 */
+                void Synchronize();
+            private:
+                /** Memory. */
+                InteropMemory* mem; 
+                
+                /** Pointer to data. */
+                int8_t* data;       
+                
+                /** Length. */
+                int len;            
+                
+                /** Current position. */
+                int pos;            
+                    
+                /**
+                 * Ensure there is enough data in the stream.
+                 *
+                 * @param cnt Amount of byte expected to be available.
+                 */
+                void EnsureEnoughData(int32_t cnt);
+
+                /**
+                 * Copy data from the stream shifting it along the way.
+                 *
+                 * @param ptr Pointer to data.
+                 * @param off Offset.
+                 * @param cnt Amount of data to copy.
+                 */
+                void CopyAndShift(int8_t* dest, int32_t off, int32_t cnt);
+
+                /**
+                 * Shift stream to the right.
+                 *
+                 * @param cnt Amount of bytes to shift the stream to.
+                 */
+                void Shift(int32_t cnt);
+            };
+        }
+    }    
+}
+
+#endif
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/core/include/ignite/impl/interop/interop_memory.h
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/core/include/ignite/impl/interop/interop_memory.h b/modules/platform/cpp/core/include/ignite/impl/interop/interop_memory.h
new file mode 100644
index 0000000..00cba43
--- /dev/null
+++ b/modules/platform/cpp/core/include/ignite/impl/interop/interop_memory.h
@@ -0,0 +1,280 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _IGNITE_IMPL_INTEROP_MEMORY
+#define _IGNITE_IMPL_INTEROP_MEMORY
+
+#include <stdint.h>
+
+#include <ignite/common/common.h>
+
+namespace ignite 
+{
+    namespace impl 
+    {
+        namespace interop 
+        {
+            /** Memory header length. */
+            const int IGNITE_MEM_HDR_LEN = 20;
+
+            /** Memory header offset: capacity. */
+            const int IGNITE_MEM_HDR_OFF_CAP = 8;
+
+            /** Memory header offset: length. */
+            const int IGNITE_MEM_HDR_OFF_LEN = 12;
+
+            /** Memory header offset: flags. */
+            const int IGNITE_MEM_HDR_OFF_FLAGS = 16;
+
+            /** Flag: external. */
+            const int IGNITE_MEM_FLAG_EXT = 0x1;
+
+            /** Flag: pooled. */
+            const int IGNITE_MEM_FLAG_POOLED = 0x2;
+
+            /** Flag: acquired. */
+            const int IGNITE_MEM_FLAG_ACQUIRED = 0x4;
+                
+            /**
+             * Interop memory.
+             */
+            class IGNITE_IMPORT_EXPORT InteropMemory
+            {
+            public:
+                /**
+                 * Get raw data pointer.
+                 *
+                 * @param memPtr Memory pointer.
+                 * @return Raw data pointer.
+                 */
+                static int8_t* Data(int8_t* memPtr);
+
+                /**
+                 * Set raw data pointer.
+                 *
+                 * @param memPtr Memory pointer.
+                 * @param ptr Raw data pointer.
+                 */
+                static void Data(int8_t* memPtr, void* ptr);
+
+                /**
+                 * Get capacity.
+                 *
+                 * @param memPtr Memory pointer.
+                 * @return Capacity.
+                 */
+                static int32_t Capacity(int8_t* memPtr);
+
+                /**
+                 * Set capacity.
+                 *
+                 * @param memPtr Memory pointer.
+                 * @param val Value.
+                 */
+                static void Capacity(int8_t* memPtr, int32_t val);
+
+                /**
+                 * Get length.
+                 *
+                 * @param memPtr Memory pointer.
+                 * @return Length.
+                 */
+                static int32_t Length(int8_t* memPtr);
+
+                /**
+                 * Set length.
+                 *
+                 * @param memPtr Memory pointer.
+                 * @param val Value.
+                 */
+                static void Length(int8_t* memPtr, int32_t val);
+
+                /**
+                 * Get flags.
+                 *
+                 * @param memPtr Memory pointer.
+                 * @return Flags.
+                 */
+                static int32_t Flags(int8_t* memPtr);
+
+                /**
+                 * Set flags.
+                 *
+                 * @param memPtr Memory pointer.
+                 * @param val Value.
+                 */
+                static void Flags(int8_t* memPtr, int32_t val);
+
+                /**
+                 * Get "external" flag state.
+                 *
+                 * @param memPtr Memory pointer.
+                 * @return Flag state.
+                 */
+                static bool IsExternal(int8_t* memPtr);
+
+                /**
+                 * Get "external" flag state.
+                 *
+                 * @param flags Flags.
+                 * @return Flag state.
+                 */
+                static bool IsExternal(int32_t flags);
+
+                /**
+                 * Get "pooled" flag state.
+                 *
+                 * @param memPtr Memory pointer.
+                 * @return Flag state.
+                 */
+                static bool IsPooled(int8_t* memPtr);
+
+                /**
+                 * Get "pooled" flag state.
+                 *
+                 * @param flags Flags.
+                 * @return Flag state.
+                 */
+                static bool IsPooled(int32_t flags);
+
+                /**
+                 * Get "acquired" flag state.
+                 *
+                 * @param memPtr Memory pointer.
+                 * @return Flag state.
+                 */
+                static bool IsAcquired(int8_t* memPtr);
+
+                /**
+                 * Get "acquired" flag state.
+                 *
+                 * @param flags Flags.
+                 * @return Flag state.
+                 */
+                static bool IsAcquired(int32_t flags);
+
+                /**
+                 * Destructor.
+                 */
+                virtual ~InteropMemory() { }
+                    
+                /**
+                 * Get cross-platform memory pointer.
+                 *
+                 * @return Memory pointer.
+                 */
+                int8_t* Pointer();
+
+                /**
+                 * Get cross-platform pointer in long form.
+                 */
+                int64_t PointerLong();
+
+                /**
+                 * Get raw data pointer.
+                 *
+                 * @return Data pointer.
+                 */
+                int8_t* Data();
+
+                /**
+                 * Get capacity.
+                 *
+                 * @return Capacity.
+                 */
+                int32_t Capacity();
+
+                /**
+                 * Get length.
+                 *
+                 * @return Length.
+                 */
+                int32_t Length();
+
+                /**
+                 * Set length.
+                 *
+                 * @param val Length.
+                 */
+                void Length(int32_t val);
+
+                /**
+                 * Reallocate memory.
+                 *
+                 * @param cap Desired capactiy.
+                 */
+                virtual void Reallocate(int32_t cap) = 0;
+            protected:
+                /** Memory pointer. */
+                int8_t* memPtr; 
+            };
+
+            /**
+             * Interop unpooled memory.
+             */
+            class IGNITE_IMPORT_EXPORT InteropUnpooledMemory : public InteropMemory
+            {
+            public:
+                /**
+                 * Constructor create new unpooled memory object from scratch.
+                 *
+                 * @param cap Capacity.
+                 */
+                explicit InteropUnpooledMemory(int32_t cap);
+
+                /**
+                 * Constructor creating unpooled memory object from existing memory pointer.
+                 *
+                 * @param memPtr Memory pointer.
+                 */
+                explicit InteropUnpooledMemory(int8_t* memPtr);
+
+                /**
+                 * Destructor.
+                 */
+                ~InteropUnpooledMemory();
+
+                virtual void Reallocate(int32_t cap);
+            private:
+                /** Whether this instance is owner of memory chunk. */
+                bool owning; 
+
+                IGNITE_NO_COPY_ASSIGNMENT(InteropUnpooledMemory)
+            };
+
+            /**
+             * Interop external memory.
+             */
+            class IGNITE_IMPORT_EXPORT InteropExternalMemory : public InteropMemory
+            {
+            public:
+                /**
+                 * Constructor.
+                 *
+                 * @param memPtr External memory pointer.
+                 */
+                explicit InteropExternalMemory(int8_t* memPtr);
+
+                virtual void Reallocate(int32_t cap);
+            private:
+                IGNITE_NO_COPY_ASSIGNMENT(InteropExternalMemory)
+            };
+        }
+    }
+}
+
+#endif
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/core/include/ignite/impl/interop/interop_output_stream.h
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/core/include/ignite/impl/interop/interop_output_stream.h b/modules/platform/cpp/core/include/ignite/impl/interop/interop_output_stream.h
new file mode 100644
index 0000000..5a08aed
--- /dev/null
+++ b/modules/platform/cpp/core/include/ignite/impl/interop/interop_output_stream.h
@@ -0,0 +1,234 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _IGNITE_IMPL_INTEROP_OUTPUT_STREAM
+#define _IGNITE_IMPL_INTEROP_OUTPUT_STREAM
+
+#include "ignite/impl/interop/interop_memory.h"
+
+namespace ignite
+{    
+    namespace impl
+    {
+        namespace interop
+        {
+            /**
+             * Interop output stream.
+             */
+            class IGNITE_IMPORT_EXPORT InteropOutputStream {
+            public:
+                /**
+                 * Create new output stream with the given capacity.
+                 *
+                 * @param mem Memory.
+                 */
+                InteropOutputStream(InteropMemory* mem);
+
+                /**
+                 * Write signed 8-byte integer.
+                 *
+                 * @param val Value.
+                 */
+                void WriteInt8(const int8_t val);
+
+                /**
+                 * Write signed 8-byte integer at the given position.
+                 *
+                 * @param val Value.
+                 */
+                void WriteInt8(const int8_t val, const int32_t pos);
+
+                /**
+                 * Write signed 8-byte integer array.
+                 *
+                 * @param val Value.
+                 * @param len Length.
+                 */
+                void WriteInt8Array(const int8_t* val, const int32_t len);
+
+                /**
+                 * Write bool.
+                 *
+                 * @param val Value.
+                 */
+                void WriteBool(const bool val);
+
+                /**
+                 * Write bool array.
+                 *
+                 * @param val Value.
+                 * @param len Length.
+                 */
+                void WriteBoolArray(const bool* val, const int32_t len);
+
+                /**
+                 * Write signed 16-byte integer.
+                 *
+                 * @param val Value.
+                 */
+                void WriteInt16(const int16_t val);
+
+                /**
+                 * Write signed 16-byte integer array.
+                 *
+                 * @param val Value.
+                 * @param len Length.
+                 */
+                void WriteInt16Array(const int16_t* val, const int32_t len);
+
+                /**
+                 * Write unsigned 16-byte integer.
+                 *
+                 * @param val Value.
+                 */
+                void WriteUInt16(const uint16_t val);
+
+                /**
+                 * Write unsigned 16-byte integer array.
+                 *
+                 * @param val Value.
+                 * @param len Length.
+                 */
+                void WriteUInt16Array(const uint16_t* val, const int32_t len);
+
+                /**
+                 * Write signed 32-byte integer.
+                 *
+                 * @param val Value.
+                 */
+                void WriteInt32(const int32_t val);
+
+                /**
+                 * Write signed 32-byte integer at the given position.
+                 *
+                 * @param pos Position.
+                 * @param val Value.
+                 */
+                void WriteInt32(const int32_t pos, const int32_t val);
+
+                /**
+                 * Write signed 32-byte integer array.
+                 *
+                 * @param val Value.
+                 * @param len Length.
+                 */
+                void WriteInt32Array(const int32_t* val, const int32_t len);
+
+                /**
+                 * Write signed 64-byte integer.
+                 *
+                 * @param val Value.
+                 */
+                void WriteInt64(const int64_t val);
+
+                /**
+                 * Write signed 64-byte integer array.
+                 *
+                 * @param val Value.
+                 * @param len Length.
+                 */
+                void WriteInt64Array(const int64_t* val, const int32_t len);
+
+                /**
+                 * Write float.
+                 *
+                 * @param val Value.
+                 */
+                void WriteFloat(const float val);
+
+                /**
+                 * Write float array.
+                 *
+                 * @param val Value.
+                 * @param len Length.
+                 */
+                void WriteFloatArray(const float* val, const int32_t len);
+
+                /**
+                 * Write double.
+                 *
+                 * @param val Value.
+                 */
+                void WriteDouble(const double val);
+
+                /**
+                 * Write double array.
+                 *
+                 * @param val Value.
+                 * @param len Length.
+                 */
+                void WriteDoubleArray(const double* val, const int32_t len);
+
+                /**
+                 * Get current stream position.
+                 */
+                int32_t Position();
+
+                /**
+                 * Set current stream position (absolute).
+                 *
+                 * @param val Position (absolute).
+                 */
+                void Position(const int32_t val);
+
+                /**
+                 * Synchronize data with underlying memory.
+                 */
+                void Synchronize();
+            private:
+                /** Memory. */
+                InteropMemory* mem; 
+
+                /** Pointer to data. */
+                int8_t* data;       
+
+                /** Capacity. */
+                int cap;            
+
+                /** Current position. */
+                int pos;            
+
+                IGNITE_NO_COPY_ASSIGNMENT(InteropOutputStream)
+
+                /**
+                 * Ensure that stream enough capacity optionally extending it.
+                 *
+                 * @param reqCap Requsted capacity.
+                 */
+                void EnsureCapacity(int32_t reqCap);
+
+                /**
+                 * Shift stream to the right.
+                 *
+                 * @param cnt Amount of bytes to shift the stream to.
+                 */
+                void Shift(int32_t cnt);
+
+                /**
+                 * Copy data to the stream shifting it along the way.
+                 *
+                 * @param ptr Pointer to data.
+                 * @param off Offset.
+                 * @param len Length.
+                 */
+                void CopyAndShift(const int8_t* src, int32_t off, int32_t len);
+            };
+        }
+    }
+}
+
+#endif
\ No newline at end of file


[12/28] ignite git commit: IGNITE-1513: Moved CPP.

Posted by vo...@apache.org.
http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/common/src/java.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/common/src/java.cpp b/modules/platform/src/main/cpp/common/src/java.cpp
deleted file mode 100644
index d08a90d..0000000
--- a/modules/platform/src/main/cpp/common/src/java.cpp
+++ /dev/null
@@ -1,2205 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <cstring>
-#include <string>
-#include <exception>
-
-#include "ignite/common/concurrent.h"
-#include "ignite/common/java.h"
-
-#define IGNITE_SAFE_PROC_NO_ARG(jniEnv, envPtr, type, field) { \
-    JniHandlers* hnds = reinterpret_cast<JniHandlers*>(envPtr); \
-    type hnd = hnds->field; \
-    if (hnd) \
-        hnd(hnds->target); \
-    else \
-        ThrowOnMissingHandler(jniEnv); \
-}
-
-#define IGNITE_SAFE_PROC(jniEnv, envPtr, type, field, ...) { \
-    JniHandlers* hnds = reinterpret_cast<JniHandlers*>(envPtr); \
-    type hnd = hnds->field; \
-    if (hnd) \
-        hnd(hnds->target, __VA_ARGS__); \
-    else \
-        ThrowOnMissingHandler(jniEnv); \
-}
-
-#define IGNITE_SAFE_FUNC(jniEnv, envPtr, type, field, ...) { \
-    JniHandlers* hnds = reinterpret_cast<JniHandlers*>(envPtr); \
-    type hnd = hnds->field; \
-    if (hnd) \
-        return hnd(hnds->target, __VA_ARGS__); \
-    else \
-    { \
-        ThrowOnMissingHandler(jniEnv); \
-        return 0; \
-    }\
-}
-
-namespace ignite
-{
-    namespace common
-    {
-        namespace java
-        {
-            namespace gcc = ignite::common::concurrent;
-
-            /* --- Startup exception. --- */
-            class JvmException : public std::exception {
-                // No-op.
-            };
-
-            /* --- JNI method definitions. --- */
-            struct JniMethod {
-                char* name;
-                char* sign;
-                bool isStatic;
-
-                JniMethod(const char* name, const char* sign, bool isStatic) {
-                    this->name = const_cast<char*>(name);
-                    this->sign = const_cast<char*>(sign);
-                    this->isStatic = isStatic;
-                }
-            };
-
-            /*
-             * Heloper function to copy characters.
-             *
-             * @param src Source.
-             * @return Result.
-             */
-            char* CopyChars(const char* src)
-            {
-                if (src)
-                {
-                    size_t len = strlen(src);
-                    char* dest = new char[len + 1];
-                    strcpy(dest, src);
-                    *(dest + len) = 0;
-                    return dest;
-                }
-                else
-                    return NULL;
-            }
-
-            JniErrorInfo::JniErrorInfo() : code(IGNITE_JNI_ERR_SUCCESS), errCls(NULL), errMsg(NULL)
-            {
-                // No-op.
-            }
-
-            JniErrorInfo::JniErrorInfo(int code, const char* errCls, const char* errMsg) : code(code)
-            {
-                this->errCls = CopyChars(errCls);
-                this->errMsg = CopyChars(errMsg);
-            }
-
-            JniErrorInfo::JniErrorInfo(const JniErrorInfo& other) : code(other.code)
-            {
-                this->errCls = CopyChars(other.errCls);
-                this->errMsg = CopyChars(other.errMsg);
-            }
-
-            JniErrorInfo& JniErrorInfo::operator=(const JniErrorInfo& other)
-            {
-                if (this != &other)
-                {
-                    // 1. Create new instance, exception could occur at this point.
-                    JniErrorInfo tmp(other);
-
-                    // 2. Swap with temp.
-                    int code0 = code;
-                    char* errCls0 = errCls;
-                    char* errMsg0 = errMsg;
-
-                    code = tmp.code;
-                    errCls = tmp.errCls;
-                    errMsg = tmp.errMsg;
-
-                    tmp.code = code0;
-                    tmp.errCls = errCls0;
-                    tmp.errMsg = errMsg0;
-                }
-
-                return *this;
-            }
-
-            JniErrorInfo::~JniErrorInfo()
-            {
-                if (errCls)
-                    delete[] errCls;
-
-                if (errMsg)
-                    delete[] errMsg;
-            }
-
-            const char* C_THROWABLE = "java/lang/Throwable";
-            JniMethod M_THROWABLE_GET_MESSAGE = JniMethod("getMessage", "()Ljava/lang/String;", false);
-            JniMethod M_THROWABLE_PRINT_STACK_TRACE = JniMethod("printStackTrace", "()V", false);
-
-            const char* C_CLASS = "java/lang/Class";
-            JniMethod M_CLASS_GET_NAME = JniMethod("getName", "()Ljava/lang/String;", false);
-
-            const char* C_IGNITE_EXCEPTION = "org/apache/ignite/IgniteException";
-
-            const char* C_PLATFORM_NO_CALLBACK_EXCEPTION = "org/apache/ignite/internal/processors/platform/PlatformNoCallbackException";
-
-            const char* C_PLATFORM_PROCESSOR = "org/apache/ignite/internal/processors/platform/PlatformProcessor";
-            JniMethod M_PLATFORM_PROCESSOR_RELEASE_START = JniMethod("releaseStart", "()V", false);
-            JniMethod M_PLATFORM_PROCESSOR_PROJECTION = JniMethod("projection", "()Lorg/apache/ignite/internal/processors/platform/PlatformTarget;", false);
-            JniMethod M_PLATFORM_PROCESSOR_CACHE = JniMethod("cache", "(Ljava/lang/String;)Lorg/apache/ignite/internal/processors/platform/PlatformTarget;", false);
-            JniMethod M_PLATFORM_PROCESSOR_CREATE_CACHE = JniMethod("createCache", "(Ljava/lang/String;)Lorg/apache/ignite/internal/processors/platform/PlatformTarget;", false);
-            JniMethod M_PLATFORM_PROCESSOR_GET_OR_CREATE_CACHE = JniMethod("getOrCreateCache", "(Ljava/lang/String;)Lorg/apache/ignite/internal/processors/platform/PlatformTarget;", false);
-            JniMethod M_PLATFORM_PROCESSOR_AFFINITY = JniMethod("affinity", "(Ljava/lang/String;)Lorg/apache/ignite/internal/processors/platform/PlatformTarget;", false);
-            JniMethod M_PLATFORM_PROCESSOR_DATA_STREAMER = JniMethod("dataStreamer", "(Ljava/lang/String;Z)Lorg/apache/ignite/internal/processors/platform/PlatformTarget;", false);
-            JniMethod M_PLATFORM_PROCESSOR_TRANSACTIONS = JniMethod("transactions", "()Lorg/apache/ignite/internal/processors/platform/PlatformTarget;", false);
-            JniMethod M_PLATFORM_PROCESSOR_COMPUTE = JniMethod("compute", "(Lorg/apache/ignite/internal/processors/platform/PlatformTarget;)Lorg/apache/ignite/internal/processors/platform/PlatformTarget;", false);
-            JniMethod M_PLATFORM_PROCESSOR_MESSAGE = JniMethod("message", "(Lorg/apache/ignite/internal/processors/platform/PlatformTarget;)Lorg/apache/ignite/internal/processors/platform/PlatformTarget;", false);
-            JniMethod M_PLATFORM_PROCESSOR_EVENTS = JniMethod("events", "(Lorg/apache/ignite/internal/processors/platform/PlatformTarget;)Lorg/apache/ignite/internal/processors/platform/PlatformTarget;", false);
-            JniMethod M_PLATFORM_PROCESSOR_SERVICES = JniMethod("services", "(Lorg/apache/ignite/internal/processors/platform/PlatformTarget;)Lorg/apache/ignite/internal/processors/platform/PlatformTarget;", false);
-            JniMethod M_PLATFORM_PROCESSOR_EXTENSIONS = JniMethod("extensions", "()Lorg/apache/ignite/internal/processors/platform/PlatformTarget;", false);
-            
-            const char* C_PLATFORM_TARGET = "org/apache/ignite/internal/processors/platform/PlatformTarget";
-            JniMethod M_PLATFORM_TARGET_IN_STREAM_OUT_LONG = JniMethod("inStreamOutLong", "(IJ)J", false);
-            JniMethod M_PLATFORM_TARGET_IN_STREAM_OUT_OBJECT = JniMethod("inStreamOutObject", "(IJ)Ljava/lang/Object;", false);
-            JniMethod M_PLATFORM_TARGET_IN_STREAM_OUT_STREAM = JniMethod("inStreamOutStream", "(IJJ)V", false);
-            JniMethod M_PLATFORM_TARGET_IN_OBJECT_STREAM_OUT_STREAM = JniMethod("inObjectStreamOutStream", "(ILjava/lang/Object;JJ)V", false);
-            JniMethod M_PLATFORM_TARGET_OUT_LONG = JniMethod("outLong", "(I)J", false);
-            JniMethod M_PLATFORM_TARGET_OUT_STREAM = JniMethod("outStream", "(IJ)V", false);
-            JniMethod M_PLATFORM_TARGET_OUT_OBJECT = JniMethod("outObject", "(I)Ljava/lang/Object;", false);
-            JniMethod M_PLATFORM_TARGET_LISTEN_FUTURE = JniMethod("listenFuture", "(JI)V", false);
-            JniMethod M_PLATFORM_TARGET_LISTEN_FOR_OPERATION = JniMethod("listenFutureForOperation", "(JII)V", false);
-
-            const char* C_PLATFORM_CLUSTER_GRP = "org/apache/ignite/internal/processors/platform/cluster/PlatformClusterGroup";
-            JniMethod M_PLATFORM_CLUSTER_GRP_FOR_OTHERS = JniMethod("forOthers", "(Lorg/apache/ignite/internal/processors/platform/cluster/PlatformClusterGroup;)Lorg/apache/ignite/internal/processors/platform/cluster/PlatformClusterGroup;", false);
-            JniMethod M_PLATFORM_CLUSTER_GRP_FOR_REMOTES = JniMethod("forRemotes", "()Lorg/apache/ignite/internal/processors/platform/cluster/PlatformClusterGroup;", false);
-            JniMethod M_PLATFORM_CLUSTER_GRP_FOR_DAEMONS = JniMethod("forDaemons", "()Lorg/apache/ignite/internal/processors/platform/cluster/PlatformClusterGroup;", false);
-            JniMethod M_PLATFORM_CLUSTER_GRP_FOR_RANDOM = JniMethod("forRandom", "()Lorg/apache/ignite/internal/processors/platform/cluster/PlatformClusterGroup;", false);
-            JniMethod M_PLATFORM_CLUSTER_GRP_FOR_OLDEST = JniMethod("forOldest", "()Lorg/apache/ignite/internal/processors/platform/cluster/PlatformClusterGroup;", false);
-            JniMethod M_PLATFORM_CLUSTER_GRP_FOR_YOUNGEST = JniMethod("forYoungest", "()Lorg/apache/ignite/internal/processors/platform/cluster/PlatformClusterGroup;", false);
-            JniMethod M_PLATFORM_CLUSTER_GRP_RESET_METRICS = JniMethod("resetMetrics", "()V", false);
-            
-            const char* C_PLATFORM_MESSAGING = "org/apache/ignite/internal/processors/platform/messaging/PlatformMessaging";
-            JniMethod M_PLATFORM_MESSAGING_WITH_ASYNC = JniMethod("withAsync", "()Lorg/apache/ignite/internal/processors/platform/messaging/PlatformMessaging;", false);
-
-            const char* C_PLATFORM_COMPUTE = "org/apache/ignite/internal/processors/platform/compute/PlatformCompute";
-            JniMethod M_PLATFORM_COMPUTE_WITH_NO_FAILOVER = JniMethod("withNoFailover", "()V", false);
-            JniMethod M_PLATFORM_COMPUTE_WITH_TIMEOUT = JniMethod("withTimeout", "(J)V", false);
-            JniMethod M_PLATFORM_COMPUTE_EXECUTE_NATIVE = JniMethod("executeNative", "(JJ)V", false);
-
-            const char* C_PLATFORM_CACHE = "org/apache/ignite/internal/processors/platform/cache/PlatformCache";
-            JniMethod M_PLATFORM_CACHE_WITH_SKIP_STORE = JniMethod("withSkipStore", "()Lorg/apache/ignite/internal/processors/platform/cache/PlatformCache;", false);
-            JniMethod M_PLATFORM_CACHE_WITH_NO_RETRIES = JniMethod("withNoRetries", "()Lorg/apache/ignite/internal/processors/platform/cache/PlatformCache;", false);
-            JniMethod M_PLATFORM_CACHE_WITH_EXPIRY_PLC = JniMethod("withExpiryPolicy", "(JJJ)Lorg/apache/ignite/internal/processors/platform/cache/PlatformCache;", false);
-            JniMethod M_PLATFORM_CACHE_WITH_ASYNC = JniMethod("withAsync", "()Lorg/apache/ignite/internal/processors/platform/cache/PlatformCache;", false);
-            JniMethod M_PLATFORM_CACHE_WITH_KEEP_PORTABLE = JniMethod("withKeepPortable", "()Lorg/apache/ignite/internal/processors/platform/cache/PlatformCache;", false);
-            JniMethod M_PLATFORM_CACHE_CLEAR = JniMethod("clear", "()V", false);
-            JniMethod M_PLATFORM_CACHE_REMOVE_ALL = JniMethod("removeAll", "()V", false);
-            JniMethod M_PLATFORM_CACHE_ITERATOR = JniMethod("iterator", "()Lorg/apache/ignite/internal/processors/platform/cache/PlatformCacheIterator;", false);
-            JniMethod M_PLATFORM_CACHE_LOCAL_ITERATOR = JniMethod("localIterator", "(I)Lorg/apache/ignite/internal/processors/platform/cache/PlatformCacheIterator;", false);
-            JniMethod M_PLATFORM_CACHE_ENTER_LOCK = JniMethod("enterLock", "(J)V", false);
-            JniMethod M_PLATFORM_CACHE_EXIT_LOCK = JniMethod("exitLock", "(J)V", false);
-            JniMethod M_PLATFORM_CACHE_TRY_ENTER_LOCK = JniMethod("tryEnterLock", "(JJ)Z", false);
-            JniMethod M_PLATFORM_CACHE_CLOSE_LOCK = JniMethod("closeLock", "(J)V", false);
-            JniMethod M_PLATFORM_CACHE_REBALANCE = JniMethod("rebalance", "(J)V", false);
-            JniMethod M_PLATFORM_CACHE_SIZE = JniMethod("size", "(IZ)I", false);
-
-            const char* C_PLATFORM_AFFINITY = "org/apache/ignite/internal/processors/platform/cache/affinity/PlatformAffinity";
-            JniMethod C_PLATFORM_AFFINITY_PARTITIONS = JniMethod("partitions", "()I", false);
-
-            const char* C_PLATFORM_DATA_STREAMER = "org/apache/ignite/internal/processors/platform/datastreamer/PlatformDataStreamer";
-            JniMethod M_PLATFORM_DATA_STREAMER_LISTEN_TOPOLOGY = JniMethod("listenTopology", "(J)V", false);
-            JniMethod M_PLATFORM_DATA_STREAMER_GET_ALLOW_OVERWRITE = JniMethod("allowOverwrite", "()Z", false);
-            JniMethod M_PLATFORM_DATA_STREAMER_SET_ALLOW_OVERWRITE = JniMethod("allowOverwrite", "(Z)V", false);
-            JniMethod M_PLATFORM_DATA_STREAMER_GET_SKIP_STORE = JniMethod("skipStore", "()Z", false);
-            JniMethod M_PLATFORM_DATA_STREAMER_SET_SKIP_STORE = JniMethod("skipStore", "(Z)V", false);
-            JniMethod M_PLATFORM_DATA_STREAMER_GET_PER_NODE_BUFFER_SIZE = JniMethod("perNodeBufferSize", "()I", false);
-            JniMethod M_PLATFORM_DATA_STREAMER_SET_PER_NODE_BUFFER_SIZE = JniMethod("perNodeBufferSize", "(I)V", false);
-            JniMethod M_PLATFORM_DATA_STREAMER_GET_PER_NODE_PARALLEL_OPS = JniMethod("perNodeParallelOperations", "()I", false);
-            JniMethod M_PLATFORM_DATA_STREAMER_SET_PER_NODE_PARALLEL_OPS = JniMethod("perNodeParallelOperations", "(I)V", false);
-
-            const char* C_PLATFORM_TRANSACTIONS = "org/apache/ignite/internal/processors/platform/transactions/PlatformTransactions";
-            JniMethod M_PLATFORM_TRANSACTIONS_TX_START = JniMethod("txStart", "(IIJI)J", false);
-            JniMethod M_PLATFORM_TRANSACTIONS_TX_COMMIT = JniMethod("txCommit", "(J)I", false);
-            JniMethod M_PLATFORM_TRANSACTIONS_TX_ROLLBACK = JniMethod("txRollback", "(J)I", false);
-            JniMethod M_PLATFORM_TRANSACTIONS_TX_COMMIT_ASYNC = JniMethod("txCommitAsync", "(JJ)V", false);
-            JniMethod M_PLATFORM_TRANSACTIONS_TX_ROLLBACK_ASYNC = JniMethod("txRollbackAsync", "(JJ)V", false);
-            JniMethod M_PLATFORM_TRANSACTIONS_TX_STATE = JniMethod("txState", "(J)I", false);
-            JniMethod M_PLATFORM_TRANSACTIONS_TX_SET_ROLLBACK_ONLY = JniMethod("txSetRollbackOnly", "(J)Z", false);
-            JniMethod M_PLATFORM_TRANSACTIONS_TX_CLOSE = JniMethod("txClose", "(J)I", false);
-            JniMethod M_PLATFORM_TRANSACTIONS_RESET_METRICS = JniMethod("resetMetrics", "()V", false);
-
-            const char* C_PLATFORM_CACHE_STORE_CALLBACK = "org/apache/ignite/internal/processors/platform/cache/store/PlatformCacheStoreCallback";
-            JniMethod M_PLATFORM_CACHE_STORE_CALLBACK_INVOKE = JniMethod("invoke", "(J)V", false);
-
-            const char* C_PLATFORM_CALLBACK_UTILS = "org/apache/ignite/internal/processors/platform/callback/PlatformCallbackUtils";
-
-            JniMethod M_PLATFORM_CALLBACK_UTILS_CACHE_STORE_CREATE = JniMethod("cacheStoreCreate", "(JJ)J", true);
-            JniMethod M_PLATFORM_CALLBACK_UTILS_CACHE_STORE_INVOKE = JniMethod("cacheStoreInvoke", "(JJJLjava/lang/Object;)I", true);
-            JniMethod M_PLATFORM_CALLBACK_UTILS_CACHE_STORE_DESTROY = JniMethod("cacheStoreDestroy", "(JJ)V", true);
-            JniMethod M_PLATFORM_CALLBACK_UTILS_CACHE_STORE_SESSION_CREATE = JniMethod("cacheStoreSessionCreate", "(JJ)J", true);
-
-            JniMethod M_PLATFORM_CALLBACK_UTILS_CACHE_ENTRY_FILTER_CREATE = JniMethod("cacheEntryFilterCreate", "(JJ)J", true);
-            JniMethod M_PLATFORM_CALLBACK_UTILS_CACHE_ENTRY_FILTER_APPLY = JniMethod("cacheEntryFilterApply", "(JJJ)I", true);
-            JniMethod M_PLATFORM_CALLBACK_UTILS_CACHE_ENTRY_FILTER_DESTROY = JniMethod("cacheEntryFilterDestroy", "(JJ)V", true);
-
-            JniMethod M_PLATFORM_CALLBACK_UTILS_CACHE_INVOKE = JniMethod("cacheInvoke", "(JJJ)V", true);
-
-            JniMethod M_PLATFORM_CALLBACK_UTILS_COMPUTE_TASK_MAP = JniMethod("computeTaskMap", "(JJJJ)V", true);
-            JniMethod M_PLATFORM_CALLBACK_UTILS_COMPUTE_TASK_JOB_RESULT = JniMethod("computeTaskJobResult", "(JJJJ)I", true);
-            JniMethod M_PLATFORM_CALLBACK_UTILS_COMPUTE_TASK_REDUCE = JniMethod("computeTaskReduce", "(JJ)V", true);
-            JniMethod M_PLATFORM_CALLBACK_UTILS_COMPUTE_TASK_COMPLETE = JniMethod("computeTaskComplete", "(JJJ)V", true);
-            JniMethod M_PLATFORM_CALLBACK_UTILS_COMPUTE_JOB_SERIALIZE = JniMethod("computeJobSerialize", "(JJJ)I", true);
-            JniMethod M_PLATFORM_CALLBACK_UTILS_COMPUTE_JOB_CREATE = JniMethod("computeJobCreate", "(JJ)J", true);
-            JniMethod M_PLATFORM_CALLBACK_UTILS_COMPUTE_JOB_EXECUTE = JniMethod("computeJobExecute", "(JJIJ)V", true);
-            JniMethod M_PLATFORM_CALLBACK_UTILS_COMPUTE_JOB_DESTROY = JniMethod("computeJobDestroy", "(JJ)V", true);
-            JniMethod M_PLATFORM_CALLBACK_UTILS_COMPUTE_JOB_CANCEL = JniMethod("computeJobCancel", "(JJ)V", true);
-
-            JniMethod M_PLATFORM_CALLBACK_UTILS_CONTINUOUS_QUERY_LSNR_APPLY = JniMethod("continuousQueryListenerApply", "(JJJ)V", true);
-            JniMethod M_PLATFORM_CALLBACK_UTILS_CONTINUOUS_QUERY_FILTER_CREATE = JniMethod("continuousQueryFilterCreate", "(JJ)J", true);
-            JniMethod M_PLATFORM_CALLBACK_UTILS_CONTINUOUS_QUERY_FILTER_EVAL = JniMethod("continuousQueryFilterApply", "(JJJ)I", true);
-            JniMethod M_PLATFORM_CALLBACK_UTILS_CONTINUOUS_QUERY_FILTER_RELEASE = JniMethod("continuousQueryFilterRelease", "(JJ)V", true);
-
-            JniMethod M_PLATFORM_CALLBACK_UTILS_DATA_STREAMER_TOPOLOGY_UPDATE = JniMethod("dataStreamerTopologyUpdate", "(JJJI)V", true);
-            JniMethod M_PLATFORM_CALLBACK_UTILS_DATA_STREAMER_STREAM_RECEIVER_INVOKE = JniMethod("dataStreamerStreamReceiverInvoke", "(JJLjava/lang/Object;JZ)V", true);
-
-            JniMethod M_PLATFORM_CALLBACK_UTILS_FUTURE_BYTE_RES = JniMethod("futureByteResult", "(JJI)V", true);
-            JniMethod M_PLATFORM_CALLBACK_UTILS_FUTURE_BOOL_RES = JniMethod("futureBoolResult", "(JJI)V", true);
-            JniMethod M_PLATFORM_CALLBACK_UTILS_FUTURE_SHORT_RES = JniMethod("futureShortResult", "(JJI)V", true);
-            JniMethod M_PLATFORM_CALLBACK_UTILS_FUTURE_CHAR_RES = JniMethod("futureCharResult", "(JJI)V", true);
-            JniMethod M_PLATFORM_CALLBACK_UTILS_FUTURE_INT_RES = JniMethod("futureIntResult", "(JJI)V", true);
-            JniMethod M_PLATFORM_CALLBACK_UTILS_FUTURE_FLOAT_RES = JniMethod("futureFloatResult", "(JJF)V", true);
-            JniMethod M_PLATFORM_CALLBACK_UTILS_FUTURE_LONG_RES = JniMethod("futureLongResult", "(JJJ)V", true);
-            JniMethod M_PLATFORM_CALLBACK_UTILS_FUTURE_DOUBLE_RES = JniMethod("futureDoubleResult", "(JJD)V", true);
-            JniMethod M_PLATFORM_CALLBACK_UTILS_FUTURE_OBJ_RES = JniMethod("futureObjectResult", "(JJJ)V", true);
-            JniMethod M_PLATFORM_CALLBACK_UTILS_FUTURE_NULL_RES = JniMethod("futureNullResult", "(JJ)V", true);
-            JniMethod M_PLATFORM_CALLBACK_UTILS_FUTURE_ERR = JniMethod("futureError", "(JJJ)V", true);
-
-            JniMethod M_PLATFORM_CALLBACK_UTILS_LIFECYCLE_EVENT = JniMethod("lifecycleEvent", "(JJI)V", true);
-
-            JniMethod M_PLATFORM_CALLBACK_UTILS_MESSAGING_FILTER_CREATE = JniMethod("messagingFilterCreate", "(JJ)J", true);
-            JniMethod M_PLATFORM_CALLBACK_UTILS_MESSAGING_FILTER_APPLY = JniMethod("messagingFilterApply", "(JJJ)I", true);
-            JniMethod M_PLATFORM_CALLBACK_UTILS_MESSAGING_FILTER_DESTROY = JniMethod("messagingFilterDestroy", "(JJ)V", true);
-            
-            JniMethod M_PLATFORM_CALLBACK_UTILS_EVENT_FILTER_CREATE = JniMethod("eventFilterCreate", "(JJ)J", true);
-            JniMethod M_PLATFORM_CALLBACK_UTILS_EVENT_FILTER_APPLY = JniMethod("eventFilterApply", "(JJJ)I", true);
-            JniMethod M_PLATFORM_CALLBACK_UTILS_EVENT_FILTER_DESTROY = JniMethod("eventFilterDestroy", "(JJ)V", true);
-            
-            JniMethod M_PLATFORM_CALLBACK_UTILS_SERVICE_INIT = JniMethod("serviceInit", "(JJ)J", true);
-            JniMethod M_PLATFORM_CALLBACK_UTILS_SERVICE_EXECUTE = JniMethod("serviceExecute", "(JJJ)V", true);
-            JniMethod M_PLATFORM_CALLBACK_UTILS_SERVICE_CANCEL = JniMethod("serviceCancel", "(JJJ)V", true);
-            JniMethod M_PLATFORM_CALLBACK_UTILS_SERVICE_INVOKE_METHOD = JniMethod("serviceInvokeMethod", "(JJJJ)V", true);
-			
-            JniMethod M_PLATFORM_CALLBACK_UTILS_CLUSTER_NODE_FILTER_APPLY = JniMethod("clusterNodeFilterApply", "(JJ)I", true);
-
-            JniMethod M_PLATFORM_CALLBACK_UTILS_NODE_INFO = JniMethod("nodeInfo", "(JJ)V", true);
-
-            JniMethod M_PLATFORM_CALLBACK_UTILS_MEMORY_REALLOCATE = JniMethod("memoryReallocate", "(JJI)V", true);
-
-            JniMethod M_PLATFORM_CALLBACK_UTILS_ON_START = JniMethod("onStart", "(JLjava/lang/Object;J)V", true);
-            JniMethod M_PLATFORM_CALLBACK_UTILS_ON_STOP = JniMethod("onStop", "(J)V", true);
-
-            JniMethod M_PLATFORM_CALLBACK_UTILS_EXTENSION_CALLBACK_IN_LONG_OUT_LONG = JniMethod("extensionCallbackInLongOutLong", "(JIJ)J", true);
-            JniMethod M_PLATFORM_CALLBACK_UTILS_EXTENSION_CALLBACK_IN_LONG_LONG_OUT_LONG = JniMethod("extensionCallbackInLongLongOutLong", "(JIJJ)J", true);
-            
-            const char* C_PLATFORM_UTILS = "org/apache/ignite/internal/processors/platform/utils/PlatformUtils";
-            JniMethod M_PLATFORM_UTILS_REALLOC = JniMethod("reallocate", "(JI)V", true);
-            JniMethod M_PLATFORM_UTILS_ERR_DATA = JniMethod("errorData", "(Ljava/lang/Throwable;)[B", true);
-
-            const char* C_PLATFORM_IGNITION = "org/apache/ignite/internal/processors/platform/PlatformIgnition";
-            JniMethod M_PLATFORM_IGNITION_START = JniMethod("start", "(Ljava/lang/String;Ljava/lang/String;IJJ)Lorg/apache/ignite/internal/processors/platform/PlatformProcessor;", true);
-            JniMethod M_PLATFORM_IGNITION_INSTANCE = JniMethod("instance", "(Ljava/lang/String;)Lorg/apache/ignite/internal/processors/platform/PlatformProcessor;", true);
-            JniMethod M_PLATFORM_IGNITION_ENVIRONMENT_POINTER = JniMethod("environmentPointer", "(Ljava/lang/String;)J", true);
-            JniMethod M_PLATFORM_IGNITION_STOP = JniMethod("stop", "(Ljava/lang/String;Z)Z", true);
-            JniMethod M_PLATFORM_IGNITION_STOP_ALL = JniMethod("stopAll", "(Z)V", true);
-            
-            const char* C_PLATFORM_ABSTRACT_QRY_CURSOR = "org/apache/ignite/internal/processors/platform/cache/query/PlatformAbstractQueryCursor";
-            JniMethod M_PLATFORM_ABSTRACT_QRY_CURSOR_ITER = JniMethod("iterator", "()V", false);
-            JniMethod M_PLATFORM_ABSTRACT_QRY_CURSOR_ITER_HAS_NEXT = JniMethod("iteratorHasNext", "()Z", false);
-            JniMethod M_PLATFORM_ABSTRACT_QRY_CURSOR_CLOSE = JniMethod("close", "()V", false);
-
-            const char* C_PLATFORM_CONT_QRY = "org/apache/ignite/internal/processors/platform/cache/query/PlatformContinuousQuery";
-            JniMethod M_PLATFORM_CONT_QRY_CLOSE = JniMethod("close", "()V", false);
-            JniMethod M_PLATFORM_CONT_QRY_GET_INITIAL_QUERY_CURSOR = JniMethod("getInitialQueryCursor", "()Lorg/apache/ignite/internal/processors/platform/PlatformTarget;", false);
-
-            const char* C_PLATFORM_EVENTS = "org/apache/ignite/internal/processors/platform/events/PlatformEvents";
-            JniMethod M_PLATFORM_EVENTS_WITH_ASYNC = JniMethod("withAsync", "()Lorg/apache/ignite/internal/processors/platform/events/PlatformEvents;", false);
-            JniMethod M_PLATFORM_EVENTS_STOP_LOCAL_LISTEN = JniMethod("stopLocalListen", "(J)Z", false);
-            JniMethod M_PLATFORM_EVENTS_LOCAL_LISTEN = JniMethod("localListen", "(JI)V", false);
-            JniMethod M_PLATFORM_EVENTS_IS_ENABLED = JniMethod("isEnabled", "(I)Z", false);
-            
-            const char* C_PLATFORM_SERVICES = "org/apache/ignite/internal/processors/platform/services/PlatformServices";
-			JniMethod M_PLATFORM_SERVICES_WITH_ASYNC = JniMethod("withAsync", "()Lorg/apache/ignite/internal/processors/platform/services/PlatformServices;", false);
-			JniMethod M_PLATFORM_SERVICES_WITH_SERVER_KEEP_PORTABLE = JniMethod("withServerKeepPortable", "()Lorg/apache/ignite/internal/processors/platform/services/PlatformServices;", false);
-			JniMethod M_PLATFORM_SERVICES_CANCEL = JniMethod("cancel", "(Ljava/lang/String;)V", false);
-			JniMethod M_PLATFORM_SERVICES_CANCEL_ALL = JniMethod("cancelAll", "()V", false);
-			JniMethod M_PLATFORM_SERVICES_SERVICE_PROXY = JniMethod("dotNetServiceProxy", "(Ljava/lang/String;Z)Ljava/lang/Object;", false);
-
-            /* STATIC STATE. */
-            gcc::CriticalSection JVM_LOCK;
-            JniJvm JVM;
-            bool PRINT_EXCEPTION = false;
-
-            /* HELPER METHODS. */
-
-            /*
-             * Throw exception to Java in case of missing callback pointer. It means that callback is not implemented in
-             * native platform and Java -> platform operation cannot proceede further. As JniContext is not available at
-             * this point, we have to obtain exception details from scratch. This is not critical from performance
-             * perspective because missing handler usually denotes fatal condition.
-             *
-             * @param env JNI environment.
-             */
-            int ThrowOnMissingHandler(JNIEnv* env)
-            {
-                jclass cls = env->FindClass(C_PLATFORM_NO_CALLBACK_EXCEPTION);
-
-                env->ThrowNew(cls, "Callback handler is not set in native platform.");
-
-                return 0;
-            }
-
-            char* StringToChars(JNIEnv* env, jstring str, int* len) {
-                if (!str) {
-                    *len = 0;
-                    return NULL;
-                }
-
-                const char* strChars = env->GetStringUTFChars(str, 0);
-                const int strCharsLen = env->GetStringUTFLength(str);
-
-                char* strChars0 = new char[strCharsLen + 1];
-                std::strcpy(strChars0, strChars);
-                *(strChars0 + strCharsLen) = 0;
-
-                env->ReleaseStringUTFChars(str, strChars);
-
-                if (len)
-                    *len = strCharsLen;
-
-                return strChars0;
-            }
-
-            std::string JavaStringToCString(JNIEnv* env, jstring str, int* len)
-            {
-                char* resChars = StringToChars(env, str, len);
-
-                if (resChars)
-                {
-                    std::string res = std::string(resChars, *len);
-
-                    delete[] resChars;
-                    
-                    return res;
-                }
-                else
-                    return std::string();
-            }
-
-            jclass FindClass(JNIEnv* env, const char *name) {
-                jclass res = env->FindClass(name);
-
-                if (!res)
-                    throw JvmException();
-
-                jclass res0 = static_cast<jclass>(env->NewGlobalRef(res));
-
-                env->DeleteLocalRef(res);
-
-                return res0;
-            }
-
-            void DeleteClass(JNIEnv* env, jclass cls) {
-                if (cls)
-                    env->DeleteGlobalRef(cls);
-            }
-
-            void CheckClass(JNIEnv* env, const char *name)
-            {
-                jclass res = env->FindClass(name);
-
-                if (!res)
-                    throw JvmException();
-            }
-
-            jmethodID FindMethod(JNIEnv* env, jclass cls, JniMethod mthd) {
-                jmethodID mthd0 = mthd.isStatic ?
-                    env->GetStaticMethodID(cls, mthd.name, mthd.sign) : env->GetMethodID(cls, mthd.name, mthd.sign);
-
-                if (!mthd0)
-                    throw JvmException();
-
-                return mthd0;
-            }
-
-            void AddNativeMethod(JNINativeMethod* mthd, JniMethod jniMthd, void* fnPtr) {
-                mthd->name = jniMthd.name;
-                mthd->signature = jniMthd.sign;
-                mthd->fnPtr = fnPtr;
-            }
-
-            void JniJavaMembers::Initialize(JNIEnv* env) {
-                c_Class = FindClass(env, C_CLASS);
-                m_Class_getName = FindMethod(env, c_Class, M_CLASS_GET_NAME);
-
-                c_Throwable = FindClass(env, C_THROWABLE);
-                m_Throwable_getMessage = FindMethod(env, c_Throwable, M_THROWABLE_GET_MESSAGE);
-                m_Throwable_printStackTrace = FindMethod(env, c_Throwable, M_THROWABLE_PRINT_STACK_TRACE);
-            }
-
-            void JniJavaMembers::Destroy(JNIEnv* env) {
-                DeleteClass(env, c_Class);
-                DeleteClass(env, c_Throwable);
-            }
-
-            bool JniJavaMembers::WriteErrorInfo(JNIEnv* env, char** errClsName, int* errClsNameLen, char** errMsg, int* errMsgLen) {
-                if (env && env->ExceptionCheck()) {
-                    if (m_Class_getName && m_Throwable_getMessage) {
-                        jthrowable err = env->ExceptionOccurred();
-
-                        env->ExceptionClear();
-
-                        jclass errCls = env->GetObjectClass(err);
-
-                        jstring clsName = static_cast<jstring>(env->CallObjectMethod(errCls, m_Class_getName));
-                        *errClsName = StringToChars(env, clsName, errClsNameLen);
-
-                        jstring msg = static_cast<jstring>(env->CallObjectMethod(err, m_Throwable_getMessage));
-                        *errMsg = StringToChars(env, msg, errMsgLen);
-
-                        if (errCls)
-                            env->DeleteLocalRef(errCls);
-
-                        if (clsName)
-                            env->DeleteLocalRef(clsName);
-
-                        if (msg)
-                            env->DeleteLocalRef(msg);
-
-                        return true;
-                    }
-                    else {
-                        env->ExceptionClear();
-                    }
-                }
-
-                return false;
-            }
-
-            void JniMembers::Initialize(JNIEnv* env) {
-                c_PlatformAbstractQryCursor = FindClass(env, C_PLATFORM_ABSTRACT_QRY_CURSOR);
-                m_PlatformAbstractQryCursor_iter = FindMethod(env, c_PlatformAbstractQryCursor, M_PLATFORM_ABSTRACT_QRY_CURSOR_ITER);
-                m_PlatformAbstractQryCursor_iterHasNext = FindMethod(env, c_PlatformAbstractQryCursor, M_PLATFORM_ABSTRACT_QRY_CURSOR_ITER_HAS_NEXT);
-                m_PlatformAbstractQryCursor_close = FindMethod(env, c_PlatformAbstractQryCursor, M_PLATFORM_ABSTRACT_QRY_CURSOR_CLOSE);
-
-                c_PlatformAffinity = FindClass(env, C_PLATFORM_AFFINITY);
-                m_PlatformAffinity_partitions = FindMethod(env, c_PlatformAffinity, C_PLATFORM_AFFINITY_PARTITIONS);
-
-                c_PlatformCache = FindClass(env, C_PLATFORM_CACHE);
-                m_PlatformCache_withSkipStore = FindMethod(env, c_PlatformCache, M_PLATFORM_CACHE_WITH_SKIP_STORE);
-                m_PlatformCache_withNoRetries = FindMethod(env, c_PlatformCache, M_PLATFORM_CACHE_WITH_NO_RETRIES);
-                m_PlatformCache_withExpiryPolicy = FindMethod(env, c_PlatformCache, M_PLATFORM_CACHE_WITH_EXPIRY_PLC);
-                m_PlatformCache_withAsync = FindMethod(env, c_PlatformCache, M_PLATFORM_CACHE_WITH_ASYNC);
-                m_PlatformCache_withKeepPortable = FindMethod(env, c_PlatformCache, M_PLATFORM_CACHE_WITH_KEEP_PORTABLE);
-                m_PlatformCache_clear = FindMethod(env, c_PlatformCache, M_PLATFORM_CACHE_CLEAR);
-                m_PlatformCache_removeAll = FindMethod(env, c_PlatformCache, M_PLATFORM_CACHE_REMOVE_ALL);
-                m_PlatformCache_iterator = FindMethod(env, c_PlatformCache, M_PLATFORM_CACHE_ITERATOR);
-                m_PlatformCache_localIterator = FindMethod(env, c_PlatformCache, M_PLATFORM_CACHE_LOCAL_ITERATOR);
-                m_PlatformCache_enterLock = FindMethod(env, c_PlatformCache, M_PLATFORM_CACHE_ENTER_LOCK);
-                m_PlatformCache_exitLock = FindMethod(env, c_PlatformCache, M_PLATFORM_CACHE_EXIT_LOCK);
-                m_PlatformCache_tryEnterLock = FindMethod(env, c_PlatformCache, M_PLATFORM_CACHE_TRY_ENTER_LOCK);
-                m_PlatformCache_closeLock = FindMethod(env, c_PlatformCache, M_PLATFORM_CACHE_CLOSE_LOCK);
-                m_PlatformCache_rebalance = FindMethod(env, c_PlatformCache, M_PLATFORM_CACHE_REBALANCE);
-                m_PlatformCache_size = FindMethod(env, c_PlatformCache, M_PLATFORM_CACHE_SIZE);
-
-                c_PlatformCacheStoreCallback = FindClass(env, C_PLATFORM_CACHE_STORE_CALLBACK);
-                m_PlatformCacheStoreCallback_invoke = FindMethod(env, c_PlatformCacheStoreCallback, M_PLATFORM_CACHE_STORE_CALLBACK_INVOKE);
-
-                c_IgniteException = FindClass(env, C_IGNITE_EXCEPTION);
-
-                c_PlatformClusterGroup = FindClass(env, C_PLATFORM_CLUSTER_GRP);
-                m_PlatformClusterGroup_forOthers = FindMethod(env, c_PlatformClusterGroup, M_PLATFORM_CLUSTER_GRP_FOR_OTHERS);
-                m_PlatformClusterGroup_forRemotes = FindMethod(env, c_PlatformClusterGroup, M_PLATFORM_CLUSTER_GRP_FOR_REMOTES);
-                m_PlatformClusterGroup_forDaemons = FindMethod(env, c_PlatformClusterGroup, M_PLATFORM_CLUSTER_GRP_FOR_DAEMONS);
-                m_PlatformClusterGroup_forRandom = FindMethod(env, c_PlatformClusterGroup, M_PLATFORM_CLUSTER_GRP_FOR_RANDOM);
-                m_PlatformClusterGroup_forOldest = FindMethod(env, c_PlatformClusterGroup, M_PLATFORM_CLUSTER_GRP_FOR_OLDEST);
-                m_PlatformClusterGroup_forYoungest = FindMethod(env, c_PlatformClusterGroup, M_PLATFORM_CLUSTER_GRP_FOR_YOUNGEST);
-                m_PlatformClusterGroup_resetMetrics = FindMethod(env, c_PlatformClusterGroup, M_PLATFORM_CLUSTER_GRP_RESET_METRICS);
-
-                c_PlatformCompute = FindClass(env, C_PLATFORM_COMPUTE);
-                m_PlatformCompute_withNoFailover = FindMethod(env, c_PlatformCompute, M_PLATFORM_COMPUTE_WITH_NO_FAILOVER);
-                m_PlatformCompute_withTimeout = FindMethod(env, c_PlatformCompute, M_PLATFORM_COMPUTE_WITH_TIMEOUT);
-                m_PlatformCompute_executeNative = FindMethod(env, c_PlatformCompute, M_PLATFORM_COMPUTE_EXECUTE_NATIVE);
-
-                c_PlatformContinuousQuery = FindClass(env, C_PLATFORM_CONT_QRY);
-                m_PlatformContinuousQuery_close = FindMethod(env, c_PlatformContinuousQuery, M_PLATFORM_CONT_QRY_CLOSE);
-                m_PlatformContinuousQuery_getInitialQueryCursor = FindMethod(env, c_PlatformContinuousQuery, M_PLATFORM_CONT_QRY_GET_INITIAL_QUERY_CURSOR);
-
-                c_PlatformDataStreamer = FindClass(env, C_PLATFORM_DATA_STREAMER);
-                m_PlatformDataStreamer_listenTopology = FindMethod(env, c_PlatformDataStreamer, M_PLATFORM_DATA_STREAMER_LISTEN_TOPOLOGY);
-                m_PlatformDataStreamer_getAllowOverwrite = FindMethod(env, c_PlatformDataStreamer, M_PLATFORM_DATA_STREAMER_GET_ALLOW_OVERWRITE);
-                m_PlatformDataStreamer_setAllowOverwrite = FindMethod(env, c_PlatformDataStreamer, M_PLATFORM_DATA_STREAMER_SET_ALLOW_OVERWRITE);
-                m_PlatformDataStreamer_getSkipStore = FindMethod(env, c_PlatformDataStreamer, M_PLATFORM_DATA_STREAMER_GET_SKIP_STORE);
-                m_PlatformDataStreamer_setSkipStore = FindMethod(env, c_PlatformDataStreamer, M_PLATFORM_DATA_STREAMER_SET_SKIP_STORE);
-                m_PlatformDataStreamer_getPerNodeBufSize = FindMethod(env, c_PlatformDataStreamer, M_PLATFORM_DATA_STREAMER_GET_PER_NODE_BUFFER_SIZE);
-                m_PlatformDataStreamer_setPerNodeBufSize = FindMethod(env, c_PlatformDataStreamer, M_PLATFORM_DATA_STREAMER_SET_PER_NODE_BUFFER_SIZE);
-                m_PlatformDataStreamer_getPerNodeParallelOps = FindMethod(env, c_PlatformDataStreamer, M_PLATFORM_DATA_STREAMER_GET_PER_NODE_PARALLEL_OPS);
-                m_PlatformDataStreamer_setPerNodeParallelOps = FindMethod(env, c_PlatformDataStreamer, M_PLATFORM_DATA_STREAMER_SET_PER_NODE_PARALLEL_OPS);
-                
-                c_PlatformEvents = FindClass(env, C_PLATFORM_EVENTS);
-                m_PlatformEvents_withAsync = FindMethod(env, c_PlatformEvents, M_PLATFORM_EVENTS_WITH_ASYNC);
-                m_PlatformEvents_stopLocalListen = FindMethod(env, c_PlatformEvents, M_PLATFORM_EVENTS_STOP_LOCAL_LISTEN);
-                m_PlatformEvents_localListen = FindMethod(env, c_PlatformEvents, M_PLATFORM_EVENTS_LOCAL_LISTEN);
-                m_PlatformEvents_isEnabled = FindMethod(env, c_PlatformEvents, M_PLATFORM_EVENTS_IS_ENABLED);
-                
-				c_PlatformServices = FindClass(env, C_PLATFORM_SERVICES);
-				m_PlatformServices_withAsync = FindMethod(env, c_PlatformServices, M_PLATFORM_SERVICES_WITH_ASYNC);
-				m_PlatformServices_withServerKeepPortable = FindMethod(env, c_PlatformServices, M_PLATFORM_SERVICES_WITH_SERVER_KEEP_PORTABLE);
-				m_PlatformServices_cancel = FindMethod(env, c_PlatformServices, M_PLATFORM_SERVICES_CANCEL);
-				m_PlatformServices_cancelAll = FindMethod(env, c_PlatformServices, M_PLATFORM_SERVICES_CANCEL_ALL);
-				m_PlatformServices_serviceProxy = FindMethod(env, c_PlatformServices, M_PLATFORM_SERVICES_SERVICE_PROXY);
-
-                c_PlatformIgnition = FindClass(env, C_PLATFORM_IGNITION);
-                m_PlatformIgnition_start = FindMethod(env, c_PlatformIgnition, M_PLATFORM_IGNITION_START);
-                m_PlatformIgnition_instance = FindMethod(env, c_PlatformIgnition, M_PLATFORM_IGNITION_INSTANCE);
-                m_PlatformIgnition_environmentPointer = FindMethod(env, c_PlatformIgnition, M_PLATFORM_IGNITION_ENVIRONMENT_POINTER);
-                m_PlatformIgnition_stop = FindMethod(env, c_PlatformIgnition, M_PLATFORM_IGNITION_STOP);
-                m_PlatformIgnition_stopAll = FindMethod(env, c_PlatformIgnition, M_PLATFORM_IGNITION_STOP_ALL);
-
-                c_PlatformMessaging = FindClass(env, C_PLATFORM_MESSAGING);
-                m_PlatformMessaging_withAsync = FindMethod(env, c_PlatformMessaging, M_PLATFORM_MESSAGING_WITH_ASYNC);
-
-                c_PlatformProcessor = FindClass(env, C_PLATFORM_PROCESSOR);
-                m_PlatformProcessor_releaseStart = FindMethod(env, c_PlatformProcessor, M_PLATFORM_PROCESSOR_RELEASE_START);
-                m_PlatformProcessor_cache = FindMethod(env, c_PlatformProcessor, M_PLATFORM_PROCESSOR_CACHE);
-                m_PlatformProcessor_createCache = FindMethod(env, c_PlatformProcessor, M_PLATFORM_PROCESSOR_CREATE_CACHE);
-                m_PlatformProcessor_getOrCreateCache = FindMethod(env, c_PlatformProcessor, M_PLATFORM_PROCESSOR_GET_OR_CREATE_CACHE);
-                m_PlatformProcessor_affinity = FindMethod(env, c_PlatformProcessor, M_PLATFORM_PROCESSOR_AFFINITY);
-                m_PlatformProcessor_dataStreamer = FindMethod(env, c_PlatformProcessor, M_PLATFORM_PROCESSOR_DATA_STREAMER);
-                m_PlatformProcessor_transactions = FindMethod(env, c_PlatformProcessor, M_PLATFORM_PROCESSOR_TRANSACTIONS);
-                m_PlatformProcessor_projection = FindMethod(env, c_PlatformProcessor, M_PLATFORM_PROCESSOR_PROJECTION);
-                m_PlatformProcessor_compute = FindMethod(env, c_PlatformProcessor, M_PLATFORM_PROCESSOR_COMPUTE);
-                m_PlatformProcessor_message = FindMethod(env, c_PlatformProcessor, M_PLATFORM_PROCESSOR_MESSAGE);
-                m_PlatformProcessor_events = FindMethod(env, c_PlatformProcessor, M_PLATFORM_PROCESSOR_EVENTS);
-                m_PlatformProcessor_services = FindMethod(env, c_PlatformProcessor, M_PLATFORM_PROCESSOR_SERVICES);
-                m_PlatformProcessor_extensions = FindMethod(env, c_PlatformProcessor, M_PLATFORM_PROCESSOR_EXTENSIONS);
-
-                c_PlatformTarget = FindClass(env, C_PLATFORM_TARGET);
-                m_PlatformTarget_inStreamOutLong = FindMethod(env, c_PlatformTarget, M_PLATFORM_TARGET_IN_STREAM_OUT_LONG);
-                m_PlatformTarget_inStreamOutObject = FindMethod(env, c_PlatformTarget, M_PLATFORM_TARGET_IN_STREAM_OUT_OBJECT);
-                m_PlatformTarget_outLong = FindMethod(env, c_PlatformTarget, M_PLATFORM_TARGET_OUT_LONG);
-                m_PlatformTarget_outStream = FindMethod(env, c_PlatformTarget, M_PLATFORM_TARGET_OUT_STREAM);
-                m_PlatformTarget_outObject = FindMethod(env, c_PlatformTarget, M_PLATFORM_TARGET_OUT_OBJECT);
-                m_PlatformTarget_inStreamOutStream = FindMethod(env, c_PlatformTarget, M_PLATFORM_TARGET_IN_STREAM_OUT_STREAM);
-                m_PlatformTarget_inObjectStreamOutStream = FindMethod(env, c_PlatformTarget, M_PLATFORM_TARGET_IN_OBJECT_STREAM_OUT_STREAM);
-                m_PlatformTarget_listenFuture = FindMethod(env, c_PlatformTarget, M_PLATFORM_TARGET_LISTEN_FUTURE);
-                m_PlatformTarget_listenFutureForOperation = FindMethod(env, c_PlatformTarget, M_PLATFORM_TARGET_LISTEN_FOR_OPERATION);
-
-                c_PlatformTransactions = FindClass(env, C_PLATFORM_TRANSACTIONS);
-                m_PlatformTransactions_txStart = FindMethod(env, c_PlatformTransactions, M_PLATFORM_TRANSACTIONS_TX_START);
-                m_PlatformTransactions_txCommit = FindMethod(env, c_PlatformTransactions, M_PLATFORM_TRANSACTIONS_TX_COMMIT);
-                m_PlatformTransactions_txRollback = FindMethod(env, c_PlatformTransactions, M_PLATFORM_TRANSACTIONS_TX_ROLLBACK);
-                m_PlatformTransactions_txCommitAsync = FindMethod(env, c_PlatformTransactions, M_PLATFORM_TRANSACTIONS_TX_COMMIT_ASYNC);
-                m_PlatformTransactions_txRollbackAsync = FindMethod(env, c_PlatformTransactions, M_PLATFORM_TRANSACTIONS_TX_ROLLBACK_ASYNC);
-                m_PlatformTransactions_txState = FindMethod(env, c_PlatformTransactions, M_PLATFORM_TRANSACTIONS_TX_STATE);
-                m_PlatformTransactions_txSetRollbackOnly = FindMethod(env, c_PlatformTransactions, M_PLATFORM_TRANSACTIONS_TX_SET_ROLLBACK_ONLY);
-                m_PlatformTransactions_txClose = FindMethod(env, c_PlatformTransactions, M_PLATFORM_TRANSACTIONS_TX_CLOSE);
-                m_PlatformTransactions_resetMetrics = FindMethod(env, c_PlatformTransactions, M_PLATFORM_TRANSACTIONS_RESET_METRICS);
-
-                c_PlatformUtils = FindClass(env, C_PLATFORM_UTILS);
-                m_PlatformUtils_reallocate = FindMethod(env, c_PlatformUtils, M_PLATFORM_UTILS_REALLOC);
-                m_PlatformUtils_errData = FindMethod(env, c_PlatformUtils, M_PLATFORM_UTILS_ERR_DATA);
-
-                // Find utility classes which are not used from context, but are still required in other places.
-                CheckClass(env, C_PLATFORM_NO_CALLBACK_EXCEPTION);
-            }
-
-            void JniMembers::Destroy(JNIEnv* env) {
-                DeleteClass(env, c_PlatformAbstractQryCursor);
-                DeleteClass(env, c_PlatformAffinity);
-                DeleteClass(env, c_PlatformCache);
-                DeleteClass(env, c_PlatformCacheStoreCallback);
-                DeleteClass(env, c_IgniteException);
-                DeleteClass(env, c_PlatformClusterGroup);
-                DeleteClass(env, c_PlatformCompute);
-                DeleteClass(env, c_PlatformContinuousQuery);
-                DeleteClass(env, c_PlatformDataStreamer);
-                DeleteClass(env, c_PlatformEvents);
-                DeleteClass(env, c_PlatformIgnition);
-                DeleteClass(env, c_PlatformMessaging);
-                DeleteClass(env, c_PlatformProcessor);
-                DeleteClass(env, c_PlatformTarget);
-                DeleteClass(env, c_PlatformTransactions);
-                DeleteClass(env, c_PlatformUtils);
-            }
-
-            JniJvm::JniJvm() : jvm(NULL), javaMembers(JniJavaMembers()), members(JniMembers())
-            {
-                // No-op.
-            }
-
-            JniJvm::JniJvm(JavaVM* jvm, JniJavaMembers javaMembers, JniMembers members) : 
-                jvm(jvm), javaMembers(javaMembers), members(members)
-            {
-                // No-op.
-            }
-
-            JavaVM* JniJvm::GetJvm()
-            {
-                return jvm;
-            }
-
-            JniJavaMembers& JniJvm::GetJavaMembers()
-            {
-                return javaMembers;
-            }
-
-            JniMembers& JniJvm::GetMembers()
-            {
-                return members;
-            }
-
-            /*
-             * Create JVM.
-             */
-            void CreateJvm(char** opts, int optsLen, JavaVM** jvm, JNIEnv** env) {
-                JavaVMOption* opts0 = new JavaVMOption[optsLen];
-
-                for (int i = 0; i < optsLen; i++)
-                    opts0[i].optionString = *(opts + i);
-
-                JavaVMInitArgs args;
-
-                args.version = JNI_VERSION_1_6;
-                args.nOptions = optsLen;
-                args.options = opts0;
-                args.ignoreUnrecognized = 0;
-
-                jint res = JNI_CreateJavaVM(jvm, reinterpret_cast<void**>(env), &args);
-
-                delete[] opts0;
-
-                if (res != JNI_OK)
-                    throw JvmException();
-            }
-
-            void RegisterNatives(JNIEnv* env) {
-                {
-					JNINativeMethod methods[52];
-
-                    int idx = 0;
-
-                    AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_CACHE_STORE_CREATE, reinterpret_cast<void*>(JniCacheStoreCreate));
-                    AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_CACHE_STORE_INVOKE, reinterpret_cast<void*>(JniCacheStoreInvoke));
-                    AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_CACHE_STORE_DESTROY, reinterpret_cast<void*>(JniCacheStoreDestroy));
-
-                    AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_CACHE_STORE_SESSION_CREATE, reinterpret_cast<void*>(JniCacheStoreSessionCreate));
-
-                    AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_CACHE_ENTRY_FILTER_CREATE, reinterpret_cast<void*>(JniCacheEntryFilterCreate));
-                    AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_CACHE_ENTRY_FILTER_APPLY, reinterpret_cast<void*>(JniCacheEntryFilterApply));
-                    AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_CACHE_ENTRY_FILTER_DESTROY, reinterpret_cast<void*>(JniCacheEntryFilterDestroy));
-
-                    AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_CACHE_INVOKE, reinterpret_cast<void*>(JniCacheInvoke));
-
-                    AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_COMPUTE_TASK_MAP, reinterpret_cast<void*>(JniComputeTaskMap));
-                    AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_COMPUTE_TASK_JOB_RESULT, reinterpret_cast<void*>(JniComputeTaskJobResult));
-                    AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_COMPUTE_TASK_REDUCE, reinterpret_cast<void*>(JniComputeTaskReduce));
-                    AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_COMPUTE_TASK_COMPLETE, reinterpret_cast<void*>(JniComputeTaskComplete));
-
-                    AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_COMPUTE_JOB_SERIALIZE, reinterpret_cast<void*>(JniComputeJobSerialize));
-                    AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_COMPUTE_JOB_CREATE, reinterpret_cast<void*>(JniComputeJobCreate));
-                    AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_COMPUTE_JOB_EXECUTE, reinterpret_cast<void*>(JniComputeJobExecute));
-                    AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_COMPUTE_JOB_DESTROY, reinterpret_cast<void*>(JniComputeJobDestroy));
-                    AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_COMPUTE_JOB_CANCEL, reinterpret_cast<void*>(JniComputeJobCancel));
-
-                    AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_CONTINUOUS_QUERY_LSNR_APPLY, reinterpret_cast<void*>(JniContinuousQueryListenerApply));
-                    AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_CONTINUOUS_QUERY_FILTER_CREATE, reinterpret_cast<void*>(JniContinuousQueryFilterCreate));
-                    AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_CONTINUOUS_QUERY_FILTER_EVAL, reinterpret_cast<void*>(JniContinuousQueryFilterApply));
-                    AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_CONTINUOUS_QUERY_FILTER_RELEASE, reinterpret_cast<void*>(JniContinuousQueryFilterRelease));
-
-                    AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_DATA_STREAMER_TOPOLOGY_UPDATE, reinterpret_cast<void*>(JniDataStreamerTopologyUpdate));
-                    AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_DATA_STREAMER_STREAM_RECEIVER_INVOKE, reinterpret_cast<void*>(JniDataStreamerStreamReceiverInvoke));
-
-                    AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_FUTURE_BYTE_RES, reinterpret_cast<void*>(JniFutureByteResult));
-                    AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_FUTURE_BOOL_RES, reinterpret_cast<void*>(JniFutureBoolResult));
-                    AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_FUTURE_SHORT_RES, reinterpret_cast<void*>(JniFutureShortResult));
-                    AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_FUTURE_CHAR_RES, reinterpret_cast<void*>(JniFutureCharResult));
-                    AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_FUTURE_INT_RES, reinterpret_cast<void*>(JniFutureIntResult));
-                    AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_FUTURE_FLOAT_RES, reinterpret_cast<void*>(JniFutureFloatResult));
-                    AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_FUTURE_LONG_RES, reinterpret_cast<void*>(JniFutureLongResult));
-                    AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_FUTURE_DOUBLE_RES, reinterpret_cast<void*>(JniFutureDoubleResult));
-                    AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_FUTURE_OBJ_RES, reinterpret_cast<void*>(JniFutureObjectResult));
-                    AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_FUTURE_NULL_RES, reinterpret_cast<void*>(JniFutureNullResult));
-                    AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_FUTURE_ERR, reinterpret_cast<void*>(JniFutureError));
-
-                    AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_LIFECYCLE_EVENT, reinterpret_cast<void*>(JniLifecycleEvent));
-
-                    AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_MESSAGING_FILTER_CREATE, reinterpret_cast<void*>(JniMessagingFilterCreate));
-                    AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_MESSAGING_FILTER_APPLY, reinterpret_cast<void*>(JniMessagingFilterApply));
-                    AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_MESSAGING_FILTER_DESTROY, reinterpret_cast<void*>(JniMessagingFilterDestroy));
-                    
-                    AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_EVENT_FILTER_CREATE, reinterpret_cast<void*>(JniEventFilterCreate));
-                    AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_EVENT_FILTER_APPLY, reinterpret_cast<void*>(JniEventFilterApply));
-                    AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_EVENT_FILTER_DESTROY, reinterpret_cast<void*>(JniEventFilterDestroy));
-                    
-                    AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_SERVICE_INIT, reinterpret_cast<void*>(JniServiceInit));
-                    AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_SERVICE_EXECUTE, reinterpret_cast<void*>(JniServiceExecute));
-                    AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_SERVICE_CANCEL, reinterpret_cast<void*>(JniServiceCancel));
-                    AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_SERVICE_INVOKE_METHOD, reinterpret_cast<void*>(JniServiceInvokeMethod));
-					
-                    AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_CLUSTER_NODE_FILTER_APPLY, reinterpret_cast<void*>(JniClusterNodeFilterApply));
-
-                    AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_NODE_INFO, reinterpret_cast<void*>(JniNodeInfo));
-
-                    AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_MEMORY_REALLOCATE, reinterpret_cast<void*>(JniMemoryReallocate));
-
-                    AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_ON_START, reinterpret_cast<void*>(JniOnStart));
-                    AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_ON_STOP, reinterpret_cast<void*>(JniOnStop));
-
-                    AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_EXTENSION_CALLBACK_IN_LONG_OUT_LONG, reinterpret_cast<void*>(JniExtensionCallbackInLongOutLong));
-                    AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_EXTENSION_CALLBACK_IN_LONG_LONG_OUT_LONG, reinterpret_cast<void*>(JniExtensionCallbackInLongLongOutLong));
-
-                    jint res = env->RegisterNatives(FindClass(env, C_PLATFORM_CALLBACK_UTILS), methods, idx);
-
-                    if (res != JNI_OK)
-                        throw JvmException();
-                }  
-            }
-
-            JniContext::JniContext(JniJvm* jvm, JniHandlers hnds) : jvm(jvm), hnds(hnds) {
-                // No-op.
-            }
-
-            JniContext* JniContext::Create(char** opts, int optsLen, JniHandlers hnds) {
-                return Create(opts, optsLen, hnds, NULL);
-            }
-
-            JniContext* JniContext::Create(char** opts, int optsLen, JniHandlers hnds, JniErrorInfo* errInfo)
-            {
-                // Acquire global lock to instantiate the JVM.
-                JVM_LOCK.Enter();
-
-                // Define local variables.
-                JavaVM* jvm = NULL;
-                JNIEnv* env = NULL;
-
-                JniJavaMembers javaMembers;
-                memset(&javaMembers, 0, sizeof(javaMembers));
-
-                JniMembers members;
-                memset(&members, 0, sizeof(members));
-
-                JniContext* ctx = NULL;
-
-                std::string errClsName;
-                int errClsNameLen = 0;
-                std::string errMsg;
-                int errMsgLen = 0;
-
-                try {
-                    if (!JVM.GetJvm()) {
-                        // 1. Create JVM itself.    
-                        CreateJvm(opts, optsLen, &jvm, &env);
-
-                        // 2. Populate members;
-                        javaMembers.Initialize(env);
-                        members.Initialize(env);
-
-                        // 3. Register native functions.
-                        RegisterNatives(env);
-
-                        // 4. Create JNI JVM.
-                        JVM = JniJvm(jvm, javaMembers, members);
-
-                        char* printStack = getenv("IGNITE_CPP_PRINT_STACK");
-                        PRINT_EXCEPTION = printStack && strcmp("true", printStack) == 0;
-                    }
-
-                    ctx = new JniContext(&JVM, hnds);
-                }
-                catch (JvmException)
-                {
-                    char* errClsNameChars = NULL;
-                    char* errMsgChars = NULL;
-
-                    // Read error info if possible.
-                    javaMembers.WriteErrorInfo(env, &errClsNameChars, &errClsNameLen, &errMsgChars, &errMsgLen);
-
-                    if (errClsNameChars) {
-                        errClsName = errClsNameChars;
-
-                        delete[] errClsNameChars;
-                    }
-
-                    if (errMsgChars)
-                    {
-                        errMsg = errMsgChars;
-
-                        delete[] errMsgChars;
-                    }
-
-                    // Destroy mmebers.
-                    if (env) {
-                        members.Destroy(env);
-                        javaMembers.Destroy(env);
-                    }
-
-                    // Destroy faulty JVM.
-                    if (jvm)
-                        jvm->DestroyJavaVM();
-                }
-
-                // It safe to release the lock at this point.
-                JVM_LOCK.Leave();
-
-                // Notify err callback if needed.
-                if (!ctx) {
-                    if (errInfo) {
-                        JniErrorInfo errInfo0(IGNITE_JNI_ERR_JVM_INIT, errClsName.c_str(), errMsg.c_str());
-
-                        *errInfo = errInfo0;
-                    }
-
-                    if (hnds.error)
-                        hnds.error(hnds.target, IGNITE_JNI_ERR_JVM_INIT, errClsName.c_str(), errClsNameLen,
-                            errMsg.c_str(), errMsgLen, NULL, 0);
-                }
-
-                return ctx;
-            }
-
-            int JniContext::Reallocate(long long memPtr, int cap) {
-                JavaVM* jvm = JVM.GetJvm();
-
-                JNIEnv* env;
-
-                int attachRes = jvm->AttachCurrentThread(reinterpret_cast<void**>(&env), NULL);
-
-                if (attachRes == JNI_OK)
-                    AttachHelper::OnThreadAttach();
-                else
-                    return -1;
-
-                env->CallStaticVoidMethod(JVM.GetMembers().c_PlatformUtils, JVM.GetMembers().m_PlatformUtils_reallocate, memPtr, cap);
-
-                if (env->ExceptionCheck()) {
-                    env->ExceptionClear();
-
-                    return -1;
-                }
-
-                return 0;
-            }
-
-            void JniContext::Detach() {
-                gcc::Memory::Fence();
-
-                if (JVM.GetJvm()) {
-                    JNIEnv* env;
-
-                    JVM.GetJvm()->GetEnv(reinterpret_cast<void**>(&env), JNI_VERSION_1_6);
-
-                    if (env)
-                        JVM.GetJvm()->DetachCurrentThread();
-                }
-            }
-
-            jobject JniContext::IgnitionStart(char* cfgPath, char* name, int factoryId, long long dataPtr) {
-                return IgnitionStart(cfgPath, name, factoryId, dataPtr, NULL);
-            }
-            
-            jobject JniContext::IgnitionStart(char* cfgPath, char* name, int factoryId, long long dataPtr, JniErrorInfo* errInfo)
-            {
-                JNIEnv* env = Attach();
-
-                jstring cfgPath0 = env->NewStringUTF(cfgPath);
-                jstring name0 = env->NewStringUTF(name);
-
-                jobject interop = env->CallStaticObjectMethod(
-                    jvm->GetMembers().c_PlatformIgnition,
-                    jvm->GetMembers().m_PlatformIgnition_start,
-                    cfgPath0,
-                    name0,
-                    factoryId,
-                    reinterpret_cast<long long>(&hnds),
-                    dataPtr
-                );
-
-                ExceptionCheck(env, errInfo);
-
-                return LocalToGlobal(env, interop);
-            }
-
-
-            jobject JniContext::IgnitionInstance(char* name)
-            {
-                return IgnitionInstance(name, NULL);
-            }
-
-            jobject JniContext::IgnitionInstance(char* name, JniErrorInfo* errInfo)
-            {
-                JNIEnv* env = Attach();
-
-                jstring name0 = env->NewStringUTF(name);
-
-                jobject interop = env->CallStaticObjectMethod(jvm->GetMembers().c_PlatformIgnition,
-                    jvm->GetMembers().m_PlatformIgnition_instance, name0);
-
-                ExceptionCheck(env, errInfo);
-
-                return LocalToGlobal(env, interop);
-            }
-
-            long long JniContext::IgnitionEnvironmentPointer(char* name)
-            {
-                return IgnitionEnvironmentPointer(name, NULL);
-            }
-
-            long long JniContext::IgnitionEnvironmentPointer(char* name, JniErrorInfo* errInfo)
-            {
-                JNIEnv* env = Attach();
-
-                jstring name0 = env->NewStringUTF(name);
-
-                long long res = env->CallStaticLongMethod(jvm->GetMembers().c_PlatformIgnition,
-                    jvm->GetMembers().m_PlatformIgnition_environmentPointer, name0);
-
-                ExceptionCheck(env, errInfo);
-
-                return res;
-            }
-
-            bool JniContext::IgnitionStop(char* name, bool cancel)
-            {
-                return IgnitionStop(name, cancel, NULL);
-            }
-
-            bool JniContext::IgnitionStop(char* name, bool cancel, JniErrorInfo* errInfo)
-            {
-                JNIEnv* env = Attach();
-
-                jstring name0 = env->NewStringUTF(name);
-
-                jboolean res = env->CallStaticBooleanMethod(jvm->GetMembers().c_PlatformIgnition,
-                    jvm->GetMembers().m_PlatformIgnition_stop, name0, cancel);
-
-                ExceptionCheck(env, errInfo);
-
-                return res != 0;
-            }
-
-            void JniContext::IgnitionStopAll(bool cancel)
-            {
-                return IgnitionStopAll(cancel, NULL);
-            }
-
-            void JniContext::IgnitionStopAll(bool cancel, JniErrorInfo* errInfo)
-            {
-                JNIEnv* env = Attach();
-
-                env->CallStaticVoidMethod(jvm->GetMembers().c_PlatformIgnition,
-                    jvm->GetMembers().m_PlatformIgnition_stopAll, cancel);
-
-                ExceptionCheck(env, errInfo);
-            }
-
-            void JniContext::ProcessorReleaseStart(jobject obj) {
-                JNIEnv* env = Attach();
-
-                env->CallVoidMethod(obj, jvm->GetMembers().m_PlatformProcessor_releaseStart);
-
-                ExceptionCheck(env);
-            }
-
-            jobject JniContext::ProcessorProjection(jobject obj) {
-                JNIEnv* env = Attach();
-
-                jobject prj = env->CallObjectMethod(obj, jvm->GetMembers().m_PlatformProcessor_projection);
-
-                ExceptionCheck(env);
-
-                return LocalToGlobal(env, prj);
-            }
-
-            jobject JniContext::ProcessorCache0(jobject obj, const char* name, jmethodID mthd, JniErrorInfo* errInfo)
-            {
-                JNIEnv* env = Attach();
-
-                jstring name0 = name != NULL ? env->NewStringUTF(name) : NULL;
-
-                jobject cache = env->CallObjectMethod(obj, mthd, name0);
-
-                if (name0)
-                    env->DeleteLocalRef(name0);
-
-                ExceptionCheck(env, errInfo);
-
-                return LocalToGlobal(env, cache);
-            }
-
-            jobject JniContext::ProcessorCache(jobject obj, const char* name) {
-                return ProcessorCache(obj, name, NULL);
-            }
-
-            jobject JniContext::ProcessorCache(jobject obj, const char* name, JniErrorInfo* errInfo) {
-                return ProcessorCache0(obj, name, jvm->GetMembers().m_PlatformProcessor_cache, errInfo);
-            }
-
-            jobject JniContext::ProcessorCreateCache(jobject obj, const char* name) {
-                return ProcessorCreateCache(obj, name, NULL);
-            }
-
-            jobject JniContext::ProcessorCreateCache(jobject obj, const char* name, JniErrorInfo* errInfo)
-            {
-                return ProcessorCache0(obj, name, jvm->GetMembers().m_PlatformProcessor_createCache, errInfo);
-            }
-
-            jobject JniContext::ProcessorGetOrCreateCache(jobject obj, const char* name) {
-                return ProcessorGetOrCreateCache(obj, name, NULL);
-            }
-
-            jobject JniContext::ProcessorGetOrCreateCache(jobject obj, const char* name, JniErrorInfo* errInfo)
-            {
-                return ProcessorCache0(obj, name, jvm->GetMembers().m_PlatformProcessor_getOrCreateCache, errInfo);
-            }
-
-            jobject JniContext::ProcessorAffinity(jobject obj, const char* name) {
-                JNIEnv* env = Attach();
-
-                jstring name0 = name != NULL ? env->NewStringUTF(name) : NULL;
-
-                jobject aff = env->CallObjectMethod(obj, jvm->GetMembers().m_PlatformProcessor_affinity, name0);
-
-                if (name0)
-                    env->DeleteLocalRef(name0);
-
-                ExceptionCheck(env);
-
-                return LocalToGlobal(env, aff);
-            }
-
-            jobject JniContext::ProcessorDataStreamer(jobject obj, const char* name, bool keepPortable) {
-                JNIEnv* env = Attach();
-
-                jstring name0 = name != NULL ? env->NewStringUTF(name) : NULL;
-
-                jobject ldr = env->CallObjectMethod(obj, jvm->GetMembers().m_PlatformProcessor_dataStreamer, name0,
-                    keepPortable);
-
-                if (name0)
-                    env->DeleteLocalRef(name0);
-
-                ExceptionCheck(env);
-
-                return LocalToGlobal(env, ldr);
-            }
-
-            jobject JniContext::ProcessorTransactions(jobject obj) {
-                JNIEnv* env = Attach();
-
-                jobject tx = env->CallObjectMethod(obj, jvm->GetMembers().m_PlatformProcessor_transactions);
-
-                ExceptionCheck(env);
-
-                return LocalToGlobal(env, tx);
-            }
-            
-            jobject JniContext::ProcessorCompute(jobject obj, jobject prj) {
-                JNIEnv* env = Attach();
-
-                jobject res = env->CallObjectMethod(obj, jvm->GetMembers().m_PlatformProcessor_compute, prj);
-
-                ExceptionCheck(env);
-
-                return LocalToGlobal(env, res);
-            }
-
-            jobject JniContext::ProcessorMessage(jobject obj, jobject prj) {
-                JNIEnv* env = Attach();
-
-                jobject res = env->CallObjectMethod(obj, jvm->GetMembers().m_PlatformProcessor_message, prj);
-
-                ExceptionCheck(env);
-
-                return LocalToGlobal(env, res);
-            }
-
-            jobject JniContext::ProcessorEvents(jobject obj, jobject prj) {
-                JNIEnv* env = Attach();
-
-                jobject res = env->CallObjectMethod(obj, jvm->GetMembers().m_PlatformProcessor_events, prj);
-
-                ExceptionCheck(env);
-
-                return LocalToGlobal(env, res);
-            }
-
-            jobject JniContext::ProcessorServices(jobject obj, jobject prj) {
-                JNIEnv* env = Attach();
-
-                jobject res = env->CallObjectMethod(obj, jvm->GetMembers().m_PlatformProcessor_services, prj);
-
-                ExceptionCheck(env);
-
-                return LocalToGlobal(env, res);
-            }
-            
-            jobject JniContext::ProcessorExtensions(jobject obj)
-            {
-                JNIEnv* env = Attach();
-
-                jobject res = env->CallObjectMethod(obj, jvm->GetMembers().m_PlatformProcessor_extensions);
-
-                ExceptionCheck(env);
-
-                return LocalToGlobal(env, res);
-            }
-
-            long long JniContext::TargetInStreamOutLong(jobject obj, int opType, long long memPtr, JniErrorInfo* err) {
-                JNIEnv* env = Attach();
-
-                long long res = env->CallLongMethod(obj, jvm->GetMembers().m_PlatformTarget_inStreamOutLong, opType, memPtr);
-
-                ExceptionCheck(env, err);
-
-                return res;
-            }
-
-            void JniContext::TargetInStreamOutStream(jobject obj, int opType, long long inMemPtr, long long outMemPtr, JniErrorInfo* err) {
-                JNIEnv* env = Attach();
-
-                env->CallVoidMethod(obj, jvm->GetMembers().m_PlatformTarget_inStreamOutStream, opType, inMemPtr, outMemPtr);
-
-                ExceptionCheck(env, err);
-            }
-
-           jobject JniContext::TargetInStreamOutObject(jobject obj, int opType, long long memPtr, JniErrorInfo* err) {
-                JNIEnv* env = Attach();
-
-                jobject res = env->CallObjectMethod(obj, jvm->GetMembers().m_PlatformTarget_inStreamOutObject, opType, memPtr);
-
-                ExceptionCheck(env, err);
-
-                return LocalToGlobal(env, res);
-            }
-
-            void JniContext::TargetInObjectStreamOutStream(jobject obj, int opType, void* arg, long long inMemPtr, long long outMemPtr, JniErrorInfo* err) {
-                JNIEnv* env = Attach();
-
-                env->CallVoidMethod(obj, jvm->GetMembers().m_PlatformTarget_inObjectStreamOutStream, opType, arg, inMemPtr, outMemPtr);
-
-                ExceptionCheck(env, err);
-            }
-
-            long long JniContext::TargetOutLong(jobject obj, int opType, JniErrorInfo* err)
-            {
-                JNIEnv* env = Attach();
-
-                jlong res = env->CallLongMethod(obj, jvm->GetMembers().m_PlatformTarget_outLong, opType);
-
-                ExceptionCheck(env, err);
-
-                return res;
-            }
-
-            void JniContext::TargetOutStream(jobject obj, int opType, long long memPtr, JniErrorInfo* err) {
-                JNIEnv* env = Attach();
-
-                env->CallVoidMethod(obj, jvm->GetMembers().m_PlatformTarget_outStream, opType, memPtr);
-
-                ExceptionCheck(env, err);
-            }
-
-            jobject JniContext::TargetOutObject(jobject obj, int opType, JniErrorInfo* err)
-            {
-                JNIEnv* env = Attach();
-
-                jobject res = env->CallObjectMethod(obj, jvm->GetMembers().m_PlatformTarget_outObject, opType);
-
-                ExceptionCheck(env, err);
-
-                return LocalToGlobal(env, res);
-            }
-
-            void JniContext::TargetListenFuture(jobject obj, long long futId, int typ) {
-                JNIEnv* env = Attach();
-
-                env->CallVoidMethod(obj, jvm->GetMembers().m_PlatformTarget_listenFuture, futId, typ);
-
-                ExceptionCheck(env);
-            }
-
-            void JniContext::TargetListenFutureForOperation(jobject obj, long long futId, int typ, int opId) {
-                JNIEnv* env = Attach();
-
-                env->CallVoidMethod(obj, jvm->GetMembers().m_PlatformTarget_listenFutureForOperation, futId, typ, opId);
-
-                ExceptionCheck(env);
-            }
-
-            int JniContext::AffinityPartitions(jobject obj) {
-                JNIEnv* env = Attach();
-
-                jint parts = env->CallIntMethod(obj, jvm->GetMembers().m_PlatformAffinity_partitions);
-
-                ExceptionCheck(env);
-
-                return parts;
-            }
-
-            jobject JniContext::CacheWithSkipStore(jobject obj) {
-                JNIEnv* env = Attach();
-
-                jobject cache = env->CallObjectMethod(obj, jvm->GetMembers().m_PlatformCache_withSkipStore);
-
-                ExceptionCheck(env);
-
-                return LocalToGlobal(env, cache);
-            }
-
-            jobject JniContext::CacheWithNoRetries(jobject obj) {
-                JNIEnv* env = Attach();
-
-                jobject cache = env->CallObjectMethod(obj, jvm->GetMembers().m_PlatformCache_withNoRetries);
-
-                ExceptionCheck(env);
-
-                return LocalToGlobal(env, cache);
-            }
-
-            jobject JniContext::CacheWithExpiryPolicy(jobject obj, long long create, long long update, long long access) {
-                JNIEnv* env = Attach();
-
-                jobject cache = env->CallObjectMethod(obj, jvm->GetMembers().m_PlatformCache_withExpiryPolicy,
-                    create, update, access);
-
-                ExceptionCheck(env);
-
-                return LocalToGlobal(env, cache);
-            }
-
-            jobject JniContext::CacheWithAsync(jobject obj) {
-                JNIEnv* env = Attach();
-
-                jobject cache = env->CallObjectMethod(obj, jvm->GetMembers().m_PlatformCache_withAsync);
-
-                ExceptionCheck(env);
-
-                return LocalToGlobal(env, cache);
-            }
-
-            jobject JniContext::CacheWithKeepPortable(jobject obj) {
-                JNIEnv* env = Attach();
-
-                jobject cache = env->CallObjectMethod(obj, jvm->GetMembers().m_PlatformCache_withKeepPortable);
-
-                ExceptionCheck(env);
-
-                return LocalToGlobal(env, cache);
-            }
-
-            void JniContext::CacheClear(jobject obj, JniErrorInfo* err) {
-                JNIEnv* env = Attach();
-
-                env->CallVoidMethod(obj, jvm->GetMembers().m_PlatformCache_clear);
-
-                ExceptionCheck(env, err);
-            }
-
-            void JniContext::CacheRemoveAll(jobject obj, JniErrorInfo* err) {
-                JNIEnv* env = Attach();
-
-                env->CallVoidMethod(obj, jvm->GetMembers().m_PlatformCache_removeAll);
-
-                ExceptionCheck(env, err);
-            }
-
-            jobject JniContext::CacheOutOpQueryCursor(jobject obj, int type, long long memPtr, JniErrorInfo* err) {
-                JNIEnv* env = Attach();
-
-                jobject res = env->CallObjectMethod(
-                    obj, jvm->GetMembers().m_PlatformTarget_inStreamOutObject, type, memPtr);
-
-                ExceptionCheck(env, err);
-
-                return LocalToGlobal(env, res);
-            }
-
-            jobject JniContext::CacheOutOpContinuousQuery(jobject obj, int type, long long memPtr) {
-                JNIEnv* env = Attach();
-
-                jobject res = env->CallObjectMethod(
-                    obj, jvm->GetMembers().m_PlatformTarget_inStreamOutObject, type, memPtr);
-
-                ExceptionCheck(env);
-
-                return LocalToGlobal(env, res);
-            }
-
-            jobject JniContext::CacheIterator(jobject obj) {
-                JNIEnv* env = Attach();
-
-                jobject res = env->CallObjectMethod(obj, jvm->GetMembers().m_PlatformCache_iterator);
-
-                ExceptionCheck(env);
-
-                return LocalToGlobal(env, res);
-            }
-
-            jobject JniContext::CacheLocalIterator(jobject obj, int peekModes) {
-                JNIEnv*env = Attach();
-
-                jobject res = env->CallObjectMethod(obj, jvm->GetMembers().m_PlatformCache_localIterator, peekModes);
-
-                ExceptionCheck(env);
-
-                return LocalToGlobal(env, res);
-            }
-
-            void JniContext::CacheEnterLock(jobject obj, long long id) {
-                JNIEnv* env = Attach();
-
-                env->CallVoidMethod(obj, jvm->GetMembers().m_PlatformCache_enterLock, id);
-
-                ExceptionCheck(env);
-            }
-
-            void JniContext::CacheExitLock(jobject obj, long long id) {
-                JNIEnv* env = Attach();
-
-                env->CallVoidMethod(obj, jvm->GetMembers().m_PlatformCache_exitLock, id);
-
-                ExceptionCheck(env);
-            }
-
-            bool JniContext::CacheTryEnterLock(jobject obj, long long id, long long timeout) {
-                JNIEnv* env = Attach();
-
-                jboolean res = env->CallBooleanMethod(obj, jvm->GetMembers().m_PlatformCache_tryEnterLock, id, timeout);
-
-                ExceptionCheck(env);
-
-                return res != 0;
-            }
-
-            void JniContext::CacheCloseLock(jobject obj, long long id) {
-                JNIEnv* env = Attach();
-
-                env->CallVoidMethod(obj, jvm->GetMembers().m_PlatformCache_closeLock, id);
-
-                ExceptionCheck(env);
-            }
-
-            void JniContext::CacheRebalance(jobject obj, long long futId) {
-                JNIEnv* env = Attach();
-
-                env->CallVoidMethod(obj, jvm->GetMembers().m_PlatformCache_rebalance, futId);
-
-                ExceptionCheck(env);
-            }
-
-            int JniContext::CacheSize(jobject obj, int peekModes, bool loc, JniErrorInfo* err) {
-                JNIEnv* env = Attach();
-
-                jint res = env->CallIntMethod(obj, jvm->GetMembers().m_PlatformCache_size, peekModes, loc);
-
-                ExceptionCheck(env, err);
-
-                return res;
-            }
-
-            void JniContext::CacheStoreCallbackInvoke(jobject obj, long long memPtr) {
-                JNIEnv* env = Attach();
-
-                env->CallVoidMethod(obj, jvm->GetMembers().m_PlatformCacheStoreCallback_invoke, memPtr);
-
-                ExceptionCheck(env);
-            }
-
-            void JniContext::ComputeWithNoFailover(jobject obj) {
-                JNIEnv* env = Attach();
-
-                env->CallVoidMethod(obj, jvm->GetMembers().m_PlatformCompute_withNoFailover);
-
-                ExceptionCheck(env);
-            }
-
-            void JniContext::ComputeWithTimeout(jobject obj, long long timeout) {
-                JNIEnv* env = Attach();
-
-                env->CallVoidMethod(obj, jvm->GetMembers().m_PlatformCompute_withTimeout, timeout);
-
-                ExceptionCheck(env);
-            }
-
-            void JniContext::ComputeExecuteNative(jobject obj, long long taskPtr, long long topVer) {
-                JNIEnv* env = Attach();
-
-                env->CallVoidMethod(obj, jvm->GetMembers().m_PlatformCompute_executeNative, taskPtr, topVer);
-
-                ExceptionCheck(env);
-            }
-
-            void JniContext::ContinuousQueryClose(jobject obj) {
-                JNIEnv* env = Attach();
-
-                env->CallVoidMethod(obj, jvm->GetMembers().m_PlatformContinuousQuery_close);
-
-                ExceptionCheck(env);
-            }
-
-            void* JniContext::ContinuousQueryGetInitialQueryCursor(jobject obj) {
-                JNIEnv* env = Attach();
-
-                jobject res = env->CallObjectMethod(obj, jvm->GetMembers().m_PlatformContinuousQuery_getInitialQueryCursor);
-
-                ExceptionCheck(env);
-
-                return res;
-            }
-
-            void JniContext::DataStreamerListenTopology(jobject obj, long long ptr) {
-                JNIEnv* env = Attach();
-
-                env->CallVoidMethod(obj, jvm->GetMembers().m_PlatformDataStreamer_listenTopology, ptr);
-
-                ExceptionCheck(env);
-            }
-
-            bool JniContext::DataStreamerAllowOverwriteGet(jobject obj) {
-                JNIEnv* env = Attach();
-
-                jboolean res = env->CallBooleanMethod(obj, jvm->GetMembers().m_PlatformDataStreamer_getAllowOverwrite);
-
-                ExceptionCheck(env);
-
-                return res != 0;
-            }
-
-            void JniContext::DataStreamerAllowOverwriteSet(jobject obj, bool val) {
-                JNIEnv* env = Attach();
-
-                env->CallVoidMethod(obj, jvm->GetMembers().m_PlatformDataStreamer_setAllowOverwrite, val);
-
-                ExceptionCheck(env);
-            }
-
-            bool JniContext::DataStreamerSkipStoreGet(jobject obj) {
-                JNIEnv* env = Attach();
-
-                jboolean res = env->CallBooleanMethod(obj, jvm->GetMembers().m_PlatformDataStreamer_getSkipStore);
-
-                ExceptionCheck(env);
-
-                return res != 0;
-            }
-
-            void JniContext::DataStreamerSkipStoreSet(jobject obj, bool val) {
-                JNIEnv* env = Attach();
-
-                env->CallVoidMethod(obj, jvm->GetMembers().m_PlatformDataStreamer_setSkipStore, val);
-
-                ExceptionCheck(env);
-            }
-
-            int JniContext::DataStreamerPerNodeBufferSizeGet(jobject obj) {
-                JNIEnv* env = Attach();
-
-                jint res = env->CallIntMethod(obj, jvm->GetMembers().m_PlatformDataStreamer_getPerNodeBufSize);
-
-                ExceptionCheck(env);
-
-                return res;
-            }
-
-            void JniContext::DataStreamerPerNodeBufferSizeSet(jobject obj, int val) {
-                JNIEnv* env = Attach();
-
-                env->CallVoidMethod(obj, jvm->GetMembers().m_PlatformDataStreamer_setPerNodeBufSize, val);
-
-                ExceptionCheck(env);
-            }
-
-            int JniContext::DataStreamerPerNodeParallelOperationsGet(jobject obj) {
-                JNIEnv* env = Attach();
-
-                jint res = env->CallIntMethod(obj, jvm->GetMembers().m_PlatformDataStreamer_getPerNodeParallelOps);
-
-                ExceptionCheck(env);
-
-                return res;
-            }
-
-            void JniContext::DataStreamerPerNodeParallelOperationsSet(jobject obj, int val) {
-                JNIEnv* env = Attach();
-
-                env->CallVoidMethod(obj, jvm->GetMembers().m_PlatformDataStreamer_setPerNodeParallelOps, val);
-
-                ExceptionCheck(env);
-            }
-
-            jobject JniContext::MessagingWithAsync(jobject obj) {
-                JNIEnv* env = Attach();
-
-                jobject msg = env->CallObjectMethod(obj, jvm->GetMembers().m_PlatformMessaging_withAsync);
-
-                ExceptionCheck(env);
-
-                return LocalToGlobal(env, msg);
-            }
-
-            jobject JniContext::ProjectionForOthers(jobject obj, jobject prj) {
-                JNIEnv* env = Attach();
-
-                jobject newPrj = env->CallObjectMethod(obj, jvm->GetMembers().m_PlatformClusterGroup_forOthers, prj);
-
-                ExceptionCheck(env);
-
-                return LocalToGlobal(env, newPrj);
-            }
-
-            jobject JniContext::ProjectionForRemotes(jobject obj) {
-                JNIEnv* env = Attach();
-
-                jobject newPrj = env->CallObjectMethod(obj, jvm->GetMembers().m_PlatformClusterGroup_forRemotes);
-
-                ExceptionCheck(env);
-
-                return LocalToGlobal(env, newPrj);
-            }
-
-            jobject JniContext::ProjectionForDaemons(jobject obj) {
-                JNIEnv* env = Attach();
-
-                jobject newPrj = env->CallObjectMethod(obj, jvm->GetMembers().m_PlatformClusterGroup_forDaemons);
-
-                ExceptionCheck(env);
-
-                return LocalToGlobal(env, newPrj);
-            }
-
-            jobject JniContext::ProjectionForRandom(jobject obj) {
-                JNIEnv* env = Attach();
-
-                jobject newPrj = env->CallObjectMethod(obj, jvm->GetMembers().m_PlatformClusterGroup_forRandom);
-
-                ExceptionCheck(env);
-
-                return LocalToGlobal(env, newPrj);
-            }
-
-            jobject JniContext::ProjectionForOldest(jobject obj) {
-                JNIEnv* env = Attach();
-
-                jobject newPrj = env->CallObjectMethod(obj, jvm->GetMembers().m_PlatformClusterGroup_forOldest);
-
-                ExceptionCheck(env);
-
-                return LocalToGlobal(env, newPrj);
-            }
-
-            jobject JniContext::ProjectionForYoungest(jobject obj) {
-                JNIEnv* env = Attach();
-
-                jobject newPrj = env->CallObjectMethod(obj, jvm->GetMembers().m_PlatformClusterGroup_forYoungest);
-
-                ExceptionCheck(env);
-
-                return LocalToGlobal(env, newPrj);
-            }
-
-            void JniContext::ProjectionResetMetrics(jobject obj) {
-                JNIEnv* env = Attach();
-
-                env->CallVoidMethod(obj, jvm->GetMembers().m_PlatformClusterGroup_resetMetrics);
-
-                ExceptionCheck(env);
-            }
-
-            jobject JniContext::ProjectionOutOpRet(jobject obj, int type, long long memPtr) {
-                JNIEnv* env = Attach();
-
-                jobject res = env->CallObjectMethod(
-                    obj, jvm->GetMembers().m_PlatformTarget_inStreamOutObject, type, memPtr);
-
-                ExceptionCheck(env);
-
-                return LocalToGlobal(env, res);
-            }
-
-
-            void JniContext::QueryCursorIterator(jobject obj, JniErrorInfo* errInfo) {
-                JNIEnv* env = Attach();
-
-                env->CallVoidMethod(obj, jvm->GetMembers().m_PlatformAbstractQryCursor_iter);
-
-                ExceptionCheck(env, errInfo);
-            }
-
-            bool JniContext::QueryCursorIteratorHasNext(jobject obj, JniErrorInfo* errInfo)
-            {
-                JNIEnv* env = Attach();
-
-                jboolean res = env->CallBooleanMethod(obj, jvm->GetMembers().m_PlatformAbstractQryCursor_iterHasNext);
-
-                ExceptionCheck(env, errInfo);
-
-                return res != 0;
-            }
-
-            void JniContext::QueryCursorClose(jobject obj, JniErrorInfo* errInfo) {
-                JNIEnv* env = Attach();
-
-                env->CallVoidMethod(obj, jvm->GetMembers().m_PlatformAbstractQryCursor_close);
-
-                ExceptionCheck(env, errInfo);
-            }
-
-            long long JniContext::TransactionsStart(jobject obj, int concurrency, int isolation, long long timeout, int txSize) {
-                JNIEnv* env = Attach();
-
-                long long id = env->CallLongMethod(obj, jvm->GetMembers().m_PlatformTransactions_txStart, concurrency, isolation, timeout, txSize);
-
-                ExceptionCheck(env);
-
-                return id;
-            }
-
-            int JniContext::TransactionsCommit(jobject obj, long long id) {
-                JNIEnv* env = Attach();
-
-                int res = env->CallIntMethod(obj, jvm->GetMembers().m_PlatformTransactions_txCommit, id);
-
-                ExceptionCheck(env);
-
-                return res;
-            }
-
-            void JniContext::TransactionsCommitAsync(jobject obj, long long id, long long futId) {
-                JNIEnv* env = Attach();
-
-                env->CallVoidMethod(obj, jvm->GetMembers().m_PlatformTransactions_txCommitAsync, id, futId);
-
-                ExceptionCheck(env);
-            }
-
-            int JniContext::TransactionsRollback(jobject obj, long long id) {
-                JNIEnv* env = Attach();
-
-                int res = env->CallIntMethod(obj, jvm->GetMembers().m_PlatformTransactions_txRollback, id);
-
-                ExceptionCheck(env);
-
-                return res;
-            }
-
-            void JniContext::TransactionsRollbackAsync(jobject obj, long long id, long long futId) {
-                JNIEnv* env = Attach();
-
-                env->CallVoidMethod(obj, jvm->GetMembers().m_PlatformTransactions_txRollbackAsync, id, futId);
-
-                ExceptionCheck(env);
-            }
-
-            int JniContext::TransactionsClose(jobject obj, long long id) {
-                JNIEnv* env = Attach();
-
-                jint state = env->CallIntMethod(obj, jvm->GetMembers().m_PlatformTransactions_txClose, id);
-
-                ExceptionCheck(env);
-
-                return state;
-            }
-
-            int JniContext::TransactionsState(jobject obj, long long id) {
-                JNIEnv* env = Attach();
-
-                jint state = env->CallIntMethod(obj, jvm->GetMembers().m_PlatformTransactions_txState, id);
-
-                ExceptionCheck(env);
-
-                return state;
-            }
-
-            bool JniContext::TransactionsSetRollbackOnly(jobject obj, long long id) {
-                JNIEnv* env = Attach();
-
-                jboolean res = env->CallBooleanMethod(obj, jvm->GetMembers().m_PlatformTransactions_txSetRollbackOnly, id);
-
-                ExceptionCheck(env);
-
-                return res != 0;
-            }
-
-            void JniContext::TransactionsResetMetrics(jobject obj) {
-                JNIEnv* env = Attach();
-
-                env->CallVoidMethod(obj, jvm->GetMembers().m_PlatformTransactions_resetMetrics);
-
-                ExceptionCheck(env);
-            }
-
-            jobject JniContext::EventsWithAsync(jobject obj) {
-                JNIEnv * env = Attach();
-
-                jobject res = env->CallObjectMethod(obj, jvm->GetMembers().m_PlatformEvents_withAsync);
-

<TRUNCATED>

[26/28] ignite git commit: IGNITE-1513: Moved CPP.

Posted by vo...@apache.org.
http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/common/src/java.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/common/src/java.cpp b/modules/platform/cpp/common/src/java.cpp
new file mode 100644
index 0000000..d08a90d
--- /dev/null
+++ b/modules/platform/cpp/common/src/java.cpp
@@ -0,0 +1,2205 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <cstring>
+#include <string>
+#include <exception>
+
+#include "ignite/common/concurrent.h"
+#include "ignite/common/java.h"
+
+#define IGNITE_SAFE_PROC_NO_ARG(jniEnv, envPtr, type, field) { \
+    JniHandlers* hnds = reinterpret_cast<JniHandlers*>(envPtr); \
+    type hnd = hnds->field; \
+    if (hnd) \
+        hnd(hnds->target); \
+    else \
+        ThrowOnMissingHandler(jniEnv); \
+}
+
+#define IGNITE_SAFE_PROC(jniEnv, envPtr, type, field, ...) { \
+    JniHandlers* hnds = reinterpret_cast<JniHandlers*>(envPtr); \
+    type hnd = hnds->field; \
+    if (hnd) \
+        hnd(hnds->target, __VA_ARGS__); \
+    else \
+        ThrowOnMissingHandler(jniEnv); \
+}
+
+#define IGNITE_SAFE_FUNC(jniEnv, envPtr, type, field, ...) { \
+    JniHandlers* hnds = reinterpret_cast<JniHandlers*>(envPtr); \
+    type hnd = hnds->field; \
+    if (hnd) \
+        return hnd(hnds->target, __VA_ARGS__); \
+    else \
+    { \
+        ThrowOnMissingHandler(jniEnv); \
+        return 0; \
+    }\
+}
+
+namespace ignite
+{
+    namespace common
+    {
+        namespace java
+        {
+            namespace gcc = ignite::common::concurrent;
+
+            /* --- Startup exception. --- */
+            class JvmException : public std::exception {
+                // No-op.
+            };
+
+            /* --- JNI method definitions. --- */
+            struct JniMethod {
+                char* name;
+                char* sign;
+                bool isStatic;
+
+                JniMethod(const char* name, const char* sign, bool isStatic) {
+                    this->name = const_cast<char*>(name);
+                    this->sign = const_cast<char*>(sign);
+                    this->isStatic = isStatic;
+                }
+            };
+
+            /*
+             * Heloper function to copy characters.
+             *
+             * @param src Source.
+             * @return Result.
+             */
+            char* CopyChars(const char* src)
+            {
+                if (src)
+                {
+                    size_t len = strlen(src);
+                    char* dest = new char[len + 1];
+                    strcpy(dest, src);
+                    *(dest + len) = 0;
+                    return dest;
+                }
+                else
+                    return NULL;
+            }
+
+            JniErrorInfo::JniErrorInfo() : code(IGNITE_JNI_ERR_SUCCESS), errCls(NULL), errMsg(NULL)
+            {
+                // No-op.
+            }
+
+            JniErrorInfo::JniErrorInfo(int code, const char* errCls, const char* errMsg) : code(code)
+            {
+                this->errCls = CopyChars(errCls);
+                this->errMsg = CopyChars(errMsg);
+            }
+
+            JniErrorInfo::JniErrorInfo(const JniErrorInfo& other) : code(other.code)
+            {
+                this->errCls = CopyChars(other.errCls);
+                this->errMsg = CopyChars(other.errMsg);
+            }
+
+            JniErrorInfo& JniErrorInfo::operator=(const JniErrorInfo& other)
+            {
+                if (this != &other)
+                {
+                    // 1. Create new instance, exception could occur at this point.
+                    JniErrorInfo tmp(other);
+
+                    // 2. Swap with temp.
+                    int code0 = code;
+                    char* errCls0 = errCls;
+                    char* errMsg0 = errMsg;
+
+                    code = tmp.code;
+                    errCls = tmp.errCls;
+                    errMsg = tmp.errMsg;
+
+                    tmp.code = code0;
+                    tmp.errCls = errCls0;
+                    tmp.errMsg = errMsg0;
+                }
+
+                return *this;
+            }
+
+            JniErrorInfo::~JniErrorInfo()
+            {
+                if (errCls)
+                    delete[] errCls;
+
+                if (errMsg)
+                    delete[] errMsg;
+            }
+
+            const char* C_THROWABLE = "java/lang/Throwable";
+            JniMethod M_THROWABLE_GET_MESSAGE = JniMethod("getMessage", "()Ljava/lang/String;", false);
+            JniMethod M_THROWABLE_PRINT_STACK_TRACE = JniMethod("printStackTrace", "()V", false);
+
+            const char* C_CLASS = "java/lang/Class";
+            JniMethod M_CLASS_GET_NAME = JniMethod("getName", "()Ljava/lang/String;", false);
+
+            const char* C_IGNITE_EXCEPTION = "org/apache/ignite/IgniteException";
+
+            const char* C_PLATFORM_NO_CALLBACK_EXCEPTION = "org/apache/ignite/internal/processors/platform/PlatformNoCallbackException";
+
+            const char* C_PLATFORM_PROCESSOR = "org/apache/ignite/internal/processors/platform/PlatformProcessor";
+            JniMethod M_PLATFORM_PROCESSOR_RELEASE_START = JniMethod("releaseStart", "()V", false);
+            JniMethod M_PLATFORM_PROCESSOR_PROJECTION = JniMethod("projection", "()Lorg/apache/ignite/internal/processors/platform/PlatformTarget;", false);
+            JniMethod M_PLATFORM_PROCESSOR_CACHE = JniMethod("cache", "(Ljava/lang/String;)Lorg/apache/ignite/internal/processors/platform/PlatformTarget;", false);
+            JniMethod M_PLATFORM_PROCESSOR_CREATE_CACHE = JniMethod("createCache", "(Ljava/lang/String;)Lorg/apache/ignite/internal/processors/platform/PlatformTarget;", false);
+            JniMethod M_PLATFORM_PROCESSOR_GET_OR_CREATE_CACHE = JniMethod("getOrCreateCache", "(Ljava/lang/String;)Lorg/apache/ignite/internal/processors/platform/PlatformTarget;", false);
+            JniMethod M_PLATFORM_PROCESSOR_AFFINITY = JniMethod("affinity", "(Ljava/lang/String;)Lorg/apache/ignite/internal/processors/platform/PlatformTarget;", false);
+            JniMethod M_PLATFORM_PROCESSOR_DATA_STREAMER = JniMethod("dataStreamer", "(Ljava/lang/String;Z)Lorg/apache/ignite/internal/processors/platform/PlatformTarget;", false);
+            JniMethod M_PLATFORM_PROCESSOR_TRANSACTIONS = JniMethod("transactions", "()Lorg/apache/ignite/internal/processors/platform/PlatformTarget;", false);
+            JniMethod M_PLATFORM_PROCESSOR_COMPUTE = JniMethod("compute", "(Lorg/apache/ignite/internal/processors/platform/PlatformTarget;)Lorg/apache/ignite/internal/processors/platform/PlatformTarget;", false);
+            JniMethod M_PLATFORM_PROCESSOR_MESSAGE = JniMethod("message", "(Lorg/apache/ignite/internal/processors/platform/PlatformTarget;)Lorg/apache/ignite/internal/processors/platform/PlatformTarget;", false);
+            JniMethod M_PLATFORM_PROCESSOR_EVENTS = JniMethod("events", "(Lorg/apache/ignite/internal/processors/platform/PlatformTarget;)Lorg/apache/ignite/internal/processors/platform/PlatformTarget;", false);
+            JniMethod M_PLATFORM_PROCESSOR_SERVICES = JniMethod("services", "(Lorg/apache/ignite/internal/processors/platform/PlatformTarget;)Lorg/apache/ignite/internal/processors/platform/PlatformTarget;", false);
+            JniMethod M_PLATFORM_PROCESSOR_EXTENSIONS = JniMethod("extensions", "()Lorg/apache/ignite/internal/processors/platform/PlatformTarget;", false);
+            
+            const char* C_PLATFORM_TARGET = "org/apache/ignite/internal/processors/platform/PlatformTarget";
+            JniMethod M_PLATFORM_TARGET_IN_STREAM_OUT_LONG = JniMethod("inStreamOutLong", "(IJ)J", false);
+            JniMethod M_PLATFORM_TARGET_IN_STREAM_OUT_OBJECT = JniMethod("inStreamOutObject", "(IJ)Ljava/lang/Object;", false);
+            JniMethod M_PLATFORM_TARGET_IN_STREAM_OUT_STREAM = JniMethod("inStreamOutStream", "(IJJ)V", false);
+            JniMethod M_PLATFORM_TARGET_IN_OBJECT_STREAM_OUT_STREAM = JniMethod("inObjectStreamOutStream", "(ILjava/lang/Object;JJ)V", false);
+            JniMethod M_PLATFORM_TARGET_OUT_LONG = JniMethod("outLong", "(I)J", false);
+            JniMethod M_PLATFORM_TARGET_OUT_STREAM = JniMethod("outStream", "(IJ)V", false);
+            JniMethod M_PLATFORM_TARGET_OUT_OBJECT = JniMethod("outObject", "(I)Ljava/lang/Object;", false);
+            JniMethod M_PLATFORM_TARGET_LISTEN_FUTURE = JniMethod("listenFuture", "(JI)V", false);
+            JniMethod M_PLATFORM_TARGET_LISTEN_FOR_OPERATION = JniMethod("listenFutureForOperation", "(JII)V", false);
+
+            const char* C_PLATFORM_CLUSTER_GRP = "org/apache/ignite/internal/processors/platform/cluster/PlatformClusterGroup";
+            JniMethod M_PLATFORM_CLUSTER_GRP_FOR_OTHERS = JniMethod("forOthers", "(Lorg/apache/ignite/internal/processors/platform/cluster/PlatformClusterGroup;)Lorg/apache/ignite/internal/processors/platform/cluster/PlatformClusterGroup;", false);
+            JniMethod M_PLATFORM_CLUSTER_GRP_FOR_REMOTES = JniMethod("forRemotes", "()Lorg/apache/ignite/internal/processors/platform/cluster/PlatformClusterGroup;", false);
+            JniMethod M_PLATFORM_CLUSTER_GRP_FOR_DAEMONS = JniMethod("forDaemons", "()Lorg/apache/ignite/internal/processors/platform/cluster/PlatformClusterGroup;", false);
+            JniMethod M_PLATFORM_CLUSTER_GRP_FOR_RANDOM = JniMethod("forRandom", "()Lorg/apache/ignite/internal/processors/platform/cluster/PlatformClusterGroup;", false);
+            JniMethod M_PLATFORM_CLUSTER_GRP_FOR_OLDEST = JniMethod("forOldest", "()Lorg/apache/ignite/internal/processors/platform/cluster/PlatformClusterGroup;", false);
+            JniMethod M_PLATFORM_CLUSTER_GRP_FOR_YOUNGEST = JniMethod("forYoungest", "()Lorg/apache/ignite/internal/processors/platform/cluster/PlatformClusterGroup;", false);
+            JniMethod M_PLATFORM_CLUSTER_GRP_RESET_METRICS = JniMethod("resetMetrics", "()V", false);
+            
+            const char* C_PLATFORM_MESSAGING = "org/apache/ignite/internal/processors/platform/messaging/PlatformMessaging";
+            JniMethod M_PLATFORM_MESSAGING_WITH_ASYNC = JniMethod("withAsync", "()Lorg/apache/ignite/internal/processors/platform/messaging/PlatformMessaging;", false);
+
+            const char* C_PLATFORM_COMPUTE = "org/apache/ignite/internal/processors/platform/compute/PlatformCompute";
+            JniMethod M_PLATFORM_COMPUTE_WITH_NO_FAILOVER = JniMethod("withNoFailover", "()V", false);
+            JniMethod M_PLATFORM_COMPUTE_WITH_TIMEOUT = JniMethod("withTimeout", "(J)V", false);
+            JniMethod M_PLATFORM_COMPUTE_EXECUTE_NATIVE = JniMethod("executeNative", "(JJ)V", false);
+
+            const char* C_PLATFORM_CACHE = "org/apache/ignite/internal/processors/platform/cache/PlatformCache";
+            JniMethod M_PLATFORM_CACHE_WITH_SKIP_STORE = JniMethod("withSkipStore", "()Lorg/apache/ignite/internal/processors/platform/cache/PlatformCache;", false);
+            JniMethod M_PLATFORM_CACHE_WITH_NO_RETRIES = JniMethod("withNoRetries", "()Lorg/apache/ignite/internal/processors/platform/cache/PlatformCache;", false);
+            JniMethod M_PLATFORM_CACHE_WITH_EXPIRY_PLC = JniMethod("withExpiryPolicy", "(JJJ)Lorg/apache/ignite/internal/processors/platform/cache/PlatformCache;", false);
+            JniMethod M_PLATFORM_CACHE_WITH_ASYNC = JniMethod("withAsync", "()Lorg/apache/ignite/internal/processors/platform/cache/PlatformCache;", false);
+            JniMethod M_PLATFORM_CACHE_WITH_KEEP_PORTABLE = JniMethod("withKeepPortable", "()Lorg/apache/ignite/internal/processors/platform/cache/PlatformCache;", false);
+            JniMethod M_PLATFORM_CACHE_CLEAR = JniMethod("clear", "()V", false);
+            JniMethod M_PLATFORM_CACHE_REMOVE_ALL = JniMethod("removeAll", "()V", false);
+            JniMethod M_PLATFORM_CACHE_ITERATOR = JniMethod("iterator", "()Lorg/apache/ignite/internal/processors/platform/cache/PlatformCacheIterator;", false);
+            JniMethod M_PLATFORM_CACHE_LOCAL_ITERATOR = JniMethod("localIterator", "(I)Lorg/apache/ignite/internal/processors/platform/cache/PlatformCacheIterator;", false);
+            JniMethod M_PLATFORM_CACHE_ENTER_LOCK = JniMethod("enterLock", "(J)V", false);
+            JniMethod M_PLATFORM_CACHE_EXIT_LOCK = JniMethod("exitLock", "(J)V", false);
+            JniMethod M_PLATFORM_CACHE_TRY_ENTER_LOCK = JniMethod("tryEnterLock", "(JJ)Z", false);
+            JniMethod M_PLATFORM_CACHE_CLOSE_LOCK = JniMethod("closeLock", "(J)V", false);
+            JniMethod M_PLATFORM_CACHE_REBALANCE = JniMethod("rebalance", "(J)V", false);
+            JniMethod M_PLATFORM_CACHE_SIZE = JniMethod("size", "(IZ)I", false);
+
+            const char* C_PLATFORM_AFFINITY = "org/apache/ignite/internal/processors/platform/cache/affinity/PlatformAffinity";
+            JniMethod C_PLATFORM_AFFINITY_PARTITIONS = JniMethod("partitions", "()I", false);
+
+            const char* C_PLATFORM_DATA_STREAMER = "org/apache/ignite/internal/processors/platform/datastreamer/PlatformDataStreamer";
+            JniMethod M_PLATFORM_DATA_STREAMER_LISTEN_TOPOLOGY = JniMethod("listenTopology", "(J)V", false);
+            JniMethod M_PLATFORM_DATA_STREAMER_GET_ALLOW_OVERWRITE = JniMethod("allowOverwrite", "()Z", false);
+            JniMethod M_PLATFORM_DATA_STREAMER_SET_ALLOW_OVERWRITE = JniMethod("allowOverwrite", "(Z)V", false);
+            JniMethod M_PLATFORM_DATA_STREAMER_GET_SKIP_STORE = JniMethod("skipStore", "()Z", false);
+            JniMethod M_PLATFORM_DATA_STREAMER_SET_SKIP_STORE = JniMethod("skipStore", "(Z)V", false);
+            JniMethod M_PLATFORM_DATA_STREAMER_GET_PER_NODE_BUFFER_SIZE = JniMethod("perNodeBufferSize", "()I", false);
+            JniMethod M_PLATFORM_DATA_STREAMER_SET_PER_NODE_BUFFER_SIZE = JniMethod("perNodeBufferSize", "(I)V", false);
+            JniMethod M_PLATFORM_DATA_STREAMER_GET_PER_NODE_PARALLEL_OPS = JniMethod("perNodeParallelOperations", "()I", false);
+            JniMethod M_PLATFORM_DATA_STREAMER_SET_PER_NODE_PARALLEL_OPS = JniMethod("perNodeParallelOperations", "(I)V", false);
+
+            const char* C_PLATFORM_TRANSACTIONS = "org/apache/ignite/internal/processors/platform/transactions/PlatformTransactions";
+            JniMethod M_PLATFORM_TRANSACTIONS_TX_START = JniMethod("txStart", "(IIJI)J", false);
+            JniMethod M_PLATFORM_TRANSACTIONS_TX_COMMIT = JniMethod("txCommit", "(J)I", false);
+            JniMethod M_PLATFORM_TRANSACTIONS_TX_ROLLBACK = JniMethod("txRollback", "(J)I", false);
+            JniMethod M_PLATFORM_TRANSACTIONS_TX_COMMIT_ASYNC = JniMethod("txCommitAsync", "(JJ)V", false);
+            JniMethod M_PLATFORM_TRANSACTIONS_TX_ROLLBACK_ASYNC = JniMethod("txRollbackAsync", "(JJ)V", false);
+            JniMethod M_PLATFORM_TRANSACTIONS_TX_STATE = JniMethod("txState", "(J)I", false);
+            JniMethod M_PLATFORM_TRANSACTIONS_TX_SET_ROLLBACK_ONLY = JniMethod("txSetRollbackOnly", "(J)Z", false);
+            JniMethod M_PLATFORM_TRANSACTIONS_TX_CLOSE = JniMethod("txClose", "(J)I", false);
+            JniMethod M_PLATFORM_TRANSACTIONS_RESET_METRICS = JniMethod("resetMetrics", "()V", false);
+
+            const char* C_PLATFORM_CACHE_STORE_CALLBACK = "org/apache/ignite/internal/processors/platform/cache/store/PlatformCacheStoreCallback";
+            JniMethod M_PLATFORM_CACHE_STORE_CALLBACK_INVOKE = JniMethod("invoke", "(J)V", false);
+
+            const char* C_PLATFORM_CALLBACK_UTILS = "org/apache/ignite/internal/processors/platform/callback/PlatformCallbackUtils";
+
+            JniMethod M_PLATFORM_CALLBACK_UTILS_CACHE_STORE_CREATE = JniMethod("cacheStoreCreate", "(JJ)J", true);
+            JniMethod M_PLATFORM_CALLBACK_UTILS_CACHE_STORE_INVOKE = JniMethod("cacheStoreInvoke", "(JJJLjava/lang/Object;)I", true);
+            JniMethod M_PLATFORM_CALLBACK_UTILS_CACHE_STORE_DESTROY = JniMethod("cacheStoreDestroy", "(JJ)V", true);
+            JniMethod M_PLATFORM_CALLBACK_UTILS_CACHE_STORE_SESSION_CREATE = JniMethod("cacheStoreSessionCreate", "(JJ)J", true);
+
+            JniMethod M_PLATFORM_CALLBACK_UTILS_CACHE_ENTRY_FILTER_CREATE = JniMethod("cacheEntryFilterCreate", "(JJ)J", true);
+            JniMethod M_PLATFORM_CALLBACK_UTILS_CACHE_ENTRY_FILTER_APPLY = JniMethod("cacheEntryFilterApply", "(JJJ)I", true);
+            JniMethod M_PLATFORM_CALLBACK_UTILS_CACHE_ENTRY_FILTER_DESTROY = JniMethod("cacheEntryFilterDestroy", "(JJ)V", true);
+
+            JniMethod M_PLATFORM_CALLBACK_UTILS_CACHE_INVOKE = JniMethod("cacheInvoke", "(JJJ)V", true);
+
+            JniMethod M_PLATFORM_CALLBACK_UTILS_COMPUTE_TASK_MAP = JniMethod("computeTaskMap", "(JJJJ)V", true);
+            JniMethod M_PLATFORM_CALLBACK_UTILS_COMPUTE_TASK_JOB_RESULT = JniMethod("computeTaskJobResult", "(JJJJ)I", true);
+            JniMethod M_PLATFORM_CALLBACK_UTILS_COMPUTE_TASK_REDUCE = JniMethod("computeTaskReduce", "(JJ)V", true);
+            JniMethod M_PLATFORM_CALLBACK_UTILS_COMPUTE_TASK_COMPLETE = JniMethod("computeTaskComplete", "(JJJ)V", true);
+            JniMethod M_PLATFORM_CALLBACK_UTILS_COMPUTE_JOB_SERIALIZE = JniMethod("computeJobSerialize", "(JJJ)I", true);
+            JniMethod M_PLATFORM_CALLBACK_UTILS_COMPUTE_JOB_CREATE = JniMethod("computeJobCreate", "(JJ)J", true);
+            JniMethod M_PLATFORM_CALLBACK_UTILS_COMPUTE_JOB_EXECUTE = JniMethod("computeJobExecute", "(JJIJ)V", true);
+            JniMethod M_PLATFORM_CALLBACK_UTILS_COMPUTE_JOB_DESTROY = JniMethod("computeJobDestroy", "(JJ)V", true);
+            JniMethod M_PLATFORM_CALLBACK_UTILS_COMPUTE_JOB_CANCEL = JniMethod("computeJobCancel", "(JJ)V", true);
+
+            JniMethod M_PLATFORM_CALLBACK_UTILS_CONTINUOUS_QUERY_LSNR_APPLY = JniMethod("continuousQueryListenerApply", "(JJJ)V", true);
+            JniMethod M_PLATFORM_CALLBACK_UTILS_CONTINUOUS_QUERY_FILTER_CREATE = JniMethod("continuousQueryFilterCreate", "(JJ)J", true);
+            JniMethod M_PLATFORM_CALLBACK_UTILS_CONTINUOUS_QUERY_FILTER_EVAL = JniMethod("continuousQueryFilterApply", "(JJJ)I", true);
+            JniMethod M_PLATFORM_CALLBACK_UTILS_CONTINUOUS_QUERY_FILTER_RELEASE = JniMethod("continuousQueryFilterRelease", "(JJ)V", true);
+
+            JniMethod M_PLATFORM_CALLBACK_UTILS_DATA_STREAMER_TOPOLOGY_UPDATE = JniMethod("dataStreamerTopologyUpdate", "(JJJI)V", true);
+            JniMethod M_PLATFORM_CALLBACK_UTILS_DATA_STREAMER_STREAM_RECEIVER_INVOKE = JniMethod("dataStreamerStreamReceiverInvoke", "(JJLjava/lang/Object;JZ)V", true);
+
+            JniMethod M_PLATFORM_CALLBACK_UTILS_FUTURE_BYTE_RES = JniMethod("futureByteResult", "(JJI)V", true);
+            JniMethod M_PLATFORM_CALLBACK_UTILS_FUTURE_BOOL_RES = JniMethod("futureBoolResult", "(JJI)V", true);
+            JniMethod M_PLATFORM_CALLBACK_UTILS_FUTURE_SHORT_RES = JniMethod("futureShortResult", "(JJI)V", true);
+            JniMethod M_PLATFORM_CALLBACK_UTILS_FUTURE_CHAR_RES = JniMethod("futureCharResult", "(JJI)V", true);
+            JniMethod M_PLATFORM_CALLBACK_UTILS_FUTURE_INT_RES = JniMethod("futureIntResult", "(JJI)V", true);
+            JniMethod M_PLATFORM_CALLBACK_UTILS_FUTURE_FLOAT_RES = JniMethod("futureFloatResult", "(JJF)V", true);
+            JniMethod M_PLATFORM_CALLBACK_UTILS_FUTURE_LONG_RES = JniMethod("futureLongResult", "(JJJ)V", true);
+            JniMethod M_PLATFORM_CALLBACK_UTILS_FUTURE_DOUBLE_RES = JniMethod("futureDoubleResult", "(JJD)V", true);
+            JniMethod M_PLATFORM_CALLBACK_UTILS_FUTURE_OBJ_RES = JniMethod("futureObjectResult", "(JJJ)V", true);
+            JniMethod M_PLATFORM_CALLBACK_UTILS_FUTURE_NULL_RES = JniMethod("futureNullResult", "(JJ)V", true);
+            JniMethod M_PLATFORM_CALLBACK_UTILS_FUTURE_ERR = JniMethod("futureError", "(JJJ)V", true);
+
+            JniMethod M_PLATFORM_CALLBACK_UTILS_LIFECYCLE_EVENT = JniMethod("lifecycleEvent", "(JJI)V", true);
+
+            JniMethod M_PLATFORM_CALLBACK_UTILS_MESSAGING_FILTER_CREATE = JniMethod("messagingFilterCreate", "(JJ)J", true);
+            JniMethod M_PLATFORM_CALLBACK_UTILS_MESSAGING_FILTER_APPLY = JniMethod("messagingFilterApply", "(JJJ)I", true);
+            JniMethod M_PLATFORM_CALLBACK_UTILS_MESSAGING_FILTER_DESTROY = JniMethod("messagingFilterDestroy", "(JJ)V", true);
+            
+            JniMethod M_PLATFORM_CALLBACK_UTILS_EVENT_FILTER_CREATE = JniMethod("eventFilterCreate", "(JJ)J", true);
+            JniMethod M_PLATFORM_CALLBACK_UTILS_EVENT_FILTER_APPLY = JniMethod("eventFilterApply", "(JJJ)I", true);
+            JniMethod M_PLATFORM_CALLBACK_UTILS_EVENT_FILTER_DESTROY = JniMethod("eventFilterDestroy", "(JJ)V", true);
+            
+            JniMethod M_PLATFORM_CALLBACK_UTILS_SERVICE_INIT = JniMethod("serviceInit", "(JJ)J", true);
+            JniMethod M_PLATFORM_CALLBACK_UTILS_SERVICE_EXECUTE = JniMethod("serviceExecute", "(JJJ)V", true);
+            JniMethod M_PLATFORM_CALLBACK_UTILS_SERVICE_CANCEL = JniMethod("serviceCancel", "(JJJ)V", true);
+            JniMethod M_PLATFORM_CALLBACK_UTILS_SERVICE_INVOKE_METHOD = JniMethod("serviceInvokeMethod", "(JJJJ)V", true);
+			
+            JniMethod M_PLATFORM_CALLBACK_UTILS_CLUSTER_NODE_FILTER_APPLY = JniMethod("clusterNodeFilterApply", "(JJ)I", true);
+
+            JniMethod M_PLATFORM_CALLBACK_UTILS_NODE_INFO = JniMethod("nodeInfo", "(JJ)V", true);
+
+            JniMethod M_PLATFORM_CALLBACK_UTILS_MEMORY_REALLOCATE = JniMethod("memoryReallocate", "(JJI)V", true);
+
+            JniMethod M_PLATFORM_CALLBACK_UTILS_ON_START = JniMethod("onStart", "(JLjava/lang/Object;J)V", true);
+            JniMethod M_PLATFORM_CALLBACK_UTILS_ON_STOP = JniMethod("onStop", "(J)V", true);
+
+            JniMethod M_PLATFORM_CALLBACK_UTILS_EXTENSION_CALLBACK_IN_LONG_OUT_LONG = JniMethod("extensionCallbackInLongOutLong", "(JIJ)J", true);
+            JniMethod M_PLATFORM_CALLBACK_UTILS_EXTENSION_CALLBACK_IN_LONG_LONG_OUT_LONG = JniMethod("extensionCallbackInLongLongOutLong", "(JIJJ)J", true);
+            
+            const char* C_PLATFORM_UTILS = "org/apache/ignite/internal/processors/platform/utils/PlatformUtils";
+            JniMethod M_PLATFORM_UTILS_REALLOC = JniMethod("reallocate", "(JI)V", true);
+            JniMethod M_PLATFORM_UTILS_ERR_DATA = JniMethod("errorData", "(Ljava/lang/Throwable;)[B", true);
+
+            const char* C_PLATFORM_IGNITION = "org/apache/ignite/internal/processors/platform/PlatformIgnition";
+            JniMethod M_PLATFORM_IGNITION_START = JniMethod("start", "(Ljava/lang/String;Ljava/lang/String;IJJ)Lorg/apache/ignite/internal/processors/platform/PlatformProcessor;", true);
+            JniMethod M_PLATFORM_IGNITION_INSTANCE = JniMethod("instance", "(Ljava/lang/String;)Lorg/apache/ignite/internal/processors/platform/PlatformProcessor;", true);
+            JniMethod M_PLATFORM_IGNITION_ENVIRONMENT_POINTER = JniMethod("environmentPointer", "(Ljava/lang/String;)J", true);
+            JniMethod M_PLATFORM_IGNITION_STOP = JniMethod("stop", "(Ljava/lang/String;Z)Z", true);
+            JniMethod M_PLATFORM_IGNITION_STOP_ALL = JniMethod("stopAll", "(Z)V", true);
+            
+            const char* C_PLATFORM_ABSTRACT_QRY_CURSOR = "org/apache/ignite/internal/processors/platform/cache/query/PlatformAbstractQueryCursor";
+            JniMethod M_PLATFORM_ABSTRACT_QRY_CURSOR_ITER = JniMethod("iterator", "()V", false);
+            JniMethod M_PLATFORM_ABSTRACT_QRY_CURSOR_ITER_HAS_NEXT = JniMethod("iteratorHasNext", "()Z", false);
+            JniMethod M_PLATFORM_ABSTRACT_QRY_CURSOR_CLOSE = JniMethod("close", "()V", false);
+
+            const char* C_PLATFORM_CONT_QRY = "org/apache/ignite/internal/processors/platform/cache/query/PlatformContinuousQuery";
+            JniMethod M_PLATFORM_CONT_QRY_CLOSE = JniMethod("close", "()V", false);
+            JniMethod M_PLATFORM_CONT_QRY_GET_INITIAL_QUERY_CURSOR = JniMethod("getInitialQueryCursor", "()Lorg/apache/ignite/internal/processors/platform/PlatformTarget;", false);
+
+            const char* C_PLATFORM_EVENTS = "org/apache/ignite/internal/processors/platform/events/PlatformEvents";
+            JniMethod M_PLATFORM_EVENTS_WITH_ASYNC = JniMethod("withAsync", "()Lorg/apache/ignite/internal/processors/platform/events/PlatformEvents;", false);
+            JniMethod M_PLATFORM_EVENTS_STOP_LOCAL_LISTEN = JniMethod("stopLocalListen", "(J)Z", false);
+            JniMethod M_PLATFORM_EVENTS_LOCAL_LISTEN = JniMethod("localListen", "(JI)V", false);
+            JniMethod M_PLATFORM_EVENTS_IS_ENABLED = JniMethod("isEnabled", "(I)Z", false);
+            
+            const char* C_PLATFORM_SERVICES = "org/apache/ignite/internal/processors/platform/services/PlatformServices";
+			JniMethod M_PLATFORM_SERVICES_WITH_ASYNC = JniMethod("withAsync", "()Lorg/apache/ignite/internal/processors/platform/services/PlatformServices;", false);
+			JniMethod M_PLATFORM_SERVICES_WITH_SERVER_KEEP_PORTABLE = JniMethod("withServerKeepPortable", "()Lorg/apache/ignite/internal/processors/platform/services/PlatformServices;", false);
+			JniMethod M_PLATFORM_SERVICES_CANCEL = JniMethod("cancel", "(Ljava/lang/String;)V", false);
+			JniMethod M_PLATFORM_SERVICES_CANCEL_ALL = JniMethod("cancelAll", "()V", false);
+			JniMethod M_PLATFORM_SERVICES_SERVICE_PROXY = JniMethod("dotNetServiceProxy", "(Ljava/lang/String;Z)Ljava/lang/Object;", false);
+
+            /* STATIC STATE. */
+            gcc::CriticalSection JVM_LOCK;
+            JniJvm JVM;
+            bool PRINT_EXCEPTION = false;
+
+            /* HELPER METHODS. */
+
+            /*
+             * Throw exception to Java in case of missing callback pointer. It means that callback is not implemented in
+             * native platform and Java -> platform operation cannot proceede further. As JniContext is not available at
+             * this point, we have to obtain exception details from scratch. This is not critical from performance
+             * perspective because missing handler usually denotes fatal condition.
+             *
+             * @param env JNI environment.
+             */
+            int ThrowOnMissingHandler(JNIEnv* env)
+            {
+                jclass cls = env->FindClass(C_PLATFORM_NO_CALLBACK_EXCEPTION);
+
+                env->ThrowNew(cls, "Callback handler is not set in native platform.");
+
+                return 0;
+            }
+
+            char* StringToChars(JNIEnv* env, jstring str, int* len) {
+                if (!str) {
+                    *len = 0;
+                    return NULL;
+                }
+
+                const char* strChars = env->GetStringUTFChars(str, 0);
+                const int strCharsLen = env->GetStringUTFLength(str);
+
+                char* strChars0 = new char[strCharsLen + 1];
+                std::strcpy(strChars0, strChars);
+                *(strChars0 + strCharsLen) = 0;
+
+                env->ReleaseStringUTFChars(str, strChars);
+
+                if (len)
+                    *len = strCharsLen;
+
+                return strChars0;
+            }
+
+            std::string JavaStringToCString(JNIEnv* env, jstring str, int* len)
+            {
+                char* resChars = StringToChars(env, str, len);
+
+                if (resChars)
+                {
+                    std::string res = std::string(resChars, *len);
+
+                    delete[] resChars;
+                    
+                    return res;
+                }
+                else
+                    return std::string();
+            }
+
+            jclass FindClass(JNIEnv* env, const char *name) {
+                jclass res = env->FindClass(name);
+
+                if (!res)
+                    throw JvmException();
+
+                jclass res0 = static_cast<jclass>(env->NewGlobalRef(res));
+
+                env->DeleteLocalRef(res);
+
+                return res0;
+            }
+
+            void DeleteClass(JNIEnv* env, jclass cls) {
+                if (cls)
+                    env->DeleteGlobalRef(cls);
+            }
+
+            void CheckClass(JNIEnv* env, const char *name)
+            {
+                jclass res = env->FindClass(name);
+
+                if (!res)
+                    throw JvmException();
+            }
+
+            jmethodID FindMethod(JNIEnv* env, jclass cls, JniMethod mthd) {
+                jmethodID mthd0 = mthd.isStatic ?
+                    env->GetStaticMethodID(cls, mthd.name, mthd.sign) : env->GetMethodID(cls, mthd.name, mthd.sign);
+
+                if (!mthd0)
+                    throw JvmException();
+
+                return mthd0;
+            }
+
+            void AddNativeMethod(JNINativeMethod* mthd, JniMethod jniMthd, void* fnPtr) {
+                mthd->name = jniMthd.name;
+                mthd->signature = jniMthd.sign;
+                mthd->fnPtr = fnPtr;
+            }
+
+            void JniJavaMembers::Initialize(JNIEnv* env) {
+                c_Class = FindClass(env, C_CLASS);
+                m_Class_getName = FindMethod(env, c_Class, M_CLASS_GET_NAME);
+
+                c_Throwable = FindClass(env, C_THROWABLE);
+                m_Throwable_getMessage = FindMethod(env, c_Throwable, M_THROWABLE_GET_MESSAGE);
+                m_Throwable_printStackTrace = FindMethod(env, c_Throwable, M_THROWABLE_PRINT_STACK_TRACE);
+            }
+
+            void JniJavaMembers::Destroy(JNIEnv* env) {
+                DeleteClass(env, c_Class);
+                DeleteClass(env, c_Throwable);
+            }
+
+            bool JniJavaMembers::WriteErrorInfo(JNIEnv* env, char** errClsName, int* errClsNameLen, char** errMsg, int* errMsgLen) {
+                if (env && env->ExceptionCheck()) {
+                    if (m_Class_getName && m_Throwable_getMessage) {
+                        jthrowable err = env->ExceptionOccurred();
+
+                        env->ExceptionClear();
+
+                        jclass errCls = env->GetObjectClass(err);
+
+                        jstring clsName = static_cast<jstring>(env->CallObjectMethod(errCls, m_Class_getName));
+                        *errClsName = StringToChars(env, clsName, errClsNameLen);
+
+                        jstring msg = static_cast<jstring>(env->CallObjectMethod(err, m_Throwable_getMessage));
+                        *errMsg = StringToChars(env, msg, errMsgLen);
+
+                        if (errCls)
+                            env->DeleteLocalRef(errCls);
+
+                        if (clsName)
+                            env->DeleteLocalRef(clsName);
+
+                        if (msg)
+                            env->DeleteLocalRef(msg);
+
+                        return true;
+                    }
+                    else {
+                        env->ExceptionClear();
+                    }
+                }
+
+                return false;
+            }
+
+            void JniMembers::Initialize(JNIEnv* env) {
+                c_PlatformAbstractQryCursor = FindClass(env, C_PLATFORM_ABSTRACT_QRY_CURSOR);
+                m_PlatformAbstractQryCursor_iter = FindMethod(env, c_PlatformAbstractQryCursor, M_PLATFORM_ABSTRACT_QRY_CURSOR_ITER);
+                m_PlatformAbstractQryCursor_iterHasNext = FindMethod(env, c_PlatformAbstractQryCursor, M_PLATFORM_ABSTRACT_QRY_CURSOR_ITER_HAS_NEXT);
+                m_PlatformAbstractQryCursor_close = FindMethod(env, c_PlatformAbstractQryCursor, M_PLATFORM_ABSTRACT_QRY_CURSOR_CLOSE);
+
+                c_PlatformAffinity = FindClass(env, C_PLATFORM_AFFINITY);
+                m_PlatformAffinity_partitions = FindMethod(env, c_PlatformAffinity, C_PLATFORM_AFFINITY_PARTITIONS);
+
+                c_PlatformCache = FindClass(env, C_PLATFORM_CACHE);
+                m_PlatformCache_withSkipStore = FindMethod(env, c_PlatformCache, M_PLATFORM_CACHE_WITH_SKIP_STORE);
+                m_PlatformCache_withNoRetries = FindMethod(env, c_PlatformCache, M_PLATFORM_CACHE_WITH_NO_RETRIES);
+                m_PlatformCache_withExpiryPolicy = FindMethod(env, c_PlatformCache, M_PLATFORM_CACHE_WITH_EXPIRY_PLC);
+                m_PlatformCache_withAsync = FindMethod(env, c_PlatformCache, M_PLATFORM_CACHE_WITH_ASYNC);
+                m_PlatformCache_withKeepPortable = FindMethod(env, c_PlatformCache, M_PLATFORM_CACHE_WITH_KEEP_PORTABLE);
+                m_PlatformCache_clear = FindMethod(env, c_PlatformCache, M_PLATFORM_CACHE_CLEAR);
+                m_PlatformCache_removeAll = FindMethod(env, c_PlatformCache, M_PLATFORM_CACHE_REMOVE_ALL);
+                m_PlatformCache_iterator = FindMethod(env, c_PlatformCache, M_PLATFORM_CACHE_ITERATOR);
+                m_PlatformCache_localIterator = FindMethod(env, c_PlatformCache, M_PLATFORM_CACHE_LOCAL_ITERATOR);
+                m_PlatformCache_enterLock = FindMethod(env, c_PlatformCache, M_PLATFORM_CACHE_ENTER_LOCK);
+                m_PlatformCache_exitLock = FindMethod(env, c_PlatformCache, M_PLATFORM_CACHE_EXIT_LOCK);
+                m_PlatformCache_tryEnterLock = FindMethod(env, c_PlatformCache, M_PLATFORM_CACHE_TRY_ENTER_LOCK);
+                m_PlatformCache_closeLock = FindMethod(env, c_PlatformCache, M_PLATFORM_CACHE_CLOSE_LOCK);
+                m_PlatformCache_rebalance = FindMethod(env, c_PlatformCache, M_PLATFORM_CACHE_REBALANCE);
+                m_PlatformCache_size = FindMethod(env, c_PlatformCache, M_PLATFORM_CACHE_SIZE);
+
+                c_PlatformCacheStoreCallback = FindClass(env, C_PLATFORM_CACHE_STORE_CALLBACK);
+                m_PlatformCacheStoreCallback_invoke = FindMethod(env, c_PlatformCacheStoreCallback, M_PLATFORM_CACHE_STORE_CALLBACK_INVOKE);
+
+                c_IgniteException = FindClass(env, C_IGNITE_EXCEPTION);
+
+                c_PlatformClusterGroup = FindClass(env, C_PLATFORM_CLUSTER_GRP);
+                m_PlatformClusterGroup_forOthers = FindMethod(env, c_PlatformClusterGroup, M_PLATFORM_CLUSTER_GRP_FOR_OTHERS);
+                m_PlatformClusterGroup_forRemotes = FindMethod(env, c_PlatformClusterGroup, M_PLATFORM_CLUSTER_GRP_FOR_REMOTES);
+                m_PlatformClusterGroup_forDaemons = FindMethod(env, c_PlatformClusterGroup, M_PLATFORM_CLUSTER_GRP_FOR_DAEMONS);
+                m_PlatformClusterGroup_forRandom = FindMethod(env, c_PlatformClusterGroup, M_PLATFORM_CLUSTER_GRP_FOR_RANDOM);
+                m_PlatformClusterGroup_forOldest = FindMethod(env, c_PlatformClusterGroup, M_PLATFORM_CLUSTER_GRP_FOR_OLDEST);
+                m_PlatformClusterGroup_forYoungest = FindMethod(env, c_PlatformClusterGroup, M_PLATFORM_CLUSTER_GRP_FOR_YOUNGEST);
+                m_PlatformClusterGroup_resetMetrics = FindMethod(env, c_PlatformClusterGroup, M_PLATFORM_CLUSTER_GRP_RESET_METRICS);
+
+                c_PlatformCompute = FindClass(env, C_PLATFORM_COMPUTE);
+                m_PlatformCompute_withNoFailover = FindMethod(env, c_PlatformCompute, M_PLATFORM_COMPUTE_WITH_NO_FAILOVER);
+                m_PlatformCompute_withTimeout = FindMethod(env, c_PlatformCompute, M_PLATFORM_COMPUTE_WITH_TIMEOUT);
+                m_PlatformCompute_executeNative = FindMethod(env, c_PlatformCompute, M_PLATFORM_COMPUTE_EXECUTE_NATIVE);
+
+                c_PlatformContinuousQuery = FindClass(env, C_PLATFORM_CONT_QRY);
+                m_PlatformContinuousQuery_close = FindMethod(env, c_PlatformContinuousQuery, M_PLATFORM_CONT_QRY_CLOSE);
+                m_PlatformContinuousQuery_getInitialQueryCursor = FindMethod(env, c_PlatformContinuousQuery, M_PLATFORM_CONT_QRY_GET_INITIAL_QUERY_CURSOR);
+
+                c_PlatformDataStreamer = FindClass(env, C_PLATFORM_DATA_STREAMER);
+                m_PlatformDataStreamer_listenTopology = FindMethod(env, c_PlatformDataStreamer, M_PLATFORM_DATA_STREAMER_LISTEN_TOPOLOGY);
+                m_PlatformDataStreamer_getAllowOverwrite = FindMethod(env, c_PlatformDataStreamer, M_PLATFORM_DATA_STREAMER_GET_ALLOW_OVERWRITE);
+                m_PlatformDataStreamer_setAllowOverwrite = FindMethod(env, c_PlatformDataStreamer, M_PLATFORM_DATA_STREAMER_SET_ALLOW_OVERWRITE);
+                m_PlatformDataStreamer_getSkipStore = FindMethod(env, c_PlatformDataStreamer, M_PLATFORM_DATA_STREAMER_GET_SKIP_STORE);
+                m_PlatformDataStreamer_setSkipStore = FindMethod(env, c_PlatformDataStreamer, M_PLATFORM_DATA_STREAMER_SET_SKIP_STORE);
+                m_PlatformDataStreamer_getPerNodeBufSize = FindMethod(env, c_PlatformDataStreamer, M_PLATFORM_DATA_STREAMER_GET_PER_NODE_BUFFER_SIZE);
+                m_PlatformDataStreamer_setPerNodeBufSize = FindMethod(env, c_PlatformDataStreamer, M_PLATFORM_DATA_STREAMER_SET_PER_NODE_BUFFER_SIZE);
+                m_PlatformDataStreamer_getPerNodeParallelOps = FindMethod(env, c_PlatformDataStreamer, M_PLATFORM_DATA_STREAMER_GET_PER_NODE_PARALLEL_OPS);
+                m_PlatformDataStreamer_setPerNodeParallelOps = FindMethod(env, c_PlatformDataStreamer, M_PLATFORM_DATA_STREAMER_SET_PER_NODE_PARALLEL_OPS);
+                
+                c_PlatformEvents = FindClass(env, C_PLATFORM_EVENTS);
+                m_PlatformEvents_withAsync = FindMethod(env, c_PlatformEvents, M_PLATFORM_EVENTS_WITH_ASYNC);
+                m_PlatformEvents_stopLocalListen = FindMethod(env, c_PlatformEvents, M_PLATFORM_EVENTS_STOP_LOCAL_LISTEN);
+                m_PlatformEvents_localListen = FindMethod(env, c_PlatformEvents, M_PLATFORM_EVENTS_LOCAL_LISTEN);
+                m_PlatformEvents_isEnabled = FindMethod(env, c_PlatformEvents, M_PLATFORM_EVENTS_IS_ENABLED);
+                
+				c_PlatformServices = FindClass(env, C_PLATFORM_SERVICES);
+				m_PlatformServices_withAsync = FindMethod(env, c_PlatformServices, M_PLATFORM_SERVICES_WITH_ASYNC);
+				m_PlatformServices_withServerKeepPortable = FindMethod(env, c_PlatformServices, M_PLATFORM_SERVICES_WITH_SERVER_KEEP_PORTABLE);
+				m_PlatformServices_cancel = FindMethod(env, c_PlatformServices, M_PLATFORM_SERVICES_CANCEL);
+				m_PlatformServices_cancelAll = FindMethod(env, c_PlatformServices, M_PLATFORM_SERVICES_CANCEL_ALL);
+				m_PlatformServices_serviceProxy = FindMethod(env, c_PlatformServices, M_PLATFORM_SERVICES_SERVICE_PROXY);
+
+                c_PlatformIgnition = FindClass(env, C_PLATFORM_IGNITION);
+                m_PlatformIgnition_start = FindMethod(env, c_PlatformIgnition, M_PLATFORM_IGNITION_START);
+                m_PlatformIgnition_instance = FindMethod(env, c_PlatformIgnition, M_PLATFORM_IGNITION_INSTANCE);
+                m_PlatformIgnition_environmentPointer = FindMethod(env, c_PlatformIgnition, M_PLATFORM_IGNITION_ENVIRONMENT_POINTER);
+                m_PlatformIgnition_stop = FindMethod(env, c_PlatformIgnition, M_PLATFORM_IGNITION_STOP);
+                m_PlatformIgnition_stopAll = FindMethod(env, c_PlatformIgnition, M_PLATFORM_IGNITION_STOP_ALL);
+
+                c_PlatformMessaging = FindClass(env, C_PLATFORM_MESSAGING);
+                m_PlatformMessaging_withAsync = FindMethod(env, c_PlatformMessaging, M_PLATFORM_MESSAGING_WITH_ASYNC);
+
+                c_PlatformProcessor = FindClass(env, C_PLATFORM_PROCESSOR);
+                m_PlatformProcessor_releaseStart = FindMethod(env, c_PlatformProcessor, M_PLATFORM_PROCESSOR_RELEASE_START);
+                m_PlatformProcessor_cache = FindMethod(env, c_PlatformProcessor, M_PLATFORM_PROCESSOR_CACHE);
+                m_PlatformProcessor_createCache = FindMethod(env, c_PlatformProcessor, M_PLATFORM_PROCESSOR_CREATE_CACHE);
+                m_PlatformProcessor_getOrCreateCache = FindMethod(env, c_PlatformProcessor, M_PLATFORM_PROCESSOR_GET_OR_CREATE_CACHE);
+                m_PlatformProcessor_affinity = FindMethod(env, c_PlatformProcessor, M_PLATFORM_PROCESSOR_AFFINITY);
+                m_PlatformProcessor_dataStreamer = FindMethod(env, c_PlatformProcessor, M_PLATFORM_PROCESSOR_DATA_STREAMER);
+                m_PlatformProcessor_transactions = FindMethod(env, c_PlatformProcessor, M_PLATFORM_PROCESSOR_TRANSACTIONS);
+                m_PlatformProcessor_projection = FindMethod(env, c_PlatformProcessor, M_PLATFORM_PROCESSOR_PROJECTION);
+                m_PlatformProcessor_compute = FindMethod(env, c_PlatformProcessor, M_PLATFORM_PROCESSOR_COMPUTE);
+                m_PlatformProcessor_message = FindMethod(env, c_PlatformProcessor, M_PLATFORM_PROCESSOR_MESSAGE);
+                m_PlatformProcessor_events = FindMethod(env, c_PlatformProcessor, M_PLATFORM_PROCESSOR_EVENTS);
+                m_PlatformProcessor_services = FindMethod(env, c_PlatformProcessor, M_PLATFORM_PROCESSOR_SERVICES);
+                m_PlatformProcessor_extensions = FindMethod(env, c_PlatformProcessor, M_PLATFORM_PROCESSOR_EXTENSIONS);
+
+                c_PlatformTarget = FindClass(env, C_PLATFORM_TARGET);
+                m_PlatformTarget_inStreamOutLong = FindMethod(env, c_PlatformTarget, M_PLATFORM_TARGET_IN_STREAM_OUT_LONG);
+                m_PlatformTarget_inStreamOutObject = FindMethod(env, c_PlatformTarget, M_PLATFORM_TARGET_IN_STREAM_OUT_OBJECT);
+                m_PlatformTarget_outLong = FindMethod(env, c_PlatformTarget, M_PLATFORM_TARGET_OUT_LONG);
+                m_PlatformTarget_outStream = FindMethod(env, c_PlatformTarget, M_PLATFORM_TARGET_OUT_STREAM);
+                m_PlatformTarget_outObject = FindMethod(env, c_PlatformTarget, M_PLATFORM_TARGET_OUT_OBJECT);
+                m_PlatformTarget_inStreamOutStream = FindMethod(env, c_PlatformTarget, M_PLATFORM_TARGET_IN_STREAM_OUT_STREAM);
+                m_PlatformTarget_inObjectStreamOutStream = FindMethod(env, c_PlatformTarget, M_PLATFORM_TARGET_IN_OBJECT_STREAM_OUT_STREAM);
+                m_PlatformTarget_listenFuture = FindMethod(env, c_PlatformTarget, M_PLATFORM_TARGET_LISTEN_FUTURE);
+                m_PlatformTarget_listenFutureForOperation = FindMethod(env, c_PlatformTarget, M_PLATFORM_TARGET_LISTEN_FOR_OPERATION);
+
+                c_PlatformTransactions = FindClass(env, C_PLATFORM_TRANSACTIONS);
+                m_PlatformTransactions_txStart = FindMethod(env, c_PlatformTransactions, M_PLATFORM_TRANSACTIONS_TX_START);
+                m_PlatformTransactions_txCommit = FindMethod(env, c_PlatformTransactions, M_PLATFORM_TRANSACTIONS_TX_COMMIT);
+                m_PlatformTransactions_txRollback = FindMethod(env, c_PlatformTransactions, M_PLATFORM_TRANSACTIONS_TX_ROLLBACK);
+                m_PlatformTransactions_txCommitAsync = FindMethod(env, c_PlatformTransactions, M_PLATFORM_TRANSACTIONS_TX_COMMIT_ASYNC);
+                m_PlatformTransactions_txRollbackAsync = FindMethod(env, c_PlatformTransactions, M_PLATFORM_TRANSACTIONS_TX_ROLLBACK_ASYNC);
+                m_PlatformTransactions_txState = FindMethod(env, c_PlatformTransactions, M_PLATFORM_TRANSACTIONS_TX_STATE);
+                m_PlatformTransactions_txSetRollbackOnly = FindMethod(env, c_PlatformTransactions, M_PLATFORM_TRANSACTIONS_TX_SET_ROLLBACK_ONLY);
+                m_PlatformTransactions_txClose = FindMethod(env, c_PlatformTransactions, M_PLATFORM_TRANSACTIONS_TX_CLOSE);
+                m_PlatformTransactions_resetMetrics = FindMethod(env, c_PlatformTransactions, M_PLATFORM_TRANSACTIONS_RESET_METRICS);
+
+                c_PlatformUtils = FindClass(env, C_PLATFORM_UTILS);
+                m_PlatformUtils_reallocate = FindMethod(env, c_PlatformUtils, M_PLATFORM_UTILS_REALLOC);
+                m_PlatformUtils_errData = FindMethod(env, c_PlatformUtils, M_PLATFORM_UTILS_ERR_DATA);
+
+                // Find utility classes which are not used from context, but are still required in other places.
+                CheckClass(env, C_PLATFORM_NO_CALLBACK_EXCEPTION);
+            }
+
+            void JniMembers::Destroy(JNIEnv* env) {
+                DeleteClass(env, c_PlatformAbstractQryCursor);
+                DeleteClass(env, c_PlatformAffinity);
+                DeleteClass(env, c_PlatformCache);
+                DeleteClass(env, c_PlatformCacheStoreCallback);
+                DeleteClass(env, c_IgniteException);
+                DeleteClass(env, c_PlatformClusterGroup);
+                DeleteClass(env, c_PlatformCompute);
+                DeleteClass(env, c_PlatformContinuousQuery);
+                DeleteClass(env, c_PlatformDataStreamer);
+                DeleteClass(env, c_PlatformEvents);
+                DeleteClass(env, c_PlatformIgnition);
+                DeleteClass(env, c_PlatformMessaging);
+                DeleteClass(env, c_PlatformProcessor);
+                DeleteClass(env, c_PlatformTarget);
+                DeleteClass(env, c_PlatformTransactions);
+                DeleteClass(env, c_PlatformUtils);
+            }
+
+            JniJvm::JniJvm() : jvm(NULL), javaMembers(JniJavaMembers()), members(JniMembers())
+            {
+                // No-op.
+            }
+
+            JniJvm::JniJvm(JavaVM* jvm, JniJavaMembers javaMembers, JniMembers members) : 
+                jvm(jvm), javaMembers(javaMembers), members(members)
+            {
+                // No-op.
+            }
+
+            JavaVM* JniJvm::GetJvm()
+            {
+                return jvm;
+            }
+
+            JniJavaMembers& JniJvm::GetJavaMembers()
+            {
+                return javaMembers;
+            }
+
+            JniMembers& JniJvm::GetMembers()
+            {
+                return members;
+            }
+
+            /*
+             * Create JVM.
+             */
+            void CreateJvm(char** opts, int optsLen, JavaVM** jvm, JNIEnv** env) {
+                JavaVMOption* opts0 = new JavaVMOption[optsLen];
+
+                for (int i = 0; i < optsLen; i++)
+                    opts0[i].optionString = *(opts + i);
+
+                JavaVMInitArgs args;
+
+                args.version = JNI_VERSION_1_6;
+                args.nOptions = optsLen;
+                args.options = opts0;
+                args.ignoreUnrecognized = 0;
+
+                jint res = JNI_CreateJavaVM(jvm, reinterpret_cast<void**>(env), &args);
+
+                delete[] opts0;
+
+                if (res != JNI_OK)
+                    throw JvmException();
+            }
+
+            void RegisterNatives(JNIEnv* env) {
+                {
+					JNINativeMethod methods[52];
+
+                    int idx = 0;
+
+                    AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_CACHE_STORE_CREATE, reinterpret_cast<void*>(JniCacheStoreCreate));
+                    AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_CACHE_STORE_INVOKE, reinterpret_cast<void*>(JniCacheStoreInvoke));
+                    AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_CACHE_STORE_DESTROY, reinterpret_cast<void*>(JniCacheStoreDestroy));
+
+                    AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_CACHE_STORE_SESSION_CREATE, reinterpret_cast<void*>(JniCacheStoreSessionCreate));
+
+                    AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_CACHE_ENTRY_FILTER_CREATE, reinterpret_cast<void*>(JniCacheEntryFilterCreate));
+                    AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_CACHE_ENTRY_FILTER_APPLY, reinterpret_cast<void*>(JniCacheEntryFilterApply));
+                    AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_CACHE_ENTRY_FILTER_DESTROY, reinterpret_cast<void*>(JniCacheEntryFilterDestroy));
+
+                    AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_CACHE_INVOKE, reinterpret_cast<void*>(JniCacheInvoke));
+
+                    AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_COMPUTE_TASK_MAP, reinterpret_cast<void*>(JniComputeTaskMap));
+                    AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_COMPUTE_TASK_JOB_RESULT, reinterpret_cast<void*>(JniComputeTaskJobResult));
+                    AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_COMPUTE_TASK_REDUCE, reinterpret_cast<void*>(JniComputeTaskReduce));
+                    AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_COMPUTE_TASK_COMPLETE, reinterpret_cast<void*>(JniComputeTaskComplete));
+
+                    AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_COMPUTE_JOB_SERIALIZE, reinterpret_cast<void*>(JniComputeJobSerialize));
+                    AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_COMPUTE_JOB_CREATE, reinterpret_cast<void*>(JniComputeJobCreate));
+                    AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_COMPUTE_JOB_EXECUTE, reinterpret_cast<void*>(JniComputeJobExecute));
+                    AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_COMPUTE_JOB_DESTROY, reinterpret_cast<void*>(JniComputeJobDestroy));
+                    AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_COMPUTE_JOB_CANCEL, reinterpret_cast<void*>(JniComputeJobCancel));
+
+                    AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_CONTINUOUS_QUERY_LSNR_APPLY, reinterpret_cast<void*>(JniContinuousQueryListenerApply));
+                    AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_CONTINUOUS_QUERY_FILTER_CREATE, reinterpret_cast<void*>(JniContinuousQueryFilterCreate));
+                    AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_CONTINUOUS_QUERY_FILTER_EVAL, reinterpret_cast<void*>(JniContinuousQueryFilterApply));
+                    AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_CONTINUOUS_QUERY_FILTER_RELEASE, reinterpret_cast<void*>(JniContinuousQueryFilterRelease));
+
+                    AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_DATA_STREAMER_TOPOLOGY_UPDATE, reinterpret_cast<void*>(JniDataStreamerTopologyUpdate));
+                    AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_DATA_STREAMER_STREAM_RECEIVER_INVOKE, reinterpret_cast<void*>(JniDataStreamerStreamReceiverInvoke));
+
+                    AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_FUTURE_BYTE_RES, reinterpret_cast<void*>(JniFutureByteResult));
+                    AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_FUTURE_BOOL_RES, reinterpret_cast<void*>(JniFutureBoolResult));
+                    AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_FUTURE_SHORT_RES, reinterpret_cast<void*>(JniFutureShortResult));
+                    AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_FUTURE_CHAR_RES, reinterpret_cast<void*>(JniFutureCharResult));
+                    AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_FUTURE_INT_RES, reinterpret_cast<void*>(JniFutureIntResult));
+                    AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_FUTURE_FLOAT_RES, reinterpret_cast<void*>(JniFutureFloatResult));
+                    AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_FUTURE_LONG_RES, reinterpret_cast<void*>(JniFutureLongResult));
+                    AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_FUTURE_DOUBLE_RES, reinterpret_cast<void*>(JniFutureDoubleResult));
+                    AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_FUTURE_OBJ_RES, reinterpret_cast<void*>(JniFutureObjectResult));
+                    AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_FUTURE_NULL_RES, reinterpret_cast<void*>(JniFutureNullResult));
+                    AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_FUTURE_ERR, reinterpret_cast<void*>(JniFutureError));
+
+                    AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_LIFECYCLE_EVENT, reinterpret_cast<void*>(JniLifecycleEvent));
+
+                    AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_MESSAGING_FILTER_CREATE, reinterpret_cast<void*>(JniMessagingFilterCreate));
+                    AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_MESSAGING_FILTER_APPLY, reinterpret_cast<void*>(JniMessagingFilterApply));
+                    AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_MESSAGING_FILTER_DESTROY, reinterpret_cast<void*>(JniMessagingFilterDestroy));
+                    
+                    AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_EVENT_FILTER_CREATE, reinterpret_cast<void*>(JniEventFilterCreate));
+                    AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_EVENT_FILTER_APPLY, reinterpret_cast<void*>(JniEventFilterApply));
+                    AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_EVENT_FILTER_DESTROY, reinterpret_cast<void*>(JniEventFilterDestroy));
+                    
+                    AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_SERVICE_INIT, reinterpret_cast<void*>(JniServiceInit));
+                    AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_SERVICE_EXECUTE, reinterpret_cast<void*>(JniServiceExecute));
+                    AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_SERVICE_CANCEL, reinterpret_cast<void*>(JniServiceCancel));
+                    AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_SERVICE_INVOKE_METHOD, reinterpret_cast<void*>(JniServiceInvokeMethod));
+					
+                    AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_CLUSTER_NODE_FILTER_APPLY, reinterpret_cast<void*>(JniClusterNodeFilterApply));
+
+                    AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_NODE_INFO, reinterpret_cast<void*>(JniNodeInfo));
+
+                    AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_MEMORY_REALLOCATE, reinterpret_cast<void*>(JniMemoryReallocate));
+
+                    AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_ON_START, reinterpret_cast<void*>(JniOnStart));
+                    AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_ON_STOP, reinterpret_cast<void*>(JniOnStop));
+
+                    AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_EXTENSION_CALLBACK_IN_LONG_OUT_LONG, reinterpret_cast<void*>(JniExtensionCallbackInLongOutLong));
+                    AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_EXTENSION_CALLBACK_IN_LONG_LONG_OUT_LONG, reinterpret_cast<void*>(JniExtensionCallbackInLongLongOutLong));
+
+                    jint res = env->RegisterNatives(FindClass(env, C_PLATFORM_CALLBACK_UTILS), methods, idx);
+
+                    if (res != JNI_OK)
+                        throw JvmException();
+                }  
+            }
+
+            JniContext::JniContext(JniJvm* jvm, JniHandlers hnds) : jvm(jvm), hnds(hnds) {
+                // No-op.
+            }
+
+            JniContext* JniContext::Create(char** opts, int optsLen, JniHandlers hnds) {
+                return Create(opts, optsLen, hnds, NULL);
+            }
+
+            JniContext* JniContext::Create(char** opts, int optsLen, JniHandlers hnds, JniErrorInfo* errInfo)
+            {
+                // Acquire global lock to instantiate the JVM.
+                JVM_LOCK.Enter();
+
+                // Define local variables.
+                JavaVM* jvm = NULL;
+                JNIEnv* env = NULL;
+
+                JniJavaMembers javaMembers;
+                memset(&javaMembers, 0, sizeof(javaMembers));
+
+                JniMembers members;
+                memset(&members, 0, sizeof(members));
+
+                JniContext* ctx = NULL;
+
+                std::string errClsName;
+                int errClsNameLen = 0;
+                std::string errMsg;
+                int errMsgLen = 0;
+
+                try {
+                    if (!JVM.GetJvm()) {
+                        // 1. Create JVM itself.    
+                        CreateJvm(opts, optsLen, &jvm, &env);
+
+                        // 2. Populate members;
+                        javaMembers.Initialize(env);
+                        members.Initialize(env);
+
+                        // 3. Register native functions.
+                        RegisterNatives(env);
+
+                        // 4. Create JNI JVM.
+                        JVM = JniJvm(jvm, javaMembers, members);
+
+                        char* printStack = getenv("IGNITE_CPP_PRINT_STACK");
+                        PRINT_EXCEPTION = printStack && strcmp("true", printStack) == 0;
+                    }
+
+                    ctx = new JniContext(&JVM, hnds);
+                }
+                catch (JvmException)
+                {
+                    char* errClsNameChars = NULL;
+                    char* errMsgChars = NULL;
+
+                    // Read error info if possible.
+                    javaMembers.WriteErrorInfo(env, &errClsNameChars, &errClsNameLen, &errMsgChars, &errMsgLen);
+
+                    if (errClsNameChars) {
+                        errClsName = errClsNameChars;
+
+                        delete[] errClsNameChars;
+                    }
+
+                    if (errMsgChars)
+                    {
+                        errMsg = errMsgChars;
+
+                        delete[] errMsgChars;
+                    }
+
+                    // Destroy mmebers.
+                    if (env) {
+                        members.Destroy(env);
+                        javaMembers.Destroy(env);
+                    }
+
+                    // Destroy faulty JVM.
+                    if (jvm)
+                        jvm->DestroyJavaVM();
+                }
+
+                // It safe to release the lock at this point.
+                JVM_LOCK.Leave();
+
+                // Notify err callback if needed.
+                if (!ctx) {
+                    if (errInfo) {
+                        JniErrorInfo errInfo0(IGNITE_JNI_ERR_JVM_INIT, errClsName.c_str(), errMsg.c_str());
+
+                        *errInfo = errInfo0;
+                    }
+
+                    if (hnds.error)
+                        hnds.error(hnds.target, IGNITE_JNI_ERR_JVM_INIT, errClsName.c_str(), errClsNameLen,
+                            errMsg.c_str(), errMsgLen, NULL, 0);
+                }
+
+                return ctx;
+            }
+
+            int JniContext::Reallocate(long long memPtr, int cap) {
+                JavaVM* jvm = JVM.GetJvm();
+
+                JNIEnv* env;
+
+                int attachRes = jvm->AttachCurrentThread(reinterpret_cast<void**>(&env), NULL);
+
+                if (attachRes == JNI_OK)
+                    AttachHelper::OnThreadAttach();
+                else
+                    return -1;
+
+                env->CallStaticVoidMethod(JVM.GetMembers().c_PlatformUtils, JVM.GetMembers().m_PlatformUtils_reallocate, memPtr, cap);
+
+                if (env->ExceptionCheck()) {
+                    env->ExceptionClear();
+
+                    return -1;
+                }
+
+                return 0;
+            }
+
+            void JniContext::Detach() {
+                gcc::Memory::Fence();
+
+                if (JVM.GetJvm()) {
+                    JNIEnv* env;
+
+                    JVM.GetJvm()->GetEnv(reinterpret_cast<void**>(&env), JNI_VERSION_1_6);
+
+                    if (env)
+                        JVM.GetJvm()->DetachCurrentThread();
+                }
+            }
+
+            jobject JniContext::IgnitionStart(char* cfgPath, char* name, int factoryId, long long dataPtr) {
+                return IgnitionStart(cfgPath, name, factoryId, dataPtr, NULL);
+            }
+            
+            jobject JniContext::IgnitionStart(char* cfgPath, char* name, int factoryId, long long dataPtr, JniErrorInfo* errInfo)
+            {
+                JNIEnv* env = Attach();
+
+                jstring cfgPath0 = env->NewStringUTF(cfgPath);
+                jstring name0 = env->NewStringUTF(name);
+
+                jobject interop = env->CallStaticObjectMethod(
+                    jvm->GetMembers().c_PlatformIgnition,
+                    jvm->GetMembers().m_PlatformIgnition_start,
+                    cfgPath0,
+                    name0,
+                    factoryId,
+                    reinterpret_cast<long long>(&hnds),
+                    dataPtr
+                );
+
+                ExceptionCheck(env, errInfo);
+
+                return LocalToGlobal(env, interop);
+            }
+
+
+            jobject JniContext::IgnitionInstance(char* name)
+            {
+                return IgnitionInstance(name, NULL);
+            }
+
+            jobject JniContext::IgnitionInstance(char* name, JniErrorInfo* errInfo)
+            {
+                JNIEnv* env = Attach();
+
+                jstring name0 = env->NewStringUTF(name);
+
+                jobject interop = env->CallStaticObjectMethod(jvm->GetMembers().c_PlatformIgnition,
+                    jvm->GetMembers().m_PlatformIgnition_instance, name0);
+
+                ExceptionCheck(env, errInfo);
+
+                return LocalToGlobal(env, interop);
+            }
+
+            long long JniContext::IgnitionEnvironmentPointer(char* name)
+            {
+                return IgnitionEnvironmentPointer(name, NULL);
+            }
+
+            long long JniContext::IgnitionEnvironmentPointer(char* name, JniErrorInfo* errInfo)
+            {
+                JNIEnv* env = Attach();
+
+                jstring name0 = env->NewStringUTF(name);
+
+                long long res = env->CallStaticLongMethod(jvm->GetMembers().c_PlatformIgnition,
+                    jvm->GetMembers().m_PlatformIgnition_environmentPointer, name0);
+
+                ExceptionCheck(env, errInfo);
+
+                return res;
+            }
+
+            bool JniContext::IgnitionStop(char* name, bool cancel)
+            {
+                return IgnitionStop(name, cancel, NULL);
+            }
+
+            bool JniContext::IgnitionStop(char* name, bool cancel, JniErrorInfo* errInfo)
+            {
+                JNIEnv* env = Attach();
+
+                jstring name0 = env->NewStringUTF(name);
+
+                jboolean res = env->CallStaticBooleanMethod(jvm->GetMembers().c_PlatformIgnition,
+                    jvm->GetMembers().m_PlatformIgnition_stop, name0, cancel);
+
+                ExceptionCheck(env, errInfo);
+
+                return res != 0;
+            }
+
+            void JniContext::IgnitionStopAll(bool cancel)
+            {
+                return IgnitionStopAll(cancel, NULL);
+            }
+
+            void JniContext::IgnitionStopAll(bool cancel, JniErrorInfo* errInfo)
+            {
+                JNIEnv* env = Attach();
+
+                env->CallStaticVoidMethod(jvm->GetMembers().c_PlatformIgnition,
+                    jvm->GetMembers().m_PlatformIgnition_stopAll, cancel);
+
+                ExceptionCheck(env, errInfo);
+            }
+
+            void JniContext::ProcessorReleaseStart(jobject obj) {
+                JNIEnv* env = Attach();
+
+                env->CallVoidMethod(obj, jvm->GetMembers().m_PlatformProcessor_releaseStart);
+
+                ExceptionCheck(env);
+            }
+
+            jobject JniContext::ProcessorProjection(jobject obj) {
+                JNIEnv* env = Attach();
+
+                jobject prj = env->CallObjectMethod(obj, jvm->GetMembers().m_PlatformProcessor_projection);
+
+                ExceptionCheck(env);
+
+                return LocalToGlobal(env, prj);
+            }
+
+            jobject JniContext::ProcessorCache0(jobject obj, const char* name, jmethodID mthd, JniErrorInfo* errInfo)
+            {
+                JNIEnv* env = Attach();
+
+                jstring name0 = name != NULL ? env->NewStringUTF(name) : NULL;
+
+                jobject cache = env->CallObjectMethod(obj, mthd, name0);
+
+                if (name0)
+                    env->DeleteLocalRef(name0);
+
+                ExceptionCheck(env, errInfo);
+
+                return LocalToGlobal(env, cache);
+            }
+
+            jobject JniContext::ProcessorCache(jobject obj, const char* name) {
+                return ProcessorCache(obj, name, NULL);
+            }
+
+            jobject JniContext::ProcessorCache(jobject obj, const char* name, JniErrorInfo* errInfo) {
+                return ProcessorCache0(obj, name, jvm->GetMembers().m_PlatformProcessor_cache, errInfo);
+            }
+
+            jobject JniContext::ProcessorCreateCache(jobject obj, const char* name) {
+                return ProcessorCreateCache(obj, name, NULL);
+            }
+
+            jobject JniContext::ProcessorCreateCache(jobject obj, const char* name, JniErrorInfo* errInfo)
+            {
+                return ProcessorCache0(obj, name, jvm->GetMembers().m_PlatformProcessor_createCache, errInfo);
+            }
+
+            jobject JniContext::ProcessorGetOrCreateCache(jobject obj, const char* name) {
+                return ProcessorGetOrCreateCache(obj, name, NULL);
+            }
+
+            jobject JniContext::ProcessorGetOrCreateCache(jobject obj, const char* name, JniErrorInfo* errInfo)
+            {
+                return ProcessorCache0(obj, name, jvm->GetMembers().m_PlatformProcessor_getOrCreateCache, errInfo);
+            }
+
+            jobject JniContext::ProcessorAffinity(jobject obj, const char* name) {
+                JNIEnv* env = Attach();
+
+                jstring name0 = name != NULL ? env->NewStringUTF(name) : NULL;
+
+                jobject aff = env->CallObjectMethod(obj, jvm->GetMembers().m_PlatformProcessor_affinity, name0);
+
+                if (name0)
+                    env->DeleteLocalRef(name0);
+
+                ExceptionCheck(env);
+
+                return LocalToGlobal(env, aff);
+            }
+
+            jobject JniContext::ProcessorDataStreamer(jobject obj, const char* name, bool keepPortable) {
+                JNIEnv* env = Attach();
+
+                jstring name0 = name != NULL ? env->NewStringUTF(name) : NULL;
+
+                jobject ldr = env->CallObjectMethod(obj, jvm->GetMembers().m_PlatformProcessor_dataStreamer, name0,
+                    keepPortable);
+
+                if (name0)
+                    env->DeleteLocalRef(name0);
+
+                ExceptionCheck(env);
+
+                return LocalToGlobal(env, ldr);
+            }
+
+            jobject JniContext::ProcessorTransactions(jobject obj) {
+                JNIEnv* env = Attach();
+
+                jobject tx = env->CallObjectMethod(obj, jvm->GetMembers().m_PlatformProcessor_transactions);
+
+                ExceptionCheck(env);
+
+                return LocalToGlobal(env, tx);
+            }
+            
+            jobject JniContext::ProcessorCompute(jobject obj, jobject prj) {
+                JNIEnv* env = Attach();
+
+                jobject res = env->CallObjectMethod(obj, jvm->GetMembers().m_PlatformProcessor_compute, prj);
+
+                ExceptionCheck(env);
+
+                return LocalToGlobal(env, res);
+            }
+
+            jobject JniContext::ProcessorMessage(jobject obj, jobject prj) {
+                JNIEnv* env = Attach();
+
+                jobject res = env->CallObjectMethod(obj, jvm->GetMembers().m_PlatformProcessor_message, prj);
+
+                ExceptionCheck(env);
+
+                return LocalToGlobal(env, res);
+            }
+
+            jobject JniContext::ProcessorEvents(jobject obj, jobject prj) {
+                JNIEnv* env = Attach();
+
+                jobject res = env->CallObjectMethod(obj, jvm->GetMembers().m_PlatformProcessor_events, prj);
+
+                ExceptionCheck(env);
+
+                return LocalToGlobal(env, res);
+            }
+
+            jobject JniContext::ProcessorServices(jobject obj, jobject prj) {
+                JNIEnv* env = Attach();
+
+                jobject res = env->CallObjectMethod(obj, jvm->GetMembers().m_PlatformProcessor_services, prj);
+
+                ExceptionCheck(env);
+
+                return LocalToGlobal(env, res);
+            }
+            
+            jobject JniContext::ProcessorExtensions(jobject obj)
+            {
+                JNIEnv* env = Attach();
+
+                jobject res = env->CallObjectMethod(obj, jvm->GetMembers().m_PlatformProcessor_extensions);
+
+                ExceptionCheck(env);
+
+                return LocalToGlobal(env, res);
+            }
+
+            long long JniContext::TargetInStreamOutLong(jobject obj, int opType, long long memPtr, JniErrorInfo* err) {
+                JNIEnv* env = Attach();
+
+                long long res = env->CallLongMethod(obj, jvm->GetMembers().m_PlatformTarget_inStreamOutLong, opType, memPtr);
+
+                ExceptionCheck(env, err);
+
+                return res;
+            }
+
+            void JniContext::TargetInStreamOutStream(jobject obj, int opType, long long inMemPtr, long long outMemPtr, JniErrorInfo* err) {
+                JNIEnv* env = Attach();
+
+                env->CallVoidMethod(obj, jvm->GetMembers().m_PlatformTarget_inStreamOutStream, opType, inMemPtr, outMemPtr);
+
+                ExceptionCheck(env, err);
+            }
+
+           jobject JniContext::TargetInStreamOutObject(jobject obj, int opType, long long memPtr, JniErrorInfo* err) {
+                JNIEnv* env = Attach();
+
+                jobject res = env->CallObjectMethod(obj, jvm->GetMembers().m_PlatformTarget_inStreamOutObject, opType, memPtr);
+
+                ExceptionCheck(env, err);
+
+                return LocalToGlobal(env, res);
+            }
+
+            void JniContext::TargetInObjectStreamOutStream(jobject obj, int opType, void* arg, long long inMemPtr, long long outMemPtr, JniErrorInfo* err) {
+                JNIEnv* env = Attach();
+
+                env->CallVoidMethod(obj, jvm->GetMembers().m_PlatformTarget_inObjectStreamOutStream, opType, arg, inMemPtr, outMemPtr);
+
+                ExceptionCheck(env, err);
+            }
+
+            long long JniContext::TargetOutLong(jobject obj, int opType, JniErrorInfo* err)
+            {
+                JNIEnv* env = Attach();
+
+                jlong res = env->CallLongMethod(obj, jvm->GetMembers().m_PlatformTarget_outLong, opType);
+
+                ExceptionCheck(env, err);
+
+                return res;
+            }
+
+            void JniContext::TargetOutStream(jobject obj, int opType, long long memPtr, JniErrorInfo* err) {
+                JNIEnv* env = Attach();
+
+                env->CallVoidMethod(obj, jvm->GetMembers().m_PlatformTarget_outStream, opType, memPtr);
+
+                ExceptionCheck(env, err);
+            }
+
+            jobject JniContext::TargetOutObject(jobject obj, int opType, JniErrorInfo* err)
+            {
+                JNIEnv* env = Attach();
+
+                jobject res = env->CallObjectMethod(obj, jvm->GetMembers().m_PlatformTarget_outObject, opType);
+
+                ExceptionCheck(env, err);
+
+                return LocalToGlobal(env, res);
+            }
+
+            void JniContext::TargetListenFuture(jobject obj, long long futId, int typ) {
+                JNIEnv* env = Attach();
+
+                env->CallVoidMethod(obj, jvm->GetMembers().m_PlatformTarget_listenFuture, futId, typ);
+
+                ExceptionCheck(env);
+            }
+
+            void JniContext::TargetListenFutureForOperation(jobject obj, long long futId, int typ, int opId) {
+                JNIEnv* env = Attach();
+
+                env->CallVoidMethod(obj, jvm->GetMembers().m_PlatformTarget_listenFutureForOperation, futId, typ, opId);
+
+                ExceptionCheck(env);
+            }
+
+            int JniContext::AffinityPartitions(jobject obj) {
+                JNIEnv* env = Attach();
+
+                jint parts = env->CallIntMethod(obj, jvm->GetMembers().m_PlatformAffinity_partitions);
+
+                ExceptionCheck(env);
+
+                return parts;
+            }
+
+            jobject JniContext::CacheWithSkipStore(jobject obj) {
+                JNIEnv* env = Attach();
+
+                jobject cache = env->CallObjectMethod(obj, jvm->GetMembers().m_PlatformCache_withSkipStore);
+
+                ExceptionCheck(env);
+
+                return LocalToGlobal(env, cache);
+            }
+
+            jobject JniContext::CacheWithNoRetries(jobject obj) {
+                JNIEnv* env = Attach();
+
+                jobject cache = env->CallObjectMethod(obj, jvm->GetMembers().m_PlatformCache_withNoRetries);
+
+                ExceptionCheck(env);
+
+                return LocalToGlobal(env, cache);
+            }
+
+            jobject JniContext::CacheWithExpiryPolicy(jobject obj, long long create, long long update, long long access) {
+                JNIEnv* env = Attach();
+
+                jobject cache = env->CallObjectMethod(obj, jvm->GetMembers().m_PlatformCache_withExpiryPolicy,
+                    create, update, access);
+
+                ExceptionCheck(env);
+
+                return LocalToGlobal(env, cache);
+            }
+
+            jobject JniContext::CacheWithAsync(jobject obj) {
+                JNIEnv* env = Attach();
+
+                jobject cache = env->CallObjectMethod(obj, jvm->GetMembers().m_PlatformCache_withAsync);
+
+                ExceptionCheck(env);
+
+                return LocalToGlobal(env, cache);
+            }
+
+            jobject JniContext::CacheWithKeepPortable(jobject obj) {
+                JNIEnv* env = Attach();
+
+                jobject cache = env->CallObjectMethod(obj, jvm->GetMembers().m_PlatformCache_withKeepPortable);
+
+                ExceptionCheck(env);
+
+                return LocalToGlobal(env, cache);
+            }
+
+            void JniContext::CacheClear(jobject obj, JniErrorInfo* err) {
+                JNIEnv* env = Attach();
+
+                env->CallVoidMethod(obj, jvm->GetMembers().m_PlatformCache_clear);
+
+                ExceptionCheck(env, err);
+            }
+
+            void JniContext::CacheRemoveAll(jobject obj, JniErrorInfo* err) {
+                JNIEnv* env = Attach();
+
+                env->CallVoidMethod(obj, jvm->GetMembers().m_PlatformCache_removeAll);
+
+                ExceptionCheck(env, err);
+            }
+
+            jobject JniContext::CacheOutOpQueryCursor(jobject obj, int type, long long memPtr, JniErrorInfo* err) {
+                JNIEnv* env = Attach();
+
+                jobject res = env->CallObjectMethod(
+                    obj, jvm->GetMembers().m_PlatformTarget_inStreamOutObject, type, memPtr);
+
+                ExceptionCheck(env, err);
+
+                return LocalToGlobal(env, res);
+            }
+
+            jobject JniContext::CacheOutOpContinuousQuery(jobject obj, int type, long long memPtr) {
+                JNIEnv* env = Attach();
+
+                jobject res = env->CallObjectMethod(
+                    obj, jvm->GetMembers().m_PlatformTarget_inStreamOutObject, type, memPtr);
+
+                ExceptionCheck(env);
+
+                return LocalToGlobal(env, res);
+            }
+
+            jobject JniContext::CacheIterator(jobject obj) {
+                JNIEnv* env = Attach();
+
+                jobject res = env->CallObjectMethod(obj, jvm->GetMembers().m_PlatformCache_iterator);
+
+                ExceptionCheck(env);
+
+                return LocalToGlobal(env, res);
+            }
+
+            jobject JniContext::CacheLocalIterator(jobject obj, int peekModes) {
+                JNIEnv*env = Attach();
+
+                jobject res = env->CallObjectMethod(obj, jvm->GetMembers().m_PlatformCache_localIterator, peekModes);
+
+                ExceptionCheck(env);
+
+                return LocalToGlobal(env, res);
+            }
+
+            void JniContext::CacheEnterLock(jobject obj, long long id) {
+                JNIEnv* env = Attach();
+
+                env->CallVoidMethod(obj, jvm->GetMembers().m_PlatformCache_enterLock, id);
+
+                ExceptionCheck(env);
+            }
+
+            void JniContext::CacheExitLock(jobject obj, long long id) {
+                JNIEnv* env = Attach();
+
+                env->CallVoidMethod(obj, jvm->GetMembers().m_PlatformCache_exitLock, id);
+
+                ExceptionCheck(env);
+            }
+
+            bool JniContext::CacheTryEnterLock(jobject obj, long long id, long long timeout) {
+                JNIEnv* env = Attach();
+
+                jboolean res = env->CallBooleanMethod(obj, jvm->GetMembers().m_PlatformCache_tryEnterLock, id, timeout);
+
+                ExceptionCheck(env);
+
+                return res != 0;
+            }
+
+            void JniContext::CacheCloseLock(jobject obj, long long id) {
+                JNIEnv* env = Attach();
+
+                env->CallVoidMethod(obj, jvm->GetMembers().m_PlatformCache_closeLock, id);
+
+                ExceptionCheck(env);
+            }
+
+            void JniContext::CacheRebalance(jobject obj, long long futId) {
+                JNIEnv* env = Attach();
+
+                env->CallVoidMethod(obj, jvm->GetMembers().m_PlatformCache_rebalance, futId);
+
+                ExceptionCheck(env);
+            }
+
+            int JniContext::CacheSize(jobject obj, int peekModes, bool loc, JniErrorInfo* err) {
+                JNIEnv* env = Attach();
+
+                jint res = env->CallIntMethod(obj, jvm->GetMembers().m_PlatformCache_size, peekModes, loc);
+
+                ExceptionCheck(env, err);
+
+                return res;
+            }
+
+            void JniContext::CacheStoreCallbackInvoke(jobject obj, long long memPtr) {
+                JNIEnv* env = Attach();
+
+                env->CallVoidMethod(obj, jvm->GetMembers().m_PlatformCacheStoreCallback_invoke, memPtr);
+
+                ExceptionCheck(env);
+            }
+
+            void JniContext::ComputeWithNoFailover(jobject obj) {
+                JNIEnv* env = Attach();
+
+                env->CallVoidMethod(obj, jvm->GetMembers().m_PlatformCompute_withNoFailover);
+
+                ExceptionCheck(env);
+            }
+
+            void JniContext::ComputeWithTimeout(jobject obj, long long timeout) {
+                JNIEnv* env = Attach();
+
+                env->CallVoidMethod(obj, jvm->GetMembers().m_PlatformCompute_withTimeout, timeout);
+
+                ExceptionCheck(env);
+            }
+
+            void JniContext::ComputeExecuteNative(jobject obj, long long taskPtr, long long topVer) {
+                JNIEnv* env = Attach();
+
+                env->CallVoidMethod(obj, jvm->GetMembers().m_PlatformCompute_executeNative, taskPtr, topVer);
+
+                ExceptionCheck(env);
+            }
+
+            void JniContext::ContinuousQueryClose(jobject obj) {
+                JNIEnv* env = Attach();
+
+                env->CallVoidMethod(obj, jvm->GetMembers().m_PlatformContinuousQuery_close);
+
+                ExceptionCheck(env);
+            }
+
+            void* JniContext::ContinuousQueryGetInitialQueryCursor(jobject obj) {
+                JNIEnv* env = Attach();
+
+                jobject res = env->CallObjectMethod(obj, jvm->GetMembers().m_PlatformContinuousQuery_getInitialQueryCursor);
+
+                ExceptionCheck(env);
+
+                return res;
+            }
+
+            void JniContext::DataStreamerListenTopology(jobject obj, long long ptr) {
+                JNIEnv* env = Attach();
+
+                env->CallVoidMethod(obj, jvm->GetMembers().m_PlatformDataStreamer_listenTopology, ptr);
+
+                ExceptionCheck(env);
+            }
+
+            bool JniContext::DataStreamerAllowOverwriteGet(jobject obj) {
+                JNIEnv* env = Attach();
+
+                jboolean res = env->CallBooleanMethod(obj, jvm->GetMembers().m_PlatformDataStreamer_getAllowOverwrite);
+
+                ExceptionCheck(env);
+
+                return res != 0;
+            }
+
+            void JniContext::DataStreamerAllowOverwriteSet(jobject obj, bool val) {
+                JNIEnv* env = Attach();
+
+                env->CallVoidMethod(obj, jvm->GetMembers().m_PlatformDataStreamer_setAllowOverwrite, val);
+
+                ExceptionCheck(env);
+            }
+
+            bool JniContext::DataStreamerSkipStoreGet(jobject obj) {
+                JNIEnv* env = Attach();
+
+                jboolean res = env->CallBooleanMethod(obj, jvm->GetMembers().m_PlatformDataStreamer_getSkipStore);
+
+                ExceptionCheck(env);
+
+                return res != 0;
+            }
+
+            void JniContext::DataStreamerSkipStoreSet(jobject obj, bool val) {
+                JNIEnv* env = Attach();
+
+                env->CallVoidMethod(obj, jvm->GetMembers().m_PlatformDataStreamer_setSkipStore, val);
+
+                ExceptionCheck(env);
+            }
+
+            int JniContext::DataStreamerPerNodeBufferSizeGet(jobject obj) {
+                JNIEnv* env = Attach();
+
+                jint res = env->CallIntMethod(obj, jvm->GetMembers().m_PlatformDataStreamer_getPerNodeBufSize);
+
+                ExceptionCheck(env);
+
+                return res;
+            }
+
+            void JniContext::DataStreamerPerNodeBufferSizeSet(jobject obj, int val) {
+                JNIEnv* env = Attach();
+
+                env->CallVoidMethod(obj, jvm->GetMembers().m_PlatformDataStreamer_setPerNodeBufSize, val);
+
+                ExceptionCheck(env);
+            }
+
+            int JniContext::DataStreamerPerNodeParallelOperationsGet(jobject obj) {
+                JNIEnv* env = Attach();
+
+                jint res = env->CallIntMethod(obj, jvm->GetMembers().m_PlatformDataStreamer_getPerNodeParallelOps);
+
+                ExceptionCheck(env);
+
+                return res;
+            }
+
+            void JniContext::DataStreamerPerNodeParallelOperationsSet(jobject obj, int val) {
+                JNIEnv* env = Attach();
+
+                env->CallVoidMethod(obj, jvm->GetMembers().m_PlatformDataStreamer_setPerNodeParallelOps, val);
+
+                ExceptionCheck(env);
+            }
+
+            jobject JniContext::MessagingWithAsync(jobject obj) {
+                JNIEnv* env = Attach();
+
+                jobject msg = env->CallObjectMethod(obj, jvm->GetMembers().m_PlatformMessaging_withAsync);
+
+                ExceptionCheck(env);
+
+                return LocalToGlobal(env, msg);
+            }
+
+            jobject JniContext::ProjectionForOthers(jobject obj, jobject prj) {
+                JNIEnv* env = Attach();
+
+                jobject newPrj = env->CallObjectMethod(obj, jvm->GetMembers().m_PlatformClusterGroup_forOthers, prj);
+
+                ExceptionCheck(env);
+
+                return LocalToGlobal(env, newPrj);
+            }
+
+            jobject JniContext::ProjectionForRemotes(jobject obj) {
+                JNIEnv* env = Attach();
+
+                jobject newPrj = env->CallObjectMethod(obj, jvm->GetMembers().m_PlatformClusterGroup_forRemotes);
+
+                ExceptionCheck(env);
+
+                return LocalToGlobal(env, newPrj);
+            }
+
+            jobject JniContext::ProjectionForDaemons(jobject obj) {
+                JNIEnv* env = Attach();
+
+                jobject newPrj = env->CallObjectMethod(obj, jvm->GetMembers().m_PlatformClusterGroup_forDaemons);
+
+                ExceptionCheck(env);
+
+                return LocalToGlobal(env, newPrj);
+            }
+
+            jobject JniContext::ProjectionForRandom(jobject obj) {
+                JNIEnv* env = Attach();
+
+                jobject newPrj = env->CallObjectMethod(obj, jvm->GetMembers().m_PlatformClusterGroup_forRandom);
+
+                ExceptionCheck(env);
+
+                return LocalToGlobal(env, newPrj);
+            }
+
+            jobject JniContext::ProjectionForOldest(jobject obj) {
+                JNIEnv* env = Attach();
+
+                jobject newPrj = env->CallObjectMethod(obj, jvm->GetMembers().m_PlatformClusterGroup_forOldest);
+
+                ExceptionCheck(env);
+
+                return LocalToGlobal(env, newPrj);
+            }
+
+            jobject JniContext::ProjectionForYoungest(jobject obj) {
+                JNIEnv* env = Attach();
+
+                jobject newPrj = env->CallObjectMethod(obj, jvm->GetMembers().m_PlatformClusterGroup_forYoungest);
+
+                ExceptionCheck(env);
+
+                return LocalToGlobal(env, newPrj);
+            }
+
+            void JniContext::ProjectionResetMetrics(jobject obj) {
+                JNIEnv* env = Attach();
+
+                env->CallVoidMethod(obj, jvm->GetMembers().m_PlatformClusterGroup_resetMetrics);
+
+                ExceptionCheck(env);
+            }
+
+            jobject JniContext::ProjectionOutOpRet(jobject obj, int type, long long memPtr) {
+                JNIEnv* env = Attach();
+
+                jobject res = env->CallObjectMethod(
+                    obj, jvm->GetMembers().m_PlatformTarget_inStreamOutObject, type, memPtr);
+
+                ExceptionCheck(env);
+
+                return LocalToGlobal(env, res);
+            }
+
+
+            void JniContext::QueryCursorIterator(jobject obj, JniErrorInfo* errInfo) {
+                JNIEnv* env = Attach();
+
+                env->CallVoidMethod(obj, jvm->GetMembers().m_PlatformAbstractQryCursor_iter);
+
+                ExceptionCheck(env, errInfo);
+            }
+
+            bool JniContext::QueryCursorIteratorHasNext(jobject obj, JniErrorInfo* errInfo)
+            {
+                JNIEnv* env = Attach();
+
+                jboolean res = env->CallBooleanMethod(obj, jvm->GetMembers().m_PlatformAbstractQryCursor_iterHasNext);
+
+                ExceptionCheck(env, errInfo);
+
+                return res != 0;
+            }
+
+            void JniContext::QueryCursorClose(jobject obj, JniErrorInfo* errInfo) {
+                JNIEnv* env = Attach();
+
+                env->CallVoidMethod(obj, jvm->GetMembers().m_PlatformAbstractQryCursor_close);
+
+                ExceptionCheck(env, errInfo);
+            }
+
+            long long JniContext::TransactionsStart(jobject obj, int concurrency, int isolation, long long timeout, int txSize) {
+                JNIEnv* env = Attach();
+
+                long long id = env->CallLongMethod(obj, jvm->GetMembers().m_PlatformTransactions_txStart, concurrency, isolation, timeout, txSize);
+
+                ExceptionCheck(env);
+
+                return id;
+            }
+
+            int JniContext::TransactionsCommit(jobject obj, long long id) {
+                JNIEnv* env = Attach();
+
+                int res = env->CallIntMethod(obj, jvm->GetMembers().m_PlatformTransactions_txCommit, id);
+
+                ExceptionCheck(env);
+
+                return res;
+            }
+
+            void JniContext::TransactionsCommitAsync(jobject obj, long long id, long long futId) {
+                JNIEnv* env = Attach();
+
+                env->CallVoidMethod(obj, jvm->GetMembers().m_PlatformTransactions_txCommitAsync, id, futId);
+
+                ExceptionCheck(env);
+            }
+
+            int JniContext::TransactionsRollback(jobject obj, long long id) {
+                JNIEnv* env = Attach();
+
+                int res = env->CallIntMethod(obj, jvm->GetMembers().m_PlatformTransactions_txRollback, id);
+
+                ExceptionCheck(env);
+
+                return res;
+            }
+
+            void JniContext::TransactionsRollbackAsync(jobject obj, long long id, long long futId) {
+                JNIEnv* env = Attach();
+
+                env->CallVoidMethod(obj, jvm->GetMembers().m_PlatformTransactions_txRollbackAsync, id, futId);
+
+                ExceptionCheck(env);
+            }
+
+            int JniContext::TransactionsClose(jobject obj, long long id) {
+                JNIEnv* env = Attach();
+
+                jint state = env->CallIntMethod(obj, jvm->GetMembers().m_PlatformTransactions_txClose, id);
+
+                ExceptionCheck(env);
+
+                return state;
+            }
+
+            int JniContext::TransactionsState(jobject obj, long long id) {
+                JNIEnv* env = Attach();
+
+                jint state = env->CallIntMethod(obj, jvm->GetMembers().m_PlatformTransactions_txState, id);
+
+                ExceptionCheck(env);
+
+                return state;
+            }
+
+            bool JniContext::TransactionsSetRollbackOnly(jobject obj, long long id) {
+                JNIEnv* env = Attach();
+
+                jboolean res = env->CallBooleanMethod(obj, jvm->GetMembers().m_PlatformTransactions_txSetRollbackOnly, id);
+
+                ExceptionCheck(env);
+
+                return res != 0;
+            }
+
+            void JniContext::TransactionsResetMetrics(jobject obj) {
+                JNIEnv* env = Attach();
+
+                env->CallVoidMethod(obj, jvm->GetMembers().m_PlatformTransactions_resetMetrics);
+
+                ExceptionCheck(env);
+            }
+
+            jobject JniContext::EventsWithAsync(jobject obj) {
+                JNIEnv * env = Attach();
+
+                jobject res = env->CallObjectMethod(obj, jvm->GetMembers().m_PlatformEvents_withAsync);
+
+                ExceptionCheck(env);
+

<TRUNCATED>

[08/28] ignite git commit: IGNITE-1513: Moved CPP.

Posted by vo...@apache.org.
http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/core/include/ignite/cache/cache.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/ignite/cache/cache.h b/modules/platform/src/main/cpp/core/include/ignite/cache/cache.h
deleted file mode 100644
index dcc837b..0000000
--- a/modules/platform/src/main/cpp/core/include/ignite/cache/cache.h
+++ /dev/null
@@ -1,1153 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef _IGNITE_CACHE
-#define _IGNITE_CACHE
-
-#include <map>
-#include <set>
-
-#include <ignite/common/common.h>
-#include <ignite/common/concurrent.h>
-
-#include "ignite/cache/cache_peek_mode.h"
-#include "ignite/cache/query/query_cursor.h"
-#include "ignite/cache/query/query_scan.h"
-#include "ignite/cache/query/query_sql.h"
-#include "ignite/cache/query/query_text.h"
-#include "ignite/impl/cache/cache_impl.h"
-#include "ignite/impl/operations.h"
-#include "ignite/ignite_error.h"
-
-namespace ignite
-{
-    namespace cache
-    {
-        /**
-         * Main entry point for all Data Grid APIs.
-         */
-        template<typename K, typename V>
-        class IGNITE_IMPORT_EXPORT Cache
-        {
-        public:
-            /**
-             * Constructor.
-             */
-            Cache(impl::cache::CacheImpl* impl) : impl(ignite::common::concurrent::SharedPointer<impl::cache::CacheImpl>(impl))
-            {
-                // No-op.
-            }
-
-            /**
-             * Name of this cache (null for default cache).
-             */
-            char* GetName()
-            {
-                return impl.Get()->GetName();
-            }
-
-            /**
-             * Checks whether this cache contains no key-value mappings.
-             * Semantically equals to Cache.Size(IGNITE_PEEK_MODE_PRIMARY) == 0.
-             *
-             * @return True if cache is empty.
-             */
-            bool IsEmpty()
-            {
-                IgniteError err;
-
-                bool res = IsEmpty(err);
-
-                IgniteError::ThrowIfNeeded(err);
-
-                return res;
-            }
-
-            /**
-             * Checks whether this cache contains no key-value mappings.
-             * Semantically equals to Cache.Size(IGNITE_PEEK_MODE_PRIMARY) == 0.
-             *
-             * @param err Error.
-             * @return True if cache is empty.
-             */
-            bool IsEmpty(IgniteError& err)
-            {
-                return impl.Get()->IsEmpty(&err);
-            }
-
-            /**
-             * Check if cache contains mapping for this key.
-             *
-             * @param key Key.
-             * @return True if cache contains mapping for this key.
-             */
-            bool ContainsKey(const K& key)
-            {
-                IgniteError err;
-
-                bool res = ContainsKey(key, err);
-
-                IgniteError::ThrowIfNeeded(err);
-
-                return res;
-            }
-
-            /**
-             * Check if cache contains mapping for this key.
-             *
-             * @param key Key.
-             * @param err Error.
-             * @return True if cache contains mapping for this key.
-             */
-            bool ContainsKey(const K& key, IgniteError& err)
-            {
-                impl::In1Operation<K> op(&key);
-
-                return impl.Get()->ContainsKey(op, &err);
-            }
-
-            /**
-             * Check if cache contains mapping for these keys.
-             *
-             * @param keys Keys.
-             * @return True if cache contains mapping for all these keys.
-             */
-            bool ContainsKeys(const std::set<K>& keys)
-            {
-                IgniteError err;
-
-                bool res = ContainsKeys(keys, err);
-
-                IgniteError::ThrowIfNeeded(err);
-
-                return res;
-            }
-
-            /**
-             * Check if cache contains mapping for these keys.
-             *
-             * @param keys Keys.
-             * @param err Error.
-             * @return True if cache contains mapping for all these keys.
-             */
-            bool ContainsKeys(const std::set<K>& keys, IgniteError& err)
-            {
-                impl::InSetOperation<K> op(&keys);
-
-                return impl.Get()->ContainsKeys(op, &err);
-            }
-
-            /**
-             * Peeks at cached value using optional set of peek modes. This method will sequentially
-             * iterate over given peek modes, and try to peek at value using each peek mode. Once a
-             * non-null value is found, it will be immediately returned.
-             * This method does not participate in any transactions, however, it may peek at transactional
-             * value depending on the peek modes used.
-             *
-             * @param key Key.
-             * @param peekModes Peek modes.
-             * @return Value.
-             */
-            V LocalPeek(const K& key, int32_t peekModes)
-            {
-                IgniteError err;
-
-                V res = LocalPeek(key, peekModes, err);
-
-                IgniteError::ThrowIfNeeded(err);
-
-                return res;
-            }
-
-            /**
-             * Peeks at cached value using optional set of peek modes. This method will sequentially
-             * iterate over given peek modes, and try to peek at value using each peek mode. Once a
-             * non-null value is found, it will be immediately returned.
-             * This method does not participate in any transactions, however, it may peek at transactional
-             * value depending on the peek modes used.
-             *
-             * @param key Key.
-             * @param peekModes Peek modes.
-             * @param err Error.
-             * @return Value.
-             */
-            V LocalPeek(const K& key, int32_t peekModes, IgniteError& err)
-            {
-                impl::InCacheLocalPeekOperation<K> inOp(&key, peekModes);
-                impl::Out1Operation<V> outOp;
-
-                impl.Get()->LocalPeek(inOp, outOp, peekModes, &err);
-
-                return outOp.GetResult();
-            }
-
-            /**
-             * Retrieves value mapped to the specified key from cache.
-             * If the value is not present in cache, then it will be looked up from swap storage. If
-             * it's not present in swap, or if swap is disabled, and if read-through is allowed, value
-             * will be loaded from persistent store.
-             * This method is transactional and will enlist the entry into ongoing transaction if there is one.
-             *
-             * @param key Key.
-             * @return Value.
-             */
-            V Get(const K& key)
-            {
-                IgniteError err;
-
-                V res = Get(key, err);
-
-                IgniteError::ThrowIfNeeded(err);
-
-                return res;
-            }
-
-            /**
-             * Retrieves value mapped to the specified key from cache.
-             * If the value is not present in cache, then it will be looked up from swap storage. If
-             * it's not present in swap, or if swap is disabled, and if read-through is allowed, value
-             * will be loaded from persistent store.
-             * This method is transactional and will enlist the entry into ongoing transaction if there is one.
-             *
-             * @param key Key.
-             * @param err Error.
-             * @return Value.
-             */
-            V Get(const K& key, IgniteError& err)
-            {
-                impl::In1Operation<K> inOp(&key);
-                impl::Out1Operation<V> outOp;
-
-                impl.Get()->Get(inOp, outOp, &err);
-
-                return outOp.GetResult();
-            }
-
-            /**
-             * Retrieves values mapped to the specified keys from cache.
-             * If some value is not present in cache, then it will be looked up from swap storage. If
-             * it's not present in swap, or if swap is disabled, and if read-through is allowed, value
-             * will be loaded from persistent store.
-             * This method is transactional and will enlist the entry into ongoing transaction if there is one.
-             *
-             * @param keys Keys.
-             * @return Map of key-value pairs.
-             */
-            std::map<K, V> GetAll(const std::set<K>& keys)
-            {
-                IgniteError err;
-
-                std::map<K, V> res = GetAll(keys, err);
-
-                IgniteError::ThrowIfNeeded(err);
-
-                return res;
-            }
-
-            /**
-             * Retrieves values mapped to the specified keys from cache.
-             * If some value is not present in cache, then it will be looked up from swap storage. If
-             * it's not present in swap, or if swap is disabled, and if read-through is allowed, value
-             * will be loaded from persistent store.
-             * This method is transactional and will enlist the entry into ongoing transaction if there is one.
-             *
-             * @param keys Keys.
-             * @param err Error.
-             * @return Map of key-value pairs.
-             */
-            std::map<K, V> GetAll(const std::set<K>& keys, IgniteError& err)
-            {
-                impl::InSetOperation<K> inOp(&keys);
-                impl::OutMapOperation<K, V> outOp;
-
-                impl.Get()->GetAll(inOp, outOp, &err);
-
-                return outOp.GetResult();
-            }
-
-            /**
-             * Associates the specified value with the specified key in the cache.
-             * If the cache previously contained a mapping for the key,
-             * the old value is replaced by the specified value.
-             *
-             * @param key Key with which the specified value is to be associated.
-             * @param val Value to be associated with the specified key.
-             */
-            void Put(const K& key, const V& val)
-            {
-                IgniteError err;
-
-                Put(key, val, err);
-
-                IgniteError::ThrowIfNeeded(err);
-            }
-
-            /**
-             * Associates the specified value with the specified key in the cache.
-             * If the cache previously contained a mapping for the key,
-             * the old value is replaced by the specified value.
-             *
-             * @param key Key with which the specified value is to be associated.
-             * @param val Value to be associated with the specified key.
-             * @param err Error.
-             */
-            void Put(const K& key, const V& val, IgniteError& err)
-            {
-                impl::In2Operation<K, V> op(&key, &val);
-
-                impl.Get()->Put(op, &err);
-            }
-
-            /**
-             * Stores given key-value pairs in cache.
-             * If write-through is enabled, the stored values will be persisted to store.
-             * This method is transactional and will enlist the entry into ongoing transaction if there is one.
-             *
-             * @param vals Key-value pairs to store in cache.
-             */
-            void PutAll(const std::map<K, V>& vals)
-            {
-                IgniteError err;
-
-                PutAll(vals, err);
-
-                IgniteError::ThrowIfNeeded(err);
-            }
-
-            /**
-             * Stores given key-value pairs in cache.
-             * If write-through is enabled, the stored values will be persisted to store.
-             * This method is transactional and will enlist the entry into ongoing transaction if there is one.
-             *
-             * @param vals Key-value pairs to store in cache.
-             * @param err Error.
-             */
-            void PutAll(const std::map<K, V>& vals, IgniteError& err)
-            {
-                impl::InMapOperation<K, V> op(&vals);
-
-                impl.Get()->PutAll(op, &err);
-            }
-
-            /**
-             * Associates the specified value with the specified key in this cache,
-             * returning an existing value if one existed.
-             *
-             * @param key Key with which the specified value is to be associated.
-             * @param val Value to be associated with the specified key.
-             * @return The value associated with the key at the start of the
-             *     operation or null if none was associated.
-             */
-            V GetAndPut(const K& key, const V& val)
-            {
-                IgniteError err;
-
-                V res = GetAndPut(key, val, err);
-
-                IgniteError::ThrowIfNeeded(err);
-
-                return res;
-            }
-
-            /**
-             * Associates the specified value with the specified key in this cache,
-             * returning an existing value if one existed.
-             *
-             * @param key Key with which the specified value is to be associated.
-             * @param val Value to be associated with the specified key.
-             * @param err Error.
-             * @return The value associated with the key at the start of the
-             *     operation or null if none was associated.
-             */
-            V GetAndPut(const K& key, const V& val, IgniteError& err)
-            {
-                impl::In2Operation<K, V> inOp(&key, &val);
-                impl::Out1Operation<V> outOp;
-
-                impl.Get()->GetAndPut(inOp, outOp, &err);
-
-                return outOp.GetResult();
-            }
-
-            /**
-             * Atomically replaces the value for a given key if and only if there is
-             * a value currently mapped by the key.
-             *
-             * @param key Key with which the specified value is to be associated.
-             * @param val Value to be associated with the specified key.
-             * @return The previous value associated with the specified key, or
-             *     null if there was no mapping for the key.
-             */
-            V GetAndReplace(const K& key, const V& val)
-            {
-                IgniteError err;
-
-                V res = GetAndReplace(key, val, err);
-
-                IgniteError::ThrowIfNeeded(err);
-
-                return res;
-            }
-
-            /**
-             * Atomically replaces the value for a given key if and only if there is
-             * a value currently mapped by the key.
-             *
-             * @param key Key with which the specified value is to be associated.
-             * @param val Value to be associated with the specified key.
-             * @param err Error.
-             * @return The previous value associated with the specified key, or
-             *     null if there was no mapping for the key.
-             */
-            V GetAndReplace(const K& key, const V& val, IgniteError& err)
-            {
-                impl::In2Operation<K, V> inOp(&key, &val);
-                impl::Out1Operation<V> outOp;
-
-                impl.Get()->GetAndReplace(inOp, outOp, &err);
-
-                return outOp.GetResult();
-            }
-
-            /**
-             * Atomically removes the entry for a key only if currently mapped to some value.
-             *
-             * @param key Key with which the specified value is associated.
-             * @return The value if one existed or null if no mapping existed for this key.
-             */
-            V GetAndRemove(const K& key)
-            {
-                IgniteError err;
-
-                V res = GetAndRemove(key, err);
-
-                IgniteError::ThrowIfNeeded(err);
-
-                return res;
-            }
-
-            /**
-             * Atomically removes the entry for a key only if currently mapped to some value.
-             *
-             * @param key Key with which the specified value is associated.
-             * @param err Error.
-             * @return The value if one existed or null if no mapping existed for this key.
-             */
-            V GetAndRemove(const K& key, IgniteError& err)
-            {
-                impl::In1Operation<K> inOp(&key);
-                impl::Out1Operation<V> outOp;
-
-                impl.Get()->GetAndRemove(inOp, outOp, &err);
-
-                return outOp.GetResult();
-            }
-
-            /**
-             * Atomically associates the specified key with the given value if it is not
-             * already associated with a value.
-             *
-             * @param key Key with which the specified value is to be associated.
-             * @param val Value to be associated with the specified key.
-             * @return True if a value was set.
-             */
-            bool PutIfAbsent(const K& key, const V& val)
-            {
-                IgniteError err;
-
-                bool res = PutIfAbsent(key, val, err);
-
-                IgniteError::ThrowIfNeeded(err);
-
-                return res;
-            }
-
-            /**
-             * Atomically associates the specified key with the given value if it is not
-             * already associated with a value.
-             *
-             * @param key Key with which the specified value is to be associated.
-             * @param val Value to be associated with the specified key.
-             * @param err Error.
-             * @return True if a value was set.
-             */
-            bool PutIfAbsent(const K& key, const V& val, IgniteError& err)
-            {
-                impl::In2Operation<K, V> op(&key, &val);
-
-                return impl.Get()->PutIfAbsent(op, &err);
-            }
-
-            /**
-             * Stores given key-value pair in cache only if cache had no previous mapping for it.
-             * If cache previously contained value for the given key, then this value is returned.
-             * In case of PARTITIONED or REPLICATED caches, the value will be loaded from the primary node,
-             * which in its turn may load the value from the swap storage, and consecutively, if it's not
-             * in swap, from the underlying persistent storage.
-             * If the returned value is not needed, method putxIfAbsent() should be used instead of this one to
-             * avoid the overhead associated with returning of the previous value.
-             * If write-through is enabled, the stored value will be persisted to store.
-             * This method is transactional and will enlist the entry into ongoing transaction if there is one.
-             *
-             * @param key Key to store in cache.
-             * @param val Value to be associated with the given key.
-             * @return Previously contained value regardless of whether put happened or not
-             *     (null if there was no previous value).
-             */
-            V GetAndPutIfAbsent(const K& key, const V& val)
-            {
-                IgniteError err;
-
-                V res = GetAndPutIfAbsent(key, val, err);
-
-                IgniteError::ThrowIfNeeded(err);
-
-                return res;
-            }
-
-            /**
-             * Stores given key-value pair in cache only if cache had no previous mapping for it.
-             * If cache previously contained value for the given key, then this value is returned.
-             * In case of PARTITIONED or REPLICATED caches, the value will be loaded from the primary node,
-             * which in its turn may load the value from the swap storage, and consecutively, if it's not
-             * in swap, from the underlying persistent storage.
-             * If the returned value is not needed, method putxIfAbsent() should be used instead of this one to
-             * avoid the overhead associated with returning of the previous value.
-             * If write-through is enabled, the stored value will be persisted to store.
-             * This method is transactional and will enlist the entry into ongoing transaction if there is one.
-             *
-             * @param key Key to store in cache.
-             * @param val Value to be associated with the given key.
-             * @param err Error.
-             * @return Previously contained value regardless of whether put happened or not
-             *     (null if there was no previous value).
-             */
-            V GetAndPutIfAbsent(const K& key, const V& val, IgniteError& err)
-            {
-                impl::In2Operation<K, V> inOp(&key, &val);
-                impl::Out1Operation<V> outOp;
-
-                impl.Get()->GetAndPutIfAbsent(inOp, outOp, &err);
-
-                return outOp.GetResult();
-            }
-
-            /**
-             * Stores given key-value pair in cache only if there is a previous mapping for it.
-             * If cache previously contained value for the given key, then this value is returned.
-             * In case of PARTITIONED or REPLICATED caches, the value will be loaded from the primary node,
-             * which in its turn may load the value from the swap storage, and consecutively, if it's not
-             * in swap, rom the underlying persistent storage.
-             * If write-through is enabled, the stored value will be persisted to store.
-             * This method is transactional and will enlist the entry into ongoing transaction if there is one.
-             *
-             * @param key Key to store in cache.
-             * @param val Value to be associated with the given key.
-             * @return True if the value was replaced.
-             */
-            bool Replace(const K& key, const V& val)
-            {
-                IgniteError err;
-
-                bool res = Replace(key, val, err);
-
-                IgniteError::ThrowIfNeeded(err);
-
-                return res;
-            }
-
-            /**
-             * Stores given key-value pair in cache only if there is a previous mapping for it.
-             * If cache previously contained value for the given key, then this value is returned.
-             * In case of PARTITIONED or REPLICATED caches, the value will be loaded from the primary node,
-             * which in its turn may load the value from the swap storage, and consecutively, if it's not
-             * in swap, rom the underlying persistent storage.
-             * If write-through is enabled, the stored value will be persisted to store.
-             * This method is transactional and will enlist the entry into ongoing transaction if there is one.
-             *
-             * @param key Key to store in cache.
-             * @param val Value to be associated with the given key.
-             * @param err Error.
-             * @return True if the value was replaced.
-             */
-            bool Replace(const K& key, const V& val, IgniteError& err)
-            {
-                impl::In2Operation<K, V> op(&key, &val);
-
-                return impl.Get()->Replace(op, &err);
-            }
-
-            /**
-             * Stores given key-value pair in cache only if only if the previous value is equal to the
-             * old value passed as argument.
-             * This method is transactional and will enlist the entry into ongoing transaction if there is one.
-             *
-             * @param key Key to store in cache.
-             * @param oldVal Old value to match.
-             * @param newVal Value to be associated with the given key.
-             * @return True if replace happened, false otherwise.
-             */
-            bool Replace(const K& key, const V& oldVal, const V& newVal)
-            {
-                IgniteError err;
-
-                bool res = Replace(key, oldVal, newVal, err);
-
-                IgniteError::ThrowIfNeeded(err);
-
-                return res;
-            }
-
-            /**
-             * Stores given key-value pair in cache only if only if the previous value is equal to the
-             * old value passed as argument.
-             * This method is transactional and will enlist the entry into ongoing transaction if there is one.
-             *
-             * @param key Key to store in cache.
-             * @param oldVal Old value to match.
-             * @param newVal Value to be associated with the given key.
-             * @param err Error.
-             * @return True if replace happened, false otherwise.
-             */
-            bool Replace(const K& key, const V& oldVal, const V& newVal, IgniteError& err)
-            {
-                impl::In3Operation<K, V, V> op(&key, &oldVal, &newVal);
-
-                return impl.Get()->ReplaceIfEqual(op, &err);
-            }
-
-            /**
-             * Attempts to evict all entries associated with keys. Note, that entry will be evicted only
-             * if it's not used (not participating in any locks or transactions).
-             *
-             * @param keys Keys to evict from cache.
-             */
-            void LocalEvict(const std::set<K>& keys)
-            {
-                IgniteError err;
-
-                LocalEvict(keys, err);
-
-                IgniteError::ThrowIfNeeded(err);
-            }
-
-            /**
-             * Attempts to evict all entries associated with keys. Note, that entry will be evicted only
-             * if it's not used (not participating in any locks or transactions).
-             *
-             * @param keys Keys to evict from cache.
-             * @param err Error.
-             */
-            void LocalEvict(const std::set<K>& keys, IgniteError& err)
-            {
-                impl::InSetOperation<K> op(&keys);
-
-                impl.Get()->LocalEvict(op, &err);
-            }
-
-            /**
-             * Clear cache.
-             */
-            void Clear()
-            {
-                IgniteError err;
-
-                Clear(err);
-
-                IgniteError::ThrowIfNeeded(err);
-            }
-
-            /**
-             * Clear cache.
-             *
-             * @param err Error.
-             */
-            void Clear(IgniteError& err)
-            {
-                impl.Get()->Clear(&err);
-            }
-
-            /**
-             * Clear entry from the cache and swap storage, without notifying listeners or CacheWriters.
-             * Entry is cleared only if it is not currently locked, and is not participating in a transaction.
-             *
-             * @param key Key to clear.
-             */
-            void Clear(const K& key)
-            {
-                IgniteError err;
-
-                Clear(key, err);
-
-                IgniteError::ThrowIfNeeded(err);
-            }
-
-            /**
-             * Clear entry from the cache and swap storage, without notifying listeners or CacheWriters.
-             * Entry is cleared only if it is not currently locked, and is not participating in a transaction.
-             *
-             * @param key Key to clear.
-             * @param err Error.
-             */
-            void Clear(const K& key, IgniteError& err)
-            {
-                impl::In1Operation<K> op(&key);
-
-                impl.Get()->Clear(op, &err);
-            }
-
-            /**
-             * Clear entries from the cache and swap storage, without notifying listeners or CacheWriters.
-             * Entry is cleared only if it is not currently locked, and is not participating in a transaction.
-             *
-             * @param keys Keys to clear.
-             */
-            void ClearAll(const std::set<K>& keys)
-            {
-                IgniteError err;
-
-                ClearAll(keys, err);
-
-                IgniteError::ThrowIfNeeded(err);
-            }
-
-            /**
-             * Clear entries from the cache and swap storage, without notifying listeners or CacheWriters.
-             * Entry is cleared only if it is not currently locked, and is not participating in a transaction.
-             *
-             * @param keys Keys to clear.
-             * @param err Error.
-             */
-            void ClearAll(const std::set<K>& keys, IgniteError& err)
-            {
-                impl::InSetOperation<K> op(&keys);
-
-                impl.Get()->ClearAll(op, &err);
-            }
-
-            /**
-             * Clear entry from the cache and swap storage, without notifying listeners or CacheWriters.
-             * Entry is cleared only if it is not currently locked, and is not participating in a transaction.
-             * Note that this operation is local as it merely clears an entry from local cache, it does not
-             * remove entries from remote caches.
-             *
-             * @param key Key to clear.
-             */
-            void LocalClear(const K& key)
-            {
-                IgniteError err;
-
-                LocalClear(key, err);
-
-                IgniteError::ThrowIfNeeded(err);
-            }
-
-            /**
-             * Clear entry from the cache and swap storage, without notifying listeners or CacheWriters.
-             * Entry is cleared only if it is not currently locked, and is not participating in a transaction.
-             * Note that this operation is local as it merely clears an entry from local cache, it does not
-             * remove entries from remote caches.
-             *
-             * @param key Key to clear.
-             * @param err Error.
-             */
-            void LocalClear(const K& key, IgniteError& err)
-            {
-                impl::In1Operation<K> op(&key);
-
-                impl.Get()->LocalClear(op, &err);
-            }
-
-            /**
-             * Clear entries from the cache and swap storage, without notifying listeners or CacheWriters.
-             * Entry is cleared only if it is not currently locked, and is not participating in a transaction.
-             * Note that this operation is local as it merely clears entries from local cache, it does not
-             * remove entries from remote caches.
-             *
-             * @param keys Keys to clear.
-             */
-            void LocalClearAll(const std::set<K>& keys)
-            {
-                IgniteError err;
-
-                LocalClearAll(keys, err);
-
-                IgniteError::ThrowIfNeeded(err);
-            }
-
-            /**
-             * Clear entries from the cache and swap storage, without notifying listeners or CacheWriters.
-             * Entry is cleared only if it is not currently locked, and is not participating in a transaction.
-             * Note that this operation is local as it merely clears entries from local cache, it does not
-             * remove entries from remote caches.
-             *
-             * @param keys Keys to clear.
-             * @param err Error.
-             */
-            void LocalClearAll(const std::set<K>& keys, IgniteError& err)
-            {
-                impl::InSetOperation<K> op(&keys);
-
-                impl.Get()->LocalClearAll(op, &err);
-            }
-
-            /**
-             * Removes given key mapping from cache. If cache previously contained value for the given key,
-             * then this value is returned. In case of PARTITIONED or REPLICATED caches, the value will be
-             * loaded from the primary node, which in its turn may load the value from the disk-based swap
-             * storage, and consecutively, if it's not in swap, from the underlying persistent storage.
-             * If the returned value is not needed, method removex() should always be used instead of this
-             * one to avoid the overhead associated with returning of the previous value.
-             * If write-through is enabled, the value will be removed from store.
-             * This method is transactional and will enlist the entry into ongoing transaction if there is one.
-             *
-             * @param key Key whose mapping is to be removed from cache.
-             * @return False if there was no matching key.
-             */
-            bool Remove(const K& key)
-            {
-                IgniteError err;
-
-                bool res = Remove(key, err);
-
-                IgniteError::ThrowIfNeeded(err);
-
-                return res;
-            }
-
-            /**
-             * Removes given key mapping from cache. If cache previously contained value for the given key,
-             * then this value is returned. In case of PARTITIONED or REPLICATED caches, the value will be
-             * loaded from the primary node, which in its turn may load the value from the disk-based swap
-             * storage, and consecutively, if it's not in swap, from the underlying persistent storage.
-             * If the returned value is not needed, method removex() should always be used instead of this
-             * one to avoid the overhead associated with returning of the previous value.
-             * If write-through is enabled, the value will be removed from store.
-             * This method is transactional and will enlist the entry into ongoing transaction if there is one.
-             *
-             * @param key Key whose mapping is to be removed from cache.
-             * @param err Error.
-             * @return False if there was no matching key.
-             */
-            bool Remove(const K& key, IgniteError& err)
-            {
-                impl::In1Operation<K> op(&key);
-
-                return impl.Get()->Remove(op, &err);
-            }
-
-            /**
-             * Removes given key mapping from cache if one exists and value is equal to the passed in value.
-             * If write-through is enabled, the value will be removed from store.
-             * This method is transactional and will enlist the entry into ongoing transaction if there is one.
-             *
-             * @param key Key whose mapping is to be removed from cache.
-             * @param val Value to match against currently cached value.
-             * @return True if entry was removed, false otherwise.
-             */
-            bool Remove(const K& key, const V& val)
-            {
-                IgniteError err;
-
-                bool res = Remove(key, val, err);
-
-                IgniteError::ThrowIfNeeded(err);
-
-                return res;
-            }
-
-            /**
-             * Removes given key mapping from cache if one exists and value is equal to the passed in value.
-             * If write-through is enabled, the value will be removed from store.
-             * This method is transactional and will enlist the entry into ongoing transaction if there is one.
-             *
-             * @param key Key whose mapping is to be removed from cache.
-             * @param val Value to match against currently cached value.
-             * @param err Error.
-             * @return True if entry was removed, false otherwise.
-             */
-            bool Remove(const K& key, const V& val, IgniteError& err)
-            {
-                impl::In2Operation<K, V> op(&key, &val);
-
-                return impl.Get()->RemoveIfEqual(op, &err);
-            }
-
-            /**
-             * Removes given key mappings from cache.
-             * If write-through is enabled, the value will be removed from store.
-             * This method is transactional and will enlist the entry into ongoing transaction if there is one.
-             *
-             * @param keys Keys whose mappings are to be removed from cache.
-             */
-            void RemoveAll(const std::set<K>& keys)
-            {
-                IgniteError err;
-
-                RemoveAll(keys, err);
-
-                IgniteError::ThrowIfNeeded(err);
-            }
-
-            /**
-             * Removes given key mappings from cache.
-             * If write-through is enabled, the value will be removed from store.
-             * This method is transactional and will enlist the entry into ongoing transaction if there is one.
-             *
-             * @param keys Keys whose mappings are to be removed from cache.
-             * @param err Error.
-             */
-            void RemoveAll(const std::set<K>& keys, IgniteError& err)
-            {
-                impl::InSetOperation<K> op(&keys);
-
-                impl.Get()->RemoveAll(op, &err);
-            }
-
-            /**
-             * Removes all mappings from cache.
-             * If write-through is enabled, the value will be removed from store.
-             * This method is transactional and will enlist the entry into ongoing transaction if there is one.
-             *
-             * @param err Error.
-             */
-            void RemoveAll()
-            {
-                IgniteError err;
-
-                RemoveAll(err);
-
-                IgniteError::ThrowIfNeeded(err);
-            }
-
-            /**
-             * Removes all mappings from cache.
-             * If write-through is enabled, the value will be removed from store.
-             * This method is transactional and will enlist the entry into ongoing transaction if there is one.
-             *
-             * @param err Error.
-             */
-            void RemoveAll(IgniteError& err)
-            {
-                return impl.Get()->RemoveAll(&err);
-            }
-
-            /**
-             * Gets the number of all entries cached on this node.
-             *
-             * @return Cache size on this node.
-             */
-            int32_t LocalSize()
-            {
-                return LocalSize(IGNITE_PEEK_MODE_ALL);
-            }
-
-            /**
-             * Gets the number of all entries cached on this node.
-             *
-             * @param err Error.
-             * @return Cache size on this node.
-             */
-            int32_t LocalSize(IgniteError& err)
-            {
-                return LocalSize(IGNITE_PEEK_MODE_ALL, err);
-            }
-
-            /**
-             * Gets the number of all entries cached on this node.
-             *
-             * @param Peek modes.
-             * @return Cache size on this node.
-             */
-            int32_t LocalSize(int32_t peekModes)
-            {
-                IgniteError err;
-
-                int32_t res = LocalSize(peekModes, err);
-
-                IgniteError::ThrowIfNeeded(err);
-
-                return res;
-            }
-
-            /**
-             * Gets the number of all entries cached on this node.
-             *
-             * @param Peek modes.
-             * @param err Error.
-             * @return Cache size on this node.
-             */
-            int32_t LocalSize(int32_t peekModes, IgniteError& err)
-            {
-                return impl.Get()->LocalSize(peekModes, &err);
-            }
-
-            /**
-             * Gets the number of all entries cached across all nodes.
-             * NOTE: this operation is distributed and will query all participating nodes for their cache sizes.
-             *
-             * @return Cache size across all nodes.
-             */
-            int32_t Size()
-            {
-                return Size(ignite::cache::IGNITE_PEEK_MODE_ALL);
-            }
-
-            /**
-             * Gets the number of all entries cached across all nodes.
-             * NOTE: this operation is distributed and will query all participating nodes for their cache sizes.
-             *
-             * @param err Error.
-             * @return Cache size across all nodes.
-             */
-            int32_t Size(IgniteError& err)
-            {
-                return Size(ignite::cache::IGNITE_PEEK_MODE_ALL, err);
-            }
-
-            /**
-             * Gets the number of all entries cached across all nodes.
-             * NOTE: this operation is distributed and will query all participating nodes for their cache sizes.
-             *
-             * @param Peek modes.
-             * @return Cache size across all nodes.
-             */
-            int32_t Size(int32_t peekModes)
-            {
-                IgniteError err;
-
-                int32_t res = Size(peekModes, err);
-
-                IgniteError::ThrowIfNeeded(err);
-
-                return res;
-            }
-
-            /**
-             * Gets the number of all entries cached across all nodes.
-             * NOTE: this operation is distributed and will query all participating nodes for their cache sizes.
-             *
-             * @param Peek modes.
-             * @param err Error.
-             * @return Cache size across all nodes.
-             */
-            int32_t Size(int32_t peekModes, IgniteError& err)
-            {
-                return impl.Get()->Size(peekModes, &err);
-            }
-
-            /**
-             * Perform SQL query.
-             *
-             * @param qry Query.
-             * @return Query cursor.
-             */
-            query::QueryCursor<K, V> Query(const query::SqlQuery& qry)
-            {
-                IgniteError err;
-
-                query::QueryCursor<K, V> res = Query(qry, err);
-
-                IgniteError::ThrowIfNeeded(err);
-
-                return res;
-            }
-
-            /**
-             * Perform SQL query.
-             *
-             * @param qry Query.
-             * @param err Error.
-             * @return Query cursor.
-             */
-            query::QueryCursor<K, V> Query(const query::SqlQuery& qry, IgniteError& err)
-            {
-                impl::cache::query::QueryCursorImpl* cursorImpl = impl.Get()->QuerySql(qry, &err);
-
-                return query::QueryCursor<K, V>(cursorImpl);
-            }
-
-            /*
-             * Perform text query.
-             *
-             * @param qry Query.
-             * @return Query cursor.
-             */
-            query::QueryCursor<K, V> Query(const query::TextQuery& qry)
-            {
-                IgniteError err;
-
-                query::QueryCursor<K, V> res = Query(qry, err);
-
-                IgniteError::ThrowIfNeeded(err);
-
-                return res;
-            }
-
-            /*
-             * Perform text query.
-             *
-             * @param qry Query.
-             * @param err Error.
-             * @return Query cursor.
-             */
-            query::QueryCursor<K, V> Query(const query::TextQuery& qry, IgniteError& err)
-            {
-                impl::cache::query::QueryCursorImpl* cursorImpl = impl.Get()->QueryText(qry, &err);
-
-                return query::QueryCursor<K, V>(cursorImpl);
-            }
-
-            /*
-             * Perform scan query.
-             *
-             * @param qry Query.
-             * @return Query cursor.
-             */
-            query::QueryCursor<K, V> Query(const query::ScanQuery& qry)
-            {
-                IgniteError err;
-
-                query::QueryCursor<K, V> res = Query(qry, err);
-
-                IgniteError::ThrowIfNeeded(err);
-
-                return res;
-            }
-
-            /*
-             * Perform scan query.
-             *
-             * @param qry Query.
-             * @param err Error.
-             * @return Query cursor.
-             */
-            query::QueryCursor<K, V> Query(const query::ScanQuery& qry, IgniteError& err)
-            {
-                impl::cache::query::QueryCursorImpl* cursorImpl = impl.Get()->QueryScan(qry, &err);
-
-                return query::QueryCursor<K, V>(cursorImpl);
-            }
-
-        private:
-            /** Implementation delegate. */
-            ignite::common::concurrent::SharedPointer<impl::cache::CacheImpl> impl;
-        };
-    }
-}
-
-#endif

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/core/include/ignite/cache/cache_entry.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/ignite/cache/cache_entry.h b/modules/platform/src/main/cpp/core/include/ignite/cache/cache_entry.h
deleted file mode 100644
index 2b6c785..0000000
--- a/modules/platform/src/main/cpp/core/include/ignite/cache/cache_entry.h
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef _IGNITE_CACHE_ENTRY
-#define _IGNITE_CACHE_ENTRY
-
-#include <ignite/common/common.h>
-
-namespace ignite
-{
-    namespace cache
-    {
-        /**
-         * Cache entry.
-         */
-        template<typename K, typename V>
-        class IGNITE_IMPORT_EXPORT CacheEntry
-        {
-        public:
-            /**
-             * Default constructor.
-             */
-            CacheEntry() : key(K()), val(V())
-            {
-                // No-op.
-            }
-
-            /**
-             * Constructor.
-             *
-             * @param key Key.
-             * @param val Value.
-             */
-            CacheEntry(const K& key, const V& val) : key(key), val(val)
-            {
-                // No-op.
-            }
-
-            /**
-             * Copy constructor.
-             *
-             * @param other Other instance.
-             */
-            CacheEntry(const CacheEntry& other)
-            {
-                key = other.key;
-                val = other.val;
-            }
-
-            /**
-             * Assignment operator.
-             *
-             * @param other Other instance.
-             */
-            CacheEntry& operator=(const CacheEntry& other) 
-            {
-                if (this != &other)
-                {
-                    CacheEntry tmp(other);
-
-                    K& key0 = key;
-                    V& val0 = val;
-
-                    key = tmp.key;
-                    val = tmp.val;
-
-                    tmp.key = key0;
-                    tmp.val = val0;
-                }
-
-                return *this;
-            }
-
-            /**
-             * Get key.
-             * 
-             * @return Key.
-             */
-            K GetKey()
-            {
-                return key;
-            }
-
-            /**
-             * Get value.
-             *
-             * @return Value.
-             */
-            V GetValue()
-            {
-                return val;
-            }
-
-        private:
-            /** Key. */
-            K key; 
-
-            /** Value. */
-            V val; 
-        };
-    }
-}
-
-#endif

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/core/include/ignite/cache/cache_peek_mode.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/ignite/cache/cache_peek_mode.h b/modules/platform/src/main/cpp/core/include/ignite/cache/cache_peek_mode.h
deleted file mode 100644
index be61887..0000000
--- a/modules/platform/src/main/cpp/core/include/ignite/cache/cache_peek_mode.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef _IGNITE_CACHE_PEEK_MODE
-#define _IGNITE_CACHE_PEEK_MODE
-
-namespace ignite
-{
-    namespace cache
-    {
-        /**
-         * Enumeration of all supported cache peek modes.
-         */
-        enum CachePeekMode
-        {
-            /**
-             * Peeks into all available cache storages.
-             */
-            IGNITE_PEEK_MODE_ALL = 0x01,
-
-            /**
-             * Peek into near cache only (don't peek into partitioned cache).
-             * In case of LOCAL cache, behaves as IGNITE_PEEK_MODE_ALL mode.
-             */
-            IGNITE_PEEK_MODE_NEAR = 0x02,
-
-            /**
-             * Peek value from primary copy of partitioned cache only (skip near cache).
-             * In case of LOCAL cache, behaves as IGNITE_PEEK_MODE_ALL mode.
-             */
-            IGNITE_PEEK_MODE_PRIMARY = 0x04,
-
-            /**
-             * Peek value from backup copies of partitioned cache only (skip near cache).
-             * In case of LOCAL cache, behaves as IGNITE_PEEK_MODE_ALL mode.
-             */
-            IGNITE_PEEK_MODE_BACKUP = 0x08,
-
-            /**
-             * Peeks value from the on-heap storage only.
-             */
-            IGNITE_PEEK_MODE_ONHEAP = 0x10,
-
-            /**
-             * Peeks value from the off-heap storage only, without loading off-heap value into cache.
-             */
-            IGNITE_PEEK_MODE_OFFHEAP = 0x20,
-
-            /**
-             * Peeks value from the swap storage only, without loading swapped value into cache.
-             */
-            IGNITE_PEEK_MODE_SWAP = 0x40
-        };
-    }
-}
-
-#endif
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/core/include/ignite/cache/query/query.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/ignite/cache/query/query.h b/modules/platform/src/main/cpp/core/include/ignite/cache/query/query.h
deleted file mode 100644
index f2d19cd..0000000
--- a/modules/platform/src/main/cpp/core/include/ignite/cache/query/query.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef _IGNITE_QUERY
-#define _IGNITE_QUERY
-
-#include "ignite/cache/query/query_argument.h"
-#include "ignite/cache/query/query_cursor.h"
-#include "ignite/cache/query/query_scan.h"
-#include "ignite/cache/query/query_sql.h"
-#include "ignite/cache/query/query_text.h"
-
-#endif
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/core/include/ignite/cache/query/query_argument.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/ignite/cache/query/query_argument.h b/modules/platform/src/main/cpp/core/include/ignite/cache/query/query_argument.h
deleted file mode 100644
index 0f41c56..0000000
--- a/modules/platform/src/main/cpp/core/include/ignite/cache/query/query_argument.h
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef _IGNITE_CACHE_QUERY_ARGUMENT
-#define _IGNITE_CACHE_QUERY_ARGUMENT
-
-#include "ignite/portable/portable_raw_writer.h"
-
-namespace ignite
-{    
-    namespace cache
-    {
-        namespace query
-        {            
-            /**
-             * Base class for all query arguments.
-             */
-            class QueryArgumentBase
-            {
-            public:
-                /**
-                 * Destructor.
-                 */
-                virtual ~QueryArgumentBase()
-                {
-                    // No-op.
-                }
-
-                /**
-                 * Copy argument. 
-                 *
-                 * @return Copy.
-                 */
-                virtual QueryArgumentBase* Copy() = 0;
-
-                /**
-                 * Write argument.
-                 */
-                virtual void Write(ignite::portable::PortableRawWriter& writer) = 0;
-            };
-
-            /**
-             * Query argument.
-             */
-            template<typename T>
-            class QueryArgument : public QueryArgumentBase
-            {
-            public:
-                /**
-                 * Constructor.
-                 *
-                 * @param val Value.
-                 */
-                QueryArgument(const T& val) : val(val)
-                {
-                    // No-op.
-                }
-
-                /**
-                 * Copy constructor.
-                 *
-                 * @param other Other instance.
-                 */
-                QueryArgument(const QueryArgument& other)
-                {
-                    val = other.val;
-                }
-
-                /**
-                 * Assignment operator.
-                 *
-                 * @param other Other instance.
-                 */
-                QueryArgument& operator=(const QueryArgument& other) 
-                {
-                    if (this != &other)
-                    {
-                        QueryArgument tmp(other);
-
-                        T val0 = val;
-                        val = tmp.val;
-                        tmp.val = val0;
-                    }
-
-                    return *this;
-                }
-
-                ~QueryArgument()
-                {
-                    // No-op.
-                }
-
-                QueryArgumentBase* Copy()
-                {
-                    return new QueryArgument(val);
-                }
-
-                void Write(ignite::portable::PortableRawWriter& writer)
-                {
-                    writer.WriteObject<T>(val);
-                }
-
-            private:
-                /** Value. */
-                T val; 
-            };
-        }
-    }    
-}
-
-#endif
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/core/include/ignite/cache/query/query_cursor.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/ignite/cache/query/query_cursor.h b/modules/platform/src/main/cpp/core/include/ignite/cache/query/query_cursor.h
deleted file mode 100644
index 23133e1..0000000
--- a/modules/platform/src/main/cpp/core/include/ignite/cache/query/query_cursor.h
+++ /dev/null
@@ -1,191 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef _IGNITE_CACHE_QUERY_CURSOR
-#define _IGNITE_CACHE_QUERY_CURSOR
-
-#include <vector>
-
-#include <ignite/common/concurrent.h>
-
-#include "ignite/cache/cache_entry.h"
-#include "ignite/ignite_error.h"
-#include "ignite/impl/cache/query/query_impl.h"
-#include "ignite/impl/operations.h"
-
-namespace ignite
-{    
-    namespace cache
-    {
-        namespace query
-        {            
-            /**
-             * Query cursor.
-             */
-            template<typename K, typename V>
-            class QueryCursor
-            {
-            public:
-                /**
-                 * Default constructor.
-                 */
-                QueryCursor() : impl(NULL)
-                {
-                    // No-op.
-                }
-
-                /**
-                 * Constructor.
-                 *
-                 * @param impl Implementation.
-                 */
-                QueryCursor(impl::cache::query::QueryCursorImpl* impl) : 
-                    impl(ignite::common::concurrent::SharedPointer<impl::cache::query::QueryCursorImpl>(impl))
-                {
-                    // No-op.
-                }
-                
-                /**
-                 * Check whether next entry exists.
-                 *
-                 * @return True if next entry exists.
-                 */
-                bool HasNext()
-                {
-                    IgniteError err;
-
-                    bool res = HasNext(err);
-
-                    IgniteError::ThrowIfNeeded(err);
-
-                    return res;
-                }
-
-                /**
-                 * Check whether next entry exists.
-                 *
-                 * @param err Error.
-                 * @return True if next entry exists.
-                 */
-                bool HasNext(IgniteError& err)
-                {
-                    impl::cache::query::QueryCursorImpl* impl0 = impl.Get();
-
-                    if (impl0)
-                        return impl0->HasNext(&err);
-                    else
-                    {
-                        err = IgniteError(IgniteError::IGNITE_ERR_GENERIC, 
-                            "Instance is not usable (did you check for error?).");
-
-                        return false;
-                    }
-                }
-
-                /**
-                 * Get next entry.
-                 *
-                 * @return Next entry.
-                 */
-                CacheEntry<K, V> GetNext()
-                {
-                    IgniteError err;
-
-                    CacheEntry<K, V> res = GetNext(err);
-
-                    IgniteError::ThrowIfNeeded(err);
-
-                    return res;                        
-                }
-
-                /**
-                 * Get next entry.
-                 *
-                 * @param err Error.
-                 * @return Next entry.
-                 */
-                CacheEntry<K, V> GetNext(IgniteError& err)
-                {
-                    impl::cache::query::QueryCursorImpl* impl0 = impl.Get();
-
-                    if (impl0) {
-                        impl::Out2Operation<K, V> outOp;
-
-                        impl0->GetNext(outOp, &err);
-
-                        if (err.GetCode() == IgniteError::IGNITE_SUCCESS) 
-                        {
-                            K& key = outOp.Get1();
-                            V& val = outOp.Get2();
-
-                            return CacheEntry<K, V>(key, val);
-                        }
-                        else 
-                            return CacheEntry<K, V>();
-                    }
-                    else
-                    {
-                        err = IgniteError(IgniteError::IGNITE_ERR_GENERIC,
-                            "Instance is not usable (did you check for error?).");
-
-                        return CacheEntry<K, V>();
-                    }
-                }
-
-                /**
-                 * Get all entries.
-                 * 
-                 * @param Vector where query entries will be stored.
-                 */
-                void GetAll(std::vector<CacheEntry<K, V>>& res)
-                {
-                    IgniteError err;
-
-                    GetAll(res, err);
-
-                    IgniteError::ThrowIfNeeded(err);
-                }
-
-                /**
-                 * Get all entries.
-                 * 
-                 * @param Vector where query entries will be stored.
-                 * @param err Error.                 
-                 */
-                void GetAll(std::vector<CacheEntry<K, V>>& res, IgniteError& err)
-                {
-                    impl::cache::query::QueryCursorImpl* impl0 = impl.Get();
-
-                    if (impl0) {
-                        impl::OutQueryGetAllOperation<K, V> outOp(&res);
-
-                        impl0->GetAll(outOp, &err);
-                    }
-                    else
-                        err = IgniteError(IgniteError::IGNITE_ERR_GENERIC,
-                            "Instance is not usable (did you check for error?).");
-                }
-
-            private:
-                /** Implementation delegate. */
-                ignite::common::concurrent::SharedPointer<impl::cache::query::QueryCursorImpl> impl;
-            };
-        }
-    }    
-}
-
-#endif
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/core/include/ignite/cache/query/query_scan.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/ignite/cache/query/query_scan.h b/modules/platform/src/main/cpp/core/include/ignite/cache/query/query_scan.h
deleted file mode 100644
index c3ec845..0000000
--- a/modules/platform/src/main/cpp/core/include/ignite/cache/query/query_scan.h
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef _IGNITE_CACHE_QUERY_SCAN
-#define _IGNITE_CACHE_QUERY_SCAN
-
-#include <stdint.h>
-#include <string>
-
-#include "ignite/portable/portable_raw_writer.h"
-
-namespace ignite
-{    
-    namespace cache
-    {
-        namespace query
-        {         
-            /*
-             * Scab query.
-             */
-            class ScanQuery
-            {
-            public:
-                /* 
-                 * Constructor.
-                 */
-                ScanQuery() : part(-1), pageSize(1024), loc(false)
-                {
-                    // No-op.
-                }
-                
-                /*
-                 * Constructor.
-                 *
-                 * @param part Partition.
-                 */
-                ScanQuery(int32_t part) : part(part), pageSize(1024), loc(false)
-                {
-                    // No-op.
-                }
-                
-                /*
-                 * Get partition to scan.
-                 *
-                 * @return Partition to scan.
-                 */
-                int32_t GetPartition()
-                {
-                    return part;
-                }
-
-                /*
-                 * Set partition to scan.
-                 *
-                 * @param part Partition to scan.
-                 */
-                void SetPartition(int32_t part)
-                {
-                    this->part = part;
-                }
-
-                /*
-                 * Get page size.
-                 *
-                 * @return Page size.
-                 */
-                int32_t GetPageSize()
-                {
-                    return pageSize;
-                }
-
-                /*
-                 * Set page size.
-                 *
-                 * @param pageSize Page size.
-                 */
-                void SetPageSize(int32_t pageSize)
-                {
-                    this->pageSize = pageSize;
-                }
-
-                /*
-                 * Get local flag.
-                 *
-                 * @return Local flag.
-                 */
-                bool IsLocal()
-                {
-                    return loc;
-                }
-
-                /*
-                 * Set local flag.
-                 *
-                 * @param loc Local flag.
-                 */
-                void SetLocal(bool loc)
-                {
-                    this->loc = loc;
-                }
-                
-                /*
-                 * Write query info to the stream.
-                 *
-                 * @param writer Writer.
-                 */
-                void Write(portable::PortableRawWriter& writer) const
-                {
-                    writer.WriteBool(loc);
-                    writer.WriteInt32(pageSize);
-
-                    if (part < 0)
-                        writer.WriteBool(false);
-                    else
-                    {
-                        writer.WriteBool(true);
-                        writer.WriteInt32(part);
-                    }
-
-                    writer.WriteNull(); // Predicates are not supported yet.
-                }
-
-            private:
-                /* Partition. */
-                int32_t part;
-
-                /* Page size. */
-                int32_t pageSize;
-
-                /* Local flag. */
-                bool loc;
-            };
-        }
-    }    
-}
-
-#endif
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/core/include/ignite/cache/query/query_sql.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/ignite/cache/query/query_sql.h b/modules/platform/src/main/cpp/core/include/ignite/cache/query/query_sql.h
deleted file mode 100644
index a2e0f33..0000000
--- a/modules/platform/src/main/cpp/core/include/ignite/cache/query/query_sql.h
+++ /dev/null
@@ -1,253 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef _IGNITE_CACHE_QUERY_SQL
-#define _IGNITE_CACHE_QUERY_SQL
-
-#include <stdint.h>
-#include <string>
-#include <vector>
-
-#include "ignite/cache/query/query_argument.h"
-#include "ignite/portable/portable_raw_writer.h"
-
-namespace ignite
-{    
-    namespace cache
-    {
-        namespace query
-        {         
-            /**
-             * Sql query.
-             */
-            class SqlQuery
-            {
-            public:
-                /**
-                 * Constructor.
-                 *
-                 * @param type Type name.
-                 * @param sql SQL string.
-                 */
-                SqlQuery(std::string type, std::string sql) : type(type), sql(sql), pageSize(1024), 
-                    loc(false), args(NULL)
-                {
-                    // No-op.
-                }
-
-                /**
-                 * Copy constructor.
-                 *
-                 * @param other Other instance.
-                 */
-                SqlQuery(const SqlQuery& other)
-                {
-                    type = other.type;
-                    sql = other.sql;
-                    pageSize = other.pageSize;
-                    loc = other.loc;
-
-                    if (other.args)
-                    {
-                        args = new std::vector<QueryArgumentBase*>();
-
-                        for (std::vector<QueryArgumentBase*>::iterator it = other.args->begin();
-                            it != other.args->end(); ++it)
-                            args->push_back((*it)->Copy());
-                    }
-                    else
-                        args = NULL;
-                }
-
-                /**
-                 * Assignment operator.
-                 *
-                 * @param other Other instance.
-                 */
-                SqlQuery& operator=(const SqlQuery& other) 
-                {
-                    if (this != &other)
-                    {
-                        type = other.type;
-                        sql = other.sql;
-                        pageSize = other.pageSize;
-                        loc = other.loc;
-
-                        SqlQuery tmp(other);
-
-                        std::vector<QueryArgumentBase*>* args0 = args;
-
-                        args = tmp.args;
-
-                        tmp.args = args0; 
-                    }
-
-                    return *this;
-                }
-
-                /**
-                 * Destructor.
-                 */
-                ~SqlQuery()
-                {
-                    if (args) 
-                    {
-                        for (std::vector<QueryArgumentBase*>::iterator it = args->begin(); it != args->end(); ++it)
-                            delete (*it);
-
-                        delete args;
-                    }
-                }
-
-                /**
-                 * Get type name.
-                 *
-                 * @return Type name.
-                 */
-                std::string GetType()
-                {
-                    return type;
-                }
-
-                /**
-                 * Set type name.
-                 *
-                 * @param sql Type name.
-                 */
-                void SetType(std::string type)
-                {
-                    this->type = type;
-                }
-
-                /**
-                 * Get SQL string.
-                 *
-                 * @return SQL string.
-                 */
-                std::string GetSql()
-                {
-                    return sql;
-                }
-
-                /**
-                 * Set SQL string.
-                 *
-                 * @param sql SQL string.
-                 */
-                void SetSql(std::string sql)
-                {
-                    this->sql = sql;
-                }
-
-                /**
-                 * Get page size.
-                 *
-                 * @return Page size.
-                 */
-                int32_t GetPageSize()
-                {
-                    return pageSize;
-                }
-
-                /**
-                 * Set page size.
-                 *
-                 * @param pageSize Page size.
-                 */
-                void SetPageSize(int32_t pageSize)
-                {
-                    this->pageSize = pageSize;
-                }
-
-                /**
-                 * Get local flag.
-                 *
-                 * @return Local flag.
-                 */
-                bool IsLocal()
-                {
-                    return loc;
-                }
-
-                /**
-                 * Set local flag.
-                 *
-                 * @param loc Local flag.
-                 */
-                void SetLocal(bool loc)
-                {
-                    this->loc = loc;
-                }
-
-                /**
-                 * Add argument.
-                 *
-                 * @param arg Argument.
-                 */
-                template<typename T>
-                void AddArgument(const T& arg)
-                {
-                    if (!args)
-                        args = new std::vector<QueryArgumentBase*>();
-
-                    args->push_back(new QueryArgument<T>(arg));
-                }
-
-                /**
-                 * Write query info to the stream.
-                 *
-                 * @param writer Writer.
-                 */
-                void Write(portable::PortableRawWriter& writer) const
-                {
-                    writer.WriteBool(loc);
-                    writer.WriteString(sql);
-                    writer.WriteString(type);
-                    writer.WriteInt32(pageSize);
-
-                    if (args)
-                    {
-                        writer.WriteInt32(static_cast<int32_t>(args->size()));
-
-                        for (std::vector<QueryArgumentBase*>::iterator it = args->begin(); it != args->end(); ++it)
-                            (*it)->Write(writer);
-                    }
-                    else
-                        writer.WriteInt32(0);
-                }
-
-            private:
-                /** Type name. */
-                std::string type;
-
-                /** SQL string. */
-                std::string sql;
-
-                /** Page size. */
-                int32_t pageSize;
-
-                /** Local flag. */
-                bool loc;
-
-                /** Arguments. */
-                std::vector<QueryArgumentBase*>* args;
-            };
-        }
-    }    
-}
-
-#endif
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/core/include/ignite/cache/query/query_text.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/ignite/cache/query/query_text.h b/modules/platform/src/main/cpp/core/include/ignite/cache/query/query_text.h
deleted file mode 100644
index 67d3ecc..0000000
--- a/modules/platform/src/main/cpp/core/include/ignite/cache/query/query_text.h
+++ /dev/null
@@ -1,159 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef _IGNITE_CACHE_QUERY_TEXT
-#define _IGNITE_CACHE_QUERY_TEXT
-
-#include <stdint.h>
-#include <string>
-
-#include "ignite/portable/portable_raw_writer.h"
-
-namespace ignite
-{    
-    namespace cache
-    {
-        namespace query
-        {         
-            /*
-             * Text query.
-             */
-            class TextQuery
-            {
-            public:
-                /*
-                 * Constructor.
-                 *
-                 * @param type Type name.
-                 * @param text Text string.
-                 */
-                TextQuery(std::string type, std::string text) : type(type), text(text), pageSize(1024), loc(false)
-                {
-                    // No-op.
-                }
-                
-                /*
-                 * Get type name.
-                 *
-                 * @return Type name.
-                 */
-                std::string GetType()
-                {
-                    return type;
-                }
-
-                /*
-                 * Set type name.
-                 *
-                 * @param sql Type name.
-                 */
-                void SetType(std::string type)
-                {
-                    this->type = type;
-                }
-
-                /*
-                 * Get text string.
-                 *
-                 * @return text string.
-                 */
-                std::string GetText()
-                {
-                    return text;
-                }
-
-                /*
-                 * Set text string.
-                 *
-                 * @param text Text string.
-                 */
-                void SetText(std::string text)
-                {
-                    this->text = text;
-                }
-
-                /*
-                 * Get page size.
-                 *
-                 * @return Page size.
-                 */
-                int32_t GetPageSize()
-                {
-                    return pageSize;
-                }
-
-                /*
-                 * Set page size.
-                 *
-                 * @param pageSize Page size.
-                 */
-                void SetPageSize(int32_t pageSize)
-                {
-                    this->pageSize = pageSize;
-                }
-
-                /*
-                 * Get local flag.
-                 *
-                 * @return Local flag.
-                 */
-                bool IsLocal()
-                {
-                    return loc;
-                }
-
-                /*
-                    * Set local flag.
-                    *
-                    * @param loc Local flag.
-                    */
-                void SetLocal(bool loc)
-                {
-                    this->loc = loc;
-                }
-                
-                /*
-                 * Write query info to the stream.
-                 *
-                 * @param writer Writer.
-                 */
-                void Write(portable::PortableRawWriter& writer) const
-                {
-                    writer.WriteBool(loc);
-                    writer.WriteString(text);
-                    writer.WriteString(type);
-                    writer.WriteInt32(pageSize);
-                }
-
-            private:
-                /* Type name. */
-                std::string type;
-
-                /* Text string. */
-                std::string text;
-
-                /* Page size. */
-                int32_t pageSize;
-
-                /* Local flag. */
-                bool loc;
-            };
-        }
-    }    
-}
-
-#endif
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/src/main/cpp/core/include/ignite/guid.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/ignite/guid.h b/modules/platform/src/main/cpp/core/include/ignite/guid.h
deleted file mode 100644
index 9469769..0000000
--- a/modules/platform/src/main/cpp/core/include/ignite/guid.h
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef _IGNITE_GUID
-#define _IGNITE_GUID
-
-#include <stdint.h>
-
-#include <ignite/common/common.h>
-
-namespace ignite
-{
-    /**
-     * Global universally unique identifier (GUID).
-     */
-    class IGNITE_IMPORT_EXPORT Guid
-    {
-    public:
-        /**
-         * Default constructor.
-         */
-        Guid();
-
-        /**
-         * Constructor.
-         *
-         * @param most Most significant bits.
-         * @param least Least significant bits.
-         */
-        Guid(int64_t most, int64_t least);
-
-        /**
-         * Returns the most significant 64 bits of this instance.
-         *
-         * @return The most significant 64 bits of this instance.
-         */
-        int64_t GetMostSignificantBits() const;
-
-        /**
-         * Returns the least significant 64 bits of this instance.
-         *  
-         * @return The least significant 64 bits of this instance.
-         */
-        int64_t GetLeastSignificantBits() const;
-
-        /**
-         * The version number associated with this instance.  The version
-         * number describes how this Guid was generated.
-         *
-         * The version number has the following meaning:
-         * 1    Time-based UUID;
-         * 2    DCE security UUID;
-         * 3    Name-based UUID;
-         * 4    Randomly generated UUID.
-         *
-         * @return The version number of this instance.
-         */
-        int32_t GetVersion() const;
-
-        /**
-         * The variant number associated with this instance. The variant
-         * number describes the layout of the Guid.
-         *
-         * The variant number has the following meaning:
-         * 0    Reserved for NCS backward compatibility;
-         * 2    IETF RFC 4122 (Leach-Salz), used by this class;
-         * 6    Reserved, Microsoft Corporation backward compatibility;
-         * 7    Reserved for future definition.
-         *
-         * @return The variant number of this instance.
-         */
-        int32_t GetVariant() const;
-
-        /**
-         * Get hash code of this instance (used in serialization).
-         *
-         * @return Hash code.
-         */
-        int32_t GetHashCode() const;
-
-        /**
-         * Comparison operator override.
-         *
-         * @param val1 First value.
-         * @param val2 Second value.
-         * @return True if equal.
-         */
-        friend bool IGNITE_IMPORT_EXPORT operator== (Guid& val1, Guid& val2);
-    private:
-        /** Most significant bits. */
-        int64_t most;  
-
-        /** Least significant bits. */
-        int64_t least; 
-    };
-}
-
-#endif
\ No newline at end of file


[23/28] ignite git commit: IGNITE-1513: Moved CPP.

Posted by vo...@apache.org.
http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/core-test/src/portable_reader_writer_test.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/core-test/src/portable_reader_writer_test.cpp b/modules/platform/cpp/core-test/src/portable_reader_writer_test.cpp
new file mode 100644
index 0000000..aff929b
--- /dev/null
+++ b/modules/platform/cpp/core-test/src/portable_reader_writer_test.cpp
@@ -0,0 +1,1951 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _MSC_VER
+    #define BOOST_TEST_DYN_LINK
+#endif
+
+#include <boost/test/unit_test.hpp>
+
+#include "ignite/impl/interop/interop.h"
+#include "ignite/portable/portable.h"
+
+#include "ignite/portable_test_defs.h"
+#include "ignite/portable_test_utils.h"
+
+using namespace ignite;
+using namespace ignite::impl::interop;
+using namespace ignite::impl::portable;
+using namespace ignite::portable;
+using namespace ignite_test::core::portable;
+
+template<typename T>
+void CheckPrimitive(T val)
+{
+    TemplatedPortableIdResolver<PortableDummy> idRslvr;
+
+    InteropUnpooledMemory mem(1024);
+
+    InteropOutputStream out(&mem);
+    out.Position(18);
+
+    PortableWriterImpl writerImpl(&out, &idRslvr, NULL, NULL);
+    PortableWriter writer(&writerImpl);
+
+    try
+    {
+        Write<T>(writer, NULL, val);
+
+        BOOST_FAIL("Not restricted.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+
+    Write<T>(writer, "test", val);
+
+    out.Synchronize();
+
+    InteropInputStream in(&mem);
+
+    in.Position(18);
+
+    PortableReaderImpl readerImpl(&in, &idRslvr, 0, true, idRslvr.GetTypeId(), 0, 100, 100);
+    PortableReader reader(&readerImpl);
+
+    try
+    {
+        Read<T>(reader, NULL);
+
+        BOOST_FAIL("Not restricted.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+
+    T readVal = Read<T>(reader, "test");
+    
+    BOOST_REQUIRE(readVal == val);
+}
+
+template<typename T>
+void CheckPrimitiveArray(T dflt, T val1, T val2)
+{
+    const char* fieldName = "test";
+
+    TemplatedPortableIdResolver<PortableDummy> idRslvr;
+
+    InteropUnpooledMemory mem(1024);
+
+    InteropOutputStream out(&mem);
+    PortableWriterImpl writerImpl(&out, &idRslvr, NULL, NULL);
+    PortableWriter writer(&writerImpl);
+    
+    InteropInputStream in(&mem);
+    PortableReaderImpl readerImpl(&in, &idRslvr, 0, true, idRslvr.GetTypeId(), 0, 100, 100);
+    PortableReader reader(&readerImpl);
+
+    out.Position(18);
+
+    try
+    {
+        T nullFieldArr[2];
+
+        nullFieldArr[0] = val1;
+        nullFieldArr[1] = val2;
+
+        WriteArray<T>(writer, NULL, nullFieldArr, 2);
+
+        BOOST_FAIL("Not restricted.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+    
+    // 1. Write NULL and see what happens.
+    WriteArray<T>(writer, fieldName, NULL, 0);
+
+    out.Synchronize();
+    in.Synchronize();
+    
+    in.Position(18);
+    BOOST_REQUIRE(ReadArray<T>(reader, fieldName, NULL, 0) == -1);
+
+    in.Position(18);
+    BOOST_REQUIRE(ReadArray<T>(reader, fieldName, NULL, 2) == -1);
+
+    T arr1[2];
+    arr1[0] = dflt;
+    arr1[1] = dflt;
+
+    in.Position(18);
+    BOOST_REQUIRE(ReadArray<T>(reader, fieldName, arr1, 1) == -1);
+
+    BOOST_REQUIRE(arr1[0] == dflt);
+    BOOST_REQUIRE(arr1[1] == dflt);
+
+    // 2. Write empty array.
+    T arr2[2];
+    arr2[0] = val1;
+    arr2[1] = val2;
+
+    out.Position(18);
+    
+    WriteArray<T>(writer, fieldName, arr2, 0);
+
+    out.Synchronize();
+    in.Synchronize();
+
+    in.Position(18);
+    BOOST_REQUIRE(ReadArray<T>(reader, fieldName, NULL, 0) == 0);
+
+    in.Position(18);
+    BOOST_REQUIRE(ReadArray<T>(reader, fieldName, NULL, 2) == 0);
+
+    in.Position(18);
+    BOOST_REQUIRE(ReadArray<T>(reader, fieldName, arr1, 0) == 0);
+    BOOST_REQUIRE(arr1[0] == dflt);
+    BOOST_REQUIRE(arr1[1] == dflt);
+
+    in.Position(18);
+    BOOST_REQUIRE(ReadArray<T>(reader, fieldName, arr1, 2) == 0);
+    BOOST_REQUIRE(arr1[0] == dflt);
+    BOOST_REQUIRE(arr1[1] == dflt);
+
+    // 3. Partial array write.
+    out.Position(18);
+    
+    WriteArray<T>(writer, fieldName, arr2, 1);
+
+    out.Synchronize();
+    in.Synchronize();
+
+    in.Position(18);
+    BOOST_REQUIRE(ReadArray<T>(reader, fieldName, NULL, 0) == 1);
+    BOOST_REQUIRE(ReadArray<T>(reader, fieldName, NULL, 2) == 1);
+    BOOST_REQUIRE(ReadArray<T>(reader, fieldName, arr1, 0) == 1);
+    BOOST_REQUIRE(arr1[0] == dflt);
+    BOOST_REQUIRE(arr1[1] == dflt);
+
+    in.Position(18);
+    BOOST_REQUIRE(ReadArray<T>(reader, fieldName, arr1, 1) == 1);
+    BOOST_REQUIRE(arr1[0] == val1);
+    BOOST_REQUIRE(arr1[1] == dflt);
+    arr1[0] = dflt;
+
+    in.Position(18);
+    BOOST_REQUIRE(ReadArray<T>(reader, fieldName, arr1, 2) == 1);
+    BOOST_REQUIRE(arr1[0] == val1);
+    BOOST_REQUIRE(arr1[1] == dflt);
+    arr1[0] = dflt;
+
+    // 4. Full array write.
+    out.Position(18);
+    
+    WriteArray<T>(writer, fieldName, arr2, 2);
+
+    out.Synchronize();
+    in.Synchronize();
+
+    in.Position(18);
+    BOOST_REQUIRE(ReadArray<T>(reader, fieldName, NULL, 0) == 2);
+
+    in.Position(18);
+    BOOST_REQUIRE(ReadArray<T>(reader, fieldName, NULL, 2) == 2);
+
+    try
+    {
+        ReadArray<T>(reader, NULL, arr1, 2);
+
+        BOOST_FAIL("Not restricted.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+
+    BOOST_REQUIRE(ReadArray<T>(reader, fieldName, arr1, 0) == 2);
+    BOOST_REQUIRE(arr1[0] == dflt);
+    BOOST_REQUIRE(arr1[1] == dflt);
+
+    BOOST_REQUIRE(ReadArray<T>(reader, fieldName, arr1, 1) == 2);
+    BOOST_REQUIRE(arr1[0] == dflt);
+    BOOST_REQUIRE(arr1[1] == dflt);
+
+    BOOST_REQUIRE(ReadArray<T>(reader, fieldName, arr1, 2) == 2);
+    BOOST_REQUIRE(arr1[0] == val1);
+    BOOST_REQUIRE(arr1[1] == val2);
+}
+
+void CheckWritesRestricted(PortableWriter& writer)
+{
+    try
+    {
+        writer.WriteInt8("field", 1);
+
+        BOOST_FAIL("Not restricted.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+
+    try
+    {
+        int8_t arr[1];
+
+        writer.WriteInt8Array("field", arr, 1);
+
+        BOOST_FAIL("Not restricted.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+
+    try
+    {
+        Guid val(1, 1);
+
+        writer.WriteGuid("field", val);
+
+        BOOST_FAIL("Not restricted.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+
+    try
+    {
+        writer.WriteString("field", "test");
+
+        BOOST_FAIL("Not restricted.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+
+    try 
+    {
+        writer.WriteArray<int8_t>("field");
+
+        BOOST_FAIL("Not restricted.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+
+    try 
+    {
+        writer.WriteCollection<int8_t>("field");
+
+        BOOST_FAIL("Not restricted.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+
+    try 
+    {
+        writer.WriteMap<int8_t, int8_t>("field");
+
+        BOOST_FAIL("Not restricted.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+}
+
+void CheckReadsRestricted(PortableReader& reader)
+{
+    try
+    {
+        reader.ReadInt8("field");
+
+        BOOST_FAIL("Not restricted.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+
+    try
+    {
+        int8_t arr[1];
+
+        reader.ReadInt8Array("field", arr, 1);
+
+        BOOST_FAIL("Not restricted.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+
+    try
+    {
+        reader.ReadGuid("field");
+
+        BOOST_FAIL("Not restricted.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+
+    try
+    {
+        reader.ReadString("field");
+
+        BOOST_FAIL("Not restricted.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+
+    try
+    {
+        reader.ReadArray<int8_t>("field");
+
+        BOOST_FAIL("Not restricted.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+
+    try
+    {
+        reader.ReadCollection<int8_t>("field");
+
+        BOOST_FAIL("Not restricted.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+
+    try
+    {
+        reader.ReadMap<int8_t, int8_t>("field");
+
+        BOOST_FAIL("Not restricted.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+}
+
+void CheckCollectionEmpty(CollectionType* colType)
+{
+    TemplatedPortableIdResolver<PortableDummy> idRslvr;
+
+    InteropUnpooledMemory mem(1024);
+
+    InteropOutputStream out(&mem);
+    PortableWriterImpl writerImpl(&out, &idRslvr, NULL, NULL);
+    PortableWriter writer(&writerImpl);
+
+    out.Position(18);
+
+    PortableCollectionWriter<PortableInner> colWriter = colType ?
+        writer.WriteCollection<PortableInner>("field1", *colType) : writer.WriteCollection<PortableInner>("field1");
+
+    CheckWritesRestricted(writer);
+
+    colWriter.Close();
+
+    writer.WriteInt8("field2", 1);
+
+    try
+    {
+        colWriter.Write(1);
+
+        BOOST_FAIL("Error expected.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+
+    try
+    {
+        colWriter.Close();
+
+        BOOST_FAIL("Error expected.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+
+    out.Synchronize();
+
+    InteropInputStream in(&mem);
+    PortableReaderImpl readerImpl(&in, &idRslvr, 0, true, idRslvr.GetTypeId(), 0, 1000, 1000);
+    PortableReader reader(&readerImpl);
+
+    in.Position(18);
+
+    PortableCollectionReader<PortableInner> colReader = reader.ReadCollection<PortableInner>("field1");
+
+    if (colType)
+        BOOST_REQUIRE(colReader.GetType() == *colType);
+    else
+        BOOST_REQUIRE(colReader.GetType() == IGNITE_COLLECTION_UNDEFINED);
+
+    BOOST_REQUIRE(colReader.GetSize() == 0);
+    BOOST_REQUIRE(!colReader.HasNext());
+    BOOST_REQUIRE(!colReader.IsNull());
+
+    try
+    {
+        colReader.GetNext();
+
+        BOOST_FAIL("Error expected.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+
+    BOOST_REQUIRE(reader.ReadInt8("field2") == 1);
+}
+
+void CheckCollection(CollectionType* colType)
+{
+    PortableInner writeVal1 = PortableInner(1);
+    PortableInner writeVal2 = PortableInner(0);
+    PortableInner writeVal3 = PortableInner(2);
+
+    TemplatedPortableIdResolver<PortableDummy> idRslvr;
+
+    InteropUnpooledMemory mem(1024);
+
+    InteropOutputStream out(&mem);
+    PortableWriterImpl writerImpl(&out, &idRslvr, NULL, NULL);
+    PortableWriter writer(&writerImpl);
+
+    out.Position(18);
+
+    PortableCollectionWriter<PortableInner> colWriter = colType ?
+        writer.WriteCollection<PortableInner>("field1", *colType) : writer.WriteCollection<PortableInner>("field1");
+
+    colWriter.Write(writeVal1);
+    colWriter.Write(writeVal2);
+    colWriter.Write(writeVal3);
+
+    CheckWritesRestricted(writer);
+
+    colWriter.Close();
+
+    writer.WriteInt8("field2", 1);
+
+    try
+    {
+        colWriter.Write(1);
+
+        BOOST_FAIL("Error expected.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+
+    try
+    {
+        colWriter.Close();
+
+        BOOST_FAIL("Error expected.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+
+    out.Synchronize();
+
+    InteropInputStream in(&mem);
+    PortableReaderImpl readerImpl(&in, &idRslvr, 0, true, idRslvr.GetTypeId(), 0, 1000, 1000);
+    PortableReader reader(&readerImpl);
+
+    in.Position(18);
+
+    PortableCollectionReader<PortableInner> colReader = reader.ReadCollection<PortableInner>("field1");
+
+    CheckReadsRestricted(reader);
+
+    if (colType)
+        BOOST_REQUIRE(colReader.GetType() == *colType);
+    else
+        BOOST_REQUIRE(colReader.GetType() == IGNITE_COLLECTION_UNDEFINED);
+
+    BOOST_REQUIRE(colReader.GetSize() == 3);
+    BOOST_REQUIRE(!colReader.IsNull());
+
+    BOOST_REQUIRE(colReader.HasNext());
+    BOOST_REQUIRE(colReader.GetNext().GetValue() == writeVal1.GetValue());
+
+    BOOST_REQUIRE(colReader.HasNext());
+    BOOST_REQUIRE(colReader.GetNext().GetValue() == writeVal2.GetValue());
+
+    BOOST_REQUIRE(colReader.HasNext());
+    BOOST_REQUIRE(colReader.GetNext().GetValue() == writeVal3.GetValue());
+
+    BOOST_REQUIRE(!colReader.HasNext());
+
+    try
+    {
+        colReader.GetNext();
+
+        BOOST_FAIL("Error expected.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+
+    BOOST_REQUIRE(reader.ReadInt8("field2") == 1);
+}
+
+void CheckMapEmpty(MapType* mapType)
+{
+    TemplatedPortableIdResolver<PortableDummy> idRslvr;
+
+    InteropUnpooledMemory mem(1024);
+
+    InteropOutputStream out(&mem);
+    PortableWriterImpl writerImpl(&out, &idRslvr, NULL, NULL);
+    PortableWriter writer(&writerImpl);
+
+    out.Position(18);
+
+    PortableMapWriter<int8_t, PortableInner> mapWriter = mapType ?
+        writer.WriteMap<int8_t, PortableInner>("field1", *mapType) : writer.WriteMap<int8_t, PortableInner>("field1");
+
+    CheckWritesRestricted(writer);
+
+    mapWriter.Close();
+
+    writer.WriteInt8("field2", 1);
+
+    try
+    {
+        mapWriter.Write(1, PortableInner(1));
+
+        BOOST_FAIL("Error expected.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+
+    try
+    {
+        mapWriter.Close();
+
+        BOOST_FAIL("Error expected.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+
+    out.Synchronize();
+
+    InteropInputStream in(&mem);
+    PortableReaderImpl readerImpl(&in, &idRslvr, 0, true, idRslvr.GetTypeId(), 0, 1000, 1000);
+    PortableReader reader(&readerImpl);
+
+    in.Position(18);
+
+    PortableMapReader<int8_t, PortableInner> mapReader = reader.ReadMap<int8_t, PortableInner>("field1");
+
+    if (mapType)
+        BOOST_REQUIRE(mapReader.GetType() == *mapType);
+    else
+        BOOST_REQUIRE(mapReader.GetType() == IGNITE_MAP_UNDEFINED);
+
+    BOOST_REQUIRE(mapReader.GetSize() == 0);
+    BOOST_REQUIRE(!mapReader.HasNext());
+    BOOST_REQUIRE(!mapReader.IsNull());
+
+    try
+    {
+        int8_t key;
+        PortableInner val;
+
+        mapReader.GetNext(&key, &val);
+
+        BOOST_FAIL("Error expected.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+
+    BOOST_REQUIRE(reader.ReadInt8("field2") == 1);
+}
+
+void CheckMap(MapType* mapType)
+{
+    PortableInner writeVal1 = PortableInner(1);
+    PortableInner writeVal2 = PortableInner(0);
+    PortableInner writeVal3 = PortableInner(2);
+
+    TemplatedPortableIdResolver<PortableDummy> idRslvr;
+
+    InteropUnpooledMemory mem(1024);
+
+    InteropOutputStream out(&mem);
+    PortableWriterImpl writerImpl(&out, &idRslvr, NULL, NULL);
+    PortableWriter writer(&writerImpl);
+
+    out.Position(18);
+
+    PortableMapWriter<int8_t, PortableInner> mapWriter = mapType ?
+        writer.WriteMap<int8_t, PortableInner>("field1", *mapType) : writer.WriteMap<int8_t, PortableInner>("field1");
+
+    mapWriter.Write(1, writeVal1);
+    mapWriter.Write(2, writeVal2);
+    mapWriter.Write(3, writeVal3);
+
+    CheckWritesRestricted(writer);
+
+    mapWriter.Close();
+
+    writer.WriteInt8("field2", 1);
+
+    try
+    {
+        mapWriter.Write(4, PortableInner(4));
+
+        BOOST_FAIL("Error expected.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+
+    try
+    {
+        mapWriter.Close();
+
+        BOOST_FAIL("Error expected.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+
+    out.Synchronize();
+
+    InteropInputStream in(&mem);
+    PortableReaderImpl readerImpl(&in, &idRslvr, 0, true, idRslvr.GetTypeId(), 0, 1000, 1000);
+    PortableReader reader(&readerImpl);
+
+    in.Position(18);
+
+    PortableMapReader<int8_t, PortableInner> mapReader = reader.ReadMap<int8_t, PortableInner>("field1");
+
+    CheckReadsRestricted(reader);
+
+    if (mapType)
+        BOOST_REQUIRE(mapReader.GetType() == *mapType);
+    else
+        BOOST_REQUIRE(mapReader.GetType() == IGNITE_MAP_UNDEFINED);
+
+    BOOST_REQUIRE(mapReader.GetSize() == 3);
+    BOOST_REQUIRE(!mapReader.IsNull());
+
+    int8_t key;
+    PortableInner val;
+
+    BOOST_REQUIRE(mapReader.HasNext());
+
+    mapReader.GetNext(&key, &val);
+    BOOST_REQUIRE(key == 1);
+    BOOST_REQUIRE(val.GetValue() == writeVal1.GetValue());
+
+    mapReader.GetNext(&key, &val);
+    BOOST_REQUIRE(key == 2);
+    BOOST_REQUIRE(val.GetValue() == writeVal2.GetValue());
+
+    mapReader.GetNext(&key, &val);
+    BOOST_REQUIRE(key == 3);
+    BOOST_REQUIRE(val.GetValue() == writeVal3.GetValue());
+
+    BOOST_REQUIRE(!mapReader.HasNext());
+
+    try
+    {
+        mapReader.GetNext(&key, &val);
+
+        BOOST_FAIL("Error expected.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+
+    BOOST_REQUIRE(reader.ReadInt8("field2") == 1);
+}
+
+BOOST_AUTO_TEST_SUITE(PortableReaderWriterTestSuite)
+
+BOOST_AUTO_TEST_CASE(TestPrimitiveInt8)
+{
+    CheckPrimitive<int8_t>(1);
+}
+
+BOOST_AUTO_TEST_CASE(TestPrimitiveBool)
+{
+    CheckPrimitive<bool>(true);
+}
+
+BOOST_AUTO_TEST_CASE(TestPrimitiveInt16)
+{
+    CheckPrimitive<int16_t>(1);
+}
+
+BOOST_AUTO_TEST_CASE(TestPrimitiveUInt16)
+{
+    CheckPrimitive<uint16_t>(1);
+}
+
+BOOST_AUTO_TEST_CASE(TestPrimitiveInt32)
+{
+    CheckPrimitive<int32_t>(1);
+}
+
+BOOST_AUTO_TEST_CASE(TestPrimitiveInt64)
+{
+    CheckPrimitive<int64_t>(1);
+}
+
+BOOST_AUTO_TEST_CASE(TestPrimitiveFloat)
+{
+    CheckPrimitive<float>(1.1f);
+}
+
+BOOST_AUTO_TEST_CASE(TestPrimitiveDouble)
+{
+    CheckPrimitive<double>(1.1);
+}
+
+BOOST_AUTO_TEST_CASE(TestPrimitiveGuid)
+{
+    Guid val(1, 2);
+
+    CheckPrimitive<Guid>(val);
+}
+
+BOOST_AUTO_TEST_CASE(TestPrimitiveArrayInt8)
+{
+    CheckPrimitiveArray<int8_t>(1, 2, 3);
+}
+
+BOOST_AUTO_TEST_CASE(TestPrimitiveArrayBool)
+{
+    CheckPrimitiveArray<bool>(false, true, false);
+}
+
+BOOST_AUTO_TEST_CASE(TestPrimitiveArrayInt16)
+{
+    CheckPrimitiveArray<int16_t>(1, 2, 3);
+}
+
+BOOST_AUTO_TEST_CASE(TestPrimitiveArrayUInt16)
+{
+    CheckPrimitiveArray<uint16_t>(1, 2, 3);
+}
+
+BOOST_AUTO_TEST_CASE(TestPrimitiveArrayInt32)
+{
+    CheckPrimitiveArray<int32_t>(1, 2, 3);
+}
+
+BOOST_AUTO_TEST_CASE(TestPrimitiveArrayInt64)
+{
+    CheckPrimitiveArray<int64_t>(1, 2, 3);
+}
+
+BOOST_AUTO_TEST_CASE(TestPrimitiveArrayFloat)
+{
+    CheckPrimitiveArray<float>(1.1f, 2.2f, 3.3f);
+}
+
+BOOST_AUTO_TEST_CASE(TestPrimitiveArrayDouble)
+{
+    CheckPrimitiveArray<double>(1.1, 2.2, 3.3);
+}
+
+BOOST_AUTO_TEST_CASE(TestPrimitiveArrayGuid)
+{
+    Guid dflt(1, 2);
+    Guid val1(3, 4);
+    Guid val2(5, 6);
+
+    CheckPrimitiveArray<Guid>(dflt, val1, val2);
+}
+
+BOOST_AUTO_TEST_CASE(TestGuidNull)
+{
+    TemplatedPortableIdResolver<PortableDummy> idRslvr;
+
+    InteropUnpooledMemory mem(1024);
+
+    InteropOutputStream out(&mem);
+    PortableWriterImpl writerImpl(&out, &idRslvr, NULL, NULL);
+    PortableWriter writer(&writerImpl);
+
+    out.Position(18);
+
+    try
+    {
+        writer.WriteNull(NULL);
+
+        BOOST_FAIL("Not restricted.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+
+    writer.WriteNull("test");
+
+    out.Synchronize();
+
+    InteropInputStream in(&mem);
+    PortableReaderImpl readerImpl(&in, &idRslvr, 0, true, idRslvr.GetTypeId(), 0, 100, 100);
+    PortableReader reader(&readerImpl);
+    
+    in.Position(18);
+
+    try
+    {
+        reader.ReadGuid(NULL);
+
+        BOOST_FAIL("Not restricted.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+
+    Guid expVal;
+    Guid actualVal = reader.ReadGuid("test");
+
+    BOOST_REQUIRE(actualVal == expVal);
+}
+
+BOOST_AUTO_TEST_CASE(TestString) {
+    TemplatedPortableIdResolver<PortableDummy> idRslvr;
+
+    InteropUnpooledMemory mem(1024);
+
+    InteropOutputStream out(&mem);
+    PortableWriterImpl writerImpl(&out, &idRslvr, NULL, NULL);
+    PortableWriter writer(&writerImpl);
+
+    out.Position(18);
+
+    const char* writeVal1 = "testtest";
+    const char* writeVal2 = "test";
+    std::string writeVal3 = writeVal1;
+
+    try
+    {
+        writer.WriteString(NULL, writeVal1);
+
+        BOOST_FAIL("Not restricted.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+
+    try
+    {
+        writer.WriteString(NULL, writeVal1, 4);
+
+        BOOST_FAIL("Not restricted.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+
+    try
+    {
+        writer.WriteString(NULL, writeVal3);
+
+        BOOST_FAIL("Not restricted.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+
+    writer.WriteString("field1", writeVal1);
+    writer.WriteString("field2", writeVal1, 4);
+    writer.WriteString("field3", writeVal3);
+    writer.WriteString("field4", NULL);
+    writer.WriteString("field5", NULL, 4);
+
+    out.Synchronize();
+
+    InteropInputStream in(&mem);
+    PortableReaderImpl readerImpl(&in, &idRslvr, 0, true, idRslvr.GetTypeId(), 0, 1000, 1000);
+    PortableReader reader(&readerImpl);
+
+    in.Position(18);
+
+    try
+    {
+        char nullCheckRes[9];
+
+        reader.ReadString(NULL, nullCheckRes, 9);
+
+        BOOST_FAIL("Not restricted.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+
+    try
+    {
+        reader.ReadString(NULL);
+
+        BOOST_FAIL("Not restricted.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+
+    char readVal1[9];
+    char readVal2[5];
+    
+    BOOST_REQUIRE(reader.ReadString("field1", NULL, 0) == 8);
+    BOOST_REQUIRE(reader.ReadString("field1", NULL, 8) == 8);
+    BOOST_REQUIRE(reader.ReadString("field1", readVal1, 0) == 8);
+    BOOST_REQUIRE(reader.ReadString("field1", readVal1, 4) == 8);
+
+    BOOST_REQUIRE(reader.ReadString("field1", readVal1, 9) == 8);
+    std::string writeVal1Str = writeVal1;
+    std::string readVal1Str = readVal1;
+    BOOST_REQUIRE(readVal1Str.compare(writeVal1Str) == 0);
+
+    BOOST_REQUIRE(reader.ReadString("field2", readVal2, 5) == 4);
+    std::string writeVal2Str = writeVal2;
+    std::string readVal2Str = readVal2;
+    BOOST_REQUIRE(readVal2Str.compare(writeVal2Str) == 0);
+
+    std::string readVal3 = reader.ReadString("field3");
+    BOOST_REQUIRE(readVal3.compare(writeVal3) == 0);
+
+    BOOST_REQUIRE(reader.ReadString("field4", readVal1, 9) == -1);
+    BOOST_REQUIRE(reader.ReadString("field5", readVal1, 9) == -1);
+}
+
+BOOST_AUTO_TEST_CASE(TestStringArrayNull)
+{
+    TemplatedPortableIdResolver<PortableDummy> idRslvr;
+
+    InteropUnpooledMemory mem(1024);
+
+    InteropOutputStream out(&mem);
+    PortableWriterImpl writerImpl(&out, &idRslvr, NULL, NULL);
+    PortableWriter writer(&writerImpl);
+
+    out.Position(18);
+
+    writer.WriteNull("field1");
+    writer.WriteInt8("field2", 1);
+
+    out.Synchronize();
+
+    InteropInputStream in(&mem);
+    PortableReaderImpl readerImpl(&in, &idRslvr, 0, true, idRslvr.GetTypeId(), 0, 1000, 1000);
+    PortableReader reader(&readerImpl);
+
+    in.Position(18);
+
+    PortableStringArrayReader arrReader = reader.ReadStringArray("field1");
+
+    BOOST_REQUIRE(arrReader.GetSize() == -1);
+    BOOST_REQUIRE(!arrReader.HasNext());
+    BOOST_REQUIRE(arrReader.IsNull());
+
+    try
+    {
+        char res[100];
+
+        arrReader.GetNext(res, 100);
+
+        BOOST_FAIL("Error expected.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+
+    try
+    {
+        arrReader.GetNext();
+
+        BOOST_FAIL("Error expected.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+
+    BOOST_REQUIRE(reader.ReadInt8("field2") == 1);
+}
+
+BOOST_AUTO_TEST_CASE(TestStringArrayEmpty)
+{
+    TemplatedPortableIdResolver<PortableDummy> idRslvr;
+
+    InteropUnpooledMemory mem(1024);
+
+    InteropOutputStream out(&mem);
+    PortableWriterImpl writerImpl(&out, &idRslvr, NULL, NULL);
+    PortableWriter writer(&writerImpl);
+
+    out.Position(18);
+
+    PortableStringArrayWriter arrWriter = writer.WriteStringArray("field1");
+    
+    CheckWritesRestricted(writer);
+
+    arrWriter.Close();
+
+    writer.WriteInt8("field2", 1);
+
+    try
+    {
+        const char* val = "test";
+
+        arrWriter.Write(val, 4);
+
+        BOOST_FAIL("Error expected.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+
+    try
+    {
+        const char* val = "test";
+
+        arrWriter.Write(val);
+
+        BOOST_FAIL("Error expected.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+
+    try
+    {
+        std::string val = "test";
+
+        arrWriter.Write(val);
+
+        BOOST_FAIL("Error expected.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+
+    try
+    {
+        arrWriter.Close();
+
+        BOOST_FAIL("Error expected.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+
+    out.Synchronize();
+
+    InteropInputStream in(&mem);
+    PortableReaderImpl readerImpl(&in, &idRslvr, 0, true, idRslvr.GetTypeId(), 0, 1000, 1000);
+    PortableReader reader(&readerImpl);
+
+    in.Position(18);
+
+    PortableStringArrayReader arrReader = reader.ReadStringArray("field1");
+
+    BOOST_REQUIRE(arrReader.GetSize() == 0);
+    BOOST_REQUIRE(!arrReader.HasNext());
+    BOOST_REQUIRE(!arrReader.IsNull());
+
+    try
+    {
+        char res[100];
+
+        arrReader.GetNext(res, 100);
+
+        BOOST_FAIL("Error expected.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+
+    try
+    {
+        arrReader.GetNext();
+
+        BOOST_FAIL("Error expected.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+
+    BOOST_REQUIRE(reader.ReadInt8("field2") == 1);
+}
+
+BOOST_AUTO_TEST_CASE(TestStringArray)
+{
+    const char* writeVal1 = "testtest";
+    const char* writeVal2 = "test";
+    std::string writeVal3 = "test2";
+
+    TemplatedPortableIdResolver<PortableDummy> idRslvr;
+
+    InteropUnpooledMemory mem(1024);
+
+    InteropOutputStream out(&mem);
+    PortableWriterImpl writerImpl(&out, &idRslvr, NULL, NULL);
+    PortableWriter writer(&writerImpl);
+
+    out.Position(18);
+
+    PortableStringArrayWriter arrWriter = writer.WriteStringArray("field1");
+
+    arrWriter.Write(writeVal1);
+    arrWriter.Write(writeVal1, 4);
+    arrWriter.Write(NULL); // NULL value.
+    arrWriter.Write(NULL, 100); // NULL value again.
+    arrWriter.Write(writeVal3);
+
+    CheckWritesRestricted(writer);
+
+    arrWriter.Close();
+
+    writer.WriteInt8("field2", 1);
+
+    try
+    {
+        const char* val = "test";
+
+        arrWriter.Write(val, 4);
+
+        BOOST_FAIL("Error expected.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+
+    try
+    {
+        const char* val = "test";
+
+        arrWriter.Write(val);
+
+        BOOST_FAIL("Error expected.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+
+    try
+    {
+        std::string val = "test";
+
+        arrWriter.Write(val);
+
+        BOOST_FAIL("Error expected.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+
+    try
+    {
+        arrWriter.Close();
+
+        BOOST_FAIL("Error expected.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+
+    out.Synchronize();
+
+    InteropInputStream in(&mem);
+    PortableReaderImpl readerImpl(&in, &idRslvr, 0, true, idRslvr.GetTypeId(), 0, 1000, 1000);
+    PortableReader reader(&readerImpl);
+
+    in.Position(18);
+
+    PortableStringArrayReader arrReader = reader.ReadStringArray("field1");
+
+    CheckReadsRestricted(reader);
+
+    BOOST_REQUIRE(arrReader.GetSize() == 5);
+    BOOST_REQUIRE(!arrReader.IsNull());
+
+    // 1. Read first value.
+    BOOST_REQUIRE(arrReader.HasNext());
+        
+    char readVal1[9];
+    
+    BOOST_REQUIRE(arrReader.GetNext(NULL, 0) == 8);
+    BOOST_REQUIRE(arrReader.GetNext(NULL, 8) == 8);
+    BOOST_REQUIRE(arrReader.GetNext(readVal1, 0) == 8);
+    BOOST_REQUIRE(arrReader.GetNext(readVal1, 4) == 8);
+
+    BOOST_REQUIRE(arrReader.GetNext(readVal1, 9) == 8);
+    std::string writeVal1Str = writeVal1;
+    std::string readVal1Str = readVal1;
+    BOOST_REQUIRE(readVal1Str.compare(writeVal1Str) == 0);
+
+    // 2. Read second value.
+    BOOST_REQUIRE(arrReader.HasNext());
+
+    char readVal2[5];
+
+    BOOST_REQUIRE(arrReader.GetNext(readVal2, 5) == 4);
+    std::string writeVal2Str = writeVal2;
+    std::string readVal2Str = readVal2;
+    BOOST_REQUIRE(readVal2Str.compare(writeVal2Str) == 0);
+
+    // 3. Read NULL.
+    BOOST_REQUIRE(arrReader.HasNext());
+
+    BOOST_REQUIRE(arrReader.GetNext(readVal1, 4) == -1);
+    readVal1Str = readVal1;
+    BOOST_REQUIRE(readVal1Str.compare(writeVal1Str) == 0);
+
+    // 4. Read NULL again, this time through another method.
+    BOOST_REQUIRE(arrReader.HasNext());
+
+    std::string readNullVal = arrReader.GetNext();
+
+    BOOST_REQUIRE(readNullVal.length() == 0);
+
+    // 5. Read third value.
+    BOOST_REQUIRE(arrReader.HasNext());
+
+    std::string readVal3 = arrReader.GetNext();
+    BOOST_REQUIRE(readVal3.compare(writeVal3) == 0);
+
+    BOOST_REQUIRE(!arrReader.HasNext());
+
+    try
+    {
+        char res[100];
+
+        arrReader.GetNext(res, 100);
+
+        BOOST_FAIL("Error expected.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+
+    try
+    {
+        arrReader.GetNext();
+
+        BOOST_FAIL("Error expected.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+
+    BOOST_REQUIRE(reader.ReadInt8("field2") == 1);
+}
+
+BOOST_AUTO_TEST_CASE(TestObject)
+{
+    PortableInner writeVal1(1);
+    PortableInner writeVal2(0);
+
+    TemplatedPortableIdResolver<PortableDummy> idRslvr;
+
+    InteropUnpooledMemory mem(1024);
+
+    InteropOutputStream out(&mem);
+    PortableWriterImpl writerImpl(&out, &idRslvr, NULL, NULL);
+    PortableWriter writer(&writerImpl);
+
+    out.Position(18);
+
+    writer.WriteObject("field1", writeVal1);
+    writer.WriteObject("field2", writeVal2);
+    writer.WriteNull("field3");
+
+    out.Synchronize();
+
+    InteropInputStream in(&mem);
+    PortableReaderImpl readerImpl(&in, &idRslvr, 0, true, idRslvr.GetTypeId(), 0, 1000, 1000);
+    PortableReader reader(&readerImpl);
+
+    in.Position(18);
+
+    PortableInner readVal1 = reader.ReadObject<PortableInner>("field1");
+    BOOST_REQUIRE(writeVal1.GetValue() == readVal1.GetValue());
+
+    PortableInner readVal2 = reader.ReadObject<PortableInner>("field2");
+    BOOST_REQUIRE(writeVal2.GetValue() == readVal2.GetValue());
+
+    PortableInner readVal3 = reader.ReadObject<PortableInner>("field3");
+    BOOST_REQUIRE(0 == readVal3.GetValue());
+}
+
+BOOST_AUTO_TEST_CASE(TestNestedObject)
+{
+    PortableOuter writeVal1(1, 2);
+    PortableOuter writeVal2(0, 0);
+
+    TemplatedPortableIdResolver<PortableDummy> idRslvr;
+
+    InteropUnpooledMemory mem(1024);
+
+    InteropOutputStream out(&mem);
+    PortableWriterImpl writerImpl(&out, &idRslvr, NULL, NULL);
+    PortableWriter writer(&writerImpl);
+
+    out.Position(18);
+
+    writer.WriteObject("field1", writeVal1);
+    writer.WriteObject("field2", writeVal2);
+    writer.WriteNull("field3");
+
+    out.Synchronize();
+
+    InteropInputStream in(&mem);
+    PortableReaderImpl readerImpl(&in, &idRslvr, 0, true, idRslvr.GetTypeId(), 0, 1000, 1000);
+    PortableReader reader(&readerImpl);
+
+    in.Position(18);
+
+    PortableOuter readVal1 = reader.ReadObject<PortableOuter>("field1");
+    BOOST_REQUIRE(writeVal1.GetValue() == readVal1.GetValue());
+    BOOST_REQUIRE(writeVal1.GetInner().GetValue() == readVal1.GetInner().GetValue());
+
+    PortableOuter readVal2 = reader.ReadObject<PortableOuter>("field2");
+    BOOST_REQUIRE(writeVal2.GetValue() == readVal2.GetValue());
+    BOOST_REQUIRE(writeVal2.GetInner().GetValue() == readVal2.GetInner().GetValue());
+
+    PortableOuter readVal3 = reader.ReadObject<PortableOuter>("field3");
+    BOOST_REQUIRE(0 == readVal3.GetValue());
+    BOOST_REQUIRE(0 == readVal3.GetInner().GetValue());
+}
+
+BOOST_AUTO_TEST_CASE(TestArrayNull)
+{
+    TemplatedPortableIdResolver<PortableDummy> idRslvr;
+
+    InteropUnpooledMemory mem(1024);
+
+    InteropOutputStream out(&mem);
+    PortableWriterImpl writerImpl(&out, &idRslvr, NULL, NULL);
+    PortableWriter writer(&writerImpl);
+
+    out.Position(18);
+
+    writer.WriteNull("field1");
+    writer.WriteInt8("field2", 1);
+
+    out.Synchronize();
+
+    InteropInputStream in(&mem);
+    PortableReaderImpl readerImpl(&in, &idRslvr, 0, true, idRslvr.GetTypeId(), 0, 1000, 1000);
+    PortableReader reader(&readerImpl);
+
+    in.Position(18);
+
+    PortableArrayReader<PortableInner> arrReader = reader.ReadArray<PortableInner>("field1");
+
+    BOOST_REQUIRE(arrReader.GetSize() == -1);
+    BOOST_REQUIRE(!arrReader.HasNext());
+    BOOST_REQUIRE(arrReader.IsNull());
+
+    try
+    {
+        arrReader.GetNext();
+
+        BOOST_FAIL("Error expected.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+
+    BOOST_REQUIRE(reader.ReadInt8("field2") == 1);
+}
+
+BOOST_AUTO_TEST_CASE(TestArrayEmpty) 
+{
+    TemplatedPortableIdResolver<PortableDummy> idRslvr;
+
+    InteropUnpooledMemory mem(1024);
+
+    InteropOutputStream out(&mem);
+    PortableWriterImpl writerImpl(&out, &idRslvr, NULL, NULL);
+    PortableWriter writer(&writerImpl);
+
+    out.Position(18);
+
+    PortableArrayWriter<PortableInner> arrWriter = writer.WriteArray<PortableInner>("field1");
+
+    CheckWritesRestricted(writer);
+
+    arrWriter.Close();
+
+    writer.WriteInt8("field2", 1);
+
+    try
+    {
+        arrWriter.Write(1);
+
+        BOOST_FAIL("Error expected.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+
+    try
+    {
+        arrWriter.Close();
+
+        BOOST_FAIL("Error expected.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+
+    out.Synchronize();
+
+    InteropInputStream in(&mem);
+    PortableReaderImpl readerImpl(&in, &idRslvr, 0, true, idRslvr.GetTypeId(), 0, 1000, 1000);
+    PortableReader reader(&readerImpl);
+
+    in.Position(18);
+
+    PortableArrayReader<PortableInner> arrReader = reader.ReadArray<PortableInner>("field1");
+
+    BOOST_REQUIRE(arrReader.GetSize() == 0);
+    BOOST_REQUIRE(!arrReader.HasNext());
+    BOOST_REQUIRE(!arrReader.IsNull());
+
+    try
+    {
+        arrReader.GetNext();
+
+        BOOST_FAIL("Error expected.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+
+    BOOST_REQUIRE(reader.ReadInt8("field2") == 1);
+}
+
+BOOST_AUTO_TEST_CASE(TestArray)
+{
+    PortableInner writeVal1 = PortableInner(1);
+    PortableInner writeVal2 = PortableInner(0);
+    PortableInner writeVal3 = PortableInner(2);
+
+    TemplatedPortableIdResolver<PortableDummy> idRslvr;
+
+    InteropUnpooledMemory mem(1024);
+
+    InteropOutputStream out(&mem);
+    PortableWriterImpl writerImpl(&out, &idRslvr, NULL, NULL);
+    PortableWriter writer(&writerImpl);
+
+    out.Position(18);
+
+    PortableArrayWriter<PortableInner> arrWriter = writer.WriteArray<PortableInner>("field1");
+
+    arrWriter.Write(writeVal1); 
+    arrWriter.Write(writeVal2);
+    arrWriter.Write(writeVal3);
+
+    CheckWritesRestricted(writer);
+
+    arrWriter.Close();
+
+    writer.WriteInt8("field2", 1);
+
+    try
+    {
+        arrWriter.Write(1);
+
+        BOOST_FAIL("Error expected.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+
+    try
+    {
+        arrWriter.Close();
+
+        BOOST_FAIL("Error expected.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+
+    out.Synchronize();
+
+    InteropInputStream in(&mem);
+    PortableReaderImpl readerImpl(&in, &idRslvr, 0, true, idRslvr.GetTypeId(), 0, 1000, 1000);
+    PortableReader reader(&readerImpl);
+
+    in.Position(18);
+
+    PortableArrayReader<PortableInner> arrReader = reader.ReadArray<PortableInner>("field1");
+
+    CheckReadsRestricted(reader);
+
+    BOOST_REQUIRE(arrReader.GetSize() == 3);
+    BOOST_REQUIRE(!arrReader.IsNull());
+
+    BOOST_REQUIRE(arrReader.HasNext());
+    BOOST_REQUIRE(arrReader.GetNext().GetValue() == writeVal1.GetValue());
+
+    BOOST_REQUIRE(arrReader.HasNext());
+    BOOST_REQUIRE(arrReader.GetNext().GetValue() == writeVal2.GetValue());
+
+    BOOST_REQUIRE(arrReader.HasNext());
+    BOOST_REQUIRE(arrReader.GetNext().GetValue() == writeVal3.GetValue());
+
+    BOOST_REQUIRE(!arrReader.HasNext());
+
+    try
+    {
+        arrReader.GetNext();
+
+        BOOST_FAIL("Error expected.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+
+    BOOST_REQUIRE(reader.ReadInt8("field2") == 1);
+}
+
+BOOST_AUTO_TEST_CASE(TestCollectionNull)
+{
+    TemplatedPortableIdResolver<PortableDummy> idRslvr;
+
+    InteropUnpooledMemory mem(1024);
+
+    InteropOutputStream out(&mem);
+    PortableWriterImpl writerImpl(&out, &idRslvr, NULL, NULL);
+    PortableWriter writer(&writerImpl);
+
+    out.Position(18);
+
+    writer.WriteNull("field1");
+    writer.WriteInt8("field2", 1);
+
+    out.Synchronize();
+
+    InteropInputStream in(&mem);
+    PortableReaderImpl readerImpl(&in, &idRslvr, 0, true, idRslvr.GetTypeId(), 0, 1000, 1000);
+    PortableReader reader(&readerImpl);
+
+    in.Position(18);
+
+    PortableCollectionReader<PortableInner> colReader = reader.ReadCollection<PortableInner>("field1");
+
+    BOOST_REQUIRE(colReader.GetType() == IGNITE_COLLECTION_UNDEFINED);
+    BOOST_REQUIRE(colReader.GetSize() == -1);
+    BOOST_REQUIRE(!colReader.HasNext());
+    BOOST_REQUIRE(colReader.IsNull()); 
+
+    try
+    {
+        colReader.GetNext();
+
+        BOOST_FAIL("Error expected.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+
+    BOOST_REQUIRE(reader.ReadInt8("field2") == 1);
+}
+
+BOOST_AUTO_TEST_CASE(TestCollectionEmpty)
+{
+    CheckCollectionEmpty(NULL);
+}
+
+BOOST_AUTO_TEST_CASE(TestCollectionEmptyTyped)
+{
+    CollectionType typ = IGNITE_COLLECTION_CONCURRENT_SKIP_LIST_SET;
+
+    CheckCollectionEmpty(&typ);
+}
+
+BOOST_AUTO_TEST_CASE(TestCollection)
+{
+    CheckCollection(NULL);
+}
+
+BOOST_AUTO_TEST_CASE(testCollectionTyped)
+{
+    CollectionType typ = IGNITE_COLLECTION_CONCURRENT_SKIP_LIST_SET;
+
+    CheckCollection(&typ);
+}
+
+BOOST_AUTO_TEST_CASE(TestMapNull)
+{
+    TemplatedPortableIdResolver<PortableDummy> idRslvr;
+
+    InteropUnpooledMemory mem(1024);
+
+    InteropOutputStream out(&mem);
+    PortableWriterImpl writerImpl(&out, &idRslvr, NULL, NULL);
+    PortableWriter writer(&writerImpl);
+
+    out.Position(18);
+
+    writer.WriteNull("field1");
+    writer.WriteInt8("field2", 1);
+
+    out.Synchronize();
+
+    InteropInputStream in(&mem);
+    PortableReaderImpl readerImpl(&in, &idRslvr, 0, true, idRslvr.GetTypeId(), 0, 1000, 1000);
+    PortableReader reader(&readerImpl);
+
+    in.Position(18);
+
+    PortableMapReader<int8_t, PortableInner> mapReader = reader.ReadMap<int8_t, PortableInner>("field1");
+
+    BOOST_REQUIRE(mapReader.GetType() == IGNITE_MAP_UNDEFINED);
+    BOOST_REQUIRE(mapReader.GetSize() == -1);
+    BOOST_REQUIRE(!mapReader.HasNext());
+    BOOST_REQUIRE(mapReader.IsNull());
+
+    try
+    {
+        int8_t key;
+        PortableInner val;
+
+        mapReader.GetNext(&key, &val);
+
+        BOOST_FAIL("Error expected.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+
+    BOOST_REQUIRE(reader.ReadInt8("field2") == 1);
+}
+
+BOOST_AUTO_TEST_CASE(TestMapEmpty)
+{
+    CheckMapEmpty(NULL);
+}
+
+BOOST_AUTO_TEST_CASE(TestMapEmptyTyped)
+{
+    MapType typ = IGNITE_MAP_CONCURRENT_HASH_MAP;
+
+    CheckMapEmpty(&typ);
+}
+
+BOOST_AUTO_TEST_CASE(TestMap)
+{
+    CheckMap(NULL);
+}
+
+BOOST_AUTO_TEST_CASE(TestMapTyped)
+{
+    MapType typ = IGNITE_MAP_CONCURRENT_HASH_MAP;
+
+    CheckMap(&typ);
+}
+
+BOOST_AUTO_TEST_CASE(TestRawMode)
+{
+    TemplatedPortableIdResolver<PortableDummy> idRslvr;
+
+    InteropUnpooledMemory mem(1024);
+
+    InteropOutputStream out(&mem);
+    PortableWriterImpl writerImpl(&out, &idRslvr, NULL, NULL);
+    PortableWriter writer(&writerImpl);
+
+    out.Position(18);
+
+    PortableRawWriter rawWriter = writer.RawWriter();
+
+    try
+    {
+        writer.RawWriter();
+
+        BOOST_FAIL("Error expected.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+
+    rawWriter.WriteInt8(1);
+
+    CheckWritesRestricted(writer);
+
+    out.Synchronize();
+
+    InteropInputStream in(&mem);
+    PortableReaderImpl readerImpl(&in, &idRslvr, 0, true, idRslvr.GetTypeId(), 0, 1000, 18);
+    PortableReader reader(&readerImpl);
+
+    in.Position(18);
+
+    PortableRawReader rawReader = reader.RawReader();
+
+    try
+    {
+        reader.RawReader();
+
+        BOOST_FAIL("Error expected.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+
+    BOOST_REQUIRE(rawReader.ReadInt8() == 1);
+
+    CheckReadsRestricted(reader);
+}
+
+BOOST_AUTO_TEST_CASE(TestFieldSeek)
+{
+    TemplatedPortableIdResolver<PortableFields> idRslvr;
+
+    InteropUnpooledMemory mem(1024);
+
+    InteropOutputStream out(&mem);
+    PortableWriterImpl writer(&out, NULL);
+
+    PortableFields writeVal(1, 2, 3, 4);
+
+    writer.WriteTopObject<PortableFields>(writeVal);
+
+    out.Synchronize();
+
+    InteropInputStream in(&mem);
+
+    int32_t pos = in.Position();
+    in.ReadInt8(); // We do not need a header here.
+    bool usrType = in.ReadBool();
+    int32_t typeId = in.ReadInt32();
+    int32_t hashCode = in.ReadInt32();
+    int32_t len = in.ReadInt32();
+    int32_t rawOff = in.ReadInt32();
+
+    PortableReaderImpl readerImpl(&in, &idRslvr, pos, usrType, typeId, hashCode, len, rawOff);
+    PortableReader reader(&readerImpl);
+
+    // 1. Clockwise.
+    BOOST_REQUIRE(reader.ReadInt32("val1") == 1);
+    BOOST_REQUIRE(reader.ReadInt32("val2") == 2);
+    BOOST_REQUIRE(reader.ReadInt32("val1") == 1);
+    BOOST_REQUIRE(reader.ReadInt32("val2") == 2);
+
+    // 2. Counter closkwise.
+    in.Position(18);
+    BOOST_REQUIRE(reader.ReadInt32("val2") == 2);
+    BOOST_REQUIRE(reader.ReadInt32("val1") == 1);
+    BOOST_REQUIRE(reader.ReadInt32("val2") == 2);
+    BOOST_REQUIRE(reader.ReadInt32("val1") == 1);
+
+    // 3. Same field twice.
+    in.Position(18);
+    BOOST_REQUIRE(reader.ReadInt32("val1") == 1);
+    BOOST_REQUIRE(reader.ReadInt32("val1") == 1);
+
+    in.Position(18);
+    BOOST_REQUIRE(reader.ReadInt32("val2") == 2);
+    BOOST_REQUIRE(reader.ReadInt32("val2") == 2);
+    
+    // 4. Read missing field in between.
+    in.Position(18);
+    BOOST_REQUIRE(reader.ReadInt32("val1") == 1);
+    BOOST_REQUIRE(reader.ReadInt32("missing") == 0);
+    BOOST_REQUIRE(reader.ReadInt32("val2") == 2);
+
+    in.Position(18);
+    BOOST_REQUIRE(reader.ReadInt32("val2") == 2);
+    BOOST_REQUIRE(reader.ReadInt32("missing") == 0);
+    BOOST_REQUIRE(reader.ReadInt32("val1") == 1);
+
+    // 5. Invalid field type.
+    in.Position(18);
+    BOOST_REQUIRE(reader.ReadInt32("val1") == 1);
+
+    try
+    {
+        reader.ReadInt64("val2");
+
+        BOOST_FAIL("Error expected.");
+    }
+    catch (IgniteError& err)
+    {
+        BOOST_REQUIRE(err.GetCode() == IgniteError::IGNITE_ERR_PORTABLE);
+    }
+
+    BOOST_REQUIRE(reader.ReadInt32("val2") == 2);
+
+    // 6. Read missing primitive fields.
+    BOOST_REQUIRE(reader.ReadInt8("missing") == 0);
+    BOOST_REQUIRE(reader.ReadBool("missing") == false);
+    BOOST_REQUIRE(reader.ReadInt16("missing") == 0);
+    BOOST_REQUIRE(reader.ReadUInt16("missing") == 0);
+    BOOST_REQUIRE(reader.ReadInt32("missing") == 0);
+    BOOST_REQUIRE(reader.ReadInt64("missing") == 0);
+    BOOST_REQUIRE(reader.ReadFloat("missing") == 0);
+    BOOST_REQUIRE(reader.ReadDouble("missing") == 0);
+
+    BOOST_REQUIRE(reader.ReadGuid("missing").GetMostSignificantBits() == 0);
+    BOOST_REQUIRE(reader.ReadGuid("missing").GetLeastSignificantBits() == 0);
+
+    // 7. Read missing primitive array fields.
+    BOOST_REQUIRE(reader.ReadInt8Array("missing", NULL, 1) == -1);
+    BOOST_REQUIRE(reader.ReadBoolArray("missing", NULL, 1) == -1);
+    BOOST_REQUIRE(reader.ReadInt16Array("missing", NULL, 1) == -1);
+    BOOST_REQUIRE(reader.ReadUInt16Array("missing", NULL, 1) == -1);
+    BOOST_REQUIRE(reader.ReadInt32Array("missing", NULL, 1) == -1);
+    BOOST_REQUIRE(reader.ReadInt64Array("missing", NULL, 1) == -1);
+    BOOST_REQUIRE(reader.ReadFloatArray("missing", NULL, 1) == -1);
+    BOOST_REQUIRE(reader.ReadDoubleArray("missing", NULL, 1) == -1);
+
+    BOOST_REQUIRE(reader.ReadGuidArray("missing", NULL, 1) == -1);
+
+    // 8. Read missing string fields.
+    BOOST_REQUIRE(reader.ReadString("missing", NULL, 1) == -1);
+    BOOST_REQUIRE(reader.ReadString("missing").length() == 0);
+
+    // 9. Read missing object fields.
+    BOOST_REQUIRE(reader.ReadObject<PortableFields*>("missing") == NULL);
+    
+    // 10. Read missing container fields.
+    PortableStringArrayReader stringArrReader = reader.ReadStringArray("missing");
+    BOOST_REQUIRE(stringArrReader.IsNull());
+
+    PortableArrayReader<PortableFields> arrReader = reader.ReadArray<PortableFields>("missing");
+    BOOST_REQUIRE(arrReader.IsNull());
+
+    PortableCollectionReader<PortableFields> colReader = reader.ReadCollection<PortableFields>("missing");
+    BOOST_REQUIRE(colReader.IsNull());
+
+    PortableMapReader<int32_t, PortableFields> mapReader = reader.ReadMap<int32_t, PortableFields>("missing");
+    BOOST_REQUIRE(mapReader.IsNull());
+}
+
+BOOST_AUTO_TEST_SUITE_END()
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/core-test/src/portable_session_test.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/core-test/src/portable_session_test.cpp b/modules/platform/cpp/core-test/src/portable_session_test.cpp
new file mode 100644
index 0000000..9d84e48
--- /dev/null
+++ b/modules/platform/cpp/core-test/src/portable_session_test.cpp
@@ -0,0 +1,257 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _MSC_VER
+    #define BOOST_TEST_DYN_LINK
+#endif
+
+#include <boost/test/unit_test.hpp>
+
+#include "ignite/impl/interop/interop.h"
+#include "ignite/impl/portable/portable_reader_impl.h"
+#include "ignite/impl/portable/portable_writer_impl.h"
+
+#include "ignite/portable_test_defs.h"
+
+using namespace ignite;
+using namespace ignite::impl::interop;
+using namespace ignite::impl::portable;
+using namespace ignite::portable;
+using namespace ignite_test::core::portable;
+
+/*
+ * Check primitive value serialization-deserialization.
+ */
+template<typename T>
+void CheckRawPrimitive(T writeVal) 
+{
+    InteropUnpooledMemory mem(1024);
+
+    InteropOutputStream out(&mem); 
+    PortableWriterImpl writeSes(&out, NULL);
+    writeSes.WriteTopObject<T>(writeVal);
+    out.Synchronize();
+
+    InteropInputStream in(&mem); 
+    PortableReaderImpl reader(&in);
+    T readVal = reader.ReadTopObject<T>();
+
+    BOOST_REQUIRE(readVal == writeVal);
+}
+
+BOOST_AUTO_TEST_SUITE(PortableSessionTestSuite)
+
+BOOST_AUTO_TEST_CASE(TestByte)
+{
+    CheckRawPrimitive<int8_t>(-128);
+    CheckRawPrimitive<int8_t>(-1);
+    CheckRawPrimitive<int8_t>(0);
+    CheckRawPrimitive<int8_t>(1);
+    CheckRawPrimitive<int8_t>(127);
+}
+
+BOOST_AUTO_TEST_CASE(TestBool)
+{
+    CheckRawPrimitive<bool>(true);
+    CheckRawPrimitive<bool>(false);
+}
+
+BOOST_AUTO_TEST_CASE(TestShort)
+{
+    //CheckRawPrimitive<int16_t>(std::numeric_limits<int16_t>::min()); 
+    CheckRawPrimitive<int16_t>(-1);
+    CheckRawPrimitive<int16_t>(0);
+    CheckRawPrimitive<int16_t>(1);
+    //CheckRawPrimitive<int16_t>(std::numeric_limits<int16_t>::max());
+}
+
+BOOST_AUTO_TEST_CASE(TestChar)
+{
+    //CheckRawPrimitive<uint16_t>(std::numeric_limits<uint16_t>::min());
+    CheckRawPrimitive<uint16_t>(1);
+    //CheckRawPrimitive<uint16_t>(std::numeric_limits<uint16_t>::max());
+}
+
+BOOST_AUTO_TEST_CASE(TestInt)
+{
+    //CheckRawPrimitive<int32_t>(std::numeric_limits<int32_t>::min());
+    CheckRawPrimitive<int32_t>(-1);
+    CheckRawPrimitive<int32_t>(0);
+    CheckRawPrimitive<int32_t>(1);
+    //CheckRawPrimitive<int32_t>(std::numeric_limits<int32_t>::max());
+}
+
+BOOST_AUTO_TEST_CASE(TestLong)
+{
+    //CheckRawPrimitive<int64_t>(std::numeric_limits<int64_t>::min());
+    CheckRawPrimitive<int64_t>(-1);
+    CheckRawPrimitive<int64_t>(0);
+    CheckRawPrimitive<int64_t>(1);
+    //CheckRawPrimitive<int64_t>(std::numeric_limits<int64_t>::max());
+}
+
+BOOST_AUTO_TEST_CASE(TestFloat)
+{
+    CheckRawPrimitive<float>(-1.1f);
+    CheckRawPrimitive<float>(0);
+    CheckRawPrimitive<float>(1.1f);
+}
+
+BOOST_AUTO_TEST_CASE(TestDouble)
+{
+    CheckRawPrimitive<double>(-1.1);
+    CheckRawPrimitive<double>(0);
+    CheckRawPrimitive<double>(1.1);
+}
+
+BOOST_AUTO_TEST_CASE(TestGuid)
+{
+    Guid writeVal = Guid(1, 1);
+
+    InteropUnpooledMemory mem(1024);
+
+    InteropOutputStream out(&mem);
+    PortableWriterImpl writeSes(&out, NULL);
+    writeSes.WriteTopObject<Guid>(writeVal);
+    out.Synchronize();
+
+    InteropInputStream in(&mem);
+    PortableReaderImpl reader(&in);
+    Guid readVal = reader.ReadTopObject<Guid>();
+
+    BOOST_REQUIRE(readVal.GetMostSignificantBits() == writeVal.GetMostSignificantBits());
+    BOOST_REQUIRE(readVal.GetLeastSignificantBits() == writeVal.GetLeastSignificantBits());    
+}
+
+BOOST_AUTO_TEST_CASE(TestString)
+{
+    std::string writeVal = "MyString";
+
+    InteropUnpooledMemory mem(1024);
+
+    InteropOutputStream out(&mem);
+    PortableWriterImpl writeSes(&out, NULL);
+    writeSes.WriteTopObject<std::string>(writeVal);
+    out.Synchronize();
+
+    InteropInputStream in(&mem);
+    PortableReaderImpl reader(&in);
+    std::string readVal = reader.ReadTopObject<std::string>();
+
+    BOOST_REQUIRE(readVal.compare(writeVal) == 0);
+}
+
+BOOST_AUTO_TEST_CASE(TestObject)
+{
+    InteropUnpooledMemory mem(1024);
+    
+    InteropOutputStream out(&mem);
+    PortableWriterImpl writer(&out, NULL);
+
+    InteropInputStream in(&mem);
+    PortableReaderImpl reader(&in);
+
+    // 1. Test null object.
+    PortableInner writeVal(0);
+    
+    writer.WriteTopObject<PortableInner>(writeVal);
+    out.Synchronize();
+    
+    in.Synchronize();
+    PortableInner readVal = reader.ReadTopObject<PortableInner>();
+
+    BOOST_REQUIRE(readVal.GetValue() == 0);
+
+    // 2. Test non-null object.
+    out.Position(0);
+    in.Position(0);
+
+    writeVal = PortableInner(1);
+
+    writer.WriteTopObject<PortableInner>(writeVal);
+    out.Synchronize();
+
+    in.Synchronize();
+    readVal = reader.ReadTopObject<PortableInner>();
+
+    BOOST_REQUIRE(readVal.GetValue() == 1);
+}
+
+BOOST_AUTO_TEST_CASE(TestObjectWithRawFields)
+{
+    InteropUnpooledMemory mem(1024);
+
+    InteropOutputStream out(&mem);
+    PortableWriterImpl writer(&out, NULL);
+
+    InteropInputStream in(&mem);
+    PortableReaderImpl reader(&in);
+
+    out.Position(0);
+    in.Position(0);
+
+    PortableFields writeVal = PortableFields(1, 2, 3, 4);
+
+    writer.WriteTopObject<PortableFields>(writeVal);
+    out.Synchronize();
+
+    in.Synchronize();
+    PortableFields readVal = reader.ReadTopObject<PortableFields>();
+
+    BOOST_REQUIRE(readVal.val1 == 1);
+    BOOST_REQUIRE(readVal.val2 == 2);
+    BOOST_REQUIRE(readVal.rawVal1 == 3);
+    BOOST_REQUIRE(readVal.rawVal2 == 4);
+}
+
+BOOST_AUTO_TEST_CASE(TestPointer)
+{
+    InteropUnpooledMemory mem(1024);
+
+    InteropOutputStream out(&mem);
+    PortableWriterImpl writer(&out, NULL);
+
+    InteropInputStream in(&mem);
+    PortableReaderImpl reader(&in);
+
+    // 1. Test null object.
+    writer.WriteTopObject<PortableInner*>(NULL);
+    out.Synchronize();
+
+    in.Synchronize();
+    PortableInner* readVal = reader.ReadTopObject<PortableInner*>();
+
+    BOOST_REQUIRE(readVal == NULL);
+
+    // 2. Test non-null object.
+    out.Position(0);
+    in.Position(0);
+
+    PortableInner writeVal = PortableInner(1);
+
+    writer.WriteTopObject<PortableInner*>(&writeVal);
+    out.Synchronize();
+
+    in.Synchronize();
+    readVal = reader.ReadTopObject<PortableInner*>();
+
+    BOOST_REQUIRE(readVal->GetValue() == 1);
+
+    delete readVal;
+}
+
+BOOST_AUTO_TEST_SUITE_END()
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/core-test/src/portable_test_defs.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/core-test/src/portable_test_defs.cpp b/modules/platform/cpp/core-test/src/portable_test_defs.cpp
new file mode 100644
index 0000000..e818711
--- /dev/null
+++ b/modules/platform/cpp/core-test/src/portable_test_defs.cpp
@@ -0,0 +1,65 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "ignite/impl/interop/interop.h"
+#include "ignite/portable/portable.h"
+
+#include "ignite/portable_test_defs.h"
+
+using namespace ignite;
+using namespace ignite::impl::interop;
+using namespace ignite::impl::portable;
+using namespace ignite::portable;
+
+namespace ignite_test
+{
+    namespace core
+    {
+        namespace portable
+        {
+            PortableInner::PortableInner() : val(0)
+            {
+                // No-op.
+            }
+
+            PortableInner::PortableInner(int32_t val) : val(val)
+            {
+                // No-op.
+            }
+
+            int32_t PortableInner::GetValue() const
+            {
+                return val;
+            }
+
+            PortableOuter::PortableOuter(int32_t valIn, int32_t valOut) : inner(valIn), val(valOut)
+            {
+                // No-op.
+            }
+
+            PortableInner PortableOuter::GetInner() const
+            {
+                return inner;
+            }
+
+            int32_t PortableOuter::GetValue() const
+            {
+                return val;
+            }
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/core-test/src/teamcity_boost.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/core-test/src/teamcity_boost.cpp b/modules/platform/cpp/core-test/src/teamcity_boost.cpp
new file mode 100644
index 0000000..45c666d
--- /dev/null
+++ b/modules/platform/cpp/core-test/src/teamcity_boost.cpp
@@ -0,0 +1,159 @@
+/* Copyright 2011 JetBrains s.r.o.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * 
+ * $Revision: 88625 $
+*/
+
+#define BOOST_TEST_MODULE IgniteCoreTest
+
+#include <sstream>
+
+#include <boost/test/unit_test_suite_impl.hpp>
+#include <boost/test/results_collector.hpp>
+#include <boost/test/utils/basic_cstring/io.hpp>
+#include <boost/test/unit_test_log.hpp>
+#include <boost/test/included/unit_test.hpp>
+
+#include "teamcity_messages.h"
+
+using namespace boost::unit_test;
+using namespace std;
+
+namespace JetBrains {
+
+// Custom formatter for TeamCity messages
+class TeamcityBoostLogFormatter: public boost::unit_test::unit_test_log_formatter {
+    TeamcityMessages messages;
+    std::string currentDetails;
+    std::string flowId;
+    
+public:
+    TeamcityBoostLogFormatter(const std::string &_flowId);
+    TeamcityBoostLogFormatter();
+    
+    void log_start(std::ostream&, boost::unit_test::counter_t test_cases_amount);
+    void log_finish(std::ostream&);
+    void log_build_info(std::ostream&);
+
+    void test_unit_start(std::ostream&, boost::unit_test::test_unit const& tu);
+    void test_unit_finish(std::ostream&,
+        boost::unit_test::test_unit const& tu,
+        unsigned long elapsed);
+    void test_unit_skipped(std::ostream&, boost::unit_test::test_unit const& tu);
+
+    void log_exception(std::ostream&,
+        boost::unit_test::log_checkpoint_data const&,
+        boost::unit_test::const_string explanation);
+
+    void log_entry_start(std::ostream&,
+        boost::unit_test::log_entry_data const&,
+        log_entry_types let);
+    void log_entry_value(std::ostream&, boost::unit_test::const_string value);
+    void log_entry_finish(std::ostream&);
+};
+
+// Fake fixture to register formatter
+struct TeamcityFormatterRegistrar {
+    TeamcityFormatterRegistrar() {
+        if (JetBrains::underTeamcity()) {
+            boost::unit_test::unit_test_log.set_formatter(new JetBrains::TeamcityBoostLogFormatter());
+            boost::unit_test::unit_test_log.set_threshold_level(boost::unit_test::log_successful_tests);
+        }
+    }
+};
+BOOST_GLOBAL_FIXTURE(TeamcityFormatterRegistrar);
+
+// Formatter implementation
+string toString(const_string bstr) {
+    stringstream ss;
+    
+    ss << bstr;
+    
+    return ss.str();
+}
+
+TeamcityBoostLogFormatter::TeamcityBoostLogFormatter(const std::string &_flowId)
+: flowId(_flowId)
+{}
+
+TeamcityBoostLogFormatter::TeamcityBoostLogFormatter()
+: flowId(getFlowIdFromEnvironment())
+{}
+
+void TeamcityBoostLogFormatter::log_start(ostream &out, counter_t test_cases_amount)
+{}
+
+void TeamcityBoostLogFormatter::log_finish(ostream &out)
+{}
+
+void TeamcityBoostLogFormatter::log_build_info(ostream &out)
+{}
+
+void TeamcityBoostLogFormatter::test_unit_start(ostream &out, test_unit const& tu) {
+    messages.setOutput(out);
+
+    if (tu.p_type == tut_case) {
+        messages.testStarted(tu.p_name, flowId);
+    } else {
+        messages.suiteStarted(tu.p_name, flowId);
+    }
+    
+    currentDetails.clear();
+}
+
+void TeamcityBoostLogFormatter::test_unit_finish(ostream &out, test_unit const& tu, unsigned long elapsed) {
+    messages.setOutput(out);
+
+    test_results const& tr = results_collector.results(tu.p_id);
+    if (tu.p_type == tut_case) {
+        if(!tr.passed()) {
+            if(tr.p_skipped) {
+                messages.testIgnored(tu.p_name, "ignored", flowId);
+            } else if (tr.p_aborted) {
+                messages.testFailed(tu.p_name, "aborted", currentDetails, flowId);
+            } else {
+                messages.testFailed(tu.p_name, "failed", currentDetails, flowId);
+            }
+        }
+        
+        messages.testFinished(tu.p_name, elapsed / 1000, flowId);
+    } else {
+        messages.suiteFinished(tu.p_name, flowId);
+    }
+}
+
+void TeamcityBoostLogFormatter::test_unit_skipped(ostream &out, test_unit const& tu)
+{}
+
+void TeamcityBoostLogFormatter::log_exception(ostream &out, log_checkpoint_data const&, const_string explanation) {
+    string what = toString(explanation);
+    
+    out << what << endl;
+    currentDetails += what + "\n";
+}
+
+void TeamcityBoostLogFormatter::log_entry_start(ostream&, log_entry_data const&, log_entry_types let)
+{}
+
+void TeamcityBoostLogFormatter::log_entry_value(ostream &out, const_string value) {
+    out << value;
+    currentDetails += toString(value);
+}
+
+void TeamcityBoostLogFormatter::log_entry_finish(ostream &out) {
+    out << endl;
+    currentDetails += "\n";
+}
+
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/core-test/src/teamcity_messages.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/core-test/src/teamcity_messages.cpp b/modules/platform/cpp/core-test/src/teamcity_messages.cpp
new file mode 100644
index 0000000..087409e
--- /dev/null
+++ b/modules/platform/cpp/core-test/src/teamcity_messages.cpp
@@ -0,0 +1,150 @@
+/* Copyright 2011 JetBrains s.r.o.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * $Revision: 88625 $
+*/
+
+#include <stdlib.h>
+#include <sstream>
+
+#include "teamcity_messages.h"
+
+using namespace std;
+
+namespace JetBrains {
+
+std::string getFlowIdFromEnvironment() {
+    const char *flowId = getenv("TEAMCITY_PROCESS_FLOW_ID");
+    return flowId == NULL ? "" : flowId;
+}
+
+bool underTeamcity() {
+    return getenv("TEAMCITY_PROJECT_NAME") != NULL;
+}
+
+TeamcityMessages::TeamcityMessages()
+: m_out(&cout)
+{}
+
+void TeamcityMessages::setOutput(ostream &out) {
+    m_out = &out;
+}
+
+string TeamcityMessages::escape(string s) {
+    string result;
+    
+    for (size_t i = 0; i < s.length(); i++) {
+        char c = s[i];
+        
+        switch (c) {
+        case '\n': result.append("|n"); break;
+        case '\r': result.append("|r"); break;
+        case '\'': result.append("|'"); break;
+        case '|':  result.append("||"); break;
+        case ']':  result.append("|]"); break;
+        default:   result.append(&c, 1);
+        }
+    }
+    
+    return result;
+}
+
+void TeamcityMessages::openMsg(const string &name) {
+    // endl for http://jetbrains.net/tracker/issue/TW-4412
+    *m_out << endl << "##teamcity[" << name;
+}
+
+void TeamcityMessages::closeMsg() {
+    *m_out << "]";
+    // endl for http://jetbrains.net/tracker/issue/TW-4412
+    *m_out << endl;
+    m_out->flush();
+}
+
+void TeamcityMessages::writeProperty(string name, string value) {
+    *m_out << " " << name << "='" << escape(value) << "'";
+}
+
+void TeamcityMessages::suiteStarted(string name, string flowid) {
+    openMsg("testSuiteStarted");
+    writeProperty("name", name);
+    if(flowid.length() > 0) {
+        writeProperty("flowId", flowid);
+    }
+    
+    closeMsg();
+}
+
+void TeamcityMessages::suiteFinished(string name, string flowid) {
+    openMsg("testSuiteFinished");
+    writeProperty("name", name);
+    if(flowid.length() > 0) {
+        writeProperty("flowId", flowid);
+    }
+    
+    closeMsg();
+}
+
+void TeamcityMessages::testStarted(string name, string flowid) {
+    openMsg("testStarted");
+    writeProperty("name", name);
+    if(flowid.length() > 0) {
+        writeProperty("flowId", flowid);
+    }
+    
+    closeMsg();
+}
+
+void TeamcityMessages::testFinished(string name, int durationMs, string flowid) {
+    openMsg("testFinished");
+
+    writeProperty("name", name);
+
+    if(flowid.length() > 0) {
+        writeProperty("flowId", flowid);
+    }
+
+    if(durationMs >= 0) {
+        stringstream out;
+        out << durationMs;
+        writeProperty("duration", out.str());
+    }
+    
+    closeMsg();
+}
+
+void TeamcityMessages::testFailed(string name, string message, string details, string flowid) {
+    openMsg("testFailed");
+    writeProperty("name", name);
+    writeProperty("message", message);
+    writeProperty("details", details);
+    if(flowid.length() > 0) {
+        writeProperty("flowId", flowid);
+    }
+    
+    closeMsg();
+}
+
+void TeamcityMessages::testIgnored(std::string name, std::string message, string flowid) {
+    openMsg("testIgnored");
+    writeProperty("name", name);
+    writeProperty("message", message);
+    if(flowid.length() > 0) {
+        writeProperty("flowId", flowid);
+    }
+    
+    closeMsg();
+}
+
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/core/Makefile.am
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/core/Makefile.am b/modules/platform/cpp/core/Makefile.am
new file mode 100644
index 0000000..db50326
--- /dev/null
+++ b/modules/platform/cpp/core/Makefile.am
@@ -0,0 +1,66 @@
+##
+## Licensed to the Apache Software Foundation (ASF) under one or more
+## contributor license agreements.  See the NOTICE file distributed with
+## this work for additional information regarding copyright ownership.
+## The ASF licenses this file to You under the Apache License, Version 2.0
+## (the "License"); you may not use this file except in compliance with
+## the License.  You may obtain a copy of the License at
+##
+##      http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS,
+## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+## See the License for the specific language governing permissions and
+## limitations under the License.
+##
+
+ACLOCAL_AMFLAGS = "-Im4"
+
+SUBDIRS = . include os/linux/include
+DIST_SUBDIRS = . include os/linux/include
+
+AM_CPPFLAGS = -I$(srcdir)/include -I$(srcdir)/os/linux/include -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/linux -DIGNITE_IMPL
+AM_CXXFLAGS = -Wall -std=c++0x
+LIB_LDFLAGS = -no-undefined -version-info 1
+
+COMMON_SRC = os/linux/src/impl/utils.cpp \
+             src/ignite_error.cpp \
+             src/guid.cpp \
+             src/impl/handle_registry.cpp \
+             src/impl/interop/interop_memory.cpp \
+             src/impl/interop/interop_input_stream.cpp \
+             src/impl/interop/interop_output_stream.cpp \
+             src/portable/portable_type.cpp \
+             src/impl/portable/portable_metadata_snapshot.cpp \
+             src/impl/portable/portable_metadata_handler.cpp \
+             src/impl/portable/portable_metadata_updater.cpp \
+             src/impl/portable/portable_metadata_manager.cpp \
+             src/impl/portable/portable_utils.cpp \
+             src/impl/portable/portable_reader_impl.cpp \
+             src/impl/portable/portable_writer_impl.cpp \
+             src/portable/portable_containers.cpp \
+             src/portable/portable_raw_reader.cpp \
+             src/portable/portable_raw_writer.cpp \
+             src/portable/portable_reader.cpp \
+             src/portable/portable_writer.cpp \
+             src/impl/portable/portable_metadata_updater_impl.cpp \
+             src/impl/ignite_environment.cpp \
+             src/impl/cache/query/query_impl.cpp \
+             src/impl/cache/cache_impl.cpp \
+             src/impl/ignite_impl.cpp \
+             src/ignite.cpp \
+             src/ignition.cpp
+
+lib_LTLIBRARIES = libignite.la
+libignite_la_SOURCES = $(COMMON_SRC)
+libignite_la_LDFLAGS = $(LIB_LDFLAGS) -L/usr/local/lib -lignite-common -ldl -version-info 0:0:0 -release $(PACKAGE_VERSION)
+
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = ignite.pc
+
+clean-local:
+	$(RM) *.gcno *.gcda
+
+clean-docs:
+	$(RM) $(DX_CLEANFILES)

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/core/configure.ac
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/core/configure.ac b/modules/platform/cpp/core/configure.ac
new file mode 100644
index 0000000..c1657d3
--- /dev/null
+++ b/modules/platform/cpp/core/configure.ac
@@ -0,0 +1,62 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+#                                               -*- Autoconf -*-
+# Process this file with autoconf to produce a configure script.
+
+AC_PREREQ([2.69])
+AC_INIT([Apache Ignite C++], [1.5.0], [dev@ignite.apache.org], [ignite], [ignite.apache.org])
+AC_CONFIG_SRCDIR(src)
+
+AC_CANONICAL_SYSTEM
+AC_CONFIG_MACRO_DIR([m4])
+AC_LANG([C++])
+
+# Initialize automake
+AM_INIT_AUTOMAKE([-Wall foreign subdir-objects])
+AC_CONFIG_HEADER(config.h)
+
+AM_PROG_AR
+
+# Checks for programs.
+GXX="-g -O2"
+
+AC_PROG_CXX
+
+# Initialize Libtool
+LT_INIT
+
+# Checks for libraries.
+AC_CHECK_LIB([pthread], [pthread_mutex_lock])
+
+# Checks for header files.
+
+# Checks for typedefs, structures, and compiler characteristics.
+AC_C_INLINE
+AC_TYPE_INT16_T
+AC_TYPE_INT32_T
+AC_TYPE_INT64_T
+AC_TYPE_INT8_T
+AC_TYPE_PID_T
+AC_TYPE_SIZE_T
+
+# Checks for library functions.
+AC_FUNC_ERROR_AT_LINE
+
+AC_CONFIG_FILES(Makefile include/Makefile os/linux/include/Makefile ignite.pc)
+
+AC_OUTPUT

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/core/ignite.pc.in
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/core/ignite.pc.in b/modules/platform/cpp/core/ignite.pc.in
new file mode 100644
index 0000000..613fd1a
--- /dev/null
+++ b/modules/platform/cpp/core/ignite.pc.in
@@ -0,0 +1,9 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: ignite
+Description: Apache Ignite C++.
+Version: @PACKAGE_VERSION@
+Libs: -L${libdir} -lignite

http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/core/include/Makefile.am
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/core/include/Makefile.am b/modules/platform/cpp/core/include/Makefile.am
new file mode 100644
index 0000000..da9d95e
--- /dev/null
+++ b/modules/platform/cpp/core/include/Makefile.am
@@ -0,0 +1,61 @@
+##
+## Licensed to the Apache Software Foundation (ASF) under one or more
+## contributor license agreements.  See the NOTICE file distributed with
+## this work for additional information regarding copyright ownership.
+## The ASF licenses this file to You under the Apache License, Version 2.0
+## (the "License"); you may not use this file except in compliance with
+## the License.  You may obtain a copy of the License at
+##
+##      http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS,
+## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+## See the License for the specific language governing permissions and
+## limitations under the License.
+##
+
+ACLOCAL_AMFLAGS = "-Im4"
+
+nobase_include_HEADERS = ignite/cache/cache.h \
+                         ignite/cache/cache_entry.h \
+                         ignite/cache/cache_peek_mode.h \
+                         ignite/cache/query/query_argument.h \
+                         ignite/cache/query/query_cursor.h \
+                         ignite/cache/query/query_scan.h \
+                         ignite/cache/query/query_sql.h \
+                         ignite/cache/query/query_text.h \
+                         ignite/cache/query/query.h \
+                         ignite/impl/cache/cache_impl.h \
+                         ignite/impl/cache/query/query_impl.h \
+                         ignite/impl/interop/interop.h \
+                         ignite/impl/interop/interop_input_stream.h \
+                         ignite/impl/interop/interop_memory.h \
+                         ignite/impl/interop/interop_output_stream.h \
+                         ignite/impl/portable/portable_metadata_handler.h \
+                         ignite/impl/portable/portable_metadata_manager.h \
+                         ignite/impl/portable/portable_metadata_snapshot.h \
+                         ignite/impl/portable/portable_metadata_updater.h \
+                         ignite/impl/portable/portable_metadata_updater_impl.h \
+                         ignite/impl/portable/portable_common.h \
+                         ignite/impl/portable/portable_id_resolver.h \
+                         ignite/impl/portable/portable_reader_impl.h \
+                         ignite/impl/portable/portable_utils.h \
+                         ignite/impl/portable/portable_writer_impl.h \
+                         ignite/impl/ignite_environment.h \
+                         ignite/impl/ignite_impl.h \
+                         ignite/impl/handle_registry.h \
+                         ignite/impl/operations.h \
+                         ignite/portable/portable.h \
+                         ignite/portable/portable_consts.h \
+                         ignite/portable/portable_containers.h \
+                         ignite/portable/portable_type.h \
+                         ignite/portable/portable_raw_reader.h \
+                         ignite/portable/portable_raw_writer.h \
+                         ignite/portable/portable_reader.h \
+                         ignite/portable/portable_writer.h \
+                         ignite/ignite.h \
+                         ignite/ignite_configuration.h \
+                         ignite/ignite_error.h \
+                         ignite/ignition.h \
+                         ignite/guid.h