Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 83A502007D1 for ; Thu, 12 May 2016 08:42:01 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 82496160A27; Thu, 12 May 2016 06:42:01 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 2678E160A2A for ; Thu, 12 May 2016 08:41:58 +0200 (CEST) Received: (qmail 75484 invoked by uid 500); 12 May 2016 06:41:58 -0000 Mailing-List: contact commits-help@ignite.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.apache.org Delivered-To: mailing list commits@ignite.apache.org Received: (qmail 74389 invoked by uid 99); 12 May 2016 06:41:56 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 12 May 2016 06:41:56 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 23EC3E0007; Thu, 12 May 2016 06:41:56 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: akuznetsov@apache.org To: commits@ignite.apache.org Date: Thu, 12 May 2016 06:42:14 -0000 Message-Id: <72e5978fcc924f6fad87b2227ae6eb75@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [20/60] [abbrv] ignite git commit: IGNITE-1786: Implemented ODBC driver. archived-at: Thu, 12 May 2016 06:42:01 -0000 http://git-wip-us.apache.org/repos/asf/ignite/blob/764c97b9/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 deleted file mode 100644 index d986225..0000000 --- a/modules/platforms/cpp/core/include/ignite/binary/binary_raw_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. - */ - -/** - * @file - * Declares ignite::binary::BinaryRawReader class. - */ - -#ifndef _IGNITE_BINARY_RAW_READER -#define _IGNITE_BINARY_RAW_READER - -#include -#include - -#include - -#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 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 - BinaryArrayReader ReadArray() - { - int32_t size; - - int32_t id = impl->ReadArray(&size); - - return BinaryArrayReader(impl, id, size); - } - - /** - * Start collection read. - * - * @return Collection reader. - */ - template - BinaryCollectionReader ReadCollection() - { - CollectionType typ; - int32_t size; - - int32_t id = impl->ReadCollection(&typ, &size); - - return BinaryCollectionReader(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 - int32_t ReadCollection(OutputIterator out) - { - return impl->ReadCollection(out); - } - - /** - * Start map read. - * - * @return Map reader. - */ - template - BinaryMapReader ReadMap() - { - MapType typ; - int32_t size; - - int32_t id = impl->ReadMap(&typ, &size); - - return BinaryMapReader(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 - T ReadObject() - { - return impl->ReadObject(); - } - 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/764c97b9/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 deleted file mode 100644 index 9bbf4ed..0000000 --- a/modules/platforms/cpp/core/include/ignite/binary/binary_raw_writer.h +++ /dev/null @@ -1,331 +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. - */ - -/** - * @file - * Declares ignite::binary::BinaryRawWriter class. - */ - -#ifndef _IGNITE_BINARY_RAW_WRITER -#define _IGNITE_BINARY_RAW_WRITER - -#include - -#include - -#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 - BinaryArrayWriter WriteArray() - { - int32_t id = impl->WriteArray(); - - return BinaryArrayWriter(impl, id); - } - - /** - * Start collection write. - * - * @return Collection writer. - */ - template - BinaryCollectionWriter WriteCollection() - { - return WriteCollection(IGNITE_COLLECTION_UNDEFINED); - } - - /** - * Start collection write. - * - * @param type Collection type. - * @return Collection writer. - */ - template - BinaryCollectionWriter WriteCollection(CollectionType typ) - { - int32_t id = impl->WriteCollection(typ); - - return BinaryCollectionWriter(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 - 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 - void WriteCollection(InputIterator first, InputIterator last, CollectionType typ) - { - impl->WriteCollection(first, last, typ); - } - - /** - * Start map write. - * - * @param typ Map type. - * @return Map writer. - */ - template - BinaryMapWriter WriteMap() - { - return WriteMap(IGNITE_MAP_UNDEFINED); - } - - /** - * Start map write. - * - * @param typ Map type. - * @return Map writer. - */ - template - BinaryMapWriter WriteMap(MapType typ) - { - int32_t id = impl->WriteMap(typ); - - return BinaryMapWriter(impl, id); - } - - /** - * Write object. - * - * @param val Object. - */ - template - void WriteObject(T val) - { - impl->WriteObject(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/764c97b9/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 deleted file mode 100644 index e991d4e..0000000 --- a/modules/platforms/cpp/core/include/ignite/binary/binary_reader.h +++ /dev/null @@ -1,389 +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. - */ - -/** - * @file - * Declares ignite::binary::BinaryReader class. - */ - -#ifndef _IGNITE_BINARY_READER -#define _IGNITE_BINARY_READER - -#include -#include - -#include - -#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 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 - BinaryArrayReader ReadArray(const char* fieldName) - { - int32_t size; - - int32_t id = impl->ReadArray(fieldName, &size); - - return BinaryArrayReader(impl, id, size); - } - - /** - * Start collection read. - * - * @param fieldName Field name. - * @return Collection reader. - */ - template - BinaryCollectionReader ReadCollection(const char* fieldName) - { - CollectionType typ; - int32_t size; - - int32_t id = impl->ReadCollection(fieldName, &typ, &size); - - return BinaryCollectionReader(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 - int32_t ReadCollection(const char* fieldName, OutputIterator out) - { - return impl->ReadCollection(fieldName, out); - } - - /** - * Start map read. - * - * @param fieldName Field name. - * @return Map reader. - */ - template - BinaryMapReader ReadMap(const char* fieldName) - { - MapType typ; - int32_t size; - - int32_t id = impl->ReadMap(fieldName, &typ, &size); - - return BinaryMapReader(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 - T ReadObject(const char* fieldName) - { - return impl->ReadObject(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/764c97b9/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 deleted file mode 100644 index 636171e..0000000 --- a/modules/platforms/cpp/core/include/ignite/binary/binary_type.h +++ /dev/null @@ -1,310 +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. - */ - -/** - * @file - * Declares ignite::binary::BinaryType class template and helping macros - * to declare binary type specialisation for user types. - */ - -#ifndef _IGNITE_BINARY_TYPE -#define _IGNITE_BINARY_TYPE - -#include - -#include - -#include "ignite/ignite_error.h" - -/** - * @def IGNITE_BINARY_TYPE_START(T) - * Start binary type definition. - */ -#define IGNITE_BINARY_TYPE_START(T) \ -template<> \ -struct BinaryType \ -{ - -/** - * @def IGNITE_BINARY_TYPE_END - * End binary type definition. - */ -#define IGNITE_BINARY_TYPE_END \ -}; - -/** - * @def IGNITE_BINARY_GET_TYPE_ID_AS_CONST(id) - * Implementation of GetTypeId() which returns predefined constant. - */ -#define IGNITE_BINARY_GET_TYPE_ID_AS_CONST(id) \ -int32_t GetTypeId() \ -{ \ - return id; \ -} - -/** - * @def IGNITE_BINARY_GET_TYPE_ID_AS_HASH(typeName) - * 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); \ -} - -/** - * @def IGNITE_BINARY_GET_TYPE_NAME_AS_IS(typeName) - * Implementation of GetTypeName() which returns type name as is. - */ -#define IGNITE_BINARY_GET_TYPE_NAME_AS_IS(typeName) \ -std::string GetTypeName() \ -{ \ - return #typeName; \ -} - -/** - * @def IGNITE_BINARY_GET_FIELD_ID_AS_HASH - * 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); \ -} - -/** - * @def IGNITE_BINARY_GET_HASH_CODE_ZERO(T) - * Implementation of GetHashCode() function which always returns 0. - */ -#define IGNITE_BINARY_GET_HASH_CODE_ZERO(T) \ -int32_t GetHashCode(const T& obj) \ -{ \ - return 0; \ -} - -/** - * @def IGNITE_BINARY_IS_NULL_FALSE(T) - * Implementation of IsNull() function which always returns false. - */ -#define IGNITE_BINARY_IS_NULL_FALSE(T) \ -bool IsNull(const T& obj) \ -{ \ - return false; \ -} - -/** - * @def IGNITE_BINARY_IS_NULL_IF_NULLPTR(T) - * 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; \ -} - -/** - * @def IGNITE_BINARY_GET_NULL_DEFAULT_CTOR(T) - * Implementation of GetNull() function which returns an instance created with defult constructor. - */ -#define IGNITE_BINARY_GET_NULL_DEFAULT_CTOR(T) \ -T GetNull() \ -{ \ - return T(); \ -} - -/** - * @def IGNITE_BINARY_GET_NULL_NULLPTR(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 - 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 specification for pointers. - */ - template - struct IGNITE_IMPORT_EXPORT BinaryType - { - /** Actual type. */ - BinaryType typ; - - /** - * Constructor. - */ - BinaryType() - { - typ = BinaryType(); - } - - 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/764c97b9/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 deleted file mode 100644 index 475f454..0000000 --- a/modules/platforms/cpp/core/include/ignite/binary/binary_writer.h +++ /dev/null @@ -1,367 +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. - */ - -/** - * @file - * Declares ignite::binary::BinaryWriter class. - */ - -#ifndef _IGNITE_BINARY_WRITER -#define _IGNITE_BINARY_WRITER - -#include -#include - -#include - -#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 - BinaryArrayWriter WriteArray(const char* fieldName) - { - int32_t id = impl->WriteArray(fieldName); - - return BinaryArrayWriter(impl, id); - } - - /** - * Start collection write. - * - * @param fieldName Field name. - * @return Collection writer. - */ - template - BinaryCollectionWriter WriteCollection(const char* fieldName) - { - return WriteCollection(fieldName, IGNITE_COLLECTION_UNDEFINED); - } - - /** - * Start collection write. - * - * @param fieldName Field name. - * @param type Collection type. - * @return Collection writer. - */ - template - BinaryCollectionWriter WriteCollection(const char* fieldName, ignite::binary::CollectionType typ) - { - int32_t id = impl->WriteCollection(fieldName, typ); - - return BinaryCollectionWriter(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 - 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 - 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 - BinaryMapWriter WriteMap(const char* fieldName) - { - return WriteMap(fieldName, IGNITE_MAP_UNDEFINED); - } - - /** - * Start map write. - * - * @param fieldName Field name. - * @param typ Map type. - * @return Map writer. - */ - template - BinaryMapWriter WriteMap(const char* fieldName, ignite::binary::MapType typ) - { - int32_t id = impl->WriteMap(fieldName, typ); - - return BinaryMapWriter(impl, id); - } - - /** - * Write object. - * - * @param fieldName Field name. - * @param val Value. - */ - template - void WriteObject(const char* fieldName, T val) - { - impl->WriteObject(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/764c97b9/modules/platforms/cpp/core/include/ignite/cache/cache.h ---------------------------------------------------------------------- diff --git a/modules/platforms/cpp/core/include/ignite/cache/cache.h b/modules/platforms/cpp/core/include/ignite/cache/cache.h index 6727293..a3a2197 100644 --- a/modules/platforms/cpp/core/include/ignite/cache/cache.h +++ b/modules/platforms/cpp/core/include/ignite/cache/cache.h @@ -20,14 +20,15 @@ * Declares ignite::cache::Cache class. */ -#ifndef _IGNITE_CACHE -#define _IGNITE_CACHE +#ifndef _IGNITE_CACHE_CACHE +#define _IGNITE_CACHE_CACHE #include #include #include #include +#include #include "ignite/cache/cache_peek_mode.h" #include "ignite/cache/query/query_cursor.h" @@ -38,7 +39,6 @@ #include "ignite/cache/query/query_sql_fields.h" #include "ignite/impl/cache/cache_impl.h" #include "ignite/impl/operations.h" -#include "ignite/ignite_error.h" namespace ignite { @@ -1198,4 +1198,4 @@ namespace ignite } } -#endif +#endif //_IGNITE_CACHE_CACHE http://git-wip-us.apache.org/repos/asf/ignite/blob/764c97b9/modules/platforms/cpp/core/include/ignite/cache/cache_entry.h ---------------------------------------------------------------------- diff --git a/modules/platforms/cpp/core/include/ignite/cache/cache_entry.h b/modules/platforms/cpp/core/include/ignite/cache/cache_entry.h index 9ca3946..ca8576e 100644 --- a/modules/platforms/cpp/core/include/ignite/cache/cache_entry.h +++ b/modules/platforms/cpp/core/include/ignite/cache/cache_entry.h @@ -20,8 +20,8 @@ * Declares ignite::cache::CacheEntry class. */ -#ifndef _IGNITE_CACHE_ENTRY -#define _IGNITE_CACHE_ENTRY +#ifndef _IGNITE_CACHE_CACHE_ENTRY +#define _IGNITE_CACHE_CACHE_ENTRY #include @@ -120,4 +120,4 @@ namespace ignite } } -#endif +#endif _IGNITE_CACHE_CACHE_ENTRY http://git-wip-us.apache.org/repos/asf/ignite/blob/764c97b9/modules/platforms/cpp/core/include/ignite/cache/cache_peek_mode.h ---------------------------------------------------------------------- diff --git a/modules/platforms/cpp/core/include/ignite/cache/cache_peek_mode.h b/modules/platforms/cpp/core/include/ignite/cache/cache_peek_mode.h index 192013d..ef9d031 100644 --- a/modules/platforms/cpp/core/include/ignite/cache/cache_peek_mode.h +++ b/modules/platforms/cpp/core/include/ignite/cache/cache_peek_mode.h @@ -20,8 +20,8 @@ * Declares ignite::cache::CachePeekMode enum. */ -#ifndef _IGNITE_CACHE_PEEK_MODE -#define _IGNITE_CACHE_PEEK_MODE +#ifndef _IGNITE_CACHE_CACHE_PEEK_MODE +#define _IGNITE_CACHE_CACHE_PEEK_MODE namespace ignite { @@ -73,4 +73,4 @@ namespace ignite } } -#endif \ No newline at end of file +#endif //_IGNITE_CACHE_CACHE_PEEK_MODE \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/764c97b9/modules/platforms/cpp/core/include/ignite/cache/query/query.h ---------------------------------------------------------------------- diff --git a/modules/platforms/cpp/core/include/ignite/cache/query/query.h b/modules/platforms/cpp/core/include/ignite/cache/query/query.h index de7578e..b2991e4 100644 --- a/modules/platforms/cpp/core/include/ignite/cache/query/query.h +++ b/modules/platforms/cpp/core/include/ignite/cache/query/query.h @@ -20,8 +20,8 @@ * Includes all query API headers. */ -#ifndef _IGNITE_QUERY -#define _IGNITE_QUERY +#ifndef _IGNITE_CACHE_QUERY_QUERY +#define _IGNITE_CACHE_QUERY_QUERY #include "ignite/cache/query/query_argument.h" #include "ignite/cache/query/query_cursor.h" @@ -30,4 +30,4 @@ #include "ignite/cache/query/query_sql_fields.h" #include "ignite/cache/query/query_text.h" -#endif \ No newline at end of file +#endif //_IGNITE_CACHE_QUERY_QUERY \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/764c97b9/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 5cd22a6..933bd60 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 @@ -21,8 +21,8 @@ * ignite::cache::query::QueryArgumentBase interface. */ -#ifndef _IGNITE_CACHE_QUERY_ARGUMENT -#define _IGNITE_CACHE_QUERY_ARGUMENT +#ifndef _IGNITE_CACHE_QUERY_QUERY_ARGUMENT +#define _IGNITE_CACHE_QUERY_QUERY_ARGUMENT #include "ignite/binary/binary_raw_writer.h" @@ -128,4 +128,4 @@ namespace ignite } } -#endif \ No newline at end of file +#endif //_IGNITE_CACHE_QUERY_QUERY_ARGUMENT \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/764c97b9/modules/platforms/cpp/core/include/ignite/cache/query/query_cursor.h ---------------------------------------------------------------------- diff --git a/modules/platforms/cpp/core/include/ignite/cache/query/query_cursor.h b/modules/platforms/cpp/core/include/ignite/cache/query/query_cursor.h index 6f507d2..ea8fd3f 100644 --- a/modules/platforms/cpp/core/include/ignite/cache/query/query_cursor.h +++ b/modules/platforms/cpp/core/include/ignite/cache/query/query_cursor.h @@ -20,15 +20,15 @@ * Declares ignite::cache::query::QueryCursor class template. */ -#ifndef _IGNITE_CACHE_QUERY_CURSOR -#define _IGNITE_CACHE_QUERY_CURSOR +#ifndef _IGNITE_CACHE_QUERY_QUERY_CURSOR +#define _IGNITE_CACHE_QUERY_QUERY_CURSOR #include #include +#include #include "ignite/cache/cache_entry.h" -#include "ignite/ignite_error.h" #include "ignite/impl/cache/query/query_impl.h" #include "ignite/impl/operations.h" @@ -202,4 +202,4 @@ namespace ignite } } -#endif \ No newline at end of file +#endif //_IGNITE_CACHE_QUERY_QUERY_CURSOR \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/764c97b9/modules/platforms/cpp/core/include/ignite/cache/query/query_fields_cursor.h ---------------------------------------------------------------------- diff --git a/modules/platforms/cpp/core/include/ignite/cache/query/query_fields_cursor.h b/modules/platforms/cpp/core/include/ignite/cache/query/query_fields_cursor.h index b74ae5a..1e70f97 100644 --- a/modules/platforms/cpp/core/include/ignite/cache/query/query_fields_cursor.h +++ b/modules/platforms/cpp/core/include/ignite/cache/query/query_fields_cursor.h @@ -20,15 +20,15 @@ * Declares ignite::cache::query::QueryFieldsCursor class. */ -#ifndef _IGNITE_CACHE_QUERY_FIELDS_CURSOR -#define _IGNITE_CACHE_QUERY_FIELDS_CURSOR +#ifndef _IGNITE_CACHE_QUERY_QUERY_FIELDS_CURSOR +#define _IGNITE_CACHE_QUERY_QUERY_FIELDS_CURSOR #include #include +#include #include "ignite/cache/cache_entry.h" -#include "ignite/ignite_error.h" #include "ignite/cache/query/query_fields_row.h" #include "ignite/impl/cache/query/query_impl.h" #include "ignite/impl/operations.h" @@ -155,4 +155,4 @@ namespace ignite } } -#endif \ No newline at end of file +#endif //_IGNITE_CACHE_QUERY_QUERY_FIELDS_CURSOR \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/764c97b9/modules/platforms/cpp/core/include/ignite/cache/query/query_fields_row.h ---------------------------------------------------------------------- diff --git a/modules/platforms/cpp/core/include/ignite/cache/query/query_fields_row.h b/modules/platforms/cpp/core/include/ignite/cache/query/query_fields_row.h index 4f3be4c..48a015a 100644 --- a/modules/platforms/cpp/core/include/ignite/cache/query/query_fields_row.h +++ b/modules/platforms/cpp/core/include/ignite/cache/query/query_fields_row.h @@ -20,15 +20,15 @@ * Declares ignite::cache::query::QueryFieldsRow class. */ -#ifndef _IGNITE_CACHE_QUERY_FIELDS_ROW -#define _IGNITE_CACHE_QUERY_FIELDS_ROW +#ifndef _IGNITE_CACHE_QUERY_QUERY_FIELDS_ROW +#define _IGNITE_CACHE_QUERY_QUERY_FIELDS_ROW #include #include +#include #include "ignite/cache/cache_entry.h" -#include "ignite/ignite_error.h" #include "ignite/impl/cache/query/query_fields_row_impl.h" #include "ignite/impl/operations.h" @@ -156,4 +156,4 @@ namespace ignite } } -#endif \ No newline at end of file +#endif //_IGNITE_CACHE_QUERY_QUERY_FIELDS_ROW \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/764c97b9/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 7bd6bbb..619e280 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 @@ -20,8 +20,8 @@ * Declares ignite::cache::query::ScanQuery class. */ -#ifndef _IGNITE_CACHE_QUERY_SCAN -#define _IGNITE_CACHE_QUERY_SCAN +#ifndef _IGNITE_CACHE_QUERY_QUERY_SCAN +#define _IGNITE_CACHE_QUERY_QUERY_SCAN #include #include @@ -153,4 +153,4 @@ namespace ignite } } -#endif \ No newline at end of file +#endif //_IGNITE_CACHE_QUERY_QUERY_SCAN \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/764c97b9/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 186e6e3..f4ddb7d 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 @@ -20,8 +20,8 @@ * Declares ignite::cache::query::SqlQuery class. */ -#ifndef _IGNITE_CACHE_QUERY_SQL -#define _IGNITE_CACHE_QUERY_SQL +#ifndef _IGNITE_CACHE_QUERY_QUERY_SQL +#define _IGNITE_CACHE_QUERY_QUERY_SQL #include #include @@ -245,4 +245,4 @@ namespace ignite } } -#endif \ No newline at end of file +#endif //_IGNITE_CACHE_QUERY_QUERY_SQL \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/764c97b9/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 7076595..4792d34 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 @@ -20,8 +20,8 @@ * Declares ignite::cache::query::SqlFieldsQuery class. */ -#ifndef _IGNITE_CACHE_QUERY_SQL_FIELDS -#define _IGNITE_CACHE_QUERY_SQL_FIELDS +#ifndef _IGNITE_CACHE_QUERY_QUERY_SQL_FIELDS +#define _IGNITE_CACHE_QUERY_QUERY_SQL_FIELDS #include #include @@ -212,4 +212,4 @@ namespace ignite } } -#endif \ No newline at end of file +#endif //_IGNITE_CACHE_QUERY_QUERY_SQL_FIELDS \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/764c97b9/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 b68f65e..4f1c436 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 @@ -20,8 +20,8 @@ * Declares ignite::cache::query::TextQuery class. */ -#ifndef _IGNITE_CACHE_QUERY_TEXT -#define _IGNITE_CACHE_QUERY_TEXT +#ifndef _IGNITE_CACHE_QUERY_QUERY_TEXT +#define _IGNITE_CACHE_QUERY_QUERY_TEXT #include #include @@ -162,4 +162,4 @@ namespace ignite } } -#endif \ No newline at end of file +#endif //_IGNITE_CACHE_QUERY_QUERY_TEXT \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/764c97b9/modules/platforms/cpp/core/include/ignite/guid.h ---------------------------------------------------------------------- diff --git a/modules/platforms/cpp/core/include/ignite/guid.h b/modules/platforms/cpp/core/include/ignite/guid.h deleted file mode 100644 index a9999e7..0000000 --- a/modules/platforms/cpp/core/include/ignite/guid.h +++ /dev/null @@ -1,117 +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. - */ - -/** - * @file - * Declares ignite::Guid class. - */ - -#ifndef _IGNITE_GUID -#define _IGNITE_GUID - -#include - -#include - -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/764c97b9/modules/platforms/cpp/core/include/ignite/ignite.h ---------------------------------------------------------------------- diff --git a/modules/platforms/cpp/core/include/ignite/ignite.h b/modules/platforms/cpp/core/include/ignite/ignite.h index 25b9f0c..aec9801 100644 --- a/modules/platforms/cpp/core/include/ignite/ignite.h +++ b/modules/platforms/cpp/core/include/ignite/ignite.h @@ -20,8 +20,8 @@ * Declares ignite::Ignite class. */ -#ifndef _IGNITE -#define _IGNITE +#ifndef _IGNITE_IGNITE +#define _IGNITE_IGNITE #include "ignite/cache/cache.h" #include "ignite/impl/ignite_impl.h" @@ -168,4 +168,4 @@ namespace ignite }; } -#endif +#endif //_IGNITE_IGNITE http://git-wip-us.apache.org/repos/asf/ignite/blob/764c97b9/modules/platforms/cpp/core/include/ignite/ignite_configuration.h ---------------------------------------------------------------------- diff --git a/modules/platforms/cpp/core/include/ignite/ignite_configuration.h b/modules/platforms/cpp/core/include/ignite/ignite_configuration.h index e46e2bd..ee59c11 100644 --- a/modules/platforms/cpp/core/include/ignite/ignite_configuration.h +++ b/modules/platforms/cpp/core/include/ignite/ignite_configuration.h @@ -20,14 +20,14 @@ * Declares ignite::IgniteConfiguration class. */ -#ifndef _IGNITE_CONFIGURATION -#define _IGNITE_CONFIGURATION +#ifndef _IGNITE_IGNITE_CONFIGURATION +#define _IGNITE_IGNITE_CONFIGURATION #include #include #include -#include "ignite/impl/utils.h" +#include namespace ignite { @@ -68,4 +68,4 @@ namespace ignite }; } -#endif \ No newline at end of file +#endif //_IGNITE_IGNITE_CONFIGURATION \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/764c97b9/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 deleted file mode 100644 index 4a0e281..0000000 --- a/modules/platforms/cpp/core/include/ignite/ignite_error.h +++ /dev/null @@ -1,275 +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. - */ - -/** - * @file - * Declares ignite::IgniteError class. - */ - -#ifndef _IGNITE_ERROR -#define _IGNITE_ERROR - -#include - -#include -#include - -#include - -#define IGNITE_ERROR_1(code, part1) { \ - std::stringstream stream; \ - stream << (part1); \ - throw ignite::IgniteError(code, stream.str().c_str()); \ -} - -#define IGNITE_ERROR_2(code, part1, part2) { \ - std::stringstream stream; \ - stream << (part1) << (part2); \ - throw ignite::IgniteError(code, stream.str().c_str()); \ -} - -#define IGNITE_ERROR_3(code, part1, part2, part3) { \ - std::stringstream stream; \ - stream << (part1) << (part2) << (part3); \ - throw ignite::IgniteError(code, stream.str().c_str()); \ -} - -#define IGNITE_ERROR_FORMATTED_1(code, msg, key1, val1) { \ - std::stringstream stream; \ - stream << msg << " [" << key1 << "=" << (val1) << "]"; \ - throw ignite::IgniteError(code, stream.str().c_str()); \ -} - -#define IGNITE_ERROR_FORMATTED_2(code, msg, key1, val1, key2, val2) { \ - std::stringstream stream; \ - stream << msg << " [" << key1 << "=" << (val1) << ", " << key2 << "=" << (val2) << "]"; \ - throw ignite::IgniteError(code, stream.str().c_str()); \ -} - -#define IGNITE_ERROR_FORMATTED_3(code, msg, key1, val1, key2, val2, key3, val3) { \ - std::stringstream stream; \ - stream << msg << " [" << key1 << "=" << (val1) << ", " << key2 << "=" << (val2) << ", " << key3 << "=" << (val3) << "]"; \ - throw ignite::IgniteError(code, stream.str().c_str()); \ -} - -#define IGNITE_ERROR_FORMATTED_4(code, msg, key1, val1, key2, val2, key3, val3, key4, val4) { \ - std::stringstream stream; \ - stream << msg << " [" << key1 << "=" << (val1) << ", " << key2 << "=" << (val2) << ", " << key3 << "=" << (val3) << ", " << key4 << "=" << (val4) << "]"; \ - throw ignite::IgniteError(code, stream.str().c_str()); \ -} - -namespace ignite -{ - /** - * Ignite error information. - */ - class IGNITE_IMPORT_EXPORT IgniteError : public std::exception - { - 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; - - /** Binary error. */ - static const int IGNITE_ERR_BINARY = 1002; - - /** Generic Ignite error. */ - static const int IGNITE_ERR_GENERIC = 2000; - - /** Illegal argument passed. */ - static const int IGNITE_ERR_ILLEGAL_ARGUMENT = 2001; - - /** Illegal state. */ - static const int IGNITE_ERR_ILLEGAL_STATE = 2002; - - /** Unsupported operation. */ - static const int IGNITE_ERR_UNSUPPORTED_OPERATION = 2003; - - /** Thread has been interrup. */ - static const int IGNITE_ERR_INTERRUPTED = 2004; - - /** Cluster group is empty. */ - static const int IGNITE_ERR_CLUSTER_GROUP_EMPTY = 2005; - - /** Cluster topology problem. */ - static const int IGNITE_ERR_CLUSTER_TOPOLOGY = 2006; - - /** Compute execution rejected. */ - static const int IGNITE_ERR_COMPUTE_EXECUTION_REJECTED = 2007; - - /** Compute job failover. */ - static const int IGNITE_ERR_COMPUTE_JOB_FAILOVER = 2008; - - /** Compute task cancelled. */ - static const int IGNITE_ERR_COMPUTE_TASK_CANCELLED = 2009; - - /** Compute task timeout. */ - static const int IGNITE_ERR_COMPUTE_TASK_TIMEOUT = 2010; - - /** Compute user undeclared exception. */ - static const int IGNITE_ERR_COMPUTE_USER_UNDECLARED_EXCEPTION = 2011; - - /** Generic cache error. */ - static const int IGNITE_ERR_CACHE = 2012; - - /** Generic cache loader error. */ - static const int IGNITE_ERR_CACHE_LOADER = 2013; - - /** Generic cache writer error. */ - static const int IGNITE_ERR_CACHE_WRITER = 2014; - - /** Generic cache entry processor error. */ - static const int IGNITE_ERR_ENTRY_PROCESSOR = 2015; - - /** Cache atomic update timeout. */ - static const int IGNITE_ERR_CACHE_ATOMIC_UPDATE_TIMEOUT = 2016; - - /** Cache partial update. */ - static const int IGNITE_ERR_CACHE_PARTIAL_UPDATE = 2017; - - /** Transaction optimisitc exception. */ - static const int IGNITE_ERR_TX_OPTIMISTIC = 2018; - - /** Transaction timeout. */ - static const int IGNITE_ERR_TX_TIMEOUT = 2019; - - /** Transaction rollback. */ - static const int IGNITE_ERR_TX_ROLLBACK = 2020; - - /** Transaction heuristic exception. */ - static const int IGNITE_ERR_TX_HEURISTIC = 2021; - - /** Authentication error. */ - static const int IGNITE_ERR_AUTHENTICATION = 2022; - - /** Security error. */ - static const int IGNITE_ERR_SECURITY = 2023; - - /** Unknown error. */ - static const int IGNITE_ERR_UNKNOWN = -1; - - /** - * Throw an error if code is not IGNITE_SUCCESS. - * - * @param err Error. - */ - static void ThrowIfNeeded(IgniteError& err); - - /** - * Create empty error. - */ - IgniteError(); - - /** - * Create error with specific code. - * - * @param code Error code. - */ - IgniteError(const int32_t code); - - /** - * Create error with specific code and message. - * - * @param code Error code. - * @param msg Message. - */ - IgniteError(const int32_t code, const char* msg); - - /** - * Copy constructor. - * - * @param other Other instance. - */ - IgniteError(const IgniteError& other); - - /** - * Assignment operator. - * - * @param other Other instance. - * @return Assignment result. - */ - IgniteError& operator=(const IgniteError& other); - - /** - * Destructor. - */ - ~IgniteError(); - - /** - * Get error code. - * - * @return Error code. - */ - int32_t GetCode() const; - - /** - * Get error message. - * - * @return Error message. - */ - const char* GetText() const IGNITE_NO_THROW; - - /** - * Implementation of the standard std::exception::what() method. - * Synonym for GetText() method. - * - * @return Error message string. - */ - virtual const char* what() const IGNITE_NO_THROW; - - /** - * Set error. - * - * @param jniCode Error code. - * @param jniCls Error class. - * @param jniMsg Error message. - * @param err Error. - */ - static void SetError(const int jniCode, const char* jniCls, const char* jniMsg, IgniteError* err); - private: - /** Error code. */ - int32_t code; - - /** Error message. */ - char* msg; - }; -} - -#endif \ No newline at end of file