You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by ak...@apache.org on 2015/11/10 05:27:36 UTC
[10/21] ignite git commit: IGNITE-1846: CPP: "portable" -> "binary",
"metadata" -> "type".
http://git-wip-us.apache.org/repos/asf/ignite/blob/303d79eb/modules/platforms/cpp/core/include/ignite/binary/binary_containers.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core/include/ignite/binary/binary_containers.h b/modules/platforms/cpp/core/include/ignite/binary/binary_containers.h
new file mode 100644
index 0000000..61b7265
--- /dev/null
+++ b/modules/platforms/cpp/core/include/ignite/binary/binary_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_BINARY_CONTAINERS
+#define _IGNITE_BINARY_CONTAINERS
+
+#include <stdint.h>
+
+#include "ignite/impl/binary/binary_writer_impl.h"
+#include "ignite/impl/binary/binary_reader_impl.h"
+#include "ignite/impl/utils.h"
+#include "ignite/binary/binary_consts.h"
+
+namespace ignite
+{
+ namespace binary
+ {
+ /**
+ * Binary string array writer.
+ */
+ class IGNITE_IMPORT_EXPORT BinaryStringArrayWriter
+ {
+ public:
+ /**
+ * Constructor.
+ *
+ * @param id Identifier.
+ * @param impl Writer.
+ */
+ BinaryStringArrayWriter(impl::binary::BinaryWriterImpl* impl, 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, 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::binary::BinaryWriterImpl* impl;
+
+ /** Idnetifier. */
+ const int32_t id;
+ };
+
+ /**
+ * Binary collection writer.
+ */
+ template<typename T>
+ class IGNITE_IMPORT_EXPORT BinaryArrayWriter
+ {
+ public:
+ /**
+ * Constructor.
+ *
+ * @param impl Writer.
+ * @param id Identifier.
+ */
+ BinaryArrayWriter(impl::binary::BinaryWriterImpl* impl, 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::binary::BinaryWriterImpl* impl;
+
+ /** Idnetifier. */
+ const int32_t id;
+ };
+
+ /**
+ * Binary collection writer.
+ */
+ template<typename T>
+ class IGNITE_IMPORT_EXPORT BinaryCollectionWriter
+ {
+ public:
+ /**
+ * Constructor.
+ *
+ * @param impl Writer.
+ * @param id Identifier.
+ */
+ BinaryCollectionWriter(impl::binary::BinaryWriterImpl* impl, 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::binary::BinaryWriterImpl* impl;
+
+ /** Identifier. */
+ const int32_t id;
+ };
+
+ /**
+ * Binary map writer.
+ */
+ template<typename K, typename V>
+ class IGNITE_IMPORT_EXPORT BinaryMapWriter
+ {
+ public:
+ /**
+ * Constructor.
+ *
+ * @param impl Writer.
+ */
+ BinaryMapWriter(impl::binary::BinaryWriterImpl* impl, 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::binary::BinaryWriterImpl* impl;
+
+ /** Identifier. */
+ const int32_t id;
+ };
+
+ /**
+ * Binary string array reader.
+ */
+ class IGNITE_IMPORT_EXPORT BinaryStringArrayReader
+ {
+ public:
+ /**
+ * Constructor.
+ *
+ * @param impl Reader.
+ * @param id Identifier.
+ * @param size Array size.
+ */
+ BinaryStringArrayReader(impl::binary::BinaryReaderImpl* impl, int32_t id, 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, 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() const;
+
+ /**
+ * Whether array is NULL.
+ */
+ bool IsNull() const;
+ private:
+ /** Implementation delegate. */
+ impl::binary::BinaryReaderImpl* impl;
+
+ /** Identifier. */
+ const int32_t id;
+
+ /** Size. */
+ const int32_t size;
+ };
+
+ /**
+ * Binary array reader.
+ */
+ template<typename T>
+ class BinaryArrayReader
+ {
+ public:
+ /**
+ * Constructor.
+ *
+ * @param impl Reader.
+ * @param id Identifier.
+ * @param size Array size.
+ */
+ BinaryArrayReader(impl::binary::BinaryReaderImpl* impl, int32_t id, 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::binary::BinaryReaderImpl* impl;
+
+ /** Identifier. */
+ const int32_t id;
+
+ /** Size. */
+ const int32_t size;
+ };
+
+ /**
+ * Binary collection reader.
+ */
+ template<typename T>
+ class BinaryCollectionReader
+ {
+ public:
+ /**
+ * Constructor.
+ *
+ * @param impl Reader.
+ * @param id Identifier.
+ * @param type Collection type.
+ * @param size Collection size.
+ */
+ BinaryCollectionReader(impl::binary::BinaryReaderImpl* impl, int32_t id,
+ const CollectionType type, 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::binary::BinaryReaderImpl* impl;
+
+ /** Identifier. */
+ const int32_t id;
+
+ /** Collection type. */
+ const CollectionType type;
+
+ /** Size. */
+ const int32_t size;
+ };
+
+ /**
+ * Binary map reader.
+ */
+ template<typename K, typename V>
+ class BinaryMapReader
+ {
+ public:
+ /**
+ * Constructor.
+ *
+ * @param impl Reader.
+ * @param id Identifier.
+ * @param type Map type.
+ * @param size Map size.
+ */
+ BinaryMapReader(impl::binary::BinaryReaderImpl* impl, int32_t id, MapType type,
+ 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::binary::BinaryReaderImpl* 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/303d79eb/modules/platforms/cpp/core/include/ignite/binary/binary_raw_reader.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core/include/ignite/binary/binary_raw_reader.h b/modules/platforms/cpp/core/include/ignite/binary/binary_raw_reader.h
new file mode 100644
index 0000000..eb39c2d
--- /dev/null
+++ b/modules/platforms/cpp/core/include/ignite/binary/binary_raw_reader.h
@@ -0,0 +1,350 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT 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_BINARY_RAW_READER
+#define _IGNITE_BINARY_RAW_READER
+
+#include <stdint.h>
+#include <string>
+
+#include <ignite/common/common.h>
+
+#include "ignite/impl/binary/binary_reader_impl.h"
+#include "ignite/binary/binary_consts.h"
+#include "ignite/binary/binary_containers.h"
+#include "ignite/guid.h"
+
+namespace ignite
+{
+ namespace binary
+ {
+ /**
+ * Binary raw reader.
+ */
+ class IGNITE_IMPORT_EXPORT BinaryRawReader
+ {
+ public:
+ /**
+ * Constructor.
+ *
+ * @param impl Implementation.
+ */
+ BinaryRawReader(ignite::impl::binary::BinaryReaderImpl* 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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.
+ */
+ BinaryStringArrayReader ReadStringArray();
+
+ /**
+ * Start array read.
+ *
+ * @return Array reader.
+ */
+ template<typename T>
+ BinaryArrayReader<T> ReadArray()
+ {
+ int32_t size;
+
+ int32_t id = impl->ReadArray(&size);
+
+ return BinaryArrayReader<T>(impl, id, size);
+ }
+
+ /**
+ * Start collection read.
+ *
+ * @return Collection reader.
+ */
+ template<typename T>
+ BinaryCollectionReader<T> ReadCollection()
+ {
+ CollectionType typ;
+ int32_t size;
+
+ int32_t id = impl->ReadCollection(&typ, &size);
+
+ return BinaryCollectionReader<T>(impl, id, typ, size);
+ }
+
+ /**
+ * Read values and insert them to specified position.
+ *
+ * @param out Output iterator to the initial position in the destination sequence.
+ * @return Number of elements that have been read.
+ */
+ template<typename T, typename OutputIterator>
+ int32_t ReadCollection(OutputIterator out)
+ {
+ return impl->ReadCollection<T>(out);
+ }
+
+ /**
+ * Start map read.
+ *
+ * @return Map reader.
+ */
+ template<typename K, typename V>
+ BinaryMapReader<K, V> ReadMap()
+ {
+ MapType typ;
+ int32_t size;
+
+ int32_t id = impl->ReadMap(&typ, &size);
+
+ return BinaryMapReader<K, V>(impl, id, typ, size);
+ }
+
+ /**
+ * Read type of the collection.
+ *
+ * @return Collection type.
+ */
+ CollectionType ReadCollectionType();
+
+ /**
+ * Read type of the collection.
+ *
+ * @return Collection size.
+ */
+ int32_t ReadCollectionSize();
+
+ /**
+ * Read object.
+ *
+ * @return Object.
+ */
+ template<typename T>
+ T ReadObject()
+ {
+ return impl->ReadObject<T>();
+ }
+ private:
+ /** Implementation delegate. */
+ ignite::impl::binary::BinaryReaderImpl* impl;
+ };
+ }
+}
+
+#endif
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/303d79eb/modules/platforms/cpp/core/include/ignite/binary/binary_raw_writer.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core/include/ignite/binary/binary_raw_writer.h b/modules/platforms/cpp/core/include/ignite/binary/binary_raw_writer.h
new file mode 100644
index 0000000..2c3e75b
--- /dev/null
+++ b/modules/platforms/cpp/core/include/ignite/binary/binary_raw_writer.h
@@ -0,0 +1,326 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT 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_BINARY_RAW_WRITER
+#define _IGNITE_BINARY_RAW_WRITER
+
+#include <stdint.h>
+
+#include <ignite/common/common.h>
+
+#include "ignite/impl/binary/binary_writer_impl.h"
+#include "ignite/binary/binary_consts.h"
+#include "ignite/binary/binary_containers.h"
+#include "ignite/guid.h"
+
+namespace ignite
+{
+ namespace binary
+ {
+ /**
+ * Binary raw writer.
+ */
+ class IGNITE_IMPORT_EXPORT BinaryRawWriter
+ {
+ public:
+ /**
+ * Constructor.
+ *
+ * @param impl Implementation.
+ */
+ BinaryRawWriter(ignite::impl::binary::BinaryWriterImpl* impl);
+
+ /**
+ * Write 8-byte signed integer. Maps to "byte" type in Java.
+ *
+ * @param val Value.
+ */
+ void WriteInt8(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, int32_t len);
+
+ /**
+ * Write bool. Maps to "short" type in Java.
+ *
+ * @param val Value.
+ */
+ void WriteBool(bool val);
+
+ /**
+ * Write array of bools. Maps to "bool[]" type in Java.
+ *
+ * @param val Array.
+ * @param len Array length.
+ */
+ void WriteBoolArray(const bool* val, int32_t len);
+
+ /**
+ * Write 16-byte signed integer. Maps to "short" type in Java.
+ *
+ * @param val Value.
+ */
+ void WriteInt16(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, int32_t len);
+
+ /**
+ * Write 16-byte unsigned integer. Maps to "char" type in Java.
+ *
+ * @param val Value.
+ */
+ void WriteUInt16(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, int32_t len);
+
+ /**
+ * Write 32-byte signed integer. Maps to "int" type in Java.
+ *
+ * @param val Value.
+ */
+ void WriteInt32(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, int32_t len);
+
+ /**
+ * Write 64-byte signed integer. Maps to "long" type in Java.
+ *
+ * @param val Value.
+ */
+ void WriteInt64(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, int32_t len);
+
+ /**
+ * Write float. Maps to "float" type in Java.
+ *
+ * @param val Value.
+ */
+ void WriteFloat(float val);
+
+ /**
+ * Write array of floats. Maps to "float[]" type in Java.
+ *
+ * @param val Array.
+ * @param len Array length.
+ */
+ void WriteFloatArray(const float* val, int32_t len);
+
+ /**
+ * Write double. Maps to "double" type in Java.
+ *
+ * @param val Value.
+ */
+ void WriteDouble(double val);
+
+ /**
+ * Write array of doubles. Maps to "double[]" type in Java.
+ *
+ * @param val Array.
+ * @param len Array length.
+ */
+ void WriteDoubleArray(const double* val, 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, 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, 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.
+ */
+ BinaryStringArrayWriter WriteStringArray();
+
+ /**
+ * Write NULL value.
+ */
+ void WriteNull();
+
+ /**
+ * Start array write.
+ *
+ * @return Array writer.
+ */
+ template<typename T>
+ BinaryArrayWriter<T> WriteArray()
+ {
+ int32_t id = impl->WriteArray();
+
+ return BinaryArrayWriter<T>(impl, id);
+ }
+
+ /**
+ * Start collection write.
+ *
+ * @return Collection writer.
+ */
+ template<typename T>
+ BinaryCollectionWriter<T> WriteCollection()
+ {
+ return WriteCollection<T>(IGNITE_COLLECTION_UNDEFINED);
+ }
+
+ /**
+ * Start collection write.
+ *
+ * @param type Collection type.
+ * @return Collection writer.
+ */
+ template<typename T>
+ BinaryCollectionWriter<T> WriteCollection(CollectionType typ)
+ {
+ int32_t id = impl->WriteCollection(typ);
+
+ return BinaryCollectionWriter<T>(impl, id);
+ }
+
+ /**
+ * Write values in interval [first, last).
+ *
+ * @param first Iterator pointing to the beginning of the interval.
+ * @param last Iterator pointing to the end of the interval.
+ * @param typ Collection type.
+ */
+ template<typename InputIterator>
+ void WriteCollection(InputIterator first, InputIterator last)
+ {
+ impl->WriteCollection(first, last, IGNITE_COLLECTION_UNDEFINED);
+ }
+
+ /**
+ * Write values in interval [first, last).
+ *
+ * @param first Iterator pointing to the beginning of the interval.
+ * @param last Iterator pointing to the end of the interval.
+ * @param typ Collection type.
+ */
+ template<typename InputIterator>
+ void WriteCollection(InputIterator first, InputIterator last, CollectionType typ)
+ {
+ impl->WriteCollection(first, last, typ);
+ }
+
+ /**
+ * Start map write.
+ *
+ * @param typ Map type.
+ * @return Map writer.
+ */
+ template<typename K, typename V>
+ BinaryMapWriter<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>
+ BinaryMapWriter<K, V> WriteMap(MapType typ)
+ {
+ int32_t id = impl->WriteMap(typ);
+
+ return BinaryMapWriter<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::binary::BinaryWriterImpl* impl;
+ };
+ }
+}
+
+#endif
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/303d79eb/modules/platforms/cpp/core/include/ignite/binary/binary_reader.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core/include/ignite/binary/binary_reader.h b/modules/platforms/cpp/core/include/ignite/binary/binary_reader.h
new file mode 100644
index 0000000..75d2384
--- /dev/null
+++ b/modules/platforms/cpp/core/include/ignite/binary/binary_reader.h
@@ -0,0 +1,384 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT 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_BINARY_READER
+#define _IGNITE_BINARY_READER
+
+#include <stdint.h>
+#include <string>
+
+#include <ignite/common/common.h>
+
+#include "ignite/binary/binary_raw_reader.h"
+#include "ignite/guid.h"
+
+namespace ignite
+{
+ namespace binary
+ {
+ /**
+ * Binary reader.
+ */
+ class IGNITE_IMPORT_EXPORT BinaryReader
+ {
+ public:
+ /**
+ * Constructor.
+ *
+ * @param impl Implementation.
+ */
+ BinaryReader(ignite::impl::binary::BinaryReaderImpl* 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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.
+ */
+ BinaryStringArrayReader ReadStringArray(const char* fieldName);
+
+ /**
+ * Start array read.
+ *
+ * @param fieldName Field name.
+ * @return Array reader.
+ */
+ template<typename T>
+ BinaryArrayReader<T> ReadArray(const char* fieldName)
+ {
+ int32_t size;
+
+ int32_t id = impl->ReadArray(fieldName, &size);
+
+ return BinaryArrayReader<T>(impl, id, size);
+ }
+
+ /**
+ * Start collection read.
+ *
+ * @param fieldName Field name.
+ * @return Collection reader.
+ */
+ template<typename T>
+ BinaryCollectionReader<T> ReadCollection(const char* fieldName)
+ {
+ CollectionType typ;
+ int32_t size;
+
+ int32_t id = impl->ReadCollection(fieldName, &typ, &size);
+
+ return BinaryCollectionReader<T>(impl, id, typ, size);
+ }
+
+ /**
+ * Read values and insert them to specified position.
+ *
+ * @param fieldName Field name.
+ * @param out Output iterator to the initial position in the destination sequence.
+ * @return Number of elements that have been read.
+ */
+ template<typename T, typename OutputIterator>
+ int32_t ReadCollection(const char* fieldName, OutputIterator out)
+ {
+ return impl->ReadCollection<T>(fieldName, out);
+ }
+
+ /**
+ * Start map read.
+ *
+ * @param fieldName Field name.
+ * @return Map reader.
+ */
+ template<typename K, typename V>
+ BinaryMapReader<K, V> ReadMap(const char* fieldName)
+ {
+ MapType typ;
+ int32_t size;
+
+ int32_t id = impl->ReadMap(fieldName, &typ, &size);
+
+ return BinaryMapReader<K, V>(impl, id, typ, size);
+ }
+
+ /**
+ * Read type of the collection.
+ *
+ * @param fieldName Field name.
+ * @return Collection type.
+ */
+ CollectionType ReadCollectionType(const char* fieldName);
+
+ /**
+ * Read type of the collection.
+ *
+ * @param fieldName Field name.
+ * @return Collection size.
+ */
+ int32_t ReadCollectionSize(const char* fieldName);
+
+ /**
+ * 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.
+ */
+ BinaryRawReader RawReader();
+ private:
+ /** Implementation delegate. */
+ ignite::impl::binary::BinaryReaderImpl* impl;
+ };
+ }
+}
+
+#endif
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/303d79eb/modules/platforms/cpp/core/include/ignite/binary/binary_type.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core/include/ignite/binary/binary_type.h b/modules/platforms/cpp/core/include/ignite/binary/binary_type.h
new file mode 100644
index 0000000..576a4d6
--- /dev/null
+++ b/modules/platforms/cpp/core/include/ignite/binary/binary_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_BINARY_TYPE
+#define _IGNITE_BINARY_TYPE
+
+#include <stdint.h>
+
+#include <ignite/common/common.h>
+
+#include "ignite/ignite_error.h"
+
+/**
+ * Start binary type definition.
+ */
+#define IGNITE_BINARY_TYPE_START(T) \
+template<> \
+struct BinaryType<T> \
+{
+
+/**
+ * End binary type definition.
+ */
+#define IGNITE_BINARY_TYPE_END \
+};
+
+/**
+ * Implementation of GetTypeId() which returns predefined constant.
+ */
+#define IGNITE_BINARY_GET_TYPE_ID_AS_CONST(id) \
+int32_t GetTypeId() \
+{ \
+ return id; \
+}
+
+/**
+ * Implementation of GetTypeId() which returns hash of passed type name.
+ */
+#define IGNITE_BINARY_GET_TYPE_ID_AS_HASH(typeName) \
+int32_t GetTypeId() \
+{ \
+ return GetBinaryStringHashCode(#typeName); \
+}
+
+/**
+ * Implementation of GetTypeName() which returns type name as is.
+ */
+#define IGNITE_BINARY_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_BINARY_GET_FIELD_ID_AS_HASH \
+int32_t GetFieldId(const char* name) \
+{ \
+ return GetBinaryStringHashCode(name); \
+}
+
+/**
+ * Implementation of GetHashCode() function which always returns 0.
+ */
+#define IGNITE_BINARY_GET_HASH_CODE_ZERO(T) \
+int32_t GetHashCode(const T& obj) \
+{ \
+ return 0; \
+}
+
+/**
+ * Implementation of IsNull() function which always returns false.
+ */
+#define IGNITE_BINARY_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_BINARY_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_BINARY_GET_NULL_DEFAULT_CTOR(T) \
+T GetNull() \
+{ \
+ return T(); \
+}
+
+/**
+ * Implementation of GetNull() function which returns NULL pointer.
+ */
+#define IGNITE_BINARY_GET_NULL_NULLPTR(T) \
+T GetNull() \
+{ \
+ return NULL; \
+}
+
+namespace ignite
+{
+ namespace binary
+ {
+ class BinaryWriter;
+ class BinaryReader;
+
+ /**
+ * Get binary string hash code.
+ *
+ * @param val Value.
+ * @return Hash code.
+ */
+ IGNITE_IMPORT_EXPORT int32_t GetBinaryStringHashCode(const char* val);
+
+ /**
+ * Binary type structure. Defines a set of functions required for type to be serialized and deserialized.
+ */
+ template<typename T>
+ struct IGNITE_IMPORT_EXPORT BinaryType
+ {
+ /**
+ * Get binary object type ID.
+ *
+ * @return Type ID.
+ */
+ int32_t GetTypeId()
+ {
+ IGNITE_ERROR_1(IgniteError::IGNITE_ERR_BINARY, "GetTypeId function is not defined for binary type.");
+ }
+
+ /**
+ * Get binary object type name.
+ *
+ * @return Type name.
+ */
+ std::string GetTypeName()
+ {
+ IGNITE_ERROR_1(IgniteError::IGNITE_ERR_BINARY, "GetTypeName function is not defined for binary type.");
+ }
+
+ /**
+ * Get binary object field ID.
+ *
+ * @param name Field name.
+ * @return Field ID.
+ */
+ int32_t GetFieldId(const char* name)
+ {
+ return GetBinaryStringHashCode(name);
+ }
+
+ /**
+ * Get binary object hash code.
+ *
+ * @param obj Binary object.
+ * @return Hash code.
+ */
+ int32_t GetHashCode(const T& obj)
+ {
+ return 0;
+ }
+
+ /**
+ * Write binary object.
+ *
+ * @param writer Writer.
+ * @param obj Object.
+ */
+ void Write(BinaryWriter& writer, const T& obj)
+ {
+ IGNITE_ERROR_1(IgniteError::IGNITE_ERR_BINARY, "Write function is not defined for binary type.");
+ }
+
+ /**
+ * Read binary object.
+ *
+ * @param reader Reader.
+ * @return Object.
+ */
+ T Read(BinaryReader& reader)
+ {
+ IGNITE_ERROR_1(IgniteError::IGNITE_ERR_BINARY, "Read function is not defined for binary type.");
+ }
+
+ /**
+ * Check whether passed binary object should be interpreted as NULL.
+ *
+ * @param obj Binary object to test.
+ * @return True if binary object should be interpreted as NULL.
+ */
+ bool IsNull(const T& obj)
+ {
+ return false;
+ }
+
+ /**
+ * Get NULL value for the given binary type.
+ *
+ * @return NULL value.
+ */
+ T GetNull()
+ {
+ IGNITE_ERROR_1(IgniteError::IGNITE_ERR_BINARY, "GetNull function is not defined for binary type.");
+ }
+ };
+
+ /*
+ * Templated binary type for pointers.
+ */
+ template <typename T>
+ struct IGNITE_IMPORT_EXPORT BinaryType<T*>
+ {
+ /** Actual type. */
+ BinaryType<T> typ;
+
+ /**
+ * Constructor.
+ */
+ BinaryType()
+ {
+ typ = BinaryType<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(BinaryWriter& writer, T* const& obj)
+ {
+ typ.Write(writer, *obj);
+ }
+
+ T* Read(BinaryReader& 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/303d79eb/modules/platforms/cpp/core/include/ignite/binary/binary_writer.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core/include/ignite/binary/binary_writer.h b/modules/platforms/cpp/core/include/ignite/binary/binary_writer.h
new file mode 100644
index 0000000..0c7cc68
--- /dev/null
+++ b/modules/platforms/cpp/core/include/ignite/binary/binary_writer.h
@@ -0,0 +1,362 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT 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_BINARY_WRITER
+#define _IGNITE_BINARY_WRITER
+
+#include <string>
+#include <stdint.h>
+
+#include <ignite/common/common.h>
+
+#include "ignite/binary/binary_raw_writer.h"
+
+namespace ignite
+{
+ namespace binary
+ {
+ /**
+ * Binary writer.
+ */
+ class IGNITE_IMPORT_EXPORT BinaryWriter
+ {
+ public:
+ /**
+ * Constructor.
+ *
+ * @param impl Implementation.
+ */
+ BinaryWriter(ignite::impl::binary::BinaryWriterImpl* impl);
+
+ /**
+ * Write 8-byte signed integer. Maps to "byte" type in Java.
+ *
+ * @param fieldName Field name.
+ * @param val Value.
+ */
+ void WriteInt8(const char* fieldName, 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, int32_t len);
+
+ /**
+ * Write bool. Maps to "short" type in Java.
+ *
+ * @param fieldName Field name.
+ * @param val Value.
+ */
+ void WriteBool(const char* fieldName, 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, 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, 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, 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, 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, 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, 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, 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, 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, int32_t len);
+
+ /**
+ * Write float. Maps to "float" type in Java.
+ *
+ * @param fieldName Field name.
+ * @param val Value.
+ */
+ void WriteFloat(const char* fieldName, 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, int32_t len);
+
+ /**
+ * Write double. Maps to "double" type in Java.
+ *
+ * @param fieldName Field name.
+ * @param val Value.
+ */
+ void WriteDouble(const char* fieldName, 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, 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, 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, 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.
+ */
+ BinaryStringArrayWriter 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>
+ BinaryArrayWriter<T> WriteArray(const char* fieldName)
+ {
+ int32_t id = impl->WriteArray(fieldName);
+
+ return BinaryArrayWriter<T>(impl, id);
+ }
+
+ /**
+ * Start collection write.
+ *
+ * @param fieldName Field name.
+ * @return Collection writer.
+ */
+ template<typename T>
+ BinaryCollectionWriter<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>
+ BinaryCollectionWriter<T> WriteCollection(const char* fieldName, ignite::binary::CollectionType typ)
+ {
+ int32_t id = impl->WriteCollection(fieldName, typ);
+
+ return BinaryCollectionWriter<T>(impl, id);
+ }
+
+ /**
+ * Write values in interval [first, last).
+ *
+ * @param fieldName Field name.
+ * @param first Iterator pointing to the beginning of the interval.
+ * @param last Iterator pointing to the end of the interval.
+ */
+ template<typename InputIterator>
+ void WriteCollection(const char* fieldName, InputIterator first, InputIterator last)
+ {
+ WriteCollection(fieldName, first, last, IGNITE_COLLECTION_UNDEFINED);
+ }
+
+ /**
+ * Write values in interval [first, last).
+ *
+ * @param fieldName Field name.
+ * @param first Iterator pointing to the beginning of the interval.
+ * @param last Iterator pointing to the end of the interval.
+ * @param typ Collection type.
+ */
+ template<typename InputIterator>
+ void WriteCollection(const char* fieldName, InputIterator first, InputIterator last, CollectionType typ)
+ {
+ impl->WriteCollection(fieldName, first, last, typ);
+ }
+
+ /**
+ * Start map write.
+ *
+ * @param fieldName Field name.
+ * @param typ Map type.
+ * @return Map writer.
+ */
+ template<typename K, typename V>
+ BinaryMapWriter<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>
+ BinaryMapWriter<K, V> WriteMap(const char* fieldName, ignite::binary::MapType typ)
+ {
+ int32_t id = impl->WriteMap(fieldName, typ);
+
+ return BinaryMapWriter<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.
+ */
+ BinaryRawWriter RawWriter();
+ private:
+ /** Implementation delegate. */
+ ignite::impl::binary::BinaryWriterImpl* impl;
+ };
+ }
+}
+
+#endif
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/303d79eb/modules/platforms/cpp/core/include/ignite/cache/query/query_argument.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core/include/ignite/cache/query/query_argument.h b/modules/platforms/cpp/core/include/ignite/cache/query/query_argument.h
index 151a821..37871c9 100644
--- a/modules/platforms/cpp/core/include/ignite/cache/query/query_argument.h
+++ b/modules/platforms/cpp/core/include/ignite/cache/query/query_argument.h
@@ -18,7 +18,7 @@
#ifndef _IGNITE_CACHE_QUERY_ARGUMENT
#define _IGNITE_CACHE_QUERY_ARGUMENT
-#include "ignite/portable/portable_raw_writer.h"
+#include "ignite/binary/binary_raw_writer.h"
namespace ignite
{
@@ -50,7 +50,7 @@ namespace ignite
/**
* Write argument.
*/
- virtual void Write(ignite::portable::PortableRawWriter& writer) = 0;
+ virtual void Write(ignite::binary::BinaryRawWriter& writer) = 0;
};
/**
@@ -109,7 +109,7 @@ namespace ignite
return new QueryArgument(val);
}
- virtual void Write(ignite::portable::PortableRawWriter& writer)
+ virtual void Write(ignite::binary::BinaryRawWriter& writer)
{
writer.WriteObject<T>(val);
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/303d79eb/modules/platforms/cpp/core/include/ignite/cache/query/query_scan.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core/include/ignite/cache/query/query_scan.h b/modules/platforms/cpp/core/include/ignite/cache/query/query_scan.h
index 453831d..c8389b2 100644
--- a/modules/platforms/cpp/core/include/ignite/cache/query/query_scan.h
+++ b/modules/platforms/cpp/core/include/ignite/cache/query/query_scan.h
@@ -21,7 +21,7 @@
#include <stdint.h>
#include <string>
-#include "ignite/portable/portable_raw_writer.h"
+#include "ignite/binary/binary_raw_writer.h"
namespace ignite
{
@@ -118,7 +118,7 @@ namespace ignite
*
* @param writer Writer.
*/
- void Write(portable::PortableRawWriter& writer) const
+ void Write(binary::BinaryRawWriter& writer) const
{
writer.WriteBool(loc);
writer.WriteInt32(pageSize);
http://git-wip-us.apache.org/repos/asf/ignite/blob/303d79eb/modules/platforms/cpp/core/include/ignite/cache/query/query_sql.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core/include/ignite/cache/query/query_sql.h b/modules/platforms/cpp/core/include/ignite/cache/query/query_sql.h
index d623536..8feb785 100644
--- a/modules/platforms/cpp/core/include/ignite/cache/query/query_sql.h
+++ b/modules/platforms/cpp/core/include/ignite/cache/query/query_sql.h
@@ -23,7 +23,7 @@
#include <vector>
#include "ignite/cache/query/query_argument.h"
-#include "ignite/portable/portable_raw_writer.h"
+#include "ignite/binary/binary_raw_writer.h"
namespace ignite
{
@@ -207,7 +207,7 @@ namespace ignite
*
* @param writer Writer.
*/
- void Write(portable::PortableRawWriter& writer) const
+ void Write(binary::BinaryRawWriter& writer) const
{
writer.WriteBool(loc);
writer.WriteString(sql);
http://git-wip-us.apache.org/repos/asf/ignite/blob/303d79eb/modules/platforms/cpp/core/include/ignite/cache/query/query_sql_fields.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core/include/ignite/cache/query/query_sql_fields.h b/modules/platforms/cpp/core/include/ignite/cache/query/query_sql_fields.h
index 945bf71..e720cdf 100644
--- a/modules/platforms/cpp/core/include/ignite/cache/query/query_sql_fields.h
+++ b/modules/platforms/cpp/core/include/ignite/cache/query/query_sql_fields.h
@@ -23,7 +23,7 @@
#include <vector>
#include "ignite/cache/query/query_argument.h"
-#include "ignite/portable/portable_raw_writer.h"
+#include "ignite/binary/binary_raw_writer.h"
namespace ignite
{
@@ -178,7 +178,7 @@ namespace ignite
*
* @param writer Writer.
*/
- void Write(portable::PortableRawWriter& writer) const
+ void Write(binary::BinaryRawWriter& writer) const
{
writer.WriteBool(loc);
writer.WriteString(sql);
http://git-wip-us.apache.org/repos/asf/ignite/blob/303d79eb/modules/platforms/cpp/core/include/ignite/cache/query/query_text.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core/include/ignite/cache/query/query_text.h b/modules/platforms/cpp/core/include/ignite/cache/query/query_text.h
index 9efa1bb..f4e7f99 100644
--- a/modules/platforms/cpp/core/include/ignite/cache/query/query_text.h
+++ b/modules/platforms/cpp/core/include/ignite/cache/query/query_text.h
@@ -21,7 +21,7 @@
#include <stdint.h>
#include <string>
-#include "ignite/portable/portable_raw_writer.h"
+#include "ignite/binary/binary_raw_writer.h"
namespace ignite
{
@@ -132,7 +132,7 @@ namespace ignite
*
* @param writer Writer.
*/
- void Write(portable::PortableRawWriter& writer) const
+ void Write(binary::BinaryRawWriter& writer) const
{
writer.WriteBool(loc);
writer.WriteString(text);
http://git-wip-us.apache.org/repos/asf/ignite/blob/303d79eb/modules/platforms/cpp/core/include/ignite/ignite_error.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core/include/ignite/ignite_error.h b/modules/platforms/cpp/core/include/ignite/ignite_error.h
index 1e5cfa5..b1fc772 100644
--- a/modules/platforms/cpp/core/include/ignite/ignite_error.h
+++ b/modules/platforms/cpp/core/include/ignite/ignite_error.h
@@ -100,8 +100,8 @@ namespace ignite
/** Memory operation error. */
static const int IGNITE_ERR_MEMORY = 1001;
- /** Portable error. */
- static const int IGNITE_ERR_PORTABLE = 1002;
+ /** Binary error. */
+ static const int IGNITE_ERR_BINARY = 1002;
/** Generic Ignite error. */
static const int IGNITE_ERR_GENERIC = 2000;
http://git-wip-us.apache.org/repos/asf/ignite/blob/303d79eb/modules/platforms/cpp/core/include/ignite/impl/binary/binary_common.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core/include/ignite/impl/binary/binary_common.h b/modules/platforms/cpp/core/include/ignite/impl/binary/binary_common.h
new file mode 100644
index 0000000..d487941
--- /dev/null
+++ b/modules/platforms/cpp/core/include/ignite/impl/binary/binary_common.h
@@ -0,0 +1,182 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _IGNITE_IMPL_BINARY_COMMON
+#define _IGNITE_IMPL_BINARY_COMMON
+
+#include <stdint.h>
+
+namespace ignite
+{
+ namespace impl
+ {
+ namespace binary
+ {
+ /** 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;
+
+ /** Binary protocol version. */
+ const int8_t IGNITE_PROTO_VER = 1;
+
+ /** Protocol version position. */
+ const int32_t PROTO_VER_POS = 1;
+
+ /** Header offset: Flags. */
+ const int32_t IGNITE_OFFSET_FLAGS = 2;
+
+ /** Header offset: Type ID. */
+ const int32_t IGNITE_OFFSET_TYPE_ID = 4;
+
+ /** Header offset: Hash Code. */
+ const int32_t IGNITE_OFFSET_HASH_CODE = 8;
+
+ /** Header offset: Object Length. */
+ const int32_t IGNITE_OFFSET_LEN = 12;
+
+ /** Header offset: Schema ID. */
+ const int32_t IGNITE_OFFSET_SCHEMA_ID = 16;
+
+ /** Header offset: Schema or Raw Offset. */
+ const int32_t IGNITE_OFFSET_SCHEMA_OR_RAW_OFF = 20;
+
+ /** Full header length. */
+ const int32_t IGNITE_DFLT_HDR_LEN = 24;
+
+ /** 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: binary object. */
+ const int8_t IGNITE_TYPE_BINARY = 27;
+
+ /** Read/write single object. */
+ const int32_t IGNITE_BINARY_MODE_SINGLE = 0;
+
+ /** Read/write array. */
+ const int32_t IGNITE_BINARY_MODE_ARRAY = 1;
+
+ /** Read/write collection. */
+ const int32_t IGNITE_BINARY_MODE_COL = 2;
+
+ /** Read/write map. */
+ const int32_t IGNITE_BINARY_MODE_MAP = 3;
+
+ /** User object flag. */
+ const int16_t IGNITE_BINARY_FLAG_USER_OBJECT = 0x0001;
+
+ /** Raw only flag. */
+ const int16_t IGNITE_BINARY_FLAG_RAW_ONLY = 0x0002;
+
+ /** Flag indicating that schema field offset is one byte long. */
+ const int16_t IGNITE_BINARY_FLAG_OFFSET_1_BYTE = 0x0004;
+
+ /** Flag indicating that schema field offset is two byte long. */
+ const int16_t IGNITE_BINARY_FLAG_OFFSET_2_BYTE = 0x0008;
+ }
+ }
+}
+
+#endif
\ No newline at end of file