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/03 12:48:55 UTC
[01/16] ignite git commit: IGNITE-1364: Renamed namespaces.
Repository: ignite
Updated Branches:
refs/heads/ignite-1364 356ab0bb0 -> 0d70d547c
http://git-wip-us.apache.org/repos/asf/ignite/blob/843fc30b/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
index 518c3e7..8ba9fec 100644
--- 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
@@ -18,9 +18,9 @@
#include "gridgain/impl/portable/portable_writer_impl.h"
#include "gridgain/portable/portable_raw_writer.h"
-using namespace gridgain::impl::portable;
+using namespace ignite::impl::portable;
-namespace gridgain
+namespace ignite
{
namespace portable
{
http://git-wip-us.apache.org/repos/asf/ignite/blob/843fc30b/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
index d9e5e73..8ce1de0 100644
--- a/modules/platform/src/main/cpp/core/src/portable/portable_reader.cpp
+++ b/modules/platform/src/main/cpp/core/src/portable/portable_reader.cpp
@@ -17,9 +17,9 @@
#include "gridgain/impl/portable/portable_reader_impl.h"
#include "gridgain/portable/portable_reader.h"
-using namespace gridgain::impl::portable;
+using namespace ignite::impl::portable;
-namespace gridgain
+namespace ignite
{
namespace portable
{
http://git-wip-us.apache.org/repos/asf/ignite/blob/843fc30b/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
index 75b8b7e..ce1f41b 100644
--- a/modules/platform/src/main/cpp/core/src/portable/portable_type.cpp
+++ b/modules/platform/src/main/cpp/core/src/portable/portable_type.cpp
@@ -17,7 +17,7 @@
#include "gridgain/portable/portable_type.h"
-namespace gridgain
+namespace ignite
{
namespace portable
{
http://git-wip-us.apache.org/repos/asf/ignite/blob/843fc30b/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
index 48e2ad7..746b6f7 100644
--- a/modules/platform/src/main/cpp/core/src/portable/portable_writer.cpp
+++ b/modules/platform/src/main/cpp/core/src/portable/portable_writer.cpp
@@ -18,9 +18,9 @@
#include "gridgain/impl/portable/portable_writer_impl.h"
#include "gridgain/portable/portable_writer.h"
-using namespace gridgain::impl::portable;
+using namespace ignite::impl::portable;
-namespace gridgain
+namespace ignite
{
namespace portable
{
[03/16] ignite git commit: IGNITE-1364: Minor renames.
Posted by vo...@apache.org.
IGNITE-1364: Minor renames.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/41cd8240
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/41cd8240
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/41cd8240
Branch: refs/heads/ignite-1364
Commit: 41cd8240d33a7e1d92faefa28c0df9ca9288f1cc
Parents: 843fc30
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Thu Sep 3 13:25:38 2015 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Thu Sep 3 13:25:38 2015 +0300
----------------------------------------------------------------------
modules/platform/src/main/cpp/core-test/src/cache_query_test.cpp | 2 +-
modules/platform/src/main/cpp/core-test/src/cache_test.cpp | 2 +-
.../platform/src/main/cpp/core-test/src/grid_factory_test.cpp | 2 +-
.../src/main/cpp/core/os/win/include/gridgain/impl/utils.h | 4 ++--
modules/platform/src/main/cpp/core/os/win/src/impl/utils.cpp | 4 ++--
5 files changed, 7 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/41cd8240/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
index 2cae873..266ff19 100644
--- 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
@@ -195,7 +195,7 @@ struct CacheQueryTestSuiteFixture {
cfg.jvmInitMem = 1024;
cfg.jvmMaxMem = 4096;
- char* cfgPath = getenv("GRIDGAIN_NATIVE_TEST_CPP_CONFIG_PATH");
+ char* cfgPath = getenv("IGNITE_NATIVE_TEST_CPP_CONFIG_PATH");
std::string cfgPathStr = std::string(cfgPath).append("/").append("cache-query.xml");
http://git-wip-us.apache.org/repos/asf/ignite/blob/41cd8240/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
index 7b62fd6..1682055 100644
--- a/modules/platform/src/main/cpp/core-test/src/cache_test.cpp
+++ b/modules/platform/src/main/cpp/core-test/src/cache_test.cpp
@@ -101,7 +101,7 @@ struct CacheTestSuiteFixture {
cfg.jvmInitMem = 1024;
cfg.jvmMaxMem = 4096;
- char* cfgPath = getenv("GRIDGAIN_NATIVE_TEST_CPP_CONFIG_PATH");
+ char* cfgPath = getenv("IGNITE_NATIVE_TEST_CPP_CONFIG_PATH");
std::string cfgPathStr = std::string(cfgPath).append("/").append("cache-test.xml");
http://git-wip-us.apache.org/repos/asf/ignite/blob/41cd8240/modules/platform/src/main/cpp/core-test/src/grid_factory_test.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core-test/src/grid_factory_test.cpp b/modules/platform/src/main/cpp/core-test/src/grid_factory_test.cpp
index be6ed63..fc33fb3 100644
--- a/modules/platform/src/main/cpp/core-test/src/grid_factory_test.cpp
+++ b/modules/platform/src/main/cpp/core-test/src/grid_factory_test.cpp
@@ -39,7 +39,7 @@ BOOST_AUTO_TEST_CASE(TestGridFactory)
cfg.jvmInitMem = 1024;
cfg.jvmMaxMem = 4096;
- char* cfgPath = getenv("GRIDGAIN_NATIVE_TEST_CPP_CONFIG_PATH");
+ char* cfgPath = getenv("IGNITE_NATIVE_TEST_CPP_CONFIG_PATH");
std::string cfgPathStr = std::string(cfgPath).append("/").append("cache-test.xml");
http://git-wip-us.apache.org/repos/asf/ignite/blob/41cd8240/modules/platform/src/main/cpp/core/os/win/include/gridgain/impl/utils.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/os/win/include/gridgain/impl/utils.h b/modules/platform/src/main/cpp/core/os/win/include/gridgain/impl/utils.h
index 2380930..3d72ae7 100644
--- a/modules/platform/src/main/cpp/core/os/win/include/gridgain/impl/utils.h
+++ b/modules/platform/src/main/cpp/core/os/win/include/gridgain/impl/utils.h
@@ -15,8 +15,8 @@
* limitations under the License.
*/
-#ifndef GRIDGAIN_UTILS
-#define GRIDGAIN_UTILS
+#ifndef _IGNITE_UTILS
+#define _IGNITE_UTILS
#include <cstring>
#include <string>
http://git-wip-us.apache.org/repos/asf/ignite/blob/41cd8240/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
index 16a1451..ee418ad 100644
--- 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
@@ -33,7 +33,7 @@ namespace ignite
const char* PROBE_BIN = "\\bin";
const char* PROBE_EXAMPLES = "\\examples";
- const char* GRIDGAIN_NATIVE_TEST_CLASSPATH = "GRIDGAIN_NATIVE_TEST_CLASSPATH";
+ const char* IGNITE_NATIVE_TEST_CLASSPATH = "IGNITE_NATIVE_TEST_CLASSPATH";
/**
* Helper method to set boolean result to reference with proper NULL-check.
@@ -424,7 +424,7 @@ namespace ignite
if (home)
{
bool envFound;
- std::string env = GetEnv(GRIDGAIN_NATIVE_TEST_CLASSPATH, &envFound);
+ std::string env = GetEnv(IGNITE_NATIVE_TEST_CLASSPATH, &envFound);
forceTest = envFound && env.compare("true") == 0;
}
[09/16] ignite git commit: IGNITE-1364: Moved headers to correct
folders.
Posted by vo...@apache.org.
http://git-wip-us.apache.org/repos/asf/ignite/blob/0d70d547/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
new file mode 100644
index 0000000..a2e0f33
--- /dev/null
+++ b/modules/platform/src/main/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/0d70d547/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
new file mode 100644
index 0000000..67d3ecc
--- /dev/null
+++ b/modules/platform/src/main/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/0d70d547/modules/platform/src/main/cpp/core/include/ignite/grid.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/ignite/grid.h b/modules/platform/src/main/cpp/core/include/ignite/grid.h
new file mode 100644
index 0000000..e388467
--- /dev/null
+++ b/modules/platform/src/main/cpp/core/include/ignite/grid.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_GRID
+#define _IGNITE_GRID
+
+#include "ignite/cache/cache.h"
+#include "ignite/impl/grid_impl.h"
+#include "ignite/grid_configuration.h"
+
+namespace ignite
+{
+ /**
+ * Main interface to operate with Ignite.
+ */
+ class IGNITE_IMPORT_EXPORT Grid
+ {
+ public:
+ /**
+ * Default constructor.
+ */
+ Grid();
+
+ /**
+ * Constructor.
+ */
+ Grid(impl::GridImpl* impl);
+
+ /**
+ * Get name of the grid.
+ *
+ * @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)
+ {
+ GridError err;
+
+ cache::Cache<K, V> res = GetCache<K, V>(name, &err);
+
+ GridError::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, GridError* 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)
+ {
+ GridError err;
+
+ cache::Cache<K, V> res = GetOrCreateCache<K, V>(name, &err);
+
+ GridError::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, GridError* 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)
+ {
+ GridError err;
+
+ cache::Cache<K, V> res = CreateCache<K, V>(name, &err);
+
+ GridError::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, GridError* 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::GridImpl> impl;
+ };
+}
+
+#endif
http://git-wip-us.apache.org/repos/asf/ignite/blob/0d70d547/modules/platform/src/main/cpp/core/include/ignite/grid_configuration.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/ignite/grid_configuration.h b/modules/platform/src/main/cpp/core/include/ignite/grid_configuration.h
new file mode 100644
index 0000000..65d2c8e
--- /dev/null
+++ b/modules/platform/src/main/cpp/core/include/ignite/grid_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_GRID_CONFIGURATION
+#define _IGNITE_GRID_CONFIGURATION
+
+#include <stdint.h>
+
+namespace ignite
+{
+ /**
+ * Single JVM option.
+ */
+ struct GridJvmOption
+ {
+ /** Option. */
+ char* opt;
+
+ /**
+ * Default constructor.
+ */
+ GridJvmOption() : opt(NULL)
+ {
+ // No-op.
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param opt Option.
+ */
+ GridJvmOption(char* opt) : opt(opt)
+ {
+ // No-op.
+ }
+ };
+
+ /**
+ * Grid configuration.
+ */
+ struct GridConfiguration
+ {
+ /** Path to GridGain home. */
+ char* gridGainHome;
+
+ /** 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. */
+ GridJvmOption* jvmOpts;
+
+ /** Additional JVM options count. */
+ int32_t jvmOptsLen;
+
+ /**
+ * Constructor.
+ */
+ GridConfiguration() : gridGainHome(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/0d70d547/modules/platform/src/main/cpp/core/include/ignite/grid_error.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/ignite/grid_error.h b/modules/platform/src/main/cpp/core/include/ignite/grid_error.h
new file mode 100644
index 0000000..7b1dd8e
--- /dev/null
+++ b/modules/platform/src/main/cpp/core/include/ignite/grid_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_GRID_ERROR
+#define _IGNITE_GRID_ERROR
+
+#include <sstream>
+#include <stdint.h>
+
+#include <ignite/common/common.h>
+
+#define IGNITE_ERROR_1(code, part1) { \
+ std::stringstream stream; \
+ stream << (part1); \
+ throw ignite::GridError(code, stream.str().c_str()); \
+}
+
+#define IGNITE_ERROR_2(code, part1, part2) { \
+ std::stringstream stream; \
+ stream << (part1) << (part2); \
+ throw ignite::GridError(code, stream.str().c_str()); \
+}
+
+#define IGNITE_ERROR_3(code, part1, part2, part3) { \
+ std::stringstream stream; \
+ stream << (part1) << (part2) << (part3); \
+ throw ignite::GridError(code, stream.str().c_str()); \
+}
+
+#define IGNITE_ERROR_FORMATTED_1(code, msg, key1, val1) { \
+ std::stringstream stream; \
+ stream << msg << " [" << key1 << "=" << (val1) << "]"; \
+ throw ignite::GridError(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::GridError(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::GridError(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::GridError(code, stream.str().c_str()); \
+}
+
+namespace ignite
+{
+ /**
+ * Grid error information.
+ */
+ class IGNITE_IMPORT_EXPORT GridError
+ {
+ 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(GridError& err);
+
+ /**
+ * Create empty error.
+ */
+ GridError();
+
+ /**
+ * Create error with specific code.
+ *
+ * @param code Error code.
+ */
+ GridError(const int32_t code);
+
+ /**
+ * Create error with specific code and message.
+ *
+ * @param code Error code.
+ * @param msg Message.
+ */
+ GridError(const int32_t code, const char* msg);
+
+ /**
+ * Copy constructor.
+ *
+ * @param other Other instance.
+ */
+ GridError(const GridError& other);
+
+ /**
+ * Assignment operator.
+ *
+ * @param other Other instance.
+ * @return Assignment result.
+ */
+ GridError& operator=(const GridError& other);
+
+ /**
+ * Destructor.
+ */
+ ~GridError();
+
+ /**
+ * 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, GridError* 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/0d70d547/modules/platform/src/main/cpp/core/include/ignite/grid_factory.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/ignite/grid_factory.h b/modules/platform/src/main/cpp/core/include/ignite/grid_factory.h
new file mode 100644
index 0000000..5ed9c16
--- /dev/null
+++ b/modules/platform/src/main/cpp/core/include/ignite/grid_factory.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_GRID_FACTORY
+#define _IGNITE_GRID_FACTORY
+
+#include "ignite/grid.h"
+#include "ignite/grid_configuration.h"
+#include "ignite/grid_error.h"
+
+namespace ignite
+{
+ /**
+ * This class defines a factory for the main Ignite API.
+ */
+ class IGNITE_IMPORT_EXPORT GridFactory
+ {
+ public:
+ /**
+ * Start grid instance.
+ *
+ * @param cfg Configuration.
+ * @return Grid instance or null in case of error.
+ */
+ static Grid Start(const GridConfiguration& cfg);
+
+ /*
+ * Start grid instance.
+ *
+ * @param cfg Configuration.
+ * @param err Error.
+ * @return Grid instance or null in case of error.
+ */
+ static Grid Start(const GridConfiguration& cfg, GridError* err);
+
+ /**
+ * Start grid instance with specific name.
+ *
+ * @param cfg Configuration.
+ * @param name Grid name.
+ * @return Grid instance or null in case of error.
+ */
+ static Grid Start(const GridConfiguration& cfg, const char* name);
+
+ /**
+ * Start grid instance with specific name.
+ *
+ * @param cfg Configuration.
+ * @param name Grid name.
+ * @param err Error.
+ * @return Grid instance or null in case of error.
+ */
+ static Grid Start(const GridConfiguration& cfg, const char* name, GridError* err);
+
+ /**
+ * Get default grid instance.
+ *
+ * @return Grid instance.
+ */
+ static Grid Get();
+
+ /**
+ * Get default grid instance.
+ *
+ * @param err Error.
+ * @return Grid instance.
+ */
+ static Grid Get(GridError* err);
+
+ /**
+ * Get grid instance with the given name.
+ *
+ * @param name Grid name.
+ * @return Grid instance.
+ */
+ static Grid Get(const char* name);
+
+ /**
+ * Get grid instance with the given name.
+ *
+ * @param name Grid name.
+ * @param err Error.
+ * @return Grid instance.
+ */
+ static Grid Get(const char* name, GridError* err);
+
+ /**
+ * Stop default grid instance.
+ *
+ * @param cancel Cancel flag.
+ * @return True if grid instance was stopped by this call.
+ */
+ static bool Stop(const bool cancel);
+
+ /**
+ * Stop default grid instance.
+ *
+ * @param cancel Cancel flag.
+ * @param err Error.
+ * @return True if grid instance was stopped by this call.
+ */
+ static bool Stop(const bool cancel, GridError* err);
+
+ /**
+ * Stop grid instance with the given name.
+ *
+ * @param name Grid name.
+ * @param cancel Cancel flag.
+ * @return True if grid instance was stopped by this call.
+ */
+ static bool Stop(const char* name, const bool cancel);
+
+ /**
+ * Stop grid instance with the given name.
+ *
+ * @param name Grid name.
+ * @param cancel Cancel flag.
+ * @param err Error.
+ * @return True if grid instance was stopped by this call.
+ */
+ static bool Stop(const char* name, const bool cancel, GridError* err);
+
+ /**
+ * Stop all running grid instances.
+ *
+ * @param cancel Cancel flag.
+ */
+ static void StopAll(const bool cancel);
+
+ /**
+ * Stop all running grid instances.
+ *
+ * @param cancel Cancel flag.
+ * @param err Error.
+ */
+ static void StopAll(const bool cancel, GridError* err);
+ };
+}
+
+#endif
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/0d70d547/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
new file mode 100644
index 0000000..9469769
--- /dev/null
+++ b/modules/platform/src/main/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
http://git-wip-us.apache.org/repos/asf/ignite/blob/0d70d547/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
new file mode 100644
index 0000000..7862957
--- /dev/null
+++ b/modules/platform/src/main/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/grid_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<GridEnvironment> env, jobject javaRef);
+
+ /**
+ * Destructor.
+ */
+ ~CacheImpl();
+
+ /**
+ * Get name.
+ *
+ * @return Cache name.
+ */
+ char* GetName();
+
+ /**
+ * Perform IsEmpty.
+ *
+ * @param err Error.
+ * @return Result.
+ */
+ bool IsEmpty(GridError* err);
+
+ /**
+ * Perform ContainsKey.
+ *
+ * @param inOp Input.
+ * @param err Error.
+ * @return Result.
+ */
+ bool ContainsKey(InputOperation& inOp, GridError* err);
+
+ /**
+ * Perform ContainsKeys.
+ *
+ * @param inOp Input.
+ * @param err Error.
+ * @return Result.
+ */
+ bool ContainsKeys(InputOperation& inOp, GridError* 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, GridError* err);
+
+ /**
+ * Perform Get.
+ *
+ * @param inOp Input.
+ * @param outOp Output.
+ * @param err Error.
+ */
+ void Get(InputOperation& inOp, OutputOperation& outOp, GridError* err);
+
+ /**
+ * Perform GetAll.
+ *
+ * @param inOp Input.
+ * @param outOp Output.
+ * @param err Error.
+ */
+ void GetAll(InputOperation& inOp, OutputOperation& outOp, GridError* err);
+
+ /**
+ * Perform Put.
+ *
+ * @param inOp Input.
+ * @param err Error.
+ */
+ void Put(InputOperation& inOp, GridError* err);
+
+ /**
+ * Perform PutAll.
+ *
+ * @param inOp Input.
+ * @param err Error.
+ */
+ void PutAll(InputOperation& inOp, GridError* err);
+
+ /**
+ * Perform GetAndPut.
+ *
+ * @param inOp Input.
+ * @param outOp Output.
+ * @param err Error.
+ */
+ void GetAndPut(InputOperation& inOp, OutputOperation& outOp, GridError* err);
+
+ /**
+ * Perform GetAndReplace.
+ *
+ * @param inOp Input.
+ * @param outOp Output.
+ * @param err Error.
+ */
+ void GetAndReplace(InputOperation& inOp, OutputOperation& outOp, GridError* err);
+
+ /**
+ * Perform GetAndRemove.
+ *
+ * @param inOp Input.
+ * @param outOp Output.
+ * @param err Error.
+ */
+ void GetAndRemove(InputOperation& inOp, OutputOperation& outOp, GridError* err);
+
+ /**
+ * Perform PutIfAbsent.
+ *
+ * @param inOp Input.
+ * @param err Error.
+ * @return Result
+ */
+ bool PutIfAbsent(InputOperation& inOp, GridError* err);
+
+ /**
+ * Perform GetAndPutIfAbsent.
+ *
+ * @param inOp Input.
+ * @param outOp Output.
+ * @param err Error.
+ */
+ void GetAndPutIfAbsent(InputOperation& inOp, OutputOperation& outOp, GridError* err);
+
+ /**
+ * Perform Replace(K, V).
+ *
+ * @param inOp Input.
+ * @param err Error.
+ * @return Result
+ */
+ bool Replace(InputOperation& inOp, GridError* err);
+
+ /**
+ * Perform Replace(K, V, V).
+ *
+ * @param inOp Input.
+ * @param err Error.
+ * @return Result
+ */
+ bool ReplaceIfEqual(InputOperation& inOp, GridError* err);
+
+ /**
+ * Perform LocalEvict.
+ *
+ * @param inOp Input.
+ * @param err Error.
+ */
+ void LocalEvict(InputOperation& inOp, GridError* err);
+
+ /**
+ * Perform Clear.
+ *
+ * @param err Error.
+ */
+ void Clear(GridError* err);
+
+ /**
+ * Perform Clear.
+ *
+ * @param inOp Input.
+ * @param err Error.
+ */
+ void Clear(InputOperation& inOp, GridError* err);
+
+ /**
+ * Perform ClearAll.
+ *
+ * @param inOp Input.
+ * @param err Error.
+ */
+ void ClearAll(InputOperation& inOp, GridError* err);
+
+ /**
+ * Perform LocalClear.
+ *
+ * @param inOp Input.
+ * @param err Error.
+ */
+ void LocalClear(InputOperation& inOp, GridError* err);
+
+ /**
+ * Perform LocalClearAll.
+ *
+ * @param inOp Input.
+ * @param err Error.
+ */
+ void LocalClearAll(InputOperation& inOp, GridError* err);
+
+ /**
+ * Perform Remove(K).
+ *
+ * @param inOp Input.
+ * @param err Error.
+ * @return Result
+ */
+ bool Remove(InputOperation& inOp, GridError* err);
+
+ /**
+ * Perform Remove(K, V).
+ *
+ * @param inOp Input.
+ * @param err Error.
+ * @return Result
+ */
+ bool RemoveIfEqual(InputOperation& inOp, GridError* err);
+
+ /**
+ * Perform RemoveAll.
+ *
+ * @param inOp Input.
+ * @param err Error.
+ */
+ void RemoveAll(InputOperation& inOp, GridError* err);
+
+ /**
+ * Perform RemoveAll.
+ *
+ * @param err Error.
+ */
+ void RemoveAll(GridError* err);
+
+ /**
+ * Perform Size.
+ *
+ * @param peekModes Peek modes.
+ * @param err Error.
+ * @return Result.
+ */
+ int32_t Size(const int32_t peekModes, GridError* err);
+
+ /**
+ * Perform LocalSize.
+ *
+ * @param peekModes Peek modes.
+ * @param err Error.
+ * @return Result.
+ */
+ int32_t LocalSize(const int32_t peekModes, GridError* err);
+
+ /**
+ * Invoke query.
+ *
+ * @param qry Query.
+ * @param err Error.
+ * @return Query cursor.
+ */
+ query::QueryCursorImpl* QuerySql(const ignite::cache::query::SqlQuery& qry, GridError* err);
+
+ /*
+ * Invoke text query.
+ *
+ * @param qry Query.
+ * @param err Error.
+ * @return Query cursor.
+ */
+ query::QueryCursorImpl* QueryText(const ignite::cache::query::TextQuery& qry, GridError* err);
+
+ /*
+ * Invoke scan query.
+ *
+ * @param qry Query.
+ * @param err Error.
+ * @return Query cursor.
+ */
+ query::QueryCursorImpl* QueryScan(const ignite::cache::query::ScanQuery& qry, GridError* err);
+
+ private:
+ /** Name. */
+ char* name;
+
+ /** Environment. */
+ ignite::common::concurrent::SharedPointer<GridEnvironment> 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, GridError* 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, GridError* err);
+
+ /**
+ * Internal out operation.
+ *
+ * @param opType Operation type.
+ * @param inOp Input.
+ * @param err Error.
+ * @return Result.
+ */
+ bool OutOpInternal(const int32_t opType, InputOperation& inOp, GridError* 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,
+ GridError* 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, GridError* 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);
+
+ GridError::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/0d70d547/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
new file mode 100644
index 0000000..a394383
--- /dev/null
+++ b/modules/platform/src/main/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/grid_error.h"
+#include "ignite/impl/grid_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<GridEnvironment> env, jobject javaRef);
+
+ /**
+ * Destructor.
+ */
+ ~QueryCursorImpl();
+
+ /**
+ * Check whether next result exists.
+ *
+ * @param err Error.
+ * @return True if exists.
+ */
+ bool HasNext(GridError* err);
+
+ /**
+ * Get next object.
+ *
+ * @param op Operation.
+ * @param err Error.
+ */
+ void GetNext(OutputOperation& op, GridError* err);
+
+ /**
+ * Get all cursor entries.
+ *
+ * @param op Operation.
+ * @param err Error.
+ */
+ void GetAll(OutputOperation& op, GridError* err);
+
+ private:
+ /** Environment. */
+ ignite::common::concurrent::SharedPointer<impl::GridEnvironment> 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(GridError* err);
+
+ /**
+ * Check whether Java-side iterator has next element.
+ *
+ * @param err Error.
+ * @return True if the next element is available.
+ */
+ bool IteratorHasNext(GridError* err);
+ };
+ }
+ }
+ }
+}
+
+#endif
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/0d70d547/modules/platform/src/main/cpp/core/include/ignite/impl/grid_environment.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/ignite/impl/grid_environment.h b/modules/platform/src/main/cpp/core/include/ignite/impl/grid_environment.h
new file mode 100644
index 0000000..8731d29
--- /dev/null
+++ b/modules/platform/src/main/cpp/core/include/ignite/impl/grid_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_GRID_ENVIRONMENT
+#define _IGNITE_GRID_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 GridEnvironment
+ {
+ public:
+ /**
+ * Default constructor.
+ */
+ GridEnvironment();
+
+ /**
+ * Destructor.
+ */
+ ~GridEnvironment();
+
+ /**
+ * Populate callback handlers.
+ *
+ * @param Target (current env wrapped into a shared pointer).
+ * @return JNI handlers.
+ */
+ ignite::common::java::JniHandlers GetJniHandlers(ignite::common::concurrent::SharedPointer<GridEnvironment>* 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 the grid.
+ *
+ * @return Name.
+ */
+ char* GridName();
+
+ /**
+ * 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;
+
+ /** Grid name. */
+ char* gridName;
+
+ /** Metadata manager. */
+ portable::PortableMetadataManager* metaMgr;
+
+ IGNITE_NO_COPY_ASSIGNMENT(GridEnvironment);
+ };
+ }
+}
+
+#endif
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/0d70d547/modules/platform/src/main/cpp/core/include/ignite/impl/grid_impl.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/ignite/impl/grid_impl.h b/modules/platform/src/main/cpp/core/include/ignite/impl/grid_impl.h
new file mode 100644
index 0000000..c0ad106
--- /dev/null
+++ b/modules/platform/src/main/cpp/core/include/ignite/impl/grid_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_GRID_IMPL
+#define _IGNITE_GRID_IMPL
+
+#include <ignite/common/concurrent.h>
+#include <ignite/common/java.h>
+
+#include "ignite/impl/cache/cache_impl.h"
+#include "ignite/impl/grid_environment.h"
+#include "ignite/impl/utils.h"
+
+namespace ignite
+{
+ namespace impl
+ {
+ /**
+ * Grid implementation.
+ */
+ class GridImpl
+ {
+ friend class Grid;
+ public:
+ /**
+ * Constructor used to create new instance.
+ *
+ * @param env Environment.
+ * @param javaRef Reference to java object.
+ */
+ GridImpl(ignite::common::concurrent::SharedPointer<GridEnvironment> env, jobject javaRef);
+
+ /**
+ * Destructor.
+ */
+ ~GridImpl();
+
+ /**
+ * Get name of the grid.
+ *
+ * @param Name.
+ */
+ char* GetName();
+
+ /**
+ * Get cache.
+ *
+ * @param name Cache name.
+ * @param err Error.
+ */
+ template<typename K, typename V>
+ cache::CacheImpl* GetCache(const char* name, GridError* err)
+ {
+ ignite::common::java::JniErrorInfo jniErr;
+
+ jobject cacheJavaRef = env.Get()->Context()->ProcessorCache(javaRef, name, &jniErr);
+
+ if (!cacheJavaRef)
+ {
+ GridError::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, GridError* err)
+ {
+ ignite::common::java::JniErrorInfo jniErr;
+
+ jobject cacheJavaRef = env.Get()->Context()->ProcessorGetOrCreateCache(javaRef, name, &jniErr);
+
+ if (!cacheJavaRef)
+ {
+ GridError::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, GridError* err)
+ {
+ ignite::common::java::JniErrorInfo jniErr;
+
+ jobject cacheJavaRef = env.Get()->Context()->ProcessorCreateCache(javaRef, name, &jniErr);
+
+ if (!cacheJavaRef)
+ {
+ GridError::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<GridEnvironment> env;
+
+ /** Native Java counterpart. */
+ jobject javaRef;
+
+ IGNITE_NO_COPY_ASSIGNMENT(GridImpl)
+ };
+ }
+
+}
+
+#endif
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/0d70d547/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
new file mode 100644
index 0000000..5e1b60a
--- /dev/null
+++ b/modules/platform/src/main/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/0d70d547/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
new file mode 100644
index 0000000..da4fdb9
--- /dev/null
+++ b/modules/platform/src/main/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/0d70d547/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
new file mode 100644
index 0000000..d8fcfc3
--- /dev/null
+++ b/modules/platform/src/main/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
[10/16] ignite git commit: IGNITE-1364: Moved headers to correct
folders.
Posted by vo...@apache.org.
http://git-wip-us.apache.org/repos/asf/ignite/blob/0d70d547/modules/platform/src/main/cpp/core/include/gridgain/portable/portable_type.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/gridgain/portable/portable_type.h b/modules/platform/src/main/cpp/core/include/gridgain/portable/portable_type.h
deleted file mode 100644
index c5c1cdb..0000000
--- a/modules/platform/src/main/cpp/core/include/gridgain/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 "gridgain/grid_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(GridError::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(GridError::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(GridError::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(GridError::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(GridError::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/0d70d547/modules/platform/src/main/cpp/core/include/gridgain/portable/portable_writer.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/gridgain/portable/portable_writer.h b/modules/platform/src/main/cpp/core/include/gridgain/portable/portable_writer.h
deleted file mode 100644
index 9d3a281..0000000
--- a/modules/platform/src/main/cpp/core/include/gridgain/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 "gridgain/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/0d70d547/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
new file mode 100644
index 0000000..628caa8
--- /dev/null
+++ b/modules/platform/src/main/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/grid_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()
+ {
+ GridError err;
+
+ bool res = IsEmpty(err);
+
+ GridError::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(GridError& 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)
+ {
+ GridError err;
+
+ bool res = ContainsKey(key, err);
+
+ GridError::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, GridError& 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)
+ {
+ GridError err;
+
+ bool res = ContainsKeys(keys, err);
+
+ GridError::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, GridError& 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)
+ {
+ GridError err;
+
+ V res = LocalPeek(key, peekModes, err);
+
+ GridError::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, GridError& 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)
+ {
+ GridError err;
+
+ V res = Get(key, err);
+
+ GridError::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, GridError& 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)
+ {
+ GridError err;
+
+ std::map<K, V> res = GetAll(keys, err);
+
+ GridError::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, GridError& 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)
+ {
+ GridError err;
+
+ Put(key, val, err);
+
+ GridError::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, GridError& 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)
+ {
+ GridError err;
+
+ PutAll(vals, err);
+
+ GridError::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, GridError& 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)
+ {
+ GridError err;
+
+ V res = GetAndPut(key, val, err);
+
+ GridError::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, GridError& 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)
+ {
+ GridError err;
+
+ V res = GetAndReplace(key, val, err);
+
+ GridError::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, GridError& 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)
+ {
+ GridError err;
+
+ V res = GetAndRemove(key, err);
+
+ GridError::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, GridError& 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)
+ {
+ GridError err;
+
+ bool res = PutIfAbsent(key, val, err);
+
+ GridError::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, GridError& 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)
+ {
+ GridError err;
+
+ V res = GetAndPutIfAbsent(key, val, err);
+
+ GridError::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, GridError& 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)
+ {
+ GridError err;
+
+ bool res = Replace(key, val, err);
+
+ GridError::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, GridError& 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)
+ {
+ GridError err;
+
+ bool res = Replace(key, oldVal, newVal, err);
+
+ GridError::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, GridError& 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)
+ {
+ GridError err;
+
+ LocalEvict(keys, err);
+
+ GridError::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, GridError& err)
+ {
+ impl::InSetOperation<K> op(&keys);
+
+ impl.Get()->LocalEvict(op, &err);
+ }
+
+ /**
+ * Clear cache.
+ */
+ void Clear()
+ {
+ GridError err;
+
+ Clear(err);
+
+ GridError::ThrowIfNeeded(err);
+ }
+
+ /**
+ * Clear cache.
+ *
+ * @param err Error.
+ */
+ void Clear(GridError& 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)
+ {
+ GridError err;
+
+ Clear(key, err);
+
+ GridError::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, GridError& 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)
+ {
+ GridError err;
+
+ ClearAll(keys, err);
+
+ GridError::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, GridError& 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)
+ {
+ GridError err;
+
+ LocalClear(key, err);
+
+ GridError::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, GridError& 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)
+ {
+ GridError err;
+
+ LocalClearAll(keys, err);
+
+ GridError::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, GridError& 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)
+ {
+ GridError err;
+
+ bool res = Remove(key, err);
+
+ GridError::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, GridError& 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)
+ {
+ GridError err;
+
+ bool res = Remove(key, val, err);
+
+ GridError::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, GridError& 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)
+ {
+ GridError err;
+
+ RemoveAll(keys, err);
+
+ GridError::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, GridError& 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()
+ {
+ GridError err;
+
+ RemoveAll(err);
+
+ GridError::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(GridError& 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(GridError& 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)
+ {
+ GridError err;
+
+ int32_t res = LocalSize(peekModes, err);
+
+ GridError::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, GridError& 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(GridError& 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)
+ {
+ GridError err;
+
+ int32_t res = Size(peekModes, err);
+
+ GridError::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, GridError& 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)
+ {
+ GridError err;
+
+ query::QueryCursor<K, V> res = Query(qry, err);
+
+ GridError::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, GridError& 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)
+ {
+ GridError err;
+
+ query::QueryCursor<K, V> res = Query(qry, err);
+
+ GridError::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, GridError& 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)
+ {
+ GridError err;
+
+ query::QueryCursor<K, V> res = Query(qry, err);
+
+ GridError::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, GridError& 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/0d70d547/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
new file mode 100644
index 0000000..2b6c785
--- /dev/null
+++ b/modules/platform/src/main/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/0d70d547/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
new file mode 100644
index 0000000..be61887
--- /dev/null
+++ b/modules/platform/src/main/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/0d70d547/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
new file mode 100644
index 0000000..f2d19cd
--- /dev/null
+++ b/modules/platform/src/main/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/0d70d547/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
new file mode 100644
index 0000000..0f41c56
--- /dev/null
+++ b/modules/platform/src/main/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/0d70d547/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
new file mode 100644
index 0000000..7860676
--- /dev/null
+++ b/modules/platform/src/main/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/grid_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()
+ {
+ GridError err;
+
+ bool res = HasNext(err);
+
+ GridError::ThrowIfNeeded(err);
+
+ return res;
+ }
+
+ /**
+ * Check whether next entry exists.
+ *
+ * @param err Error.
+ * @return True if next entry exists.
+ */
+ bool HasNext(GridError& err)
+ {
+ impl::cache::query::QueryCursorImpl* impl0 = impl.Get();
+
+ if (impl0)
+ return impl0->HasNext(&err);
+ else
+ {
+ err = GridError(GridError::IGNITE_ERR_GENERIC,
+ "Instance is not usable (did you check for error?).");
+
+ return false;
+ }
+ }
+
+ /**
+ * Get next entry.
+ *
+ * @return Next entry.
+ */
+ CacheEntry<K, V> GetNext()
+ {
+ GridError err;
+
+ CacheEntry<K, V> res = GetNext(err);
+
+ GridError::ThrowIfNeeded(err);
+
+ return res;
+ }
+
+ /**
+ * Get next entry.
+ *
+ * @param err Error.
+ * @return Next entry.
+ */
+ CacheEntry<K, V> GetNext(GridError& err)
+ {
+ impl::cache::query::QueryCursorImpl* impl0 = impl.Get();
+
+ if (impl0) {
+ impl::Out2Operation<K, V> outOp;
+
+ impl0->GetNext(outOp, &err);
+
+ if (err.GetCode() == GridError::IGNITE_SUCCESS)
+ {
+ K& key = outOp.Get1();
+ V& val = outOp.Get2();
+
+ return CacheEntry<K, V>(key, val);
+ }
+ else
+ return CacheEntry<K, V>();
+ }
+ else
+ {
+ err = GridError(GridError::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)
+ {
+ GridError err;
+
+ GetAll(res, err);
+
+ GridError::ThrowIfNeeded(err);
+ }
+
+ /**
+ * Get all entries.
+ *
+ * @param Vector where query entries will be stored.
+ * @param err Error.
+ */
+ void GetAll(std::vector<CacheEntry<K, V>>& res, GridError& err)
+ {
+ impl::cache::query::QueryCursorImpl* impl0 = impl.Get();
+
+ if (impl0) {
+ impl::OutQueryGetAllOperation<K, V> outOp(&res);
+
+ impl0->GetAll(outOp, &err);
+ }
+ else
+ err = GridError(GridError::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/0d70d547/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
new file mode 100644
index 0000000..c3ec845
--- /dev/null
+++ b/modules/platform/src/main/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
[14/16] ignite git commit: IGNITE-1364: Moved headers to correct
folders.
Posted by vo...@apache.org.
http://git-wip-us.apache.org/repos/asf/ignite/blob/0d70d547/modules/platform/src/main/cpp/core/include/gridgain/cache/query/query_sql.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/gridgain/cache/query/query_sql.h b/modules/platform/src/main/cpp/core/include/gridgain/cache/query/query_sql.h
deleted file mode 100644
index aab4398..0000000
--- a/modules/platform/src/main/cpp/core/include/gridgain/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 "gridgain/cache/query/query_argument.h"
-#include "gridgain/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/0d70d547/modules/platform/src/main/cpp/core/include/gridgain/cache/query/query_text.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/gridgain/cache/query/query_text.h b/modules/platform/src/main/cpp/core/include/gridgain/cache/query/query_text.h
deleted file mode 100644
index 016684c..0000000
--- a/modules/platform/src/main/cpp/core/include/gridgain/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 "gridgain/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/0d70d547/modules/platform/src/main/cpp/core/include/gridgain/grid.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/gridgain/grid.h b/modules/platform/src/main/cpp/core/include/gridgain/grid.h
deleted file mode 100644
index efd3d57..0000000
--- a/modules/platform/src/main/cpp/core/include/gridgain/grid.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_GRID
-#define _IGNITE_GRID
-
-#include "gridgain/cache/cache.h"
-#include "gridgain/impl/grid_impl.h"
-#include "gridgain/grid_configuration.h"
-
-namespace ignite
-{
- /**
- * Main interface to operate with GridGain.
- */
- class IGNITE_IMPORT_EXPORT Grid
- {
- public:
- /**
- * Default constructor.
- */
- Grid();
-
- /**
- * Constructor.
- */
- Grid(impl::GridImpl* impl);
-
- /**
- * Get name of the grid.
- *
- * @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)
- {
- GridError err;
-
- cache::Cache<K, V> res = GetCache<K, V>(name, &err);
-
- GridError::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, GridError* 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)
- {
- GridError err;
-
- cache::Cache<K, V> res = GetOrCreateCache<K, V>(name, &err);
-
- GridError::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, GridError* 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)
- {
- GridError err;
-
- cache::Cache<K, V> res = CreateCache<K, V>(name, &err);
-
- GridError::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, GridError* 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::GridImpl> impl;
- };
-}
-
-#endif
http://git-wip-us.apache.org/repos/asf/ignite/blob/0d70d547/modules/platform/src/main/cpp/core/include/gridgain/grid_configuration.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/gridgain/grid_configuration.h b/modules/platform/src/main/cpp/core/include/gridgain/grid_configuration.h
deleted file mode 100644
index 65d2c8e..0000000
--- a/modules/platform/src/main/cpp/core/include/gridgain/grid_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_GRID_CONFIGURATION
-#define _IGNITE_GRID_CONFIGURATION
-
-#include <stdint.h>
-
-namespace ignite
-{
- /**
- * Single JVM option.
- */
- struct GridJvmOption
- {
- /** Option. */
- char* opt;
-
- /**
- * Default constructor.
- */
- GridJvmOption() : opt(NULL)
- {
- // No-op.
- }
-
- /**
- * Constructor.
- *
- * @param opt Option.
- */
- GridJvmOption(char* opt) : opt(opt)
- {
- // No-op.
- }
- };
-
- /**
- * Grid configuration.
- */
- struct GridConfiguration
- {
- /** Path to GridGain home. */
- char* gridGainHome;
-
- /** 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. */
- GridJvmOption* jvmOpts;
-
- /** Additional JVM options count. */
- int32_t jvmOptsLen;
-
- /**
- * Constructor.
- */
- GridConfiguration() : gridGainHome(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/0d70d547/modules/platform/src/main/cpp/core/include/gridgain/grid_error.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/gridgain/grid_error.h b/modules/platform/src/main/cpp/core/include/gridgain/grid_error.h
deleted file mode 100644
index 47c54b1..0000000
--- a/modules/platform/src/main/cpp/core/include/gridgain/grid_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_GRID_ERROR
-#define _IGNITE_GRID_ERROR
-
-#include <sstream>
-#include <stdint.h>
-
-#include <ignite/common/common.h>
-
-#define IGNITE_ERROR_1(code, part1) { \
- std::stringstream stream; \
- stream << (part1); \
- throw ignite::GridError(code, stream.str().c_str()); \
-}
-
-#define IGNITE_ERROR_2(code, part1, part2) { \
- std::stringstream stream; \
- stream << (part1) << (part2); \
- throw ignite::GridError(code, stream.str().c_str()); \
-}
-
-#define IGNITE_ERROR_3(code, part1, part2, part3) { \
- std::stringstream stream; \
- stream << (part1) << (part2) << (part3); \
- throw ignite::GridError(code, stream.str().c_str()); \
-}
-
-#define IGNITE_ERROR_FORMATTED_1(code, msg, key1, val1) { \
- std::stringstream stream; \
- stream << msg << " [" << key1 << "=" << (val1) << "]"; \
- throw ignite::GridError(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::GridError(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::GridError(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::GridError(code, stream.str().c_str()); \
-}
-
-namespace ignite
-{
- /**
- * Grid error information.
- */
- class IGNITE_IMPORT_EXPORT GridError
- {
- 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 GridGain 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(GridError& err);
-
- /**
- * Create empty error.
- */
- GridError();
-
- /**
- * Create error with specific code.
- *
- * @param code Error code.
- */
- GridError(const int32_t code);
-
- /**
- * Create error with specific code and message.
- *
- * @param code Error code.
- * @param msg Message.
- */
- GridError(const int32_t code, const char* msg);
-
- /**
- * Copy constructor.
- *
- * @param other Other instance.
- */
- GridError(const GridError& other);
-
- /**
- * Assignment operator.
- *
- * @param other Other instance.
- * @return Assignment result.
- */
- GridError& operator=(const GridError& other);
-
- /**
- * Destructor.
- */
- ~GridError();
-
- /**
- * 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, GridError* 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/0d70d547/modules/platform/src/main/cpp/core/include/gridgain/grid_factory.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/gridgain/grid_factory.h b/modules/platform/src/main/cpp/core/include/gridgain/grid_factory.h
deleted file mode 100644
index 0d45b97..0000000
--- a/modules/platform/src/main/cpp/core/include/gridgain/grid_factory.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 GridGain for C++ Library
- *
- * The GridGain In-Memory Data Fabric 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 GridGain In-Memory Data Fabric 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 GridGain In-Memory Data Fabric 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 GridGain In-Memory Data Fabric 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 GridGain Data Fabric 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_GRID_FACTORY
-#define _IGNITE_GRID_FACTORY
-
-#include "gridgain/grid.h"
-#include "gridgain/grid_configuration.h"
-#include "gridgain/grid_error.h"
-
-namespace ignite
-{
- /**
- * This class defines a factory for the main GridGain API.
- */
- class IGNITE_IMPORT_EXPORT GridFactory
- {
- public:
- /**
- * Start grid instance.
- *
- * @param cfg Configuration.
- * @return Grid instance or null in case of error.
- */
- static Grid Start(const GridConfiguration& cfg);
-
- /*
- * Start grid instance.
- *
- * @param cfg Configuration.
- * @param err Error.
- * @return Grid instance or null in case of error.
- */
- static Grid Start(const GridConfiguration& cfg, GridError* err);
-
- /**
- * Start grid instance with specific name.
- *
- * @param cfg Configuration.
- * @param name Grid name.
- * @return Grid instance or null in case of error.
- */
- static Grid Start(const GridConfiguration& cfg, const char* name);
-
- /**
- * Start grid instance with specific name.
- *
- * @param cfg Configuration.
- * @param name Grid name.
- * @param err Error.
- * @return Grid instance or null in case of error.
- */
- static Grid Start(const GridConfiguration& cfg, const char* name, GridError* err);
-
- /**
- * Get default grid instance.
- *
- * @return Grid instance.
- */
- static Grid Get();
-
- /**
- * Get default grid instance.
- *
- * @param err Error.
- * @return Grid instance.
- */
- static Grid Get(GridError* err);
-
- /**
- * Get grid instance with the given name.
- *
- * @param name Grid name.
- * @return Grid instance.
- */
- static Grid Get(const char* name);
-
- /**
- * Get grid instance with the given name.
- *
- * @param name Grid name.
- * @param err Error.
- * @return Grid instance.
- */
- static Grid Get(const char* name, GridError* err);
-
- /**
- * Stop default grid instance.
- *
- * @param cancel Cancel flag.
- * @return True if grid instance was stopped by this call.
- */
- static bool Stop(const bool cancel);
-
- /**
- * Stop default grid instance.
- *
- * @param cancel Cancel flag.
- * @param err Error.
- * @return True if grid instance was stopped by this call.
- */
- static bool Stop(const bool cancel, GridError* err);
-
- /**
- * Stop grid instance with the given name.
- *
- * @param name Grid name.
- * @param cancel Cancel flag.
- * @return True if grid instance was stopped by this call.
- */
- static bool Stop(const char* name, const bool cancel);
-
- /**
- * Stop grid instance with the given name.
- *
- * @param name Grid name.
- * @param cancel Cancel flag.
- * @param err Error.
- * @return True if grid instance was stopped by this call.
- */
- static bool Stop(const char* name, const bool cancel, GridError* err);
-
- /**
- * Stop all running grid instances.
- *
- * @param cancel Cancel flag.
- */
- static void StopAll(const bool cancel);
-
- /**
- * Stop all running grid instances.
- *
- * @param cancel Cancel flag.
- * @param err Error.
- */
- static void StopAll(const bool cancel, GridError* err);
- };
-}
-
-#endif
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/0d70d547/modules/platform/src/main/cpp/core/include/gridgain/guid.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/gridgain/guid.h b/modules/platform/src/main/cpp/core/include/gridgain/guid.h
deleted file mode 100644
index 9469769..0000000
--- a/modules/platform/src/main/cpp/core/include/gridgain/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
http://git-wip-us.apache.org/repos/asf/ignite/blob/0d70d547/modules/platform/src/main/cpp/core/include/gridgain/impl/cache/cache_impl.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/gridgain/impl/cache/cache_impl.h b/modules/platform/src/main/cpp/core/include/gridgain/impl/cache/cache_impl.h
deleted file mode 100644
index e769402..0000000
--- a/modules/platform/src/main/cpp/core/include/gridgain/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 "gridgain/cache/query/query_scan.h"
-#include "gridgain/cache/query/query_sql.h"
-#include "gridgain/cache/query/query_text.h"
-#include "gridgain/impl/grid_environment.h"
-#include "gridgain/impl/cache/query/query_impl.h"
-#include "gridgain/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<GridEnvironment> env, jobject javaRef);
-
- /**
- * Destructor.
- */
- ~CacheImpl();
-
- /**
- * Get name.
- *
- * @return Cache name.
- */
- char* GetName();
-
- /**
- * Perform IsEmpty.
- *
- * @param err Error.
- * @return Result.
- */
- bool IsEmpty(GridError* err);
-
- /**
- * Perform ContainsKey.
- *
- * @param inOp Input.
- * @param err Error.
- * @return Result.
- */
- bool ContainsKey(InputOperation& inOp, GridError* err);
-
- /**
- * Perform ContainsKeys.
- *
- * @param inOp Input.
- * @param err Error.
- * @return Result.
- */
- bool ContainsKeys(InputOperation& inOp, GridError* 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, GridError* err);
-
- /**
- * Perform Get.
- *
- * @param inOp Input.
- * @param outOp Output.
- * @param err Error.
- */
- void Get(InputOperation& inOp, OutputOperation& outOp, GridError* err);
-
- /**
- * Perform GetAll.
- *
- * @param inOp Input.
- * @param outOp Output.
- * @param err Error.
- */
- void GetAll(InputOperation& inOp, OutputOperation& outOp, GridError* err);
-
- /**
- * Perform Put.
- *
- * @param inOp Input.
- * @param err Error.
- */
- void Put(InputOperation& inOp, GridError* err);
-
- /**
- * Perform PutAll.
- *
- * @param inOp Input.
- * @param err Error.
- */
- void PutAll(InputOperation& inOp, GridError* err);
-
- /**
- * Perform GetAndPut.
- *
- * @param inOp Input.
- * @param outOp Output.
- * @param err Error.
- */
- void GetAndPut(InputOperation& inOp, OutputOperation& outOp, GridError* err);
-
- /**
- * Perform GetAndReplace.
- *
- * @param inOp Input.
- * @param outOp Output.
- * @param err Error.
- */
- void GetAndReplace(InputOperation& inOp, OutputOperation& outOp, GridError* err);
-
- /**
- * Perform GetAndRemove.
- *
- * @param inOp Input.
- * @param outOp Output.
- * @param err Error.
- */
- void GetAndRemove(InputOperation& inOp, OutputOperation& outOp, GridError* err);
-
- /**
- * Perform PutIfAbsent.
- *
- * @param inOp Input.
- * @param err Error.
- * @return Result
- */
- bool PutIfAbsent(InputOperation& inOp, GridError* err);
-
- /**
- * Perform GetAndPutIfAbsent.
- *
- * @param inOp Input.
- * @param outOp Output.
- * @param err Error.
- */
- void GetAndPutIfAbsent(InputOperation& inOp, OutputOperation& outOp, GridError* err);
-
- /**
- * Perform Replace(K, V).
- *
- * @param inOp Input.
- * @param err Error.
- * @return Result
- */
- bool Replace(InputOperation& inOp, GridError* err);
-
- /**
- * Perform Replace(K, V, V).
- *
- * @param inOp Input.
- * @param err Error.
- * @return Result
- */
- bool ReplaceIfEqual(InputOperation& inOp, GridError* err);
-
- /**
- * Perform LocalEvict.
- *
- * @param inOp Input.
- * @param err Error.
- */
- void LocalEvict(InputOperation& inOp, GridError* err);
-
- /**
- * Perform Clear.
- *
- * @param err Error.
- */
- void Clear(GridError* err);
-
- /**
- * Perform Clear.
- *
- * @param inOp Input.
- * @param err Error.
- */
- void Clear(InputOperation& inOp, GridError* err);
-
- /**
- * Perform ClearAll.
- *
- * @param inOp Input.
- * @param err Error.
- */
- void ClearAll(InputOperation& inOp, GridError* err);
-
- /**
- * Perform LocalClear.
- *
- * @param inOp Input.
- * @param err Error.
- */
- void LocalClear(InputOperation& inOp, GridError* err);
-
- /**
- * Perform LocalClearAll.
- *
- * @param inOp Input.
- * @param err Error.
- */
- void LocalClearAll(InputOperation& inOp, GridError* err);
-
- /**
- * Perform Remove(K).
- *
- * @param inOp Input.
- * @param err Error.
- * @return Result
- */
- bool Remove(InputOperation& inOp, GridError* err);
-
- /**
- * Perform Remove(K, V).
- *
- * @param inOp Input.
- * @param err Error.
- * @return Result
- */
- bool RemoveIfEqual(InputOperation& inOp, GridError* err);
-
- /**
- * Perform RemoveAll.
- *
- * @param inOp Input.
- * @param err Error.
- */
- void RemoveAll(InputOperation& inOp, GridError* err);
-
- /**
- * Perform RemoveAll.
- *
- * @param err Error.
- */
- void RemoveAll(GridError* err);
-
- /**
- * Perform Size.
- *
- * @param peekModes Peek modes.
- * @param err Error.
- * @return Result.
- */
- int32_t Size(const int32_t peekModes, GridError* err);
-
- /**
- * Perform LocalSize.
- *
- * @param peekModes Peek modes.
- * @param err Error.
- * @return Result.
- */
- int32_t LocalSize(const int32_t peekModes, GridError* err);
-
- /**
- * Invoke query.
- *
- * @param qry Query.
- * @param err Error.
- * @return Query cursor.
- */
- query::QueryCursorImpl* QuerySql(const ignite::cache::query::SqlQuery& qry, GridError* err);
-
- /*
- * Invoke text query.
- *
- * @param qry Query.
- * @param err Error.
- * @return Query cursor.
- */
- query::QueryCursorImpl* QueryText(const ignite::cache::query::TextQuery& qry, GridError* err);
-
- /*
- * Invoke scan query.
- *
- * @param qry Query.
- * @param err Error.
- * @return Query cursor.
- */
- query::QueryCursorImpl* QueryScan(const ignite::cache::query::ScanQuery& qry, GridError* err);
-
- private:
- /** Name. */
- char* name;
-
- /** Environment. */
- ignite::common::concurrent::SharedPointer<GridEnvironment> 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, GridError* 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, GridError* err);
-
- /**
- * Internal out operation.
- *
- * @param opType Operation type.
- * @param inOp Input.
- * @param err Error.
- * @return Result.
- */
- bool OutOpInternal(const int32_t opType, InputOperation& inOp, GridError* 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,
- GridError* 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, GridError* 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);
-
- GridError::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/0d70d547/modules/platform/src/main/cpp/core/include/gridgain/impl/cache/query/query_impl.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/gridgain/impl/cache/query/query_impl.h b/modules/platform/src/main/cpp/core/include/gridgain/impl/cache/query/query_impl.h
deleted file mode 100644
index 7cf84fe..0000000
--- a/modules/platform/src/main/cpp/core/include/gridgain/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 <gridgain/impl/grid_environment.h>
-#include <gridgain/grid_error.h>
-#include <gridgain/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<GridEnvironment> env, jobject javaRef);
-
- /**
- * Destructor.
- */
- ~QueryCursorImpl();
-
- /**
- * Check whether next result exists.
- *
- * @param err Error.
- * @return True if exists.
- */
- bool HasNext(GridError* err);
-
- /**
- * Get next object.
- *
- * @param op Operation.
- * @param err Error.
- */
- void GetNext(OutputOperation& op, GridError* err);
-
- /**
- * Get all cursor entries.
- *
- * @param op Operation.
- * @param err Error.
- */
- void GetAll(OutputOperation& op, GridError* err);
-
- private:
- /** Environment. */
- ignite::common::concurrent::SharedPointer<impl::GridEnvironment> 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(GridError* err);
-
- /**
- * Check whether Java-side iterator has next element.
- *
- * @param err Error.
- * @return True if the next element is available.
- */
- bool IteratorHasNext(GridError* err);
- };
- }
- }
- }
-}
-
-#endif
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/0d70d547/modules/platform/src/main/cpp/core/include/gridgain/impl/grid_environment.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/gridgain/impl/grid_environment.h b/modules/platform/src/main/cpp/core/include/gridgain/impl/grid_environment.h
deleted file mode 100644
index 600a699..0000000
--- a/modules/platform/src/main/cpp/core/include/gridgain/impl/grid_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_GRID_ENVIRONMENT
-#define _IGNITE_GRID_ENVIRONMENT
-
-#include <ignite/common/concurrent.h>
-#include <ignite/common/java.h>
-
-#include "gridgain/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 GridEnvironment
- {
- public:
- /**
- * Default constructor.
- */
- GridEnvironment();
-
- /**
- * Destructor.
- */
- ~GridEnvironment();
-
- /**
- * Populate callback handlers.
- *
- * @param Target (current env wrapped into a shared pointer).
- * @return JNI handlers.
- */
- ignite::common::java::JniHandlers GetJniHandlers(ignite::common::concurrent::SharedPointer<GridEnvironment>* 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 the grid.
- *
- * @return Name.
- */
- char* GridName();
-
- /**
- * 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;
-
- /** Grid name. */
- char* gridName;
-
- /** Metadata manager. */
- portable::PortableMetadataManager* metaMgr;
-
- IGNITE_NO_COPY_ASSIGNMENT(GridEnvironment);
- };
- }
-}
-
-#endif
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/0d70d547/modules/platform/src/main/cpp/core/include/gridgain/impl/grid_impl.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/gridgain/impl/grid_impl.h b/modules/platform/src/main/cpp/core/include/gridgain/impl/grid_impl.h
deleted file mode 100644
index 6c45ec2..0000000
--- a/modules/platform/src/main/cpp/core/include/gridgain/impl/grid_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_GRID_IMPL
-#define _IGNITE_GRID_IMPL
-
-#include <ignite/common/concurrent.h>
-#include <ignite/common/java.h>
-
-#include "gridgain/impl/cache/cache_impl.h"
-#include "gridgain/impl/grid_environment.h"
-#include "gridgain/impl/utils.h"
-
-namespace ignite
-{
- namespace impl
- {
- /**
- * Grid implementation.
- */
- class GridImpl
- {
- friend class Grid;
- public:
- /**
- * Constructor used to create new instance.
- *
- * @param env Environment.
- * @param javaRef Reference to java object.
- */
- GridImpl(ignite::common::concurrent::SharedPointer<GridEnvironment> env, jobject javaRef);
-
- /**
- * Destructor.
- */
- ~GridImpl();
-
- /**
- * Get name of the grid.
- *
- * @param Name.
- */
- char* GetName();
-
- /**
- * Get cache.
- *
- * @param name Cache name.
- * @param err Error.
- */
- template<typename K, typename V>
- cache::CacheImpl* GetCache(const char* name, GridError* err)
- {
- ignite::common::java::JniErrorInfo jniErr;
-
- jobject cacheJavaRef = env.Get()->Context()->ProcessorCache(javaRef, name, &jniErr);
-
- if (!cacheJavaRef)
- {
- GridError::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, GridError* err)
- {
- ignite::common::java::JniErrorInfo jniErr;
-
- jobject cacheJavaRef = env.Get()->Context()->ProcessorGetOrCreateCache(javaRef, name, &jniErr);
-
- if (!cacheJavaRef)
- {
- GridError::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, GridError* err)
- {
- ignite::common::java::JniErrorInfo jniErr;
-
- jobject cacheJavaRef = env.Get()->Context()->ProcessorCreateCache(javaRef, name, &jniErr);
-
- if (!cacheJavaRef)
- {
- GridError::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<GridEnvironment> env;
-
- /** Native Java counterpart. */
- jobject javaRef;
-
- IGNITE_NO_COPY_ASSIGNMENT(GridImpl)
- };
- }
-
-}
-
-#endif
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/0d70d547/modules/platform/src/main/cpp/core/include/gridgain/impl/handle_registry.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/gridgain/impl/handle_registry.h b/modules/platform/src/main/cpp/core/include/gridgain/impl/handle_registry.h
deleted file mode 100644
index 5e1b60a..0000000
--- a/modules/platform/src/main/cpp/core/include/gridgain/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/0d70d547/modules/platform/src/main/cpp/core/include/gridgain/impl/interop/interop.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/gridgain/impl/interop/interop.h b/modules/platform/src/main/cpp/core/include/gridgain/impl/interop/interop.h
deleted file mode 100644
index f9d3f6c..0000000
--- a/modules/platform/src/main/cpp/core/include/gridgain/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 "gridgain/impl/interop/interop_memory.h"
-#include "gridgain/impl/interop/interop_output_stream.h"
-#include "gridgain/impl/interop/interop_input_stream.h"
-
-#endif
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/0d70d547/modules/platform/src/main/cpp/core/include/gridgain/impl/interop/interop_input_stream.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/gridgain/impl/interop/interop_input_stream.h b/modules/platform/src/main/cpp/core/include/gridgain/impl/interop/interop_input_stream.h
deleted file mode 100644
index 4cf3b04..0000000
--- a/modules/platform/src/main/cpp/core/include/gridgain/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 "gridgain/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
[12/16] ignite git commit: IGNITE-1364: Moved headers to correct
folders.
Posted by vo...@apache.org.
http://git-wip-us.apache.org/repos/asf/ignite/blob/0d70d547/modules/platform/src/main/cpp/core/include/gridgain/impl/portable/portable_reader_impl.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/gridgain/impl/portable/portable_reader_impl.h b/modules/platform/src/main/cpp/core/include/gridgain/impl/portable/portable_reader_impl.h
deleted file mode 100644
index 75debc4..0000000
--- a/modules/platform/src/main/cpp/core/include/gridgain/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 "gridgain/impl/interop/interop_input_stream.h"
-#include "gridgain/impl/portable/portable_common.h"
-#include "gridgain/impl/portable/portable_id_resolver.h"
-#include "gridgain/impl/portable/portable_utils.h"
-#include "gridgain/impl/utils.h"
-#include "gridgain/portable/portable_consts.h"
-#include "gridgain/portable/portable_type.h"
-#include "gridgain/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::GridError::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(GridError::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(GridError::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(GridError::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(GridError::IGNITE_ERR_PORTABLE, "Invalid header", "position", pos, "expected", IGNITE_TYPE_STRING, "actual", typeId)
- }
- }
- }
- }
-}
-
-#endif
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/0d70d547/modules/platform/src/main/cpp/core/include/gridgain/impl/portable/portable_utils.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/gridgain/impl/portable/portable_utils.h b/modules/platform/src/main/cpp/core/include/gridgain/impl/portable/portable_utils.h
deleted file mode 100644
index aa7ecba..0000000
--- a/modules/platform/src/main/cpp/core/include/gridgain/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 "gridgain/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
[06/16] ignite git commit: IGNITE-1364: Moved headers to correct
folders.
Posted by vo...@apache.org.
http://git-wip-us.apache.org/repos/asf/ignite/blob/0d70d547/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
new file mode 100644
index 0000000..b38dc1f
--- /dev/null
+++ b/modules/platform/src/main/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/0d70d547/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
new file mode 100644
index 0000000..1a7c3dd
--- /dev/null
+++ b/modules/platform/src/main/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/0d70d547/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
new file mode 100644
index 0000000..ef6db45
--- /dev/null
+++ b/modules/platform/src/main/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/0d70d547/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
new file mode 100644
index 0000000..f93a11a
--- /dev/null
+++ b/modules/platform/src/main/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/0d70d547/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
new file mode 100644
index 0000000..9f1d74c
--- /dev/null
+++ b/modules/platform/src/main/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/0d70d547/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
new file mode 100644
index 0000000..47b5880
--- /dev/null
+++ b/modules/platform/src/main/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
http://git-wip-us.apache.org/repos/asf/ignite/blob/0d70d547/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
new file mode 100644
index 0000000..5e4b7ad
--- /dev/null
+++ b/modules/platform/src/main/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
[07/16] ignite git commit: IGNITE-1364: Moved headers to correct
folders.
Posted by vo...@apache.org.
http://git-wip-us.apache.org/repos/asf/ignite/blob/0d70d547/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
new file mode 100644
index 0000000..119332f
--- /dev/null
+++ b/modules/platform/src/main/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::GridError::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(GridError::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(GridError::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(GridError::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(GridError::IGNITE_ERR_PORTABLE, "Invalid header", "position", pos, "expected", IGNITE_TYPE_STRING, "actual", typeId)
+ }
+ }
+ }
+ }
+}
+
+#endif
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/0d70d547/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
new file mode 100644
index 0000000..dd16686
--- /dev/null
+++ b/modules/platform/src/main/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
[08/16] ignite git commit: IGNITE-1364: Moved headers to correct
folders.
Posted by vo...@apache.org.
http://git-wip-us.apache.org/repos/asf/ignite/blob/0d70d547/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
new file mode 100644
index 0000000..00cba43
--- /dev/null
+++ b/modules/platform/src/main/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/0d70d547/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
new file mode 100644
index 0000000..5a08aed
--- /dev/null
+++ b/modules/platform/src/main/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
http://git-wip-us.apache.org/repos/asf/ignite/blob/0d70d547/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
new file mode 100644
index 0000000..8f32922
--- /dev/null
+++ b/modules/platform/src/main/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/0d70d547/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
new file mode 100644
index 0000000..622cb54
--- /dev/null
+++ b/modules/platform/src/main/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/0d70d547/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
new file mode 100644
index 0000000..e3c1955
--- /dev/null
+++ b/modules/platform/src/main/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(GridError::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/0d70d547/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
new file mode 100644
index 0000000..a557129
--- /dev/null
+++ b/modules/platform/src/main/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/0d70d547/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
new file mode 100644
index 0000000..eb2f445
--- /dev/null
+++ b/modules/platform/src/main/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/grid_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, GridError* 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/0d70d547/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
new file mode 100644
index 0000000..1e000fc
--- /dev/null
+++ b/modules/platform/src/main/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/0d70d547/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
new file mode 100644
index 0000000..bd53df6
--- /dev/null
+++ b/modules/platform/src/main/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/grid_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, GridError* err) = 0;
+ };
+ }
+ }
+}
+
+#endif
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/0d70d547/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
new file mode 100644
index 0000000..d03f34b
--- /dev/null
+++ b/modules/platform/src/main/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/grid_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<GridEnvironment> env, jobject javaRef);
+
+ /**
+ * Destructor.
+ */
+ ~PortableMetadataUpdaterImpl();
+
+ bool Update(Snap* snapshot, GridError* err);
+ private:
+ /** Environment. */
+ ignite::common::concurrent::SharedPointer<GridEnvironment> env;
+
+ /** Handle to Java object. */
+ jobject javaRef;
+
+ IGNITE_NO_COPY_ASSIGNMENT(PortableMetadataUpdaterImpl)
+ };
+ }
+ }
+}
+
+#endif
\ No newline at end of file
[05/16] ignite git commit: IGNITE-1364: Moved headers to correct
folders.
Posted by vo...@apache.org.
http://git-wip-us.apache.org/repos/asf/ignite/blob/0d70d547/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
new file mode 100644
index 0000000..ce5b2fa
--- /dev/null
+++ b/modules/platform/src/main/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/grid_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(GridError::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(GridError::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(GridError::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(GridError::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(GridError::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/0d70d547/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
new file mode 100644
index 0000000..5dc9494
--- /dev/null
+++ b/modules/platform/src/main/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/0d70d547/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
index 7402d04..2ee13eff 100644
--- a/modules/platform/src/main/cpp/core/os/linux/include/Makefile.am
+++ b/modules/platform/src/main/cpp/core/os/linux/include/Makefile.am
@@ -17,4 +17,4 @@
ACLOCAL_AMFLAGS = "-Im4"
-nobase_include_HEADERS = gridgain/impl/utils.h
+nobase_include_HEADERS = ignite/impl/utils.h
http://git-wip-us.apache.org/repos/asf/ignite/blob/0d70d547/modules/platform/src/main/cpp/core/os/linux/include/gridgain/impl/utils.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/os/linux/include/gridgain/impl/utils.h b/modules/platform/src/main/cpp/core/os/linux/include/gridgain/impl/utils.h
deleted file mode 100644
index 5cbd6cf..0000000
--- a/modules/platform/src/main/cpp/core/os/linux/include/gridgain/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 GRIDGAIN_UTILS
-#define GRIDGAIN_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 gridgain
-{
- 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 GRIDGAIN_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,
- * GRIDGAIN_HOME is considered resolved.
- *
- * @param path Optional path to evaluate.
- * @param found Whether GRIDGAIN_HOME home was found.
- * @return Resolved GG home.
- */
- IGNITE_FRIEND_EXPORT std::string ResolveGridGainHome(const std::string* path, bool* found);
-
- /**
- * Create GridGain classpath based on user input and home directory.
- *
- * @param usrCp User's classpath.
- * @param home GridGain home directory.
- * @return Classpath.
- */
- IGNITE_FRIEND_EXPORT std::string CreateGridGainClasspath(const std::string* usrCp, const std::string* home);
-
- /**
- * Create GridGain classpath based on user input and home directory.
- *
- * @param usrCp User's classpath.
- * @param home GridGain home directory.
- * @param test Whether test classpath must be used.
- * @return Classpath.
- */
- IGNITE_FRIEND_EXPORT std::string CreateGridGainClasspath(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/0d70d547/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
new file mode 100644
index 0000000..f2fc6e3
--- /dev/null
+++ b/modules/platform/src/main/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 GRIDGAIN_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,
+ * GRIDGAIN_HOME is considered resolved.
+ *
+ * @param path Optional path to evaluate.
+ * @param found Whether GRIDGAIN_HOME home was found.
+ * @return Resolved GG home.
+ */
+ IGNITE_FRIEND_EXPORT std::string ResolveGridGainHome(const std::string* path, bool* found);
+
+ /**
+ * Create GridGain classpath based on user input and home directory.
+ *
+ * @param usrCp User's classpath.
+ * @param home GridGain home directory.
+ * @return Classpath.
+ */
+ IGNITE_FRIEND_EXPORT std::string CreateGridGainClasspath(const std::string* usrCp, const std::string* home);
+
+ /**
+ * Create GridGain classpath based on user input and home directory.
+ *
+ * @param usrCp User's classpath.
+ * @param home GridGain home directory.
+ * @param test Whether test classpath must be used.
+ * @return Classpath.
+ */
+ IGNITE_FRIEND_EXPORT std::string CreateGridGainClasspath(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/0d70d547/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
index 64c1312..55d836a 100644
--- 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
@@ -18,9 +18,9 @@
#include <dirent.h>
#include <dlfcn.h>
-#include "gridgain/impl/utils.h"
+#include "ignite/impl/utils.h"
-namespace gridgain
+namespace ignite
{
namespace impl
{
@@ -34,7 +34,7 @@ namespace gridgain
const char* PROBE_BIN = "/bin";
const char* PROBE_EXAMPLES = "/examples";
- const char* GRIDGAIN_NATIVE_TEST_CLASSPATH = "GRIDGAIN_NATIVE_TEST_CLASSPATH";
+ const char* IGNITE_NATIVE_TEST_CLASSPATH = "IGNITE_NATIVE_TEST_CLASSPATH";
/**
* Helper method to set boolean result to reference with proper NULL-check.
@@ -410,7 +410,7 @@ namespace gridgain
if (home)
{
bool envFound;
- std::string env = GetEnv(GRIDGAIN_NATIVE_TEST_CLASSPATH, &envFound);
+ std::string env = GetEnv(IGNITE_NATIVE_TEST_CLASSPATH, &envFound);
forceTest = envFound && env.compare("true") == 0;
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/0d70d547/modules/platform/src/main/cpp/core/os/win/include/gridgain/impl/utils.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/os/win/include/gridgain/impl/utils.h b/modules/platform/src/main/cpp/core/os/win/include/gridgain/impl/utils.h
deleted file mode 100644
index 3d72ae7..0000000
--- a/modules/platform/src/main/cpp/core/os/win/include/gridgain/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 GRIDGAIN_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,
- * GRIDGAIN_HOME is considered resolved.
- *
- * @param path Optional path to evaluate.
- * @param found Whether GRIDGAIN_HOME home was found.
- * @return Resolved GG home.
- */
- IGNITE_FRIEND_EXPORT std::string ResolveGridGainHome(const std::string* path, bool* found);
-
- /**
- * Create GridGain classpath based on user input and home directory.
- *
- * @param usrCp User's classpath.
- * @param home GridGain home directory.
- * @return Classpath.
- */
- IGNITE_FRIEND_EXPORT std::string CreateGridGainClasspath(const std::string* usrCp, const std::string* home);
-
- /**
- * Create GridGain classpath based on user input and home directory.
- *
- * @param usrCp User's classpath.
- * @param home GridGain home directory.
- * @param test Whether test classpath must be used.
- * @return Classpath.
- */
- IGNITE_FRIEND_EXPORT std::string CreateGridGainClasspath(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/0d70d547/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
new file mode 100644
index 0000000..3d72ae7
--- /dev/null
+++ b/modules/platform/src/main/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 GRIDGAIN_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,
+ * GRIDGAIN_HOME is considered resolved.
+ *
+ * @param path Optional path to evaluate.
+ * @param found Whether GRIDGAIN_HOME home was found.
+ * @return Resolved GG home.
+ */
+ IGNITE_FRIEND_EXPORT std::string ResolveGridGainHome(const std::string* path, bool* found);
+
+ /**
+ * Create GridGain classpath based on user input and home directory.
+ *
+ * @param usrCp User's classpath.
+ * @param home GridGain home directory.
+ * @return Classpath.
+ */
+ IGNITE_FRIEND_EXPORT std::string CreateGridGainClasspath(const std::string* usrCp, const std::string* home);
+
+ /**
+ * Create GridGain classpath based on user input and home directory.
+ *
+ * @param usrCp User's classpath.
+ * @param home GridGain home directory.
+ * @param test Whether test classpath must be used.
+ * @return Classpath.
+ */
+ IGNITE_FRIEND_EXPORT std::string CreateGridGainClasspath(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/0d70d547/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
index ee418ad..bd17658 100644
--- 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
@@ -17,7 +17,7 @@
#include <windows.h>
-#include "gridgain/impl/utils.h"
+#include "ignite/impl/utils.h"
namespace ignite
{
http://git-wip-us.apache.org/repos/asf/ignite/blob/0d70d547/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
index 78eb949..de90f65 100644
--- a/modules/platform/src/main/cpp/core/project/vs/core.vcxproj
+++ b/modules/platform/src/main/cpp/core/project/vs/core.vcxproj
@@ -68,18 +68,18 @@
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
- <TargetName>gridgain.core</TargetName>
+ <TargetName>ignite.core</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
- <TargetName>gridgain.core</TargetName>
+ <TargetName>ignite.core</TargetName>
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
- <TargetName>gridgain.core</TargetName>
+ <TargetName>ignite.core</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
- <TargetName>gridgain.core</TargetName>
+ <TargetName>ignite.core</TargetName>
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
@@ -188,49 +188,49 @@
</Link>
</ItemDefinitionGroup>
<ItemGroup>
- <ClInclude Include="..\..\include\gridgain\cache\cache.h" />
- <ClInclude Include="..\..\include\gridgain\cache\cache_entry.h" />
- <ClInclude Include="..\..\include\gridgain\cache\cache_peek_mode.h" />
- <ClInclude Include="..\..\include\gridgain\cache\query\query.h" />
- <ClInclude Include="..\..\include\gridgain\cache\query\query_argument.h" />
- <ClInclude Include="..\..\include\gridgain\cache\query\query_cursor.h" />
- <ClInclude Include="..\..\include\gridgain\cache\query\query_scan.h" />
- <ClInclude Include="..\..\include\gridgain\cache\query\query_sql.h" />
- <ClInclude Include="..\..\include\gridgain\cache\query\query_text.h" />
- <ClInclude Include="..\..\include\gridgain\grid.h" />
- <ClInclude Include="..\..\include\gridgain\grid_configuration.h" />
- <ClInclude Include="..\..\include\gridgain\grid_error.h" />
- <ClInclude Include="..\..\include\gridgain\grid_factory.h" />
- <ClInclude Include="..\..\include\gridgain\guid.h" />
- <ClInclude Include="..\..\include\gridgain\impl\cache\cache_impl.h" />
- <ClInclude Include="..\..\include\gridgain\impl\cache\query\query_impl.h" />
- <ClInclude Include="..\..\include\gridgain\impl\grid_environment.h" />
- <ClInclude Include="..\..\include\gridgain\impl\grid_impl.h" />
- <ClInclude Include="..\..\include\gridgain\impl\handle_registry.h" />
- <ClInclude Include="..\..\include\gridgain\impl\interop\interop.h" />
- <ClInclude Include="..\..\include\gridgain\impl\interop\interop_input_stream.h" />
- <ClInclude Include="..\..\include\gridgain\impl\interop\interop_memory.h" />
- <ClInclude Include="..\..\include\gridgain\impl\interop\interop_output_stream.h" />
- <ClInclude Include="..\..\include\gridgain\impl\operations.h" />
- <ClInclude Include="..\..\include\gridgain\impl\portable\portable_common.h" />
- <ClInclude Include="..\..\include\gridgain\impl\portable\portable_id_resolver.h" />
- <ClInclude Include="..\..\include\gridgain\impl\portable\portable_metadata_handler.h" />
- <ClInclude Include="..\..\include\gridgain\impl\portable\portable_metadata_manager.h" />
- <ClInclude Include="..\..\include\gridgain\impl\portable\portable_metadata_snapshot.h" />
- <ClInclude Include="..\..\include\gridgain\impl\portable\portable_metadata_updater.h" />
- <ClInclude Include="..\..\include\gridgain\impl\portable\portable_metadata_updater_impl.h" />
- <ClInclude Include="..\..\include\gridgain\impl\portable\portable_reader_impl.h" />
- <ClInclude Include="..\..\include\gridgain\impl\portable\portable_utils.h" />
- <ClInclude Include="..\..\include\gridgain\impl\portable\portable_writer_impl.h" />
- <ClInclude Include="..\..\include\gridgain\portable\portable.h" />
- <ClInclude Include="..\..\include\gridgain\portable\portable_consts.h" />
- <ClInclude Include="..\..\include\gridgain\portable\portable_containers.h" />
- <ClInclude Include="..\..\include\gridgain\portable\portable_type.h" />
- <ClInclude Include="..\..\include\gridgain\portable\portable_raw_reader.h" />
- <ClInclude Include="..\..\include\gridgain\portable\portable_raw_writer.h" />
- <ClInclude Include="..\..\include\gridgain\portable\portable_reader.h" />
- <ClInclude Include="..\..\include\gridgain\portable\portable_writer.h" />
- <ClInclude Include="..\..\os\win\include\gridgain\impl\utils.h" />
+ <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\grid.h" />
+ <ClInclude Include="..\..\include\ignite\grid_configuration.h" />
+ <ClInclude Include="..\..\include\ignite\grid_error.h" />
+ <ClInclude Include="..\..\include\ignite\grid_factory.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\grid_environment.h" />
+ <ClInclude Include="..\..\include\ignite\impl\grid_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" />
http://git-wip-us.apache.org/repos/asf/ignite/blob/0d70d547/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
index 7640178..5747f10 100644
--- a/modules/platform/src/main/cpp/core/project/vs/core.vcxproj.filters
+++ b/modules/platform/src/main/cpp/core/project/vs/core.vcxproj.filters
@@ -84,133 +84,133 @@
</ClCompile>
</ItemGroup>
<ItemGroup>
- <ClInclude Include="..\..\include\gridgain\impl\cache\cache_impl.h">
+ <ClInclude Include="..\..\include\ignite\impl\cache\cache_impl.h">
<Filter>Code\impl\cache</Filter>
</ClInclude>
- <ClInclude Include="..\..\include\gridgain\cache\cache.h">
+ <ClInclude Include="..\..\include\ignite\cache\cache.h">
<Filter>Code\cache</Filter>
</ClInclude>
- <ClInclude Include="..\..\include\gridgain\cache\cache_peek_mode.h">
+ <ClInclude Include="..\..\include\ignite\cache\cache_peek_mode.h">
<Filter>Code\cache</Filter>
</ClInclude>
- <ClInclude Include="..\..\include\gridgain\impl\interop\interop.h">
+ <ClInclude Include="..\..\include\ignite\impl\interop\interop.h">
<Filter>Code\impl\interop</Filter>
</ClInclude>
- <ClInclude Include="..\..\include\gridgain\impl\interop\interop_input_stream.h">
+ <ClInclude Include="..\..\include\ignite\impl\interop\interop_input_stream.h">
<Filter>Code\impl\interop</Filter>
</ClInclude>
- <ClInclude Include="..\..\include\gridgain\impl\interop\interop_memory.h">
+ <ClInclude Include="..\..\include\ignite\impl\interop\interop_memory.h">
<Filter>Code\impl\interop</Filter>
</ClInclude>
- <ClInclude Include="..\..\include\gridgain\impl\interop\interop_output_stream.h">
+ <ClInclude Include="..\..\include\ignite\impl\interop\interop_output_stream.h">
<Filter>Code\impl\interop</Filter>
</ClInclude>
- <ClInclude Include="..\..\include\gridgain\impl\grid_environment.h">
+ <ClInclude Include="..\..\include\ignite\impl\grid_environment.h">
<Filter>Code\impl</Filter>
</ClInclude>
- <ClInclude Include="..\..\include\gridgain\impl\grid_impl.h">
+ <ClInclude Include="..\..\include\ignite\impl\grid_impl.h">
<Filter>Code\impl</Filter>
</ClInclude>
- <ClInclude Include="..\..\include\gridgain\impl\operations.h">
+ <ClInclude Include="..\..\include\ignite\impl\operations.h">
<Filter>Code\impl</Filter>
</ClInclude>
- <ClInclude Include="..\..\include\gridgain\impl\portable\portable_common.h">
+ <ClInclude Include="..\..\include\ignite\impl\portable\portable_common.h">
<Filter>Code\impl\portable</Filter>
</ClInclude>
- <ClInclude Include="..\..\include\gridgain\portable\portable_consts.h">
+ <ClInclude Include="..\..\include\ignite\portable\portable_consts.h">
<Filter>Code\portable</Filter>
</ClInclude>
- <ClInclude Include="..\..\include\gridgain\portable\portable.h">
+ <ClInclude Include="..\..\include\ignite\portable\portable.h">
<Filter>Code\portable</Filter>
</ClInclude>
- <ClInclude Include="..\..\include\gridgain\portable\portable_containers.h">
+ <ClInclude Include="..\..\include\ignite\portable\portable_containers.h">
<Filter>Code\portable</Filter>
</ClInclude>
- <ClInclude Include="..\..\include\gridgain\impl\portable\portable_id_resolver.h">
+ <ClInclude Include="..\..\include\ignite\impl\portable\portable_id_resolver.h">
<Filter>Code\impl\portable</Filter>
</ClInclude>
- <ClInclude Include="..\..\include\gridgain\portable\portable_raw_reader.h">
+ <ClInclude Include="..\..\include\ignite\portable\portable_raw_reader.h">
<Filter>Code\portable</Filter>
</ClInclude>
- <ClInclude Include="..\..\include\gridgain\portable\portable_raw_writer.h">
+ <ClInclude Include="..\..\include\ignite\portable\portable_raw_writer.h">
<Filter>Code\portable</Filter>
</ClInclude>
- <ClInclude Include="..\..\include\gridgain\portable\portable_reader.h">
+ <ClInclude Include="..\..\include\ignite\portable\portable_reader.h">
<Filter>Code\portable</Filter>
</ClInclude>
- <ClInclude Include="..\..\include\gridgain\portable\portable_writer.h">
+ <ClInclude Include="..\..\include\ignite\portable\portable_writer.h">
<Filter>Code\portable</Filter>
</ClInclude>
- <ClInclude Include="..\..\include\gridgain\impl\portable\portable_reader_impl.h">
+ <ClInclude Include="..\..\include\ignite\impl\portable\portable_reader_impl.h">
<Filter>Code\impl\portable</Filter>
</ClInclude>
- <ClInclude Include="..\..\include\gridgain\impl\portable\portable_utils.h">
+ <ClInclude Include="..\..\include\ignite\impl\portable\portable_utils.h">
<Filter>Code\impl\portable</Filter>
</ClInclude>
- <ClInclude Include="..\..\include\gridgain\impl\portable\portable_writer_impl.h">
+ <ClInclude Include="..\..\include\ignite\impl\portable\portable_writer_impl.h">
<Filter>Code\impl\portable</Filter>
</ClInclude>
- <ClInclude Include="..\..\os\win\include\gridgain\impl\utils.h">
+ <ClInclude Include="..\..\os\win\include\ignite\impl\utils.h">
<Filter>Code\impl</Filter>
</ClInclude>
- <ClInclude Include="..\..\include\gridgain\grid.h">
+ <ClInclude Include="..\..\include\ignite\grid.h">
<Filter>Code</Filter>
</ClInclude>
- <ClInclude Include="..\..\include\gridgain\grid_configuration.h">
+ <ClInclude Include="..\..\include\ignite\grid_configuration.h">
<Filter>Code</Filter>
</ClInclude>
- <ClInclude Include="..\..\include\gridgain\grid_error.h">
+ <ClInclude Include="..\..\include\ignite\grid_error.h">
<Filter>Code</Filter>
</ClInclude>
- <ClInclude Include="..\..\include\gridgain\grid_factory.h">
+ <ClInclude Include="..\..\include\ignite\grid_factory.h">
<Filter>Code</Filter>
</ClInclude>
- <ClInclude Include="..\..\include\gridgain\guid.h">
+ <ClInclude Include="..\..\include\ignite\guid.h">
<Filter>Code</Filter>
</ClInclude>
- <ClInclude Include="..\..\include\gridgain\impl\handle_registry.h">
+ <ClInclude Include="..\..\include\ignite\impl\handle_registry.h">
<Filter>Code\impl</Filter>
</ClInclude>
- <ClInclude Include="..\..\include\gridgain\cache\cache_entry.h">
+ <ClInclude Include="..\..\include\ignite\cache\cache_entry.h">
<Filter>Code\cache</Filter>
</ClInclude>
- <ClInclude Include="..\..\include\gridgain\impl\cache\query\query_impl.h">
+ <ClInclude Include="..\..\include\ignite\impl\cache\query\query_impl.h">
<Filter>Code\impl\cache\query</Filter>
</ClInclude>
- <ClInclude Include="..\..\include\gridgain\impl\portable\portable_metadata_snapshot.h">
+ <ClInclude Include="..\..\include\ignite\impl\portable\portable_metadata_snapshot.h">
<Filter>Code\impl\portable</Filter>
</ClInclude>
- <ClInclude Include="..\..\include\gridgain\impl\portable\portable_metadata_handler.h">
+ <ClInclude Include="..\..\include\ignite\impl\portable\portable_metadata_handler.h">
<Filter>Code\impl\portable</Filter>
</ClInclude>
- <ClInclude Include="..\..\include\gridgain\impl\portable\portable_metadata_manager.h">
+ <ClInclude Include="..\..\include\ignite\impl\portable\portable_metadata_manager.h">
<Filter>Code\impl\portable</Filter>
</ClInclude>
- <ClInclude Include="..\..\include\gridgain\portable\portable_type.h">
+ <ClInclude Include="..\..\include\ignite\portable\portable_type.h">
<Filter>Code\portable</Filter>
</ClInclude>
- <ClInclude Include="..\..\include\gridgain\impl\portable\portable_metadata_updater.h">
+ <ClInclude Include="..\..\include\ignite\impl\portable\portable_metadata_updater.h">
<Filter>Code\impl\portable</Filter>
</ClInclude>
- <ClInclude Include="..\..\include\gridgain\impl\portable\portable_metadata_updater_impl.h">
+ <ClInclude Include="..\..\include\ignite\impl\portable\portable_metadata_updater_impl.h">
<Filter>Code\impl\portable</Filter>
</ClInclude>
- <ClInclude Include="..\..\include\gridgain\cache\query\query_argument.h">
+ <ClInclude Include="..\..\include\ignite\cache\query\query_argument.h">
<Filter>Code\cache\query</Filter>
</ClInclude>
- <ClInclude Include="..\..\include\gridgain\cache\query\query_cursor.h">
+ <ClInclude Include="..\..\include\ignite\cache\query\query_cursor.h">
<Filter>Code\cache\query</Filter>
</ClInclude>
- <ClInclude Include="..\..\include\gridgain\cache\query\query_sql.h">
+ <ClInclude Include="..\..\include\ignite\cache\query\query_sql.h">
<Filter>Code\cache\query</Filter>
</ClInclude>
- <ClInclude Include="..\..\include\gridgain\cache\query\query.h">
+ <ClInclude Include="..\..\include\ignite\cache\query\query.h">
<Filter>Code\cache\query</Filter>
</ClInclude>
- <ClInclude Include="..\..\include\gridgain\cache\query\query_text.h">
+ <ClInclude Include="..\..\include\ignite\cache\query\query_text.h">
<Filter>Code\cache\query</Filter>
</ClInclude>
- <ClInclude Include="..\..\include\gridgain\cache\query\query_scan.h">
+ <ClInclude Include="..\..\include\ignite\cache\query\query_scan.h">
<Filter>Code\cache\query</Filter>
</ClInclude>
</ItemGroup>
http://git-wip-us.apache.org/repos/asf/ignite/blob/0d70d547/modules/platform/src/main/cpp/core/project/vs/core.vcxprojrel
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/project/vs/core.vcxprojrel b/modules/platform/src/main/cpp/core/project/vs/core.vcxprojrel
index 78eb949..de90f65 100644
--- a/modules/platform/src/main/cpp/core/project/vs/core.vcxprojrel
+++ b/modules/platform/src/main/cpp/core/project/vs/core.vcxprojrel
@@ -68,18 +68,18 @@
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
- <TargetName>gridgain.core</TargetName>
+ <TargetName>ignite.core</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
- <TargetName>gridgain.core</TargetName>
+ <TargetName>ignite.core</TargetName>
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
- <TargetName>gridgain.core</TargetName>
+ <TargetName>ignite.core</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
- <TargetName>gridgain.core</TargetName>
+ <TargetName>ignite.core</TargetName>
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
@@ -188,49 +188,49 @@
</Link>
</ItemDefinitionGroup>
<ItemGroup>
- <ClInclude Include="..\..\include\gridgain\cache\cache.h" />
- <ClInclude Include="..\..\include\gridgain\cache\cache_entry.h" />
- <ClInclude Include="..\..\include\gridgain\cache\cache_peek_mode.h" />
- <ClInclude Include="..\..\include\gridgain\cache\query\query.h" />
- <ClInclude Include="..\..\include\gridgain\cache\query\query_argument.h" />
- <ClInclude Include="..\..\include\gridgain\cache\query\query_cursor.h" />
- <ClInclude Include="..\..\include\gridgain\cache\query\query_scan.h" />
- <ClInclude Include="..\..\include\gridgain\cache\query\query_sql.h" />
- <ClInclude Include="..\..\include\gridgain\cache\query\query_text.h" />
- <ClInclude Include="..\..\include\gridgain\grid.h" />
- <ClInclude Include="..\..\include\gridgain\grid_configuration.h" />
- <ClInclude Include="..\..\include\gridgain\grid_error.h" />
- <ClInclude Include="..\..\include\gridgain\grid_factory.h" />
- <ClInclude Include="..\..\include\gridgain\guid.h" />
- <ClInclude Include="..\..\include\gridgain\impl\cache\cache_impl.h" />
- <ClInclude Include="..\..\include\gridgain\impl\cache\query\query_impl.h" />
- <ClInclude Include="..\..\include\gridgain\impl\grid_environment.h" />
- <ClInclude Include="..\..\include\gridgain\impl\grid_impl.h" />
- <ClInclude Include="..\..\include\gridgain\impl\handle_registry.h" />
- <ClInclude Include="..\..\include\gridgain\impl\interop\interop.h" />
- <ClInclude Include="..\..\include\gridgain\impl\interop\interop_input_stream.h" />
- <ClInclude Include="..\..\include\gridgain\impl\interop\interop_memory.h" />
- <ClInclude Include="..\..\include\gridgain\impl\interop\interop_output_stream.h" />
- <ClInclude Include="..\..\include\gridgain\impl\operations.h" />
- <ClInclude Include="..\..\include\gridgain\impl\portable\portable_common.h" />
- <ClInclude Include="..\..\include\gridgain\impl\portable\portable_id_resolver.h" />
- <ClInclude Include="..\..\include\gridgain\impl\portable\portable_metadata_handler.h" />
- <ClInclude Include="..\..\include\gridgain\impl\portable\portable_metadata_manager.h" />
- <ClInclude Include="..\..\include\gridgain\impl\portable\portable_metadata_snapshot.h" />
- <ClInclude Include="..\..\include\gridgain\impl\portable\portable_metadata_updater.h" />
- <ClInclude Include="..\..\include\gridgain\impl\portable\portable_metadata_updater_impl.h" />
- <ClInclude Include="..\..\include\gridgain\impl\portable\portable_reader_impl.h" />
- <ClInclude Include="..\..\include\gridgain\impl\portable\portable_utils.h" />
- <ClInclude Include="..\..\include\gridgain\impl\portable\portable_writer_impl.h" />
- <ClInclude Include="..\..\include\gridgain\portable\portable.h" />
- <ClInclude Include="..\..\include\gridgain\portable\portable_consts.h" />
- <ClInclude Include="..\..\include\gridgain\portable\portable_containers.h" />
- <ClInclude Include="..\..\include\gridgain\portable\portable_type.h" />
- <ClInclude Include="..\..\include\gridgain\portable\portable_raw_reader.h" />
- <ClInclude Include="..\..\include\gridgain\portable\portable_raw_writer.h" />
- <ClInclude Include="..\..\include\gridgain\portable\portable_reader.h" />
- <ClInclude Include="..\..\include\gridgain\portable\portable_writer.h" />
- <ClInclude Include="..\..\os\win\include\gridgain\impl\utils.h" />
+ <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\grid.h" />
+ <ClInclude Include="..\..\include\ignite\grid_configuration.h" />
+ <ClInclude Include="..\..\include\ignite\grid_error.h" />
+ <ClInclude Include="..\..\include\ignite\grid_factory.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\grid_environment.h" />
+ <ClInclude Include="..\..\include\ignite\impl\grid_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" />
http://git-wip-us.apache.org/repos/asf/ignite/blob/0d70d547/modules/platform/src/main/cpp/core/src/grid.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/src/grid.cpp b/modules/platform/src/main/cpp/core/src/grid.cpp
index fd25702..21bbe34 100644
--- a/modules/platform/src/main/cpp/core/src/grid.cpp
+++ b/modules/platform/src/main/cpp/core/src/grid.cpp
@@ -17,8 +17,8 @@
#include <ignite/common/java.h>
-#include "gridgain/impl/grid_impl.h"
-#include "gridgain/grid.h"
+#include "ignite/impl/grid_impl.h"
+#include "ignite/grid.h"
using namespace ignite::common::concurrent;
using namespace ignite::impl;
http://git-wip-us.apache.org/repos/asf/ignite/blob/0d70d547/modules/platform/src/main/cpp/core/src/grid_error.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/src/grid_error.cpp b/modules/platform/src/main/cpp/core/src/grid_error.cpp
index a909ff6..597853a 100644
--- a/modules/platform/src/main/cpp/core/src/grid_error.cpp
+++ b/modules/platform/src/main/cpp/core/src/grid_error.cpp
@@ -16,8 +16,8 @@
*/
#include <ignite/common/java.h>
-#include "gridgain/impl/utils.h"
-#include "gridgain/grid_error.h"
+#include "ignite/impl/utils.h"
+#include "ignite/grid_error.h"
using namespace ignite::common::java;
using namespace ignite::impl::utils;
http://git-wip-us.apache.org/repos/asf/ignite/blob/0d70d547/modules/platform/src/main/cpp/core/src/grid_factory.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/src/grid_factory.cpp b/modules/platform/src/main/cpp/core/src/grid_factory.cpp
index 0014320..cfdd6b7 100644
--- a/modules/platform/src/main/cpp/core/src/grid_factory.cpp
+++ b/modules/platform/src/main/cpp/core/src/grid_factory.cpp
@@ -22,10 +22,10 @@
#include <ignite/common/exports.h>
#include <ignite/common/java.h>
-#include "gridgain/impl/grid_environment.h"
-#include "gridgain/impl/grid_impl.h"
-#include "gridgain/impl/utils.h"
-#include "gridgain/grid_factory.h"
+#include "ignite/impl/grid_environment.h"
+#include "ignite/impl/grid_impl.h"
+#include "ignite/impl/utils.h"
+#include "ignite/grid_factory.h"
using namespace ignite::common::concurrent;
using namespace ignite::common::java;
http://git-wip-us.apache.org/repos/asf/ignite/blob/0d70d547/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
index 75670e6..77997e4 100644
--- a/modules/platform/src/main/cpp/core/src/guid.cpp
+++ b/modules/platform/src/main/cpp/core/src/guid.cpp
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-#include "gridgain/guid.h"
+#include "ignite/guid.h"
namespace ignite
{
http://git-wip-us.apache.org/repos/asf/ignite/blob/0d70d547/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
index 637e7a1..176ab93 100644
--- 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
@@ -15,13 +15,13 @@
* limitations under the License.
*/
-#include "gridgain/cache/cache_peek_mode.h"
-#include "gridgain/impl/cache/cache_impl.h"
-#include "gridgain/impl/interop/interop.h"
-#include "gridgain/impl/portable/portable_reader_impl.h"
-#include "gridgain/impl/utils.h"
-#include "gridgain/portable/portable.h"
-#include <gridgain/impl/portable/portable_metadata_updater_impl.h>
+#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;
http://git-wip-us.apache.org/repos/asf/ignite/blob/0d70d547/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
index 35b7fd9..6196902 100644
--- 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
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-#include "gridgain/impl/cache/query/query_impl.h"
+#include "ignite/impl/cache/query/query_impl.h"
using namespace ignite::common::concurrent;
using namespace ignite::common::java;
http://git-wip-us.apache.org/repos/asf/ignite/blob/0d70d547/modules/platform/src/main/cpp/core/src/impl/grid_environment.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/src/impl/grid_environment.cpp b/modules/platform/src/main/cpp/core/src/impl/grid_environment.cpp
index e66da91..0eaf60d 100644
--- a/modules/platform/src/main/cpp/core/src/impl/grid_environment.cpp
+++ b/modules/platform/src/main/cpp/core/src/impl/grid_environment.cpp
@@ -15,9 +15,9 @@
* limitations under the License.
*/
-#include "gridgain/impl/portable/portable_reader_impl.h"
-#include "gridgain/impl/grid_environment.h"
-#include "gridgain/portable/portable.h"
+#include "ignite/impl/portable/portable_reader_impl.h"
+#include "ignite/impl/grid_environment.h"
+#include "ignite/portable/portable.h"
using namespace ignite::common::concurrent;
using namespace ignite::common::java;
http://git-wip-us.apache.org/repos/asf/ignite/blob/0d70d547/modules/platform/src/main/cpp/core/src/impl/grid_impl.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/src/impl/grid_impl.cpp b/modules/platform/src/main/cpp/core/src/impl/grid_impl.cpp
index b79e548..2328239 100644
--- a/modules/platform/src/main/cpp/core/src/impl/grid_impl.cpp
+++ b/modules/platform/src/main/cpp/core/src/impl/grid_impl.cpp
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-#include "gridgain/impl/grid_impl.h"
+#include "ignite/impl/grid_impl.h"
using namespace ignite::common::concurrent;
using namespace ignite::common::java;
http://git-wip-us.apache.org/repos/asf/ignite/blob/0d70d547/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
index c52833c..c447faa 100644
--- a/modules/platform/src/main/cpp/core/src/impl/handle_registry.cpp
+++ b/modules/platform/src/main/cpp/core/src/impl/handle_registry.cpp
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-#include "gridgain/impl/handle_registry.h"
+#include "ignite/impl/handle_registry.h"
using namespace ignite::common::concurrent;
http://git-wip-us.apache.org/repos/asf/ignite/blob/0d70d547/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
index c938416..551d3a5 100644
--- 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
@@ -17,8 +17,8 @@
#include <cstring>
-#include "gridgain/impl/interop/interop_input_stream.h"
-#include "gridgain/grid_error.h"
+#include "ignite/impl/interop/interop_input_stream.h"
+#include "ignite/grid_error.h"
/**
* Common macro to read a single value.
http://git-wip-us.apache.org/repos/asf/ignite/blob/0d70d547/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
index 52e19e7..04af510 100644
--- 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
@@ -17,8 +17,8 @@
#include <ignite/common/java.h>
-#include "gridgain/impl/interop/interop_memory.h"
-#include "gridgain/grid_error.h"
+#include "ignite/impl/interop/interop_memory.h"
+#include "ignite/grid_error.h"
using namespace ignite::common::java;
http://git-wip-us.apache.org/repos/asf/ignite/blob/0d70d547/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
index ebf2c67..56c428c 100644
--- 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
@@ -17,8 +17,8 @@
#include <cstring>
-#include "gridgain/impl/interop/interop_output_stream.h"
-#include "gridgain/grid_error.h"
+#include "ignite/impl/interop/interop_output_stream.h"
+#include "ignite/grid_error.h"
/**
* Common macro to write a single value.
http://git-wip-us.apache.org/repos/asf/ignite/blob/0d70d547/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
index 1ad40d0..5ca91dc 100644
--- 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
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-#include "gridgain/impl/portable/portable_metadata_handler.h"
+#include "ignite/impl/portable/portable_metadata_handler.h"
using namespace ignite::common::concurrent;
http://git-wip-us.apache.org/repos/asf/ignite/blob/0d70d547/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
index fe5b5c6..9ecf5ab 100644
--- 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
@@ -17,7 +17,7 @@
#include <ignite/common/concurrent.h>
-#include "gridgain/impl/portable/portable_metadata_manager.h"
+#include "ignite/impl/portable/portable_metadata_manager.h"
using namespace ignite::common::concurrent;
http://git-wip-us.apache.org/repos/asf/ignite/blob/0d70d547/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
index f9a57fc..6ce5ab5 100644
--- 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
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-#include "gridgain/impl/portable/portable_metadata_snapshot.h"
+#include "ignite/impl/portable/portable_metadata_snapshot.h"
namespace ignite
{
http://git-wip-us.apache.org/repos/asf/ignite/blob/0d70d547/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
index f0f8e8e..81c96d7 100644
--- 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
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-#include "gridgain/impl/portable/portable_metadata_updater.h"
+#include "ignite/impl/portable/portable_metadata_updater.h"
namespace ignite
{
http://git-wip-us.apache.org/repos/asf/ignite/blob/0d70d547/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
index ea89b53..472938d 100644
--- 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
@@ -15,10 +15,10 @@
* limitations under the License.
*/
-#include "gridgain/impl/portable/portable_metadata_updater_impl.h"
-#include <gridgain/impl/interop/interop_output_stream.h>
-#include <gridgain/impl/portable/portable_writer_impl.h>
-#include <gridgain/portable/portable_raw_writer.h>
+#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;
http://git-wip-us.apache.org/repos/asf/ignite/blob/0d70d547/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
index 264885c..386ccd3 100644
--- 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
@@ -15,13 +15,13 @@
* limitations under the License.
*/
-#include "gridgain/impl/interop/interop.h"
-#include "gridgain/impl/portable/portable_common.h"
-#include "gridgain/impl/portable/portable_id_resolver.h"
-#include "gridgain/impl/portable/portable_reader_impl.h"
-#include "gridgain/impl/portable/portable_utils.h"
-#include "gridgain/portable/portable_type.h"
-#include "gridgain/grid_error.h"
+#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/grid_error.h"
using namespace ignite::impl::interop;
using namespace ignite::impl::portable;
[04/16] ignite git commit: IGNITE-1364: Moved headers to correct
folders.
Posted by vo...@apache.org.
http://git-wip-us.apache.org/repos/asf/ignite/blob/0d70d547/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
index 3f9c48d..2f9c259 100644
--- 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
@@ -15,8 +15,8 @@
* limitations under the License.
*/
-#include "gridgain/impl/interop/interop.h"
-#include "gridgain/impl/portable/portable_utils.h"
+#include "ignite/impl/interop/interop.h"
+#include "ignite/impl/portable/portable_utils.h"
using namespace ignite::impl::interop;
using namespace ignite::impl::portable;
http://git-wip-us.apache.org/repos/asf/ignite/blob/0d70d547/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
index a4eb5b6..5e39f54 100644
--- 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
@@ -15,8 +15,8 @@
* limitations under the License.
*/
-#include "gridgain/impl/portable/portable_writer_impl.h"
-#include "gridgain/grid_error.h"
+#include "ignite/impl/portable/portable_writer_impl.h"
+#include "ignite/grid_error.h"
using namespace ignite::impl::interop;
using namespace ignite::impl::portable;
http://git-wip-us.apache.org/repos/asf/ignite/blob/0d70d547/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
index 2d6e1d2..8270a13 100644
--- a/modules/platform/src/main/cpp/core/src/portable/portable_containers.cpp
+++ b/modules/platform/src/main/cpp/core/src/portable/portable_containers.cpp
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-#include "gridgain/portable/portable_containers.h"
+#include "ignite/portable/portable_containers.h"
using namespace ignite::impl::portable;
http://git-wip-us.apache.org/repos/asf/ignite/blob/0d70d547/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
index e9809d6..f659913 100644
--- 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
@@ -14,8 +14,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-#include "gridgain/impl/portable/portable_reader_impl.h"
-#include "gridgain/portable/portable_raw_reader.h"
+#include "ignite/impl/portable/portable_reader_impl.h"
+#include "ignite/portable/portable_raw_reader.h"
using namespace ignite::impl::portable;
http://git-wip-us.apache.org/repos/asf/ignite/blob/0d70d547/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
index 8ba9fec..c682abe 100644
--- 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
@@ -15,8 +15,8 @@
* limitations under the License.
*/
-#include "gridgain/impl/portable/portable_writer_impl.h"
-#include "gridgain/portable/portable_raw_writer.h"
+#include "ignite/impl/portable/portable_writer_impl.h"
+#include "ignite/portable/portable_raw_writer.h"
using namespace ignite::impl::portable;
http://git-wip-us.apache.org/repos/asf/ignite/blob/0d70d547/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
index 8ce1de0..515216d 100644
--- a/modules/platform/src/main/cpp/core/src/portable/portable_reader.cpp
+++ b/modules/platform/src/main/cpp/core/src/portable/portable_reader.cpp
@@ -14,8 +14,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-#include "gridgain/impl/portable/portable_reader_impl.h"
-#include "gridgain/portable/portable_reader.h"
+#include "ignite/impl/portable/portable_reader_impl.h"
+#include "ignite/portable/portable_reader.h"
using namespace ignite::impl::portable;
http://git-wip-us.apache.org/repos/asf/ignite/blob/0d70d547/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
index ce1f41b..e22f869 100644
--- a/modules/platform/src/main/cpp/core/src/portable/portable_type.cpp
+++ b/modules/platform/src/main/cpp/core/src/portable/portable_type.cpp
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-#include "gridgain/portable/portable_type.h"
+#include "ignite/portable/portable_type.h"
namespace ignite
{
http://git-wip-us.apache.org/repos/asf/ignite/blob/0d70d547/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
index 746b6f7..f31b9dd 100644
--- a/modules/platform/src/main/cpp/core/src/portable/portable_writer.cpp
+++ b/modules/platform/src/main/cpp/core/src/portable/portable_writer.cpp
@@ -15,8 +15,8 @@
* limitations under the License.
*/
-#include "gridgain/impl/portable/portable_writer_impl.h"
-#include "gridgain/portable/portable_writer.h"
+#include "ignite/impl/portable/portable_writer_impl.h"
+#include "ignite/portable/portable_writer.h"
using namespace ignite::impl::portable;
[16/16] ignite git commit: IGNITE-1364: Moved headers to correct
folders.
Posted by vo...@apache.org.
IGNITE-1364: Moved headers to correct folders.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/0d70d547
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/0d70d547
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/0d70d547
Branch: refs/heads/ignite-1364
Commit: 0d70d547cd5dbec5809da7f6c1748d7bae034a58
Parents: 41cd824
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Thu Sep 3 13:49:28 2015 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Thu Sep 3 13:49:30 2015 +0300
----------------------------------------------------------------------
.../platform/src/main/cpp/common/configure.ac | 2 +-
.../src/main/cpp/common/ignite-common.pc.in | 2 +-
.../platform/src/main/cpp/core-test/Makefile.am | 10 +-
.../main/cpp/core-test/config/cache-query.xml | 22 +-
.../main/cpp/core-test/config/cache-test.xml | 43 +-
.../src/main/cpp/core-test/configure.ac | 2 +-
.../src/main/cpp/core-test/include/Makefile.am | 21 +-
.../include/gridgain/portable_test_defs.h | 312 -----
.../include/gridgain/portable_test_utils.h | 508 --------
.../include/ignite/portable_test_defs.h | 320 +++++
.../include/ignite/portable_test_utils.h | 516 ++++++++
.../cpp/core-test/project/vs/core-test.vcxproj | 4 +-
.../project/vs/core-test.vcxproj.filters | 4 +-
.../main/cpp/core-test/src/cache_query_test.cpp | 35 +-
.../src/main/cpp/core-test/src/cache_test.cpp | 26 +-
.../main/cpp/core-test/src/concurrent_test.cpp | 20 +-
.../cpp/core-test/src/grid_factory_test.cpp | 24 +-
.../cpp/core-test/src/handle_registry_test.cpp | 22 +-
.../src/portable_reader_writer_raw_test.cpp | 28 +-
.../src/portable_reader_writer_test.cpp | 28 +-
.../cpp/core-test/src/portable_session_test.cpp | 28 +-
.../cpp/core-test/src/portable_test_defs.cpp | 26 +-
.../main/cpp/core-test/src/teamcity_boost.cpp | 2 +-
modules/platform/src/main/cpp/core/Makefile.am | 8 +-
modules/platform/src/main/cpp/core/configure.ac | 4 +-
.../platform/src/main/cpp/core/gridgain.pc.in | 9 -
modules/platform/src/main/cpp/core/ignite.pc.in | 9 +
.../src/main/cpp/core/include/Makefile.am | 84 +-
.../cpp/core/include/gridgain/cache/cache.h | 1153 ------------------
.../core/include/gridgain/cache/cache_entry.h | 118 --
.../include/gridgain/cache/cache_peek_mode.h | 71 --
.../core/include/gridgain/cache/query/query.h | 27 -
.../gridgain/cache/query/query_argument.h | 125 --
.../include/gridgain/cache/query/query_cursor.h | 191 ---
.../include/gridgain/cache/query/query_scan.h | 151 ---
.../include/gridgain/cache/query/query_sql.h | 253 ----
.../include/gridgain/cache/query/query_text.h | 159 ---
.../src/main/cpp/core/include/gridgain/grid.h | 154 ---
.../core/include/gridgain/grid_configuration.h | 92 --
.../main/cpp/core/include/gridgain/grid_error.h | 260 ----
.../cpp/core/include/gridgain/grid_factory.h | 195 ---
.../src/main/cpp/core/include/gridgain/guid.h | 112 --
.../include/gridgain/impl/cache/cache_impl.h | 418 -------
.../gridgain/impl/cache/query/query_impl.h | 115 --
.../include/gridgain/impl/grid_environment.h | 130 --
.../cpp/core/include/gridgain/impl/grid_impl.h | 146 ---
.../include/gridgain/impl/handle_registry.h | 202 ---
.../include/gridgain/impl/interop/interop.h | 25 -
.../impl/interop/interop_input_stream.h | 234 ----
.../gridgain/impl/interop/interop_memory.h | 280 -----
.../impl/interop/interop_output_stream.h | 234 ----
.../cpp/core/include/gridgain/impl/operations.h | 452 -------
.../gridgain/impl/portable/portable_common.h | 146 ---
.../impl/portable/portable_id_resolver.h | 106 --
.../impl/portable/portable_metadata_handler.h | 102 --
.../impl/portable/portable_metadata_manager.h | 121 --
.../impl/portable/portable_metadata_snapshot.h | 122 --
.../impl/portable/portable_metadata_updater.h | 53 -
.../portable/portable_metadata_updater_impl.h | 65 -
.../impl/portable/portable_reader_impl.h | 1130 -----------------
.../gridgain/impl/portable/portable_utils.h | 344 ------
.../impl/portable/portable_writer_impl.h | 859 -------------
.../core/include/gridgain/portable/portable.h | 29 -
.../include/gridgain/portable/portable_consts.h | 106 --
.../gridgain/portable/portable_containers.h | 525 --------
.../gridgain/portable/portable_raw_reader.h | 324 -----
.../gridgain/portable/portable_raw_writer.h | 300 -----
.../include/gridgain/portable/portable_reader.h | 355 ------
.../include/gridgain/portable/portable_type.h | 293 -----
.../include/gridgain/portable/portable_writer.h | 335 -----
.../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/grid.h | 154 +++
.../core/include/ignite/grid_configuration.h | 92 ++
.../main/cpp/core/include/ignite/grid_error.h | 260 ++++
.../main/cpp/core/include/ignite/grid_factory.h | 195 +++
.../src/main/cpp/core/include/ignite/guid.h | 112 ++
.../core/include/ignite/impl/cache/cache_impl.h | 418 +++++++
.../ignite/impl/cache/query/query_impl.h | 115 ++
.../core/include/ignite/impl/grid_environment.h | 130 ++
.../cpp/core/include/ignite/impl/grid_impl.h | 146 +++
.../core/include/ignite/impl/handle_registry.h | 202 +++
.../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 | 2 +-
.../core/os/linux/include/gridgain/impl/utils.h | 155 ---
.../core/os/linux/include/ignite/impl/utils.h | 155 +++
.../main/cpp/core/os/linux/src/impl/utils.cpp | 8 +-
.../core/os/win/include/gridgain/impl/utils.h | 155 ---
.../cpp/core/os/win/include/ignite/impl/utils.h | 155 +++
.../src/main/cpp/core/os/win/src/impl/utils.cpp | 2 +-
.../src/main/cpp/core/project/vs/core.vcxproj | 94 +-
.../cpp/core/project/vs/core.vcxproj.filters | 86 +-
.../main/cpp/core/project/vs/core.vcxprojrel | 94 +-
modules/platform/src/main/cpp/core/src/grid.cpp | 4 +-
.../src/main/cpp/core/src/grid_error.cpp | 4 +-
.../src/main/cpp/core/src/grid_factory.cpp | 8 +-
modules/platform/src/main/cpp/core/src/guid.cpp | 2 +-
.../main/cpp/core/src/impl/cache/cache_impl.cpp | 14 +-
.../core/src/impl/cache/query/query_impl.cpp | 2 +-
.../main/cpp/core/src/impl/grid_environment.cpp | 6 +-
.../src/main/cpp/core/src/impl/grid_impl.cpp | 2 +-
.../main/cpp/core/src/impl/handle_registry.cpp | 2 +-
.../src/impl/interop/interop_input_stream.cpp | 4 +-
.../core/src/impl/interop/interop_memory.cpp | 4 +-
.../src/impl/interop/interop_output_stream.cpp | 4 +-
.../impl/portable/portable_metadata_handler.cpp | 2 +-
.../impl/portable/portable_metadata_manager.cpp | 2 +-
.../portable/portable_metadata_snapshot.cpp | 2 +-
.../impl/portable/portable_metadata_updater.cpp | 2 +-
.../portable/portable_metadata_updater_impl.cpp | 8 +-
.../src/impl/portable/portable_reader_impl.cpp | 14 +-
.../core/src/impl/portable/portable_utils.cpp | 4 +-
.../src/impl/portable/portable_writer_impl.cpp | 4 +-
.../core/src/portable/portable_containers.cpp | 2 +-
.../core/src/portable/portable_raw_reader.cpp | 4 +-
.../core/src/portable/portable_raw_writer.cpp | 4 +-
.../cpp/core/src/portable/portable_reader.cpp | 4 +-
.../cpp/core/src/portable/portable_type.cpp | 2 +-
.../cpp/core/src/portable/portable_writer.cpp | 4 +-
148 files changed, 12230 insertions(+), 12132 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/0d70d547/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
index 7706737..b34d7d8 100644
--- a/modules/platform/src/main/cpp/common/configure.ac
+++ b/modules/platform/src/main/cpp/common/configure.ac
@@ -19,7 +19,7 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.69])
-AC_INIT([Ignite JNI bridge for C++], [7.4.1], [dev@ignite.apache.org], [ignite-common], [ignite.apache.org])
+AC_INIT([Apache Ignite JNI bridge for C++], [1.4.0], [dev@ignite.apache.org], [ignite-common], [ignite.apache.org])
AC_CONFIG_SRCDIR(src)
AC_CANONICAL_SYSTEM
http://git-wip-us.apache.org/repos/asf/ignite/blob/0d70d547/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
index 3cd3cec..b8c40d2 100644
--- a/modules/platform/src/main/cpp/common/ignite-common.pc.in
+++ b/modules/platform/src/main/cpp/common/ignite-common.pc.in
@@ -4,6 +4,6 @@ libdir=@libdir@
includedir=@includedir@
Name: ignite-common
-Description: Ignite JNI bridge for C++.
+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/0d70d547/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
index 7ebe9f4..8a2f8ae 100644
--- a/modules/platform/src/main/cpp/core-test/Makefile.am
+++ b/modules/platform/src/main/cpp/core-test/Makefile.am
@@ -23,9 +23,9 @@ 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 = gridgain-tests
+noinst_PROGRAMS = ignite-tests
-gridgain_tests_SOURCES = src/cache_test.cpp \
+ignite_tests_SOURCES = src/cache_test.cpp \
src/cache_query_test.cpp \
src/concurrent_test.cpp \
src/grid_factory_test.cpp \
@@ -37,13 +37,13 @@ gridgain_tests_SOURCES = src/cache_test.cpp \
src/teamcity_messages.cpp \
src/teamcity_boost.cpp
-gridgain_tests_LDFLAGS = -static-libtool-libs -L/usr/local/lib -lgridgain
+ignite_tests_LDFLAGS = -static-libtool-libs -L/usr/local/lib -lignite
run-check: check
- ./gridgain-tests -p
+ ./ignite-tests -p
clean-local: clean-check
$(RM) *.gcno *.gcda
clean-check:
- $(RM) $(gridgain_tests_OBJECTS)
+ $(RM) $(ignite_tests_OBJECTS)
http://git-wip-us.apache.org/repos/asf/ignite/blob/0d70d547/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
index d3af85a..160fe49 100644
--- a/modules/platform/src/main/cpp/core-test/config/cache-query.xml
+++ b/modules/platform/src/main/cpp/core-test/config/cache-query.xml
@@ -1,16 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Copyright (C) GridGain Systems. All Rights Reserved.
- _________ _____ __________________ _____
- __ ____/___________(_)______ /__ ____/______ ____(_)_______
- _ / __ __ ___/__ / _ __ / _ / __ _ __ `/__ / __ __ \
- / /_/ / _ / _ / / /_/ / / /_/ / / /_/ / _ / _ / / /
- \____/ /_/ /_/ \_,__/ \____/ \__,_/ /_/ /_/ /_/
+ 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.
-->
<!--
- GridGain Spring configuration file to startup grid cache.
+ 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"
http://git-wip-us.apache.org/repos/asf/ignite/blob/0d70d547/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
index 59c6142..f239ba9 100644
--- a/modules/platform/src/main/cpp/core-test/config/cache-test.xml
+++ b/modules/platform/src/main/cpp/core-test/config/cache-test.xml
@@ -1,16 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Copyright (C) GridGain Systems. All Rights Reserved.
- _________ _____ __________________ _____
- __ ____/___________(_)______ /__ ____/______ ____(_)_______
- _ / __ __ ___/__ / _ __ / _ / __ _ __ `/__ / __ __ \
- / /_/ / _ / _ / / /_/ / / /_/ / / /_/ / _ / _ / / /
- \____/ /_/ /_/ \_,__/ \____/ \__,_/ /_/ /_/ /_/
+ 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.
-->
<!--
- GridGain Spring configuration file to startup grid cache.
+ 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"
@@ -24,27 +32,6 @@
<property name="localHost" value="127.0.0.1"/>
<property name="connectorConfiguration"><null/></property>
- <property name="marshaller">
- <bean class="org.gridgain.grid.marshaller.portable.PortableMarshaller">
- <property name="typeConfigurations">
- <list>
- <bean class="org.gridgain.grid.portables.PortableTypeConfiguration">
- <property name="className" value="org.gridgain.client.ClientTestPortable"/>
- </bean>
- <bean class="org.gridgain.grid.portables.PortableTypeConfiguration">
- <property name="className" value="org.gridgain.internal.client.model.GridPortablePerson"/>
- </bean>
- <bean class="org.gridgain.grid.portables.PortableTypeConfiguration">
- <property name="className" value="org.gridgain.internal.client.model.GridImplicitPortablePerson"/>
- </bean>
- <bean class="org.gridgain.grid.portables.PortableTypeConfiguration">
- <property name="className" value="GridNoDefPortablePerson"/>
- </bean>
- </list>
- </property>
- </bean>
- </property>
-
<property name="includeEventTypes">
<util:constant static-field="org.apache.ignite.events.EventType.EVTS_CACHE"/>
</property>
http://git-wip-us.apache.org/repos/asf/ignite/blob/0d70d547/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
index 6557adc..3a1b660 100644
--- a/modules/platform/src/main/cpp/core-test/configure.ac
+++ b/modules/platform/src/main/cpp/core-test/configure.ac
@@ -19,7 +19,7 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.69])
-AC_INIT([GridGain for C++ Test], [7.4.1], [info@gridgain.com], [gridgain], [www.gridgain.com])
+AC_INIT([Apache Ignite C++ Test], [1.4.0], [dev@ignite.apache.org], [ignite], [ignite.apache.org])
AC_CONFIG_SRCDIR(src)
AC_CANONICAL_SYSTEM
http://git-wip-us.apache.org/repos/asf/ignite/blob/0d70d547/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
index eafae0d..c43103e 100644
--- a/modules/platform/src/main/cpp/core-test/include/Makefile.am
+++ b/modules/platform/src/main/cpp/core-test/include/Makefile.am
@@ -1,5 +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 \
- gridgain/portable_test_defs.h \
- gridgain/portable_test_utils.h
+ ignite/portable_test_defs.h \
+ ignite/portable_test_utils.h
http://git-wip-us.apache.org/repos/asf/ignite/blob/0d70d547/modules/platform/src/main/cpp/core-test/include/gridgain/portable_test_defs.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core-test/include/gridgain/portable_test_defs.h b/modules/platform/src/main/cpp/core-test/include/gridgain/portable_test_defs.h
deleted file mode 100644
index 58ae419..0000000
--- a/modules/platform/src/main/cpp/core-test/include/gridgain/portable_test_defs.h
+++ /dev/null
@@ -1,312 +0,0 @@
-/*
- * Copyright (C) GridGain Systems. All Rights Reserved.
- * _________ _____ __________________ _____
- * __ ____/___________(_)______ /__ ____/______ ____(_)_______
- * _ / __ __ ___/__ / _ __ / _ / __ _ __ `/__ / __ __ \
- * / /_/ / _ / _ / / /_/ / / /_/ / / /_/ / _ / _ / / /
- * \____/ /_/ /_/ \_,__/ \____/ \__,_/ /_/ /_/ /_/
- */
-
-#ifndef _IGNITE_PORTABLE_TEST_DEFS
-#define _IGNITE_PORTABLE_TEST_DEFS
-
-#include <stdexcept>
-#include <stdint.h>
-
-#include "gridgain/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/0d70d547/modules/platform/src/main/cpp/core-test/include/gridgain/portable_test_utils.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core-test/include/gridgain/portable_test_utils.h b/modules/platform/src/main/cpp/core-test/include/gridgain/portable_test_utils.h
deleted file mode 100644
index 4df37c4..0000000
--- a/modules/platform/src/main/cpp/core-test/include/gridgain/portable_test_utils.h
+++ /dev/null
@@ -1,508 +0,0 @@
-/*
- * Copyright (C) GridGain Systems. All Rights Reserved.
- * _________ _____ __________________ _____
- * __ ____/___________(_)______ /__ ____/______ ____(_)_______
- * _ / __ __ ___/__ / _ __ / _ / __ _ __ `/__ / __ __ \
- * / /_/ / _ / _ / / /_/ / / /_/ / / /_/ / _ / _ / / /
- * \____/ /_/ /_/ \_,__/ \____/ \__,_/ /_/ /_/ /_/
- */
-
-#ifndef _IGNITE_PORTABLE_TEST_UTILS
-#define _IGNITE_PORTABLE_TEST_UTILS
-
-#include "gridgain/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/0d70d547/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
new file mode 100644
index 0000000..bae0118
--- /dev/null
+++ b/modules/platform/src/main/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/0d70d547/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
new file mode 100644
index 0000000..62f99f9
--- /dev/null
+++ b/modules/platform/src/main/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/0d70d547/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
index 52def17..1f70a04 100644
--- 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
@@ -44,8 +44,8 @@
<ClCompile Include="..\..\src\teamcity_messages.cpp" />
</ItemGroup>
<ItemGroup>
- <ClInclude Include="..\..\include\gridgain\portable_test_defs.h" />
- <ClInclude Include="..\..\include\gridgain\portable_test_utils.h" />
+ <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">
http://git-wip-us.apache.org/repos/asf/ignite/blob/0d70d547/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
index 0d8a707..6ecc63b 100644
--- 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
@@ -36,10 +36,10 @@
</ClCompile>
</ItemGroup>
<ItemGroup>
- <ClInclude Include="..\..\include\gridgain\portable_test_defs.h">
+ <ClInclude Include="..\..\include\ignite\portable_test_defs.h">
<Filter>Code</Filter>
</ClInclude>
- <ClInclude Include="..\..\include\gridgain\portable_test_utils.h">
+ <ClInclude Include="..\..\include\ignite\portable_test_utils.h">
<Filter>Code</Filter>
</ClInclude>
<ClInclude Include="..\..\include\teamcity_messages.h">
http://git-wip-us.apache.org/repos/asf/ignite/blob/0d70d547/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
index 266ff19..4ad5278 100644
--- 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
@@ -1,10 +1,18 @@
/*
- * Copyright (C) GridGain Systems. All Rights Reserved.
- * _________ _____ __________________ _____
- * __ ____/___________(_)______ /__ ____/______ ____(_)_______
- * _ / __ __ ___/__ / _ __ / _ / __ _ __ `/__ / __ __ \
- * / /_/ / _ / _ / / /_/ / / /_/ / / /_/ / _ / _ / / /
- * \____/ /_/ /_/ \_,__/ \____/ \__,_/ /_/ /_/ /_/
+ * 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
@@ -15,14 +23,13 @@
#include <boost/test/unit_test.hpp>
-#include "gridgain/impl/utils.h"
-
-#include "gridgain/cache/cache.h"
-#include "gridgain/cache/query/query_cursor.h"
-#include "gridgain/cache/query/query_sql.h"
-#include "gridgain/cache/query/query_text.h"
-#include "gridgain/grid.h"
-#include "gridgain/grid_factory.h"
+#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/grid.h"
+#include "ignite/grid_factory.h"
using namespace boost::unit_test;
http://git-wip-us.apache.org/repos/asf/ignite/blob/0d70d547/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
index 1682055..b9ae672 100644
--- a/modules/platform/src/main/cpp/core-test/src/cache_test.cpp
+++ b/modules/platform/src/main/cpp/core-test/src/cache_test.cpp
@@ -1,10 +1,18 @@
/*
- * Copyright (C) GridGain Systems. All Rights Reserved.
- * _________ _____ __________________ _____
- * __ ____/___________(_)______ /__ ____/______ ____(_)_______
- * _ / __ __ ___/__ / _ __ / _ / __ _ __ `/__ / __ __ \
- * / /_/ / _ / _ / / /_/ / / /_/ / / /_/ / _ / _ / / /
- * \____/ /_/ /_/ \_,__/ \____/ \__,_/ /_/ /_/ /_/
+ * 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
@@ -13,9 +21,9 @@
#include <boost/test/unit_test.hpp>
-#include "gridgain/cache/cache_peek_mode.h"
-#include "gridgain/grid.h"
-#include "gridgain/grid_factory.h"
+#include "ignite/cache/cache_peek_mode.h"
+#include "ignite/grid.h"
+#include "ignite/grid_factory.h"
using namespace ignite;
using namespace boost::unit_test;
http://git-wip-us.apache.org/repos/asf/ignite/blob/0d70d547/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
index 5bd09a2..2d89b7a 100644
--- a/modules/platform/src/main/cpp/core-test/src/concurrent_test.cpp
+++ b/modules/platform/src/main/cpp/core-test/src/concurrent_test.cpp
@@ -1,10 +1,18 @@
/*
- * Copyright (C) GridGain Systems. All Rights Reserved.
- * _________ _____ __________________ _____
- * __ ____/___________(_)______ /__ ____/______ ____(_)_______
- * _ / __ __ ___/__ / _ __ / _ / __ _ __ `/__ / __ __ \
- * / /_/ / _ / _ / / /_/ / / /_/ / / /_/ / _ / _ / / /
- * \____/ /_/ /_/ \_,__/ \____/ \__,_/ /_/ /_/ /_/
+ * 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
http://git-wip-us.apache.org/repos/asf/ignite/blob/0d70d547/modules/platform/src/main/cpp/core-test/src/grid_factory_test.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core-test/src/grid_factory_test.cpp b/modules/platform/src/main/cpp/core-test/src/grid_factory_test.cpp
index fc33fb3..575b5c7 100644
--- a/modules/platform/src/main/cpp/core-test/src/grid_factory_test.cpp
+++ b/modules/platform/src/main/cpp/core-test/src/grid_factory_test.cpp
@@ -1,10 +1,18 @@
/*
- * Copyright (C) GridGain Systems. All Rights Reserved.
- * _________ _____ __________________ _____
- * __ ____/___________(_)______ /__ ____/______ ____(_)_______
- * _ / __ __ ___/__ / _ __ / _ / __ _ __ `/__ / __ __ \
- * / /_/ / _ / _ / / /_/ / / /_/ / / /_/ / _ / _ / / /
- * \____/ /_/ /_/ \_,__/ \____/ \__,_/ /_/ /_/ /_/
+ * 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
@@ -13,8 +21,8 @@
#include <boost/test/unit_test.hpp>
-#include "gridgain/grid.h"
-#include "gridgain/grid_factory.h"
+#include "ignite/grid.h"
+#include "ignite/grid_factory.h"
using namespace ignite;
using namespace boost::unit_test;
http://git-wip-us.apache.org/repos/asf/ignite/blob/0d70d547/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
index 9b2798b..bc4a654 100644
--- 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
@@ -1,10 +1,18 @@
/*
- * Copyright (C) GridGain Systems. All Rights Reserved.
- * _________ _____ __________________ _____
- * __ ____/___________(_)______ /__ ____/______ ____(_)_______
- * _ / __ __ ___/__ / _ __ / _ / __ _ __ `/__ / __ __ \
- * / /_/ / _ / _ / / /_/ / / /_/ / / /_/ / _ / _ / / /
- * \____/ /_/ /_/ \_,__/ \____/ \__,_/ /_/ /_/ /_/
+ * 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
@@ -13,7 +21,7 @@
#include <boost/test/unit_test.hpp>
-#include "gridgain/impl/handle_registry.h"
+#include "ignite/impl/handle_registry.h"
using namespace ignite::common::concurrent;
using namespace ignite::impl;
http://git-wip-us.apache.org/repos/asf/ignite/blob/0d70d547/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
index c213e67..c717372 100644
--- 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
@@ -1,10 +1,18 @@
/*
- * Copyright (C) GridGain Systems. All Rights Reserved.
- * _________ _____ __________________ _____
- * __ ____/___________(_)______ /__ ____/______ ____(_)_______
- * _ / __ __ ___/__ / _ __ / _ / __ _ __ `/__ / __ __ \
- * / /_/ / _ / _ / / /_/ / / /_/ / / /_/ / _ / _ / / /
- * \____/ /_/ /_/ \_,__/ \____/ \__,_/ /_/ /_/ /_/
+ * 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
@@ -13,11 +21,11 @@
#include <boost/test/unit_test.hpp>
-#include "gridgain/impl/interop/interop.h"
-#include "gridgain/portable/portable.h"
+#include "ignite/impl/interop/interop.h"
+#include "ignite/portable/portable.h"
-#include "gridgain/portable_test_defs.h"
-#include "gridgain/portable_test_utils.h"
+#include "ignite/portable_test_defs.h"
+#include "ignite/portable_test_utils.h"
using namespace ignite;
using namespace ignite::impl::interop;
[13/16] ignite git commit: IGNITE-1364: Moved headers to correct
folders.
Posted by vo...@apache.org.
http://git-wip-us.apache.org/repos/asf/ignite/blob/0d70d547/modules/platform/src/main/cpp/core/include/gridgain/impl/interop/interop_memory.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/gridgain/impl/interop/interop_memory.h b/modules/platform/src/main/cpp/core/include/gridgain/impl/interop/interop_memory.h
deleted file mode 100644
index 00cba43..0000000
--- a/modules/platform/src/main/cpp/core/include/gridgain/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/0d70d547/modules/platform/src/main/cpp/core/include/gridgain/impl/interop/interop_output_stream.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/gridgain/impl/interop/interop_output_stream.h b/modules/platform/src/main/cpp/core/include/gridgain/impl/interop/interop_output_stream.h
deleted file mode 100644
index d75eefb..0000000
--- a/modules/platform/src/main/cpp/core/include/gridgain/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 "gridgain/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
http://git-wip-us.apache.org/repos/asf/ignite/blob/0d70d547/modules/platform/src/main/cpp/core/include/gridgain/impl/operations.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/gridgain/impl/operations.h b/modules/platform/src/main/cpp/core/include/gridgain/impl/operations.h
deleted file mode 100644
index 87f7d11..0000000
--- a/modules/platform/src/main/cpp/core/include/gridgain/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 "gridgain/cache/cache_entry.h"
-#include "gridgain/impl/portable/portable_reader_impl.h"
-#include "gridgain/impl/portable/portable_writer_impl.h"
-#include "gridgain/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/0d70d547/modules/platform/src/main/cpp/core/include/gridgain/impl/portable/portable_common.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/gridgain/impl/portable/portable_common.h b/modules/platform/src/main/cpp/core/include/gridgain/impl/portable/portable_common.h
deleted file mode 100644
index 622cb54..0000000
--- a/modules/platform/src/main/cpp/core/include/gridgain/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/0d70d547/modules/platform/src/main/cpp/core/include/gridgain/impl/portable/portable_id_resolver.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/gridgain/impl/portable/portable_id_resolver.h b/modules/platform/src/main/cpp/core/include/gridgain/impl/portable/portable_id_resolver.h
deleted file mode 100644
index 00447d9..0000000
--- a/modules/platform/src/main/cpp/core/include/gridgain/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 "gridgain/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(GridError::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/0d70d547/modules/platform/src/main/cpp/core/include/gridgain/impl/portable/portable_metadata_handler.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/gridgain/impl/portable/portable_metadata_handler.h b/modules/platform/src/main/cpp/core/include/gridgain/impl/portable/portable_metadata_handler.h
deleted file mode 100644
index c55e6b2..0000000
--- a/modules/platform/src/main/cpp/core/include/gridgain/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 "gridgain/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/0d70d547/modules/platform/src/main/cpp/core/include/gridgain/impl/portable/portable_metadata_manager.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/gridgain/impl/portable/portable_metadata_manager.h b/modules/platform/src/main/cpp/core/include/gridgain/impl/portable/portable_metadata_manager.h
deleted file mode 100644
index 64dc0a3c..0000000
--- a/modules/platform/src/main/cpp/core/include/gridgain/impl/portable/portable_metadata_manager.h
+++ /dev/null
@@ -1,121 +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 "gridgain/grid_error.h"
-
-#include "gridgain/impl/portable/portable_metadata_handler.h"
-#include "gridgain/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, GridError* 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/0d70d547/modules/platform/src/main/cpp/core/include/gridgain/impl/portable/portable_metadata_snapshot.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/gridgain/impl/portable/portable_metadata_snapshot.h b/modules/platform/src/main/cpp/core/include/gridgain/impl/portable/portable_metadata_snapshot.h
deleted file mode 100644
index 1e000fc..0000000
--- a/modules/platform/src/main/cpp/core/include/gridgain/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/0d70d547/modules/platform/src/main/cpp/core/include/gridgain/impl/portable/portable_metadata_updater.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/gridgain/impl/portable/portable_metadata_updater.h b/modules/platform/src/main/cpp/core/include/gridgain/impl/portable/portable_metadata_updater.h
deleted file mode 100644
index a2fb9ed..0000000
--- a/modules/platform/src/main/cpp/core/include/gridgain/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 "gridgain/grid_error.h"
-#include "gridgain/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, GridError* err) = 0;
- };
- }
- }
-}
-
-#endif
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/0d70d547/modules/platform/src/main/cpp/core/include/gridgain/impl/portable/portable_metadata_updater_impl.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/gridgain/impl/portable/portable_metadata_updater_impl.h b/modules/platform/src/main/cpp/core/include/gridgain/impl/portable/portable_metadata_updater_impl.h
deleted file mode 100644
index 7ce86e7..0000000
--- a/modules/platform/src/main/cpp/core/include/gridgain/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 "gridgain/impl/grid_environment.h"
-#include "gridgain/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<GridEnvironment> env, jobject javaRef);
-
- /**
- * Destructor.
- */
- ~PortableMetadataUpdaterImpl();
-
- bool Update(Snap* snapshot, GridError* err);
- private:
- /** Environment. */
- ignite::common::concurrent::SharedPointer<GridEnvironment> env;
-
- /** Handle to Java object. */
- jobject javaRef;
-
- IGNITE_NO_COPY_ASSIGNMENT(PortableMetadataUpdaterImpl)
- };
- }
- }
-}
-
-#endif
\ No newline at end of file
[02/16] ignite git commit: IGNITE-1364: Renamed namespaces.
Posted by vo...@apache.org.
IGNITE-1364: Renamed namespaces.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/843fc30b
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/843fc30b
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/843fc30b
Branch: refs/heads/ignite-1364
Commit: 843fc30b9ef719d4f6c7a0fd8d9242297fe0ec31
Parents: 356ab0b
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Thu Sep 3 13:21:41 2015 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Thu Sep 3 13:21:41 2015 +0300
----------------------------------------------------------------------
.../include/gridgain/portable_test_defs.h | 6 ++--
.../include/gridgain/portable_test_utils.h | 8 ++---
.../main/cpp/core-test/src/cache_query_test.cpp | 10 +++---
.../src/main/cpp/core-test/src/cache_test.cpp | 4 +--
.../cpp/core-test/src/grid_factory_test.cpp | 2 +-
.../cpp/core-test/src/handle_registry_test.cpp | 2 +-
.../src/portable_reader_writer_raw_test.cpp | 10 +++---
.../src/portable_reader_writer_test.cpp | 10 +++---
.../cpp/core-test/src/portable_session_test.cpp | 10 +++---
.../cpp/core-test/src/portable_test_defs.cpp | 10 +++---
.../cpp/core/include/gridgain/cache/cache.h | 6 ++--
.../core/include/gridgain/cache/cache_entry.h | 2 +-
.../include/gridgain/cache/cache_peek_mode.h | 2 +-
.../gridgain/cache/query/query_argument.h | 6 ++--
.../include/gridgain/cache/query/query_cursor.h | 2 +-
.../include/gridgain/cache/query/query_scan.h | 2 +-
.../include/gridgain/cache/query/query_sql.h | 2 +-
.../include/gridgain/cache/query/query_text.h | 2 +-
.../src/main/cpp/core/include/gridgain/grid.h | 2 +-
.../core/include/gridgain/grid_configuration.h | 2 +-
.../main/cpp/core/include/gridgain/grid_error.h | 19 +++++-------
.../cpp/core/include/gridgain/grid_factory.h | 2 +-
.../src/main/cpp/core/include/gridgain/guid.h | 2 +-
.../include/gridgain/impl/cache/cache_impl.h | 10 +++---
.../gridgain/impl/cache/query/query_impl.h | 2 +-
.../include/gridgain/impl/grid_environment.h | 2 +-
.../cpp/core/include/gridgain/impl/grid_impl.h | 2 +-
.../include/gridgain/impl/handle_registry.h | 2 +-
.../impl/interop/interop_input_stream.h | 2 +-
.../gridgain/impl/interop/interop_memory.h | 2 +-
.../impl/interop/interop_output_stream.h | 2 +-
.../cpp/core/include/gridgain/impl/operations.h | 32 ++++++++++----------
.../gridgain/impl/portable/portable_common.h | 2 +-
.../impl/portable/portable_id_resolver.h | 8 ++---
.../impl/portable/portable_metadata_handler.h | 2 +-
.../impl/portable/portable_metadata_manager.h | 2 +-
.../impl/portable/portable_metadata_snapshot.h | 2 +-
.../impl/portable/portable_metadata_updater.h | 2 +-
.../portable/portable_metadata_updater_impl.h | 2 +-
.../impl/portable/portable_reader_impl.h | 24 +++++++--------
.../gridgain/impl/portable/portable_utils.h | 2 +-
.../impl/portable/portable_writer_impl.h | 20 ++++++------
.../include/gridgain/portable/portable_consts.h | 2 +-
.../gridgain/portable/portable_containers.h | 2 +-
.../gridgain/portable/portable_raw_reader.h | 8 ++---
.../gridgain/portable/portable_raw_writer.h | 10 +++---
.../include/gridgain/portable/portable_reader.h | 8 ++---
.../include/gridgain/portable/portable_type.h | 2 +-
.../include/gridgain/portable/portable_writer.h | 10 +++---
.../core/os/win/include/gridgain/impl/utils.h | 2 +-
.../src/main/cpp/core/os/win/src/impl/utils.cpp | 2 +-
modules/platform/src/main/cpp/core/src/grid.cpp | 4 +--
.../src/main/cpp/core/src/grid_error.cpp | 6 ++--
.../src/main/cpp/core/src/grid_factory.cpp | 6 ++--
modules/platform/src/main/cpp/core/src/guid.cpp | 2 +-
.../main/cpp/core/src/impl/cache/cache_impl.cpp | 22 +++++++-------
.../core/src/impl/cache/query/query_impl.cpp | 6 ++--
.../main/cpp/core/src/impl/grid_environment.cpp | 8 ++---
.../src/main/cpp/core/src/impl/grid_impl.cpp | 2 +-
.../main/cpp/core/src/impl/handle_registry.cpp | 2 +-
.../src/impl/interop/interop_input_stream.cpp | 2 +-
.../core/src/impl/interop/interop_memory.cpp | 2 +-
.../src/impl/interop/interop_output_stream.cpp | 2 +-
.../impl/portable/portable_metadata_handler.cpp | 2 +-
.../impl/portable/portable_metadata_manager.cpp | 2 +-
.../portable/portable_metadata_snapshot.cpp | 2 +-
.../impl/portable/portable_metadata_updater.cpp | 2 +-
.../portable/portable_metadata_updater_impl.cpp | 8 ++---
.../src/impl/portable/portable_reader_impl.cpp | 8 ++---
.../core/src/impl/portable/portable_utils.cpp | 6 ++--
.../src/impl/portable/portable_writer_impl.cpp | 12 ++++----
.../core/src/portable/portable_containers.cpp | 4 +--
.../core/src/portable/portable_raw_reader.cpp | 4 +--
.../core/src/portable/portable_raw_writer.cpp | 4 +--
.../cpp/core/src/portable/portable_reader.cpp | 4 +--
.../cpp/core/src/portable/portable_type.cpp | 2 +-
.../cpp/core/src/portable/portable_writer.cpp | 4 +--
77 files changed, 207 insertions(+), 212 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/843fc30b/modules/platform/src/main/cpp/core-test/include/gridgain/portable_test_defs.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core-test/include/gridgain/portable_test_defs.h b/modules/platform/src/main/cpp/core-test/include/gridgain/portable_test_defs.h
index 9e658a3..58ae419 100644
--- a/modules/platform/src/main/cpp/core-test/include/gridgain/portable_test_defs.h
+++ b/modules/platform/src/main/cpp/core-test/include/gridgain/portable_test_defs.h
@@ -15,7 +15,7 @@
#include "gridgain/portable/portable.h"
-namespace gridgain_test
+namespace ignite_test
{
namespace core
{
@@ -73,11 +73,11 @@ namespace gridgain_test
}
}
-namespace gridgain
+namespace ignite
{
namespace portable
{
- namespace gt = gridgain_test::core::portable;
+ namespace gt = ignite_test::core::portable;
template<>
struct PortableType<gt::PortableDummy>
http://git-wip-us.apache.org/repos/asf/ignite/blob/843fc30b/modules/platform/src/main/cpp/core-test/include/gridgain/portable_test_utils.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core-test/include/gridgain/portable_test_utils.h b/modules/platform/src/main/cpp/core-test/include/gridgain/portable_test_utils.h
index e78b235..4df37c4 100644
--- a/modules/platform/src/main/cpp/core-test/include/gridgain/portable_test_utils.h
+++ b/modules/platform/src/main/cpp/core-test/include/gridgain/portable_test_utils.h
@@ -12,11 +12,11 @@
#include "gridgain/portable/portable.h"
-using namespace gridgain;
-using namespace gridgain::portable;
-using namespace gridgain::impl::portable;
+using namespace ignite;
+using namespace ignite::portable;
+using namespace ignite::impl::portable;
-namespace gridgain_test
+namespace ignite_test
{
namespace core
{
http://git-wip-us.apache.org/repos/asf/ignite/blob/843fc30b/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
index cc858ee..2cae873 100644
--- 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
@@ -26,10 +26,10 @@
using namespace boost::unit_test;
-using namespace gridgain;
-using namespace gridgain::cache;
-using namespace gridgain::cache::query;
-using namespace gridgain::impl::utils;
+using namespace ignite;
+using namespace ignite::cache;
+using namespace ignite::cache::query;
+using namespace ignite::impl::utils;
/**
* Person class for query tests.
@@ -128,7 +128,7 @@ private:
int age;
};
-namespace gridgain
+namespace ignite
{
namespace portable
{
http://git-wip-us.apache.org/repos/asf/ignite/blob/843fc30b/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
index 9f870f9..7b62fd6 100644
--- a/modules/platform/src/main/cpp/core-test/src/cache_test.cpp
+++ b/modules/platform/src/main/cpp/core-test/src/cache_test.cpp
@@ -17,7 +17,7 @@
#include "gridgain/grid.h"
#include "gridgain/grid_factory.h"
-using namespace gridgain;
+using namespace ignite;
using namespace boost::unit_test;
/* Nodes started during the test. */
@@ -46,7 +46,7 @@ struct Person
}
};
-namespace gridgain
+namespace ignite
{
namespace portable
{
http://git-wip-us.apache.org/repos/asf/ignite/blob/843fc30b/modules/platform/src/main/cpp/core-test/src/grid_factory_test.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core-test/src/grid_factory_test.cpp b/modules/platform/src/main/cpp/core-test/src/grid_factory_test.cpp
index 253a692..be6ed63 100644
--- a/modules/platform/src/main/cpp/core-test/src/grid_factory_test.cpp
+++ b/modules/platform/src/main/cpp/core-test/src/grid_factory_test.cpp
@@ -16,7 +16,7 @@
#include "gridgain/grid.h"
#include "gridgain/grid_factory.h"
-using namespace gridgain;
+using namespace ignite;
using namespace boost::unit_test;
BOOST_AUTO_TEST_SUITE(GridFactoryTestSuite)
http://git-wip-us.apache.org/repos/asf/ignite/blob/843fc30b/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
index 6ec2a02..9b2798b 100644
--- 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
@@ -16,7 +16,7 @@
#include "gridgain/impl/handle_registry.h"
using namespace ignite::common::concurrent;
-using namespace gridgain::impl;
+using namespace ignite::impl;
struct HandleRegistryTestProbe
{
http://git-wip-us.apache.org/repos/asf/ignite/blob/843fc30b/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
index 59ee741..c213e67 100644
--- 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
@@ -19,11 +19,11 @@
#include "gridgain/portable_test_defs.h"
#include "gridgain/portable_test_utils.h"
-using namespace gridgain;
-using namespace gridgain::impl::interop;
-using namespace gridgain::impl::portable;
-using namespace gridgain::portable;
-using namespace gridgain_test::core::portable;
+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)
http://git-wip-us.apache.org/repos/asf/ignite/blob/843fc30b/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
index 139addc..c4f0a11 100644
--- 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
@@ -19,11 +19,11 @@
#include "gridgain/portable_test_defs.h"
#include "gridgain/portable_test_utils.h"
-using namespace gridgain;
-using namespace gridgain::impl::interop;
-using namespace gridgain::impl::portable;
-using namespace gridgain::portable;
-using namespace gridgain_test::core::portable;
+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)
http://git-wip-us.apache.org/repos/asf/ignite/blob/843fc30b/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
index 5eb732c..2f42971 100644
--- 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
@@ -19,11 +19,11 @@
#include "gridgain/portable_test_defs.h"
-using namespace gridgain;
-using namespace gridgain::impl::interop;
-using namespace gridgain::impl::portable;
-using namespace gridgain::portable;
-using namespace gridgain_test::core::portable;
+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.
http://git-wip-us.apache.org/repos/asf/ignite/blob/843fc30b/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
index bbb1acd..d96d4eb 100644
--- 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
@@ -12,12 +12,12 @@
#include "gridgain/portable_test_defs.h"
-using namespace gridgain;
-using namespace gridgain::impl::interop;
-using namespace gridgain::impl::portable;
-using namespace gridgain::portable;
+using namespace ignite;
+using namespace ignite::impl::interop;
+using namespace ignite::impl::portable;
+using namespace ignite::portable;
-namespace gridgain_test
+namespace ignite_test
{
namespace core
{
http://git-wip-us.apache.org/repos/asf/ignite/blob/843fc30b/modules/platform/src/main/cpp/core/include/gridgain/cache/cache.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/gridgain/cache/cache.h b/modules/platform/src/main/cpp/core/include/gridgain/cache/cache.h
index 81f01ab..940bff3 100644
--- a/modules/platform/src/main/cpp/core/include/gridgain/cache/cache.h
+++ b/modules/platform/src/main/cpp/core/include/gridgain/cache/cache.h
@@ -33,7 +33,7 @@
#include "gridgain/impl/operations.h"
#include "gridgain/grid_error.h"
-namespace gridgain
+namespace ignite
{
namespace cache
{
@@ -1004,7 +1004,7 @@ namespace gridgain
*/
int32_t Size()
{
- return Size(gridgain::cache::IGNITE_PEEK_MODE_ALL);
+ return Size(ignite::cache::IGNITE_PEEK_MODE_ALL);
}
/**
@@ -1016,7 +1016,7 @@ namespace gridgain
*/
int32_t Size(GridError& err)
{
- return Size(gridgain::cache::IGNITE_PEEK_MODE_ALL, err);
+ return Size(ignite::cache::IGNITE_PEEK_MODE_ALL, err);
}
/**
http://git-wip-us.apache.org/repos/asf/ignite/blob/843fc30b/modules/platform/src/main/cpp/core/include/gridgain/cache/cache_entry.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/gridgain/cache/cache_entry.h b/modules/platform/src/main/cpp/core/include/gridgain/cache/cache_entry.h
index f2cd7ed..2b6c785 100644
--- a/modules/platform/src/main/cpp/core/include/gridgain/cache/cache_entry.h
+++ b/modules/platform/src/main/cpp/core/include/gridgain/cache/cache_entry.h
@@ -20,7 +20,7 @@
#include <ignite/common/common.h>
-namespace gridgain
+namespace ignite
{
namespace cache
{
http://git-wip-us.apache.org/repos/asf/ignite/blob/843fc30b/modules/platform/src/main/cpp/core/include/gridgain/cache/cache_peek_mode.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/gridgain/cache/cache_peek_mode.h b/modules/platform/src/main/cpp/core/include/gridgain/cache/cache_peek_mode.h
index c00525d..be61887 100644
--- a/modules/platform/src/main/cpp/core/include/gridgain/cache/cache_peek_mode.h
+++ b/modules/platform/src/main/cpp/core/include/gridgain/cache/cache_peek_mode.h
@@ -18,7 +18,7 @@
#ifndef _IGNITE_CACHE_PEEK_MODE
#define _IGNITE_CACHE_PEEK_MODE
-namespace gridgain
+namespace ignite
{
namespace cache
{
http://git-wip-us.apache.org/repos/asf/ignite/blob/843fc30b/modules/platform/src/main/cpp/core/include/gridgain/cache/query/query_argument.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/gridgain/cache/query/query_argument.h b/modules/platform/src/main/cpp/core/include/gridgain/cache/query/query_argument.h
index c7a9d90..1ed96da 100644
--- a/modules/platform/src/main/cpp/core/include/gridgain/cache/query/query_argument.h
+++ b/modules/platform/src/main/cpp/core/include/gridgain/cache/query/query_argument.h
@@ -20,7 +20,7 @@
#include "gridgain/portable/portable_raw_writer.h"
-namespace gridgain
+namespace ignite
{
namespace cache
{
@@ -50,7 +50,7 @@ namespace gridgain
/**
* Write argument.
*/
- virtual void Write(gridgain::portable::PortableRawWriter& writer) = 0;
+ virtual void Write(ignite::portable::PortableRawWriter& writer) = 0;
};
/**
@@ -109,7 +109,7 @@ namespace gridgain
return new QueryArgument(val);
}
- void Write(gridgain::portable::PortableRawWriter& writer)
+ void Write(ignite::portable::PortableRawWriter& writer)
{
writer.WriteObject<T>(val);
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/843fc30b/modules/platform/src/main/cpp/core/include/gridgain/cache/query/query_cursor.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/gridgain/cache/query/query_cursor.h b/modules/platform/src/main/cpp/core/include/gridgain/cache/query/query_cursor.h
index 6f8dd3e..dbe738c 100644
--- a/modules/platform/src/main/cpp/core/include/gridgain/cache/query/query_cursor.h
+++ b/modules/platform/src/main/cpp/core/include/gridgain/cache/query/query_cursor.h
@@ -27,7 +27,7 @@
#include "gridgain/impl/cache/query/query_impl.h"
#include "gridgain/impl/operations.h"
-namespace gridgain
+namespace ignite
{
namespace cache
{
http://git-wip-us.apache.org/repos/asf/ignite/blob/843fc30b/modules/platform/src/main/cpp/core/include/gridgain/cache/query/query_scan.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/gridgain/cache/query/query_scan.h b/modules/platform/src/main/cpp/core/include/gridgain/cache/query/query_scan.h
index 4a8aeff..0955aee 100644
--- a/modules/platform/src/main/cpp/core/include/gridgain/cache/query/query_scan.h
+++ b/modules/platform/src/main/cpp/core/include/gridgain/cache/query/query_scan.h
@@ -23,7 +23,7 @@
#include "gridgain/portable/portable_raw_writer.h"
-namespace gridgain
+namespace ignite
{
namespace cache
{
http://git-wip-us.apache.org/repos/asf/ignite/blob/843fc30b/modules/platform/src/main/cpp/core/include/gridgain/cache/query/query_sql.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/gridgain/cache/query/query_sql.h b/modules/platform/src/main/cpp/core/include/gridgain/cache/query/query_sql.h
index 089e775..aab4398 100644
--- a/modules/platform/src/main/cpp/core/include/gridgain/cache/query/query_sql.h
+++ b/modules/platform/src/main/cpp/core/include/gridgain/cache/query/query_sql.h
@@ -25,7 +25,7 @@
#include "gridgain/cache/query/query_argument.h"
#include "gridgain/portable/portable_raw_writer.h"
-namespace gridgain
+namespace ignite
{
namespace cache
{
http://git-wip-us.apache.org/repos/asf/ignite/blob/843fc30b/modules/platform/src/main/cpp/core/include/gridgain/cache/query/query_text.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/gridgain/cache/query/query_text.h b/modules/platform/src/main/cpp/core/include/gridgain/cache/query/query_text.h
index 430ce60..016684c 100644
--- a/modules/platform/src/main/cpp/core/include/gridgain/cache/query/query_text.h
+++ b/modules/platform/src/main/cpp/core/include/gridgain/cache/query/query_text.h
@@ -23,7 +23,7 @@
#include "gridgain/portable/portable_raw_writer.h"
-namespace gridgain
+namespace ignite
{
namespace cache
{
http://git-wip-us.apache.org/repos/asf/ignite/blob/843fc30b/modules/platform/src/main/cpp/core/include/gridgain/grid.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/gridgain/grid.h b/modules/platform/src/main/cpp/core/include/gridgain/grid.h
index 528a884..efd3d57 100644
--- a/modules/platform/src/main/cpp/core/include/gridgain/grid.h
+++ b/modules/platform/src/main/cpp/core/include/gridgain/grid.h
@@ -22,7 +22,7 @@
#include "gridgain/impl/grid_impl.h"
#include "gridgain/grid_configuration.h"
-namespace gridgain
+namespace ignite
{
/**
* Main interface to operate with GridGain.
http://git-wip-us.apache.org/repos/asf/ignite/blob/843fc30b/modules/platform/src/main/cpp/core/include/gridgain/grid_configuration.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/gridgain/grid_configuration.h b/modules/platform/src/main/cpp/core/include/gridgain/grid_configuration.h
index 8940e32..65d2c8e 100644
--- a/modules/platform/src/main/cpp/core/include/gridgain/grid_configuration.h
+++ b/modules/platform/src/main/cpp/core/include/gridgain/grid_configuration.h
@@ -20,7 +20,7 @@
#include <stdint.h>
-namespace gridgain
+namespace ignite
{
/**
* Single JVM option.
http://git-wip-us.apache.org/repos/asf/ignite/blob/843fc30b/modules/platform/src/main/cpp/core/include/gridgain/grid_error.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/gridgain/grid_error.h b/modules/platform/src/main/cpp/core/include/gridgain/grid_error.h
index 6774b45..47c54b1 100644
--- a/modules/platform/src/main/cpp/core/include/gridgain/grid_error.h
+++ b/modules/platform/src/main/cpp/core/include/gridgain/grid_error.h
@@ -26,46 +26,46 @@
#define IGNITE_ERROR_1(code, part1) { \
std::stringstream stream; \
stream << (part1); \
- throw gridgain::GridError(code, stream.str().c_str()); \
+ throw ignite::GridError(code, stream.str().c_str()); \
}
#define IGNITE_ERROR_2(code, part1, part2) { \
std::stringstream stream; \
stream << (part1) << (part2); \
- throw gridgain::GridError(code, stream.str().c_str()); \
+ throw ignite::GridError(code, stream.str().c_str()); \
}
#define IGNITE_ERROR_3(code, part1, part2, part3) { \
std::stringstream stream; \
stream << (part1) << (part2) << (part3); \
- throw gridgain::GridError(code, stream.str().c_str()); \
+ throw ignite::GridError(code, stream.str().c_str()); \
}
#define IGNITE_ERROR_FORMATTED_1(code, msg, key1, val1) { \
std::stringstream stream; \
stream << msg << " [" << key1 << "=" << (val1) << "]"; \
- throw gridgain::GridError(code, stream.str().c_str()); \
+ throw ignite::GridError(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 gridgain::GridError(code, stream.str().c_str()); \
+ throw ignite::GridError(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 gridgain::GridError(code, stream.str().c_str()); \
+ throw ignite::GridError(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 gridgain::GridError(code, stream.str().c_str()); \
+ throw ignite::GridError(code, stream.str().c_str()); \
}
-namespace gridgain
+namespace ignite
{
/**
* Grid error information.
@@ -175,9 +175,6 @@ namespace gridgain
/** Security error. */
static const int IGNITE_ERR_SECURITY = 2023;
- /** Product license error. */
- static const int IGNITE_ERR_PRODUCT_LICENSE = 2024;
-
/** Unknown error. */
static const int IGNITE_ERR_UNKNOWN = -1;
http://git-wip-us.apache.org/repos/asf/ignite/blob/843fc30b/modules/platform/src/main/cpp/core/include/gridgain/grid_factory.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/gridgain/grid_factory.h b/modules/platform/src/main/cpp/core/include/gridgain/grid_factory.h
index 909fcac..0d45b97 100644
--- a/modules/platform/src/main/cpp/core/include/gridgain/grid_factory.h
+++ b/modules/platform/src/main/cpp/core/include/gridgain/grid_factory.h
@@ -63,7 +63,7 @@
#include "gridgain/grid_configuration.h"
#include "gridgain/grid_error.h"
-namespace gridgain
+namespace ignite
{
/**
* This class defines a factory for the main GridGain API.
http://git-wip-us.apache.org/repos/asf/ignite/blob/843fc30b/modules/platform/src/main/cpp/core/include/gridgain/guid.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/gridgain/guid.h b/modules/platform/src/main/cpp/core/include/gridgain/guid.h
index 51da8c4..9469769 100644
--- a/modules/platform/src/main/cpp/core/include/gridgain/guid.h
+++ b/modules/platform/src/main/cpp/core/include/gridgain/guid.h
@@ -22,7 +22,7 @@
#include <ignite/common/common.h>
-namespace gridgain
+namespace ignite
{
/**
* Global universally unique identifier (GUID).
http://git-wip-us.apache.org/repos/asf/ignite/blob/843fc30b/modules/platform/src/main/cpp/core/include/gridgain/impl/cache/cache_impl.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/gridgain/impl/cache/cache_impl.h b/modules/platform/src/main/cpp/core/include/gridgain/impl/cache/cache_impl.h
index 0777ecc..e769402 100644
--- a/modules/platform/src/main/cpp/core/include/gridgain/impl/cache/cache_impl.h
+++ b/modules/platform/src/main/cpp/core/include/gridgain/impl/cache/cache_impl.h
@@ -25,7 +25,7 @@
#include "gridgain/impl/cache/query/query_impl.h"
#include "gridgain/impl/operations.h"
-namespace gridgain
+namespace ignite
{
namespace impl
{
@@ -297,7 +297,7 @@ namespace gridgain
* @param err Error.
* @return Query cursor.
*/
- query::QueryCursorImpl* QuerySql(const gridgain::cache::query::SqlQuery& qry, GridError* err);
+ query::QueryCursorImpl* QuerySql(const ignite::cache::query::SqlQuery& qry, GridError* err);
/*
* Invoke text query.
@@ -306,7 +306,7 @@ namespace gridgain
* @param err Error.
* @return Query cursor.
*/
- query::QueryCursorImpl* QueryText(const gridgain::cache::query::TextQuery& qry, GridError* err);
+ query::QueryCursorImpl* QueryText(const ignite::cache::query::TextQuery& qry, GridError* err);
/*
* Invoke scan query.
@@ -315,7 +315,7 @@ namespace gridgain
* @param err Error.
* @return Query cursor.
*/
- query::QueryCursorImpl* QueryScan(const gridgain::cache::query::ScanQuery& qry, GridError* err);
+ query::QueryCursorImpl* QueryScan(const ignite::cache::query::ScanQuery& qry, GridError* err);
private:
/** Name. */
@@ -394,7 +394,7 @@ namespace gridgain
interop::InteropMemory* mem0 = mem.Get();
interop::InteropOutputStream out(mem0);
portable::PortableWriterImpl writer(&out, env.Get()->GetMetadataManager());
- gridgain::portable::PortableRawWriter rawWriter(&writer);
+ ignite::portable::PortableRawWriter rawWriter(&writer);
qry.Write(rawWriter);
http://git-wip-us.apache.org/repos/asf/ignite/blob/843fc30b/modules/platform/src/main/cpp/core/include/gridgain/impl/cache/query/query_impl.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/gridgain/impl/cache/query/query_impl.h b/modules/platform/src/main/cpp/core/include/gridgain/impl/cache/query/query_impl.h
index 703a347..7cf84fe 100644
--- a/modules/platform/src/main/cpp/core/include/gridgain/impl/cache/query/query_impl.h
+++ b/modules/platform/src/main/cpp/core/include/gridgain/impl/cache/query/query_impl.h
@@ -22,7 +22,7 @@
#include <gridgain/grid_error.h>
#include <gridgain/impl/operations.h>
-namespace gridgain
+namespace ignite
{
namespace impl
{
http://git-wip-us.apache.org/repos/asf/ignite/blob/843fc30b/modules/platform/src/main/cpp/core/include/gridgain/impl/grid_environment.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/gridgain/impl/grid_environment.h b/modules/platform/src/main/cpp/core/include/gridgain/impl/grid_environment.h
index 568e69f..600a699 100644
--- a/modules/platform/src/main/cpp/core/include/gridgain/impl/grid_environment.h
+++ b/modules/platform/src/main/cpp/core/include/gridgain/impl/grid_environment.h
@@ -24,7 +24,7 @@
#include "gridgain/impl/interop/interop_memory.h"
#include "portable/portable_metadata_manager.h"
-namespace gridgain
+namespace ignite
{
namespace impl
{
http://git-wip-us.apache.org/repos/asf/ignite/blob/843fc30b/modules/platform/src/main/cpp/core/include/gridgain/impl/grid_impl.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/gridgain/impl/grid_impl.h b/modules/platform/src/main/cpp/core/include/gridgain/impl/grid_impl.h
index 3a13105..6c45ec2 100644
--- a/modules/platform/src/main/cpp/core/include/gridgain/impl/grid_impl.h
+++ b/modules/platform/src/main/cpp/core/include/gridgain/impl/grid_impl.h
@@ -25,7 +25,7 @@
#include "gridgain/impl/grid_environment.h"
#include "gridgain/impl/utils.h"
-namespace gridgain
+namespace ignite
{
namespace impl
{
http://git-wip-us.apache.org/repos/asf/ignite/blob/843fc30b/modules/platform/src/main/cpp/core/include/gridgain/impl/handle_registry.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/gridgain/impl/handle_registry.h b/modules/platform/src/main/cpp/core/include/gridgain/impl/handle_registry.h
index b57722c..5e1b60a 100644
--- a/modules/platform/src/main/cpp/core/include/gridgain/impl/handle_registry.h
+++ b/modules/platform/src/main/cpp/core/include/gridgain/impl/handle_registry.h
@@ -23,7 +23,7 @@
#include <ignite/common/concurrent.h>
-namespace gridgain
+namespace ignite
{
namespace impl
{
http://git-wip-us.apache.org/repos/asf/ignite/blob/843fc30b/modules/platform/src/main/cpp/core/include/gridgain/impl/interop/interop_input_stream.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/gridgain/impl/interop/interop_input_stream.h b/modules/platform/src/main/cpp/core/include/gridgain/impl/interop/interop_input_stream.h
index f1ca2f9..4cf3b04 100644
--- a/modules/platform/src/main/cpp/core/include/gridgain/impl/interop/interop_input_stream.h
+++ b/modules/platform/src/main/cpp/core/include/gridgain/impl/interop/interop_input_stream.h
@@ -20,7 +20,7 @@
#include "gridgain/impl/interop/interop_memory.h"
-namespace gridgain
+namespace ignite
{
namespace impl
{
http://git-wip-us.apache.org/repos/asf/ignite/blob/843fc30b/modules/platform/src/main/cpp/core/include/gridgain/impl/interop/interop_memory.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/gridgain/impl/interop/interop_memory.h b/modules/platform/src/main/cpp/core/include/gridgain/impl/interop/interop_memory.h
index 566a768..00cba43 100644
--- a/modules/platform/src/main/cpp/core/include/gridgain/impl/interop/interop_memory.h
+++ b/modules/platform/src/main/cpp/core/include/gridgain/impl/interop/interop_memory.h
@@ -22,7 +22,7 @@
#include <ignite/common/common.h>
-namespace gridgain
+namespace ignite
{
namespace impl
{
http://git-wip-us.apache.org/repos/asf/ignite/blob/843fc30b/modules/platform/src/main/cpp/core/include/gridgain/impl/interop/interop_output_stream.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/gridgain/impl/interop/interop_output_stream.h b/modules/platform/src/main/cpp/core/include/gridgain/impl/interop/interop_output_stream.h
index cc31db2..d75eefb 100644
--- a/modules/platform/src/main/cpp/core/include/gridgain/impl/interop/interop_output_stream.h
+++ b/modules/platform/src/main/cpp/core/include/gridgain/impl/interop/interop_output_stream.h
@@ -20,7 +20,7 @@
#include "gridgain/impl/interop/interop_memory.h"
-namespace gridgain
+namespace ignite
{
namespace impl
{
http://git-wip-us.apache.org/repos/asf/ignite/blob/843fc30b/modules/platform/src/main/cpp/core/include/gridgain/impl/operations.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/gridgain/impl/operations.h b/modules/platform/src/main/cpp/core/include/gridgain/impl/operations.h
index 8e937cb..87f7d11 100644
--- a/modules/platform/src/main/cpp/core/include/gridgain/impl/operations.h
+++ b/modules/platform/src/main/cpp/core/include/gridgain/impl/operations.h
@@ -29,7 +29,7 @@
#include "gridgain/impl/portable/portable_writer_impl.h"
#include "gridgain/portable/portable.h"
-namespace gridgain
+namespace ignite
{
namespace impl
{
@@ -52,7 +52,7 @@ namespace gridgain
*
* @param writer Writer.
*/
- virtual void ProcessInput(gridgain::impl::portable::PortableWriterImpl& writer) = 0;
+ virtual void ProcessInput(ignite::impl::portable::PortableWriterImpl& writer) = 0;
};
/**
@@ -72,7 +72,7 @@ namespace gridgain
// No-op.
}
- virtual void ProcessInput(gridgain::impl::portable::PortableWriterImpl& writer)
+ virtual void ProcessInput(ignite::impl::portable::PortableWriterImpl& writer)
{
writer.WriteTopObject<T>(*val);
}
@@ -101,7 +101,7 @@ namespace gridgain
// No-op.
}
- virtual void ProcessInput(gridgain::impl::portable::PortableWriterImpl& writer)
+ virtual void ProcessInput(ignite::impl::portable::PortableWriterImpl& writer)
{
writer.WriteTopObject<T1>(*val1);
writer.WriteTopObject<T2>(*val2);
@@ -135,7 +135,7 @@ namespace gridgain
// No-op.
}
- virtual void ProcessInput(gridgain::impl::portable::PortableWriterImpl& writer)
+ virtual void ProcessInput(ignite::impl::portable::PortableWriterImpl& writer)
{
writer.WriteTopObject<T1>(*val1);
writer.WriteTopObject<T2>(*val2);
@@ -171,7 +171,7 @@ namespace gridgain
// No-op.
}
- virtual void ProcessInput(gridgain::impl::portable::PortableWriterImpl& writer)
+ virtual void ProcessInput(ignite::impl::portable::PortableWriterImpl& writer)
{
writer.GetStream()->WriteInt32(static_cast<int32_t>(val->size()));
@@ -202,7 +202,7 @@ namespace gridgain
// No-op.
}
- virtual void ProcessInput(gridgain::impl::portable::PortableWriterImpl& writer)
+ virtual void ProcessInput(ignite::impl::portable::PortableWriterImpl& writer)
{
writer.GetStream()->WriteInt32(static_cast<int32_t>(val->size()));
@@ -236,7 +236,7 @@ namespace gridgain
// No-op.
}
- virtual void ProcessInput(gridgain::impl::portable::PortableWriterImpl& writer)
+ virtual void ProcessInput(ignite::impl::portable::PortableWriterImpl& writer)
{
writer.WriteTopObject<T>(*key);
writer.GetStream()->WriteInt32(peekModes);
@@ -270,7 +270,7 @@ namespace gridgain
*
* @param reader Reader.
*/
- virtual void ProcessOutput(gridgain::impl::portable::PortableReaderImpl& reader) = 0;
+ virtual void ProcessOutput(ignite::impl::portable::PortableReaderImpl& reader) = 0;
};
/**
@@ -288,7 +288,7 @@ namespace gridgain
// No-op.
}
- virtual void ProcessOutput(gridgain::impl::portable::PortableReaderImpl& reader)
+ virtual void ProcessOutput(ignite::impl::portable::PortableReaderImpl& reader)
{
val = reader.ReadTopObject<T>();
}
@@ -324,7 +324,7 @@ namespace gridgain
// No-op.
}
- virtual void ProcessOutput(gridgain::impl::portable::PortableReaderImpl& reader)
+ virtual void ProcessOutput(ignite::impl::portable::PortableReaderImpl& reader)
{
val1 = reader.ReadTopObject<T1>();
val2 = reader.ReadTopObject<T2>();
@@ -375,7 +375,7 @@ namespace gridgain
// No-op.
}
- virtual void ProcessOutput(gridgain::impl::portable::PortableReaderImpl& reader)
+ virtual void ProcessOutput(ignite::impl::portable::PortableReaderImpl& reader)
{
bool exists = reader.GetStream()->ReadBool();
@@ -422,12 +422,12 @@ namespace gridgain
/**
* Constructor.
*/
- OutQueryGetAllOperation(std::vector<gridgain::cache::CacheEntry<K, V>>* res) : res(res)
+ OutQueryGetAllOperation(std::vector<ignite::cache::CacheEntry<K, V>>* res) : res(res)
{
// No-op.
}
- virtual void ProcessOutput(gridgain::impl::portable::PortableReaderImpl& reader)
+ virtual void ProcessOutput(ignite::impl::portable::PortableReaderImpl& reader)
{
int32_t cnt = reader.ReadInt32();
@@ -436,13 +436,13 @@ namespace gridgain
K key = reader.ReadTopObject<K>();
V val = reader.ReadTopObject<V>();
- res->push_back(gridgain::cache::CacheEntry<K, V>(key, val));
+ res->push_back(ignite::cache::CacheEntry<K, V>(key, val));
}
}
private:
/** Entries. */
- std::vector<gridgain::cache::CacheEntry<K, V>>* res;
+ std::vector<ignite::cache::CacheEntry<K, V>>* res;
IGNITE_NO_COPY_ASSIGNMENT(OutQueryGetAllOperation)
};
http://git-wip-us.apache.org/repos/asf/ignite/blob/843fc30b/modules/platform/src/main/cpp/core/include/gridgain/impl/portable/portable_common.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/gridgain/impl/portable/portable_common.h b/modules/platform/src/main/cpp/core/include/gridgain/impl/portable/portable_common.h
index 7477c44..622cb54 100644
--- a/modules/platform/src/main/cpp/core/include/gridgain/impl/portable/portable_common.h
+++ b/modules/platform/src/main/cpp/core/include/gridgain/impl/portable/portable_common.h
@@ -20,7 +20,7 @@
#include <stdint.h>
-namespace gridgain
+namespace ignite
{
namespace impl
{
http://git-wip-us.apache.org/repos/asf/ignite/blob/843fc30b/modules/platform/src/main/cpp/core/include/gridgain/impl/portable/portable_id_resolver.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/gridgain/impl/portable/portable_id_resolver.h b/modules/platform/src/main/cpp/core/include/gridgain/impl/portable/portable_id_resolver.h
index 825f919..00447d9 100644
--- a/modules/platform/src/main/cpp/core/include/gridgain/impl/portable/portable_id_resolver.h
+++ b/modules/platform/src/main/cpp/core/include/gridgain/impl/portable/portable_id_resolver.h
@@ -20,7 +20,7 @@
#include "gridgain/portable/portable_type.h"
-namespace gridgain
+namespace ignite
{
namespace impl
{
@@ -69,7 +69,7 @@ namespace gridgain
*/
TemplatedPortableIdResolver()
{
- type = gridgain::portable::PortableType<T>();
+ type = ignite::portable::PortableType<T>();
}
/**
@@ -77,7 +77,7 @@ namespace gridgain
*
* @param type Portable type.
*/
- TemplatedPortableIdResolver(gridgain::portable::PortableType<T> type) : type(type)
+ TemplatedPortableIdResolver(ignite::portable::PortableType<T> type) : type(type)
{
// No-op.
}
@@ -97,7 +97,7 @@ namespace gridgain
}
private:
/** Actual type. */
- gridgain::portable::PortableType<T> type;
+ ignite::portable::PortableType<T> type;
};
}
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/843fc30b/modules/platform/src/main/cpp/core/include/gridgain/impl/portable/portable_metadata_handler.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/gridgain/impl/portable/portable_metadata_handler.h b/modules/platform/src/main/cpp/core/include/gridgain/impl/portable/portable_metadata_handler.h
index bc38486..c55e6b2 100644
--- a/modules/platform/src/main/cpp/core/include/gridgain/impl/portable/portable_metadata_handler.h
+++ b/modules/platform/src/main/cpp/core/include/gridgain/impl/portable/portable_metadata_handler.h
@@ -22,7 +22,7 @@
#include "gridgain/impl/portable/portable_metadata_snapshot.h"
-namespace gridgain
+namespace ignite
{
namespace impl
{
http://git-wip-us.apache.org/repos/asf/ignite/blob/843fc30b/modules/platform/src/main/cpp/core/include/gridgain/impl/portable/portable_metadata_manager.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/gridgain/impl/portable/portable_metadata_manager.h b/modules/platform/src/main/cpp/core/include/gridgain/impl/portable/portable_metadata_manager.h
index eeab4d3..64dc0a3c 100644
--- a/modules/platform/src/main/cpp/core/include/gridgain/impl/portable/portable_metadata_manager.h
+++ b/modules/platform/src/main/cpp/core/include/gridgain/impl/portable/portable_metadata_manager.h
@@ -25,7 +25,7 @@
#include "gridgain/impl/portable/portable_metadata_handler.h"
#include "gridgain/impl/portable/portable_metadata_updater.h"
-namespace gridgain
+namespace ignite
{
namespace impl
{
http://git-wip-us.apache.org/repos/asf/ignite/blob/843fc30b/modules/platform/src/main/cpp/core/include/gridgain/impl/portable/portable_metadata_snapshot.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/gridgain/impl/portable/portable_metadata_snapshot.h b/modules/platform/src/main/cpp/core/include/gridgain/impl/portable/portable_metadata_snapshot.h
index 68eba75..1e000fc 100644
--- a/modules/platform/src/main/cpp/core/include/gridgain/impl/portable/portable_metadata_snapshot.h
+++ b/modules/platform/src/main/cpp/core/include/gridgain/impl/portable/portable_metadata_snapshot.h
@@ -26,7 +26,7 @@
#include <ignite/common/common.h>
#include <ignite/common/concurrent.h>
-namespace gridgain
+namespace ignite
{
namespace impl
{
http://git-wip-us.apache.org/repos/asf/ignite/blob/843fc30b/modules/platform/src/main/cpp/core/include/gridgain/impl/portable/portable_metadata_updater.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/gridgain/impl/portable/portable_metadata_updater.h b/modules/platform/src/main/cpp/core/include/gridgain/impl/portable/portable_metadata_updater.h
index 8a1a615..a2fb9ed 100644
--- a/modules/platform/src/main/cpp/core/include/gridgain/impl/portable/portable_metadata_updater.h
+++ b/modules/platform/src/main/cpp/core/include/gridgain/impl/portable/portable_metadata_updater.h
@@ -21,7 +21,7 @@
#include "gridgain/grid_error.h"
#include "gridgain/impl/portable/portable_metadata_snapshot.h"
-namespace gridgain
+namespace ignite
{
namespace impl
{
http://git-wip-us.apache.org/repos/asf/ignite/blob/843fc30b/modules/platform/src/main/cpp/core/include/gridgain/impl/portable/portable_metadata_updater_impl.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/gridgain/impl/portable/portable_metadata_updater_impl.h b/modules/platform/src/main/cpp/core/include/gridgain/impl/portable/portable_metadata_updater_impl.h
index ae447d2..7ce86e7 100644
--- a/modules/platform/src/main/cpp/core/include/gridgain/impl/portable/portable_metadata_updater_impl.h
+++ b/modules/platform/src/main/cpp/core/include/gridgain/impl/portable/portable_metadata_updater_impl.h
@@ -23,7 +23,7 @@
#include "gridgain/impl/grid_environment.h"
#include "gridgain/impl/portable/portable_metadata_updater.h"
-namespace gridgain
+namespace ignite
{
namespace impl
{
http://git-wip-us.apache.org/repos/asf/ignite/blob/843fc30b/modules/platform/src/main/cpp/core/include/gridgain/impl/portable/portable_reader_impl.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/gridgain/impl/portable/portable_reader_impl.h b/modules/platform/src/main/cpp/core/include/gridgain/impl/portable/portable_reader_impl.h
index edee162..75debc4 100644
--- a/modules/platform/src/main/cpp/core/include/gridgain/impl/portable/portable_reader_impl.h
+++ b/modules/platform/src/main/cpp/core/include/gridgain/impl/portable/portable_reader_impl.h
@@ -31,7 +31,7 @@
#include "gridgain/portable/portable_type.h"
#include "gridgain/guid.h"
-namespace gridgain
+namespace ignite
{
namespace impl
{
@@ -505,7 +505,7 @@ namespace gridgain
* @param size Collection size.
* @return Read session ID.
*/
- int32_t ReadCollection(gridgain::portable::CollectionType* typ, int32_t* size);
+ int32_t ReadCollection(ignite::portable::CollectionType* typ, int32_t* size);
/**
* Start collection read.
@@ -515,7 +515,7 @@ namespace gridgain
* @param size Collection size.
* @return Read session ID.
*/
- int32_t ReadCollection(const char* fieldName, gridgain::portable::CollectionType* typ, int32_t* size);
+ int32_t ReadCollection(const char* fieldName, ignite::portable::CollectionType* typ, int32_t* size);
/**
* Start map read.
@@ -524,7 +524,7 @@ namespace gridgain
* @param size Map size.
* @return Read session ID.
*/
- int32_t ReadMap(gridgain::portable::MapType* typ, int32_t* size);
+ int32_t ReadMap(ignite::portable::MapType* typ, int32_t* size);
/**
* Start map read.
@@ -534,7 +534,7 @@ namespace gridgain
* @param size Map size.
* @return Read session ID.
*/
- int32_t ReadMap(const char* fieldName, gridgain::portable::MapType* typ, int32_t* size);
+ int32_t ReadMap(const char* fieldName, ignite::portable::MapType* typ, int32_t* size);
/**
* Check whether next value exists.
@@ -639,7 +639,7 @@ namespace gridgain
if (hdr == IGNITE_HDR_NULL)
return GetNull<T>();
else if (hdr == IGNITE_HDR_HND) {
- IGNITE_ERROR_1(gridgain::GridError::IGNITE_ERR_PORTABLE, "Circular references are not supported.");
+ IGNITE_ERROR_1(ignite::GridError::IGNITE_ERR_PORTABLE, "Circular references are not supported.");
}
else if (hdr == IGNITE_TYPE_PORTABLE)
{
@@ -663,10 +663,10 @@ namespace gridgain
int32_t len = stream->ReadInt32();
int32_t rawOff = stream->ReadInt32();
- gridgain::portable::PortableType<T> type;
+ ignite::portable::PortableType<T> type;
TemplatedPortableIdResolver<T> idRslvr(type);
PortableReaderImpl readerImpl(stream, &idRslvr, pos, usrType, typeId, hashCode, len, rawOff);
- gridgain::portable::PortableReader reader(&readerImpl);
+ ignite::portable::PortableReader reader(&readerImpl);
T val = type.Read(reader);
@@ -682,7 +682,7 @@ namespace gridgain
template<typename T>
T GetNull()
{
- gridgain::portable::PortableType<T> type;
+ ignite::portable::PortableType<T> type;
return type.GetNull();
}
@@ -1020,7 +1020,7 @@ namespace gridgain
* @param func Function to be applied to the stream.
*/
template<typename T>
- T ReadTopObject0(const int8_t expHdr, T(*func) (gridgain::impl::interop::InteropInputStream*))
+ T ReadTopObject0(const int8_t expHdr, T(*func) (ignite::impl::interop::InteropInputStream*))
{
int8_t typeId = stream->ReadInt8();
@@ -1043,7 +1043,7 @@ namespace gridgain
* @param dflt Default value.
*/
template<typename T>
- T ReadTopObject0(const int8_t expHdr, T(*func) (gridgain::impl::interop::InteropInputStream*), T dflt)
+ T ReadTopObject0(const int8_t expHdr, T(*func) (ignite::impl::interop::InteropInputStream*), T dflt)
{
int8_t typeId = stream->ReadInt8();
@@ -1097,7 +1097,7 @@ namespace gridgain
bool utf8Mode = stream->ReadBool();
int32_t realLen = stream->ReadInt32();
- gridgain::impl::utils::SafeArray<char> arr(realLen + 1);
+ ignite::impl::utils::SafeArray<char> arr(realLen + 1);
if (utf8Mode)
{
http://git-wip-us.apache.org/repos/asf/ignite/blob/843fc30b/modules/platform/src/main/cpp/core/include/gridgain/impl/portable/portable_utils.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/gridgain/impl/portable/portable_utils.h b/modules/platform/src/main/cpp/core/include/gridgain/impl/portable/portable_utils.h
index 17a428f..aa7ecba 100644
--- a/modules/platform/src/main/cpp/core/include/gridgain/impl/portable/portable_utils.h
+++ b/modules/platform/src/main/cpp/core/include/gridgain/impl/portable/portable_utils.h
@@ -22,7 +22,7 @@
#include "gridgain/guid.h"
-namespace gridgain
+namespace ignite
{
namespace impl
{
http://git-wip-us.apache.org/repos/asf/ignite/blob/843fc30b/modules/platform/src/main/cpp/core/include/gridgain/impl/portable/portable_writer_impl.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/gridgain/impl/portable/portable_writer_impl.h b/modules/platform/src/main/cpp/core/include/gridgain/impl/portable/portable_writer_impl.h
index 96e718f..41f8c37 100644
--- a/modules/platform/src/main/cpp/core/include/gridgain/impl/portable/portable_writer_impl.h
+++ b/modules/platform/src/main/cpp/core/include/gridgain/impl/portable/portable_writer_impl.h
@@ -34,7 +34,7 @@
#include "gridgain/portable/portable_type.h"
#include "gridgain/guid.h"
-namespace gridgain
+namespace ignite
{
namespace impl
{
@@ -54,7 +54,7 @@ namespace gridgain
* @param metaMgr Metadata manager.
* @param metaHnd Metadata handler.
*/
- PortableWriterImpl(gridgain::impl::interop::InteropOutputStream* stream, PortableIdResolver* idRslvr,
+ PortableWriterImpl(ignite::impl::interop::InteropOutputStream* stream, PortableIdResolver* idRslvr,
PortableMetadataManager* metaMgr, PortableMetadataHandler* metaHnd);
/**
@@ -64,7 +64,7 @@ namespace gridgain
* @param stream Interop stream.
* @param metaMgr Metadata manager.
*/
- PortableWriterImpl(gridgain::impl::interop::InteropOutputStream* stream, PortableMetadataManager* metaMgr);
+ PortableWriterImpl(ignite::impl::interop::InteropOutputStream* stream, PortableMetadataManager* metaMgr);
/**
* Write 8-byte signed integer. Maps to "byte" type in Java.
@@ -430,7 +430,7 @@ namespace gridgain
* @param typ Collection type.
* @return Session ID.
*/
- int32_t WriteCollection(gridgain::portable::CollectionType typ);
+ int32_t WriteCollection(ignite::portable::CollectionType typ);
/**
* Start collection write.
@@ -439,7 +439,7 @@ namespace gridgain
* @param typ Collection type.
* @return Session ID.
*/
- int32_t WriteCollection(const char* fieldName, gridgain::portable::CollectionType typ);
+ int32_t WriteCollection(const char* fieldName, ignite::portable::CollectionType typ);
/**
* Start map write.
@@ -447,7 +447,7 @@ namespace gridgain
* @param typ Map type.
* @return Session ID.
*/
- int32_t WriteMap(gridgain::portable::MapType typ);
+ int32_t WriteMap(ignite::portable::MapType typ);
/**
* Start map write.
@@ -456,7 +456,7 @@ namespace gridgain
* @param typ Map type.
* @return Session ID.
*/
- int32_t WriteMap(const char* fieldName, gridgain::portable::MapType typ);
+ int32_t WriteMap(const char* fieldName, ignite::portable::MapType typ);
/**
* Write collection element.
@@ -556,7 +556,7 @@ namespace gridgain
template<typename T>
void WriteTopObject(const T& obj)
{
- gridgain::portable::PortableType<T> type;
+ ignite::portable::PortableType<T> type;
if (type.IsNull(obj))
stream->WriteInt8(IGNITE_HDR_NULL);
@@ -569,7 +569,7 @@ namespace gridgain
metaHnd = metaMgr->GetHandler(idRslvr.GetTypeId());
PortableWriterImpl writerImpl(stream, &idRslvr, metaMgr, metaHnd.Get());
- gridgain::portable::PortableWriter writer(&writerImpl);
+ ignite::portable::PortableWriter writer(&writerImpl);
int32_t pos = stream->Position();
@@ -600,7 +600,7 @@ namespace gridgain
impl::interop::InteropOutputStream* GetStream();
private:
/** Underlying stream. */
- gridgain::impl::interop::InteropOutputStream* stream;
+ ignite::impl::interop::InteropOutputStream* stream;
/** ID resolver. */
PortableIdResolver* idRslvr;
http://git-wip-us.apache.org/repos/asf/ignite/blob/843fc30b/modules/platform/src/main/cpp/core/include/gridgain/portable/portable_consts.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/gridgain/portable/portable_consts.h b/modules/platform/src/main/cpp/core/include/gridgain/portable/portable_consts.h
index 2c1f6bc..ef6db45 100644
--- a/modules/platform/src/main/cpp/core/include/gridgain/portable/portable_consts.h
+++ b/modules/platform/src/main/cpp/core/include/gridgain/portable/portable_consts.h
@@ -20,7 +20,7 @@
#include <ignite/common/common.h>
-namespace gridgain
+namespace ignite
{
namespace portable
{
http://git-wip-us.apache.org/repos/asf/ignite/blob/843fc30b/modules/platform/src/main/cpp/core/include/gridgain/portable/portable_containers.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/gridgain/portable/portable_containers.h b/modules/platform/src/main/cpp/core/include/gridgain/portable/portable_containers.h
index 02e9d3e..85d8f1b 100644
--- a/modules/platform/src/main/cpp/core/include/gridgain/portable/portable_containers.h
+++ b/modules/platform/src/main/cpp/core/include/gridgain/portable/portable_containers.h
@@ -25,7 +25,7 @@
#include "gridgain/impl/utils.h"
#include "gridgain/portable/portable_consts.h"
-namespace gridgain
+namespace ignite
{
namespace portable
{
http://git-wip-us.apache.org/repos/asf/ignite/blob/843fc30b/modules/platform/src/main/cpp/core/include/gridgain/portable/portable_raw_reader.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/gridgain/portable/portable_raw_reader.h b/modules/platform/src/main/cpp/core/include/gridgain/portable/portable_raw_reader.h
index c26271f..addf4a3 100644
--- a/modules/platform/src/main/cpp/core/include/gridgain/portable/portable_raw_reader.h
+++ b/modules/platform/src/main/cpp/core/include/gridgain/portable/portable_raw_reader.h
@@ -28,7 +28,7 @@
#include "gridgain/portable/portable_containers.h"
#include "gridgain/guid.h"
-namespace gridgain
+namespace ignite
{
namespace portable
{
@@ -43,7 +43,7 @@ namespace gridgain
*
* @param impl Implementation.
*/
- PortableRawReader(gridgain::impl::portable::PortableReaderImpl* impl);
+ PortableRawReader(ignite::impl::portable::PortableReaderImpl* impl);
/**
* Read 8-byte signed integer. Maps to "byte" type in Java.
@@ -240,7 +240,7 @@ namespace gridgain
if (len != -1)
{
- gridgain::impl::utils::SafeArray<char> arr(len + 1);
+ ignite::impl::utils::SafeArray<char> arr(len + 1);
ReadString(arr.target, len + 1);
@@ -316,7 +316,7 @@ namespace gridgain
}
private:
/** Implementation delegate. */
- gridgain::impl::portable::PortableReaderImpl* impl;
+ ignite::impl::portable::PortableReaderImpl* impl;
};
}
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/843fc30b/modules/platform/src/main/cpp/core/include/gridgain/portable/portable_raw_writer.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/gridgain/portable/portable_raw_writer.h b/modules/platform/src/main/cpp/core/include/gridgain/portable/portable_raw_writer.h
index 3a3ac38..1e71296 100644
--- a/modules/platform/src/main/cpp/core/include/gridgain/portable/portable_raw_writer.h
+++ b/modules/platform/src/main/cpp/core/include/gridgain/portable/portable_raw_writer.h
@@ -27,7 +27,7 @@
#include "gridgain/portable/portable_containers.h"
#include "gridgain/guid.h"
-namespace gridgain
+namespace ignite
{
namespace portable
{
@@ -42,7 +42,7 @@ namespace gridgain
*
* @param impl Implementation.
*/
- PortableRawWriter(gridgain::impl::portable::PortableWriterImpl* impl);
+ PortableRawWriter(ignite::impl::portable::PortableWriterImpl* impl);
/**
* Write 8-byte signed integer. Maps to "byte" type in Java.
@@ -247,7 +247,7 @@ namespace gridgain
* @return Collection writer.
*/
template<typename T>
- PortableCollectionWriter<T> WriteCollection(gridgain::portable::CollectionType typ)
+ PortableCollectionWriter<T> WriteCollection(ignite::portable::CollectionType typ)
{
int32_t id = impl->WriteCollection(typ);
@@ -273,7 +273,7 @@ namespace gridgain
* @return Map writer.
*/
template<typename K, typename V>
- PortableMapWriter<K, V> WriteMap(gridgain::portable::MapType typ)
+ PortableMapWriter<K, V> WriteMap(ignite::portable::MapType typ)
{
int32_t id = impl->WriteMap(typ);
@@ -292,7 +292,7 @@ namespace gridgain
}
private:
/** Implementation delegate. */
- gridgain::impl::portable::PortableWriterImpl* impl;
+ ignite::impl::portable::PortableWriterImpl* impl;
};
}
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/843fc30b/modules/platform/src/main/cpp/core/include/gridgain/portable/portable_reader.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/gridgain/portable/portable_reader.h b/modules/platform/src/main/cpp/core/include/gridgain/portable/portable_reader.h
index 2f49859..b8fa2e0 100644
--- a/modules/platform/src/main/cpp/core/include/gridgain/portable/portable_reader.h
+++ b/modules/platform/src/main/cpp/core/include/gridgain/portable/portable_reader.h
@@ -26,7 +26,7 @@
#include "gridgain/portable/portable_raw_reader.h"
#include "gridgain/guid.h"
-namespace gridgain
+namespace ignite
{
namespace portable
{
@@ -41,7 +41,7 @@ namespace gridgain
*
* @param impl Implementation.
*/
- PortableReader(gridgain::impl::portable::PortableReaderImpl* impl);
+ PortableReader(ignite::impl::portable::PortableReaderImpl* impl);
/**
* Read 8-byte signed integer. Maps to "byte" type in Java.
@@ -259,7 +259,7 @@ namespace gridgain
if (len != -1)
{
- gridgain::impl::utils::SafeArray<char> arr(len + 1);
+ ignite::impl::utils::SafeArray<char> arr(len + 1);
ReadString(fieldName, arr.target, len + 1);
@@ -347,7 +347,7 @@ namespace gridgain
PortableRawReader RawReader();
private:
/** Implementation delegate. */
- gridgain::impl::portable::PortableReaderImpl* impl;
+ ignite::impl::portable::PortableReaderImpl* impl;
};
}
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/843fc30b/modules/platform/src/main/cpp/core/include/gridgain/portable/portable_type.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/gridgain/portable/portable_type.h b/modules/platform/src/main/cpp/core/include/gridgain/portable/portable_type.h
index c1fda73..c5c1cdb 100644
--- a/modules/platform/src/main/cpp/core/include/gridgain/portable/portable_type.h
+++ b/modules/platform/src/main/cpp/core/include/gridgain/portable/portable_type.h
@@ -119,7 +119,7 @@ T GetNull() \
return NULL; \
}
-namespace gridgain
+namespace ignite
{
namespace portable
{
http://git-wip-us.apache.org/repos/asf/ignite/blob/843fc30b/modules/platform/src/main/cpp/core/include/gridgain/portable/portable_writer.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/gridgain/portable/portable_writer.h b/modules/platform/src/main/cpp/core/include/gridgain/portable/portable_writer.h
index 2cbc201..9d3a281 100644
--- a/modules/platform/src/main/cpp/core/include/gridgain/portable/portable_writer.h
+++ b/modules/platform/src/main/cpp/core/include/gridgain/portable/portable_writer.h
@@ -25,7 +25,7 @@
#include "gridgain/portable/portable_raw_writer.h"
-namespace gridgain
+namespace ignite
{
namespace portable
{
@@ -40,7 +40,7 @@ namespace gridgain
*
* @param impl Implementation.
*/
- PortableWriter(gridgain::impl::portable::PortableWriterImpl* impl);
+ PortableWriter(ignite::impl::portable::PortableWriterImpl* impl);
/**
* Write 8-byte signed integer. Maps to "byte" type in Java.
@@ -272,7 +272,7 @@ namespace gridgain
* @return Collection writer.
*/
template<typename T>
- PortableCollectionWriter<T> WriteCollection(const char* fieldName, gridgain::portable::CollectionType typ)
+ PortableCollectionWriter<T> WriteCollection(const char* fieldName, ignite::portable::CollectionType typ)
{
int32_t id = impl->WriteCollection(fieldName, typ);
@@ -300,7 +300,7 @@ namespace gridgain
* @return Map writer.
*/
template<typename K, typename V>
- PortableMapWriter<K, V> WriteMap(const char* fieldName, gridgain::portable::MapType typ)
+ PortableMapWriter<K, V> WriteMap(const char* fieldName, ignite::portable::MapType typ)
{
int32_t id = impl->WriteMap(fieldName, typ);
@@ -327,7 +327,7 @@ namespace gridgain
PortableRawWriter RawWriter();
private:
/** Implementation delegate. */
- gridgain::impl::portable::PortableWriterImpl* impl;
+ ignite::impl::portable::PortableWriterImpl* impl;
};
}
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/843fc30b/modules/platform/src/main/cpp/core/os/win/include/gridgain/impl/utils.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/os/win/include/gridgain/impl/utils.h b/modules/platform/src/main/cpp/core/os/win/include/gridgain/impl/utils.h
index 3ad40b7..2380930 100644
--- a/modules/platform/src/main/cpp/core/os/win/include/gridgain/impl/utils.h
+++ b/modules/platform/src/main/cpp/core/os/win/include/gridgain/impl/utils.h
@@ -29,7 +29,7 @@
#define IGNITE_FRIEND_EXPORT
#endif
-namespace gridgain
+namespace ignite
{
namespace impl
{
http://git-wip-us.apache.org/repos/asf/ignite/blob/843fc30b/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
index 3223cad..16a1451 100644
--- 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
@@ -19,7 +19,7 @@
#include "gridgain/impl/utils.h"
-namespace gridgain
+namespace ignite
{
namespace impl
{
http://git-wip-us.apache.org/repos/asf/ignite/blob/843fc30b/modules/platform/src/main/cpp/core/src/grid.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/src/grid.cpp b/modules/platform/src/main/cpp/core/src/grid.cpp
index b6dd72d..fd25702 100644
--- a/modules/platform/src/main/cpp/core/src/grid.cpp
+++ b/modules/platform/src/main/cpp/core/src/grid.cpp
@@ -21,9 +21,9 @@
#include "gridgain/grid.h"
using namespace ignite::common::concurrent;
-using namespace gridgain::impl;
+using namespace ignite::impl;
-namespace gridgain
+namespace ignite
{
Grid::Grid() : impl(SharedPointer<GridImpl>())
{
http://git-wip-us.apache.org/repos/asf/ignite/blob/843fc30b/modules/platform/src/main/cpp/core/src/grid_error.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/src/grid_error.cpp b/modules/platform/src/main/cpp/core/src/grid_error.cpp
index 95992ce..a909ff6 100644
--- a/modules/platform/src/main/cpp/core/src/grid_error.cpp
+++ b/modules/platform/src/main/cpp/core/src/grid_error.cpp
@@ -20,9 +20,9 @@
#include "gridgain/grid_error.h"
using namespace ignite::common::java;
-using namespace gridgain::impl::utils;
+using namespace ignite::impl::utils;
-namespace gridgain
+namespace ignite
{
void GridError::ThrowIfNeeded(GridError& err)
{
@@ -170,8 +170,6 @@ namespace gridgain
*err = GridError(IGNITE_ERR_AUTHENTICATION, jniMsg);
else if (jniCls0.compare("org.apache.ignite.plugin.security.GridSecurityException") == 0)
*err = GridError(IGNITE_ERR_SECURITY, jniMsg);
- else if (jniCls0.compare("org.gridgain.grid.product.ProductLicenseException") == 0)
- *err = GridError(IGNITE_ERR_PRODUCT_LICENSE, jniMsg);
else if (jniCls0.compare("org.apache.ignite.IgniteException") == 0)
*err = GridError(IGNITE_ERR_GENERIC, jniMsg);
else if (jniCls0.compare("org.apache.ignite.IgniteCheckedException") == 0)
http://git-wip-us.apache.org/repos/asf/ignite/blob/843fc30b/modules/platform/src/main/cpp/core/src/grid_factory.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/src/grid_factory.cpp b/modules/platform/src/main/cpp/core/src/grid_factory.cpp
index b2ef1e2..0014320 100644
--- a/modules/platform/src/main/cpp/core/src/grid_factory.cpp
+++ b/modules/platform/src/main/cpp/core/src/grid_factory.cpp
@@ -29,10 +29,10 @@
using namespace ignite::common::concurrent;
using namespace ignite::common::java;
-using namespace gridgain::impl;
-using namespace gridgain::impl::utils;
+using namespace ignite::impl;
+using namespace ignite::impl::utils;
-namespace gridgain
+namespace ignite
{
/** Default configuration. */
const char* GRID_DFLT_CFG = "config/default-config.xml";
http://git-wip-us.apache.org/repos/asf/ignite/blob/843fc30b/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
index c747480..75670e6 100644
--- a/modules/platform/src/main/cpp/core/src/guid.cpp
+++ b/modules/platform/src/main/cpp/core/src/guid.cpp
@@ -17,7 +17,7 @@
#include "gridgain/guid.h"
-namespace gridgain
+namespace ignite
{
Guid::Guid() : most(0), least(0)
{
http://git-wip-us.apache.org/repos/asf/ignite/blob/843fc30b/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
index f6354ec..637e7a1 100644
--- 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
@@ -25,16 +25,16 @@
using namespace ignite::common::concurrent;
using namespace ignite::common::java;
-using namespace gridgain::cache;
-using namespace gridgain::cache::query;
-using namespace gridgain::impl;
-using namespace gridgain::impl::cache::query;
-using namespace gridgain::impl::interop;
-using namespace gridgain::impl::portable;
-using namespace gridgain::impl::utils;
-using namespace gridgain::portable;
-
-namespace gridgain
+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
{
@@ -171,7 +171,7 @@ namespace gridgain
OutOpInternal(OP_PUT, inOp, err);
}
- void CacheImpl::PutAll(gridgain::impl::InputOperation& inOp, GridError* err)
+ void CacheImpl::PutAll(ignite::impl::InputOperation& inOp, GridError* err)
{
OutOpInternal(OP_PUT_ALL, inOp, err);
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/843fc30b/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
index d10a6dd..35b7fd9 100644
--- 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
@@ -19,10 +19,10 @@
using namespace ignite::common::concurrent;
using namespace ignite::common::java;
-using namespace gridgain::impl::interop;
-using namespace gridgain::impl::portable;
+using namespace ignite::impl::interop;
+using namespace ignite::impl::portable;
-namespace gridgain
+namespace ignite
{
namespace impl
{
http://git-wip-us.apache.org/repos/asf/ignite/blob/843fc30b/modules/platform/src/main/cpp/core/src/impl/grid_environment.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/src/impl/grid_environment.cpp b/modules/platform/src/main/cpp/core/src/impl/grid_environment.cpp
index bce5f0d..e66da91 100644
--- a/modules/platform/src/main/cpp/core/src/impl/grid_environment.cpp
+++ b/modules/platform/src/main/cpp/core/src/impl/grid_environment.cpp
@@ -21,11 +21,11 @@
using namespace ignite::common::concurrent;
using namespace ignite::common::java;
-using namespace gridgain::impl::interop;
-using namespace gridgain::impl::portable;
-using namespace gridgain::portable;
+using namespace ignite::impl::interop;
+using namespace ignite::impl::portable;
+using namespace ignite::portable;
-namespace gridgain
+namespace ignite
{
namespace impl
{
http://git-wip-us.apache.org/repos/asf/ignite/blob/843fc30b/modules/platform/src/main/cpp/core/src/impl/grid_impl.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/src/impl/grid_impl.cpp b/modules/platform/src/main/cpp/core/src/impl/grid_impl.cpp
index 6bebf9c..b79e548 100644
--- a/modules/platform/src/main/cpp/core/src/impl/grid_impl.cpp
+++ b/modules/platform/src/main/cpp/core/src/impl/grid_impl.cpp
@@ -20,7 +20,7 @@
using namespace ignite::common::concurrent;
using namespace ignite::common::java;
-namespace gridgain
+namespace ignite
{
namespace impl
{
http://git-wip-us.apache.org/repos/asf/ignite/blob/843fc30b/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
index 72ffac8..c52833c 100644
--- a/modules/platform/src/main/cpp/core/src/impl/handle_registry.cpp
+++ b/modules/platform/src/main/cpp/core/src/impl/handle_registry.cpp
@@ -19,7 +19,7 @@
using namespace ignite::common::concurrent;
-namespace gridgain
+namespace ignite
{
namespace impl
{
http://git-wip-us.apache.org/repos/asf/ignite/blob/843fc30b/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
index 89fb5fa..c938416 100644
--- 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
@@ -37,7 +37,7 @@
CopyAndShift(reinterpret_cast<int8_t*>(res), 0, len << shift); \
}
-namespace gridgain
+namespace ignite
{
namespace impl
{
http://git-wip-us.apache.org/repos/asf/ignite/blob/843fc30b/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
index d0024d8..52e19e7 100644
--- 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
@@ -22,7 +22,7 @@
using namespace ignite::common::java;
-namespace gridgain
+namespace ignite
{
namespace impl
{
http://git-wip-us.apache.org/repos/asf/ignite/blob/843fc30b/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
index 27a47d3..ebf2c67 100644
--- 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
@@ -36,7 +36,7 @@
CopyAndShift(reinterpret_cast<const int8_t*>(val), 0, len); \
}
-namespace gridgain
+namespace ignite
{
namespace impl
{
http://git-wip-us.apache.org/repos/asf/ignite/blob/843fc30b/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
index 3cda810..1ad40d0 100644
--- 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
@@ -19,7 +19,7 @@
using namespace ignite::common::concurrent;
-namespace gridgain
+namespace ignite
{
namespace impl
{
http://git-wip-us.apache.org/repos/asf/ignite/blob/843fc30b/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
index ad456c5..fe5b5c6 100644
--- 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
@@ -21,7 +21,7 @@
using namespace ignite::common::concurrent;
-namespace gridgain
+namespace ignite
{
namespace impl
{
http://git-wip-us.apache.org/repos/asf/ignite/blob/843fc30b/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
index 08790f4..f9a57fc 100644
--- 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
@@ -17,7 +17,7 @@
#include "gridgain/impl/portable/portable_metadata_snapshot.h"
-namespace gridgain
+namespace ignite
{
namespace impl
{
http://git-wip-us.apache.org/repos/asf/ignite/blob/843fc30b/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
index 7720eba..f0f8e8e 100644
--- 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
@@ -17,7 +17,7 @@
#include "gridgain/impl/portable/portable_metadata_updater.h"
-namespace gridgain
+namespace ignite
{
namespace impl
{
http://git-wip-us.apache.org/repos/asf/ignite/blob/843fc30b/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
index a685772..ea89b53 100644
--- 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
@@ -22,11 +22,11 @@
using namespace ignite::common::concurrent;
using namespace ignite::common::java;
-using namespace gridgain::impl;
-using namespace gridgain::impl::interop;
-using namespace gridgain::portable;
+using namespace ignite::impl;
+using namespace ignite::impl::interop;
+using namespace ignite::portable;
-namespace gridgain
+namespace ignite
{
namespace impl
{
http://git-wip-us.apache.org/repos/asf/ignite/blob/843fc30b/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
index fc72552..264885c 100644
--- 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
@@ -23,11 +23,11 @@
#include "gridgain/portable/portable_type.h"
#include "gridgain/grid_error.h"
-using namespace gridgain::impl::interop;
-using namespace gridgain::impl::portable;
-using namespace gridgain::portable;
+using namespace ignite::impl::interop;
+using namespace ignite::impl::portable;
+using namespace ignite::portable;
-namespace gridgain
+namespace ignite
{
namespace impl
{
http://git-wip-us.apache.org/repos/asf/ignite/blob/843fc30b/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
index e6ac052..3f9c48d 100644
--- 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
@@ -18,10 +18,10 @@
#include "gridgain/impl/interop/interop.h"
#include "gridgain/impl/portable/portable_utils.h"
-using namespace gridgain::impl::interop;
-using namespace gridgain::impl::portable;
+using namespace ignite::impl::interop;
+using namespace ignite::impl::portable;
-namespace gridgain
+namespace ignite
{
namespace impl
{
http://git-wip-us.apache.org/repos/asf/ignite/blob/843fc30b/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
index 16bd990..a4eb5b6 100644
--- 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
@@ -18,11 +18,11 @@
#include "gridgain/impl/portable/portable_writer_impl.h"
#include "gridgain/grid_error.h"
-using namespace gridgain::impl::interop;
-using namespace gridgain::impl::portable;
-using namespace gridgain::portable;
+using namespace ignite::impl::interop;
+using namespace ignite::impl::portable;
+using namespace ignite::portable;
-namespace gridgain
+namespace ignite
{
namespace impl
{
@@ -418,7 +418,7 @@ namespace gridgain
return elemId;
}
- int32_t PortableWriterImpl::WriteMap(gridgain::portable::MapType typ)
+ int32_t PortableWriterImpl::WriteMap(ignite::portable::MapType typ)
{
StartContainerSession(true);
@@ -429,7 +429,7 @@ namespace gridgain
return elemId;
}
- int32_t PortableWriterImpl::WriteMap(const char* fieldName, gridgain::portable::MapType typ)
+ int32_t PortableWriterImpl::WriteMap(const char* fieldName, ignite::portable::MapType typ)
{
StartContainerSession(false);
http://git-wip-us.apache.org/repos/asf/ignite/blob/843fc30b/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
index ade48b9..2d6e1d2 100644
--- a/modules/platform/src/main/cpp/core/src/portable/portable_containers.cpp
+++ b/modules/platform/src/main/cpp/core/src/portable/portable_containers.cpp
@@ -17,9 +17,9 @@
#include "gridgain/portable/portable_containers.h"
-using namespace gridgain::impl::portable;
+using namespace ignite::impl::portable;
-namespace gridgain
+namespace ignite
{
namespace portable
{
http://git-wip-us.apache.org/repos/asf/ignite/blob/843fc30b/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
index 52840c8..e9809d6 100644
--- 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
@@ -17,9 +17,9 @@
#include "gridgain/impl/portable/portable_reader_impl.h"
#include "gridgain/portable/portable_raw_reader.h"
-using namespace gridgain::impl::portable;
+using namespace ignite::impl::portable;
-namespace gridgain
+namespace ignite
{
namespace portable
{
[15/16] ignite git commit: IGNITE-1364: Moved headers to correct
folders.
Posted by vo...@apache.org.
http://git-wip-us.apache.org/repos/asf/ignite/blob/0d70d547/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
index c4f0a11..ee27df8 100644
--- 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
@@ -1,10 +1,18 @@
/*
- * Copyright (C) GridGain Systems. All Rights Reserved.
- * _________ _____ __________________ _____
- * __ ____/___________(_)______ /__ ____/______ ____(_)_______
- * _ / __ __ ___/__ / _ __ / _ / __ _ __ `/__ / __ __ \
- * / /_/ / _ / _ / / /_/ / / /_/ / / /_/ / _ / _ / / /
- * \____/ /_/ /_/ \_,__/ \____/ \__,_/ /_/ /_/ /_/
+ * 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
@@ -13,11 +21,11 @@
#include <boost/test/unit_test.hpp>
-#include "gridgain/impl/interop/interop.h"
-#include "gridgain/portable/portable.h"
+#include "ignite/impl/interop/interop.h"
+#include "ignite/portable/portable.h"
-#include "gridgain/portable_test_defs.h"
-#include "gridgain/portable_test_utils.h"
+#include "ignite/portable_test_defs.h"
+#include "ignite/portable_test_utils.h"
using namespace ignite;
using namespace ignite::impl::interop;
http://git-wip-us.apache.org/repos/asf/ignite/blob/0d70d547/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
index 2f42971..9d84e48 100644
--- 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
@@ -1,10 +1,18 @@
/*
- * Copyright (C) GridGain Systems. All Rights Reserved.
- * _________ _____ __________________ _____
- * __ ____/___________(_)______ /__ ____/______ ____(_)_______
- * _ / __ __ ___/__ / _ __ / _ / __ _ __ `/__ / __ __ \
- * / /_/ / _ / _ / / /_/ / / /_/ / / /_/ / _ / _ / / /
- * \____/ /_/ /_/ \_,__/ \____/ \__,_/ /_/ /_/ /_/
+ * 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
@@ -13,11 +21,11 @@
#include <boost/test/unit_test.hpp>
-#include "gridgain/impl/interop/interop.h"
-#include "gridgain/impl/portable/portable_reader_impl.h"
-#include "gridgain/impl/portable/portable_writer_impl.h"
+#include "ignite/impl/interop/interop.h"
+#include "ignite/impl/portable/portable_reader_impl.h"
+#include "ignite/impl/portable/portable_writer_impl.h"
-#include "gridgain/portable_test_defs.h"
+#include "ignite/portable_test_defs.h"
using namespace ignite;
using namespace ignite::impl::interop;
http://git-wip-us.apache.org/repos/asf/ignite/blob/0d70d547/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
index d96d4eb..e818711 100644
--- 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
@@ -1,16 +1,24 @@
/*
- * Copyright (C) GridGain Systems. All Rights Reserved.
- * _________ _____ __________________ _____
- * __ ____/___________(_)______ /__ ____/______ ____(_)_______
- * _ / __ __ ___/__ / _ __ / _ / __ _ __ `/__ / __ __ \
- * / /_/ / _ / _ / / /_/ / / /_/ / / /_/ / _ / _ / / /
- * \____/ /_/ /_/ \_,__/ \____/ \__,_/ /_/ /_/ /_/
+ * 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 "gridgain/impl/interop/interop.h"
-#include "gridgain/portable/portable.h"
+#include "ignite/impl/interop/interop.h"
+#include "ignite/portable/portable.h"
-#include "gridgain/portable_test_defs.h"
+#include "ignite/portable_test_defs.h"
using namespace ignite;
using namespace ignite::impl::interop;
http://git-wip-us.apache.org/repos/asf/ignite/blob/0d70d547/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
index 8a91c4e..45c666d 100644
--- a/modules/platform/src/main/cpp/core-test/src/teamcity_boost.cpp
+++ b/modules/platform/src/main/cpp/core-test/src/teamcity_boost.cpp
@@ -15,7 +15,7 @@
* $Revision: 88625 $
*/
-#define BOOST_TEST_MODULE GridGainCoreTest
+#define BOOST_TEST_MODULE IgniteCoreTest
#include <sstream>
http://git-wip-us.apache.org/repos/asf/ignite/blob/0d70d547/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
index 365d662..07091c6 100644
--- a/modules/platform/src/main/cpp/core/Makefile.am
+++ b/modules/platform/src/main/cpp/core/Makefile.am
@@ -52,12 +52,12 @@ COMMON_SRC = os/linux/src/impl/utils.cpp \
src/grid.cpp \
src/grid_factory.cpp
-lib_LTLIBRARIES = libgridgain.la
-libgridgain_la_SOURCES = $(COMMON_SRC)
-libgridgain_la_LDFLAGS = $(LIB_LDFLAGS) -L/usr/local/lib -lignite-common -ldl -version-info 0:0:0 -release $(PACKAGE_VERSION)
+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 = gridgain.pc
+pkgconfig_DATA = ignite.pc
clean-local:
$(RM) *.gcno *.gcda
http://git-wip-us.apache.org/repos/asf/ignite/blob/0d70d547/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
index 5f93b3c..cdd238f 100644
--- a/modules/platform/src/main/cpp/core/configure.ac
+++ b/modules/platform/src/main/cpp/core/configure.ac
@@ -19,7 +19,7 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.69])
-AC_INIT([GridGain for C++], [7.4.1], [info@gridgain.com], [gridgain], [www.gridgain.com])
+AC_INIT([Apache Ignite C++], [1.4.0], [dev@ignite.apache.org], [ignite], [ignite.apache.org])
AC_CONFIG_SRCDIR(src)
AC_CANONICAL_SYSTEM
@@ -57,6 +57,6 @@ AC_TYPE_SIZE_T
# Checks for library functions.
AC_FUNC_ERROR_AT_LINE
-AC_CONFIG_FILES(Makefile include/Makefile os/linux/include/Makefile gridgain.pc)
+AC_CONFIG_FILES(Makefile include/Makefile os/linux/include/Makefile ignite.pc)
AC_OUTPUT
http://git-wip-us.apache.org/repos/asf/ignite/blob/0d70d547/modules/platform/src/main/cpp/core/gridgain.pc.in
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/gridgain.pc.in b/modules/platform/src/main/cpp/core/gridgain.pc.in
deleted file mode 100644
index f248f8c..0000000
--- a/modules/platform/src/main/cpp/core/gridgain.pc.in
+++ /dev/null
@@ -1,9 +0,0 @@
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-libdir=@libdir@
-includedir=@includedir@
-
-Name: gridgain
-Description: GridGain for C++.
-Version: @PACKAGE_VERSION@
-Libs: -L${libdir} -lgridgain
http://git-wip-us.apache.org/repos/asf/ignite/blob/0d70d547/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
new file mode 100644
index 0000000..613fd1a
--- /dev/null
+++ b/modules/platform/src/main/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/0d70d547/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
index 20300b3..e938e1c 100644
--- a/modules/platform/src/main/cpp/core/include/Makefile.am
+++ b/modules/platform/src/main/cpp/core/include/Makefile.am
@@ -17,45 +17,45 @@
ACLOCAL_AMFLAGS = "-Im4"
-nobase_include_HEADERS = gridgain/cache/cache.h \
- gridgain/cache/cache_entry.h \
- gridgain/cache/cache_peek_mode.h \
- gridgain/cache/query/query_argument.h \
- gridgain/cache/query/query_cursor.h \
- gridgain/cache/query/query_scan.h \
- gridgain/cache/query/query_sql.h \
- gridgain/cache/query/query_text.h \
- gridgain/cache/query/query.h \
- gridgain/impl/cache/cache_impl.h \
- gridgain/impl/cache/query/query_impl.h \
- gridgain/impl/interop/interop.h \
- gridgain/impl/interop/interop_input_stream.h \
- gridgain/impl/interop/interop_memory.h \
- gridgain/impl/interop/interop_output_stream.h \
- gridgain/impl/portable/portable_metadata_handler.h \
- gridgain/impl/portable/portable_metadata_manager.h \
- gridgain/impl/portable/portable_metadata_snapshot.h \
- gridgain/impl/portable/portable_metadata_updater.h \
- gridgain/impl/portable/portable_metadata_updater_impl.h \
- gridgain/impl/portable/portable_common.h \
- gridgain/impl/portable/portable_id_resolver.h \
- gridgain/impl/portable/portable_reader_impl.h \
- gridgain/impl/portable/portable_utils.h \
- gridgain/impl/portable/portable_writer_impl.h \
- gridgain/impl/grid_environment.h \
- gridgain/impl/grid_impl.h \
- gridgain/impl/handle_registry.h \
- gridgain/impl/operations.h \
- gridgain/portable/portable.h \
- gridgain/portable/portable_consts.h \
- gridgain/portable/portable_containers.h \
- gridgain/portable/portable_type.h \
- gridgain/portable/portable_raw_reader.h \
- gridgain/portable/portable_raw_writer.h \
- gridgain/portable/portable_reader.h \
- gridgain/portable/portable_writer.h \
- gridgain/grid.h \
- gridgain/grid_configuration.h \
- gridgain/grid_error.h \
- gridgain/grid_factory.h \
- gridgain/guid.h
+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/grid_environment.h \
+ ignite/impl/grid_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/grid.h \
+ ignite/grid_configuration.h \
+ ignite/grid_error.h \
+ ignite/grid_factory.h \
+ ignite/guid.h
http://git-wip-us.apache.org/repos/asf/ignite/blob/0d70d547/modules/platform/src/main/cpp/core/include/gridgain/cache/cache.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/gridgain/cache/cache.h b/modules/platform/src/main/cpp/core/include/gridgain/cache/cache.h
deleted file mode 100644
index 940bff3..0000000
--- a/modules/platform/src/main/cpp/core/include/gridgain/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 "gridgain/cache/cache_peek_mode.h"
-#include "gridgain/cache/query/query_cursor.h"
-#include "gridgain/cache/query/query_scan.h"
-#include "gridgain/cache/query/query_sql.h"
-#include "gridgain/cache/query/query_text.h"
-#include "gridgain/impl/cache/cache_impl.h"
-#include "gridgain/impl/operations.h"
-#include "gridgain/grid_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()
- {
- GridError err;
-
- bool res = IsEmpty(err);
-
- GridError::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(GridError& 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)
- {
- GridError err;
-
- bool res = ContainsKey(key, err);
-
- GridError::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, GridError& 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)
- {
- GridError err;
-
- bool res = ContainsKeys(keys, err);
-
- GridError::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, GridError& 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)
- {
- GridError err;
-
- V res = LocalPeek(key, peekModes, err);
-
- GridError::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, GridError& 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)
- {
- GridError err;
-
- V res = Get(key, err);
-
- GridError::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, GridError& 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)
- {
- GridError err;
-
- std::map<K, V> res = GetAll(keys, err);
-
- GridError::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, GridError& 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)
- {
- GridError err;
-
- Put(key, val, err);
-
- GridError::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, GridError& 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)
- {
- GridError err;
-
- PutAll(vals, err);
-
- GridError::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, GridError& 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)
- {
- GridError err;
-
- V res = GetAndPut(key, val, err);
-
- GridError::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, GridError& 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)
- {
- GridError err;
-
- V res = GetAndReplace(key, val, err);
-
- GridError::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, GridError& 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)
- {
- GridError err;
-
- V res = GetAndRemove(key, err);
-
- GridError::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, GridError& 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)
- {
- GridError err;
-
- bool res = PutIfAbsent(key, val, err);
-
- GridError::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, GridError& 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)
- {
- GridError err;
-
- V res = GetAndPutIfAbsent(key, val, err);
-
- GridError::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, GridError& 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)
- {
- GridError err;
-
- bool res = Replace(key, val, err);
-
- GridError::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, GridError& 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)
- {
- GridError err;
-
- bool res = Replace(key, oldVal, newVal, err);
-
- GridError::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, GridError& 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)
- {
- GridError err;
-
- LocalEvict(keys, err);
-
- GridError::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, GridError& err)
- {
- impl::InSetOperation<K> op(&keys);
-
- impl.Get()->LocalEvict(op, &err);
- }
-
- /**
- * Clear cache.
- */
- void Clear()
- {
- GridError err;
-
- Clear(err);
-
- GridError::ThrowIfNeeded(err);
- }
-
- /**
- * Clear cache.
- *
- * @param err Error.
- */
- void Clear(GridError& 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)
- {
- GridError err;
-
- Clear(key, err);
-
- GridError::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, GridError& 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)
- {
- GridError err;
-
- ClearAll(keys, err);
-
- GridError::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, GridError& 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)
- {
- GridError err;
-
- LocalClear(key, err);
-
- GridError::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, GridError& 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)
- {
- GridError err;
-
- LocalClearAll(keys, err);
-
- GridError::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, GridError& 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)
- {
- GridError err;
-
- bool res = Remove(key, err);
-
- GridError::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, GridError& 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)
- {
- GridError err;
-
- bool res = Remove(key, val, err);
-
- GridError::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, GridError& 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)
- {
- GridError err;
-
- RemoveAll(keys, err);
-
- GridError::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, GridError& 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()
- {
- GridError err;
-
- RemoveAll(err);
-
- GridError::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(GridError& 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(GridError& 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)
- {
- GridError err;
-
- int32_t res = LocalSize(peekModes, err);
-
- GridError::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, GridError& 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(GridError& 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)
- {
- GridError err;
-
- int32_t res = Size(peekModes, err);
-
- GridError::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, GridError& 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)
- {
- GridError err;
-
- query::QueryCursor<K, V> res = Query(qry, err);
-
- GridError::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, GridError& 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)
- {
- GridError err;
-
- query::QueryCursor<K, V> res = Query(qry, err);
-
- GridError::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, GridError& 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)
- {
- GridError err;
-
- query::QueryCursor<K, V> res = Query(qry, err);
-
- GridError::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, GridError& 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/0d70d547/modules/platform/src/main/cpp/core/include/gridgain/cache/cache_entry.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/gridgain/cache/cache_entry.h b/modules/platform/src/main/cpp/core/include/gridgain/cache/cache_entry.h
deleted file mode 100644
index 2b6c785..0000000
--- a/modules/platform/src/main/cpp/core/include/gridgain/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/0d70d547/modules/platform/src/main/cpp/core/include/gridgain/cache/cache_peek_mode.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/gridgain/cache/cache_peek_mode.h b/modules/platform/src/main/cpp/core/include/gridgain/cache/cache_peek_mode.h
deleted file mode 100644
index be61887..0000000
--- a/modules/platform/src/main/cpp/core/include/gridgain/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/0d70d547/modules/platform/src/main/cpp/core/include/gridgain/cache/query/query.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/gridgain/cache/query/query.h b/modules/platform/src/main/cpp/core/include/gridgain/cache/query/query.h
deleted file mode 100644
index 2bf607c..0000000
--- a/modules/platform/src/main/cpp/core/include/gridgain/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 "gridgain/cache/query/query_argument.h"
-#include "gridgain/cache/query/query_cursor.h"
-#include "gridgain/cache/query/query_scan.h"
-#include "gridgain/cache/query/query_sql.h"
-#include "gridgain/cache/query/query_text.h"
-
-#endif
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/0d70d547/modules/platform/src/main/cpp/core/include/gridgain/cache/query/query_argument.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/gridgain/cache/query/query_argument.h b/modules/platform/src/main/cpp/core/include/gridgain/cache/query/query_argument.h
deleted file mode 100644
index 1ed96da..0000000
--- a/modules/platform/src/main/cpp/core/include/gridgain/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 "gridgain/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/0d70d547/modules/platform/src/main/cpp/core/include/gridgain/cache/query/query_cursor.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/gridgain/cache/query/query_cursor.h b/modules/platform/src/main/cpp/core/include/gridgain/cache/query/query_cursor.h
deleted file mode 100644
index dbe738c..0000000
--- a/modules/platform/src/main/cpp/core/include/gridgain/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 "gridgain/cache/cache_entry.h"
-#include "gridgain/grid_error.h"
-#include "gridgain/impl/cache/query/query_impl.h"
-#include "gridgain/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()
- {
- GridError err;
-
- bool res = HasNext(err);
-
- GridError::ThrowIfNeeded(err);
-
- return res;
- }
-
- /**
- * Check whether next entry exists.
- *
- * @param err Error.
- * @return True if next entry exists.
- */
- bool HasNext(GridError& err)
- {
- impl::cache::query::QueryCursorImpl* impl0 = impl.Get();
-
- if (impl0)
- return impl0->HasNext(&err);
- else
- {
- err = GridError(GridError::IGNITE_ERR_GENERIC,
- "Instance is not usable (did you check for error?).");
-
- return false;
- }
- }
-
- /**
- * Get next entry.
- *
- * @return Next entry.
- */
- CacheEntry<K, V> GetNext()
- {
- GridError err;
-
- CacheEntry<K, V> res = GetNext(err);
-
- GridError::ThrowIfNeeded(err);
-
- return res;
- }
-
- /**
- * Get next entry.
- *
- * @param err Error.
- * @return Next entry.
- */
- CacheEntry<K, V> GetNext(GridError& err)
- {
- impl::cache::query::QueryCursorImpl* impl0 = impl.Get();
-
- if (impl0) {
- impl::Out2Operation<K, V> outOp;
-
- impl0->GetNext(outOp, &err);
-
- if (err.GetCode() == GridError::IGNITE_SUCCESS)
- {
- K& key = outOp.Get1();
- V& val = outOp.Get2();
-
- return CacheEntry<K, V>(key, val);
- }
- else
- return CacheEntry<K, V>();
- }
- else
- {
- err = GridError(GridError::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)
- {
- GridError err;
-
- GetAll(res, err);
-
- GridError::ThrowIfNeeded(err);
- }
-
- /**
- * Get all entries.
- *
- * @param Vector where query entries will be stored.
- * @param err Error.
- */
- void GetAll(std::vector<CacheEntry<K, V>>& res, GridError& err)
- {
- impl::cache::query::QueryCursorImpl* impl0 = impl.Get();
-
- if (impl0) {
- impl::OutQueryGetAllOperation<K, V> outOp(&res);
-
- impl0->GetAll(outOp, &err);
- }
- else
- err = GridError(GridError::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/0d70d547/modules/platform/src/main/cpp/core/include/gridgain/cache/query/query_scan.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/gridgain/cache/query/query_scan.h b/modules/platform/src/main/cpp/core/include/gridgain/cache/query/query_scan.h
deleted file mode 100644
index 0955aee..0000000
--- a/modules/platform/src/main/cpp/core/include/gridgain/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 "gridgain/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
[11/16] ignite git commit: IGNITE-1364: Moved headers to correct
folders.
Posted by vo...@apache.org.
http://git-wip-us.apache.org/repos/asf/ignite/blob/0d70d547/modules/platform/src/main/cpp/core/include/gridgain/impl/portable/portable_writer_impl.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/gridgain/impl/portable/portable_writer_impl.h b/modules/platform/src/main/cpp/core/include/gridgain/impl/portable/portable_writer_impl.h
deleted file mode 100644
index 41f8c37..0000000
--- a/modules/platform/src/main/cpp/core/include/gridgain/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 "gridgain/impl/interop/interop_output_stream.h"
-#include "gridgain/impl/portable/portable_common.h"
-#include "gridgain/impl/portable/portable_id_resolver.h"
-#include "gridgain/impl/portable/portable_metadata_manager.h"
-#include "gridgain/impl/portable/portable_utils.h"
-#include "gridgain/portable/portable_consts.h"
-#include "gridgain/portable/portable_type.h"
-#include "gridgain/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/0d70d547/modules/platform/src/main/cpp/core/include/gridgain/portable/portable.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/gridgain/portable/portable.h b/modules/platform/src/main/cpp/core/include/gridgain/portable/portable.h
deleted file mode 100644
index 60d4311..0000000
--- a/modules/platform/src/main/cpp/core/include/gridgain/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 "gridgain/portable/portable_consts.h"
-#include "gridgain/portable/portable_containers.h"
-#include "gridgain/portable/portable_type.h"
-#include "gridgain/portable/portable_raw_reader.h"
-#include "gridgain/portable/portable_raw_writer.h"
-#include "gridgain/portable/portable_reader.h"
-#include "gridgain/portable/portable_writer.h"
-
-#endif
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/0d70d547/modules/platform/src/main/cpp/core/include/gridgain/portable/portable_consts.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/gridgain/portable/portable_consts.h b/modules/platform/src/main/cpp/core/include/gridgain/portable/portable_consts.h
deleted file mode 100644
index ef6db45..0000000
--- a/modules/platform/src/main/cpp/core/include/gridgain/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/0d70d547/modules/platform/src/main/cpp/core/include/gridgain/portable/portable_containers.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/gridgain/portable/portable_containers.h b/modules/platform/src/main/cpp/core/include/gridgain/portable/portable_containers.h
deleted file mode 100644
index 85d8f1b..0000000
--- a/modules/platform/src/main/cpp/core/include/gridgain/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 "gridgain/impl/portable/portable_writer_impl.h"
-#include "gridgain/impl/portable/portable_reader_impl.h"
-#include "gridgain/impl/utils.h"
-#include "gridgain/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/0d70d547/modules/platform/src/main/cpp/core/include/gridgain/portable/portable_raw_reader.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/gridgain/portable/portable_raw_reader.h b/modules/platform/src/main/cpp/core/include/gridgain/portable/portable_raw_reader.h
deleted file mode 100644
index addf4a3..0000000
--- a/modules/platform/src/main/cpp/core/include/gridgain/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 "gridgain/impl/portable/portable_reader_impl.h"
-#include "gridgain/portable/portable_consts.h"
-#include "gridgain/portable/portable_containers.h"
-#include "gridgain/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/0d70d547/modules/platform/src/main/cpp/core/include/gridgain/portable/portable_raw_writer.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/gridgain/portable/portable_raw_writer.h b/modules/platform/src/main/cpp/core/include/gridgain/portable/portable_raw_writer.h
deleted file mode 100644
index 1e71296..0000000
--- a/modules/platform/src/main/cpp/core/include/gridgain/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 "gridgain/impl/portable/portable_writer_impl.h"
-#include "gridgain/portable/portable_consts.h"
-#include "gridgain/portable/portable_containers.h"
-#include "gridgain/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
http://git-wip-us.apache.org/repos/asf/ignite/blob/0d70d547/modules/platform/src/main/cpp/core/include/gridgain/portable/portable_reader.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/gridgain/portable/portable_reader.h b/modules/platform/src/main/cpp/core/include/gridgain/portable/portable_reader.h
deleted file mode 100644
index b8fa2e0..0000000
--- a/modules/platform/src/main/cpp/core/include/gridgain/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 "gridgain/portable/portable_raw_reader.h"
-#include "gridgain/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