diff --git a/Doxyfile b/Doxyfile index eb61d645..83e647f2 100644 --- a/Doxyfile +++ b/Doxyfile @@ -34,6 +34,7 @@ DOXYFILE_ENCODING = UTF-8 PROJECT_NAME = "Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com # The PROJECT_NUMBER tag can be used to enter a project or revision number. This # could be handy for archiving the generated documentation or if some version diff --git a/algorithm.h b/algorithm.h index 75ef2076..f3afa52b 100644 --- a/algorithm.h +++ b/algorithm.h @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/alignment.h b/alignment.h index cd51528c..69ebbf54 100644 --- a/alignment.h +++ b/alignment.h @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/array.h b/array.h index 006e92ef..ac0a80b6 100644 --- a/array.h +++ b/array.h @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove @@ -55,8 +56,8 @@ namespace etl { public: - array_exception(const char* what) - : exception(what) + array_exception(string_type what, string_type file_name, numeric_type line_number) + : exception(what, file_name, line_number) { } }; @@ -69,8 +70,8 @@ namespace etl { public: - array_out_of_range() - : array_exception("array: out of range") + array_out_of_range(string_type file_name, numeric_type line_number) + : array_exception("array:range", file_name, line_number) { } }; @@ -115,7 +116,7 @@ namespace etl //************************************************************************* reference at(size_t i) { - ETL_ASSERT(i < SIZE, array_out_of_range()); + ETL_ASSERT(i < SIZE, ETL_ERROR(array_out_of_range)); return _buffer[i]; } @@ -126,7 +127,7 @@ namespace etl //************************************************************************* const_reference at(size_t i) const { - ETL_ASSERT(i < SIZE, array_out_of_range()); + ETL_ASSERT(i < SIZE, ETL_ERROR(array_out_of_range)); return _buffer[i]; } diff --git a/basic_intrusive_forward_list.h b/basic_intrusive_forward_list.h index 66bce0a6..ce1342bc 100644 --- a/basic_intrusive_forward_list.h +++ b/basic_intrusive_forward_list.h @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2015 jwellbelove diff --git a/basic_intrusive_forward_list_node.h b/basic_intrusive_forward_list_node.h index 2de530cd..60c1ca7d 100644 --- a/basic_intrusive_forward_list_node.h +++ b/basic_intrusive_forward_list_node.h @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2015 jwellbelove diff --git a/binary.h b/binary.h index 0d718583..682725cf 100644 --- a/binary.h +++ b/binary.h @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2015 jwellbelove diff --git a/bitset.h b/bitset.h index 2f51d8f5..76861847 100644 --- a/bitset.h +++ b/bitset.h @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove @@ -137,7 +138,7 @@ namespace etl //************************************************************************* bitset& set(const char* text) { - if (ETL_ASSERT(text != 0, etl::bitset_nullptr())) + if (ETL_ASSERT(text != 0, ETL_ERROR(bitset_nullptr))) { ibitset::set(text); } diff --git a/bloom_filter.h b/bloom_filter.h index aaa16e68..3407d6e6 100644 --- a/bloom_filter.h +++ b/bloom_filter.h @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/bsd_checksum.h b/bsd_checksum.h index 0dc70bc4..00fb7884 100644 --- a/bsd_checksum.h +++ b/bsd_checksum.h @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/checksum.h b/checksum.h index aba4b181..142a00de 100644 --- a/checksum.h +++ b/checksum.h @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/container.h b/container.h index 1426fff3..d03cddc4 100644 --- a/container.h +++ b/container.h @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/crc16.cpp b/crc16.cpp index 5e07f6b3..f5194058 100644 --- a/crc16.cpp +++ b/crc16.cpp @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/crc16.h b/crc16.h index 22b45f15..7261cf29 100644 --- a/crc16.h +++ b/crc16.h @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/crc16_ccitt.cpp b/crc16_ccitt.cpp index 0d58eb21..6c800d74 100644 --- a/crc16_ccitt.cpp +++ b/crc16_ccitt.cpp @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/crc16_ccitt.h b/crc16_ccitt.h index f7aad60d..ca0769bc 100644 --- a/crc16_ccitt.h +++ b/crc16_ccitt.h @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/crc16_kermit.cpp b/crc16_kermit.cpp index b6a9791a..c7363d14 100644 --- a/crc16_kermit.cpp +++ b/crc16_kermit.cpp @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/crc16_kermit.h b/crc16_kermit.h index a69d4ced..337843c6 100644 --- a/crc16_kermit.h +++ b/crc16_kermit.h @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/crc32.cpp b/crc32.cpp index 302bb82e..9b7c0be6 100644 --- a/crc32.cpp +++ b/crc32.cpp @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/crc32.h b/crc32.h index 4257571c..ecf9a5d7 100644 --- a/crc32.h +++ b/crc32.h @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/crc64_ecma.cpp b/crc64_ecma.cpp index b4146f80..7b41a3d0 100644 --- a/crc64_ecma.cpp +++ b/crc64_ecma.cpp @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/crc64_ecma.h b/crc64_ecma.h index 68d6ee3d..442a57d5 100644 --- a/crc64_ecma.h +++ b/crc64_ecma.h @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/crc8_ccitt.cpp b/crc8_ccitt.cpp index df2947e6..1919d21d 100644 --- a/crc8_ccitt.cpp +++ b/crc8_ccitt.cpp @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/crc8_ccitt.h b/crc8_ccitt.h index 47d2aa96..fb11accf 100644 --- a/crc8_ccitt.h +++ b/crc8_ccitt.h @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/cyclic_value.h b/cyclic_value.h index e5c86255..6ed18c7b 100644 --- a/cyclic_value.h +++ b/cyclic_value.h @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/deque.h b/deque.h index 99f3274b..227e4faa 100644 --- a/deque.h +++ b/deque.h @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/doxygen.h b/doxygen.h index 6e1d744c..4639da8d 100644 --- a/doxygen.h +++ b/doxygen.h @@ -3,6 +3,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove @@ -27,6 +28,7 @@ SOFTWARE. ///\defgroup etl Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com ///\defgroup containers Containers ///\ingroup etl diff --git a/endian.h b/endian.h index edb55b7f..d905d8e1 100644 --- a/endian.h +++ b/endian.h @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/enum_type.h b/enum_type.h index b57ed2a5..bd1a4d7c 100644 --- a/enum_type.h +++ b/enum_type.h @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/error_handler.cpp b/error_handler.cpp index 4cbb2cbc..5a02d220 100644 --- a/error_handler.cpp +++ b/error_handler.cpp @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/error_handler.h b/error_handler.h index 3def7a0f..46045d59 100644 --- a/error_handler.h +++ b/error_handler.h @@ -6,6 +6,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove @@ -53,10 +54,10 @@ namespace etl //************************************************************************* /// Callback class for free handler functions. //************************************************************************* - struct free_function : public function + struct free_function : public function { - free_function(void (*p_function)(const exception&)) - : function(p_function) + free_function(void (*p_function)(const etl::exception&)) + : etl::function(p_function) { } }; @@ -65,46 +66,58 @@ namespace etl /// Callback class for member handler functions. //************************************************************************* template - struct member_function : public function + struct member_function : public etl::function { - member_function(TObject& object, void(TObject::*p_function)(const exception&)) - : function(object, p_function) + member_function(TObject& object, void(TObject::*p_function)(const etl::exception&)) + : etl::function(object, p_function) { } }; - static void set_callback(ifunction& f); - static void error(const exception& e); + static void set_callback(ifunction& f); + static void error(const etl::exception& e); private: - static ifunction* p_ifunction; + static ifunction* p_ifunction; }; - - //*************************************************************************** - /// Asserts a coondition. - /// Versions of the macro that return a constant value of 'true' will allow the compiler to optimise away - /// any 'if' statements that it is contained within. - /// If ETL_NO_CHECKS is defined then no runtime checks are executed at all. - /// If ETL_THROW_EXCEPTIONS is defined then the error is thrown if the assert fails. The return value is always 'true'. - /// If ETL_LOG_ERRORS is defined then the error is logged if the assert fails. The return value is the value of the boolean test. - /// Otherwise 'assert' is called. The return value is always 'true'. - ///\ingroup error_handler - //*************************************************************************** -#if defined(ETL_NO_CHECKS) - #define ETL_ASSERT(b, e) (true) // Does nothing. Evaluates to 'true'. -#elif defined(ETL_THROW_EXCEPTIONS) - #define ETL_ASSERT(b, e) (((b) ? true : throw((e))), true) // Throws an exception if the condition fails. Evaluates to 'true'. -#elif defined (ETL_LOG_ERRORS) - #define ETL_ASSERT(b, e) (((b) ? true : etl::error_handler::error((e))), (b)) // Logs the error if the condition fails. Evaluates to the result of the condition. -#else - #if defined(NDEBUG) - #define ETL_ASSERT(b, e) (true) // Does nothing. Evaluates to 'true'. - #elif - #define ETL_ASSERT(b, e) ((assert((b))), true) // Asserts if the condition fails. Evaluates to 'true'. - #endif -#endif } +//*************************************************************************** +/// Asserts a coondition. +/// Versions of the macro that return a constant value of 'true' will allow the compiler to optimise away +/// any 'if' statements that it is contained within. +/// If ETL_NO_CHECKS is defined then no runtime checks are executed at all. +/// If ETL_THROW_EXCEPTIONS is defined then the error is thrown if the assert fails. The return value is always 'true'. +/// If ETL_LOG_ERRORS is defined then the error is logged if the assert fails. The return value is the value of the boolean test. +/// Otherwise 'assert' is called. The return value is always 'true'. +///\ingroup error_handler +//*************************************************************************** +#if defined(ETL_NO_CHECKS) +#define ETL_ASSERT(b, e) (true) // Does nothing. Evaluates to 'true'. +#elif defined(ETL_THROW_EXCEPTIONS) +#define ETL_ASSERT(b, e) (((b) ? true : throw((e))), true) // Throws an exception if the condition fails. Evaluates to 'true'. +#elif defined(ETL_LOG_ERRORS) +#define ETL_ASSERT(b, e) (((b) ? true : etl::error_handler::error((e))), (b)) // Logs the error if the condition fails. Evaluates to the result of the condition. +#else +#if defined(NDEBUG) +#define ETL_ASSERT(b, e) (true) // Does nothing. Evaluates to 'true'. +#elif +#define ETL_ASSERT(b, e) ((assert((b))), true) // Asserts if the condition fails. Evaluates to 'true'. +#endif +#endif + +#if defined(ETL_VERBOSE_ERRORS) +#define ETL_ERROR(e) (e(__FILE__, __LINE__)) // Make an exception with the file name and line number. +#else +#define ETL_ERROR(e) (e("", __LINE__)) // Make an exception with the line number. +#endif + +#if defined(ETL_VERBOSE_ERRORS) +#define ETL_ERROR_TEXT(verbose_text, terse_text) (verbose_text) // Use the verbose text. +#else +#define ETL_ERROR_TEXT(verbose_text, terse_text) (terse_text) // Use the terse text. +#endif + #endif diff --git a/exception.h b/exception.h index 6ad619eb..52369caa 100644 --- a/exception.h +++ b/exception.h @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove @@ -44,28 +45,69 @@ namespace etl { public: - typedef const char* value_type; + typedef const char* string_type; + typedef int numeric_type; +#if defined(ETL_VERBOSE_ERRORS) //************************************************************************* /// Constructor. //************************************************************************* - exception(value_type reason) - : reason(reason) + exception(string_type reason, string_type file, numeric_type line) + : reason(reason), + file(file), + line(line) { } +#else + //************************************************************************* + /// Constructor. + //************************************************************************* + exception(string_type reason, string_type file, numeric_type line) + : reason(reason), + line(line) + { + } +#endif //*************************************************************************** /// Gets the reason for the exception. /// \return const char* to the reason. //*************************************************************************** - value_type what() const + string_type what() const { return reason; } + + //*************************************************************************** + /// Gets the file for the exception. + /// \return const char* to the file. + //*************************************************************************** + string_type file_name() const + { +#if defined(ETL_VERBOSE_ERRORS) + return file; +#else + return ""; +#endif + } + + //*************************************************************************** + /// Gets the line for the exception. + /// \return const char* to the line. + //*************************************************************************** + numeric_type line_number() const + { + return line; + } + private: - value_type reason; ///< The reason for the exception. + string_type reason; ///< The reason for the exception. +#if defined(ETL_VERBOSE_ERRORS) + string_type file; ///< The file for the exception. +#endif + numeric_type line; ///< The line for the exception. }; } diff --git a/factorial.h b/factorial.h index bda83090..07dedeed 100644 --- a/factorial.h +++ b/factorial.h @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/fibonacci.h b/fibonacci.h index d8846da3..d3765111 100644 --- a/fibonacci.h +++ b/fibonacci.h @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/fixed_iterator.h b/fixed_iterator.h index 551f18c9..1b9d1370 100644 --- a/fixed_iterator.h +++ b/fixed_iterator.h @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2015 jwellbelove diff --git a/flat_map.h b/flat_map.h index 7172668c..a8d9f069 100644 --- a/flat_map.h +++ b/flat_map.h @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2015 jwellbelove diff --git a/flat_multimap.h b/flat_multimap.h index bd3c2024..3f3cff4a 100644 --- a/flat_multimap.h +++ b/flat_multimap.h @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2015 jwellbelove diff --git a/flat_multiset.h b/flat_multiset.h index 80a70c25..691e3f77 100644 --- a/flat_multiset.h +++ b/flat_multiset.h @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2015 jwellbelove diff --git a/flat_set.h b/flat_set.h index b9e4003c..2e8948d6 100644 --- a/flat_set.h +++ b/flat_set.h @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2015 jwellbelove diff --git a/fnv_1.h b/fnv_1.h index 1020a123..5ed5217d 100644 --- a/fnv_1.h +++ b/fnv_1.h @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/forward_list.h b/forward_list.h index 7ceba686..c27450e4 100644 --- a/forward_list.h +++ b/forward_list.h @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/function.h b/function.h index 43abc5dd..d5d91742 100644 --- a/function.h +++ b/function.h @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/functional.h b/functional.h index de8d8098..31353980 100644 --- a/functional.h +++ b/functional.h @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/hash.h b/hash.h index 01bc7259..417f68dd 100644 --- a/hash.h +++ b/hash.h @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/ibitset.h b/ibitset.h index 82a24dfc..a7f09239 100644 --- a/ibitset.h +++ b/ibitset.h @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove @@ -51,8 +52,8 @@ namespace etl { public: - bitset_exception(const char* what) - : exception(what) + bitset_exception(string_type what, string_type file_name, numeric_type line_number) + : exception(what, file_name, line_number) { } }; @@ -65,8 +66,8 @@ namespace etl { public: - bitset_nullptr() - : bitset_exception("bitset: nullptr") + bitset_nullptr(string_type file_name, numeric_type line_number) + : bitset_exception("bitset: nullptr", file_name, line_number) { } }; diff --git a/ideque.h b/ideque.h index 95e92a94..0eb6fdd8 100644 --- a/ideque.h +++ b/ideque.h @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove @@ -491,7 +492,7 @@ namespace etl //************************************************************************* void assign(size_type n, const value_type& value) { - if (ETL_ASSERT(n <= MAX_SIZE, deque_full())) + if (ETL_ASSERT(n <= MAX_SIZE, ETL_ERROR(deque_full))) { initialise(); @@ -513,7 +514,7 @@ namespace etl //************************************************************************* reference at(size_t index) { - ETL_ASSERT(index < current_size, deque_out_of_bounds()); + ETL_ASSERT(index < current_size, ETL_ERROR(deque_out_of_bounds)); iterator result(_begin); result += index; @@ -528,7 +529,7 @@ namespace etl //************************************************************************* const_reference at(size_t index) const { - ETL_ASSERT(index < current_size, deque_out_of_bounds()); + ETL_ASSERT(index < current_size, ETL_ERROR(deque_out_of_bounds)); iterator result(_begin); result += index; @@ -710,7 +711,7 @@ namespace etl { iterator position(insert_position.index, *this, p_buffer); - if (ETL_ASSERT(!full(), deque_full())) + if (ETL_ASSERT(!full(), ETL_ERROR(deque_full))) { if (insert_position == begin()) { @@ -764,7 +765,7 @@ namespace etl { iterator position; - if (ETL_ASSERT((current_size + n) <= MAX_SIZE, deque_full())) + if (ETL_ASSERT((current_size + n) <= MAX_SIZE, ETL_ERROR(deque_full))) { if (insert_position == begin()) { @@ -878,7 +879,7 @@ namespace etl difference_type n = std::distance(range_begin, range_end); - if (ETL_ASSERT((current_size + n) <= MAX_SIZE, deque_full())) + if (ETL_ASSERT((current_size + n) <= MAX_SIZE, ETL_ERROR(deque_full))) { if (insert_position == begin()) { @@ -980,7 +981,7 @@ namespace etl { iterator position(erase_position.index, *this, p_buffer); - if (ETL_ASSERT(distance(position) <= difference_type(current_size), deque_out_of_bounds())) + if (ETL_ASSERT(distance(position) <= difference_type(current_size), ETL_ERROR(deque_out_of_bounds))) { if (position == _begin) { @@ -1022,7 +1023,7 @@ namespace etl { iterator position(range_begin.index, *this, p_buffer); - if (ETL_ASSERT((distance(range_begin) <= difference_type(current_size)) && (distance(range_end) <= difference_type(current_size)), deque_out_of_bounds())) + if (ETL_ASSERT((distance(range_begin) <= difference_type(current_size)) && (distance(range_end) <= difference_type(current_size)), ETL_ERROR(deque_out_of_bounds))) { // How many to erase? size_t length = std::distance(range_begin, range_end); @@ -1087,7 +1088,7 @@ namespace etl //************************************************************************* void push_back(parameter_t item) { - if (ETL_ASSERT(!full(), deque_full())) + if (ETL_ASSERT(!full(), ETL_ERROR(deque_full))) { create_element_back(item); } @@ -1102,7 +1103,7 @@ namespace etl { reference r = *_end; - if (ETL_ASSERT(!full(), deque_full())) + if (ETL_ASSERT(!full(), ETL_ERROR(deque_full))) { create_element_back(); } @@ -1128,7 +1129,7 @@ namespace etl //************************************************************************* void push_front(parameter_t item) { - if (ETL_ASSERT(!full(), deque_full())) + if (ETL_ASSERT(!full(), ETL_ERROR(deque_full))) { create_element_front(item); } @@ -1141,7 +1142,7 @@ namespace etl //************************************************************************* reference push_front() { - if (ETL_ASSERT(!full(), deque_full())) + if (ETL_ASSERT(!full(), ETL_ERROR(deque_full))) { create_element_front(); } @@ -1168,7 +1169,7 @@ namespace etl //************************************************************************* void resize(size_t new_size, const value_type& value = value_type()) { - if (ETL_ASSERT(new_size <= MAX_SIZE, deque_out_of_bounds())) + if (ETL_ASSERT(new_size <= MAX_SIZE, ETL_ERROR(deque_out_of_bounds))) { // Make it smaller? if (new_size < current_size) diff --git a/iflat_map.h b/iflat_map.h index 2dd03075..d212aeb9 100644 --- a/iflat_map.h +++ b/iflat_map.h @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2015 jwellbelove @@ -240,7 +241,7 @@ namespace etl { iterator i_element = lower_bound(key); - ETL_ASSERT(i_element != end(), flat_map_out_of_bounds()); + ETL_ASSERT(i_element != end(), ETL_ERROR(flat_map_out_of_bounds)); return i_element->second; } @@ -255,7 +256,7 @@ namespace etl { typename buffer_t::const_iterator i_element = lower_bound(key); - ETL_ASSERT(i_element != end(), flat_map_out_of_bounds()); + ETL_ASSERT(i_element != end(), ETL_ERROR(flat_map_out_of_bounds)); return i_element->second; } @@ -273,8 +274,8 @@ namespace etl #ifdef _DEBUG difference_type count = std::distance(first, last); - ETL_ASSERT(count >= 0, flat_map_iterator()); - ETL_ASSERT(count <= difference_type(capacity()), flat_map_full()); + ETL_ASSERT(count >= 0, ETL_ERROR(flat_map_iterator)); + ETL_ASSERT(count <= difference_type(capacity()), ETL_ERROR(flat_map_full)); #endif clear(); @@ -299,7 +300,7 @@ namespace etl if (i_element == end()) { // At the end. - if (ETL_ASSERT(!buffer.full(), flat_map_full())) + if (ETL_ASSERT(!buffer.full(), ETL_ERROR(flat_map_full))) { buffer.push_back(value); result.first = end() - 1; @@ -320,7 +321,7 @@ namespace etl else { // A new one. - if (ETL_ASSERT(!buffer.full(), flat_map_full())) + if (ETL_ASSERT(!buffer.full(), ETL_ERROR(flat_map_full))) { buffer.insert(i_element, value); result.first = i_element; diff --git a/iflat_multimap.h b/iflat_multimap.h index e347e0c1..81b351f3 100644 --- a/iflat_multimap.h +++ b/iflat_multimap.h @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2015 jwellbelove @@ -223,7 +224,7 @@ namespace etl { #ifdef _DEBUG difference_type count = std::distance(first, last); - ETL_ASSERT(count >= 0, flat_multimap_iterator()); + ETL_ASSERT(count >= 0, ETL_ERROR(flat_multimap_iterator)); #endif clear(); @@ -245,7 +246,7 @@ namespace etl iterator i_element = lower_bound(value.first); - if (ETL_ASSERT(!buffer.full(), flat_multimap_full())) + if (ETL_ASSERT(!buffer.full(), ETL_ERROR(flat_multimap_full))) { if (i_element == end()) { diff --git a/iflat_multiset.h b/iflat_multiset.h index f8e23727..a8d66797 100644 --- a/iflat_multiset.h +++ b/iflat_multiset.h @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2015 jwellbelove @@ -200,7 +201,7 @@ namespace etl #ifdef _DEBUG difference_type count = std::distance(first, last); - ETL_ASSERT(count >= 0, flat_multiset_iterator()); + ETL_ASSERT(count >= 0, ETL_ERROR(flat_multiset_iterator)); #endif clear(); @@ -220,7 +221,7 @@ namespace etl { std::pair result(end(), false); - if (ETL_ASSERT(!buffer.full(), flat_multiset_full())) + if (ETL_ASSERT(!buffer.full(), ETL_ERROR(flat_multiset_full))) { iterator i_element = std::lower_bound(begin(), end(), value, TKeyCompare()); diff --git a/iflat_set.h b/iflat_set.h index abc8869a..f7ee5175 100644 --- a/iflat_set.h +++ b/iflat_set.h @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2015 jwellbelove @@ -199,7 +200,7 @@ namespace etl { #ifdef _DEBUG difference_type count = std::distance(first, last); - ETL_ASSERT(count >= 0, flat_set_iterator()); + ETL_ASSERT(count >= 0, ETL_ERROR(flat_set_iterator)); #endif clear(); @@ -219,7 +220,7 @@ namespace etl { std::pair result(end(), false); - if (ETL_ASSERT(!buffer.full(), flat_set_full())) + if (ETL_ASSERT(!buffer.full(), ETL_ERROR(flat_set_full))) { iterator i_element = std::lower_bound(begin(), end(), value, TKeyCompare()); diff --git a/iforward_list.h b/iforward_list.h index a3cb7ddc..9f65bc41 100644 --- a/iforward_list.h +++ b/iforward_list.h @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove @@ -363,7 +364,7 @@ namespace etl { #ifdef _DEBUG difference_type count = std::distance(first, last); - ETL_ASSERT(count >= 0, forward_list_iterator()); + ETL_ASSERT(count >= 0, ETL_ERROR(forward_list_iterator)); #endif initialise(); @@ -373,7 +374,7 @@ namespace etl // Add all of the elements. while (first != last) { - if (ETL_ASSERT(!full(), forward_list_iterator())) + if (ETL_ASSERT(!full(), ETL_ERROR(forward_list_iterator))) { Data_Node& data_node = allocate_data_node(*first++); join(p_last_node, &data_node); @@ -389,7 +390,7 @@ namespace etl //************************************************************************* void assign(size_t n, parameter_t value) { - if (ETL_ASSERT(n <= MAX_SIZE, forward_list_full())) + if (ETL_ASSERT(n <= MAX_SIZE, ETL_ERROR(forward_list_full))) { initialise(); @@ -412,7 +413,7 @@ namespace etl //************************************************************************* void push_front() { - if (ETL_ASSERT(!full(), forward_list_full())) + if (ETL_ASSERT(!full(), ETL_ERROR(forward_list_full))) { Data_Node& data_node = allocate_data_node(T()); insert_node_after(start_node, data_node); @@ -424,7 +425,7 @@ namespace etl //************************************************************************* void push_front(parameter_t value) { - if (ETL_ASSERT(!full(), forward_list_full())) + if (ETL_ASSERT(!full(), ETL_ERROR(forward_list_full))) { Data_Node& data_node = allocate_data_node(value); insert_node_after(start_node, data_node); @@ -457,7 +458,7 @@ namespace etl //************************************************************************* void resize(size_t n, T value) { - if (ETL_ASSERT(n <= MAX_SIZE, forward_list_full())) + if (ETL_ASSERT(n <= MAX_SIZE, ETL_ERROR(forward_list_full))) { size_t i = 0; iterator i_node = begin(); @@ -493,7 +494,7 @@ namespace etl //************************************************************************* iterator insert_after(iterator position, parameter_t value) { - if (ETL_ASSERT(!full(), forward_list_full())) + if (ETL_ASSERT(!full(), ETL_ERROR(forward_list_full))) { Data_Node& data_node = allocate_data_node(value); insert_node_after(*position.p_node, data_node); @@ -507,7 +508,7 @@ namespace etl //************************************************************************* void insert_after(iterator position, size_t n, parameter_t value) { - if (ETL_ASSERT(!full(), forward_list_full())) + if (ETL_ASSERT(!full(), ETL_ERROR(forward_list_full))) { for (size_t i = 0; !full() && (i < n); ++i) { @@ -526,7 +527,7 @@ namespace etl { #ifdef _DEBUG difference_type count = std::distance(first, last); - ETL_ASSERT((count + current_size) <= MAX_SIZE, forward_list_full()); + ETL_ASSERT((count + current_size) <= MAX_SIZE, ETL_ERROR(forward_list_full)); #endif while (first != last) diff --git a/ihash.h b/ihash.h index c4668d1f..4450e9c5 100644 --- a/ihash.h +++ b/ihash.h @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2015 jwellbelove @@ -34,10 +35,14 @@ SOFTWARE. #include #include "exception.h" +#include "error_handler.h" ///\defgroup ihash Common data for all hash type classes. ///\ingroup hash +#undef ETL_FILE +#define ETL_FILE "19" + namespace etl { //*************************************************************************** @@ -48,8 +53,8 @@ namespace etl { public: - hash_exception(const char* what) - : exception(what) + hash_exception(string_type what, string_type file_name, numeric_type line_number) + : exception(what, file_name, line_number) {} }; @@ -61,8 +66,8 @@ namespace etl { public: - hash_finalised() - : hash_exception("ihash: finalised") + hash_finalised(string_type file_name, numeric_type line_number) + : hash_exception(ETL_ERROR_TEXT("ihash:finalised", ETL_FILE"A"), file_name, line_number) {} }; @@ -70,4 +75,6 @@ namespace etl typedef hash_finalised hash_finalized; } +#undef ETL_FILE + #endif diff --git a/ilist.h b/ilist.h index d35686a4..0ea57fb9 100644 --- a/ilist.h +++ b/ilist.h @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove @@ -452,8 +453,8 @@ namespace etl { #ifdef _DEBUG difference_type count = std::distance(first, last); - ETL_ASSERT(count >= 0, list_iterator()); - ETL_ASSERT(size_t(count) <= MAX_SIZE, list_full()); + ETL_ASSERT(count >= 0, ETL_ERROR(list_iterator)); + ETL_ASSERT(size_t(count) <= MAX_SIZE, ETL_ERROR(list_full)); #endif initialise(); @@ -474,7 +475,7 @@ namespace etl void assign(size_t n, parameter_t value) { #ifdef _DEBUG - ETL_ASSERT(n <= MAX_SIZE, list_full()); + ETL_ASSERT(n <= MAX_SIZE, ETL_ERROR(list_full)); #endif initialise(); @@ -494,7 +495,7 @@ namespace etl //************************************************************************* void push_front() { - if (ETL_ASSERT(!full(), list_full())) + if (ETL_ASSERT(!full(), ETL_ERROR(list_full))) { Data_Node& data_node = allocate_data_node(T()); insert_node(get_head(), data_node); @@ -506,7 +507,7 @@ namespace etl //************************************************************************* void push_front(parameter_t value) { - if (ETL_ASSERT(!full(), list_full())) + if (ETL_ASSERT(!full(), ETL_ERROR(list_full))) { Node& data_node = allocate_data_node(value); insert_node(get_head(), data_node); @@ -530,7 +531,7 @@ namespace etl //************************************************************************* void push_back() { - if (ETL_ASSERT(!full(), list_full())) + if (ETL_ASSERT(!full(), ETL_ERROR(list_full))) { Data_Node& data_node = allocate_data_node(T()); insert_node(terminal_node, data_node); @@ -542,7 +543,7 @@ namespace etl //************************************************************************* void push_back(parameter_t value) { - if (ETL_ASSERT(!full(), list_full())) + if (ETL_ASSERT(!full(), ETL_ERROR(list_full))) { Data_Node& data_node = allocate_data_node(value); insert_node(terminal_node, data_node); @@ -566,7 +567,7 @@ namespace etl //************************************************************************* iterator insert(iterator position, const value_type& value) { - if (ETL_ASSERT(!full(), list_full())) + if (ETL_ASSERT(!full(), ETL_ERROR(list_full))) { Data_Node& data_node = allocate_data_node(value); insert_node(*position.p_node, data_node); @@ -582,7 +583,7 @@ namespace etl { for (size_t i = 0; i < n; ++i) { - if (ETL_ASSERT(!full(), list_full())) + if (ETL_ASSERT(!full(), ETL_ERROR(list_full))) { // Set up the next free node and insert. Data_Node& data_node = allocate_data_node(value); @@ -599,7 +600,7 @@ namespace etl { while (first != last) { - if (ETL_ASSERT(!full(), list_full())) + if (ETL_ASSERT(!full(), ETL_ERROR(list_full))) { // Set up the next free node and insert. Data_Node& data_node = allocate_data_node(*first++); @@ -660,7 +661,7 @@ namespace etl //************************************************************************* void resize(size_t n, parameter_t value) { - if (ETL_ASSERT(n <= MAX_SIZE, list_full())) + if (ETL_ASSERT(n <= MAX_SIZE, ETL_ERROR(list_full))) { // Smaller? if (n < size()) diff --git a/imap.h b/imap.h index 4ee0d3b5..7c2330de 100644 --- a/imap.h +++ b/imap.h @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove, rlindeman @@ -524,16 +525,7 @@ namespace etl { iterator i_element = find(key); - if (!i_element.p_node) - { - // Doesn't exist. -#if ETL_THROW_EXCEPTIONS - throw map_out_of_bounds(); -#else - error_handler::error(map_out_of_bounds()); - -#endif - } + ETL_ASSERT(i_element.p_node != nullptr, ETL_ERROR(map_out_of_bounds)); return i_element->second; } @@ -548,16 +540,7 @@ namespace etl { const_iterator i_element = find(key); - if (!i_element.p_node) - { - // Doesn't exist. -#if ETL_THROW_EXCEPTIONS - throw map_out_of_bounds(); -#else - error_handler::error(map_out_of_bounds()); - -#endif - } + ETL_ASSERT(i_element.p_node != nullptr, ETL_ERROR(map_out_of_bounds)); return i_element->second; } @@ -708,7 +691,7 @@ namespace etl Node* inserted_node = nullptr; bool inserted = false; - if (ETL_ASSERT(!full(), map_full())) + if (ETL_ASSERT(!full(), ETL_ERROR(map_full))) { // Get next available free node Data_Node& node = allocate_data_node(value); @@ -733,7 +716,7 @@ namespace etl // Default to no inserted node Node* inserted_node = nullptr; - if (ETL_ASSERT(!full(), map_full())) + if (ETL_ASSERT(!full(), ETL_ERROR(map_full))) { // Get next available free node Data_Node& node = allocate_data_node(value); @@ -757,7 +740,7 @@ namespace etl // Default to no inserted node Node* inserted_node = nullptr; - if (ETL_ASSERT(!full(), map_full())) + if (ETL_ASSERT(!full(), ETL_ERROR(map_full))) { // Get next available free node Data_Node& node = allocate_data_node(value); diff --git a/imultimap.h b/imultimap.h index 63a21ecc..c740a7a6 100644 --- a/imultimap.h +++ b/imultimap.h @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove, rlindeman @@ -655,7 +656,7 @@ namespace etl // Default to no inserted node Node* inserted_node = nullptr; - if (ETL_ASSERT(!full(), multimap_full())) + if (ETL_ASSERT(!full(), ETL_ERROR(multimap_full))) { // Get next available free node Data_Node& node = allocate_data_node(value); diff --git a/imultiset.h b/imultiset.h index 7b0ae287..efd9d3ea 100644 --- a/imultiset.h +++ b/imultiset.h @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove, rlindeman @@ -636,7 +637,7 @@ namespace etl // Default to no inserted node Node* inserted_node = nullptr; - if (ETL_ASSERT(!full(), multiset_full())) + if (ETL_ASSERT(!full(), ETL_ERROR(multiset_full))) { // Get next available free node Data_Node& node = allocate_data_node(value); diff --git a/instance_count.h b/instance_count.h index ad8f0927..37e29e37 100644 --- a/instance_count.h +++ b/instance_count.h @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/integral_limits.h b/integral_limits.h index 6ba47468..3754d80b 100644 --- a/integral_limits.h +++ b/integral_limits.h @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/intrusive_forward_list.h b/intrusive_forward_list.h index ca601040..0c41cc9d 100644 --- a/intrusive_forward_list.h +++ b/intrusive_forward_list.h @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2015 jwellbelove @@ -53,8 +54,8 @@ namespace etl { public: - intrusive_forward_list_exception(const char* what) - : exception(what) + intrusive_forward_list_exception(string_type what, string_type file_name, numeric_type line_number) + : exception(what, file_name, line_number) { } }; @@ -67,8 +68,8 @@ namespace etl { public: - intrusive_forward_list_iterator_exception() - : intrusive_forward_list_exception("intrusive_forward_list: iterator problem") + intrusive_forward_list_iterator_exception(string_type file_name, numeric_type line_number) + : intrusive_forward_list_exception("intrusive_forward_list: iterator", file_name, line_number) { } }; @@ -81,8 +82,8 @@ namespace etl { public: - intrusive_forward_list_index_exception() - : intrusive_forward_list_exception("intrusive_forward_list: index out of bounds") + intrusive_forward_list_index_exception(string_type file_name, numeric_type line_number) + : intrusive_forward_list_exception("intrusive_forward_list:bounds", file_name, line_number) { } }; @@ -408,7 +409,7 @@ namespace etl { #ifdef _DEBUG difference_type count = std::distance(first, last); - ETL_ASSERT(count >= 0, intrusive_forward_list_iterator_exception()); + ETL_ASSERT(count >= 0, ETL_ERROR(intrusive_forward_list_iterator_exception)); #endif initialise(); diff --git a/intrusive_forward_list_node.h b/intrusive_forward_list_node.h index b71cd830..7c44c1a8 100644 --- a/intrusive_forward_list_node.h +++ b/intrusive_forward_list_node.h @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2015 jwellbelove @@ -71,7 +72,7 @@ namespace etl __private_intrusive_forward_list__::intrusive_forward_list_node_base* get_next(size_t index) const { #ifdef _DEBUG - ETL_ASSERT(index < SIZE, intrusive_forward_list_index_exception()); + ETL_ASSERT(index < SIZE, ETL_ERROR(intrusive_forward_list_index_exception)); #endif return next[index]; } @@ -79,7 +80,7 @@ namespace etl void set_next(size_t index, __private_intrusive_forward_list__::intrusive_forward_list_node_base* pnext) { #ifdef _DEBUG - ETL_ASSERT(index < SIZE, intrusive_forward_list_index_exception()); + ETL_ASSERT(index < SIZE, ETL_ERROR(intrusive_forward_list_index_exception)); #endif next[index] = pnext; } diff --git a/io_port.h b/io_port.h index b69aa541..c4427963 100644 --- a/io_port.h +++ b/io_port.h @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/ipool.h b/ipool.h index b5c3fbe8..33a730c5 100644 --- a/ipool.h +++ b/ipool.h @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove @@ -323,9 +324,9 @@ namespace etl T* allocate() { #if defined(_DEBUG) || defined(DEBUG) - if (ETL_ASSERT(items_allocated < MAX_SIZE && !in_use_flags.test(next_free), pool_no_allocation())) + if (ETL_ASSERT(items_allocated < MAX_SIZE && !in_use_flags.test(next_free), ETL_ERROR(pool_no_allocation))) #else - if (ETL_ASSERT(items_allocated < MAX_SIZE, pool_no_allocation())) + if (ETL_ASSERT(items_allocated < MAX_SIZE, ETL_ERROR(pool_no_allocation))) #endif { T* result = new(&p_buffer[next_free]) T(); @@ -349,9 +350,9 @@ namespace etl T* allocate(const T& initial) { #if defined(_DEBUG) || defined(DEBUG) - if (ETL_ASSERT(items_allocated < MAX_SIZE && !in_use_flags.test(next_free), pool_no_allocation())) + if (ETL_ASSERT(items_allocated < MAX_SIZE && !in_use_flags.test(next_free), ETL_ERROR(pool_no_allocation))) #else - if (ETL_ASSERT(items_allocated < MAX_SIZE, pool_no_allocation())) + if (ETL_ASSERT(items_allocated < MAX_SIZE, ETL_ERROR(pool_no_allocation))) #endif { T* result = new(&p_buffer[next_free]) T(initial); @@ -386,7 +387,7 @@ namespace etl void release(const T* const p_object) { // Does it belong to me? - if (ETL_ASSERT(is_in_pool(p_object), pool_object_not_in_pool())) + if (ETL_ASSERT(is_in_pool(p_object), ETL_ERROR(pool_object_not_in_pool))) { // Where is it in the buffer? typename std::iterator_traits::difference_type distance = p_object - p_buffer; diff --git a/ipriority_queue.h b/ipriority_queue.h index ce6ce15a..97747f59 100644 --- a/ipriority_queue.h +++ b/ipriority_queue.h @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2015 jwellbelove, rlindeman @@ -101,7 +102,7 @@ namespace etl //************************************************************************* void push(parameter_t value) { - if (ETL_ASSERT(!full(), priority_queue_full())) + if (ETL_ASSERT(!full(), ETL_ERROR(priority_queue_full))) { // Put element at end container.push_back(value); @@ -135,8 +136,8 @@ namespace etl { #ifdef _DEBUG difference_type count = std::distance(first, last); - ETL_ASSERT(count >= 0, priority_queue_iterator()); - ETL_ASSERT(static_cast(count) <= MAX_SIZE, priority_queue_full()); + ETL_ASSERT(count >= 0, ETL_ERROR(priority_queue_iterator)); + ETL_ASSERT(static_cast(count) <= MAX_SIZE, ETL_ERROR(priority_queue_full)); #endif clear(); diff --git a/iqueue.h b/iqueue.h index 1b87e507..99df6294 100644 --- a/iqueue.h +++ b/iqueue.h @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove @@ -113,7 +114,7 @@ namespace etl //************************************************************************* void push(parameter_t value) { - if (ETL_ASSERT(!full(), queue_full())) + if (ETL_ASSERT(!full(), ETL_ERROR(queue_full))) { new(&p_buffer[in]) T(value); in = (in == (MAX_SIZE - 1)) ? 0 : in + 1; @@ -133,7 +134,7 @@ namespace etl { const size_type next = in; - if (ETL_ASSERT(!full(), queue_full())) + if (ETL_ASSERT(!full(), ETL_ERROR(queue_full))) { new(&p_buffer[in]) T(); in = (in == (MAX_SIZE - 1)) ? 0 : in + 1; @@ -165,7 +166,7 @@ namespace etl //************************************************************************* void pop() { - if ETL_ASSERT(!empty(), etl::queue_empty()) + if ETL_ASSERT(!empty(), ETL_ERROR(queue_empty)) { p_buffer[out].~T(); out = (out == (MAX_SIZE - 1)) ? 0 : out + 1; diff --git a/iset.h b/iset.h index e06fe729..d28e7581 100644 --- a/iset.h +++ b/iset.h @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove, rlindeman @@ -632,7 +633,7 @@ namespace etl Node* inserted_node = nullptr; bool inserted = false; - if (ETL_ASSERT(!full(), set_full())) + if (ETL_ASSERT(!full(), ETL_ERROR(set_full))) { // Get next available free node Data_Node& node = allocate_data_node(value); @@ -657,7 +658,7 @@ namespace etl // Default to no inserted node Node* inserted_node = nullptr; - if (ETL_ASSERT(!full(), set_full())) + if (ETL_ASSERT(!full(), ETL_ERROR(set_full))) { // Get next available free node Data_Node& node = allocate_data_node(value); @@ -681,7 +682,7 @@ namespace etl // Default to no inserted node Node* inserted_node = nullptr; - if (ETL_ASSERT(!full(), set_full())) + if (ETL_ASSERT(!full(), ETL_ERROR(set_full))) { // Get next available free node Data_Node& node = allocate_data_node(value); diff --git a/istack.h b/istack.h index 167d30e7..559f6473 100644 --- a/istack.h +++ b/istack.h @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove @@ -85,7 +86,7 @@ namespace etl //************************************************************************* void push(parameter_t value) { - if (ETL_ASSERT(!full(), stack_full())) + if (ETL_ASSERT(!full(), ETL_ERROR(stack_full))) { top_index = current_size++; new(&p_buffer[top_index]) T(value); @@ -101,7 +102,7 @@ namespace etl //************************************************************************* reference push() { - if (ETL_ASSERT(!full(), stack_full())) + if (ETL_ASSERT(!full(), ETL_ERROR(stack_full))) { top_index = current_size++; new(&p_buffer[top_index]) T(); diff --git a/ivector.h b/ivector.h index b06dfb40..033cfcde 100644 --- a/ivector.h +++ b/ivector.h @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove @@ -192,7 +193,7 @@ namespace etl //********************************************************************* void resize(size_t new_size) { - if (ETL_ASSERT(new_size <= MAX_SIZE, vector_full())) + if (ETL_ASSERT(new_size <= MAX_SIZE, ETL_ERROR(vector_full))) { // Size up or size down? if (new_size > current_size) @@ -224,7 +225,7 @@ namespace etl //********************************************************************* void resize(size_t new_size, T value) { - if (ETL_ASSERT(new_size <= MAX_SIZE, vector_full())) + if (ETL_ASSERT(new_size <= MAX_SIZE, ETL_ERROR(vector_full))) { // Size up? if (new_size > current_size) @@ -273,7 +274,7 @@ namespace etl //********************************************************************* reference at(size_t i) { - ETL_ASSERT(i < current_size, vector_out_of_bounds()); + ETL_ASSERT(i < current_size, ETL_ERROR(vector_out_of_bounds)); return p_buffer[i]; } @@ -285,7 +286,7 @@ namespace etl //********************************************************************* const_reference at(size_t i) const { - ETL_ASSERT(i < current_size, vector_out_of_bounds()); + ETL_ASSERT(i < current_size, ETL_ERROR(vector_out_of_bounds)); return p_buffer[i]; } @@ -355,8 +356,8 @@ namespace etl { #ifdef _DEBUG difference_type count = std::distance(first, last); - ETL_ASSERT(count >= 0, vector_iterator()); - ETL_ASSERT(static_cast(count) <= MAX_SIZE, vector_full()); + ETL_ASSERT(count >= 0, ETL_ERROR(vector_iterator)); + ETL_ASSERT(static_cast(count) <= MAX_SIZE, ETL_ERROR(vector_full)); #endif initialise(); @@ -379,7 +380,7 @@ namespace etl { initialise(); - if (ETL_ASSERT(n <= MAX_SIZE, vector_full())) + if (ETL_ASSERT(n <= MAX_SIZE, ETL_ERROR(vector_full))) { while (n > 0) { @@ -403,7 +404,7 @@ namespace etl //************************************************************************* void push_back() { - if (ETL_ASSERT(current_size != MAX_SIZE, vector_full())) + if (ETL_ASSERT(current_size != MAX_SIZE, ETL_ERROR(vector_full))) { create_element(); } @@ -416,7 +417,7 @@ namespace etl //********************************************************************* void push_back(parameter_t value) { - if (ETL_ASSERT(current_size != MAX_SIZE, vector_full())) + if (ETL_ASSERT(current_size != MAX_SIZE, ETL_ERROR(vector_full))) { create_element(value); } @@ -442,7 +443,7 @@ namespace etl //********************************************************************* iterator insert(iterator position, parameter_t value) { - if (ETL_ASSERT((current_size) + 1 <= MAX_SIZE, vector_full())) + if (ETL_ASSERT((current_size) + 1 <= MAX_SIZE, ETL_ERROR(vector_full))) { create_element(value); @@ -465,7 +466,7 @@ namespace etl //********************************************************************* void insert(iterator position, size_t n, parameter_t value) { - if (ETL_ASSERT((current_size) + 1 <= MAX_SIZE, vector_full())) + if (ETL_ASSERT((current_size) + 1 <= MAX_SIZE, ETL_ERROR(vector_full))) { if (position == end()) { @@ -528,7 +529,7 @@ namespace etl { size_t count = std::distance(first, last); - if (ETL_ASSERT((current_size) + count <= MAX_SIZE, vector_full())) + if (ETL_ASSERT((current_size) + count <= MAX_SIZE, ETL_ERROR(vector_full))) { if (position == end()) { diff --git a/jenkins.h b/jenkins.h index b778df5c..4b05076b 100644 --- a/jenkins.h +++ b/jenkins.h @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove @@ -107,7 +108,7 @@ namespace etl { STATIC_ASSERT(sizeof(typename std::iterator_traits::value_type) == 1, "Incompatible type"); - if (ETL_ASSERT(!is_finalised, hash_finalised())) + if (ETL_ASSERT(!is_finalised, ETL_ERROR(hash_finalised))) { while (begin != end) { @@ -123,7 +124,7 @@ namespace etl //************************************************************************* void add(uint8_t value) { - if (ETL_ASSERT(!is_finalised, hash_finalised())) + if (ETL_ASSERT(!is_finalised, ETL_ERROR(hash_finalised))) { hash += value; hash += (hash << 10); diff --git a/largest.h b/largest.h index 9e9649a5..47e56600 100644 --- a/largest.h +++ b/largest.h @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/list.h b/list.h index 7b7b674e..d162823a 100644 --- a/list.h +++ b/list.h @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/log.h b/log.h index abb11725..4662ca26 100644 --- a/log.h +++ b/log.h @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/map.h b/map.h index 11e78159..9f7f5ea8 100644 --- a/map.h +++ b/map.h @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove, rlindeman diff --git a/multimap.h b/multimap.h index a76ecf5a..8e63f5a9 100644 --- a/multimap.h +++ b/multimap.h @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove, rlindeman diff --git a/multiset.h b/multiset.h index cddcda2a..26926d86 100644 --- a/multiset.h +++ b/multiset.h @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove, rlindeman diff --git a/murmur3.h b/murmur3.h index 223e9c1f..92178be7 100644 --- a/murmur3.h +++ b/murmur3.h @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove @@ -120,7 +121,7 @@ namespace etl { STATIC_ASSERT(sizeof(typename std::iterator_traits::value_type) == 1, "Incompatible type"); - if (ETL_ASSERT(!is_finalised, hash_finalised())) + if (ETL_ASSERT(!is_finalised, ETL_ERROR(hash_finalised))) { while (begin != end) { @@ -146,7 +147,7 @@ namespace etl void add(uint8_t value) { // We can't add to a finalised hash! - if (ETL_ASSERT(!is_finalised, hash_finalised())) + if (ETL_ASSERT(!is_finalised, ETL_ERROR(hash_finalised))) { block |= value << (block_fill_count * 8); diff --git a/nullptr.h b/nullptr.h index f4fe6f52..7b34b34b 100644 --- a/nullptr.h +++ b/nullptr.h @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/numeric.h b/numeric.h index bdc13940..064bab64 100644 --- a/numeric.h +++ b/numeric.h @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/observer.h b/observer.h index 29ddab12..529423ee 100644 --- a/observer.h +++ b/observer.h @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove @@ -55,6 +56,9 @@ SOFTWARE. #include "exception.h" #include "error_handler.h" +#undef ETL_FILE +#define ETL_FILE "18" + namespace etl { //*************************************************************************** @@ -65,8 +69,8 @@ namespace etl { public: - observer_exception(const char* what) - : exception(what) + observer_exception(string_type what, string_type file_name, numeric_type line_number) + : exception(what, file_name, line_number) { } }; @@ -79,8 +83,8 @@ namespace etl { public: - observer_list_full() - : observer_exception("observer: list full") + observer_list_full(string_type file_name, numeric_type line_number) + : observer_exception(ETL_ERROR_TEXT("observer:full", ETL_FILE"A"), file_name, line_number) { } }; @@ -117,7 +121,7 @@ namespace etl if (i_observer == observer_list.end()) { // Is there enough room? - if (ETL_ASSERT(!observer_list.full(), etl::observer_list_full())) + if (ETL_ASSERT(!observer_list.full(), ETL_ERROR(etl::observer_list_full))) { // Add it. observer_list.push_back(&observer); @@ -340,4 +344,6 @@ namespace etl }; } +#undef ETL_FILE + #endif diff --git a/optional.h b/optional.h index 62891cf1..2237426e 100644 --- a/optional.h +++ b/optional.h @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2015 jwellbelove @@ -72,8 +73,8 @@ namespace etl { public: - optional_exception(const char* what) - : exception(what) + optional_exception(string_type what, string_type file_name, numeric_type line_number) + : exception(what, file_name, line_number) { } }; @@ -86,8 +87,8 @@ namespace etl { public: - optional_invalid() - : optional_exception("optional: invalid") + optional_invalid(string_type file_name, numeric_type line_number) + : optional_exception("optional: invalid", file_name, line_number) { } }; @@ -215,7 +216,7 @@ namespace etl T* operator ->() { #ifdef _DEBUG - ETL_ASSERT(valid, optional_invalid()); + ETL_ASSERT(valid, ETL_ERROR(optional_invalid)); #endif return storage.template get_address(); @@ -227,7 +228,7 @@ namespace etl const T* operator ->() const { #ifdef _DEBUG - ETL_ASSERT(valid, optional_invalid()); + ETL_ASSERT(valid, ETL_ERROR(optional_invalid)); #endif return storage.template get_address(); @@ -239,7 +240,7 @@ namespace etl T& operator *() { #ifdef _DEBUG - ETL_ASSERT(valid, optional_invalid()); + ETL_ASSERT(valid, ETL_ERROR(optional_invalid)); #endif return storage.template get_reference(); @@ -251,7 +252,7 @@ namespace etl const T& operator *() const { #ifdef _DEBUG - ETL_ASSERT(valid, optional_invalid()); + ETL_ASSERT(valid, ETL_ERROR(optional_invalid)); #endif return storage.template get_reference(); @@ -271,7 +272,7 @@ namespace etl T& value() { #ifdef _DEBUG - ETL_ASSERT(valid, optional_invalid()); + ETL_ASSERT(valid, ETL_ERROR(optional_invalid)); #endif return storage.template get_reference(); @@ -283,7 +284,7 @@ namespace etl const T& value() const { #ifdef _DEBUG - ETL_ASSERT(valid, optional_invalid()); + ETL_ASSERT(valid, ETL_ERROR(optional_invalid)); #endif return storage.template get_reference(); diff --git a/parameter_type.h b/parameter_type.h index a90d61e0..bdc73e0b 100644 --- a/parameter_type.h +++ b/parameter_type.h @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/pearson.cpp b/pearson.cpp index c02ee85d..ce4742dd 100644 --- a/pearson.cpp +++ b/pearson.cpp @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2015 jwellbelove diff --git a/pearson.h b/pearson.h index 2be0c780..fd37fe1c 100644 --- a/pearson.h +++ b/pearson.h @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/pool.h b/pool.h index 0cfcfbd8..9b5f9d90 100644 --- a/pool.h +++ b/pool.h @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/power.h b/power.h index 210045d7..3421e39e 100644 --- a/power.h +++ b/power.h @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/priority_queue.h b/priority_queue.h index 79bee35f..042293f2 100644 --- a/priority_queue.h +++ b/priority_queue.h @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2015 jwellbelove, rlindeman diff --git a/private/deque_base.h b/private/deque_base.h index 464395bd..79755433 100644 --- a/private/deque_base.h +++ b/private/deque_base.h @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove @@ -37,6 +38,10 @@ SOFTWARE. #include #include "../exception.h" +#include "../error_handler.h" + +#undef ETL_FILE +#define ETL_FILE "1" namespace etl { @@ -48,8 +53,8 @@ namespace etl { public: - deque_exception(const char* what) - : exception(what) + deque_exception(string_type what, string_type file_name, numeric_type line_number) + : exception(what, file_name, line_number) { } }; @@ -62,8 +67,8 @@ namespace etl { public: - deque_full() - : deque_exception("deque: full") + deque_full(string_type file_name, numeric_type line_number) + : deque_exception(ETL_ERROR_TEXT("deque:full", ETL_FILE"A"), file_name, line_number) { } }; @@ -76,8 +81,8 @@ namespace etl { public: - deque_empty() - : deque_exception("deque: empty") + deque_empty(string_type file_name, numeric_type line_number) + : deque_exception(ETL_ERROR_TEXT("deque:empty", ETL_FILE"B"), file_name, line_number) { } }; @@ -90,8 +95,8 @@ namespace etl { public: - deque_out_of_bounds() - : deque_exception("deque: out of bounds") + deque_out_of_bounds(string_type file_name, numeric_type line_number) + : deque_exception(ETL_ERROR_TEXT("deque:bounds", ETL_FILE"C"), file_name, line_number) { } }; @@ -169,4 +174,6 @@ namespace etl }; } +#undef ETL_FILE + #endif diff --git a/private/flat_map_base.h b/private/flat_map_base.h index b3136b59..ee410425 100644 --- a/private/flat_map_base.h +++ b/private/flat_map_base.h @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2015 jwellbelove @@ -40,6 +41,9 @@ SOFTWARE. #include "../ivector.h" #include "../error_handler.h" +#undef ETL_FILE +#define ETL_FILE "2" + namespace etl { //*************************************************************************** @@ -50,8 +54,8 @@ namespace etl { public: - flat_map_exception(const char* what) - : exception(what) + flat_map_exception(string_type what, string_type file_name, numeric_type line_number) + : exception(what, file_name, line_number) { } }; @@ -64,8 +68,8 @@ namespace etl { public: - flat_map_full() - : flat_map_exception("flat_map: full") + flat_map_full(string_type file_name, numeric_type line_number) + : flat_map_exception(ETL_ERROR_TEXT("flat_map: full", ETL_FILE"A"), file_name, line_number) { } }; @@ -78,8 +82,8 @@ namespace etl { public: - flat_map_out_of_bounds() - : flat_map_exception("flat_map: out of bounds") + flat_map_out_of_bounds(string_type file_name, numeric_type line_number) + : flat_map_exception(ETL_ERROR_TEXT("flat_map:bounds", ETL_FILE"B"), file_name, line_number) { } }; @@ -92,8 +96,8 @@ namespace etl { public: - flat_map_iterator() - : flat_map_exception("flat_map: iterator error") + flat_map_iterator(string_type file_name, numeric_type line_number) + : flat_map_exception(ETL_ERROR_TEXT("flat_map:iterator", ETL_FILE"C"), file_name, line_number) { } }; @@ -176,4 +180,6 @@ namespace etl }; } +#undef ETL_FILE + #endif diff --git a/private/flat_multimap_base.h b/private/flat_multimap_base.h index ed4e3a8d..74473b21 100644 --- a/private/flat_multimap_base.h +++ b/private/flat_multimap_base.h @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2015 jwellbelove @@ -40,6 +41,9 @@ SOFTWARE. #include "../ivector.h" #include "../error_handler.h" +#undef ETL_FILE +#define ETL_FILE "3" + namespace etl { //*************************************************************************** @@ -50,8 +54,8 @@ namespace etl { public: - flat_multimap_exception(const char* what) - : exception(what) + flat_multimap_exception(string_type what, string_type file_name, numeric_type line_number) + : exception(what, file_name, line_number) { } }; @@ -64,8 +68,8 @@ namespace etl { public: - flat_multimap_full() - : flat_multimap_exception("flat_multimap: full") + flat_multimap_full(string_type file_name, numeric_type line_number) + : flat_multimap_exception(ETL_ERROR_TEXT("flat_multimap:full", ETL_FILE"A"), file_name, line_number) { } }; @@ -78,8 +82,8 @@ namespace etl { public: - flat_multimap_out_of_bounds() - : flat_multimap_exception("flat_multimap: out of bounds") + flat_multimap_out_of_bounds(string_type file_name, numeric_type line_number) + : flat_multimap_exception(ETL_ERROR_TEXT("flat_multimap:bounds", ETL_FILE"B"), file_name, line_number) { } }; @@ -92,8 +96,8 @@ namespace etl { public: - flat_multimap_iterator() - : flat_multimap_exception("flat_multimap: iterator error") + flat_multimap_iterator(string_type file_name, numeric_type line_number) + : flat_multimap_exception(ETL_ERROR_TEXT("flat_multimap:iterator", ETL_FILE"C"), file_name, line_number) { } }; diff --git a/private/flat_multiset_base.h b/private/flat_multiset_base.h index ce24b1ac..1e1e2007 100644 --- a/private/flat_multiset_base.h +++ b/private/flat_multiset_base.h @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2015 jwellbelove @@ -40,6 +41,9 @@ SOFTWARE. #include "../ivector.h" #include "../error_handler.h" +#undef ETL_FILE +#define ETL_FILE "4" + namespace etl { //*************************************************************************** @@ -50,8 +54,8 @@ namespace etl { public: - flat_multiset_exception(const char* what) - : exception(what) + flat_multiset_exception(string_type what, string_type file_name, numeric_type line_number) + : exception(what, file_name, line_number) { } }; @@ -64,8 +68,8 @@ namespace etl { public: - flat_multiset_full() - : flat_multiset_exception("flat_multiset: full") + flat_multiset_full(string_type file_name, numeric_type line_number) + : flat_multiset_exception(ETL_ERROR_TEXT("flat_multiset:full", ETL_FILE"A"), file_name, line_number) { } }; @@ -78,8 +82,8 @@ namespace etl { public: - flat_multiset_out_of_bounds() - : flat_multiset_exception("flat_multiset: out of bounds") + flat_multiset_out_of_bounds(string_type file_name, numeric_type line_number) + : flat_multiset_exception(ETL_ERROR_TEXT("flat_multiset:bounds", ETL_FILE"B"), file_name, line_number) { } }; @@ -92,8 +96,8 @@ namespace etl { public: - flat_multiset_iterator() - : flat_multiset_exception("flat_multiset: iterator error") + flat_multiset_iterator(string_type file_name, numeric_type line_number) + : flat_multiset_exception(ETL_ERROR_TEXT("flat_multiset:iterator", ETL_FILE"C"), file_name, line_number) { } }; @@ -176,4 +180,6 @@ namespace etl }; } +#undef ETL_FILE + #endif diff --git a/private/flat_set_base.h b/private/flat_set_base.h index 67e6bf21..e61e8a24 100644 --- a/private/flat_set_base.h +++ b/private/flat_set_base.h @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2015 jwellbelove @@ -40,6 +41,9 @@ SOFTWARE. #include "../ivector.h" #include "../error_handler.h" +#undef ETL_FILE +#define ETL_FILE "5" + namespace etl { //*************************************************************************** @@ -50,8 +54,8 @@ namespace etl { public: - flat_set_exception(const char* what) - : exception(what) + flat_set_exception(string_type what, string_type file_name, numeric_type line_number) + : exception(what, file_name, line_number) { } }; @@ -64,8 +68,8 @@ namespace etl { public: - flat_set_full() - : flat_set_exception("flat_set: full") + flat_set_full(string_type file_name, numeric_type line_number) + : flat_set_exception(ETL_ERROR_TEXT("flat_set:full", ETL_FILE"A"), file_name, line_number) { } }; @@ -78,8 +82,8 @@ namespace etl { public: - flat_set_out_of_bounds() - : flat_set_exception("flat_set: out of bounds") + flat_set_out_of_bounds(string_type file_name, numeric_type line_number) + : flat_set_exception(ETL_ERROR_TEXT("flat_set:bounds", ETL_FILE"B"), file_name, line_number) { } }; @@ -92,8 +96,8 @@ namespace etl { public: - flat_set_iterator() - : flat_set_exception("flat_set: iterator error") + flat_set_iterator(string_type file_name, numeric_type line_number) + : flat_set_exception(ETL_ERROR_TEXT("flat_set:iterator", ETL_FILE"C"), file_name, line_number) { } }; @@ -176,4 +180,6 @@ namespace etl }; } +#undef ETL_FILE + #endif diff --git a/private/forward_list_base.h b/private/forward_list_base.h index be7cb516..d742640e 100644 --- a/private/forward_list_base.h +++ b/private/forward_list_base.h @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove @@ -36,6 +37,10 @@ SOFTWARE. #include #include "../exception.h" +#include "../error_handler.h" + +#undef ETL_FILE +#define ETL_FILE "6" namespace etl { @@ -47,8 +52,8 @@ namespace etl { public: - forward_list_exception(const char* what) - : exception(what) + forward_list_exception(string_type what, string_type file_name, numeric_type line_number) + : exception(what, file_name, line_number) { } }; @@ -61,8 +66,8 @@ namespace etl { public: - forward_list_full() - : forward_list_exception("forward list: full") + forward_list_full(string_type file_name, numeric_type line_number) + : forward_list_exception(ETL_ERROR_TEXT("forward_list:full", ETL_FILE"A"), file_name, line_number) { } }; @@ -75,8 +80,8 @@ namespace etl { public: - forward_list_iterator() - : forward_list_exception("forward_list: iterator problem") + forward_list_iterator(string_type file_name, numeric_type line_number) + : forward_list_exception(ETL_ERROR_TEXT("forward_list:iterator", ETL_FILE"B"), file_name, line_number) { } }; @@ -240,4 +245,6 @@ namespace etl }; } +#undef ETL_FILE + #endif diff --git a/private/list_base.h b/private/list_base.h index f883fa8d..80e74a2d 100644 --- a/private/list_base.h +++ b/private/list_base.h @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove @@ -36,6 +37,10 @@ SOFTWARE. #include #include "../exception.h" +#include "../error_handler.h" + +#undef ETL_FILE +#define ETL_FILE "7" namespace etl { @@ -47,8 +52,8 @@ namespace etl { public: - list_exception(const char* what) - : exception(what) + list_exception(string_type what, string_type file_name, numeric_type line_number) + : exception(what, file_name, line_number) { } }; @@ -61,8 +66,8 @@ namespace etl { public: - list_full() - : list_exception("list: full") + list_full(string_type file_name, numeric_type line_number) + : list_exception(ETL_ERROR_TEXT("list:full", ETL_FILE"A"), file_name, line_number) { } }; @@ -75,8 +80,8 @@ namespace etl { public: - list_iterator() - : list_exception("list: iterator problem") + list_iterator(string_type file_name, numeric_type line_number) + : list_exception(ETL_ERROR_TEXT("list:iterator", ETL_FILE"B"), file_name, line_number) { } }; @@ -261,4 +266,6 @@ namespace etl }; } +#undef ETL_FILE + #endif diff --git a/private/map_base.h b/private/map_base.h index e04aa610..539554a1 100644 --- a/private/map_base.h +++ b/private/map_base.h @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove, rlindeman @@ -36,6 +37,10 @@ SOFTWARE. #include #include "../exception.h" +#include "../error_handler.h" + +#undef ETL_FILE +#define ETL_FILE "8" namespace etl { @@ -47,8 +52,8 @@ namespace etl { public: - map_exception(const char* what) - : exception(what) + map_exception(string_type what, string_type file_name, numeric_type line_number) + : exception(what, file_name, line_number) { } }; @@ -61,8 +66,8 @@ namespace etl { public: - map_full() - : map_exception("map: full") + map_full(string_type file_name, numeric_type line_number) + : map_exception("map:full", file_name, line_number) { } }; @@ -75,8 +80,8 @@ namespace etl { public: - map_out_of_bounds() - : map_exception("map: out of bounds") + map_out_of_bounds(string_type file_name, numeric_type line_number) + : map_exception("map:bounds", file_name, line_number) { } }; @@ -89,8 +94,8 @@ namespace etl { public: - map_iterator() - : map_exception("map: iterator problem") + map_iterator(string_type file_name, numeric_type line_number) + : map_exception("map:iterator", file_name, line_number) { } }; @@ -417,4 +422,6 @@ namespace etl }; } +#undef ETL_FILE + #endif diff --git a/private/multimap_base.h b/private/multimap_base.h index 7e7201a7..02b85f94 100644 --- a/private/multimap_base.h +++ b/private/multimap_base.h @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove, rlindeman @@ -36,6 +37,10 @@ SOFTWARE. #include #include "../exception.h" +#include "../error_handler.h" + +#undef ETL_FILE +#define ETL_FILE "9" namespace etl { @@ -47,8 +52,8 @@ namespace etl { public: - multimap_exception(const char* what) - : exception(what) + multimap_exception(string_type what, string_type file_name, numeric_type line_number) + : exception(what, file_name, line_number) { } }; @@ -61,8 +66,8 @@ namespace etl { public: - multimap_full() - : multimap_exception("multimap: full") + multimap_full(string_type file_name, numeric_type line_number) + : multimap_exception("multimap:full", file_name, line_number) { } }; @@ -75,8 +80,8 @@ namespace etl { public: - multimap_out_of_bounds() - : multimap_exception("multimap: out of bounds") + multimap_out_of_bounds(string_type file_name, numeric_type line_number) + : multimap_exception("multimap:bounds", file_name, line_number) { } }; @@ -89,8 +94,8 @@ namespace etl { public: - multimap_iterator() - : multimap_exception("multimap: iterator problem") + multimap_iterator(string_type file_name, numeric_type line_number) + : multimap_exception("multimap:iterator", file_name, line_number) { } }; diff --git a/private/multiset_base.h b/private/multiset_base.h index 6a13781a..5b9a1d36 100644 --- a/private/multiset_base.h +++ b/private/multiset_base.h @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2015 jwellbelove, rlindeman @@ -36,6 +37,10 @@ SOFTWARE. #include #include "../exception.h" +#include "../error_handler.h" + +#undef ETL_FILE +#define ETL_FILE "10" namespace etl { @@ -47,8 +52,8 @@ namespace etl { public: - multiset_exception(const char* what) - : exception(what) + multiset_exception(string_type what, string_type file_name, numeric_type line_number) + : exception(what, file_name, line_number) { } }; @@ -61,8 +66,8 @@ namespace etl { public: - multiset_full() - : multiset_exception("multiset: full") + multiset_full(string_type file_name, numeric_type line_number) + : multiset_exception(ETL_ERROR_TEXT("multiset:full", ETL_FILE"A"), file_name, line_number) { } }; @@ -75,8 +80,8 @@ namespace etl { public: - multiset_out_of_bounds() - : multiset_exception("multiset: out of bounds") + multiset_out_of_bounds(string_type file_name, numeric_type line_number) + : multiset_exception(ETL_ERROR_TEXT("multiset:bounds", ETL_FILE"B"), file_name, line_number) { } }; @@ -89,8 +94,8 @@ namespace etl { public: - multiset_iterator() - : multiset_exception("multiset: iterator problem") + multiset_iterator(string_type file_name, numeric_type line_number) + : multiset_exception(ETL_ERROR_TEXT("multiset:iterator", ETL_FILE"C"), file_name, line_number) { } }; @@ -577,4 +582,6 @@ namespace etl }; } +#undef ETL_FILE + #endif diff --git a/private/pool_base.h b/private/pool_base.h index 8011c049..b9aa7257 100644 --- a/private/pool_base.h +++ b/private/pool_base.h @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove @@ -38,6 +39,10 @@ SOFTWARE. #include "../exception.h" #include "../error_handler.h" +#include "../error_handler.h" + +#undef ETL_FILE +#define ETL_FILE "11" namespace etl { @@ -49,8 +54,8 @@ namespace etl { public: - pool_exception(const char* what) - : exception(what) + pool_exception(string_type what, string_type file_name, numeric_type line_number) + : exception(what, file_name, line_number) {} }; @@ -62,8 +67,8 @@ namespace etl { public: - pool_no_allocation() - : pool_exception("pool: no allocation") + explicit pool_no_allocation(string_type file_name, numeric_type line_number) + : pool_exception(ETL_ERROR_TEXT("pool:allocation", ETL_FILE"A"), file_name, line_number) {} }; @@ -75,8 +80,8 @@ namespace etl { public: - pool_object_not_in_pool() - : pool_exception("pool: not in pool") + pool_object_not_in_pool(string_type file_name, numeric_type line_number) + : pool_exception(ETL_ERROR_TEXT("pool:notinpool", ETL_FILE"B"), file_name, line_number) {} }; @@ -122,5 +127,8 @@ namespace etl const size_t MAX_SIZE; ///< The maximum number of objects that can be allocated. }; } + +#undef ETL_FILE + #endif diff --git a/private/priority_queue_base.h b/private/priority_queue_base.h index b9101ca2..9883663b 100644 --- a/private/priority_queue_base.h +++ b/private/priority_queue_base.h @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2015 jwellbelove, rlindeman @@ -37,6 +38,10 @@ SOFTWARE. #include #include "../exception.h" +#include "../error_handler.h" + +#undef ETL_FILE +#define ETL_FILE "12" namespace etl { @@ -48,8 +53,8 @@ namespace etl { public: - priority_queue_exception(const char* what) - : exception(what) + priority_queue_exception(string_type what, string_type file_name, numeric_type line_number) + : exception(what, file_name, line_number) { } }; @@ -62,8 +67,8 @@ namespace etl { public: - priority_queue_full() - : priority_queue_exception("priority_queue: full") + priority_queue_full(string_type file_name, numeric_type line_number) + : priority_queue_exception(ETL_ERROR_TEXT("priority_queue:full", ETL_FILE"A"), file_name, line_number) { } }; @@ -76,8 +81,8 @@ namespace etl { public: - priority_queue_iterator() - : priority_queue_exception("priority_queue: iterator error") + priority_queue_iterator(string_type file_name, numeric_type line_number) + : priority_queue_exception(ETL_ERROR_TEXT("priority_queue:iterator", ETL_FILE"B"), file_name, line_number) { } }; @@ -151,4 +156,6 @@ namespace etl }; } +#undef ETL_FILE + #endif diff --git a/private/queue_base.h b/private/queue_base.h index ede4c714..c7a0aadc 100644 --- a/private/queue_base.h +++ b/private/queue_base.h @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove @@ -37,6 +38,10 @@ SOFTWARE. #include #include "../exception.h" +#include "../error_handler.h" + +#undef ETL_FILE +#define ETL_FILE "13" namespace etl { @@ -48,8 +53,8 @@ namespace etl { public: - queue_exception(const char* what) - : exception(what) + queue_exception(string_type what, string_type file_name, numeric_type line_number) + : exception(what, file_name, line_number) { } }; @@ -62,8 +67,8 @@ namespace etl { public: - queue_full() - : queue_exception("queue: full") + queue_full(string_type file_name, numeric_type line_number) + : queue_exception(ETL_ERROR_TEXT("queue:full", ETL_FILE"A"), file_name, line_number) { } }; @@ -76,8 +81,8 @@ namespace etl { public: - queue_empty() - : queue_exception("queue: empty") + queue_empty(string_type file_name, numeric_type line_number) + : queue_exception(ETL_ERROR_TEXT("queue:empty", ETL_FILE"B"), file_name, line_number) { } }; @@ -155,4 +160,6 @@ namespace etl }; } +#undef ETL_FILE + #endif diff --git a/private/set_base.h b/private/set_base.h index 0fd097c5..32a72c2f 100644 --- a/private/set_base.h +++ b/private/set_base.h @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2015 jwellbelove, rlindeman @@ -36,6 +37,9 @@ SOFTWARE. #include #include "../exception.h" +#include "../error_handler.h" + +#define ETL_FILE "14" namespace etl { @@ -47,8 +51,8 @@ namespace etl { public: - set_exception(const char* what) - : exception(what) + set_exception(string_type what, string_type file_name, numeric_type line_number) + : exception(what, file_name, line_number) { } }; @@ -61,8 +65,8 @@ namespace etl { public: - set_full() - : set_exception("set: full") + set_full(string_type file_name, numeric_type line_number) + : set_exception(ETL_ERROR_TEXT("set:full", ETL_FILE"A"), file_name, line_number) { } }; @@ -75,8 +79,8 @@ namespace etl { public: - set_out_of_bounds() - : set_exception("set: out of bounds") + set_out_of_bounds(string_type file_name, numeric_type line_number) + : set_exception(ETL_ERROR_TEXT("set:bounds", ETL_FILE"B"), file_name, line_number) { } }; @@ -89,8 +93,8 @@ namespace etl { public: - set_iterator() - : set_exception("set: iterator problem") + set_iterator(string_type file_name, numeric_type line_number) + : set_exception(ETL_ERROR_TEXT("set:iterator problem", ETL_FILE"C"), file_name, line_number) { } }; @@ -418,4 +422,6 @@ namespace etl }; } +#undef ETL_FILE + #endif diff --git a/private/stack_base.h b/private/stack_base.h index 6c104b84..790b8f3b 100644 --- a/private/stack_base.h +++ b/private/stack_base.h @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove @@ -37,6 +38,9 @@ SOFTWARE. #include #include "../exception.h" +#include "../error_handler.h" + +#define ETL_FILE "15" namespace etl { @@ -48,8 +52,8 @@ namespace etl { public: - stack_exception(const char* what) - : exception(what) + stack_exception(string_type what, string_type file_name, numeric_type line_number) + : exception(what, file_name, line_number) { } }; @@ -62,8 +66,8 @@ namespace etl { public: - stack_full() - : stack_exception("stack: full") + stack_full(string_type file_name, numeric_type line_number) + : stack_exception(ETL_ERROR_TEXT("stack: full", ETL_FILE"A"), file_name, line_number) { } }; @@ -140,4 +144,6 @@ namespace etl }; } +#undef ETL_FILE + #endif diff --git a/private/unordered_map_base.h b/private/unordered_map_base.h index 1b34a088..bc9b4716 100644 --- a/private/unordered_map_base.h +++ b/private/unordered_map_base.h @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove @@ -36,6 +37,9 @@ SOFTWARE. #include #include "../exception.h" +#include "../error_handler.h" + +#define ETL_FILE "16" namespace etl { @@ -47,8 +51,8 @@ namespace etl { public: - unordered_map_exception(const char* what) - : exception(what) + unordered_map_exception(string_type what, string_type file_name, numeric_type line_number) + : exception(what, file_name, line_number) { } }; @@ -61,8 +65,8 @@ namespace etl { public: - unordered_map_full() - : unordered_map_exception("unordered_map: full") + unordered_map_full(string_type file_name, numeric_type line_number) + : unordered_map_exception(ETL_ERROR_TEXT("unordered_map:full", ETL_FILE"A"), file_name, line_number) { } }; @@ -75,8 +79,8 @@ namespace etl { public: - unordered_map_out_of_range() - : unordered_map_exception("unordered_map: out of range") + unordered_map_out_of_range(string_type file_name, numeric_type line_number) + : unordered_map_exception(ETL_ERROR_TEXT("unordered_map:range", ETL_FILE"B"), file_name, line_number) {} }; @@ -88,8 +92,8 @@ namespace etl { public: - unordered_map_iterator() - : unordered_map_exception("unordered_map: iterator problem") + unordered_map_iterator(string_type file_name, numeric_type line_number) + : unordered_map_exception("unordered_map:iterator", file_name, line_number) { } }; @@ -161,4 +165,6 @@ namespace etl }; } +#undef ETL_FILE + #endif diff --git a/private/vector_base.h b/private/vector_base.h index c8e4de91..2d3fc8c6 100644 --- a/private/vector_base.h +++ b/private/vector_base.h @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove @@ -39,6 +40,8 @@ SOFTWARE. #include "../exception.h" #include "../error_handler.h" +#define ETL_FILE "17" + namespace etl { //*************************************************************************** @@ -49,8 +52,8 @@ namespace etl { public: - vector_exception(const char* what) - : exception(what) + vector_exception(string_type what, string_type file_name, numeric_type line_number) + : exception(what, file_name, line_number) { } }; @@ -63,8 +66,8 @@ namespace etl { public: - vector_full() - : vector_exception("vector: full") + vector_full(string_type file_name, numeric_type line_number) + : vector_exception(ETL_ERROR_TEXT("vector:full", ETL_FILE"0"), file_name, line_number) { } }; @@ -77,8 +80,8 @@ namespace etl { public: - vector_out_of_bounds() - : vector_exception("vector: out of bounds") + vector_out_of_bounds(string_type file_name, numeric_type line_number) + : vector_exception(ETL_ERROR_TEXT("vector:bounds", ETL_FILE"1"), file_name, line_number) { } }; @@ -91,8 +94,8 @@ namespace etl { public: - vector_iterator() - : vector_exception("vector: iterator error") + vector_iterator(string_type file_name, numeric_type line_number) + : vector_exception(ETL_ERROR_TEXT("vector:iterator", ETL_FILE"2"), file_name, line_number) { } }; @@ -177,4 +180,6 @@ namespace etl }; } +#undef ETL_FILE + #endif diff --git a/queue.h b/queue.h index 806ee730..17cdc338 100644 --- a/queue.h +++ b/queue.h @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/radix.h b/radix.h index c33bf5d2..108cf923 100644 --- a/radix.h +++ b/radix.h @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/set.h b/set.h index ea74819e..acb9812a 100644 --- a/set.h +++ b/set.h @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove, rlindeman diff --git a/smallest.h b/smallest.h index 2a22b708..c234a2b3 100644 --- a/smallest.h +++ b/smallest.h @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/stack.h b/stack.h index ef6922f9..86a43d39 100644 --- a/stack.h +++ b/stack.h @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/static_assert.h b/static_assert.h index 1055e4a6..f49606c8 100644 --- a/static_assert.h +++ b/static_assert.h @@ -3,6 +3,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/test/data.h b/test/data.h index ddc0b43b..22c46381 100644 --- a/test/data.h +++ b/test/data.h @@ -3,6 +3,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/test/test_algorithm.cpp b/test/test_algorithm.cpp index c4bf049d..149bb349 100644 --- a/test/test_algorithm.cpp +++ b/test/test_algorithm.cpp @@ -3,6 +3,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/test/test_alignment.cpp b/test/test_alignment.cpp index 79fcf541..0e2de31d 100644 --- a/test/test_alignment.cpp +++ b/test/test_alignment.cpp @@ -3,6 +3,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/test/test_array.cpp b/test/test_array.cpp index d3005d1e..c521518c 100644 --- a/test/test_array.cpp +++ b/test/test_array.cpp @@ -3,6 +3,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/test/test_basic_intrusive_forward_list.cpp b/test/test_basic_intrusive_forward_list.cpp index 30ee12d1..7d678a45 100644 --- a/test/test_basic_intrusive_forward_list.cpp +++ b/test/test_basic_intrusive_forward_list.cpp @@ -3,6 +3,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2015 jwellbelove diff --git a/test/test_binary.cpp b/test/test_binary.cpp index 63a5a7bd..11a27e20 100644 --- a/test/test_binary.cpp +++ b/test/test_binary.cpp @@ -3,6 +3,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/test/test_bitset.cpp b/test/test_bitset.cpp index c6e4d333..c09635b4 100644 --- a/test/test_bitset.cpp +++ b/test/test_bitset.cpp @@ -3,6 +3,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/test/test_bloom_filter.cpp b/test/test_bloom_filter.cpp index 19e29ee3..aebaa7ba 100644 --- a/test/test_bloom_filter.cpp +++ b/test/test_bloom_filter.cpp @@ -3,6 +3,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/test/test_bsd_checksum.cpp b/test/test_bsd_checksum.cpp index cbd53c1d..1c0991eb 100644 --- a/test/test_bsd_checksum.cpp +++ b/test/test_bsd_checksum.cpp @@ -3,6 +3,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/test/test_checksum.cpp b/test/test_checksum.cpp index 88897695..03ec5b5e 100644 --- a/test/test_checksum.cpp +++ b/test/test_checksum.cpp @@ -3,6 +3,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/test/test_compile.cpp b/test/test_compile.cpp index 9cd4f01b..ba418f68 100644 --- a/test/test_compile.cpp +++ b/test/test_compile.cpp @@ -1,5 +1,3 @@ - - #include "algorithm.h" #include "alignment.h" #include "array.h" diff --git a/test/test_container.cpp b/test/test_container.cpp index 52cdb22f..6d86e82a 100644 --- a/test/test_container.cpp +++ b/test/test_container.cpp @@ -3,6 +3,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/test/test_crc.cpp b/test/test_crc.cpp index 23f23ac8..1f3a0029 100644 --- a/test/test_crc.cpp +++ b/test/test_crc.cpp @@ -3,6 +3,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/test/test_cyclic_value.cpp b/test/test_cyclic_value.cpp index 6531e68b..bd42dae3 100644 --- a/test/test_cyclic_value.cpp +++ b/test/test_cyclic_value.cpp @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/test/test_deque.cpp b/test/test_deque.cpp index 7ea2f25d..52044f05 100644 --- a/test/test_deque.cpp +++ b/test/test_deque.cpp @@ -3,6 +3,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/test/test_endian.cpp b/test/test_endian.cpp index f6e3ba69..a08f78ed 100644 --- a/test/test_endian.cpp +++ b/test/test_endian.cpp @@ -3,6 +3,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/test/test_enum_type.cpp b/test/test_enum_type.cpp index b721aa79..0e7ed36f 100644 --- a/test/test_enum_type.cpp +++ b/test/test_enum_type.cpp @@ -3,6 +3,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/test/test_error_handler.cpp b/test/test_error_handler.cpp index 3972b39d..a7c6549c 100644 --- a/test/test_error_handler.cpp +++ b/test/test_error_handler.cpp @@ -3,6 +3,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove @@ -26,6 +27,9 @@ SOFTWARE. ******************************************************************************/ #include +#include +#include +#include #include "../error_handler.h" #include "../exception.h" @@ -39,8 +43,8 @@ class test_exception : public etl::exception { public: - test_exception() - : exception("test_exception") + test_exception(string_type file_name, numeric_type line_number) + : exception(ETL_ERROR_TEXT("test_exception", "123"), file_name, line_number) { error_received = false; } @@ -49,9 +53,19 @@ public: //***************************************************************************** // A free error handler function. //***************************************************************************** -void receive_error(const etl::exception&) +void receive_error(const etl::exception& e) { error_received = true; + std::ostringstream oss; + oss << "Error '" << e.what() << "' in " << e.file_name() << " at line " << e.line_number() << "\n"; + + std::string stext = oss.str(); + + WCHAR text[200]; + MultiByteToWideChar(0, 0, stext.c_str(), stext.size() + 1, text, 200); + LPCWSTR ltext = text; + + OutputDebugString(ltext); } //***************************************************************************** @@ -62,9 +76,19 @@ public: //*************************************************************************** // A member error handler function. //*************************************************************************** - void receive_error(const etl::exception&) + void receive_error(const etl::exception& e) { error_received = true; + std::ostringstream oss; + oss << "Error '" << e.what() << "' in " << e.file_name() << " at line " << e.line_number() << "\n"; + + std::string stext = oss.str(); + + WCHAR text[200]; + MultiByteToWideChar(0, 0, stext.c_str(), stext.size() + 1, text, 200); + LPCWSTR ltext = text; + + OutputDebugString(ltext); } }; @@ -82,7 +106,7 @@ namespace etl::error_handler::set_callback(error_callback); // Log an error. - etl::error_handler::error(test_exception()); + etl::error_handler::error(ETL_ERROR(test_exception)); CHECK(error_received); } @@ -100,7 +124,7 @@ namespace etl::error_handler::set_callback(error_callback); // Log an error. - etl::error_handler::error(test_exception()); + etl::error_handler::error(ETL_ERROR(test_exception)); CHECK(error_received); } diff --git a/test/test_exception.cpp b/test/test_exception.cpp index eed7b7c0..1301c07f 100644 --- a/test/test_exception.cpp +++ b/test/test_exception.cpp @@ -3,6 +3,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove @@ -37,15 +38,21 @@ namespace //************************************************************************* TEST(test_constructor) { - etl::exception e("An exception"); + etl::exception e("An exception", "Some file", 123); + + std::string what(e.what()); + std::string file(e.file_name()); + int line(e.line_number()); CHECK_EQUAL(std::string("An exception"), std::string(e.what())); + CHECK_EQUAL(std::string("Some file"), std::string(e.file_name())); + CHECK_EQUAL(123, e.line_number()); } //************************************************************************* TEST(test_exception) { - etl::exception e("An exception"); + etl::exception e("An exception", "Some file", 123); try { @@ -53,7 +60,13 @@ namespace } catch (etl::exception& c) { + std::string what(c.what()); + std::string file(c.file_name()); + int line(c.line_number()); + CHECK_EQUAL(std::string("An exception"), std::string(c.what())); + CHECK_EQUAL(std::string("Some file"), std::string(c.file_name())); + CHECK_EQUAL(123, c.line_number()); } } }; diff --git a/test/test_fixed_iterator.cpp b/test/test_fixed_iterator.cpp index ad5ee691..635475fc 100644 --- a/test/test_fixed_iterator.cpp +++ b/test/test_fixed_iterator.cpp @@ -3,6 +3,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/test/test_flat_map.cpp b/test/test_flat_map.cpp index e01c51be..648c1383 100644 --- a/test/test_flat_map.cpp +++ b/test/test_flat_map.cpp @@ -3,6 +3,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/test/test_flat_multimap.cpp b/test/test_flat_multimap.cpp index cc87ddb6..e3753c70 100644 --- a/test/test_flat_multimap.cpp +++ b/test/test_flat_multimap.cpp @@ -3,6 +3,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2015 jwellbelove diff --git a/test/test_flat_multiset.cpp b/test/test_flat_multiset.cpp index c14b556c..d26d0974 100644 --- a/test/test_flat_multiset.cpp +++ b/test/test_flat_multiset.cpp @@ -3,6 +3,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2015 jwellbelove diff --git a/test/test_flat_set.cpp b/test/test_flat_set.cpp index 0449553f..8cc29013 100644 --- a/test/test_flat_set.cpp +++ b/test/test_flat_set.cpp @@ -3,6 +3,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2015 jwellbelove diff --git a/test/test_fnv_1.cpp b/test/test_fnv_1.cpp index c953e6d5..20830beb 100644 --- a/test/test_fnv_1.cpp +++ b/test/test_fnv_1.cpp @@ -3,6 +3,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/test/test_forward_list.cpp b/test/test_forward_list.cpp index cc3a08f6..51d274ea 100644 --- a/test/test_forward_list.cpp +++ b/test/test_forward_list.cpp @@ -3,6 +3,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/test/test_function.cpp b/test/test_function.cpp index a79dd68f..7b147734 100644 --- a/test/test_function.cpp +++ b/test/test_function.cpp @@ -3,6 +3,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/test/test_functional.cpp b/test/test_functional.cpp index 9b4a2923..01c7fcb3 100644 --- a/test/test_functional.cpp +++ b/test/test_functional.cpp @@ -3,6 +3,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/test/test_hash.cpp b/test/test_hash.cpp index 21f795c1..8d0bac99 100644 --- a/test/test_hash.cpp +++ b/test/test_hash.cpp @@ -3,6 +3,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/test/test_instance_count.cpp b/test/test_instance_count.cpp index cbcfed07..3295fa68 100644 --- a/test/test_instance_count.cpp +++ b/test/test_instance_count.cpp @@ -3,6 +3,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/test/test_integral_limits.cpp b/test/test_integral_limits.cpp index ca149f52..7dcdf841 100644 --- a/test/test_integral_limits.cpp +++ b/test/test_integral_limits.cpp @@ -3,6 +3,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/test/test_intrusive_forward_list.cpp b/test/test_intrusive_forward_list.cpp index a8472c16..82ec2a6a 100644 --- a/test/test_intrusive_forward_list.cpp +++ b/test/test_intrusive_forward_list.cpp @@ -3,6 +3,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2015 jwellbelove diff --git a/test/test_io_port.cpp b/test/test_io_port.cpp index c3406e63..7f8bdaaf 100644 --- a/test/test_io_port.cpp +++ b/test/test_io_port.cpp @@ -3,6 +3,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/test/test_jenkins.cpp b/test/test_jenkins.cpp index 7f119e26..7bc96f1e 100644 --- a/test/test_jenkins.cpp +++ b/test/test_jenkins.cpp @@ -3,6 +3,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/test/test_largest.cpp b/test/test_largest.cpp index 90c053f2..9120d242 100644 --- a/test/test_largest.cpp +++ b/test/test_largest.cpp @@ -3,6 +3,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/test/test_list.cpp b/test/test_list.cpp index 2fe5a404..f795b61b 100644 --- a/test/test_list.cpp +++ b/test/test_list.cpp @@ -3,6 +3,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/test/test_map.cpp b/test/test_map.cpp index b39b10ff..d783bcc0 100644 --- a/test/test_map.cpp +++ b/test/test_map.cpp @@ -3,6 +3,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove, rlindeman diff --git a/test/test_maths.cpp b/test/test_maths.cpp index 8c12ed5d..82a879ad 100644 --- a/test/test_maths.cpp +++ b/test/test_maths.cpp @@ -3,6 +3,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/test/test_multimap.cpp b/test/test_multimap.cpp index 180ce8d0..1f8087bf 100644 --- a/test/test_multimap.cpp +++ b/test/test_multimap.cpp @@ -3,6 +3,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove, rlindeman diff --git a/test/test_multiset.cpp b/test/test_multiset.cpp index 7ba863ef..9c83ab16 100644 --- a/test/test_multiset.cpp +++ b/test/test_multiset.cpp @@ -3,6 +3,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove, rlindeman diff --git a/test/test_murmur3.cpp b/test/test_murmur3.cpp index c2a76903..87d28337 100644 --- a/test/test_murmur3.cpp +++ b/test/test_murmur3.cpp @@ -3,6 +3,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/test/test_numeric.cpp b/test/test_numeric.cpp index 17b5e1cf..58f50f32 100644 --- a/test/test_numeric.cpp +++ b/test/test_numeric.cpp @@ -3,6 +3,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/test/test_observer.cpp b/test/test_observer.cpp index 26b6dcc5..43750bad 100644 --- a/test/test_observer.cpp +++ b/test/test_observer.cpp @@ -3,6 +3,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/test/test_optional.cpp b/test/test_optional.cpp index 4714e578..17399bc7 100644 --- a/test/test_optional.cpp +++ b/test/test_optional.cpp @@ -3,6 +3,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2015 jwellbelove diff --git a/test/test_pearson.cpp b/test/test_pearson.cpp index 3acf0b58..638ab3e5 100644 --- a/test/test_pearson.cpp +++ b/test/test_pearson.cpp @@ -3,6 +3,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2015 jwellbelove diff --git a/test/test_pool.cpp b/test/test_pool.cpp index d3569ae6..e803934f 100644 --- a/test/test_pool.cpp +++ b/test/test_pool.cpp @@ -3,6 +3,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/test/test_priority_queue.cpp b/test/test_priority_queue.cpp index 37428ecb..e98d3441 100644 --- a/test/test_priority_queue.cpp +++ b/test/test_priority_queue.cpp @@ -3,6 +3,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2015 jwellbelove, rlindeman diff --git a/test/test_queue.cpp b/test/test_queue.cpp index c5d6d643..610f94db 100644 --- a/test/test_queue.cpp +++ b/test/test_queue.cpp @@ -3,6 +3,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/test/test_set.cpp b/test/test_set.cpp index fff3dbf1..aa6c1835 100644 --- a/test/test_set.cpp +++ b/test/test_set.cpp @@ -3,6 +3,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove, rlindeman diff --git a/test/test_smallest.cpp b/test/test_smallest.cpp index ccbbd4ec..9c5f4758 100644 --- a/test/test_smallest.cpp +++ b/test/test_smallest.cpp @@ -3,6 +3,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/test/test_stack.cpp b/test/test_stack.cpp index 2f9fcb17..5f36880e 100644 --- a/test/test_stack.cpp +++ b/test/test_stack.cpp @@ -3,6 +3,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/test/test_type_traits.cpp b/test/test_type_traits.cpp index 2d37ed19..5fc02df0 100644 --- a/test/test_type_traits.cpp +++ b/test/test_type_traits.cpp @@ -3,6 +3,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/test/test_variant.cpp b/test/test_variant.cpp index 04893031..bf7d580a 100644 --- a/test/test_variant.cpp +++ b/test/test_variant.cpp @@ -3,6 +3,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/test/test_vector.cpp b/test/test_vector.cpp index bdd2ca47..d5feb40a 100644 --- a/test/test_vector.cpp +++ b/test/test_vector.cpp @@ -3,6 +3,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/test/test_visitor.cpp b/test/test_visitor.cpp index c48e6432..22826a32 100644 --- a/test/test_visitor.cpp +++ b/test/test_visitor.cpp @@ -3,6 +3,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/test/vs2015/etl.vcxproj b/test/vs2015/etl.vcxproj index 02afd28c..0b68cb71 100644 --- a/test/vs2015/etl.vcxproj +++ b/test/vs2015/etl.vcxproj @@ -53,7 +53,7 @@ Level3 Disabled - WIN32;_DEBUG;_CONSOLE;_LIB;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;ETL_THROW_EXCEPTIONS;PLATFORM_WINDOWS;COMPILER_MICROSOFT;%(PreprocessorDefinitions) + WIN32;_DEBUG;_CONSOLE;_LIB;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;ETL_THROW_EXCEPTIONS;PLATFORM_WINDOWS;COMPILER_MICROSOFT;ETL_VERBOSE_ERRORS;%(PreprocessorDefinitions) ../../../unittest-cpp @@ -329,8 +329,6 @@ - - diff --git a/test/vs2015/etl.vcxproj.filters b/test/vs2015/etl.vcxproj.filters index afa8a437..5f36ee24 100644 --- a/test/vs2015/etl.vcxproj.filters +++ b/test/vs2015/etl.vcxproj.filters @@ -718,7 +718,5 @@ Header Files - - \ No newline at end of file diff --git a/type_traits.h b/type_traits.h index 84c26c05..5c527838 100644 --- a/type_traits.h +++ b/type_traits.h @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/variant.h b/variant.h index 326d5f10..3cad72d7 100644 --- a/variant.h +++ b/variant.h @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove @@ -73,8 +74,8 @@ namespace etl class variant_exception : public exception { public: - variant_exception(const char* what) - : exception(what) + variant_exception(string_type what, string_type file_name, numeric_type line_number) + : exception(what, file_name, line_number) { } }; @@ -86,8 +87,8 @@ namespace etl class variant_incorrect_type_exception : public variant_exception { public: - variant_incorrect_type_exception() - : variant_exception("variant: unsupported type") + variant_incorrect_type_exception(string_type file_name, numeric_type line_number) + : variant_exception("variant: unsupported type", file_name, line_number) { } }; @@ -99,8 +100,8 @@ namespace etl class variant_invalid_type_id_exception : public variant_exception { public: - variant_invalid_type_id_exception() - : variant_exception("variant: invalid type id") + variant_invalid_type_id_exception(string_type file_name, numeric_type line_number) + : variant_exception("variant: invalid type id", file_name, line_number) { } }; @@ -444,7 +445,7 @@ namespace etl case 6: return reinterpret_cast(*p_data); case 7: return reinterpret_cast(*p_data); default: - ETL_ASSERT(false, variant_invalid_type_id_exception()); + ETL_ASSERT(false, ETL_ERROR(variant_invalid_type_id_exception)); return reinterpret_cast(*p_data); break; } @@ -463,7 +464,7 @@ namespace etl case 6: return reinterpret_cast(*p_data); case 7: return reinterpret_cast(*p_data); default: - ETL_ASSERT(false, variant_invalid_type_id_exception()); + ETL_ASSERT(false, ETL_ERROR(variant_invalid_type_id_exception)); return reinterpret_cast(*p_data); break; } @@ -490,7 +491,7 @@ namespace etl case 5: return reinterpret_cast(*p_data); case 6: return reinterpret_cast(*p_data); default: - ETL_ASSERT(false, variant_invalid_type_id_exception()); + ETL_ASSERT(false, ETL_ERROR(variant_invalid_type_id_exception)); return reinterpret_cast(*p_data); break; } @@ -508,7 +509,7 @@ namespace etl case 5: return reinterpret_cast(*p_data); case 6: return reinterpret_cast(*p_data); default: - ETL_ASSERT(false, variant_invalid_type_id_exception()); + ETL_ASSERT(false, ETL_ERROR(variant_invalid_type_id_exception)); return reinterpret_cast(*p_data); break; } @@ -534,7 +535,7 @@ namespace etl case 4: return reinterpret_cast(*p_data); case 5: return reinterpret_cast(*p_data); default: - ETL_ASSERT(false, variant_invalid_type_id_exception()); + ETL_ASSERT(false, ETL_ERROR(variant_invalid_type_id_exception)); return reinterpret_cast(*p_data); break; } @@ -551,7 +552,7 @@ namespace etl case 4: return reinterpret_cast(*p_data); case 5: return reinterpret_cast(*p_data); default: - ETL_ASSERT(false, variant_invalid_type_id_exception()); + ETL_ASSERT(false, ETL_ERROR(variant_invalid_type_id_exception)); return reinterpret_cast(*p_data); break; } @@ -576,7 +577,7 @@ namespace etl case 3: return reinterpret_cast(*p_data); case 4: return reinterpret_cast(*p_data); default: - ETL_ASSERT(false, variant_invalid_type_id_exception()); + ETL_ASSERT(false, ETL_ERROR(variant_invalid_type_id_exception)); return reinterpret_cast(*p_data); break; } @@ -592,7 +593,7 @@ namespace etl case 3: return reinterpret_cast(*p_data); case 4: return reinterpret_cast(*p_data); default: - ETL_ASSERT(false, variant_invalid_type_id_exception()); + ETL_ASSERT(false, ETL_ERROR(variant_invalid_type_id_exception)); return reinterpret_cast(*p_data); break; } @@ -616,7 +617,7 @@ namespace etl case 2: return reinterpret_cast(*p_data); case 3: return reinterpret_cast(*p_data); default: - ETL_ASSERT(false, variant_invalid_type_id_exception()); + ETL_ASSERT(false, ETL_ERROR(variant_invalid_type_id_exception)); return reinterpret_cast(*p_data); break; } @@ -631,7 +632,7 @@ namespace etl case 2: return reinterpret_cast(*p_data); case 3: return reinterpret_cast(*p_data); default: - ETL_ASSERT(false, variant_invalid_type_id_exception()); + ETL_ASSERT(false, ETL_ERROR(variant_invalid_type_id_exception)); return reinterpret_cast(*p_data); break; } @@ -654,7 +655,7 @@ namespace etl case 1: return reinterpret_cast(*p_data); case 2: return reinterpret_cast(*p_data); default: - ETL_ASSERT(false, variant_invalid_type_id_exception()); + ETL_ASSERT(false, ETL_ERROR(variant_invalid_type_id_exception)); return reinterpret_cast(*p_data); break; } @@ -668,7 +669,7 @@ namespace etl case 1: return reinterpret_cast(*p_data); case 2: return reinterpret_cast(*p_data); default: - ETL_ASSERT(false, variant_invalid_type_id_exception()); + ETL_ASSERT(false, ETL_ERROR(variant_invalid_type_id_exception)); return reinterpret_cast(*p_data); break; } @@ -690,7 +691,7 @@ namespace etl case 0: return reinterpret_cast(*p_data); case 1: return reinterpret_cast(*p_data); default: - ETL_ASSERT(false, variant_invalid_type_id_exception()); + ETL_ASSERT(false, ETL_ERROR(variant_invalid_type_id_exception)); return reinterpret_cast(*p_data); break; } @@ -703,7 +704,7 @@ namespace etl case 0: return reinterpret_cast(*p_data); case 1: return reinterpret_cast(*p_data); default: - ETL_ASSERT(false, variant_invalid_type_id_exception()); + ETL_ASSERT(false, ETL_ERROR(variant_invalid_type_id_exception)); return reinterpret_cast(*p_data); break; } @@ -724,7 +725,7 @@ namespace etl { case 0: return reinterpret_cast(*p_data); default: - ETL_ASSERT(false, variant_invalid_type_id_exception()); + ETL_ASSERT(false, ETL_ERROR(variant_invalid_type_id_exception)); return reinterpret_cast(*p_data); break; } @@ -736,7 +737,7 @@ namespace etl { case 0: return reinterpret_cast(*p_data); default: - ETL_ASSERT(false, variant_invalid_type_id_exception()); + ETL_ASSERT(false, ETL_ERROR(variant_invalid_type_id_exception)); return reinterpret_cast(*p_data); break; } @@ -825,7 +826,7 @@ namespace etl case 6: is_same_type = type_id == Type_Id_Lookup::type_id; break; case 7: is_same_type = type_id == Type_Id_Lookup::type_id; break; default: - ETL_ASSERT(false, variant_invalid_type_id_exception()); + ETL_ASSERT(false, ETL_ERROR(variant_invalid_type_id_exception)); break; } @@ -849,7 +850,7 @@ namespace etl case 6: reader.read(static_cast(data)); break; case 7: reader.read(static_cast(data)); break; default: - ETL_ASSERT(false, variant_invalid_type_id_exception()); + ETL_ASSERT(false, ETL_ERROR(variant_invalid_type_id_exception)); break; } } @@ -890,7 +891,7 @@ namespace etl T& get() { STATIC_ASSERT(Type_Is_Supported::value, "Unsupported type"); - ETL_ASSERT(is_type(), variant_incorrect_type_exception()); + ETL_ASSERT(is_type(), ETL_ERROR(variant_incorrect_type_exception)); return static_cast(data); } @@ -904,7 +905,7 @@ namespace etl const T& get() const { STATIC_ASSERT(Type_Is_Supported::value, "Unsupported type"); - ETL_ASSERT(is_type(), variant_incorrect_type_exception()); + ETL_ASSERT(is_type(), ETL_ERROR(variant_incorrect_type_exception)); return static_cast(data); } diff --git a/vector.h b/vector.h index fd679dee..9043e874 100644 --- a/vector.h +++ b/vector.h @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove diff --git a/visitor.h b/visitor.h index c624b880..c7af3547 100644 --- a/visitor.h +++ b/visitor.h @@ -5,6 +5,7 @@ The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl +http://www.etlcpp.com Copyright(c) 2014 jwellbelove