From d8d24b75095261688ad8e51cab0a286827370fbc Mon Sep 17 00:00:00 2001 From: "EXPROGROUP\\john.wellbelove" Date: Fri, 2 Mar 2018 10:00:58 +0000 Subject: [PATCH 1/9] Experimental spsc queue --- src/experimental/atomic.h | 56 ++++++++++++++++++++++++++++++++++ src/experimental/spsc_queue.h | 57 +++++++++++++++++++++++++++++++++++ 2 files changed, 113 insertions(+) create mode 100644 src/experimental/atomic.h create mode 100644 src/experimental/spsc_queue.h diff --git a/src/experimental/atomic.h b/src/experimental/atomic.h new file mode 100644 index 00000000..48669852 --- /dev/null +++ b/src/experimental/atomic.h @@ -0,0 +1,56 @@ +/****************************************************************************** +The MIT License(MIT) + +Embedded Template Library. +https://github.com/ETLCPP/etl +https://www.etlcpp.com + +Copyright(c) 2017 jwellbelove + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files(the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and / or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions : + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +******************************************************************************/ + +#ifndef __ETL_ATOMIC__ +#define __ETL_ATOMIC__ + +#include "platform.h" + +#if ETL_ATOMIC_SUPPORTED == 1 + #include + + namespace etl + { + typedef std::atomic atomic_uint32_t; + } + #define ETL_CPP11_ATOMIC_AVAILABLE 1 +#elif defined(ETL_COMPILER_ARM) + #include "atomic/atomic_arm.h" + #define ETL_ETL_ATOMIC_AVAILABLE 1 +#elif defined(ETL_COMPILER_GCC) + #include "atomic/atomic_gcc.h" + #define ETL_ATOMIC_AVAILABLE 1 +#elif defined(ETL_COMPILER_MSVC) + #include "atomic/atomic_windows.h" + #define ETL_ATOMIC_AVAILABLE 1 +#else + #warning NO ATOMIC SUPPORT DEFINED! + #define ETL_ATOMIC_AVAILABLE 0 +#endif + +#endif diff --git a/src/experimental/spsc_queue.h b/src/experimental/spsc_queue.h new file mode 100644 index 00000000..253d5db1 --- /dev/null +++ b/src/experimental/spsc_queue.h @@ -0,0 +1,57 @@ + +#include "platform.h" + +#include "atomic.h" + +struct spsc_queue_implementation +{ + enum + { + UNKNOWN, + STD_ATOMIC, + ETL_ATOMIC, + CMSIS_RTOS2, + FREERTOS, + GCC, + WIN32 + }; +}; + +template +class ispsc_queue; + +template +class spsc_queue : public ispsc_queue; + +#if ETL_ATOMIC_AVAILABLE +template +class ispsc_queue +{ + +}; + +template +class spsc_queue + : public ispsc_queue +{ + +}; +#endif + +#if ETL_OPERATING_SYSTEM == ETL_CMSIS_RTOS2 +template +class spsc_queue + : public ispsc_queue +{ + +}; +#endif + +#if ETL_OPERATING_SYSTEM == ETL_FREERTOS +template +class spsc_queue + : public ispsc_queue +{ + +}; +#endif From 2d43d1baf374ec4399f6849aafe74c2e2989257d Mon Sep 17 00:00:00 2001 From: John Wellbelove Date: Thu, 1 Mar 2018 09:52:14 +0000 Subject: [PATCH 2/9] Removed redundant template function --- src/utility.h | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/src/utility.h b/src/utility.h index db6aa911..8c96f1be 100644 --- a/src/utility.h +++ b/src/utility.h @@ -39,17 +39,6 @@ SOFTWARE. namespace etl { - //*************************************************************************** - /// exchange - //*************************************************************************** - template - T exchange(T& object, U& new_value) - { - T old_value = object; - object = new_value; - return old_value; - } - //*************************************************************************** /// exchange (const) //*************************************************************************** From 224df730c32313f0a4a5de320b69197c7c24f563 Mon Sep 17 00:00:00 2001 From: John Wellbelove Date: Sun, 18 Mar 2018 14:13:24 +0000 Subject: [PATCH 3/9] Merge remote-tracking branch 'origin/master' into development --- CMakeLists.txt | 65 +++++ src/profiles/etl_profile.h | 60 ++++ test/codeblocks/ETL.layout | 585 ------------------------------------- 3 files changed, 125 insertions(+), 585 deletions(-) create mode 100644 CMakeLists.txt create mode 100644 src/profiles/etl_profile.h delete mode 100644 test/codeblocks/ETL.layout diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 00000000..8b2b698a --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,65 @@ +####################################################################### +# The Embedded Template Library (https://www.etlcpp.com/) +####################################################################### +cmake_minimum_required(VERSION 3.5.0) +project(etl) + +####################################################################### +# Define an option to allow consumers of the library to +# specify the profile they would like to compile to. If +# not explicitly set CMake will attempt to choose an appropriate +# profile based on the compiler +####################################################################### +set(ETL_PROFILE "DEFAULT" CACHE STRING "Defines what profile header to include. See https://www.etlcpp.com/setup.html" +) + +add_library(etl + src/binary.cpp + src/crc16_ccitt.cpp + src/crc16_kermit.cpp + src/crc32.cpp + src/crc64_ecma.cpp + src/crc8_ccitt.cpp + src/error_handler.cpp + src/pearson.cpp + src/random.cpp + src/private + src/private/pvoidvector.cpp + ) +target_include_directories(etl + PUBLIC + src/ + src/atomic + src/profiles + PRIVATE + src/private + ) + +if (${ETL_PROFILE} STREQUAL DEFAULT) + if (CMAKE_CXX_COMPILER_ID MATCHES "GNU") + set(ETL_PROFILE "PROFILE_GCC_GENERIC") + + elseif (CMAKE_CXX_COMPILER_ID MATCHES "MSVC") + set(ETL_PROFILE "PROFILE_MSVC") + + elseif (CMAKE_CXX_COMPILER_ID MATCHES "ARMCC") + if (CXX_STANDARD EQUAL 11) + set(ETL_PROFILE "PROFILE_ARMV6") + else () + set(ETL_PROFILE "PROFILE_ARMV5") + endif() + elseif (CMAKE_CXX_COMPILER_ID MATCHES "TI") + set(ETL_PROFILE "PROFILE_TICC") + + else() + message(FATAL_ERROR "Can't generate default profile for compiler: ${CMAKE_CXX_COMPILER_ID}") + endif() +endif() + +message(STATUS "Compiling with ETL profile set to: ${ETL_PROFILE}") + +target_compile_definitions(etl + PUBLIC + ${ETL_PROFILE} + ) + diff --git a/src/profiles/etl_profile.h b/src/profiles/etl_profile.h new file mode 100644 index 00000000..45596b1a --- /dev/null +++ b/src/profiles/etl_profile.h @@ -0,0 +1,60 @@ +///\file + +/****************************************************************************** +The MIT License(MIT) + +Embedded Template Library. +https://github.com/ETLCPP/etl +https://www.etlcpp.com + +Copyright(c) 2017 jwellbelove, scott-eddy + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files(the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and / or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions : + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +******************************************************************************/ +#ifndef __ETL_PROFILE_H__ +#define __ETL_PROFILE_H__ +#ifdef PROFILE_MSVC + #include "msvc_x86.h" +#elif PROFILE_GCC_GENERIC + #include "gcc_generic.h" +#elif PROFILE_GCC_LINUX_X86 + #include "gcc_linux_x86.h" +#elif PROFILE_GCC_WINDOWS_X86 + #include "gcc_windows_x86.h" +#elif PROFILE_ARM_V5_GENERIC + #include "armv5.h" +#elif PROFILE_ARM_V6_GENERIC + #include "armv6.h" +#elif PROFILE_ARDUINO + #include "arduino_arm.h" +#elif PROFILE_TICC + #include "ticc.h" +#elif PROFILE_CPP03_GENERIC + #include "cpp03.h" +#elif PROFILE_CPP11_GENERIC + #include "cpp11.h" +#elif PROFILE_CPP14_GENERIC + #include "cpp14.h" +#elif PROFILE_CUSTOM + #include "custom_profile.h" +#else + #error Must provide a profile header file when buiding ETL. See https://www.etlcpp.com/setup.html +#endif + +#endif // __ETL_PROFILE_H_ diff --git a/test/codeblocks/ETL.layout b/test/codeblocks/ETL.layout deleted file mode 100644 index ccf9f11d..00000000 --- a/test/codeblocks/ETL.layout +++ /dev/null @@ -1,585 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - From 4864e95b364538f30e41f9fa4b066712c8604dde Mon Sep 17 00:00:00 2001 From: John Wellbelove Date: Sun, 18 Mar 2018 17:29:52 +0000 Subject: [PATCH 4/9] New directory layout --- CMakeLists.txt | 8 +- {src => include/etl}/.vscode/settings.json | 0 {src => include/etl}/algorithm.h | 0 {src => include/etl}/alignment.h | 0 {src => include/etl}/array.h | 0 {src => include/etl}/array_view.h | 0 {src => include/etl}/array_wrapper.h | 0 {src => include/etl}/atomic.h | 0 {src => include/etl}/atomic/atomic_arm.h | 0 {src => include/etl}/atomic/atomic_gcc.h | 0 {src => include/etl}/atomic/atomic_windows.h | 0 {src => include/etl}/basic_string.h | 0 {src => include/etl}/binary.h | 0 {src => include/etl}/bitset.h | 0 {src => include/etl}/bloom_filter.h | 0 {src => include/etl}/c/ecl_timer.h | 0 {src => include/etl}/callback.h | 0 {src => include/etl}/callback_timer.h | 0 {src => include/etl}/char_traits.h | 0 {src => include/etl}/checksum.h | 0 {src => include/etl}/compare.h | 0 {src => include/etl}/constant.h | 0 {src => include/etl}/container.h | 0 {src => include/etl}/crc16.h | 0 {src => include/etl}/crc16_ccitt.h | 0 {src => include/etl}/crc16_kermit.h | 0 {src => include/etl}/crc32.h | 0 {src => include/etl}/crc64_ecma.h | 0 {src => include/etl}/crc8_ccitt.h | 0 {src => include/etl}/cstring.h | 0 {src => include/etl}/cyclic_value.h | 0 {src => include/etl}/debounce.h | 0 {src => include/etl}/debug_count.h | 0 {src => include/etl}/deque.h | 0 {src => include/etl}/doxygen.h | 0 {src => include/etl}/endianness.h | 0 {src => include/etl}/enum_type.h | 0 {src => include/etl}/error_handler.h | 0 {src => include/etl}/exception.h | 0 {src => include/etl}/experimental/atomic.h | 0 .../etl}/experimental/spsc_queue.h | 0 {src => include/etl}/factorial.h | 0 {src => include/etl}/factory.h | 0 {src => include/etl}/fibonacci.h | 0 {src => include/etl}/file_error_numbers.txt | 0 {src => include/etl}/fixed_iterator.h | 0 {src => include/etl}/flat_map.h | 0 {src => include/etl}/flat_multimap.h | 0 {src => include/etl}/flat_multiset.h | 0 {src => include/etl}/flat_set.h | 0 {src => include/etl}/fnv_1.h | 0 {src => include/etl}/forward_list.h | 0 {src => include/etl}/frame_check_sequence.h | 0 {src => include/etl}/fsm.h | 0 {src => include/etl}/fsm_generator.h | 0 {src => include/etl}/function.h | 0 {src => include/etl}/functional.h | 0 {src => include/etl}/generate.bat | 0 {src => include/etl}/generate_fsm.bat | 0 {src => include/etl}/generate_largest.bat | 0 .../etl}/generate_message_router.bat | 0 {src => include/etl}/generate_smallest.bat | 0 {src => include/etl}/generate_type_lookup.bat | 0 {src => include/etl}/generate_type_traits.bat | 0 .../etl}/generate_variant_pool.bat | 0 {src => include/etl}/hash.h | 0 {src => include/etl}/icache.h | 0 {src => include/etl}/ihash.h | 0 {src => include/etl}/instance_count.h | 0 {src => include/etl}/integral_limits.h | 0 {src => include/etl}/intrusive_forward_list.h | 0 {src => include/etl}/intrusive_links.h | 0 {src => include/etl}/intrusive_list.h | 0 {src => include/etl}/intrusive_queue.h | 0 {src => include/etl}/intrusive_stack.h | 0 {src => include/etl}/io_port.h | 0 {src => include/etl}/iterator.h | 0 {src => include/etl}/jenkins.h | 0 {src => include/etl}/largest.h | 0 {src => include/etl}/largest_generator.h | 0 {src => include/etl}/list.h | 0 {src => include/etl}/log.h | 0 {src => include/etl}/map.h | 0 {src => include/etl}/memory.h | 0 {src => include/etl}/message.h | 0 {src => include/etl}/message_bus.h | 0 {src => include/etl}/message_router.h | 0 .../etl}/message_router_generator.h | 0 {src => include/etl}/message_timer.h | 0 {src => include/etl}/message_types.h | 0 {src => include/etl}/multimap.h | 0 {src => include/etl}/multiset.h | 0 {src => include/etl}/murmur3.h | 0 {src => include/etl}/nullptr.h | 0 {src => include/etl}/numeric.h | 0 {src => include/etl}/observer.h | 0 {src => include/etl}/optional.h | 0 {src => include/etl}/packet.h | 0 {src => include/etl}/parameter_type.h | 0 {src => include/etl}/pearson.h | 0 {src => include/etl}/platform.h | 0 {src => include/etl}/pool.h | 0 {src => include/etl}/power.h | 0 {src => include/etl}/priority_queue.h | 0 {src => include/etl}/private/ivectorpointer.h | 0 {src => include/etl}/private/pvoidvector.h | 0 {src => include/etl}/private/vector_base.h | 0 {src => include/etl}/profiles/arduino_arm.h | 0 {src => include/etl}/profiles/armv5.h | 0 {src => include/etl}/profiles/armv6.h | 0 {src => include/etl}/profiles/cpp03.h | 0 {src => include/etl}/profiles/cpp11.h | 0 {src => include/etl}/profiles/cpp14.h | 0 {src => include/etl}/profiles/etl_profile.h | 0 {src => include/etl}/profiles/gcc_generic.h | 0 {src => include/etl}/profiles/gcc_linux_x86.h | 0 .../etl}/profiles/gcc_windows_x86.h | 0 {src => include/etl}/profiles/msvc_x86.h | 0 {src => include/etl}/profiles/ticc.h | 0 {src => include/etl}/queue.h | 0 {src => include/etl}/radix.h | 0 {src => include/etl}/random.h | 0 {src => include/etl}/ratio.h | 0 {src => include/etl}/reference_flat_map.h | 0 .../etl}/reference_flat_multimap.h | 0 .../etl}/reference_flat_multiset.h | 0 {src => include/etl}/reference_flat_set.h | 0 {src => include/etl}/scheduler.h | 0 {src => include/etl}/set.h | 0 {src => include/etl}/smallest.h | 0 {src => include/etl}/smallest_generator.h | 0 {src => include/etl}/sqrt.h | 0 {src => include/etl}/stack.h | 0 {src => include/etl}/static_assert.h | 0 {src => include/etl}/string_view.h | 0 {src => include/etl}/task.h | 0 {src => include/etl}/temp.h | 0 {src => include/etl}/timer.h | 0 {src => include/etl}/type_def.h | 0 {src => include/etl}/type_lookup.h | 0 {src => include/etl}/type_lookup_generator.h | 0 {src => include/etl}/type_traits.h | 0 {src => include/etl}/type_traits_generator.h | 0 {src => include/etl}/u16string.h | 0 {src => include/etl}/u32string.h | 0 {src => include/etl}/unordered_map.h | 0 {src => include/etl}/unordered_multimap.h | 0 {src => include/etl}/unordered_multiset.h | 0 {src => include/etl}/unordered_set.h | 0 {src => include/etl}/user_type.h | 0 {src => include/etl}/utility.h | 0 {src => include/etl}/variant.h | 0 {src => include/etl}/variant_pool.h | 0 {src => include/etl}/variant_pool_generator.h | 0 {src => include/etl}/vector.h | 0 {src => include/etl}/version.h | 0 {src => include/etl}/visitor.h | 0 {src => include/etl}/wstring.h | 0 src/c/ecl_timer.c | 16 +- src/private/pvoidvector.cpp | 4 +- support/Release notes.txt | 6 + test/codeblocks/ETL.cbp | 291 +++++++------- test/test_c_timer_framework.cpp | 2 +- test/vs2017/etl.vcxproj | 316 +++++++-------- test/vs2017/etl.vcxproj.filters | 376 +++++++++--------- 165 files changed, 515 insertions(+), 504 deletions(-) rename {src => include/etl}/.vscode/settings.json (100%) rename {src => include/etl}/algorithm.h (100%) rename {src => include/etl}/alignment.h (100%) rename {src => include/etl}/array.h (100%) rename {src => include/etl}/array_view.h (100%) rename {src => include/etl}/array_wrapper.h (100%) rename {src => include/etl}/atomic.h (100%) rename {src => include/etl}/atomic/atomic_arm.h (100%) rename {src => include/etl}/atomic/atomic_gcc.h (100%) rename {src => include/etl}/atomic/atomic_windows.h (100%) rename {src => include/etl}/basic_string.h (100%) rename {src => include/etl}/binary.h (100%) rename {src => include/etl}/bitset.h (100%) rename {src => include/etl}/bloom_filter.h (100%) rename {src => include/etl}/c/ecl_timer.h (100%) rename {src => include/etl}/callback.h (100%) rename {src => include/etl}/callback_timer.h (100%) rename {src => include/etl}/char_traits.h (100%) rename {src => include/etl}/checksum.h (100%) rename {src => include/etl}/compare.h (100%) rename {src => include/etl}/constant.h (100%) rename {src => include/etl}/container.h (100%) rename {src => include/etl}/crc16.h (100%) rename {src => include/etl}/crc16_ccitt.h (100%) rename {src => include/etl}/crc16_kermit.h (100%) rename {src => include/etl}/crc32.h (100%) rename {src => include/etl}/crc64_ecma.h (100%) rename {src => include/etl}/crc8_ccitt.h (100%) rename {src => include/etl}/cstring.h (100%) rename {src => include/etl}/cyclic_value.h (100%) rename {src => include/etl}/debounce.h (100%) rename {src => include/etl}/debug_count.h (100%) rename {src => include/etl}/deque.h (100%) rename {src => include/etl}/doxygen.h (100%) rename {src => include/etl}/endianness.h (100%) rename {src => include/etl}/enum_type.h (100%) rename {src => include/etl}/error_handler.h (100%) rename {src => include/etl}/exception.h (100%) rename {src => include/etl}/experimental/atomic.h (100%) rename {src => include/etl}/experimental/spsc_queue.h (100%) rename {src => include/etl}/factorial.h (100%) rename {src => include/etl}/factory.h (100%) rename {src => include/etl}/fibonacci.h (100%) rename {src => include/etl}/file_error_numbers.txt (100%) rename {src => include/etl}/fixed_iterator.h (100%) rename {src => include/etl}/flat_map.h (100%) rename {src => include/etl}/flat_multimap.h (100%) rename {src => include/etl}/flat_multiset.h (100%) rename {src => include/etl}/flat_set.h (100%) rename {src => include/etl}/fnv_1.h (100%) rename {src => include/etl}/forward_list.h (100%) rename {src => include/etl}/frame_check_sequence.h (100%) rename {src => include/etl}/fsm.h (100%) rename {src => include/etl}/fsm_generator.h (100%) rename {src => include/etl}/function.h (100%) rename {src => include/etl}/functional.h (100%) rename {src => include/etl}/generate.bat (100%) rename {src => include/etl}/generate_fsm.bat (100%) rename {src => include/etl}/generate_largest.bat (100%) rename {src => include/etl}/generate_message_router.bat (100%) rename {src => include/etl}/generate_smallest.bat (100%) rename {src => include/etl}/generate_type_lookup.bat (100%) rename {src => include/etl}/generate_type_traits.bat (100%) rename {src => include/etl}/generate_variant_pool.bat (100%) rename {src => include/etl}/hash.h (100%) rename {src => include/etl}/icache.h (100%) rename {src => include/etl}/ihash.h (100%) rename {src => include/etl}/instance_count.h (100%) rename {src => include/etl}/integral_limits.h (100%) rename {src => include/etl}/intrusive_forward_list.h (100%) rename {src => include/etl}/intrusive_links.h (100%) rename {src => include/etl}/intrusive_list.h (100%) rename {src => include/etl}/intrusive_queue.h (100%) rename {src => include/etl}/intrusive_stack.h (100%) rename {src => include/etl}/io_port.h (100%) rename {src => include/etl}/iterator.h (100%) rename {src => include/etl}/jenkins.h (100%) rename {src => include/etl}/largest.h (100%) rename {src => include/etl}/largest_generator.h (100%) rename {src => include/etl}/list.h (100%) rename {src => include/etl}/log.h (100%) rename {src => include/etl}/map.h (100%) rename {src => include/etl}/memory.h (100%) rename {src => include/etl}/message.h (100%) rename {src => include/etl}/message_bus.h (100%) rename {src => include/etl}/message_router.h (100%) rename {src => include/etl}/message_router_generator.h (100%) rename {src => include/etl}/message_timer.h (100%) rename {src => include/etl}/message_types.h (100%) rename {src => include/etl}/multimap.h (100%) rename {src => include/etl}/multiset.h (100%) rename {src => include/etl}/murmur3.h (100%) rename {src => include/etl}/nullptr.h (100%) rename {src => include/etl}/numeric.h (100%) rename {src => include/etl}/observer.h (100%) rename {src => include/etl}/optional.h (100%) rename {src => include/etl}/packet.h (100%) rename {src => include/etl}/parameter_type.h (100%) rename {src => include/etl}/pearson.h (100%) rename {src => include/etl}/platform.h (100%) rename {src => include/etl}/pool.h (100%) rename {src => include/etl}/power.h (100%) rename {src => include/etl}/priority_queue.h (100%) rename {src => include/etl}/private/ivectorpointer.h (100%) rename {src => include/etl}/private/pvoidvector.h (100%) rename {src => include/etl}/private/vector_base.h (100%) rename {src => include/etl}/profiles/arduino_arm.h (100%) rename {src => include/etl}/profiles/armv5.h (100%) rename {src => include/etl}/profiles/armv6.h (100%) rename {src => include/etl}/profiles/cpp03.h (100%) rename {src => include/etl}/profiles/cpp11.h (100%) rename {src => include/etl}/profiles/cpp14.h (100%) rename {src => include/etl}/profiles/etl_profile.h (100%) rename {src => include/etl}/profiles/gcc_generic.h (100%) rename {src => include/etl}/profiles/gcc_linux_x86.h (100%) rename {src => include/etl}/profiles/gcc_windows_x86.h (100%) rename {src => include/etl}/profiles/msvc_x86.h (100%) rename {src => include/etl}/profiles/ticc.h (100%) rename {src => include/etl}/queue.h (100%) rename {src => include/etl}/radix.h (100%) rename {src => include/etl}/random.h (100%) rename {src => include/etl}/ratio.h (100%) rename {src => include/etl}/reference_flat_map.h (100%) rename {src => include/etl}/reference_flat_multimap.h (100%) rename {src => include/etl}/reference_flat_multiset.h (100%) rename {src => include/etl}/reference_flat_set.h (100%) rename {src => include/etl}/scheduler.h (100%) rename {src => include/etl}/set.h (100%) rename {src => include/etl}/smallest.h (100%) rename {src => include/etl}/smallest_generator.h (100%) rename {src => include/etl}/sqrt.h (100%) rename {src => include/etl}/stack.h (100%) rename {src => include/etl}/static_assert.h (100%) rename {src => include/etl}/string_view.h (100%) rename {src => include/etl}/task.h (100%) rename {src => include/etl}/temp.h (100%) rename {src => include/etl}/timer.h (100%) rename {src => include/etl}/type_def.h (100%) rename {src => include/etl}/type_lookup.h (100%) rename {src => include/etl}/type_lookup_generator.h (100%) rename {src => include/etl}/type_traits.h (100%) rename {src => include/etl}/type_traits_generator.h (100%) rename {src => include/etl}/u16string.h (100%) rename {src => include/etl}/u32string.h (100%) rename {src => include/etl}/unordered_map.h (100%) rename {src => include/etl}/unordered_multimap.h (100%) rename {src => include/etl}/unordered_multiset.h (100%) rename {src => include/etl}/unordered_set.h (100%) rename {src => include/etl}/user_type.h (100%) rename {src => include/etl}/utility.h (100%) rename {src => include/etl}/variant.h (100%) rename {src => include/etl}/variant_pool.h (100%) rename {src => include/etl}/variant_pool_generator.h (100%) rename {src => include/etl}/vector.h (100%) rename {src => include/etl}/version.h (100%) rename {src => include/etl}/visitor.h (100%) rename {src => include/etl}/wstring.h (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8b2b698a..3456c7be 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,11 +28,11 @@ add_library(etl ) target_include_directories(etl PUBLIC - src/ - src/atomic - src/profiles + include/etl/ + include/etl/atomic + include/etl/profiles PRIVATE - src/private + include/etl/private ) if (${ETL_PROFILE} STREQUAL DEFAULT) diff --git a/src/.vscode/settings.json b/include/etl/.vscode/settings.json similarity index 100% rename from src/.vscode/settings.json rename to include/etl/.vscode/settings.json diff --git a/src/algorithm.h b/include/etl/algorithm.h similarity index 100% rename from src/algorithm.h rename to include/etl/algorithm.h diff --git a/src/alignment.h b/include/etl/alignment.h similarity index 100% rename from src/alignment.h rename to include/etl/alignment.h diff --git a/src/array.h b/include/etl/array.h similarity index 100% rename from src/array.h rename to include/etl/array.h diff --git a/src/array_view.h b/include/etl/array_view.h similarity index 100% rename from src/array_view.h rename to include/etl/array_view.h diff --git a/src/array_wrapper.h b/include/etl/array_wrapper.h similarity index 100% rename from src/array_wrapper.h rename to include/etl/array_wrapper.h diff --git a/src/atomic.h b/include/etl/atomic.h similarity index 100% rename from src/atomic.h rename to include/etl/atomic.h diff --git a/src/atomic/atomic_arm.h b/include/etl/atomic/atomic_arm.h similarity index 100% rename from src/atomic/atomic_arm.h rename to include/etl/atomic/atomic_arm.h diff --git a/src/atomic/atomic_gcc.h b/include/etl/atomic/atomic_gcc.h similarity index 100% rename from src/atomic/atomic_gcc.h rename to include/etl/atomic/atomic_gcc.h diff --git a/src/atomic/atomic_windows.h b/include/etl/atomic/atomic_windows.h similarity index 100% rename from src/atomic/atomic_windows.h rename to include/etl/atomic/atomic_windows.h diff --git a/src/basic_string.h b/include/etl/basic_string.h similarity index 100% rename from src/basic_string.h rename to include/etl/basic_string.h diff --git a/src/binary.h b/include/etl/binary.h similarity index 100% rename from src/binary.h rename to include/etl/binary.h diff --git a/src/bitset.h b/include/etl/bitset.h similarity index 100% rename from src/bitset.h rename to include/etl/bitset.h diff --git a/src/bloom_filter.h b/include/etl/bloom_filter.h similarity index 100% rename from src/bloom_filter.h rename to include/etl/bloom_filter.h diff --git a/src/c/ecl_timer.h b/include/etl/c/ecl_timer.h similarity index 100% rename from src/c/ecl_timer.h rename to include/etl/c/ecl_timer.h diff --git a/src/callback.h b/include/etl/callback.h similarity index 100% rename from src/callback.h rename to include/etl/callback.h diff --git a/src/callback_timer.h b/include/etl/callback_timer.h similarity index 100% rename from src/callback_timer.h rename to include/etl/callback_timer.h diff --git a/src/char_traits.h b/include/etl/char_traits.h similarity index 100% rename from src/char_traits.h rename to include/etl/char_traits.h diff --git a/src/checksum.h b/include/etl/checksum.h similarity index 100% rename from src/checksum.h rename to include/etl/checksum.h diff --git a/src/compare.h b/include/etl/compare.h similarity index 100% rename from src/compare.h rename to include/etl/compare.h diff --git a/src/constant.h b/include/etl/constant.h similarity index 100% rename from src/constant.h rename to include/etl/constant.h diff --git a/src/container.h b/include/etl/container.h similarity index 100% rename from src/container.h rename to include/etl/container.h diff --git a/src/crc16.h b/include/etl/crc16.h similarity index 100% rename from src/crc16.h rename to include/etl/crc16.h diff --git a/src/crc16_ccitt.h b/include/etl/crc16_ccitt.h similarity index 100% rename from src/crc16_ccitt.h rename to include/etl/crc16_ccitt.h diff --git a/src/crc16_kermit.h b/include/etl/crc16_kermit.h similarity index 100% rename from src/crc16_kermit.h rename to include/etl/crc16_kermit.h diff --git a/src/crc32.h b/include/etl/crc32.h similarity index 100% rename from src/crc32.h rename to include/etl/crc32.h diff --git a/src/crc64_ecma.h b/include/etl/crc64_ecma.h similarity index 100% rename from src/crc64_ecma.h rename to include/etl/crc64_ecma.h diff --git a/src/crc8_ccitt.h b/include/etl/crc8_ccitt.h similarity index 100% rename from src/crc8_ccitt.h rename to include/etl/crc8_ccitt.h diff --git a/src/cstring.h b/include/etl/cstring.h similarity index 100% rename from src/cstring.h rename to include/etl/cstring.h diff --git a/src/cyclic_value.h b/include/etl/cyclic_value.h similarity index 100% rename from src/cyclic_value.h rename to include/etl/cyclic_value.h diff --git a/src/debounce.h b/include/etl/debounce.h similarity index 100% rename from src/debounce.h rename to include/etl/debounce.h diff --git a/src/debug_count.h b/include/etl/debug_count.h similarity index 100% rename from src/debug_count.h rename to include/etl/debug_count.h diff --git a/src/deque.h b/include/etl/deque.h similarity index 100% rename from src/deque.h rename to include/etl/deque.h diff --git a/src/doxygen.h b/include/etl/doxygen.h similarity index 100% rename from src/doxygen.h rename to include/etl/doxygen.h diff --git a/src/endianness.h b/include/etl/endianness.h similarity index 100% rename from src/endianness.h rename to include/etl/endianness.h diff --git a/src/enum_type.h b/include/etl/enum_type.h similarity index 100% rename from src/enum_type.h rename to include/etl/enum_type.h diff --git a/src/error_handler.h b/include/etl/error_handler.h similarity index 100% rename from src/error_handler.h rename to include/etl/error_handler.h diff --git a/src/exception.h b/include/etl/exception.h similarity index 100% rename from src/exception.h rename to include/etl/exception.h diff --git a/src/experimental/atomic.h b/include/etl/experimental/atomic.h similarity index 100% rename from src/experimental/atomic.h rename to include/etl/experimental/atomic.h diff --git a/src/experimental/spsc_queue.h b/include/etl/experimental/spsc_queue.h similarity index 100% rename from src/experimental/spsc_queue.h rename to include/etl/experimental/spsc_queue.h diff --git a/src/factorial.h b/include/etl/factorial.h similarity index 100% rename from src/factorial.h rename to include/etl/factorial.h diff --git a/src/factory.h b/include/etl/factory.h similarity index 100% rename from src/factory.h rename to include/etl/factory.h diff --git a/src/fibonacci.h b/include/etl/fibonacci.h similarity index 100% rename from src/fibonacci.h rename to include/etl/fibonacci.h diff --git a/src/file_error_numbers.txt b/include/etl/file_error_numbers.txt similarity index 100% rename from src/file_error_numbers.txt rename to include/etl/file_error_numbers.txt diff --git a/src/fixed_iterator.h b/include/etl/fixed_iterator.h similarity index 100% rename from src/fixed_iterator.h rename to include/etl/fixed_iterator.h diff --git a/src/flat_map.h b/include/etl/flat_map.h similarity index 100% rename from src/flat_map.h rename to include/etl/flat_map.h diff --git a/src/flat_multimap.h b/include/etl/flat_multimap.h similarity index 100% rename from src/flat_multimap.h rename to include/etl/flat_multimap.h diff --git a/src/flat_multiset.h b/include/etl/flat_multiset.h similarity index 100% rename from src/flat_multiset.h rename to include/etl/flat_multiset.h diff --git a/src/flat_set.h b/include/etl/flat_set.h similarity index 100% rename from src/flat_set.h rename to include/etl/flat_set.h diff --git a/src/fnv_1.h b/include/etl/fnv_1.h similarity index 100% rename from src/fnv_1.h rename to include/etl/fnv_1.h diff --git a/src/forward_list.h b/include/etl/forward_list.h similarity index 100% rename from src/forward_list.h rename to include/etl/forward_list.h diff --git a/src/frame_check_sequence.h b/include/etl/frame_check_sequence.h similarity index 100% rename from src/frame_check_sequence.h rename to include/etl/frame_check_sequence.h diff --git a/src/fsm.h b/include/etl/fsm.h similarity index 100% rename from src/fsm.h rename to include/etl/fsm.h diff --git a/src/fsm_generator.h b/include/etl/fsm_generator.h similarity index 100% rename from src/fsm_generator.h rename to include/etl/fsm_generator.h diff --git a/src/function.h b/include/etl/function.h similarity index 100% rename from src/function.h rename to include/etl/function.h diff --git a/src/functional.h b/include/etl/functional.h similarity index 100% rename from src/functional.h rename to include/etl/functional.h diff --git a/src/generate.bat b/include/etl/generate.bat similarity index 100% rename from src/generate.bat rename to include/etl/generate.bat diff --git a/src/generate_fsm.bat b/include/etl/generate_fsm.bat similarity index 100% rename from src/generate_fsm.bat rename to include/etl/generate_fsm.bat diff --git a/src/generate_largest.bat b/include/etl/generate_largest.bat similarity index 100% rename from src/generate_largest.bat rename to include/etl/generate_largest.bat diff --git a/src/generate_message_router.bat b/include/etl/generate_message_router.bat similarity index 100% rename from src/generate_message_router.bat rename to include/etl/generate_message_router.bat diff --git a/src/generate_smallest.bat b/include/etl/generate_smallest.bat similarity index 100% rename from src/generate_smallest.bat rename to include/etl/generate_smallest.bat diff --git a/src/generate_type_lookup.bat b/include/etl/generate_type_lookup.bat similarity index 100% rename from src/generate_type_lookup.bat rename to include/etl/generate_type_lookup.bat diff --git a/src/generate_type_traits.bat b/include/etl/generate_type_traits.bat similarity index 100% rename from src/generate_type_traits.bat rename to include/etl/generate_type_traits.bat diff --git a/src/generate_variant_pool.bat b/include/etl/generate_variant_pool.bat similarity index 100% rename from src/generate_variant_pool.bat rename to include/etl/generate_variant_pool.bat diff --git a/src/hash.h b/include/etl/hash.h similarity index 100% rename from src/hash.h rename to include/etl/hash.h diff --git a/src/icache.h b/include/etl/icache.h similarity index 100% rename from src/icache.h rename to include/etl/icache.h diff --git a/src/ihash.h b/include/etl/ihash.h similarity index 100% rename from src/ihash.h rename to include/etl/ihash.h diff --git a/src/instance_count.h b/include/etl/instance_count.h similarity index 100% rename from src/instance_count.h rename to include/etl/instance_count.h diff --git a/src/integral_limits.h b/include/etl/integral_limits.h similarity index 100% rename from src/integral_limits.h rename to include/etl/integral_limits.h diff --git a/src/intrusive_forward_list.h b/include/etl/intrusive_forward_list.h similarity index 100% rename from src/intrusive_forward_list.h rename to include/etl/intrusive_forward_list.h diff --git a/src/intrusive_links.h b/include/etl/intrusive_links.h similarity index 100% rename from src/intrusive_links.h rename to include/etl/intrusive_links.h diff --git a/src/intrusive_list.h b/include/etl/intrusive_list.h similarity index 100% rename from src/intrusive_list.h rename to include/etl/intrusive_list.h diff --git a/src/intrusive_queue.h b/include/etl/intrusive_queue.h similarity index 100% rename from src/intrusive_queue.h rename to include/etl/intrusive_queue.h diff --git a/src/intrusive_stack.h b/include/etl/intrusive_stack.h similarity index 100% rename from src/intrusive_stack.h rename to include/etl/intrusive_stack.h diff --git a/src/io_port.h b/include/etl/io_port.h similarity index 100% rename from src/io_port.h rename to include/etl/io_port.h diff --git a/src/iterator.h b/include/etl/iterator.h similarity index 100% rename from src/iterator.h rename to include/etl/iterator.h diff --git a/src/jenkins.h b/include/etl/jenkins.h similarity index 100% rename from src/jenkins.h rename to include/etl/jenkins.h diff --git a/src/largest.h b/include/etl/largest.h similarity index 100% rename from src/largest.h rename to include/etl/largest.h diff --git a/src/largest_generator.h b/include/etl/largest_generator.h similarity index 100% rename from src/largest_generator.h rename to include/etl/largest_generator.h diff --git a/src/list.h b/include/etl/list.h similarity index 100% rename from src/list.h rename to include/etl/list.h diff --git a/src/log.h b/include/etl/log.h similarity index 100% rename from src/log.h rename to include/etl/log.h diff --git a/src/map.h b/include/etl/map.h similarity index 100% rename from src/map.h rename to include/etl/map.h diff --git a/src/memory.h b/include/etl/memory.h similarity index 100% rename from src/memory.h rename to include/etl/memory.h diff --git a/src/message.h b/include/etl/message.h similarity index 100% rename from src/message.h rename to include/etl/message.h diff --git a/src/message_bus.h b/include/etl/message_bus.h similarity index 100% rename from src/message_bus.h rename to include/etl/message_bus.h diff --git a/src/message_router.h b/include/etl/message_router.h similarity index 100% rename from src/message_router.h rename to include/etl/message_router.h diff --git a/src/message_router_generator.h b/include/etl/message_router_generator.h similarity index 100% rename from src/message_router_generator.h rename to include/etl/message_router_generator.h diff --git a/src/message_timer.h b/include/etl/message_timer.h similarity index 100% rename from src/message_timer.h rename to include/etl/message_timer.h diff --git a/src/message_types.h b/include/etl/message_types.h similarity index 100% rename from src/message_types.h rename to include/etl/message_types.h diff --git a/src/multimap.h b/include/etl/multimap.h similarity index 100% rename from src/multimap.h rename to include/etl/multimap.h diff --git a/src/multiset.h b/include/etl/multiset.h similarity index 100% rename from src/multiset.h rename to include/etl/multiset.h diff --git a/src/murmur3.h b/include/etl/murmur3.h similarity index 100% rename from src/murmur3.h rename to include/etl/murmur3.h diff --git a/src/nullptr.h b/include/etl/nullptr.h similarity index 100% rename from src/nullptr.h rename to include/etl/nullptr.h diff --git a/src/numeric.h b/include/etl/numeric.h similarity index 100% rename from src/numeric.h rename to include/etl/numeric.h diff --git a/src/observer.h b/include/etl/observer.h similarity index 100% rename from src/observer.h rename to include/etl/observer.h diff --git a/src/optional.h b/include/etl/optional.h similarity index 100% rename from src/optional.h rename to include/etl/optional.h diff --git a/src/packet.h b/include/etl/packet.h similarity index 100% rename from src/packet.h rename to include/etl/packet.h diff --git a/src/parameter_type.h b/include/etl/parameter_type.h similarity index 100% rename from src/parameter_type.h rename to include/etl/parameter_type.h diff --git a/src/pearson.h b/include/etl/pearson.h similarity index 100% rename from src/pearson.h rename to include/etl/pearson.h diff --git a/src/platform.h b/include/etl/platform.h similarity index 100% rename from src/platform.h rename to include/etl/platform.h diff --git a/src/pool.h b/include/etl/pool.h similarity index 100% rename from src/pool.h rename to include/etl/pool.h diff --git a/src/power.h b/include/etl/power.h similarity index 100% rename from src/power.h rename to include/etl/power.h diff --git a/src/priority_queue.h b/include/etl/priority_queue.h similarity index 100% rename from src/priority_queue.h rename to include/etl/priority_queue.h diff --git a/src/private/ivectorpointer.h b/include/etl/private/ivectorpointer.h similarity index 100% rename from src/private/ivectorpointer.h rename to include/etl/private/ivectorpointer.h diff --git a/src/private/pvoidvector.h b/include/etl/private/pvoidvector.h similarity index 100% rename from src/private/pvoidvector.h rename to include/etl/private/pvoidvector.h diff --git a/src/private/vector_base.h b/include/etl/private/vector_base.h similarity index 100% rename from src/private/vector_base.h rename to include/etl/private/vector_base.h diff --git a/src/profiles/arduino_arm.h b/include/etl/profiles/arduino_arm.h similarity index 100% rename from src/profiles/arduino_arm.h rename to include/etl/profiles/arduino_arm.h diff --git a/src/profiles/armv5.h b/include/etl/profiles/armv5.h similarity index 100% rename from src/profiles/armv5.h rename to include/etl/profiles/armv5.h diff --git a/src/profiles/armv6.h b/include/etl/profiles/armv6.h similarity index 100% rename from src/profiles/armv6.h rename to include/etl/profiles/armv6.h diff --git a/src/profiles/cpp03.h b/include/etl/profiles/cpp03.h similarity index 100% rename from src/profiles/cpp03.h rename to include/etl/profiles/cpp03.h diff --git a/src/profiles/cpp11.h b/include/etl/profiles/cpp11.h similarity index 100% rename from src/profiles/cpp11.h rename to include/etl/profiles/cpp11.h diff --git a/src/profiles/cpp14.h b/include/etl/profiles/cpp14.h similarity index 100% rename from src/profiles/cpp14.h rename to include/etl/profiles/cpp14.h diff --git a/src/profiles/etl_profile.h b/include/etl/profiles/etl_profile.h similarity index 100% rename from src/profiles/etl_profile.h rename to include/etl/profiles/etl_profile.h diff --git a/src/profiles/gcc_generic.h b/include/etl/profiles/gcc_generic.h similarity index 100% rename from src/profiles/gcc_generic.h rename to include/etl/profiles/gcc_generic.h diff --git a/src/profiles/gcc_linux_x86.h b/include/etl/profiles/gcc_linux_x86.h similarity index 100% rename from src/profiles/gcc_linux_x86.h rename to include/etl/profiles/gcc_linux_x86.h diff --git a/src/profiles/gcc_windows_x86.h b/include/etl/profiles/gcc_windows_x86.h similarity index 100% rename from src/profiles/gcc_windows_x86.h rename to include/etl/profiles/gcc_windows_x86.h diff --git a/src/profiles/msvc_x86.h b/include/etl/profiles/msvc_x86.h similarity index 100% rename from src/profiles/msvc_x86.h rename to include/etl/profiles/msvc_x86.h diff --git a/src/profiles/ticc.h b/include/etl/profiles/ticc.h similarity index 100% rename from src/profiles/ticc.h rename to include/etl/profiles/ticc.h diff --git a/src/queue.h b/include/etl/queue.h similarity index 100% rename from src/queue.h rename to include/etl/queue.h diff --git a/src/radix.h b/include/etl/radix.h similarity index 100% rename from src/radix.h rename to include/etl/radix.h diff --git a/src/random.h b/include/etl/random.h similarity index 100% rename from src/random.h rename to include/etl/random.h diff --git a/src/ratio.h b/include/etl/ratio.h similarity index 100% rename from src/ratio.h rename to include/etl/ratio.h diff --git a/src/reference_flat_map.h b/include/etl/reference_flat_map.h similarity index 100% rename from src/reference_flat_map.h rename to include/etl/reference_flat_map.h diff --git a/src/reference_flat_multimap.h b/include/etl/reference_flat_multimap.h similarity index 100% rename from src/reference_flat_multimap.h rename to include/etl/reference_flat_multimap.h diff --git a/src/reference_flat_multiset.h b/include/etl/reference_flat_multiset.h similarity index 100% rename from src/reference_flat_multiset.h rename to include/etl/reference_flat_multiset.h diff --git a/src/reference_flat_set.h b/include/etl/reference_flat_set.h similarity index 100% rename from src/reference_flat_set.h rename to include/etl/reference_flat_set.h diff --git a/src/scheduler.h b/include/etl/scheduler.h similarity index 100% rename from src/scheduler.h rename to include/etl/scheduler.h diff --git a/src/set.h b/include/etl/set.h similarity index 100% rename from src/set.h rename to include/etl/set.h diff --git a/src/smallest.h b/include/etl/smallest.h similarity index 100% rename from src/smallest.h rename to include/etl/smallest.h diff --git a/src/smallest_generator.h b/include/etl/smallest_generator.h similarity index 100% rename from src/smallest_generator.h rename to include/etl/smallest_generator.h diff --git a/src/sqrt.h b/include/etl/sqrt.h similarity index 100% rename from src/sqrt.h rename to include/etl/sqrt.h diff --git a/src/stack.h b/include/etl/stack.h similarity index 100% rename from src/stack.h rename to include/etl/stack.h diff --git a/src/static_assert.h b/include/etl/static_assert.h similarity index 100% rename from src/static_assert.h rename to include/etl/static_assert.h diff --git a/src/string_view.h b/include/etl/string_view.h similarity index 100% rename from src/string_view.h rename to include/etl/string_view.h diff --git a/src/task.h b/include/etl/task.h similarity index 100% rename from src/task.h rename to include/etl/task.h diff --git a/src/temp.h b/include/etl/temp.h similarity index 100% rename from src/temp.h rename to include/etl/temp.h diff --git a/src/timer.h b/include/etl/timer.h similarity index 100% rename from src/timer.h rename to include/etl/timer.h diff --git a/src/type_def.h b/include/etl/type_def.h similarity index 100% rename from src/type_def.h rename to include/etl/type_def.h diff --git a/src/type_lookup.h b/include/etl/type_lookup.h similarity index 100% rename from src/type_lookup.h rename to include/etl/type_lookup.h diff --git a/src/type_lookup_generator.h b/include/etl/type_lookup_generator.h similarity index 100% rename from src/type_lookup_generator.h rename to include/etl/type_lookup_generator.h diff --git a/src/type_traits.h b/include/etl/type_traits.h similarity index 100% rename from src/type_traits.h rename to include/etl/type_traits.h diff --git a/src/type_traits_generator.h b/include/etl/type_traits_generator.h similarity index 100% rename from src/type_traits_generator.h rename to include/etl/type_traits_generator.h diff --git a/src/u16string.h b/include/etl/u16string.h similarity index 100% rename from src/u16string.h rename to include/etl/u16string.h diff --git a/src/u32string.h b/include/etl/u32string.h similarity index 100% rename from src/u32string.h rename to include/etl/u32string.h diff --git a/src/unordered_map.h b/include/etl/unordered_map.h similarity index 100% rename from src/unordered_map.h rename to include/etl/unordered_map.h diff --git a/src/unordered_multimap.h b/include/etl/unordered_multimap.h similarity index 100% rename from src/unordered_multimap.h rename to include/etl/unordered_multimap.h diff --git a/src/unordered_multiset.h b/include/etl/unordered_multiset.h similarity index 100% rename from src/unordered_multiset.h rename to include/etl/unordered_multiset.h diff --git a/src/unordered_set.h b/include/etl/unordered_set.h similarity index 100% rename from src/unordered_set.h rename to include/etl/unordered_set.h diff --git a/src/user_type.h b/include/etl/user_type.h similarity index 100% rename from src/user_type.h rename to include/etl/user_type.h diff --git a/src/utility.h b/include/etl/utility.h similarity index 100% rename from src/utility.h rename to include/etl/utility.h diff --git a/src/variant.h b/include/etl/variant.h similarity index 100% rename from src/variant.h rename to include/etl/variant.h diff --git a/src/variant_pool.h b/include/etl/variant_pool.h similarity index 100% rename from src/variant_pool.h rename to include/etl/variant_pool.h diff --git a/src/variant_pool_generator.h b/include/etl/variant_pool_generator.h similarity index 100% rename from src/variant_pool_generator.h rename to include/etl/variant_pool_generator.h diff --git a/src/vector.h b/include/etl/vector.h similarity index 100% rename from src/vector.h rename to include/etl/vector.h diff --git a/src/version.h b/include/etl/version.h similarity index 100% rename from src/version.h rename to include/etl/version.h diff --git a/src/visitor.h b/include/etl/visitor.h similarity index 100% rename from src/visitor.h rename to include/etl/visitor.h diff --git a/src/wstring.h b/include/etl/wstring.h similarity index 100% rename from src/wstring.h rename to include/etl/wstring.h diff --git a/src/c/ecl_timer.c b/src/c/ecl_timer.c index 6f648f88..004ee669 100644 --- a/src/c/ecl_timer.c +++ b/src/c/ecl_timer.c @@ -29,7 +29,7 @@ SOFTWARE. #include #include -#include "ecl_timer.h" +#include "../../include/etl/c/ecl_timer.h" //***************************************************************************** // Internal timer list @@ -326,7 +326,7 @@ ecl_timer_id_t ecl_timer_register(void (*pcallback_)(), ecl_timer_result_t ecl_timer_unregister(ecl_timer_id_t id_) { assert(ecl.ptimers != 0); - + ecl_timer_result_t result = ECL_TIMER_FAIL; if (id_ != ECL_TIMER_NO_TIMER) @@ -376,7 +376,7 @@ ecl_timer_result_t ecl_timer_is_running() /// Clears the timer of data. //******************************************* void ecl_timer_clear() -{ +{ ecl_timer_list_clear(); int i; @@ -398,7 +398,7 @@ void ecl_timer_clear() ecl_timer_result_t ecl_timer_tick(uint32_t count) { assert(ecl.ptimers != 0); - + if (ecl.enabled) { if (ECL_TIMER_PROCESSING_ENABLED) @@ -452,7 +452,7 @@ ecl_timer_result_t ecl_timer_tick(uint32_t count) ecl_timer_result_t ecl_timer_start(ecl_timer_id_t id_, ecl_timer_start_t immediate_) { assert(ecl.ptimers != 0); - + ecl_timer_result_t result = ECL_TIMER_FAIL; // Valid timer id? @@ -490,7 +490,7 @@ ecl_timer_result_t ecl_timer_start(ecl_timer_id_t id_, ecl_timer_start_t immedia ecl_timer_result_t ecl_timer_stop(ecl_timer_id_t id_) { assert(ecl.ptimers != 0); - + ecl_timer_result_t result = ECL_TIMER_FAIL; // Valid timer id? @@ -520,7 +520,7 @@ ecl_timer_result_t ecl_timer_stop(ecl_timer_id_t id_) ecl_timer_result_t ecl_timer_set_period(ecl_timer_id_t id_, ecl_timer_time_t period_) { assert(ecl.ptimers != 0); - + if (ecl_timer_stop(id_)) { ecl.ptimers[id_].period = period_; @@ -536,7 +536,7 @@ ecl_timer_result_t ecl_timer_set_period(ecl_timer_id_t id_, ecl_timer_time_t per ecl_timer_result_t ecl_timer_set_mode(ecl_timer_id_t id_, ecl_timer_mode_t repeating_) { assert(ecl.ptimers != 0); - + if (ecl_timer_stop(id_)) { ecl.ptimers[id_].repeating = repeating_; diff --git a/src/private/pvoidvector.cpp b/src/private/pvoidvector.cpp index e714921e..5b000adf 100644 --- a/src/private/pvoidvector.cpp +++ b/src/private/pvoidvector.cpp @@ -28,8 +28,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ******************************************************************************/ -#include "../platform.h" -#include "pvoidvector.h" +#include "../../include/etl/platform.h" +#include "../../include/etl/private/pvoidvector.h" namespace etl { diff --git a/support/Release notes.txt b/support/Release notes.txt index 8b7238fd..1f55c588 100644 --- a/support/Release notes.txt +++ b/support/Release notes.txt @@ -1,3 +1,9 @@ +=============================================================================== +11.00.0 +New directory structure. +C & CPP files in src/ +H files in include/etl/ + =============================================================================== 10.21.2 Added version.h diff --git a/test/codeblocks/ETL.cbp b/test/codeblocks/ETL.cbp index 9857c6e7..a399f5d1 100644 --- a/test/codeblocks/ETL.cbp +++ b/test/codeblocks/ETL.cbp @@ -53,164 +53,169 @@ + - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/test_c_timer_framework.cpp b/test/test_c_timer_framework.cpp index 3868fcc3..47aa0aa9 100644 --- a/test/test_c_timer_framework.cpp +++ b/test/test_c_timer_framework.cpp @@ -35,7 +35,7 @@ extern "C" { uint32_t timer_semaphore; - #include "ecl_timer.h" + #include "../include/etl/c/ecl_timer.h" } #include diff --git a/test/vs2017/etl.vcxproj b/test/vs2017/etl.vcxproj index 5e1be754..43f7decb 100644 --- a/test/vs2017/etl.vcxproj +++ b/test/vs2017/etl.vcxproj @@ -74,7 +74,7 @@ Level3 Disabled WIN32;_DEBUG;_CONSOLE;_LIB;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) - ../../unittest-cpp/UnitTest++/;../../src;../../src/c;../../test + ../../unittest-cpp/UnitTest++/;../../include/etl;../../include/etl/c;../../test false @@ -131,48 +131,48 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -202,102 +202,102 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -306,7 +306,17 @@ + + + + + + + + + + @@ -325,16 +335,6 @@ - - - - - - - - - - @@ -473,17 +473,17 @@ - - - - - - - - + + + + + + + + - + diff --git a/test/vs2017/etl.vcxproj.filters b/test/vs2017/etl.vcxproj.filters index 4f5dbef1..32ae59ed 100644 --- a/test/vs2017/etl.vcxproj.filters +++ b/test/vs2017/etl.vcxproj.filters @@ -63,295 +63,295 @@ - + Header Files - + ETL\Utilities - + ETL\Utilities - + ETL\Utilities - + ETL\Containers - + ETL\Containers - + ETL\Containers - + ETL\Containers - + ETL\Containers - + ETL\Utilities - + ETL\Utilities - + ETL\Utilities - + ETL\Utilities - + ETL\Utilities - + ETL\Utilities - + ETL\Patterns - + ETL\Patterns - + ETL\Utilities - + ETL\Containers - + ETL\Containers - + ETL\Maths - + ETL\Maths - + ETL\Maths - + ETL\Maths - + ETL\Maths - + ETL\Maths - + ETL\Containers Header Files - + ETL\Containers - + ETL\Containers - + ETL\Utilities - + ETL\Utilities - + ETL\Containers - + ETL\Maths - + ETL\Utilities - + ETL\Utilities - + ETL\Containers - + ETL\Maths - + ETL\Maths - + ETL\Maths - + ETL\Utilities - + ETL\Utilities - + ETL\Utilities - + ETL\Maths - + ETL\Maths - + ETL\Maths - + ETL\Maths Header Files - + ETL\Containers - + ETL\Utilities - + ETL\Utilities - + ETL\Containers - + ETL\Maths - + ETL\Containers - + ETL\Containers - + ETL\Utilities - + ETL\Containers - + ETL\Containers - + ETL\Containers - + ETL\Containers - + ETL\Containers - + ETL\Maths - + ETL\Maths Source Files - + ETL\Maths - + ETL\Containers - + ETL\Containers - + ETL\Containers - + ETL\Private - + ETL\Utilities - + ETL\Containers - + ETL\Containers - + ETL\Containers - + ETL\Containers - + Header Files - + Header Files - + ETL\Utilities - + ETL\Utilities - + ETL\Containers - + ETL\Containers - + ETL\Containers - + ETL\Containers - + ETL\Private - + ETL\Utilities - + ETL\Containers - + ETL\Utilities - + ETL\Containers - + ETL\Containers - + ETL\Containers - + ETL\Utilities - + ETL\Utilities - + ETL\Utilities - + ETL\Utilities - + ETL\Containers - + ETL\Containers - + ETL\Containers - + ETL\Containers @@ -441,144 +441,144 @@ Header Files - + ETL\Frameworks - + ETL\Frameworks - + ETL\Containers - + ETL\Frameworks\Generators - + ETL\Frameworks\Generators - + ETL\Utilities\Generators - + ETL\Utilities\Generators - + ETL\Utilities\Generators - + ETL\Frameworks - + ETL\Frameworks - + ETL\Frameworks - + ETL\Frameworks - + ETL\Frameworks - + ETL\Maths - + ETL\Utilities - + ETL\Utilities - + ETL\Maths - + ETL\Utilities - + ETL\Utilities\Generators - + ETL\Utilities - + ETL\Frameworks - + ETL\Frameworks - + ETL\Frameworks - + ETL\Utilities - + ETL\Profiles - + ETL\Profiles - + ETL\Profiles - + ETL\Profiles - + ETL\Profiles - + ETL\Profiles Source Files - + ETL\Profiles - + ETL\Profiles - + ETL\Profiles - + ETL\Profiles - + ETL\Profiles - + ETL\Utilities\Atomic - + ETL\Utilities\Atomic - - ECL - Source Files\ECL - + ETL\Containers - + ETL\Containers - + ETL\Containers - + ETL\Containers - + ETL\Containers\Generators - + ETL\Utilities + + ECL + @@ -752,30 +752,6 @@ Source Files - - ETL\Maths - - - ETL\Maths - - - ETL\Maths - - - ETL\Maths - - - ETL\Maths - - - ETL\Maths - - - ETL\Maths - - - ETL\Utilities - Source Files @@ -797,9 +773,6 @@ Source Files - - ETL\Private - Source Files @@ -863,9 +836,6 @@ Source Files - - ETL\Maths - Source Files @@ -941,15 +911,6 @@ Source Files - - ECL - - - Source Files\ECL - - - ETL\Utilities - Source Files @@ -965,6 +926,45 @@ Source Files + + ETL\Private + + + ETL\Maths + + + ETL\Maths + + + ETL\Maths + + + ETL\Maths + + + ETL\Maths + + + ETL\Maths + + + ETL\Maths + + + ETL\Maths + + + ETL\Utilities + + + ETL\Utilities + + + ECL + + + Source Files + @@ -973,33 +973,33 @@ Resource Files - + Resource Files - + Resource Files - + Resource Files - + Resource Files - + Resource Files - + Resource Files - + Resource Files - + Resource Files - + Resource Files From 44068d1493c4a8aa846a89b6d9c02d800e908045 Mon Sep 17 00:00:00 2001 From: John Wellbelove Date: Sun, 18 Mar 2018 18:14:11 +0000 Subject: [PATCH 5/9] Merge from new directories feature. Added files to VS project. Fixed ETL_FILE numbering clashes. --- include/etl/callback_timer.h | 2 +- include/etl/file_error_numbers.txt | 4 ++ include/etl/message_timer.h | 2 +- include/etl/type_lookup.h | 2 +- include/etl/type_lookup_generator.h | 2 +- test/vs2017/etl.vcxproj | 11 +++++ test/vs2017/etl.vcxproj.filters | 62 +++++++++++++++++++++++------ 7 files changed, 69 insertions(+), 16 deletions(-) diff --git a/include/etl/callback_timer.h b/include/etl/callback_timer.h index 42410566..5634b37a 100644 --- a/include/etl/callback_timer.h +++ b/include/etl/callback_timer.h @@ -40,7 +40,7 @@ SOFTWARE. #include "atomic.h" #undef ETL_FILE -#define ETL_FILE "42" +#define ETL_FILE "43" #if !defined(ETL_CALLBACK_TIMER_USE_ATOMIC_LOCK) && !defined(ETL_CALLBACK_TIMER_USE_INTERRUPT_LOCK) #error ETL_CALLBACK_TIMER_USE_ATOMIC_LOCK or ETL_CALLBACK_TIMER_USE_INTERRUPT_LOCK not defined diff --git a/include/etl/file_error_numbers.txt b/include/etl/file_error_numbers.txt index 061eda1a..7516f471 100644 --- a/include/etl/file_error_numbers.txt +++ b/include/etl/file_error_numbers.txt @@ -39,3 +39,7 @@ 39 message_bus 40 factory / variant_pool 41 array_view +42 string_view +43 callback_timer +44 message_timer +45 type_lookup \ No newline at end of file diff --git a/include/etl/message_timer.h b/include/etl/message_timer.h index 64d41f7d..4a570ae2 100644 --- a/include/etl/message_timer.h +++ b/include/etl/message_timer.h @@ -43,7 +43,7 @@ SOFTWARE. #include "atomic.h" #undef ETL_FILE -#define ETL_FILE "41" +#define ETL_FILE "44" #if !defined(ETL_MESSAGE_TIMER_USE_ATOMIC_LOCK) && !defined(ETL_MESSAGE_TIMER_USE_INTERRUPT_LOCK) #error ETL_MESSAGE_TIMER_USE_ATOMIC_LOCK or ETL_MESSAGE_TIMER_USE_INTERRUPT_LOCK not defined diff --git a/include/etl/type_lookup.h b/include/etl/type_lookup.h index 01d254cf..994809db 100644 --- a/include/etl/type_lookup.h +++ b/include/etl/type_lookup.h @@ -36,7 +36,7 @@ SOFTWARE. #include "static_assert.h" #undef ETL_FILE -#define ETL_FILE "41" +#define ETL_FILE "45" #if 0 #error THIS HEADER IS A GENERATOR. DO NOT INCLUDE. diff --git a/include/etl/type_lookup_generator.h b/include/etl/type_lookup_generator.h index 851bfec3..da849c5b 100644 --- a/include/etl/type_lookup_generator.h +++ b/include/etl/type_lookup_generator.h @@ -36,7 +36,7 @@ SOFTWARE. #include "static_assert.h" #undef ETL_FILE -#define ETL_FILE "41" +#define ETL_FILE "45" /*[[[cog import cog diff --git a/test/vs2017/etl.vcxproj b/test/vs2017/etl.vcxproj index 43f7decb..efc88c3b 100644 --- a/test/vs2017/etl.vcxproj +++ b/test/vs2017/etl.vcxproj @@ -472,6 +472,8 @@ + + @@ -483,9 +485,18 @@ + + + + + + + + + diff --git a/test/vs2017/etl.vcxproj.filters b/test/vs2017/etl.vcxproj.filters index 32ae59ed..675dce75 100644 --- a/test/vs2017/etl.vcxproj.filters +++ b/test/vs2017/etl.vcxproj.filters @@ -61,6 +61,15 @@ {e4a699ae-e7f3-418e-bf9f-211c21f7f4b2} + + {7371282e-fddc-4269-891b-e909f74ff8e9} + + + {3353062c-e8dc-4095-b7cf-d11fc952263e} + + + {4d08353c-b393-47c7-a9eb-c9f2f8c25887} + @@ -974,28 +983,34 @@ Resource Files - Resource Files - - - Resource Files + Resource Files\Generators - Resource Files + Resource Files\Generators - Resource Files + Resource Files\Generators + + + Resource Files\Generators - Resource Files - - - Resource Files + Resource Files\Generators - Resource Files + Resource Files\Generators + + + Resource Files\Generators - Resource Files + Resource Files\Generators + + + Resource Files\Images + + + Resource Files\Images @@ -1005,5 +1020,28 @@ Resource Files + + Resource Files\Make + + + + + Resource Files\Images + + + Resource Files\Images + + + Resource Files\Images + + + Resource Files\Images + + + Resource Files\Images + + + Resource Files\Images + \ No newline at end of file From 8ac3b648238bc93c546670136ad7eeecf7256dce Mon Sep 17 00:00:00 2001 From: John Wellbelove Date: Wed, 21 Mar 2018 19:35:18 +0000 Subject: [PATCH 6/9] Added reset() to etl::optional --- include/etl/optional.h | 12 ++++++++++++ test/test_optional.cpp | 10 ++++++++++ 2 files changed, 22 insertions(+) diff --git a/include/etl/optional.h b/include/etl/optional.h index a1ec6a64..08cf7805 100644 --- a/include/etl/optional.h +++ b/include/etl/optional.h @@ -313,6 +313,18 @@ namespace etl other = temp; } + //*************************************************************************** + /// Reset back to invalid. + //*************************************************************************** + void reset() + { + if (valid) + { + storage.template get_reference().~T(); + valid = false; + } + } + private: typename etl::aligned_storage_as::type storage; diff --git a/test/test_optional.cpp b/test/test_optional.cpp index e0d081f4..a8b2d665 100644 --- a/test/test_optional.cpp +++ b/test/test_optional.cpp @@ -396,5 +396,15 @@ namespace CHECK_EQUAL(data1, original2); CHECK_EQUAL(data2, original1); } + + //************************************************************************* + TEST(test_reset) + { + etl::optional data(Data("1")); + CHECK(bool(data)); + + data.reset(); + CHECK(!bool(data)); + } }; } From d28c88b1dab4bc2c5ba032839a601328670666a9 Mon Sep 17 00:00:00 2001 From: John Wellbelove Date: Wed, 21 Mar 2018 19:35:18 +0000 Subject: [PATCH 7/9] Added reset() to etl::optional --- include/etl/optional.h | 12 ++++++++++++ support/Release notes.txt | 4 ++++ test/test_optional.cpp | 10 ++++++++++ 3 files changed, 26 insertions(+) diff --git a/include/etl/optional.h b/include/etl/optional.h index a1ec6a64..08cf7805 100644 --- a/include/etl/optional.h +++ b/include/etl/optional.h @@ -313,6 +313,18 @@ namespace etl other = temp; } + //*************************************************************************** + /// Reset back to invalid. + //*************************************************************************** + void reset() + { + if (valid) + { + storage.template get_reference().~T(); + valid = false; + } + } + private: typename etl::aligned_storage_as::type storage; diff --git a/support/Release notes.txt b/support/Release notes.txt index 1f55c588..58b72831 100644 --- a/support/Release notes.txt +++ b/support/Release notes.txt @@ -1,3 +1,7 @@ +=============================================================================== +11.00.1 +Added reset() to etl::optional + =============================================================================== 11.00.0 New directory structure. diff --git a/test/test_optional.cpp b/test/test_optional.cpp index e0d081f4..a8b2d665 100644 --- a/test/test_optional.cpp +++ b/test/test_optional.cpp @@ -396,5 +396,15 @@ namespace CHECK_EQUAL(data1, original2); CHECK_EQUAL(data2, original1); } + + //************************************************************************* + TEST(test_reset) + { + etl::optional data(Data("1")); + CHECK(bool(data)); + + data.reset(); + CHECK(!bool(data)); + } }; } From ab65a5abaa8bf1ccd74e1845f3b39fddcea10934 Mon Sep 17 00:00:00 2001 From: John Wellbelove Date: Sun, 25 Mar 2018 14:34:28 +0100 Subject: [PATCH 8/9] Added std::initializer_list constructors when ETL_CPP11_SUPPORTED is defined as 1 --- include/etl/basic_string.h | 36 ++++++++-------- include/etl/cstring.h | 33 ++++++++++---- include/etl/deque.h | 29 ++++++++++--- include/etl/flat_map.h | 23 ++++++++-- include/etl/flat_multimap.h | 23 ++++++++-- include/etl/flat_multiset.h | 23 ++++++++-- include/etl/flat_set.h | 23 ++++++++-- include/etl/forward_list.h | 27 +++++++++--- include/etl/list.h | 31 ++++++++++---- include/etl/map.h | 27 +++++++++--- include/etl/multimap.h | 25 ++++++++--- include/etl/multiset.h | 25 ++++++++--- include/etl/set.h | 25 ++++++++--- include/etl/u16string.h | 41 ++++++++++++------ include/etl/u32string.h | 41 ++++++++++++------ include/etl/vector.h | 62 +++++++++++++++++++-------- include/etl/wstring.h | 37 +++++++++++----- test/test_deque.cpp | 10 +++++ test/test_flat_map.cpp | 32 +++++++------- test/test_flat_multimap.cpp | 38 +++++++++------- test/test_flat_multiset.cpp | 16 +++++++ test/test_flat_set.cpp | 16 +++++++ test/test_forward_list.cpp | 17 ++++++++ test/test_list.cpp | 15 +++++++ test/test_map.cpp | 19 ++++++++ test/test_multimap.cpp | 19 ++++++++ test/test_multiset.cpp | 14 ++++++ test/test_reference_flat_map.cpp | 16 ------- test/test_reference_flat_multimap.cpp | 16 ------- test/test_reference_flat_multiset.cpp | 16 ------- test/test_set.cpp | 17 ++++++++ test/test_string_char.cpp | 10 +++++ test/test_string_u16.cpp | 10 +++++ test/test_string_u32.cpp | 10 +++++ test/test_string_wchar_t.cpp | 10 +++++ test/test_vector.cpp | 10 +++++ test/test_vector_non_trivial.cpp | 10 +++++ test/test_vector_pointer.cpp | 16 +++++++ 38 files changed, 648 insertions(+), 220 deletions(-) diff --git a/include/etl/basic_string.h b/include/etl/basic_string.h index 106803c6..f6741eea 100644 --- a/include/etl/basic_string.h +++ b/include/etl/basic_string.h @@ -1466,9 +1466,9 @@ namespace etl int compare(const ibasic_string& str) const { return compare(p_buffer, - p_buffer + size(), - str.p_buffer, - str.p_buffer + str.size()); + p_buffer + size(), + str.p_buffer, + str.p_buffer + str.size()); } //************************************************************************* @@ -1482,9 +1482,9 @@ namespace etl length_ = std::min(length_, size() - position); return compare(p_buffer + position, - p_buffer + position + length_, - str.p_buffer, - str.p_buffer + str.size()); + p_buffer + position + length_, + str.p_buffer, + str.p_buffer + str.size()); } //************************************************************************* @@ -1500,9 +1500,9 @@ namespace etl sublength = std::min(sublength, str.size() - subposition); return compare(p_buffer + position, - p_buffer + position + length_, - str.p_buffer + subposition, - str.p_buffer + subposition + sublength); + p_buffer + position + length_, + str.p_buffer + subposition, + str.p_buffer + subposition + sublength); } //************************************************************************* @@ -1511,9 +1511,9 @@ namespace etl int compare(const value_type* s) const { return compare(p_buffer, - p_buffer + size(), - s, - s + etl::strlen(s)); + p_buffer + size(), + s, + s + etl::strlen(s)); } //************************************************************************* @@ -1522,9 +1522,9 @@ namespace etl int compare(size_t position, size_t length_, const_pointer s) const { return compare(p_buffer + position, - p_buffer + position + length_, - s, - s + etl::strlen(s)); + p_buffer + position + length_, + s, + s + etl::strlen(s)); } //************************************************************************* @@ -1533,9 +1533,9 @@ namespace etl int compare(size_t position, size_t length_, const_pointer s, size_t n) const { return compare(p_buffer + position, - p_buffer + position + length_, - s, - s + n);; + p_buffer + position + length_, + s, + s + n); } //********************************************************************* diff --git a/include/etl/cstring.h b/include/etl/cstring.h index 36e60233..d9f69f16 100644 --- a/include/etl/cstring.h +++ b/include/etl/cstring.h @@ -35,6 +35,10 @@ SOFTWARE. #include "basic_string.h" #include "hash.h" +#if ETL_CPP11_SUPPORTED + #include +#endif + #if defined(ETL_COMPILER_MICROSOFT) #undef min #endif @@ -63,7 +67,7 @@ namespace etl string() : istring(reinterpret_cast(&buffer), MAX_SIZE) { - istring::initialise(); + this->initialise(); } //************************************************************************* @@ -73,7 +77,7 @@ namespace etl string(const etl::string& other) : istring(reinterpret_cast(&buffer), MAX_SIZE) { - istring::assign(other.begin(), other.end()); + this->assign(other.begin(), other.end()); } //************************************************************************* @@ -90,7 +94,7 @@ namespace etl // Set the length to the exact amount. length_ = (length_ > MAX_SIZE_) ? MAX_SIZE_ : length_; - istring::assign(other.begin() + position, other.begin() + position + length_); + this->assign(other.begin() + position, other.begin() + position + length_); } //************************************************************************* @@ -100,7 +104,7 @@ namespace etl string(const value_type* text) : istring(reinterpret_cast(&buffer), MAX_SIZE) { - istring::assign(text, text + etl::char_traits::length(text)); + this->assign(text, text + etl::char_traits::length(text)); } //************************************************************************* @@ -111,7 +115,7 @@ namespace etl string(const value_type* text, size_t count) : istring(reinterpret_cast(&buffer), MAX_SIZE) { - istring::assign(text, text + count); + this->assign(text, text + count); } //************************************************************************* @@ -122,8 +126,8 @@ namespace etl string(size_t count, value_type c) : istring(reinterpret_cast(&buffer), MAX_SIZE) { - istring::initialise(); - istring::resize(count, c); + this->initialise(); + this->resize(count, c); } //************************************************************************* @@ -136,9 +140,20 @@ namespace etl string(TIterator first, TIterator last) : istring(reinterpret_cast(&buffer), MAX_SIZE) { - istring::assign(first, last); + this->assign(first, last); } +#if ETL_CPP11_SUPPORTED + //************************************************************************* + /// Construct from initializer_list. + //************************************************************************* + string(std::initializer_list init) + : istring(reinterpret_cast(&buffer), MAX_SIZE) + { + this->assign(init.begin(), init.end()); + } +#endif + //************************************************************************* /// Returns a sub-string. ///\param position The position of the first character. Default = 0. @@ -167,7 +182,7 @@ namespace etl { if (&rhs != this) { - istring::assign(rhs.cbegin(), rhs.cend()); + this->assign(rhs.cbegin(), rhs.cend()); } return *this; diff --git a/include/etl/deque.h b/include/etl/deque.h index 0d0966cd..dd487002 100644 --- a/include/etl/deque.h +++ b/include/etl/deque.h @@ -48,8 +48,12 @@ SOFTWARE. #include "type_traits.h" #include "parameter_type.h" +#if ETL_CPP11_SUPPORTED + #include +#endif + #ifdef ETL_COMPILER_MICROSOFT -#undef min + #undef min #endif #undef ETL_FILE @@ -2022,7 +2026,7 @@ namespace etl deque() : etl::ideque(reinterpret_cast(&buffer[0]), MAX_SIZE, BUFFER_SIZE) { - etl::ideque::initialise(); + this->initialise(); } //************************************************************************* @@ -2030,7 +2034,7 @@ namespace etl //************************************************************************* ~deque() { - etl::ideque::initialise(); + this->initialise(); } //************************************************************************* @@ -2041,7 +2045,7 @@ namespace etl { if (this != &other) { - etl::ideque::assign(other.begin(), other.end()); + this->assign(other.begin(), other.end()); } } @@ -2052,7 +2056,7 @@ namespace etl deque(TIterator begin_, TIterator end_) : etl::ideque(reinterpret_cast(&buffer[0]), MAX_SIZE, BUFFER_SIZE) { - etl::ideque::assign(begin_, end_); + this->assign(begin_, end_); } //************************************************************************* @@ -2061,9 +2065,20 @@ namespace etl explicit deque(size_t n, typename etl::ideque::parameter_t value = value_type()) : etl::ideque(reinterpret_cast(&buffer[0]), MAX_SIZE, BUFFER_SIZE) { - etl::ideque::assign(n, value); + this->assign(n, value); } +#if ETL_CPP11_SUPPORTED + //************************************************************************* + /// Construct from initializer_list. + //************************************************************************* + deque(std::initializer_list init) + : ideque(reinterpret_cast(&buffer[0]), MAX_SIZE, BUFFER_SIZE) + { + this->assign(init.begin(), init.end()); + } +#endif + //************************************************************************* /// Assignment operator. //************************************************************************* @@ -2071,7 +2086,7 @@ namespace etl { if (&rhs != this) { - etl::ideque::assign(rhs.begin(), rhs.end()); + this->assign(rhs.begin(), rhs.end()); } return *this; diff --git a/include/etl/flat_map.h b/include/etl/flat_map.h index e9b799cd..abd423b4 100644 --- a/include/etl/flat_map.h +++ b/include/etl/flat_map.h @@ -35,6 +35,10 @@ SOFTWARE. #include "reference_flat_map.h" #include "pool.h" +#if ETL_CPP11_SUPPORTED + #include +#endif + #undef ETL_FILE #define ETL_FILE "2" @@ -834,7 +838,7 @@ namespace etl flat_map(const flat_map& other) : etl::iflat_map(lookup, storage) { - etl::iflat_map::assign(other.cbegin(), other.cend()); + this->assign(other.cbegin(), other.cend()); } //************************************************************************* @@ -847,15 +851,26 @@ namespace etl flat_map(TIterator first, TIterator last) : etl::iflat_map(lookup, storage) { - etl::iflat_map::assign(first, last); + this->assign(first, last); } +#if ETL_CPP11_SUPPORTED + //************************************************************************* + /// Construct from initializer_list. + //************************************************************************* + flat_map(std::initializer_list::value_type> init) + : etl::iflat_map(lookup, storage) + { + this->assign(init.begin(), init.end()); + } +#endif + //************************************************************************* /// Destructor. //************************************************************************* ~flat_map() { - etl::iflat_map::clear(); + this->clear(); } //************************************************************************* @@ -865,7 +880,7 @@ namespace etl { if (&rhs != this) { - etl::iflat_map::assign(rhs.cbegin(), rhs.cend()); + this->assign(rhs.cbegin(), rhs.cend()); } return *this; diff --git a/include/etl/flat_multimap.h b/include/etl/flat_multimap.h index 4ef7901e..25b6a36d 100644 --- a/include/etl/flat_multimap.h +++ b/include/etl/flat_multimap.h @@ -35,6 +35,10 @@ SOFTWARE. #include "reference_flat_multimap.h" #include "pool.h" +#if ETL_CPP11_SUPPORTED + #include +#endif + #undef ETL_FILE #define ETL_FILE "3" @@ -715,7 +719,7 @@ namespace etl flat_multimap(const flat_multimap& other) : etl::iflat_multimap(lookup, storage) { - etl::iflat_multimap::assign(other.cbegin(), other.cend()); + this->assign(other.cbegin(), other.cend()); } //************************************************************************* @@ -728,15 +732,26 @@ namespace etl flat_multimap(TIterator first, TIterator last) : etl::iflat_multimap(lookup, storage) { - etl::iflat_multimap::assign(first, last); + this->assign(first, last); } +#if ETL_CPP11_SUPPORTED + //************************************************************************* + /// Construct from initializer_list. + //************************************************************************* + flat_multimap(std::initializer_list::value_type> init) + : etl::iflat_multimap(lookup, storage) + { + this->assign(init.begin(), init.end()); + } +#endif + //************************************************************************* /// Destructor. //************************************************************************* ~flat_multimap() { - etl::iflat_multimap::clear(); + this->clear(); } //************************************************************************* @@ -746,7 +761,7 @@ namespace etl { if (&rhs != this) { - etl::iflat_multimap::assign(rhs.cbegin(), rhs.cend()); + this->assign(rhs.cbegin(), rhs.cend()); } return *this; diff --git a/include/etl/flat_multiset.h b/include/etl/flat_multiset.h index 2ec645a1..c47dff0d 100644 --- a/include/etl/flat_multiset.h +++ b/include/etl/flat_multiset.h @@ -35,6 +35,10 @@ SOFTWARE. #include "reference_flat_multiset.h" #include "pool.h" +#if ETL_CPP11_SUPPORTED + #include +#endif + #undef ETL_FILE #define ETL_FILE "4" @@ -674,7 +678,7 @@ namespace etl flat_multiset(const flat_multiset& other) : iflat_multiset(lookup, storage) { - etl::iflat_multiset::assign(other.cbegin(), other.cend()); + this->assign(other.cbegin(), other.cend()); } //************************************************************************* @@ -687,15 +691,26 @@ namespace etl flat_multiset(TIterator first, TIterator last) : iflat_multiset(lookup, storage) { - etl::iflat_multiset::assign(first, last); + this->assign(first, last); } +#if ETL_CPP11_SUPPORTED + //************************************************************************* + /// Construct from initializer_list. + //************************************************************************* + flat_multiset(std::initializer_list init) + : iflat_multiset(lookup, storage) + { + this->assign(init.begin(), init.end()); + } +#endif + //************************************************************************* /// Destructor. //************************************************************************* ~flat_multiset() { - etl::iflat_multiset::clear(); + this->clear(); } //************************************************************************* @@ -705,7 +720,7 @@ namespace etl { if (&rhs != this) { - etl::iflat_multiset::assign(rhs.cbegin(), rhs.cend()); + this->assign(rhs.cbegin(), rhs.cend()); } return *this; diff --git a/include/etl/flat_set.h b/include/etl/flat_set.h index 49e8b12f..5366c0e8 100644 --- a/include/etl/flat_set.h +++ b/include/etl/flat_set.h @@ -35,6 +35,10 @@ SOFTWARE. #include "reference_flat_set.h" #include "pool.h" +#if ETL_CPP11_SUPPORTED + #include +#endif + #undef ETL_FILE #define ETL_FILE "5" @@ -740,7 +744,7 @@ namespace etl flat_set(const flat_set& other) : etl::iflat_set(lookup, storage) { - etl::iflat_set::assign(other.cbegin(), other.cend()); + this->assign(other.cbegin(), other.cend()); } //************************************************************************* @@ -753,15 +757,26 @@ namespace etl flat_set(TIterator first, TIterator last) : etl::iflat_set(lookup, storage) { - etl::iflat_set::assign(first, last); + this->assign(first, last); } +#if ETL_CPP11_SUPPORTED + //************************************************************************* + /// Construct from initializer_list. + //************************************************************************* + flat_set(std::initializer_list init) + : etl::iflat_set(lookup, storage) + { + this->assign(init.begin(), init.end()); + } +#endif + //************************************************************************* /// Destructor. //************************************************************************* ~flat_set() { - etl::iflat_set::clear(); + this->clear(); } //************************************************************************* @@ -771,7 +786,7 @@ namespace etl { if (&rhs != this) { - etl::iflat_set::assign(rhs.cbegin(), rhs.cend()); + this->assign(rhs.cbegin(), rhs.cend()); } return *this; diff --git a/include/etl/forward_list.h b/include/etl/forward_list.h index e9a2fc08..eaf5fcd0 100644 --- a/include/etl/forward_list.h +++ b/include/etl/forward_list.h @@ -46,6 +46,10 @@ SOFTWARE. #include "type_traits.h" #include "parameter_type.h" +#if ETL_CPP11_SUPPORTED + #include +#endif + #ifdef ETL_COMPILER_MICROSOFT #undef min #endif @@ -1382,7 +1386,7 @@ namespace etl forward_list() : etl::iforward_list(node_pool, MAX_SIZE) { - etl::iforward_list::initialise(); + this->initialise(); } //************************************************************************* @@ -1391,7 +1395,7 @@ namespace etl explicit forward_list(size_t initial_size, typename etl::iforward_list::parameter_t value = T()) : etl::iforward_list(node_pool, MAX_SIZE) { - etl::iforward_list::assign(initial_size, value); + this->assign(initial_size, value); } //************************************************************************* @@ -1400,7 +1404,7 @@ namespace etl forward_list(const forward_list& other) : etl::iforward_list(node_pool, MAX_SIZE) { - etl::iforward_list::assign(other.cbegin(), other.cend()); + this->assign(other.cbegin(), other.cend()); } //************************************************************************* @@ -1410,15 +1414,26 @@ namespace etl forward_list(TIterator first, TIterator last) : etl::iforward_list(node_pool, MAX_SIZE) { - etl::iforward_list::assign(first, last); + this->assign(first, last); } +#if ETL_CPP11_SUPPORTED + //************************************************************************* + /// Construct from initializer_list. + //************************************************************************* + forward_list(std::initializer_list init) + : etl::iforward_list(node_pool, MAX_SIZE) + { + this->assign(init.begin(), init.end()); + } +#endif + //************************************************************************* /// Destructor. //************************************************************************* ~forward_list() { - etl::iforward_list::initialise(); + this->initialise(); } //************************************************************************* @@ -1428,7 +1443,7 @@ namespace etl { if (&rhs != this) { - etl::iforward_list::assign(rhs.cbegin(), rhs.cend()); + this->assign(rhs.cbegin(), rhs.cend()); } return *this; diff --git a/include/etl/list.h b/include/etl/list.h index 65f9efc0..8ed4e267 100644 --- a/include/etl/list.h +++ b/include/etl/list.h @@ -47,8 +47,12 @@ SOFTWARE. #include "parameter_type.h" #include "algorithm.h" +#if ETL_CPP11_SUPPORTED + #include +#endif + #ifdef ETL_COMPILER_MICROSOFT -#undef min + #undef min #endif #undef ETL_FILE @@ -1602,7 +1606,7 @@ namespace etl list() : etl::ilist(node_pool, MAX_SIZE) { - etl::ilist::initialise(); + this->initialise(); } //************************************************************************* @@ -1610,7 +1614,7 @@ namespace etl //************************************************************************* ~list() { - etl::ilist::initialise(); + this->initialise(); } //************************************************************************* @@ -1619,7 +1623,7 @@ namespace etl explicit list(size_t initial_size) : etl::ilist(node_pool, MAX_SIZE) { - etl::ilist::assign(initial_size, T()); + this->assign(initial_size, T()); } //************************************************************************* @@ -1628,7 +1632,7 @@ namespace etl list(size_t initial_size, typename ilist::parameter_t value) : etl::ilist(node_pool, MAX_SIZE) { - etl::ilist::assign(initial_size, value); + this->assign(initial_size, value); } //************************************************************************* @@ -1639,7 +1643,7 @@ namespace etl { if (this != &other) { - etl::ilist::assign(other.cbegin(), other.cend()); + this->assign(other.cbegin(), other.cend()); } } @@ -1650,9 +1654,20 @@ namespace etl list(TIterator first, TIterator last) : ilist(node_pool, MAX_SIZE) { - etl::ilist::assign(first, last); + this->assign(first, last); } +#if ETL_CPP11_SUPPORTED + //************************************************************************* + /// Construct from initializer_list. + //************************************************************************* + list(std::initializer_list init) + : ilist(node_pool, MAX_SIZE) + { + this->assign(init.begin(), init.end()); + } +#endif + //************************************************************************* /// Assignment operator. //************************************************************************* @@ -1660,7 +1675,7 @@ namespace etl { if (&rhs != this) { - etl::ilist::assign(rhs.cbegin(), rhs.cend()); + this->assign(rhs.cbegin(), rhs.cend()); } return *this; diff --git a/include/etl/map.h b/include/etl/map.h index 61695cec..19e04f43 100644 --- a/include/etl/map.h +++ b/include/etl/map.h @@ -47,8 +47,12 @@ SOFTWARE. #include "type_traits.h" #include "parameter_type.h" +#if ETL_CPP11_SUPPORTED + #include +#endif + #ifdef ETL_COMPILER_MICROSOFT -#undef min + #undef min #endif #undef ETL_FILE @@ -2036,7 +2040,7 @@ namespace etl map() : etl::imap(node_pool, MAX_SIZE) { - etl::imap::initialise(); + this->initialise(); } //************************************************************************* @@ -2045,7 +2049,7 @@ namespace etl map(const map& other) : etl::imap(node_pool, MAX_SIZE) { - etl::imap::assign(other.cbegin(), other.cend()); + this->assign(other.cbegin(), other.cend()); } //************************************************************************* @@ -2058,15 +2062,26 @@ namespace etl map(TIterator first, TIterator last) : etl::imap(node_pool, MAX_SIZE) { - etl::imap::assign(first, last); + this->assign(first, last); } +#if ETL_CPP11_SUPPORTED + //************************************************************************* + /// Constructor, from an initializer_list. + //************************************************************************* + map(std::initializer_list::value_type> init) + : etl::imap(node_pool, MAX_SIZE) + { + this->assign(init.begin(), init.end()); + } +#endif + //************************************************************************* /// Destructor. //************************************************************************* ~map() { - etl::imap::initialise(); + this->initialise(); } //************************************************************************* @@ -2077,7 +2092,7 @@ namespace etl // Skip if doing self assignment if (this != &rhs) { - etl::imap::assign(rhs.cbegin(), rhs.cend()); + this->assign(rhs.cbegin(), rhs.cend()); } return *this; diff --git a/include/etl/multimap.h b/include/etl/multimap.h index ebb93c89..fa032c0a 100644 --- a/include/etl/multimap.h +++ b/include/etl/multimap.h @@ -46,6 +46,10 @@ SOFTWARE. #include "type_traits.h" #include "parameter_type.h" +#if ETL_CPP11_SUPPORTED + #include +#endif + #ifdef ETL_COMPILER_MICROSOFT #undef min #endif @@ -1921,7 +1925,7 @@ namespace etl multimap() : etl::imultimap(node_pool, MAX_SIZE) { - etl::imultimap::initialise(); + this->initialise(); } //************************************************************************* @@ -1930,7 +1934,7 @@ namespace etl multimap(const multimap& other) : etl::imultimap(node_pool, MAX_SIZE) { - etl::imultimap::assign(other.cbegin(), other.cend()); + this->assign(other.cbegin(), other.cend()); } //************************************************************************* @@ -1943,15 +1947,26 @@ namespace etl multimap(TIterator first, TIterator last) : etl::imultimap(node_pool, MAX_SIZE) { - etl::imultimap::assign(first, last); + this->assign(first, last); } +#if ETL_CPP11_SUPPORTED + //************************************************************************* + /// Constructor, from an initializer_list. + //************************************************************************* + multimap(std::initializer_list::value_type> init) + : etl::imultimap(node_pool, MAX_SIZE) + { + this->assign(init.begin(), init.end()); + } +#endif + //************************************************************************* /// Destructor. //************************************************************************* ~multimap() { - etl::imultimap::initialise(); + this->initialise(); } //************************************************************************* @@ -1962,7 +1977,7 @@ namespace etl // Skip if doing self assignment if (this != &rhs) { - etl::imultimap::assign(rhs.cbegin(), rhs.cend()); + this->assign(rhs.cbegin(), rhs.cend()); } return *this; diff --git a/include/etl/multiset.h b/include/etl/multiset.h index 3d58d186..7bb0fff2 100644 --- a/include/etl/multiset.h +++ b/include/etl/multiset.h @@ -46,6 +46,10 @@ SOFTWARE. #include "nullptr.h" #include "type_traits.h" +#if ETL_CPP11_SUPPORTED + #include +#endif + #ifdef ETL_COMPILER_MICROSOFT #undef min #endif @@ -1901,7 +1905,7 @@ namespace etl multiset() : etl::imultiset(node_pool, MAX_SIZE) { - etl::imultiset::initialise(); + this->initialise(); } //************************************************************************* @@ -1910,7 +1914,7 @@ namespace etl multiset(const multiset& other) : etl::imultiset(node_pool, MAX_SIZE) { - etl::imultiset::assign(other.cbegin(), other.cend()); + this->assign(other.cbegin(), other.cend()); } //************************************************************************* @@ -1923,15 +1927,26 @@ namespace etl multiset(TIterator first, TIterator last) : etl::imultiset(node_pool, MAX_SIZE) { - etl::imultiset::assign(first, last); + this->assign(first, last); } +#if ETL_CPP11_SUPPORTED + //************************************************************************* + /// Constructor, from an initializer_list. + //************************************************************************* + multiset(std::initializer_list::value_type> init) + : etl::imultiset(node_pool, MAX_SIZE) + { + this->assign(init.begin(), init.end()); + } +#endif + //************************************************************************* /// Destructor. //************************************************************************* ~multiset() { - etl::imultiset::initialise(); + this->initialise(); } //************************************************************************* @@ -1942,7 +1957,7 @@ namespace etl // Skip if doing self assignment if (this != &rhs) { - etl::imultiset::assign(rhs.cbegin(), rhs.cend()); + this->assign(rhs.cbegin(), rhs.cend()); } return *this; diff --git a/include/etl/set.h b/include/etl/set.h index a3040c57..0db42f38 100644 --- a/include/etl/set.h +++ b/include/etl/set.h @@ -46,6 +46,10 @@ SOFTWARE. #include "type_traits.h" #include "parameter_type.h" +#if ETL_CPP11_SUPPORTED + #include +#endif + #ifdef ETL_COMPILER_MICROSOFT #undef min #endif @@ -1959,7 +1963,7 @@ namespace etl set() : etl::iset(node_pool, MAX_SIZE) { - etl::iset::initialise(); + this->initialise(); } //************************************************************************* @@ -1968,7 +1972,7 @@ namespace etl set(const set& other) : etl::iset(node_pool, MAX_SIZE) { - etl::iset::assign(other.cbegin(), other.cend()); + this->assign(other.cbegin(), other.cend()); } //************************************************************************* @@ -1981,15 +1985,26 @@ namespace etl set(TIterator first, TIterator last) : etl::iset(node_pool, MAX_SIZE) { - etl::iset::assign(first, last); + this->assign(first, last); } +#if ETL_CPP11_SUPPORTED + //************************************************************************* + /// Constructor, from an initializer_list. + //************************************************************************* + set(std::initializer_list::value_type> init) + : etl::iset(node_pool, MAX_SIZE) + { + this->assign(init.begin(), init.end()); + } +#endif + //************************************************************************* /// Destructor. //************************************************************************* ~set() { - etl::iset::initialise(); + this->initialise(); } //************************************************************************* @@ -2000,7 +2015,7 @@ namespace etl // Skip if doing self assignment if (this != &rhs) { - etl::iset::assign(rhs.cbegin(), rhs.cend()); + this->assign(rhs.cbegin(), rhs.cend()); } return *this; diff --git a/include/etl/u16string.h b/include/etl/u16string.h index 107ccfcb..b9d81f04 100644 --- a/include/etl/u16string.h +++ b/include/etl/u16string.h @@ -35,6 +35,10 @@ SOFTWARE. #include "basic_string.h" #include "hash.h" +#if ETL_CPP11_SUPPORTED + #include +#endif + #if defined(ETL_COMPILER_MICROSOFT) #undef min #endif @@ -63,7 +67,7 @@ namespace etl u16string() : iu16string(reinterpret_cast(&buffer), MAX_SIZE) { - iu16string::initialise(); + this->initialise(); } //************************************************************************* @@ -73,8 +77,8 @@ namespace etl u16string(const etl::u16string& other) : iu16string(reinterpret_cast(&buffer), MAX_SIZE) { - iu16string::initialise(); - iu16string::assign(other.begin(), other.end()); + this->initialise(); + this->assign(other.begin(), other.end()); } //************************************************************************* @@ -91,8 +95,8 @@ namespace etl // Set the length to the exact amount. length_ = (length_ > MAX_SIZE_) ? MAX_SIZE_ : length_; - iu16string::initialise(); - iu16string::assign(other.begin() + position, other.begin() + position + length_); + this->initialise(); + this->assign(other.begin() + position, other.begin() + position + length_); } //************************************************************************* @@ -102,8 +106,8 @@ namespace etl u16string(const value_type* text) : iu16string(reinterpret_cast(&buffer), MAX_SIZE) { - iu16string::initialise(); - iu16string::assign(text, text + etl::char_traits::length(text)); + this->initialise(); + this->assign(text, text + etl::char_traits::length(text)); } //************************************************************************* @@ -114,8 +118,8 @@ namespace etl u16string(const value_type* text, size_t count) : iu16string(reinterpret_cast(&buffer), MAX_SIZE) { - iu16string::initialise(); - iu16string::assign(text, text + count); + this->initialise(); + this->assign(text, text + count); } //************************************************************************* @@ -126,8 +130,8 @@ namespace etl u16string(size_t count, value_type c) : iu16string(reinterpret_cast(&buffer), MAX_SIZE) { - iu16string::initialise(); - iu16string::resize(count, c); + this->initialise(); + this->resize(count, c); } //************************************************************************* @@ -140,9 +144,20 @@ namespace etl u16string(TIterator first, TIterator last) : iu16string(reinterpret_cast(&buffer), MAX_SIZE) { - iu16string::assign(first, last); + this->assign(first, last); } +#if ETL_CPP11_SUPPORTED + //************************************************************************* + /// Construct from initializer_list. + //************************************************************************* + u16string(std::initializer_list init) + : iu16string(reinterpret_cast(&buffer), MAX_SIZE) + { + this->assign(init.begin(), init.end()); + } +#endif + //************************************************************************* /// Returns a sub-string. ///\param position The position of the first character. Default = 0. @@ -171,7 +186,7 @@ namespace etl { if (&rhs != this) { - iu16string::assign(rhs.cbegin(), rhs.cend()); + this->assign(rhs.cbegin(), rhs.cend()); } return *this; diff --git a/include/etl/u32string.h b/include/etl/u32string.h index 590c7534..8df0ccd6 100644 --- a/include/etl/u32string.h +++ b/include/etl/u32string.h @@ -35,6 +35,10 @@ SOFTWARE. #include "basic_string.h" #include "hash.h" +#if ETL_CPP11_SUPPORTED + #include +#endif + #if defined(ETL_COMPILER_MICROSOFT) #undef min #endif @@ -63,7 +67,7 @@ namespace etl u32string() : iu32string(reinterpret_cast(&buffer), MAX_SIZE) { - iu32string::initialise(); + this->initialise(); } //************************************************************************* @@ -73,8 +77,8 @@ namespace etl u32string(const etl::u32string& other) : iu32string(reinterpret_cast(&buffer), MAX_SIZE) { - iu32string::initialise(); - iu32string::assign(other.begin(), other.end()); + this->initialise(); + this->assign(other.begin(), other.end()); } //************************************************************************* @@ -91,8 +95,8 @@ namespace etl // Set the length to the exact amount. length_ = (length_ > MAX_SIZE_) ? MAX_SIZE_ : length_; - iu32string::initialise(); - iu32string::assign(other.begin() + position, other.begin() + position + length_); + this->initialise(); + this->assign(other.begin() + position, other.begin() + position + length_); } //************************************************************************* @@ -102,8 +106,8 @@ namespace etl u32string(const value_type* text) : iu32string(reinterpret_cast(&buffer), MAX_SIZE) { - iu32string::initialise(); - iu32string::assign(text, text + etl::char_traits::length(text)); + this->initialise(); + this->assign(text, text + etl::char_traits::length(text)); } //************************************************************************* @@ -114,8 +118,8 @@ namespace etl u32string(const value_type* text, size_t count) : iu32string(reinterpret_cast(&buffer), MAX_SIZE) { - iu32string::initialise(); - iu32string::assign(text, text + count); + this->initialise(); + this->assign(text, text + count); } //************************************************************************* @@ -126,8 +130,8 @@ namespace etl u32string(size_t count, value_type c) : iu32string(reinterpret_cast(&buffer), MAX_SIZE) { - iu32string::initialise(); - iu32string::resize(count, c); + this->initialise(); + this->resize(count, c); } //************************************************************************* @@ -140,9 +144,20 @@ namespace etl u32string(TIterator first, TIterator last) : iu32string(reinterpret_cast(&buffer), MAX_SIZE) { - iu32string::assign(first, last); + this->assign(first, last); } +#if ETL_CPP11_SUPPORTED + //************************************************************************* + /// Construct from initializer_list. + //************************************************************************* + u32string(std::initializer_list init) + : iu32string(reinterpret_cast(&buffer), MAX_SIZE) + { + this->assign(init.begin(), init.end()); + } +#endif + //************************************************************************* /// Returns a sub-string. ///\param position The position of the first character. Default = 0. @@ -171,7 +186,7 @@ namespace etl { if (&rhs != this) { - iu32string::assign(rhs.cbegin(), rhs.cend()); + this->assign(rhs.cbegin(), rhs.cend()); } return *this; diff --git a/include/etl/vector.h b/include/etl/vector.h index bbc8b820..4a7a9e73 100644 --- a/include/etl/vector.h +++ b/include/etl/vector.h @@ -53,8 +53,12 @@ SOFTWARE. #include "debug_count.h" #include "private/vector_base.h" +#if ETL_CPP11_SUPPORTED + #include +#endif + #ifdef ETL_COMPILER_GCC -#pragma GCC diagnostic ignored "-Wunused-variable" + #pragma GCC diagnostic ignored "-Wunused-variable" #endif //***************************************************************************** @@ -1071,7 +1075,7 @@ namespace etl vector() : etl::ivector(reinterpret_cast(&buffer), MAX_SIZE) { - etl::ivector::initialise(); + this->initialise(); } //************************************************************************* @@ -1081,8 +1085,8 @@ namespace etl explicit vector(size_t initial_size) : etl::ivector(reinterpret_cast(&buffer), MAX_SIZE) { - etl::ivector::initialise(); - etl::ivector::resize(initial_size); + this->initialise(); + this->resize(initial_size); } //************************************************************************* @@ -1093,8 +1097,8 @@ namespace etl vector(size_t initial_size, typename etl::ivector::parameter_t value) : etl::ivector(reinterpret_cast(&buffer), MAX_SIZE) { - etl::ivector::initialise(); - etl::ivector::resize(initial_size, value); + this->initialise(); + this->resize(initial_size, value); } //************************************************************************* @@ -1107,16 +1111,27 @@ namespace etl vector(TIterator first, TIterator last) : etl::ivector(reinterpret_cast(&buffer), MAX_SIZE) { - etl::ivector::assign(first, last); + this->assign(first, last); } +#if ETL_CPP11_SUPPORTED + //************************************************************************* + /// Constructor, from an initializer_list. + //************************************************************************* + vector(std::initializer_list init) + : etl::ivector(reinterpret_cast(&buffer), MAX_SIZE) + { + this->assign(init.begin(), init.end()); + } +#endif + //************************************************************************* /// Copy constructor. //************************************************************************* vector(const vector& other) : etl::ivector(reinterpret_cast(&buffer), MAX_SIZE) { - etl::ivector::assign(other.begin(), other.end()); + this->assign(other.begin(), other.end()); } //************************************************************************* @@ -1124,7 +1139,7 @@ namespace etl //************************************************************************* ~vector() { - etl::ivector::clear(); + this->clear(); } //************************************************************************* @@ -1134,7 +1149,7 @@ namespace etl { if (&rhs != this) { - etl::ivector::assign(rhs.cbegin(), rhs.cend()); + this->assign(rhs.cbegin(), rhs.cend()); } return *this; @@ -1176,7 +1191,7 @@ namespace etl vector() : etl::ivector(reinterpret_cast(&buffer), MAX_SIZE) { - etl::ivector::initialise(); + this->initialise(); } //************************************************************************* @@ -1186,8 +1201,8 @@ namespace etl explicit vector(size_t initial_size) : etl::ivector(reinterpret_cast(&buffer), MAX_SIZE) { - etl::ivector::initialise(); - etl::ivector::resize(initial_size); + this->initialise(); + this->resize(initial_size); } //************************************************************************* @@ -1198,8 +1213,8 @@ namespace etl vector(size_t initial_size, typename etl::ivector::parameter_t value) : etl::ivector(reinterpret_cast(&buffer), MAX_SIZE) { - etl::ivector::initialise(); - etl::ivector::resize(initial_size, value); + this->initialise(); + this->resize(initial_size, value); } //************************************************************************* @@ -1212,16 +1227,27 @@ namespace etl vector(TIterator first, TIterator last) : etl::ivector(reinterpret_cast(&buffer), MAX_SIZE) { - etl::ivector::assign(first, last); + this->assign(first, last); } +#if ETL_CPP11_SUPPORTED + //************************************************************************* + /// Constructor, from an initializer_list. + //************************************************************************* + vector(std::initializer_list init) + : etl::ivector(reinterpret_cast(&buffer), MAX_SIZE) + { + this->assign(init.begin(), init.end()); + } +#endif + //************************************************************************* /// Copy constructor. //************************************************************************* vector(const vector& other) : etl::ivector(reinterpret_cast(&buffer), MAX_SIZE) { - etl::ivector::assign(other.begin(), other.end()); + this->assign(other.begin(), other.end()); } //************************************************************************* @@ -1231,7 +1257,7 @@ namespace etl { if (&rhs != this) { - etl::ivector::assign(rhs.cbegin(), rhs.cend()); + this->assign(rhs.cbegin(), rhs.cend()); } return *this; diff --git a/include/etl/wstring.h b/include/etl/wstring.h index 99b1979a..7a2a94ce 100644 --- a/include/etl/wstring.h +++ b/include/etl/wstring.h @@ -35,6 +35,10 @@ SOFTWARE. #include "basic_string.h" #include "hash.h" +#if ETL_CPP11_SUPPORTED + #include +#endif + #if defined(ETL_COMPILER_MICROSOFT) #undef min #endif @@ -63,7 +67,7 @@ namespace etl wstring() : iwstring(reinterpret_cast(&buffer), MAX_SIZE) { - iwstring::initialise(); + this->initialise(); } //************************************************************************* @@ -92,8 +96,8 @@ namespace etl // Set the length to the exact amount. length_ = (length_ > MAX_SIZE_) ? MAX_SIZE_ : length_; - iwstring::initialise(); - iwstring::assign(other.begin() + position, other.begin() + position + length_); + this->initialise(); + this->assign(other.begin() + position, other.begin() + position + length_); } //************************************************************************* @@ -103,8 +107,8 @@ namespace etl wstring(const value_type* text) : iwstring(reinterpret_cast(&buffer), MAX_SIZE) { - iwstring::initialise(); - iwstring::assign(text, text + etl::char_traits::length(text)); + this->initialise(); + this->assign(text, text + etl::char_traits::length(text)); } //************************************************************************* @@ -115,8 +119,8 @@ namespace etl wstring(const value_type* text, size_t count) : iwstring(reinterpret_cast(&buffer), MAX_SIZE) { - iwstring::initialise(); - iwstring::assign(text, text + count); + this->initialise(); + this->assign(text, text + count); } //************************************************************************* @@ -127,8 +131,8 @@ namespace etl wstring(size_t count, value_type c) : iwstring(reinterpret_cast(&buffer), MAX_SIZE) { - iwstring::initialise(); - iwstring::resize(count, c); + this->initialise(); + this->resize(count, c); } //************************************************************************* @@ -141,9 +145,20 @@ namespace etl wstring(TIterator first, TIterator last) : iwstring(reinterpret_cast(&buffer), MAX_SIZE) { - iwstring::assign(first, last); + this->assign(first, last); } +#if ETL_CPP11_SUPPORTED + //************************************************************************* + /// Construct from initializer_list. + //************************************************************************* + wstring(std::initializer_list init) + : iwstring(reinterpret_cast(&buffer), MAX_SIZE) + { + this->assign(init.begin(), init.end()); + } +#endif + //************************************************************************* /// Returns a sub-string. ///\param position The position of the first character. Default = 0. @@ -172,7 +187,7 @@ namespace etl { if (&rhs != this) { - iwstring::assign(rhs.cbegin(), rhs.cend()); + this->assign(rhs.cbegin(), rhs.cend()); } return *this; diff --git a/test/test_deque.cpp b/test/test_deque.cpp index 0bd71a7e..869bdfcd 100644 --- a/test/test_deque.cpp +++ b/test/test_deque.cpp @@ -136,6 +136,16 @@ namespace CHECK(std::equal(compare_data.begin(), compare_data.end(), data.begin())); } + //************************************************************************* + TEST(test_constructor_initializer_list) + { + Compare_Data compare_data = { N0, N1, N2, N3 }; + DataNDC data = { N0, N1, N2, N3 }; + + CHECK_EQUAL(compare_data.size(), data.size()); + CHECK(std::equal(compare_data.begin(), compare_data.end(), data.begin())); + } + //************************************************************************* TEST(test_copy_constructor) { diff --git a/test/test_flat_map.cpp b/test/test_flat_map.cpp index d00387e0..c290da7f 100644 --- a/test/test_flat_map.cpp +++ b/test/test_flat_map.cpp @@ -189,22 +189,6 @@ namespace return true; } - //************************************************************************* -// std::ostream& operator <<(std::ostream& os, const DataDC::iterator& itr) -// { -// os << itr->first; - -// return os; -// } - - //************************************************************************* -// std::ostream& operator <<(std::ostream& os, const DataDC::const_iterator& itr) -// { -// os << itr->first; - -// return os; -// } - //************************************************************************* std::ostream& operator <<(std::ostream& os, const DataNDC::iterator& itr) { @@ -351,6 +335,22 @@ namespace CHECK(!data.empty()); } + //************************************************************************* + TEST_FIXTURE(SetupFixture, test_constructor_initializer_list) + { + Compare_DataNDC compare_data = { ElementNDC(0, N0), ElementNDC(1, N1), ElementNDC(2, N2), ElementNDC(3, N3), ElementNDC(4, N4) }; + + DataNDC data = { ElementNDC(0, N0), ElementNDC(1, N1), ElementNDC(2, N2), ElementNDC(3, N3), ElementNDC(4, N4) }; + + CHECK_EQUAL(compare_data.size(), data.size()); + CHECK(!data.empty()); + + bool isEqual = std::equal(data.begin(), + data.end(), + compare_data.begin()); + CHECK(isEqual); + } + //************************************************************************* TEST_FIXTURE(SetupFixture, test_assignment) { diff --git a/test/test_flat_multimap.cpp b/test/test_flat_multimap.cpp index afec18e1..2c2486cb 100644 --- a/test/test_flat_multimap.cpp +++ b/test/test_flat_multimap.cpp @@ -215,22 +215,6 @@ namespace return true; } - //************************************************************************* -// std::ostream& operator <<(std::ostream& os, const DataDC::iterator& itr) -// { -// os << itr->first; - -// return os; -// } - - //************************************************************************* -// std::ostream& operator <<(std::ostream& os, const DataDC::const_iterator& itr) -// { -// os << itr->first; - -// return os; -// } - //************************************************************************* std::ostream& operator <<(std::ostream& os, const DataNDC::iterator& itr) { @@ -326,6 +310,28 @@ namespace CHECK(data.size() == SIZE); CHECK(!data.empty()); + + + bool isEqual = std::equal(data.begin(), + data.end(), + compare_data.begin()); + CHECK(isEqual); + } + + //************************************************************************* + TEST_FIXTURE(SetupFixture, test_constructor_initializer_list) + { + Compare_DataNDC compare_data = { ElementNDC(0, N0), ElementNDC(1, N1), ElementNDC(2, N2), ElementNDC(3, N3), ElementNDC(4, N4) }; + + DataNDC data = { ElementNDC(0, N0), ElementNDC(1, N1), ElementNDC(2, N2), ElementNDC(3, N3), ElementNDC(4, N4) }; + + CHECK_EQUAL(compare_data.size(), data.size()); + CHECK(!data.empty()); + + bool isEqual = std::equal(data.begin(), + data.end(), + compare_data.begin()); + CHECK(isEqual); } //************************************************************************* diff --git a/test/test_flat_multiset.cpp b/test/test_flat_multiset.cpp index 447de187..e9bccba0 100644 --- a/test/test_flat_multiset.cpp +++ b/test/test_flat_multiset.cpp @@ -281,6 +281,22 @@ namespace CHECK(!data.empty()); } + //************************************************************************* + TEST_FIXTURE(SetupFixture, test_constructor_initializer_list) + { + Compare_DataNDC compare_data = { N0, N0, N1, N2, N3, N1, N3, N3, N4, N2 }; + + DataNDC data = { N0, N0, N1, N2, N3, N1, N3, N3, N4, N2 }; + + CHECK_EQUAL(compare_data.size(), data.size()); + CHECK(!data.empty()); + + bool isEqual = std::equal(data.begin(), + data.end(), + compare_data.begin()); + CHECK(isEqual); + } + //************************************************************************* TEST_FIXTURE(SetupFixture, test_assignment) { diff --git a/test/test_flat_set.cpp b/test/test_flat_set.cpp index b7530a6d..1e0e9982 100644 --- a/test/test_flat_set.cpp +++ b/test/test_flat_set.cpp @@ -293,6 +293,22 @@ namespace CHECK(!data.empty()); } + //************************************************************************* + TEST_FIXTURE(SetupFixture, test_constructor_initializer_list) + { + Compare_DataNDC compare_data = { N0, N1, N2, N3, N4, N5, N6, N7, N8, N9 }; + + DataNDC data = { N0, N1, N2, N3, N4, N5, N6, N7, N8, N9 }; + + CHECK_EQUAL(compare_data.size(), data.size()); + CHECK(!data.empty()); + + bool isEqual = std::equal(data.begin(), + data.end(), + compare_data.begin()); + CHECK(isEqual); + } + //************************************************************************* TEST_FIXTURE(SetupFixture, test_assignment) { diff --git a/test/test_forward_list.cpp b/test/test_forward_list.cpp index c6e81f6c..98827bb3 100644 --- a/test/test_forward_list.cpp +++ b/test/test_forward_list.cpp @@ -124,9 +124,26 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_constructor_range) { + CompareDataNDC compare(sorted_data.begin(), sorted_data.end()); DataNDC data(sorted_data.begin(), sorted_data.end()); CHECK(!data.empty()); + + are_equal = std::equal(data.begin(), data.end(), compare.begin()); + + CHECK(are_equal); + } + + //************************************************************************* + TEST_FIXTURE(SetupFixture, test_constructor_initializer_list) + { + CompareDataNDC compare = { ItemNDC("0"), ItemNDC("1"), ItemNDC("2"), ItemNDC("3") }; + DataNDC data = { ItemNDC("0"), ItemNDC("1"), ItemNDC("2"), ItemNDC("3") }; + + CHECK(!data.empty()); + + are_equal = std::equal(data.begin(), data.end(), compare.begin()); + CHECK(are_equal); } //************************************************************************* diff --git a/test/test_list.cpp b/test/test_list.cpp index c0aaf9bd..a96e1127 100644 --- a/test/test_list.cpp +++ b/test/test_list.cpp @@ -162,6 +162,21 @@ namespace CHECK(!data.empty()); } + //************************************************************************* + TEST_FIXTURE(SetupFixture, test_constructor_initializer_list) + { + DataNDC data = { ItemNDC("0"), ItemNDC("1"), ItemNDC("2"), ItemNDC("3") }; + + CHECK_EQUAL(4U, data.size()); + + DataNDC::const_iterator i_item = data.begin(); + + CHECK_EQUAL(ItemNDC("0"), *i_item++); + CHECK_EQUAL(ItemNDC("1"), *i_item++); + CHECK_EQUAL(ItemNDC("2"), *i_item++); + CHECK_EQUAL(ItemNDC("3"), *i_item++); + } + //************************************************************************* TEST_FIXTURE(SetupFixture, test_copy_constructor) { diff --git a/test/test_map.cpp b/test/test_map.cpp index a23397b4..1881f0e2 100644 --- a/test/test_map.cpp +++ b/test/test_map.cpp @@ -206,6 +206,25 @@ namespace CHECK(!data.empty()); } + //************************************************************************* + TEST_FIXTURE(SetupFixture, test_constructor_initializer_list) + { + Compare_Data compare_data = { Data::value_type(std::string("0"), 0), Data::value_type(std::string("1"), 1), + Data::value_type(std::string("2"), 2), Data::value_type(std::string("3"), 3) }; + + Data data = { Data::value_type(std::string("0"), 0), Data::value_type(std::string("1"), 1), + Data::value_type(std::string("2"), 2), Data::value_type(std::string("3"), 3) }; + + CHECK_EQUAL(compare_data.size(), data.size()); + CHECK(!data.empty()); + + bool isEqual = Check_Equal(data.begin(), + data.end(), + compare_data.begin()); + + CHECK(isEqual); + } + //************************************************************************* TEST_FIXTURE(SetupFixture, test_assignment) { diff --git a/test/test_multimap.cpp b/test/test_multimap.cpp index d71dc01e..9954afbc 100644 --- a/test/test_multimap.cpp +++ b/test/test_multimap.cpp @@ -203,6 +203,25 @@ namespace CHECK(!data.empty()); } + //************************************************************************* + TEST_FIXTURE(SetupFixture, test_constructor_initializer_list) + { + Compare_Data compare_data = { Data::value_type(std::string("0"), 0), Data::value_type(std::string("1"), 1), + Data::value_type(std::string("2"), 2), Data::value_type(std::string("3"), 3) }; + + Data data = { Data::value_type(std::string("0"), 0), Data::value_type(std::string("1"), 1), + Data::value_type(std::string("2"), 2), Data::value_type(std::string("3"), 3) }; + + CHECK_EQUAL(compare_data.size(), data.size()); + CHECK(!data.empty()); + + bool isEqual = Check_Equal(data.begin(), + data.end(), + compare_data.begin()); + + CHECK(isEqual); + } + //************************************************************************* TEST_FIXTURE(SetupFixture, test_assignment) { diff --git a/test/test_multiset.cpp b/test/test_multiset.cpp index ab454fbd..03813ba0 100644 --- a/test/test_multiset.cpp +++ b/test/test_multiset.cpp @@ -195,6 +195,20 @@ namespace CHECK(!data.empty()); } + //************************************************************************* + TEST_FIXTURE(SetupFixture, test_constructor_initializer_list) + { + Compare_Data compare_data = { 0, 1, 1, 3, 4, 4, 6, 7, 7, 9 }; + + Data data = { 0, 1, 1, 3, 4, 4, 6, 7, 7, 9 }; + + CHECK_EQUAL(compare_data.size(), data.size()); + CHECK(!data.empty()); + + bool isEqual = std::equal(data.begin(), data.end(), compare_data.begin()); + CHECK(isEqual); + } + //************************************************************************* TEST_FIXTURE(SetupFixture, test_assignment) { diff --git a/test/test_reference_flat_map.cpp b/test/test_reference_flat_map.cpp index 976b28ea..bfcd7cda 100644 --- a/test/test_reference_flat_map.cpp +++ b/test/test_reference_flat_map.cpp @@ -78,22 +78,6 @@ namespace return true; } - //************************************************************************* -// std::ostream& operator <<(std::ostream& os, const DataDC::iterator& itr) -// { -// os << itr->first; - -// return os; -// } - - //************************************************************************* -// std::ostream& operator <<(std::ostream& os, const DataDC::const_iterator& itr) -// { -// os << itr->first; - -// return os; -// } - //************************************************************************* std::ostream& operator <<(std::ostream& os, const DataNDC::iterator& itr) { diff --git a/test/test_reference_flat_multimap.cpp b/test/test_reference_flat_multimap.cpp index f433cea2..c9bc8e55 100644 --- a/test/test_reference_flat_multimap.cpp +++ b/test/test_reference_flat_multimap.cpp @@ -58,22 +58,6 @@ namespace typedef std::multimap Compare_DataDC; typedef std::multimap Compare_DataNDC; - //************************************************************************* - // std::ostream& operator <<(std::ostream& os, const DataDC::iterator& itr) - // { - // os << itr->first - // - // return os; - // } - - //************************************************************************* - // std::ostream& operator <<(std::ostream& os, const DataDC::const_iterator& itr) - // { - // os << itr->first; - // - // return os; - // } - //************************************************************************* std::ostream& operator <<(std::ostream& os, const DataNDC::iterator& itr) { diff --git a/test/test_reference_flat_multiset.cpp b/test/test_reference_flat_multiset.cpp index f3ad4a34..72c1511b 100644 --- a/test/test_reference_flat_multiset.cpp +++ b/test/test_reference_flat_multiset.cpp @@ -83,22 +83,6 @@ namespace std::vector different_data; std::vector multi_data; - //************************************************************************* -// std::ostream& operator <<(std::ostream& os, const DataDC::iterator& itr) -// { -// os << itr->value; -// -// return os; -// } - - //************************************************************************* -// std::ostream& operator <<(std::ostream& os, const DataDC::const_iterator& itr) -// { -// os << itr->value; -// -// return os; -// } - //************************************************************************* std::ostream& operator <<(std::ostream& os, const DataNDC::iterator& itr) { diff --git a/test/test_set.cpp b/test/test_set.cpp index 98422f6f..773aeea5 100644 --- a/test/test_set.cpp +++ b/test/test_set.cpp @@ -204,6 +204,23 @@ namespace CHECK(data.size() == MAX_SIZE); CHECK(!data.empty()); + + bool isEqual = std::equal(data.begin(), data.end(), compare_data.begin()); + CHECK(isEqual); + } + + //************************************************************************* + TEST_FIXTURE(SetupFixture, test_constructor_initializer_list) + { + Compare_Data compare_data = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; + + Data data = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; + + CHECK_EQUAL(compare_data.size(), data.size()); + CHECK(!data.empty()); + + bool isEqual = std::equal(data.begin(), data.end(), compare_data.begin()); + CHECK(isEqual); } //************************************************************************* diff --git a/test/test_string_char.cpp b/test/test_string_char.cpp index 1e8968dd..d93d6d4d 100644 --- a/test/test_string_char.cpp +++ b/test/test_string_char.cpp @@ -217,6 +217,16 @@ namespace CHECK(is_equal); } + //************************************************************************* + TEST_FIXTURE(SetupFixture, test_construct_initializer_list) + { + Compare_Text compare_text = { STR('H'), STR('e'), STR('l') , STR('l') , STR('o') }; + Text text = { STR('H'), STR('e'), STR('l') , STR('l') , STR('o') }; + + bool is_equal = Equal(compare_text, text); + CHECK(is_equal); + } + //************************************************************************* TEST_FIXTURE(SetupFixture, test_assignment) { diff --git a/test/test_string_u16.cpp b/test/test_string_u16.cpp index 09b93293..aeff4cc2 100644 --- a/test/test_string_u16.cpp +++ b/test/test_string_u16.cpp @@ -216,6 +216,16 @@ namespace CHECK(is_equal); } + //************************************************************************* + TEST_FIXTURE(SetupFixture, test_construct_initializer_list) + { + Compare_Text compare_text = { STR('H'), STR('e'), STR('l') , STR('l') , STR('o') }; + Text text = { STR('H'), STR('e'), STR('l') , STR('l') , STR('o') }; + + bool is_equal = Equal(compare_text, text); + CHECK(is_equal); + } + //************************************************************************* TEST_FIXTURE(SetupFixture, test_assignment) { diff --git a/test/test_string_u32.cpp b/test/test_string_u32.cpp index ce1579b0..03d0912f 100644 --- a/test/test_string_u32.cpp +++ b/test/test_string_u32.cpp @@ -216,6 +216,16 @@ namespace CHECK(is_equal); } + //************************************************************************* + TEST_FIXTURE(SetupFixture, test_construct_initializer_list) + { + Compare_Text compare_text = { STR('H'), STR('e'), STR('l') , STR('l') , STR('o') }; + Text text = { STR('H'), STR('e'), STR('l') , STR('l') , STR('o') }; + + bool is_equal = Equal(compare_text, text); + CHECK(is_equal); + } + //************************************************************************* TEST_FIXTURE(SetupFixture, test_assignment) { diff --git a/test/test_string_wchar_t.cpp b/test/test_string_wchar_t.cpp index 191f53d3..1ae194aa 100644 --- a/test/test_string_wchar_t.cpp +++ b/test/test_string_wchar_t.cpp @@ -216,6 +216,16 @@ namespace CHECK(is_equal); } + //************************************************************************* + TEST_FIXTURE(SetupFixture, test_construct_initializer_list) + { + Compare_Text compare_text = { STR('H'), STR('e'), STR('l') , STR('l') , STR('o') }; + Text text = { STR('H'), STR('e'), STR('l') , STR('l') , STR('o') }; + + bool is_equal = Equal(compare_text, text); + CHECK(is_equal); + } + //************************************************************************* TEST_FIXTURE(SetupFixture, test_assignment) { diff --git a/test/test_vector.cpp b/test/test_vector.cpp index 23770eac..e581faf0 100644 --- a/test/test_vector.cpp +++ b/test/test_vector.cpp @@ -142,6 +142,16 @@ namespace CHECK(!data.empty()); } + //************************************************************************* + TEST(test_constructor_initializer_list) + { + Compare_Data compare_data = { 0, 1, 2, 3 }; + Data data = { 0, 1, 2, 3 }; + + CHECK_EQUAL(compare_data.size(), data.size()); + CHECK(std::equal(compare_data.begin(), compare_data.end(), data.begin())); + } + //************************************************************************* TEST_FIXTURE(SetupFixture, test_copy_constructor) { diff --git a/test/test_vector_non_trivial.cpp b/test/test_vector_non_trivial.cpp index 88c1e7f4..2d1d89e3 100644 --- a/test/test_vector_non_trivial.cpp +++ b/test/test_vector_non_trivial.cpp @@ -167,6 +167,16 @@ namespace CHECK(!data.empty()); } + //************************************************************************* + TEST(test_constructor_initializer_list) + { + CompareDataNDC compare_data = { NDC("0"), NDC("1"), NDC("2"), NDC("3") }; + DataNDC data = { NDC("0"), NDC("1"), NDC("2"), NDC("3") }; + + CHECK_EQUAL(compare_data.size(), data.size()); + CHECK(std::equal(compare_data.begin(), compare_data.end(), data.begin())); + } + //************************************************************************* TEST_FIXTURE(SetupFixture, test_copy_constructor) { diff --git a/test/test_vector_pointer.cpp b/test/test_vector_pointer.cpp index 232faa21..970d2263 100644 --- a/test/test_vector_pointer.cpp +++ b/test/test_vector_pointer.cpp @@ -152,6 +152,22 @@ namespace CHECK(data.size() == SIZE); CHECK(!data.empty()); + CHECK(std::equal(compare_data.begin(), compare_data.end(), data.begin())); + } + + //************************************************************************* + TEST(test_constructor_initializer_list) + { + int a = 0; + int b = 1; + int c = 3; + int d = 4; + + Compare_Data compare_data = { &a, &b, &c, &d }; + Data data = { &a, &b, &c, &d }; + + CHECK_EQUAL(compare_data.size(), data.size()); + CHECK(std::equal(compare_data.begin(), compare_data.end(), data.begin())); } //************************************************************************* From 6f6c80fcd593d99da52103bf0a1207dfdd481e41 Mon Sep 17 00:00:00 2001 From: John Wellbelove Date: Sun, 25 Mar 2018 14:41:17 +0100 Subject: [PATCH 9/9] Added std::initializer_list constructors when ETL_CPP11_SUPPORTED is defined as 1 --- support/Release notes.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/support/Release notes.txt b/support/Release notes.txt index 58b72831..3d56ce4e 100644 --- a/support/Release notes.txt +++ b/support/Release notes.txt @@ -1,9 +1,13 @@ =============================================================================== -11.00.1 +11.2.0 +Added std::initializer_list constructors to containers, if ETL_CPP11_SUPPORTED is set to 1 + +=============================================================================== +11.0.1 Added reset() to etl::optional =============================================================================== -11.00.0 +11.0.0 New directory structure. C & CPP files in src/ H files in include/etl/