├── .gitignore ├── LICENSE ├── README.md ├── examples ├── Example_0_import_etl │ └── Example_0_import_etl.ino └── Vector_Examples │ └── Example_Vector_1_simple_use │ └── Example_Vector_1_simple_use.ino ├── library.json ├── library.properties └── src ├── Embedded_Template_Library.h └── etl ├── absolute.h ├── algorithm.h ├── alignment.h ├── array.h ├── array_view.h ├── array_wrapper.h ├── atomic.h ├── atomic ├── atomic_arm.h ├── atomic_clang_sync.h ├── atomic_gcc_sync.h └── atomic_std.h ├── base64.h ├── base64_decoder.h ├── base64_encoder.h ├── basic_format_spec.h ├── basic_string.h ├── basic_string_stream.h ├── binary.h ├── bip_buffer_spsc_atomic.h ├── bit.h ├── bit_stream.h ├── bitset.h ├── bloom_filter.h ├── bresenham_line.h ├── buffer_descriptors.h ├── byte.h ├── byte_stream.h ├── callback.h ├── callback_service.h ├── callback_timer.h ├── callback_timer_atomic.h ├── callback_timer_interrupt.h ├── callback_timer_locked.h ├── char_traits.h ├── checksum.h ├── circular_buffer.h ├── circular_iterator.h ├── combinations.h ├── compare.h ├── constant.h ├── container.h ├── correlation.h ├── covariance.h ├── crc.h ├── crc1.h ├── crc16.h ├── crc16_a.h ├── crc16_arc.h ├── crc16_aug_ccitt.h ├── crc16_buypass.h ├── crc16_ccitt.h ├── crc16_cdma2000.h ├── crc16_dds110.h ├── crc16_dectr.h ├── crc16_dectx.h ├── crc16_dnp.h ├── crc16_en13757.h ├── crc16_genibus.h ├── crc16_kermit.h ├── crc16_m17.h ├── crc16_maxim.h ├── crc16_mcrf4xx.h ├── crc16_modbus.h ├── crc16_profibus.h ├── crc16_riello.h ├── crc16_t10dif.h ├── crc16_teledisk.h ├── crc16_tms37157.h ├── crc16_usb.h ├── crc16_x25.h ├── crc16_xmodem.h ├── crc32.h ├── crc32_bzip2.h ├── crc32_c.h ├── crc32_d.h ├── crc32_jamcrc.h ├── crc32_mpeg2.h ├── crc32_posix.h ├── crc32_q.h ├── crc32_xfer.h ├── crc64_ecma.h ├── crc8_ccitt.h ├── crc8_cdma2000.h ├── crc8_darc.h ├── crc8_dvbs2.h ├── crc8_ebu.h ├── crc8_icode.h ├── crc8_itu.h ├── crc8_j1850.h ├── crc8_j1850_zero.h ├── crc8_maxim.h ├── crc8_rohc.h ├── crc8_wcdma.h ├── cstring.h ├── cumulative_moving_average.h ├── cyclic_value.h ├── debounce.h ├── debug_count.h ├── delegate.h ├── delegate_observer.h ├── delegate_service.h ├── deprecated └── factory.h ├── deque.h ├── doxygen.h ├── endianness.h ├── enum_type.h ├── error_handler.h ├── exception.h ├── expected.h ├── factorial.h ├── fibonacci.h ├── file_error_numbers.h ├── file_error_numbers.txt ├── fixed_iterator.h ├── fixed_sized_memory_block_allocator.h ├── flags.h ├── flat_map.h ├── flat_multimap.h ├── flat_multiset.h ├── flat_set.h ├── fnv_1.h ├── format_spec.h ├── forward_list.h ├── frame_check_sequence.h ├── fsm.h ├── function.h ├── function_traits.h ├── function_wrapper.h ├── functional.h ├── gamma.h ├── gcd.h ├── generators ├── fsm_generator.h ├── generate.bat ├── generate_fsm.bat ├── generate_largest.bat ├── generate_message_packet.bat ├── generate_message_router.bat ├── generate_smallest.bat ├── generate_type_lookup.bat ├── generate_type_select.bat ├── generate_type_traits.bat ├── generate_variant_pool.bat ├── largest_generator.h ├── message_packet_generator.h ├── message_router_generator.h ├── smallest_generator.h ├── type_lookup_generator.h ├── type_select_generator.h ├── type_traits_generator.h └── variant_pool_generator.h ├── generic_pool.h ├── hash.h ├── hfsm.h ├── histogram.h ├── ihash.h ├── imemory_block_allocator.h ├── indirect_vector.h ├── initializer_list.h ├── instance_count.h ├── integral_limits.h ├── intrusive_forward_list.h ├── intrusive_links.h ├── intrusive_list.h ├── intrusive_queue.h ├── intrusive_stack.h ├── invert.h ├── io_port.h ├── ipool.h ├── ireference_counted_message_pool.h ├── iterator.h ├── jenkins.h ├── largest.h ├── lcm.h ├── limiter.h ├── limits.h ├── list.h ├── log.h ├── macros.h ├── map.h ├── math.h ├── math_constants.h ├── mean.h ├── mem_cast.h ├── memory.h ├── memory_model.h ├── message.h ├── message_broker.h ├── message_bus.h ├── message_packet.h ├── message_router.h ├── message_router_registry.h ├── message_timer.h ├── message_timer_atomic.h ├── message_timer_interrupt.h ├── message_timer_locked.h ├── message_types.h ├── multi_array.h ├── multi_range.h ├── multi_span.h ├── multi_vector.h ├── multimap.h ├── multiset.h ├── murmur3.h ├── mutex.h ├── mutex ├── mutex_arm.h ├── mutex_clang_sync.h ├── mutex_cmsis_os1.h ├── mutex_cmsis_os2.h ├── mutex_freertos.h ├── mutex_gcc_sync.h └── mutex_std.h ├── negative.h ├── nth_type.h ├── null_type.h ├── nullptr.h ├── numeric.h ├── observer.h ├── optional.h ├── overload.h ├── packet.h ├── parameter_pack.h ├── parameter_type.h ├── pearson.h ├── permutations.h ├── persistence.h ├── placement_new.h ├── platform.h ├── poly_span.h ├── poly_span_forked.h ├── pool.h ├── power.h ├── priority_queue.h ├── private ├── addressof.h ├── bitset_legacy.h ├── bitset_new.h ├── choose_namespace.h ├── comparator_is_transparent.h ├── crc16_poly_0x1021_.h ├── crc16_poly_0x8005.h ├── crc32_poly_0x04c11db7.h ├── crc32_poly_0x1edc6f41.h ├── crc64_poly_0x42f0e1eba9ea3693.h ├── crc8_poly_0x07.h ├── crc_implementation.h ├── crc_parameters.h ├── delegate_cpp03.h ├── delegate_cpp11.h ├── diagnostic_array_bounds_push.h ├── diagnostic_cxx_20_compat_push.h ├── diagnostic_deprecated_push.h ├── diagnostic_float_equal_push.h ├── diagnostic_null_dereference_push.h ├── diagnostic_pessimizing-move_push.h ├── diagnostic_pessimizing_move_push.h ├── diagnostic_pop.h ├── diagnostic_self_assign_overloaded_push.h ├── diagnostic_stringop_overread_push.h ├── diagnostic_uninitialized_push.h ├── diagnostic_unused_function_push.h ├── diagnostic_useless_cast_push.h ├── dynamic_extent.h ├── ivectorpointer.h ├── minmax_pop.h ├── minmax_push.h ├── pvoidvector.h ├── to_string_helper.h ├── variant_legacy.h ├── variant_variadic.h └── vector_base.h ├── profiles ├── arduino_arm.h ├── armv5.h ├── armv5_no_stl.h ├── armv6.h ├── armv6_no_stl.h ├── armv7.h ├── armv7_no_stl.h ├── auto.h ├── clang_generic.h ├── clang_generic_no_stl.h ├── cpp03.h ├── cpp03_no_stl.h ├── cpp11.h ├── cpp11_no_stl.h ├── cpp14.h ├── cpp14_no_stl.h ├── cpp17.h ├── cpp17_no_stl.h ├── determine_builtin_support.h ├── determine_compiler.h ├── determine_compiler_language_support.h ├── determine_compiler_version.h ├── determine_development_os.h ├── gcc_generic.h ├── gcc_generic_no_stl.h ├── gcc_linux_x86.h ├── gcc_linux_x86_no_stl.h ├── gcc_windows_x86.h ├── gcc_windows_x86_no_stl.h ├── msvc_x86.h ├── msvc_x86_no_stl.h ├── segger_gcc_stlport.h ├── ticc.h └── ticc_no_stl.h ├── pseudo_moving_average.h ├── quantize.h ├── queue.h ├── queue_lockable.h ├── queue_mpmc_mutex.h ├── queue_spsc_atomic.h ├── queue_spsc_isr.h ├── queue_spsc_locked.h ├── radix.h ├── random.h ├── ratio.h ├── reference_counted_message.h ├── reference_counted_message_pool.h ├── reference_counted_object.h ├── reference_flat_map.h ├── reference_flat_multimap.h ├── reference_flat_multiset.h ├── reference_flat_set.h ├── rescale.h ├── result.h ├── rms.h ├── scaled_rounding.h ├── scheduler.h ├── set.h ├── shared_message.h ├── singleton.h ├── singleton_base.h ├── smallest.h ├── span.h ├── spsc_queue.h ├── sqrt.h ├── stack.h ├── standard_deviation.h ├── state_chart.h ├── static_assert.h ├── string.h ├── string_stream.h ├── string_utilities.h ├── string_view.h ├── stringify.h ├── successor.h ├── task.h ├── threshold.h ├── timer.h ├── to_arithmetic.h ├── to_string.h ├── to_u16string.h ├── to_u32string.h ├── to_u8string.h ├── to_wstring.h ├── type_def.h ├── type_list.h ├── type_lookup.h ├── type_select.h ├── type_traits.h ├── u16format_spec.h ├── u16string.h ├── u16string_stream.h ├── u32format_spec.h ├── u32string.h ├── u32string_stream.h ├── u8format_spec.h ├── u8string.h ├── u8string_stream.h ├── unaligned_type.h ├── uncopyable.h ├── unordered_map.h ├── unordered_multimap.h ├── unordered_multiset.h ├── unordered_set.h ├── user_type.h ├── utility.h ├── variance.h ├── variant.h ├── variant_pool.h ├── vector.h ├── version.h ├── visitor.h ├── wformat_spec.h ├── wstring.h └── wstring_stream.h /.gitignore: -------------------------------------------------------------------------------- 1 | src/etl/.vscode/settings.json 2 | src/etl/experimental 3 | *.TMP 4 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Embedded Template Library 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Embedded Template Library (ETL) 2 | ------------------------- 3 | 4 | [![Release date](https://img.shields.io/github/release-date/jwellbelove/etl?color=%231182c3)](https://img.shields.io/github/release-date/jwellbelove/etl?color=%231182c3) 5 | ![GitHub release (latest by date)](https://img.shields.io/github/v/release/jwellbelove/etl) 6 | [![Standard](https://img.shields.io/badge/c%2B%2B-98/03/11/14/17-blue.svg)](https://en.wikipedia.org/wiki/C%2B%2B#Standardization) 7 | [![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/MIT) 8 | [![Sponsors](https://img.shields.io/github/sponsors/ETLCPP)](https://img.shields.io/github/sponsors/ETLCPP) 9 | 10 | ![CI](https://github.com/ETLCPP/etl/workflows/vs2019/badge.svg) 11 | ![CI](https://github.com/ETLCPP/etl/workflows/gcc/badge.svg) 12 | ![CI](https://github.com/ETLCPP/etl/workflows/clang/badge.svg) 13 | [![Build status](https://ci.appveyor.com/api/projects/status/b7jgecv7unqjw4u0/branch/master?svg=true)](https://ci.appveyor.com/project/jwellbelove/etl/branch/master) 14 | [![Codacy Badge](https://api.codacy.com/project/badge/Grade/3c14cd918ccf40008d0bcd7b083d5946)](https://www.codacy.com/manual/jwellbelove/etl?utm_source=github.com&utm_medium=referral&utm_content=ETLCPP/etl&utm_campaign=Badge_Grade) 15 | 16 | **This repository is an Arduino compatible clone of the Embedded Template Library (ETL)** 17 | 18 | https://github.com/ETLCPP/etl 19 | 20 | See (https://www.etlcpp.com/arduino.html) for up-to-date information. 21 | 22 | If you already have the main ETL library from GitHub, you can generate the Arduino compatible variant by running a python script. 23 | 24 | You must ensure that you have a directory named ```etl-arduino``` in the same parent directory as ```etl``` 25 | 26 | Change directory to ```etl/scripts``` and run the python script ```update_releases.py``` 27 | 28 | This will copy the ETL files into ```etl-arduino``` with a directory structure compatible with the Arduino library system. 29 | -------------------------------------------------------------------------------- /examples/Example_0_import_etl/Example_0_import_etl.ino: -------------------------------------------------------------------------------- 1 | #include "Embedded_Template_Library.h" // This is required for any more etl import when using Arduino IDE 2 | 3 | void setup() 4 | { 5 | 6 | } 7 | 8 | 9 | void loop() 10 | { 11 | 12 | } 13 | -------------------------------------------------------------------------------- /examples/Vector_Examples/Example_Vector_1_simple_use/Example_Vector_1_simple_use.ino: -------------------------------------------------------------------------------- 1 | // make sure that we do not rely on the STL 2 | #define ETL_NO_STL 3 | 4 | #include "Embedded_Template_Library.h" 5 | #include "etl/vector.h" 6 | 7 | template 8 | void print_vector(etl::ivector const & vec_in) 9 | { 10 | Serial.print(F("print vector content | size ")); Serial.print(vec_in.size()); Serial.print(F(" | capacity ")); Serial.println(vec_in.capacity()); 11 | Serial.print(F("content | ")); 12 | 13 | for (T const & elem : vec_in) 14 | { 15 | Serial.print(elem); 16 | Serial.print(F(" | ")); 17 | } 18 | 19 | Serial.println(); 20 | } 21 | 22 | void setup() 23 | { 24 | Serial.begin(115200); 25 | delay(100); 26 | Serial.println(F("booted")); 27 | 28 | etl::vector vec_int; 29 | 30 | Serial.println(F("initialized vec_int")); 31 | print_vector(vec_int); 32 | 33 | vec_int.push_back(1); 34 | vec_int.push_back(2); 35 | Serial.println(F("pushed to vec_int")); 36 | print_vector(vec_int); 37 | 38 | vec_int.pop_back(); 39 | Serial.println(F("pop from vec_int; returns no value")); 40 | print_vector(vec_int); 41 | } 42 | 43 | void loop() 44 | { 45 | 46 | } 47 | -------------------------------------------------------------------------------- /library.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Embedded Template Library ETL", 3 | "version": "20.40.0", 4 | "authors": { 5 | "name": "John Wellbelove", 6 | "email": "john.wellbelove@etlcpp.com" 7 | }, 8 | "homepage": "https://www.etlcpp.com/", 9 | "license": "MIT", 10 | "description": "ETL. A C++ template library tailored for embedded systems. Directories formatted for Arduino", 11 | "keywords": "c-plus-plus, cpp, algorithms, containers, templates", 12 | "repository": { 13 | "type": "git", 14 | "url": "https://github.com/ETLCPP/etl-arduino.git" 15 | }, 16 | "build": { 17 | "includeDir": "include" 18 | }, 19 | "export": { 20 | "include": [ 21 | "include", 22 | "examples", 23 | "LICENSE", 24 | "README.md" 25 | ], 26 | "exclude": [ 27 | "include/etl/experimental", 28 | "include/etl/deprecated", 29 | "**/__vm", 30 | "**/.vs", 31 | "**/*.filters", 32 | "**/*.log", 33 | "**/*.tmp" 34 | ] 35 | }, 36 | "platforms": "*", 37 | "frameworks": "*" 38 | } 39 | 40 | -------------------------------------------------------------------------------- /library.properties: -------------------------------------------------------------------------------- 1 | name=Embedded Template Library ETL 2 | version=20.40.0 3 | author= John Wellbelove 4 | maintainer=John Wellbelove 5 | license=MIT 6 | sentence=ETL. A C++ template library tailored for embedded systems. 7 | paragraph= 8 | category=Other 9 | url=https://www.etlcpp.com/ 10 | architectures=* 11 | -------------------------------------------------------------------------------- /src/etl/atomic.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | The MIT License(MIT) 3 | 4 | Embedded Template Library. 5 | https://github.com/ETLCPP/etl 6 | https://www.etlcpp.com 7 | 8 | Copyright(c) 2017 John Wellbelove 9 | 10 | Permission is hereby granted, free of charge, to any person obtaining a copy 11 | of this software and associated documentation files(the "Software"), to deal 12 | in the Software without restriction, including without limitation the rights 13 | to use, copy, modify, merge, publish, distribute, sublicense, and / or sell 14 | copies of the Software, and to permit persons to whom the Software is 15 | furnished to do so, subject to the following conditions : 16 | 17 | The above copyright notice and this permission notice shall be included in all 18 | copies or substantial portions of the Software. 19 | 20 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 23 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 25 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | SOFTWARE. 27 | ******************************************************************************/ 28 | 29 | #ifndef ETL_ATOMIC_INCLUDED 30 | #define ETL_ATOMIC_INCLUDED 31 | 32 | #include "platform.h" 33 | 34 | #if ETL_HAS_ATOMIC 35 | #if (ETL_USING_CPP11 && (ETL_USING_STL || defined(ETL_IN_UNIT_TEST))) 36 | #include "atomic/atomic_std.h" 37 | #elif defined(ETL_COMPILER_ARM5) 38 | #include "atomic/atomic_arm.h" 39 | #elif defined(ETL_COMPILER_ARM6) 40 | #include "atomic/atomic_arm.h" 41 | #elif defined(ETL_COMPILER_GCC) 42 | #include "atomic/atomic_gcc_sync.h" 43 | #elif defined(ETL_COMPILER_CLANG) 44 | #include "atomic/atomic_clang_sync.h" 45 | #endif 46 | #endif 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /src/etl/atomic/atomic_arm.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | The MIT License(MIT) 3 | 4 | Embedded Template Library. 5 | https://github.com/ETLCPP/etl 6 | https://www.etlcpp.com 7 | 8 | Copyright(c) 2017 John Wellbelove 9 | 10 | Permission is hereby granted, free of charge, to any person obtaining a copy 11 | of this software and associated documentation files(the "Software"), to deal 12 | in the Software without restriction, including without limitation the rights 13 | to use, copy, modify, merge, publish, distribute, sublicense, and / or sell 14 | copies of the Software, and to permit persons to whom the Software is 15 | furnished to do so, subject to the following conditions : 16 | 17 | The above copyright notice and this permission notice shall be included in all 18 | copies or substantial portions of the Software. 19 | 20 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 23 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 25 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | SOFTWARE. 27 | ******************************************************************************/ 28 | 29 | #ifndef ETL_ATOMIC_ARM_INCLUDED 30 | #define ETL_ATOMIC_ARM_INCLUDED 31 | 32 | #include "atomic_gcc_sync.h" 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /src/etl/atomic/atomic_clang_sync.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | The MIT License(MIT) 3 | 4 | Embedded Template Library. 5 | https://github.com/ETLCPP/etl 6 | https://www.etlcpp.com 7 | 8 | Copyright(c) 2017 John Wellbelove 9 | 10 | Permission is hereby granted, free of charge, to any person obtaining a copy 11 | of this software and associated documentation files(the "Software"), to deal 12 | in the Software without restriction, including without limitation the rights 13 | to use, copy, modify, merge, publish, distribute, sublicense, and / or sell 14 | copies of the Software, and to permit persons to whom the Software is 15 | furnished to do so, subject to the following conditions : 16 | 17 | The above copyright notice and this permission notice shall be included in all 18 | copies or substantial portions of the Software. 19 | 20 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 23 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 25 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | SOFTWARE. 27 | ******************************************************************************/ 28 | 29 | #ifndef ETL_ATOMIC_CLANG_INCLUDED 30 | #define ETL_ATOMIC_CLANG_INCLUDED 31 | 32 | #include "atomic_gcc_sync.h" 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /src/etl/bitset.h: -------------------------------------------------------------------------------- 1 | ///\file 2 | 3 | /****************************************************************************** 4 | The MIT License(MIT) 5 | 6 | Embedded Template Library. 7 | https://github.com/ETLCPP/etl 8 | https://www.etlcpp.com 9 | 10 | Copyright(c) 2014 John Wellbelove 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining a copy 13 | of this software and associated documentation files(the "Software"), to deal 14 | in the Software without restriction, including without limitation the rights 15 | to use, copy, modify, merge, publish, distribute, sublicense, and / or sell 16 | copies of the Software, and to permit persons to whom the Software is 17 | furnished to do so, subject to the following conditions : 18 | 19 | The above copyright notice and this permission notice shall be included in all 20 | copies or substantial portions of the Software. 21 | 22 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 25 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 26 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 27 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 28 | SOFTWARE. 29 | ******************************************************************************/ 30 | 31 | #ifndef ETL_BITSET_INCLUDED 32 | #define ETL_BITSET_INCLUDED 33 | 34 | #include "platform.h" 35 | 36 | #if defined(ETL_USE_LEGACY_BITSET) 37 | #include "private/bitset_legacy.h" 38 | #else 39 | #include "private/bitset_new.h" 40 | #endif 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /src/etl/callback.h: -------------------------------------------------------------------------------- 1 | ///\file 2 | 3 | /****************************************************************************** 4 | The MIT License(MIT) 5 | 6 | Embedded Template Library. 7 | https://github.com/ETLCPP/etl 8 | http://www.etlcpp.com 9 | 10 | Copyright(c) 2015 jwellbelove 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining a copy 13 | of this software and associated documentation files(the "Software"), to deal 14 | in the Software without restriction, including without limitation the rights 15 | to use, copy, modify, merge, publish, distribute, sublicense, and / or sell 16 | copies of the Software, and to permit persons to whom the Software is 17 | furnished to do so, subject to the following conditions : 18 | 19 | The above copyright notice and this permission notice shall be included in all 20 | copies or substantial portions of the Software. 21 | 22 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 25 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 26 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 27 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 28 | SOFTWARE. 29 | ******************************************************************************/ 30 | 31 | #ifndef __ETL_CALLBACK__ 32 | #define __ETL_CALLBACK__ 33 | 34 | namespace etl 35 | { 36 | //*************************************************************************** 37 | /// A callback class designed to be multiply inherited by other client classes. 38 | /// The class is parametrised with a callback parameter type and a unique id. 39 | /// The unique id allows multiple callbacks with the same parameter type. 40 | ///\tparam TParameter The callback parameter type. 41 | ///\tparam ID The unique id for this callback. 42 | //*************************************************************************** 43 | template 44 | class callback 45 | { 46 | private: 47 | 48 | // Creates a parameter type unique to this ID. 49 | template 50 | struct parameter 51 | { 52 | parameter(T value_) 53 | : value(value_) 54 | { 55 | } 56 | 57 | typedef T value_type; 58 | 59 | T value; 60 | 61 | private: 62 | 63 | parameter(); 64 | }; 65 | 66 | // Specialisation for void. 67 | template 68 | struct parameter 69 | { 70 | typedef void value_type; 71 | }; 72 | 73 | public: 74 | 75 | typedef parameter type; 76 | 77 | virtual void etl_callback(type p = type()) = 0; 78 | }; 79 | } 80 | 81 | #endif 82 | -------------------------------------------------------------------------------- /src/etl/combinations.h: -------------------------------------------------------------------------------- 1 | ///\file 2 | 3 | /****************************************************************************** 4 | The MIT License(MIT) 5 | 6 | Embedded Template Library. 7 | https://github.com/ETLCPP/etl 8 | https://www.etlcpp.com 9 | 10 | Copyright(c) 2018 John Wellbelove 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining a copy 13 | of this software and associated documentation files(the "Software"), to deal 14 | in the Software without restriction, including without limitation the rights 15 | to use, copy, modify, merge, publish, distribute, sublicense, and / or sell 16 | copies of the Software, and to permit persons to whom the Software is 17 | furnished to do so, subject to the following conditions : 18 | 19 | The above copyright notice and this permission notice shall be included in all 20 | copies or substantial portions of the Software. 21 | 22 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 25 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 26 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 27 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 28 | SOFTWARE. 29 | ******************************************************************************/ 30 | 31 | #ifndef ETL_COMBINATIONS_INCLUDED 32 | #define ETL_COMBINATIONS_INCLUDED 33 | 34 | #include "platform.h" 35 | #include "permutations.h" 36 | #include "factorial.h" 37 | 38 | ///\defgroup combinations combinations 39 | /// combinations : Calculates K combinations from N. 40 | ///\ingroup maths 41 | 42 | namespace etl 43 | { 44 | //*************************************************************************** 45 | ///\ingroup combinations 46 | /// Calculates combinations. 47 | //*************************************************************************** 48 | template 49 | struct combinations 50 | { 51 | static ETL_CONSTANT size_t value = etl::permutations::value / etl::factorial::value; 52 | }; 53 | 54 | template 55 | ETL_CONSTANT size_t combinations::value; 56 | 57 | #if ETL_USING_CPP17 58 | template 59 | inline constexpr size_t combinations_v = combinations::value; 60 | #endif 61 | } 62 | 63 | #endif 64 | -------------------------------------------------------------------------------- /src/etl/constant.h: -------------------------------------------------------------------------------- 1 | ///\file 2 | 3 | /****************************************************************************** 4 | The MIT License(MIT) 5 | 6 | Embedded Template Library. 7 | https://github.com/ETLCPP/etl 8 | https://www.etlcpp.com 9 | 10 | Copyright(c) 2017 John Wellbelove 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining a copy 13 | of this software and associated documentation files(the "Software"), to deal 14 | in the Software without restriction, including without limitation the rights 15 | to use, copy, modify, merge, publish, distribute, sublicense, and / or sell 16 | copies of the Software, and to permit persons to whom the Software is 17 | furnished to do so, subject to the following conditions : 18 | 19 | The above copyright notice and this permission notice shall be included in all 20 | copies or substantial portions of the Software. 21 | 22 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 25 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 26 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 27 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 28 | SOFTWARE. 29 | ******************************************************************************/ 30 | 31 | #ifndef ETL_CONSTANT_INCLUDED 32 | #define ETL_CONSTANT_INCLUDED 33 | 34 | #include "platform.h" 35 | 36 | //***************************************************************************** 37 | ///\defgroup constant constant 38 | ///\ingroup utilities 39 | //***************************************************************************** 40 | 41 | namespace etl 42 | { 43 | template 44 | class constant 45 | { 46 | public: 47 | 48 | typedef T value_type; 49 | 50 | static ETL_CONSTANT T value = VALUE; 51 | }; 52 | 53 | template 54 | const T constant::value; 55 | } 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /src/etl/container.h: -------------------------------------------------------------------------------- 1 | ///\file 2 | 3 | /****************************************************************************** 4 | The MIT License(MIT) 5 | 6 | Embedded Template Library. 7 | https://github.com/ETLCPP/etl 8 | https://www.etlcpp.com 9 | 10 | Copyright(c) 2014 John Wellbelove 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining a copy 13 | of this software and associated documentation files(the "Software"), to deal 14 | in the Software without restriction, including without limitation the rights 15 | to use, copy, modify, merge, publish, distribute, sublicense, and / or sell 16 | copies of the Software, and to permit persons to whom the Software is 17 | furnished to do so, subject to the following conditions : 18 | 19 | The above copyright notice and this permission notice shall be included in all 20 | copies or substantial portions of the Software. 21 | 22 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 25 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 26 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 27 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 28 | SOFTWARE. 29 | ******************************************************************************/ 30 | 31 | #ifndef ETL_CONTAINER_INCLUDED 32 | #define ETL_CONTAINER_INCLUDED 33 | 34 | #include "platform.h" 35 | #include "iterator.h" 36 | 37 | #include 38 | 39 | #endif 40 | 41 | -------------------------------------------------------------------------------- /src/etl/crc.h: -------------------------------------------------------------------------------- 1 | ///\file 2 | 3 | /****************************************************************************** 4 | The MIT License(MIT) 5 | 6 | Embedded Template Library. 7 | https://github.com/ETLCPP/etl 8 | https://www.etlcpp.com 9 | 10 | Copyright(c) 2021 John Wellbelove 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining a copy 13 | of this software and associated documentation files(the "Software"), to deal 14 | in the Software without restriction, including without limitation the rights 15 | to use, copy, modify, merge, publish, distribute, sublicense, and / or sell 16 | copies of the Software, and to permit persons to whom the Software is 17 | furnished to do so, subject to the following conditions : 18 | 19 | The above copyright notice and this permission notice shall be included in all 20 | copies or substantial portions of the Software. 21 | 22 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 25 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 26 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 27 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 28 | SOFTWARE. 29 | ******************************************************************************/ 30 | 31 | #ifndef ETL_CRC_INCLUDED 32 | #define ETL_CRC_INCLUDED 33 | 34 | #include "crc1.h" 35 | 36 | #include "crc8_ccitt.h" 37 | #include "crc8_cdma2000.h" 38 | #include "crc8_darc.h" 39 | #include "crc8_dvbs2.h" 40 | #include "crc8_ebu.h" 41 | #include "crc8_icode.h" 42 | #include "crc8_itu.h" 43 | #include "crc8_j1850_zero.h" 44 | #include "crc8_j1850.h" 45 | #include "crc8_maxim.h" 46 | #include "crc8_rohc.h" 47 | #include "crc8_wcdma.h" 48 | 49 | #include "crc16.h" 50 | #include "crc16_a.h" 51 | #include "crc16_arc.h" 52 | #include "crc16_aug_ccitt.h" 53 | #include "crc16_buypass.h" 54 | #include "crc16_ccitt.h" 55 | #include "crc16_cdma2000.h" 56 | #include "crc16_dds110.h" 57 | #include "crc16_dectr.h" 58 | #include "crc16_dectx.h" 59 | #include "crc16_dnp.h" 60 | #include "crc16_en13757.h" 61 | #include "crc16_genibus.h" 62 | #include "crc16_kermit.h" 63 | #include "crc16_maxim.h" 64 | #include "crc16_mcrf4xx.h" 65 | #include "crc16_modbus.h" 66 | #include "crc16_profibus.h" 67 | #include "crc16_riello.h" 68 | #include "crc16_t10dif.h" 69 | #include "crc16_teledisk.h" 70 | #include "crc16_tms37157.h" 71 | #include "crc16_usb.h" 72 | #include "crc16_x25.h" 73 | #include "crc16_xmodem.h" 74 | #include "crc16_m17.h" 75 | 76 | #include "crc32.h" 77 | #include "crc32_bzip2.h" 78 | #include "crc32_c.h" 79 | #include "crc32_d.h" 80 | #include "crc32_jamcrc.h" 81 | #include "crc32_mpeg2.h" 82 | #include "crc32_posix.h" 83 | #include "crc32_q.h" 84 | #include "crc32_xfer.h" 85 | 86 | #include "crc64_ecma.h" 87 | 88 | #endif 89 | -------------------------------------------------------------------------------- /src/etl/crc32.h: -------------------------------------------------------------------------------- 1 | ///\file 2 | 3 | /****************************************************************************** 4 | The MIT License(MIT) 5 | 6 | Embedded Template Library. 7 | https://github.com/ETLCPP/etl 8 | https://www.etlcpp.com 9 | 10 | Copyright(c) 2021 John Wellbelove 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining a copy 13 | of this software and associated documentation files(the "Software"), to deal 14 | in the Software without restriction, including without limitation the rights 15 | to use, copy, modify, merge, publish, distribute, sublicense, and / or sell 16 | copies of the Software, and to permit persons to whom the Software is 17 | furnished to do so, subject to the following conditions : 18 | 19 | The above copyright notice and this permission notice shall be included in all 20 | copies or substantial portions of the Software. 21 | 22 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 25 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 26 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 27 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 28 | SOFTWARE. 29 | ******************************************************************************/ 30 | 31 | #ifndef ETL_CRC32_INCLUDED 32 | #define ETL_CRC32_INCLUDED 33 | 34 | #include "platform.h" 35 | #include "private/crc_implementation.h" 36 | 37 | ///\defgroup crc32 32 bit CRC calculation 38 | ///\ingroup crc 39 | 40 | namespace etl 41 | { 42 | #if ETL_USING_CPP11 43 | template 44 | using crc32_t = etl::crc_type; 45 | #else 46 | template 47 | class crc32_t : public etl::crc_type 48 | { 49 | public: 50 | 51 | //************************************************************************* 52 | /// Default constructor. 53 | //************************************************************************* 54 | crc32_t() 55 | { 56 | this->reset(); 57 | } 58 | 59 | //************************************************************************* 60 | /// Constructor from range. 61 | /// \param begin Start of the range. 62 | /// \param end End of the range. 63 | //************************************************************************* 64 | template 65 | crc32_t(TIterator begin, const TIterator end) 66 | { 67 | this->reset(); 68 | this->add(begin, end); 69 | } 70 | }; 71 | #endif 72 | 73 | typedef etl::crc32_t<256U> crc32_t256; 74 | typedef etl::crc32_t<16U> crc32_t16; 75 | typedef etl::crc32_t<4U> crc32_t4; 76 | typedef crc32_t256 crc32; 77 | } 78 | #endif 79 | -------------------------------------------------------------------------------- /src/etl/crc32_c.h: -------------------------------------------------------------------------------- 1 | ///\file 2 | 3 | /****************************************************************************** 4 | The MIT License(MIT) 5 | 6 | Embedded Template Library. 7 | https://github.com/ETLCPP/etl 8 | https://www.etlcpp.com 9 | 10 | Copyright(c) 2021 John Wellbelove 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining a copy 13 | of this software and associated documentation files(the "Software"), to deal 14 | in the Software without restriction, including without limitation the rights 15 | to use, copy, modify, merge, publish, distribute, sublicense, and / or sell 16 | copies of the Software, and to permit persons to whom the Software is 17 | furnished to do so, subject to the following conditions : 18 | 19 | The above copyright notice and this permission notice shall be included in all 20 | copies or substantial portions of the Software. 21 | 22 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 25 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 26 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 27 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 28 | SOFTWARE. 29 | ******************************************************************************/ 30 | 31 | #ifndef ETL_CRC32_C_INCLUDED 32 | #define ETL_CRC32_C_INCLUDED 33 | 34 | #include "platform.h" 35 | #include "private/crc_implementation.h" 36 | 37 | ///\defgroup crc32_c 32 bit CRC_C calculation 38 | ///\ingroup crc 39 | 40 | namespace etl 41 | { 42 | #if ETL_USING_CPP11 43 | template 44 | using crc32_c_t = etl::crc_type; 45 | #else 46 | template 47 | class crc32_c_t : public etl::crc_type 48 | { 49 | public: 50 | 51 | //************************************************************************* 52 | /// Default constructor. 53 | //************************************************************************* 54 | crc32_c_t() 55 | { 56 | this->reset(); 57 | } 58 | 59 | //************************************************************************* 60 | /// Constructor from range. 61 | /// \param begin Start of the range. 62 | /// \param end End of the range. 63 | //************************************************************************* 64 | template 65 | crc32_c_t(TIterator begin, const TIterator end) 66 | { 67 | this->reset(); 68 | this->add(begin, end); 69 | } 70 | }; 71 | #endif 72 | 73 | typedef etl::crc32_c_t<256U> crc32_c_t256; 74 | typedef etl::crc32_c_t<16U> crc32_c_t16; 75 | typedef etl::crc32_c_t<4U> crc32_c_t4; 76 | typedef crc32_c_t256 crc32_c; 77 | } 78 | #endif 79 | -------------------------------------------------------------------------------- /src/etl/crc32_d.h: -------------------------------------------------------------------------------- 1 | ///\file 2 | 3 | /****************************************************************************** 4 | The MIT License(MIT) 5 | 6 | Embedded Template Library. 7 | https://github.com/ETLCPP/etl 8 | https://www.etlcpp.com 9 | 10 | Copyright(c) 2021 John Wellbelove 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining a copy 13 | of this software and associated documentation files(the "Software"), to deal 14 | in the Software without restriction, including without limitation the rights 15 | to use, copy, modify, merge, publish, distribute, sublicense, and / or sell 16 | copies of the Software, and to permit persons to whom the Software is 17 | furnished to do so, subject to the following conditions : 18 | 19 | The above copyright notice and this permission notice shall be included in all 20 | copies or substantial portions of the Software. 21 | 22 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 25 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 26 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 27 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 28 | SOFTWARE. 29 | ******************************************************************************/ 30 | 31 | #ifndef ETL_CRC32_D_INCLUDED 32 | #define ETL_CRC32_D_INCLUDED 33 | 34 | #include "platform.h" 35 | #include "private/crc_implementation.h" 36 | 37 | ///\defgroup crc32_d 32 bit CRC_D calculation 38 | ///\ingroup crc 39 | 40 | namespace etl 41 | { 42 | #if ETL_USING_CPP11 43 | template 44 | using crc32_d_t = etl::crc_type; 45 | #else 46 | template 47 | class crc32_d_t : public etl::crc_type 48 | { 49 | public: 50 | 51 | //************************************************************************* 52 | /// Default constructor. 53 | //************************************************************************* 54 | crc32_d_t() 55 | { 56 | this->reset(); 57 | } 58 | 59 | //************************************************************************* 60 | /// Constructor from range. 61 | /// \param begin Start of the range. 62 | /// \param end End of the range. 63 | //************************************************************************* 64 | template 65 | crc32_d_t(TIterator begin, const TIterator end) 66 | { 67 | this->reset(); 68 | this->add(begin, end); 69 | } 70 | }; 71 | #endif 72 | 73 | typedef etl::crc32_d_t<256U> crc32_d_t256; 74 | typedef etl::crc32_d_t<16U> crc32_d_t16; 75 | typedef etl::crc32_d_t<4U> crc32_d_t4; 76 | typedef crc32_d_t256 crc32_d; 77 | } 78 | #endif 79 | -------------------------------------------------------------------------------- /src/etl/crc32_q.h: -------------------------------------------------------------------------------- 1 | ///\file 2 | 3 | /****************************************************************************** 4 | The MIT License(MIT) 5 | 6 | Embedded Template Library. 7 | https://github.com/ETLCPP/etl 8 | https://www.etlcpp.com 9 | 10 | Copyright(c) 2021 John Wellbelove 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining a copy 13 | of this software and associated documentation files(the "Software"), to deal 14 | in the Software without restriction, including without limitation the rights 15 | to use, copy, modify, merge, publish, distribute, sublicense, and / or sell 16 | copies of the Software, and to permit persons to whom the Software is 17 | furnished to do so, subject to the following conditions : 18 | 19 | The above copyright notice and this permission notice shall be included in all 20 | copies or substantial portions of the Software. 21 | 22 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 25 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 26 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 27 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 28 | SOFTWARE. 29 | ******************************************************************************/ 30 | 31 | #ifndef ETL_CRC32_D_INCLUDED 32 | #define ETL_CRC32_D_INCLUDED 33 | 34 | #include "platform.h" 35 | #include "private/crc_implementation.h" 36 | 37 | ///\defgroup crc32_q 32 bit CRC_Q calculation 38 | ///\ingroup crc 39 | 40 | namespace etl 41 | { 42 | #if ETL_USING_CPP11 43 | template 44 | using crc32_q_t = etl::crc_type; 45 | #else 46 | template 47 | class crc32_q_t : public etl::crc_type 48 | { 49 | public: 50 | 51 | //************************************************************************* 52 | /// Default constructor. 53 | //************************************************************************* 54 | crc32_q_t() 55 | { 56 | this->reset(); 57 | } 58 | 59 | //************************************************************************* 60 | /// Constructor from range. 61 | /// \param begin Start of the range. 62 | /// \param end End of the range. 63 | //************************************************************************* 64 | template 65 | crc32_q_t(TIterator begin, const TIterator end) 66 | { 67 | this->reset(); 68 | this->add(begin, end); 69 | } 70 | }; 71 | #endif 72 | 73 | typedef etl::crc32_q_t<256U> crc32_q_t256; 74 | typedef etl::crc32_q_t<16U> crc32_q_t16; 75 | typedef etl::crc32_q_t<4U> crc32_q_t4; 76 | typedef crc32_q_t256 crc32_q; 77 | } 78 | #endif 79 | -------------------------------------------------------------------------------- /src/etl/cstring.h: -------------------------------------------------------------------------------- 1 | ///\file 2 | 3 | /****************************************************************************** 4 | The MIT License(MIT) 5 | 6 | Embedded Template Library. 7 | https://github.com/ETLCPP/etl 8 | https://www.etlcpp.com 9 | 10 | Copyright(c) 2020 jwellbelove 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining a copy 13 | of this software and associated documentation files(the "Software"), to deal 14 | in the Software without restriction, including without limitation the rights 15 | to use, copy, modify, merge, publish, distribute, sublicense, and / or sell 16 | copies of the Software, and to permit persons to whom the Software is 17 | furnished to do so, subject to the following conditions : 18 | 19 | The above copyright notice and this permission notice shall be included in all 20 | copies or substantial portions of the Software. 21 | 22 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 25 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 26 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 27 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 28 | SOFTWARE. 29 | ******************************************************************************/ 30 | 31 | //***************************************************************************** 32 | // This header is deprecated. Use "string.h" 33 | //***************************************************************************** 34 | 35 | #pragma message ("This header is deprecated. Use 'etl/string.h'") 36 | 37 | #include "string.h" 38 | -------------------------------------------------------------------------------- /src/etl/delegate.h: -------------------------------------------------------------------------------- 1 | ///\file 2 | 3 | /****************************************************************************** 4 | The MIT License(MIT) 5 | 6 | Embedded Template Library. 7 | https://github.com/ETLCPP/etl 8 | https://www.etlcpp.com 9 | 10 | Copyright(c) 2021 John Wellbelove 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining a copy 13 | of this software and associated documentation files(the "Software"), to deal 14 | in the Software without restriction, including without limitation the rights 15 | to use, copy, modify, merge, publish, distribute, sublicense, and / or sell 16 | copies of the Software, and to permit persons to whom the Software is 17 | furnished to do so, subject to the following conditions : 18 | 19 | The above copyright notice and this permission notice shall be included in all 20 | copies or substantial portions of the Software. 21 | 22 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 25 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 26 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 27 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 28 | SOFTWARE. 29 | ******************************************************************************/ 30 | 31 | #ifndef ETL_DELEGATE_INCLUDED 32 | #define ETL_DELEGATE_INCLUDED 33 | 34 | #include "platform.h" 35 | 36 | #if ETL_USING_CPP11 && !defined(ETL_DELEGATE_FORCE_CPP03_IMPLEMENTATION) 37 | #include "private/delegate_cpp11.h" 38 | #else 39 | #include "private/delegate_cpp03.h" 40 | #endif 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /src/etl/doxygen.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | The MIT License(MIT) 3 | 4 | Embedded Template Library. 5 | https://github.com/ETLCPP/etl 6 | http://www.etlcpp.com 7 | 8 | Copyright(c) 2014 jwellbelove 9 | 10 | Permission is hereby granted, free of charge, to any person obtaining a copy 11 | of this software and associated documentation files(the "Software"), to deal 12 | in the Software without restriction, including without limitation the rights 13 | to use, copy, modify, merge, publish, distribute, sublicense, and / or sell 14 | copies of the Software, and to permit persons to whom the Software is 15 | furnished to do so, subject to the following conditions : 16 | 17 | The above copyright notice and this permission notice shall be included in all 18 | copies or substantial portions of the Software. 19 | 20 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 23 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 25 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | SOFTWARE. 27 | ******************************************************************************/ 28 | 29 | ///\defgroup etl Embedded Template Library. 30 | https://github.com/ETLCPP/etl 31 | http://www.etlcpp.com 32 | 33 | ///\defgroup containers Containers 34 | ///\ingroup etl 35 | 36 | ///\defgroup utilities Utilities 37 | /// A set of utility templates. 38 | ///\ingroup etl 39 | 40 | ///\defgroup maths Maths 41 | /// A set of mathematical templates. 42 | ///\ingroup etl 43 | 44 | ///\defgroup patterns Patterns 45 | /// A set of templated design patterns. 46 | ///\ingroup etl 47 | 48 | ///\defgroup crc CRC 49 | /// A set of CRC calculations 50 | ///\ingroup maths 51 | 52 | ///\ingroup etl 53 | namespace etl {} 54 | 55 | 56 | -------------------------------------------------------------------------------- /src/etl/factorial.h: -------------------------------------------------------------------------------- 1 | ///\file 2 | 3 | /****************************************************************************** 4 | The MIT License(MIT) 5 | 6 | Embedded Template Library. 7 | https://github.com/ETLCPP/etl 8 | https://www.etlcpp.com 9 | 10 | Copyright(c) 2014 John Wellbelove 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining a copy 13 | of this software and associated documentation files(the "Software"), to deal 14 | in the Software without restriction, including without limitation the rights 15 | to use, copy, modify, merge, publish, distribute, sublicense, and / or sell 16 | copies of the Software, and to permit persons to whom the Software is 17 | furnished to do so, subject to the following conditions : 18 | 19 | The above copyright notice and this permission notice shall be included in all 20 | copies or substantial portions of the Software. 21 | 22 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 25 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 26 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 27 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 28 | SOFTWARE. 29 | ******************************************************************************/ 30 | 31 | #ifndef ETL_FACTORIAL_INCLUDED 32 | #define ETL_FACTORIAL_INCLUDED 33 | 34 | #include "platform.h" 35 | 36 | #include 37 | 38 | ///\defgroup factorial factorial 39 | /// fibonacci : Calculates the Nth factorial value. 40 | ///\ingroup maths 41 | 42 | namespace etl 43 | { 44 | //*************************************************************************** 45 | ///\ingroup fibonacci 46 | /// Defines value as the Nth factorial number. 47 | ///\tparam N The number to find the factorial value of. 48 | //*************************************************************************** 49 | template 50 | struct factorial 51 | { 52 | static ETL_CONSTANT size_t value = N * factorial::value; 53 | }; 54 | 55 | //*************************************************************************** 56 | // Specialisation for N = 0 57 | //*************************************************************************** 58 | template <> 59 | struct factorial<0> 60 | { 61 | static ETL_CONSTANT size_t value = 1; 62 | }; 63 | 64 | template 65 | ETL_CONSTANT size_t factorial::value; 66 | 67 | #if ETL_USING_CPP17 68 | template 69 | inline constexpr size_t factorial_v = factorial::value; 70 | #endif 71 | } 72 | 73 | #endif 74 | -------------------------------------------------------------------------------- /src/etl/file_error_numbers.txt: -------------------------------------------------------------------------------- 1 | 1 deque 2 | 2 flat_map 3 | 3 flat_multimap 4 | 4 flat_multiset 5 | 5 flat_set 6 | 6 forward_list 7 | 7 list 8 | 8 map 9 | 9 multimap 10 | 10 multiset 11 | 11 pool 12 | 12 priority_queue 13 | 13 queue 14 | 14 set 15 | 15 stack 16 | 16 unordered_map 17 | 17 vector 18 | 18 observer 19 | 19 ihash 20 | 20 intrusive_forward_list 21 | 21 intrusive_list 22 | 22 intrusive_links 23 | 23 unordered_set 24 | 24 variant 25 | 25 unordered_multimap 26 | 26 unordered_multiset 27 | 27 basic_string 28 | 28 intrusive_stack 29 | 29 intrusive_queue 30 | 30 reference_flat_map 31 | 31 reference_flat_multimap 32 | 32 reference_flat_set 33 | 33 reference_flat_multiset 34 | 34 fsm 35 | 35 message_router 36 | 36 scheduler 37 | 37 task 38 | 38 message 39 | 39 message_bus 40 | 40 factory / variant_pool 41 | 41 array_view 42 | 42 string_view 43 | 43 callback_timer 44 | 44 message_timer 45 | 45 type_lookup 46 | 46 queue_spsc_isr 47 | 47 queue_spsc_atomic 48 | 48 queue_mpmc_mutex 49 | 49 type_select 50 | 50 binary 51 | 51 delegate 52 | 52 bitset 53 | 53 indirect_vector 54 | 54 queue_spsc_locked 55 | 55 message_packet 56 | 56 circular_buffer 57 | -------------------------------------------------------------------------------- /src/etl/format_spec.h: -------------------------------------------------------------------------------- 1 | ///\file 2 | 3 | /****************************************************************************** 4 | The MIT License(MIT) 5 | 6 | Embedded Template Library. 7 | https://github.com/ETLCPP/etl 8 | https://www.etlcpp.com 9 | 10 | Copyright(c) 2019 John Wellbelove 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining a copy 13 | of this software and associated documentation files(the "Software"), to deal 14 | in the Software without restriction, including without limitation the rights 15 | to use, copy, modify, merge, publish, distribute, sublicense, and / or sell 16 | copies of the Software, and to permit persons to whom the Software is 17 | furnished to do so, subject to the following conditions : 18 | 19 | The above copyright notice and this permission notice shall be included in all 20 | copies or substantial portions of the Software. 21 | 22 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 25 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 26 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 27 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 28 | SOFTWARE. 29 | ******************************************************************************/ 30 | 31 | #ifndef ETL_FORMAT_SPEC_INCLUDED 32 | #define ETL_FORMAT_SPEC_INCLUDED 33 | 34 | ///\ingroup string 35 | 36 | #include "platform.h" 37 | #include "basic_format_spec.h" 38 | #include "string.h" 39 | 40 | namespace etl 41 | { 42 | typedef etl::basic_format_spec format_spec; 43 | } 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /src/etl/generators/generate.bat: -------------------------------------------------------------------------------- 1 | python -m cogapp -d -e -o../fsm.h -DHandlers=16 fsm_generator.h 2 | python -m cogapp -d -e -o../message_router.h -DHandlers=16 message_router_generator.h 3 | python -m cogapp -d -e -o../largest.h -DNTypes=16 largest_generator.h 4 | python -m cogapp -d -e -o../smallest.h -DNTypes=16 smallest_generator.h 5 | python -m cogapp -d -e -o../type_traits.h -DIsOneOf=16 type_traits_generator.h 6 | python -m cogapp -d -e -o../type_lookup.h -DNTypes=16 type_lookup_generator.h 7 | python -m cogapp -d -e -o../type_select.h -DNTypes=16 type_select_generator.h 8 | python -m cogapp -d -e -o../message_packet.h -DHandlers=16 message_packet_generator.h 9 | python -m cogapp -d -e -o../variant_pool.h -DNTypes=16 variant_pool_generator.h 10 | -------------------------------------------------------------------------------- /src/etl/generators/generate_fsm.bat: -------------------------------------------------------------------------------- 1 | python -m cogapp -d -e -o../fsm.h -DHandlers=16 fsm_generator.h 2 | -------------------------------------------------------------------------------- /src/etl/generators/generate_largest.bat: -------------------------------------------------------------------------------- 1 | python -m cogapp -d -e -o../largest.h -DNTypes=16 largest_generator.h 2 | -------------------------------------------------------------------------------- /src/etl/generators/generate_message_packet.bat: -------------------------------------------------------------------------------- 1 | python -m cogapp -d -e -o../message_packet.h -DHandlers=16 message_packet_generator.h 2 | -------------------------------------------------------------------------------- /src/etl/generators/generate_message_router.bat: -------------------------------------------------------------------------------- 1 | python -m cogapp -d -e -o../message_router.h -DHandlers=16 message_router_generator.h 2 | -------------------------------------------------------------------------------- /src/etl/generators/generate_smallest.bat: -------------------------------------------------------------------------------- 1 | python -m cogapp -d -e -o../smallest.h -DNTypes=16 smallest_generator.h 2 | -------------------------------------------------------------------------------- /src/etl/generators/generate_type_lookup.bat: -------------------------------------------------------------------------------- 1 | python -m cogapp -d -e -o../type_lookup.h -DNTypes=16 type_lookup_generator.h 2 | -------------------------------------------------------------------------------- /src/etl/generators/generate_type_select.bat: -------------------------------------------------------------------------------- 1 | python -m cogapp -d -e -o../type_select.h -DNTypes=16 type_select_generator.h 2 | -------------------------------------------------------------------------------- /src/etl/generators/generate_type_traits.bat: -------------------------------------------------------------------------------- 1 | python -m cogapp -d -e -o../type_traits.h -DIsOneOf=16 type_traits_generator.h 2 | -------------------------------------------------------------------------------- /src/etl/generators/generate_variant_pool.bat: -------------------------------------------------------------------------------- 1 | python -m cogapp -d -e -o../variant_pool.h -DNTypes=16 variant_pool_generator.h 2 | -------------------------------------------------------------------------------- /src/etl/ihash.h: -------------------------------------------------------------------------------- 1 | ///\file 2 | 3 | /****************************************************************************** 4 | The MIT License(MIT) 5 | 6 | Embedded Template Library. 7 | https://github.com/ETLCPP/etl 8 | https://www.etlcpp.com 9 | 10 | Copyright(c) 2015 John Wellbelove 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining a copy 13 | of this software and associated documentation files(the "Software"), to deal 14 | in the Software without restriction, including without limitation the rights 15 | to use, copy, modify, merge, publish, distribute, sublicense, and / or sell 16 | copies of the Software, and to permit persons to whom the Software is 17 | furnished to do so, subject to the following conditions : 18 | 19 | The above copyright notice and this permission notice shall be included in all 20 | copies or substantial portions of the Software. 21 | 22 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 25 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 26 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 27 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 28 | SOFTWARE. 29 | ******************************************************************************/ 30 | 31 | #ifndef ETL_IHASH_INCLUDED 32 | #define ETL_IHASH_INCLUDED 33 | 34 | #include "platform.h" 35 | #include "utility.h" 36 | #include "exception.h" 37 | #include "error_handler.h" 38 | 39 | #include 40 | 41 | ///\defgroup ihash Common data for all hash type classes. 42 | ///\ingroup hash 43 | 44 | namespace etl 45 | { 46 | //*************************************************************************** 47 | ///\ingroup hash 48 | /// Exception base for hashes. 49 | //*************************************************************************** 50 | class hash_exception : public exception 51 | { 52 | public: 53 | 54 | hash_exception(string_type reason_, string_type file_name_, numeric_type line_number_) 55 | : exception(reason_, file_name_, line_number_) 56 | {} 57 | }; 58 | 59 | //*************************************************************************** 60 | ///\ingroup vector 61 | /// Hash finalised exception. 62 | //*************************************************************************** 63 | class hash_finalised : public hash_exception 64 | { 65 | public: 66 | 67 | hash_finalised(string_type file_name_, numeric_type line_number_) 68 | : hash_exception(ETL_ERROR_TEXT("ihash:finalised", ETL_IHASH_FILE_ID"A"), file_name_, line_number_) 69 | {} 70 | }; 71 | 72 | /// For the Americans 73 | typedef hash_finalised hash_finalized; 74 | } 75 | 76 | #endif 77 | -------------------------------------------------------------------------------- /src/etl/ireference_counted_message_pool.h: -------------------------------------------------------------------------------- 1 | ///\file 2 | 3 | /****************************************************************************** 4 | The MIT License(MIT) 5 | 6 | Embedded Template Library. 7 | https://github.com/ETLCPP/etl 8 | https://www.etlcpp.com 9 | 10 | Copyright(c) 2020 John Wellbelove 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining a copy 13 | of this software and associated documentation files(the "Software"), to deal 14 | in the Software without restriction, including without limitation the rights 15 | to use, copy, modify, merge, publish, distribute, sublicense, and / or sell 16 | copies of the Software, and to permit persons to whom the Software is 17 | furnished to do so, subject to the following conditions : 18 | 19 | The above copyright notice and this permission notice shall be included in all 20 | copies or substantial portions of the Software. 21 | 22 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 25 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 26 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 27 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 28 | SOFTWARE. 29 | ******************************************************************************/ 30 | 31 | #ifndef ETL_IREFERENCE_COUNTED_MESSAGE_POOL_INCLUDED 32 | #define ETL_IREFERENCE_COUNTED_MESSAGE_POOL_INCLUDED 33 | 34 | #include "platform.h" 35 | 36 | namespace etl 37 | { 38 | class ireference_counted_message; 39 | 40 | //*************************************************************************** 41 | /// Interface for a reference counted message pool. 42 | //*************************************************************************** 43 | class ireference_counted_message_pool 44 | { 45 | public: 46 | 47 | virtual ~ireference_counted_message_pool() {} 48 | virtual void release(const etl::ireference_counted_message& msg) = 0; 49 | 50 | protected: 51 | 52 | //*************************************************************************** 53 | /// The pool lock function. 54 | /// Override to add thread or interrupt locking to the pool. 55 | //*************************************************************************** 56 | virtual void lock() 57 | { 58 | // The default implementation does nothing. 59 | } 60 | 61 | //*************************************************************************** 62 | /// The pool unlock function. 63 | /// Override to add thread or interrupt unlocking to the pool. 64 | //*************************************************************************** 65 | virtual void unlock() 66 | { 67 | // The default implementation does nothing. 68 | } 69 | }; 70 | } 71 | 72 | #endif 73 | 74 | -------------------------------------------------------------------------------- /src/etl/macros.h: -------------------------------------------------------------------------------- 1 | ///\file 2 | 3 | /****************************************************************************** 4 | The MIT License(MIT) 5 | 6 | Embedded Template Library. 7 | https://github.com/ETLCPP/etl 8 | https://www.etlcpp.com 9 | 10 | Copyright(c) 2018 John Wellbelove 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining a copy 13 | of this software and associated documentation files(the "Software"), to deal 14 | in the Software without restriction, including without limitation the rights 15 | to use, copy, modify, merge, publish, distribute, sublicense, and / or sell 16 | copies of the Software, and to permit persons to whom the Software is 17 | furnished to do so, subject to the following conditions : 18 | 19 | The above copyright notice and this permission notice shall be included in all 20 | copies or substantial portions of the Software. 21 | 22 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 25 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 26 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 27 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 28 | SOFTWARE. 29 | ******************************************************************************/ 30 | 31 | #ifndef ETL_MACROS_INCLUDED 32 | #define ETL_MACROS_INCLUDED 33 | 34 | #define ETL_CONCAT2(X, Y) X##Y 35 | #define ETL_CONCAT(X, Y) ETL_CONCAT2(X, Y) 36 | 37 | #define ETL_STRINGIFY_1(...) #__VA_ARGS__ 38 | #define ETL_STRINGIFY(...) ETL_STRINGIFY_1(__VA_ARGS__) 39 | 40 | #define ETL_STRING(X) ETL_CONCAT(, ETL_STRINGIFY(X)) 41 | #define ETL_WIDE_STRING(X) ETL_CONCAT(L, ETL_STRINGIFY(X)) 42 | #define ETL_U8_STRING(X) ETL_CONCAT(u8, ETL_STRINGIFY(X)) 43 | #define ETL_U16_STRING(X) ETL_CONCAT(u, ETL_STRINGIFY(X)) 44 | #define ETL_U32_STRING(X) ETL_CONCAT(U, ETL_STRINGIFY(X)) 45 | 46 | #endif 47 | 48 | -------------------------------------------------------------------------------- /src/etl/memory_model.h: -------------------------------------------------------------------------------- 1 | ///\file 2 | 3 | /****************************************************************************** 4 | The MIT License(MIT) 5 | 6 | Embedded Template Library. 7 | https://github.com/ETLCPP/etl 8 | https://www.etlcpp.com 9 | 10 | Copyright(c) 2018 John Wellbelove 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining a copy 13 | of this software and associated documentation files(the "Software"), to deal 14 | in the Software without restriction, including without limitation the rights 15 | to use, copy, modify, merge, publish, distribute, sublicense, and / or sell 16 | copies of the Software, and to permit persons to whom the Software is 17 | furnished to do so, subject to the following conditions : 18 | 19 | The above copyright notice and this permission notice shall be included in all 20 | copies or substantial portions of the Software. 21 | 22 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 25 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 26 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 27 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 28 | SOFTWARE. 29 | ******************************************************************************/ 30 | 31 | #ifndef ETL_MEMORY_MODEL_INCLUDED 32 | #define ETL_MEMORY_MODEL_INCLUDED 33 | 34 | #include "platform.h" 35 | #include "user_type.h" 36 | #include "type_lookup.h" 37 | 38 | #include 39 | 40 | namespace etl 41 | { 42 | ETL_DECLARE_USER_TYPE(memory_model, int) 43 | ETL_USER_TYPE(MEMORY_MODEL_SMALL, 0) 44 | ETL_USER_TYPE(MEMORY_MODEL_MEDIUM, 1) 45 | ETL_USER_TYPE(MEMORY_MODEL_LARGE, 2) 46 | ETL_USER_TYPE(MEMORY_MODEL_HUGE, 3) 47 | ETL_END_USER_TYPE(memory_model) 48 | 49 | template 50 | struct size_type_lookup; 51 | 52 | template <> 53 | struct size_type_lookup 54 | { 55 | typedef uint_least8_t type; 56 | }; 57 | 58 | template <> 59 | struct size_type_lookup 60 | { 61 | typedef uint_least16_t type; 62 | }; 63 | 64 | template <> 65 | struct size_type_lookup 66 | { 67 | typedef uint_least32_t type; 68 | }; 69 | 70 | template <> 71 | struct size_type_lookup 72 | { 73 | typedef uint_least64_t type; 74 | }; 75 | } 76 | 77 | #endif 78 | 79 | -------------------------------------------------------------------------------- /src/etl/message_types.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | The MIT License(MIT) 3 | 4 | Embedded Template Library. 5 | https://github.com/ETLCPP/etl 6 | https://www.etlcpp.com 7 | 8 | Copyright(c) 2017 John Wellbelove 9 | 10 | Permission is hereby granted, free of charge, to any person obtaining a copy 11 | of this software and associated documentation files(the "Software"), to deal 12 | in the Software without restriction, including without limitation the rights 13 | to use, copy, modify, merge, publish, distribute, sublicense, and / or sell 14 | copies of the Software, and to permit persons to whom the Software is 15 | furnished to do so, subject to the following conditions : 16 | 17 | The above copyright notice and this permission notice shall be included in all 18 | copies or substantial portions of the Software. 19 | 20 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 23 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 25 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | SOFTWARE. 27 | ******************************************************************************/ 28 | 29 | #ifndef ETL_MESSAGE_DEFS_INCLUDED 30 | #define ETL_MESSAGE_DEFS_INCLUDED 31 | 32 | #include "platform.h" 33 | 34 | #include 35 | 36 | namespace etl 37 | { 38 | /// Allow alternative type for message id. 39 | #if !defined(ETL_MESSAGE_ID_TYPE) 40 | typedef uint_least8_t message_id_t; 41 | #else 42 | typedef ETL_MESSAGE_ID_TYPE message_id_t; 43 | #endif 44 | 45 | typedef uint_least8_t message_router_id_t; 46 | } 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /src/etl/multi_array.h: -------------------------------------------------------------------------------- 1 | ///\file 2 | 3 | /****************************************************************************** 4 | The MIT License(MIT) 5 | 6 | Embedded Template Library. 7 | https://github.com/ETLCPP/etl 8 | https://www.etlcpp.com 9 | 10 | Copyright(c) 2019 John Wellbelove 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining a copy 13 | of this software and associated documentation files(the "Software"), to deal 14 | in the Software without restriction, including without limitation the rights 15 | to use, copy, modify, merge, publish, distribute, sublicense, and / or sell 16 | copies of the Software, and to permit persons to whom the Software is 17 | furnished to do so, subject to the following conditions : 18 | 19 | The above copyright notice and this permission notice shall be included in all 20 | copies or substantial portions of the Software. 21 | 22 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 25 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 26 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 27 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 28 | SOFTWARE. 29 | ******************************************************************************/ 30 | 31 | #ifndef ETL_MULTI_ARRAY_INCLUDED 32 | #define ETL_MULTI_ARRAY_INCLUDED 33 | 34 | #include "platform.h" 35 | #include "array.h" 36 | 37 | ///\defgroup multi_array multi_array 38 | /// A multi dimensional array. 39 | ///\ingroup containers 40 | 41 | namespace etl 42 | { 43 | #if ETL_USING_CPP11 44 | 45 | namespace private_multi_array 46 | { 47 | template 48 | struct multi_array_t 49 | { 50 | using type = etl::array::type, TD1>; 51 | static constexpr size_t SIZE = TD1; 52 | }; 53 | 54 | template 55 | struct multi_array_t 56 | { 57 | using type = etl::array; 58 | static constexpr size_t SIZE = TD1; 59 | }; 60 | } 61 | 62 | template 63 | using multi_array = typename private_multi_array::multi_array_t::type; 64 | 65 | #endif 66 | } 67 | 68 | #endif 69 | 70 | -------------------------------------------------------------------------------- /src/etl/multi_vector.h: -------------------------------------------------------------------------------- 1 | /////\file 2 | // 3 | ///****************************************************************************** 4 | //The MIT License(MIT) 5 | // 6 | //Embedded Template Library. 7 | //https://github.com/ETLCPP/etl 8 | //https://www.etlcpp.com 9 | // 10 | //Copyright(c) 2021 John Wellbelove 11 | // 12 | //Permission is hereby granted, free of charge, to any person obtaining a copy 13 | //of this software and associated documentation files(the "Software"), to deal 14 | //in the Software without restriction, including without limitation the rights 15 | //to use, copy, modify, merge, publish, distribute, sublicense, and / or sell 16 | //copies of the Software, and to permit persons to whom the Software is 17 | //furnished to do so, subject to the following conditions : 18 | // 19 | //The above copyright notice and this permission notice shall be included in all 20 | //copies or substantial portions of the Software. 21 | // 22 | //THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | //IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | //FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 25 | //AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 26 | //LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 27 | //OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 28 | //SOFTWARE. 29 | //******************************************************************************/ 30 | 31 | #ifndef ETL_MULTI_VECTOR_INCLUDED 32 | #define ETL_MULTI_VECTOR_INCLUDED 33 | 34 | #include "platform.h" 35 | #include "vector.h" 36 | 37 | ///\defgroup multi_vector multi_vector 38 | /// A multi dimensional vector. 39 | ///\ingroup containers 40 | 41 | #if ETL_USING_CPP11 42 | 43 | namespace etl 44 | { 45 | namespace private_multi_vector 46 | { 47 | template 48 | struct multi_vector_t 49 | { 50 | using type = etl::vector::type, TD1>; 51 | static constexpr size_t Max_Size = TD1; 52 | }; 53 | 54 | template 55 | struct multi_vector_t 56 | { 57 | using type = etl::vector; 58 | static constexpr size_t Max_Size = TD1; 59 | }; 60 | } 61 | 62 | template 63 | using multi_vector = typename private_multi_vector::multi_vector_t::type; 64 | } 65 | 66 | #endif 67 | #endif 68 | 69 | -------------------------------------------------------------------------------- /src/etl/mutex/mutex_arm.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | The MIT License(MIT) 3 | 4 | Embedded Template Library. 5 | https://github.com/ETLCPP/etl 6 | https://www.etlcpp.com 7 | 8 | Copyright(c) 2017 John Wellbelove 9 | 10 | Permission is hereby granted, free of charge, to any person obtaining a copy 11 | of this software and associated documentation files(the "Software"), to deal 12 | in the Software without restriction, including without limitation the rights 13 | to use, copy, modify, merge, publish, distribute, sublicense, and / or sell 14 | copies of the Software, and to permit persons to whom the Software is 15 | furnished to do so, subject to the following conditions : 16 | 17 | The above copyright notice and this permission notice shall be included in all 18 | copies or substantial portions of the Software. 19 | 20 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 23 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 25 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | SOFTWARE. 27 | ******************************************************************************/ 28 | 29 | #ifndef ETL_MUTEX_ARM_INCLUDED 30 | #define ETL_MUTEX_ARM_INCLUDED 31 | 32 | #include "mutex_gcc_sync.h" 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /src/etl/mutex/mutex_clang_sync.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | The MIT License(MIT) 3 | 4 | Embedded Template Library. 5 | https://github.com/ETLCPP/etl 6 | https://www.etlcpp.com 7 | 8 | Copyright(c) 2020 John Wellbelove 9 | 10 | Permission is hereby granted, free of charge, to any person obtaining a copy 11 | of this software and associated documentation files(the "Software"), to deal 12 | in the Software without restriction, including without limitation the rights 13 | to use, copy, modify, merge, publish, distribute, sublicense, and / or sell 14 | copies of the Software, and to permit persons to whom the Software is 15 | furnished to do so, subject to the following conditions : 16 | 17 | The above copyright notice and this permission notice shall be included in all 18 | copies or substantial portions of the Software. 19 | 20 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 23 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 25 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | SOFTWARE. 27 | ******************************************************************************/ 28 | 29 | #ifndef ETL_MUTEX_CLANG_INCLUDED 30 | #define ETL_MUTEX_CLANG_INCLUDED 31 | 32 | #include "mutex_gcc_sync.h" 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /src/etl/mutex/mutex_cmsis_os1.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ETLCPP/etl-arduino/54ed03dd4ef62dbd58b6642c01d56fd3a7b56547/src/etl/mutex/mutex_cmsis_os1.h -------------------------------------------------------------------------------- /src/etl/mutex/mutex_cmsis_os2.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | The MIT License(MIT) 3 | 4 | Embedded Template Library. 5 | https://github.com/ETLCPP/etl 6 | https://www.etlcpp.com 7 | 8 | Copyright(c) 2021 John Wellbelove 9 | 10 | Permission is hereby granted, free of charge, to any person obtaining a copy 11 | of this software and associated documentation files(the "Software"), to deal 12 | in the Software without restriction, including without limitation the rights 13 | to use, copy, modify, merge, publish, distribute, sublicense, and / or sell 14 | copies of the Software, and to permit persons to whom the Software is 15 | furnished to do so, subject to the following conditions : 16 | 17 | The above copyright notice and this permission notice shall be included in all 18 | copies or substantial portions of the Software. 19 | 20 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 23 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 25 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | SOFTWARE. 27 | ******************************************************************************/ 28 | 29 | #ifndef ETL_MUTEX_CMSIS_RTOS2_INCLUDED 30 | #define ETL_MUTEX_CMSIS_RTOS2_INCLUDED 31 | 32 | #include "../platform.h" 33 | 34 | #include 35 | 36 | namespace etl 37 | { 38 | //*************************************************************************** 39 | ///\ingroup mutex 40 | ///\brief This mutex class is implemented using CMSIS's RTOS2 mutexes 41 | //*************************************************************************** 42 | class mutex 43 | { 44 | public: 45 | 46 | mutex() 47 | : id(NULL) 48 | { 49 | osMutexAttr_t attr = { "ETL", osMutexRecursive | osMutexPrioInherit | osMutexRobust, 0, 0 }; 50 | id = osMutexNew(&attr); 51 | } 52 | 53 | ~mutex() 54 | { 55 | osMutexDelete(id); 56 | } 57 | 58 | void lock() 59 | { 60 | osMutexAcquire(id, osWaitForever); 61 | } 62 | 63 | bool try_lock() 64 | { 65 | return osMutexAcquire(id, 0) == osOK; 66 | } 67 | 68 | void unlock() 69 | { 70 | osMutexRelease(id); 71 | } 72 | 73 | private: 74 | 75 | mutex(const mutex&) ETL_DELETE; 76 | mutex& operator=(const mutex&) ETL_DELETE; 77 | 78 | osMutexId_t id; 79 | }; 80 | } 81 | 82 | #endif 83 | -------------------------------------------------------------------------------- /src/etl/mutex/mutex_freertos.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | The MIT License(MIT) 3 | 4 | Embedded Template Library. 5 | https://github.com/ETLCPP/etl 6 | https://www.etlcpp.com 7 | 8 | Copyright(c) 2020 Phil Wise phil@phil-wise.com 9 | 10 | Permission is hereby granted, free of charge, to any person obtaining a copy 11 | of this software and associated documentation files(the "Software"), to deal 12 | in the Software without restriction, including without limitation the rights 13 | to use, copy, modify, merge, publish, distribute, sublicense, and / or sell 14 | copies of the Software, and to permit persons to whom the Software is 15 | furnished to do so, subject to the following conditions : 16 | 17 | The above copyright notice and this permission notice shall be included in all 18 | copies or substantial portions of the Software. 19 | 20 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 23 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 25 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | SOFTWARE. 27 | ******************************************************************************/ 28 | 29 | #ifndef ETL_MUTEX_FREERTOS_INCLUDED 30 | #define ETL_MUTEX_FREERTOS_INCLUDED 31 | 32 | #include "../platform.h" 33 | 34 | #include "FreeRTOS.h" 35 | #include 36 | 37 | namespace etl 38 | { 39 | //*************************************************************************** 40 | ///\ingroup mutex 41 | ///\brief This mutex class is implemented using FreeRTOS's mutexes 42 | //*************************************************************************** 43 | class mutex 44 | { 45 | public: 46 | 47 | mutex() 48 | { 49 | access = xSemaphoreCreateMutexStatic(&mutex_allocation); 50 | } 51 | 52 | void lock() 53 | { 54 | xSemaphoreTake(access, portMAX_DELAY); // portMAX_DELAY=block forever 55 | } 56 | 57 | bool try_lock() 58 | { 59 | return xSemaphoreTake(access, 0) == pdTRUE; 60 | } 61 | 62 | void unlock() 63 | { 64 | xSemaphoreGive(access); 65 | } 66 | 67 | private: 68 | // Non-copyable 69 | mutex(const mutex&) ETL_DELETE; 70 | mutex& operator=(const mutex&) ETL_DELETE; 71 | 72 | // Memory to hold the mutex 73 | StaticSemaphore_t mutex_allocation; 74 | 75 | // The mutex handle itself 76 | SemaphoreHandle_t access; 77 | }; 78 | } 79 | 80 | #endif 81 | -------------------------------------------------------------------------------- /src/etl/mutex/mutex_gcc_sync.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | The MIT License(MIT) 3 | 4 | Embedded Template Library. 5 | https://github.com/ETLCPP/etl 6 | https://www.etlcpp.com 7 | 8 | Copyright(c) 2017 John Wellbelove 9 | 10 | Permission is hereby granted, free of charge, to any person obtaining a copy 11 | of this software and associated documentation files(the "Software"), to deal 12 | in the Software without restriction, including without limitation the rights 13 | to use, copy, modify, merge, publish, distribute, sublicense, and / or sell 14 | copies of the Software, and to permit persons to whom the Software is 15 | furnished to do so, subject to the following conditions : 16 | 17 | The above copyright notice and this permission notice shall be included in all 18 | copies or substantial portions of the Software. 19 | 20 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 23 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 25 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | SOFTWARE. 27 | ******************************************************************************/ 28 | 29 | #ifndef ETL_MUTEX_GCC_SYNC_INCLUDED 30 | #define ETL_MUTEX_GCC_SYNC_INCLUDED 31 | 32 | #include "../platform.h" 33 | 34 | #include 35 | 36 | namespace etl 37 | { 38 | //*************************************************************************** 39 | ///\ingroup mutex 40 | ///\brief This mutex class is implemented using GCC's __sync functions. 41 | //*************************************************************************** 42 | class mutex 43 | { 44 | public: 45 | 46 | mutex() 47 | : flag(0) 48 | { 49 | __sync_lock_release(&flag); 50 | } 51 | 52 | void lock() 53 | { 54 | while (__sync_lock_test_and_set(&flag, 1U)) 55 | { 56 | } 57 | } 58 | 59 | bool try_lock() 60 | { 61 | return (__sync_lock_test_and_set(&flag, 1U) == 0U); 62 | } 63 | 64 | void unlock() 65 | { 66 | __sync_lock_release(&flag); 67 | } 68 | 69 | private: 70 | 71 | mutex(const mutex&) ETL_DELETE; 72 | mutex& operator=(const mutex&) ETL_DELETE; 73 | 74 | char flag; 75 | }; 76 | } 77 | 78 | #endif 79 | -------------------------------------------------------------------------------- /src/etl/mutex/mutex_std.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | The MIT License(MIT) 3 | 4 | Embedded Template Library. 5 | https://github.com/ETLCPP/etl 6 | https://www.etlcpp.com 7 | 8 | Copyright(c) 2017 John Wellbelove 9 | 10 | Permission is hereby granted, free of charge, to any person obtaining a copy 11 | of this software and associated documentation files(the "Software"), to deal 12 | in the Software without restriction, including without limitation the rights 13 | to use, copy, modify, merge, publish, distribute, sublicense, and / or sell 14 | copies of the Software, and to permit persons to whom the Software is 15 | furnished to do so, subject to the following conditions : 16 | 17 | The above copyright notice and this permission notice shall be included in all 18 | copies or substantial portions of the Software. 19 | 20 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 23 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 25 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | SOFTWARE. 27 | ******************************************************************************/ 28 | 29 | #ifndef ETL_MUTEX_STD_INCLUDED 30 | #define ETL_MUTEX_STD_INCLUDED 31 | 32 | #include "../platform.h" 33 | 34 | #include 35 | 36 | namespace etl 37 | { 38 | //*************************************************************************** 39 | ///\ingroup mutex 40 | ///\brief This mutex class is implemented using std::mutex. 41 | //*************************************************************************** 42 | using mutex = std::mutex; 43 | } 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /src/etl/negative.h: -------------------------------------------------------------------------------- 1 | ///\file 2 | 3 | /****************************************************************************** 4 | The MIT License(MIT) 5 | 6 | Embedded Template Library. 7 | https://github.com/ETLCPP/etl 8 | https://www.etlcpp.com 9 | 10 | Copyright(c) 2018 John Wellbelove 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining a copy 13 | of this software and associated documentation files(the "Software"), to deal 14 | in the Software without restriction, including without limitation the rights 15 | to use, copy, modify, merge, publish, distribute, sublicense, and / or sell 16 | copies of the Software, and to permit persons to whom the Software is 17 | furnished to do so, subject to the following conditions : 18 | 19 | The above copyright notice and this permission notice shall be included in all 20 | copies or substantial portions of the Software. 21 | 22 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 25 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 26 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 27 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 28 | SOFTWARE. 29 | ******************************************************************************/ 30 | 31 | #ifndef ETL_NEGATIVE_INCLUDED 32 | #define ETL_NEGATIVE_INCLUDED 33 | 34 | #include "type_traits.h" 35 | 36 | namespace etl 37 | { 38 | //*************************************************************************** 39 | // For signed types. 40 | //*************************************************************************** 41 | template 42 | ETL_CONSTEXPR 43 | typename etl::enable_if::value, bool>::type 44 | is_negative(const T value) 45 | { 46 | return (value < T(0)); 47 | } 48 | 49 | //*************************************************************************** 50 | // For unsigned types. 51 | //*************************************************************************** 52 | template 53 | ETL_CONSTEXPR 54 | typename etl::enable_if::value, bool>::type 55 | is_negative(const T) 56 | { 57 | return false; 58 | } 59 | } 60 | 61 | #endif 62 | 63 | -------------------------------------------------------------------------------- /src/etl/null_type.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | The MIT License(MIT) 3 | 4 | Embedded Template Library. 5 | https://github.com/ETLCPP/etl 6 | https://www.etlcpp.com 7 | 8 | Copyright(c) 2018 John Wellbelove 9 | 10 | Permission is hereby granted, free of charge, to any person obtaining a copy 11 | of this software and associated documentation files(the "Software"), to deal 12 | in the Software without restriction, including without limitation the rights 13 | to use, copy, modify, merge, publish, distribute, sublicense, and / or sell 14 | copies of the Software, and to permit persons to whom the Software is 15 | furnished to do so, subject to the following conditions : 16 | 17 | The above copyright notice and this permission notice shall be included in all 18 | copies or substantial portions of the Software. 19 | 20 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 23 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 25 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | SOFTWARE. 27 | ******************************************************************************/ 28 | 29 | #ifndef ETL_NULL_TYPE_INCLUDED 30 | #define ETL_NULL_TYPE_INCLUDED 31 | 32 | #include "platform.h" 33 | 34 | #include 35 | 36 | namespace etl 37 | { 38 | template 39 | class null_type 40 | { 41 | }; 42 | } 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /src/etl/nullptr.h: -------------------------------------------------------------------------------- 1 | ///\file 2 | 3 | /****************************************************************************** 4 | The MIT License(MIT) 5 | 6 | Embedded Template Library. 7 | https://github.com/ETLCPP/etl 8 | https://www.etlcpp.com 9 | 10 | Copyright(c) 2014 John Wellbelove 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining a copy 13 | of this software and associated documentation files(the "Software"), to deal 14 | in the Software without restriction, including without limitation the rights 15 | to use, copy, modify, merge, publish, distribute, sublicense, and / or sell 16 | copies of the Software, and to permit persons to whom the Software is 17 | furnished to do so, subject to the following conditions : 18 | 19 | The above copyright notice and this permission notice shall be included in all 20 | copies or substantial portions of the Software. 21 | 22 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 25 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 26 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 27 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 28 | SOFTWARE. 29 | ******************************************************************************/ 30 | 31 | #ifndef ETL_NULLPTR_INCLUDED 32 | #define ETL_NULLPTR_INCLUDED 33 | 34 | #include "platform.h" 35 | 36 | #include 37 | 38 | namespace etl 39 | { 40 | #if ETL_CPP11_NOT_SUPPORTED 41 | class nullptr_t 42 | { 43 | public: 44 | template 45 | inline operator T*() const { return 0; } 46 | 47 | template 48 | inline operator T C::* () const { return 0; } 49 | 50 | inline bool operator==(nullptr_t) const { return true; } 51 | inline bool operator!=(nullptr_t) const { return false; } 52 | private: 53 | void operator&() const ETL_DELETE; // cannot take the address of ETL_NULLPTR 54 | }; 55 | 56 | static const nullptr_t _nullptr = nullptr_t(); 57 | 58 | #define ETL_NULLPTR (etl::_nullptr) 59 | #else 60 | // Use the new style nullptr. 61 | typedef decltype(nullptr) nullptr_t; 62 | #define ETL_NULLPTR nullptr 63 | #endif 64 | } 65 | 66 | #endif 67 | 68 | -------------------------------------------------------------------------------- /src/etl/parameter_type.h: -------------------------------------------------------------------------------- 1 | ///\file 2 | 3 | /****************************************************************************** 4 | The MIT License(MIT) 5 | 6 | Embedded Template Library. 7 | https://github.com/ETLCPP/etl 8 | https://www.etlcpp.com 9 | 10 | Copyright(c) 2014 John Wellbelove 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining a copy 13 | of this software and associated documentation files(the "Software"), to deal 14 | in the Software without restriction, including without limitation the rights 15 | to use, copy, modify, merge, publish, distribute, sublicense, and / or sell 16 | copies of the Software, and to permit persons to whom the Software is 17 | furnished to do so, subject to the following conditions : 18 | 19 | The above copyright notice and this permission notice shall be included in all 20 | copies or substantial portions of the Software. 21 | 22 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 25 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 26 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 27 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 28 | SOFTWARE. 29 | ******************************************************************************/ 30 | 31 | #ifndef ETL_PARAMETER_INCLUDED 32 | #define ETL_PARAMETER_INCLUDED 33 | 34 | #include "platform.h" 35 | #include "type_traits.h" 36 | 37 | namespace etl 38 | { 39 | //************************************************************************* 40 | /// Determine how to pass parameters. 41 | //************************************************************************* 42 | template 43 | struct parameter_type 44 | { 45 | /// By default fundamental and pointer types are passed by value. 46 | typedef typename etl::conditional::value || etl::is_pointer::value, 47 | T, 48 | const T&>::type type; 49 | }; 50 | 51 | #if ETL_USING_CPP11 52 | template 53 | using parameter_type_t = typename etl::parameter_type::type; 54 | #endif 55 | } 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /src/etl/permutations.h: -------------------------------------------------------------------------------- 1 | ///\file 2 | 3 | /****************************************************************************** 4 | The MIT License(MIT) 5 | 6 | Embedded Template Library. 7 | https://github.com/ETLCPP/etl 8 | https://www.etlcpp.com 9 | 10 | Copyright(c) 2018 John Wellbelove 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining a copy 13 | of this software and associated documentation files(the "Software"), to deal 14 | in the Software without restriction, including without limitation the rights 15 | to use, copy, modify, merge, publish, distribute, sublicense, and / or sell 16 | copies of the Software, and to permit persons to whom the Software is 17 | furnished to do so, subject to the following conditions : 18 | 19 | The above copyright notice and this permission notice shall be included in all 20 | copies or substantial portions of the Software. 21 | 22 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 25 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 26 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 27 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 28 | SOFTWARE. 29 | ******************************************************************************/ 30 | 31 | #ifndef ETL_PERMUTATIONS_INCLUDED 32 | #define ETL_PERMUTATIONS_INCLUDED 33 | 34 | #include "platform.h" 35 | 36 | ///\defgroup permutations permutations 37 | /// permutations : Calculates K permutations from N. 38 | ///\ingroup maths 39 | 40 | namespace etl 41 | { 42 | //*************************************************************************** 43 | ///\ingroup permutations 44 | /// Calculates permutations. 45 | //*************************************************************************** 46 | template 47 | struct permutations 48 | { 49 | static ETL_CONSTANT size_t value = NV * permutations::value; 50 | }; 51 | 52 | template 53 | ETL_CONSTANT size_t permutations::value; 54 | 55 | //*************************************************************************** 56 | /// Calculates permutations. 57 | /// Specialisation for KV == 0. 58 | //*************************************************************************** 59 | template 60 | struct permutations 61 | { 62 | static ETL_CONSTANT size_t value = 1UL; 63 | }; 64 | 65 | template 66 | ETL_CONSTANT size_t permutations::value; 67 | 68 | #if ETL_USING_CPP17 69 | template 70 | inline constexpr size_t permutations_v = permutations::value; 71 | #endif 72 | } 73 | 74 | #endif 75 | -------------------------------------------------------------------------------- /src/etl/placement_new.h: -------------------------------------------------------------------------------- 1 | ///\file 2 | 3 | /****************************************************************************** 4 | The MIT License(MIT) 5 | 6 | Embedded Template Library. 7 | https://github.com/ETLCPP/etl 8 | https://www.etlcpp.com 9 | 10 | Copyright(c) 2019 John Wellbelove 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining a copy 13 | of this software and associated documentation files(the "Software"), to deal 14 | in the Software without restriction, including without limitation the rights 15 | to use, copy, modify, merge, publish, distribute, sublicense, and / or sell 16 | copies of the Software, and to permit persons to whom the Software is 17 | furnished to do so, subject to the following conditions : 18 | 19 | The above copyright notice and this permission notice shall be included in all 20 | copies or substantial portions of the Software. 21 | 22 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 25 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 26 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 27 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 28 | SOFTWARE. 29 | ******************************************************************************/ 30 | 31 | #ifndef ETL_PLACEMENT_NEW_INCLUDED 32 | #define ETL_PLACEMENT_NEW_INCLUDED 33 | 34 | #include "platform.h" 35 | 36 | //***************************************************************************** 37 | // Figure out if we can use the standard library header, if haven't already done so. 38 | //***************************************************************************** 39 | #if !defined(ETL_USING_STD_NEW) 40 | #if defined(__has_include) 41 | #if __has_include() 42 | #define ETL_USING_STD_NEW 1 43 | #else 44 | #define ETL_USING_STD_NEW 0 45 | #endif 46 | #elif (defined(ARDUINO) && defined(__AVR__)) 47 | #define ETL_USING_STD_NEW 0 48 | #else 49 | #define ETL_USING_STD_NEW 1 50 | #endif 51 | #endif 52 | 53 | #if ETL_USING_STD_NEW 54 | #include 55 | #else 56 | //***************************************************************************** 57 | // Define placement new if no new header is available. 58 | //***************************************************************************** 59 | inline void* operator new(size_t, void* p) ETL_NOEXCEPT { return p; } 60 | inline void* operator new[](size_t, void* p) ETL_NOEXCEPT { return p; } 61 | 62 | inline void operator delete(void*, void*) ETL_NOEXCEPT {} 63 | inline void operator delete[](void*, void*) ETL_NOEXCEPT{} 64 | 65 | #endif 66 | 67 | #endif 68 | -------------------------------------------------------------------------------- /src/etl/private/addressof.h: -------------------------------------------------------------------------------- 1 | ///\file 2 | 3 | /****************************************************************************** 4 | The MIT License(MIT) 5 | 6 | Embedded Template Library. 7 | https://github.com/ETLCPP/etl 8 | https://www.etlcpp.com 9 | 10 | Copyright(c) 2022 John Wellbelove 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining a copy 13 | of this software and associated documentation files(the "Software"), to deal 14 | in the Software without restriction, including without limitation the rights 15 | to use, copy, modify, merge, publish, distribute, sublicense, and / or sell 16 | copies of the Software, and to permit persons to whom the Software is 17 | furnished to do so, subject to the following conditions : 18 | 19 | The above copyright notice and this permission notice shall be included in all 20 | copies or substantial portions of the Software. 21 | 22 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 25 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 26 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 27 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 28 | SOFTWARE. 29 | ******************************************************************************/ 30 | 31 | #ifndef ETL_ADDRESSOF_INCLUDED 32 | #define ETL_ADDRESSOF_INCLUDED 33 | 34 | #include "../platform.h" 35 | #include "../type_traits.h" 36 | 37 | #if defined(ETL_IN_UNIT_TEST) || ETL_USING_STL 38 | #include 39 | #endif 40 | 41 | ///\defgroup memory memory 42 | ///\ingroup etl 43 | 44 | namespace etl 45 | { 46 | //***************************************************************************** 47 | /// Gets the address of an object. 48 | /// https://en.cppreference.com/w/cpp/memory/addressof 49 | ///\ingroup memory 50 | //***************************************************************************** 51 | template 52 | ETL_CONSTEXPR17 typename etl::enable_if::value, T>::type* addressof(T& t) 53 | { 54 | #if ETL_USING_STL && ETL_USING_CPP11 55 | return std::addressof(t); 56 | #else 57 | return reinterpret_cast(&const_cast(reinterpret_cast(t))); 58 | #endif 59 | } 60 | } 61 | 62 | #endif 63 | -------------------------------------------------------------------------------- /src/etl/private/comparator_is_transparent.h: -------------------------------------------------------------------------------- 1 | ///\file 2 | 3 | /****************************************************************************** 4 | The MIT License(MIT) 5 | 6 | Embedded Template Library. 7 | https://github.com/ETLCPP/etl 8 | https://www.etlcpp.com 9 | 10 | Copyright(c) 2021 John Wellbelove 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining a copy 13 | of this software and associated documentation files(the "Software"), to deal 14 | in the Software without restriction, including without limitation the rights 15 | to use, copy, modify, merge, publish, distribute, sublicense, and / or sell 16 | copies of the Software, and to permit persons to whom the Software is 17 | furnished to do so, subject to the following conditions : 18 | 19 | The above copyright notice and this permission notice shall be included in all 20 | copies or substantial portions of the Software. 21 | 22 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 25 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 26 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 27 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 28 | SOFTWARE. 29 | ******************************************************************************/ 30 | 31 | #ifndef ETL_COMPARATOR_IS_TRANSPARENT 32 | #define ETL_COMPARATOR_IS_TRANSPARENT 33 | 34 | #include "../type_traits.h" 35 | 36 | namespace etl 37 | { 38 | #if ETL_USING_CPP11 39 | template 40 | struct comparator_is_transparent : etl::false_type 41 | { 42 | }; 43 | 44 | template 45 | struct comparator_is_transparent> : etl::true_type 46 | { 47 | }; 48 | #endif 49 | } 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /src/etl/private/diagnostic_array_bounds_push.h: -------------------------------------------------------------------------------- 1 | ///\file 2 | 3 | /****************************************************************************** 4 | The MIT License(MIT) 5 | 6 | Embedded Template Library. 7 | https://github.com/ETLCPP/etl 8 | https://www.etlcpp.com 9 | 10 | Copyright(c) 2023 John Wellbelove 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining a copy 13 | of this software and associated documentation files(the "Software"), to deal 14 | in the Software without restriction, including without limitation the rights 15 | to use, copy, modify, merge, publish, distribute, sublicense, and / or sell 16 | copies of the Software, and to permit persons to whom the Software is 17 | furnished to do so, subject to the following conditions : 18 | 19 | The above copyright notice and this permission notice shall be included in all 20 | copies or substantial portions of the Software. 21 | 22 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 25 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 26 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 27 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 28 | SOFTWARE. 29 | ******************************************************************************/ 30 | 31 | /* 32 | * The header include guard has been intentionally omitted. 33 | * This file is intended to evaluated multiple times by design. 34 | */ 35 | 36 | #if defined(__GNUC__) && !defined(__clang__) && !defined(__llvm__) 37 | #pragma GCC diagnostic push 38 | #pragma GCC diagnostic ignored "-Warray-bounds" 39 | #endif 40 | 41 | #if defined(__clang__) || defined(__llvm__) 42 | #pragma clang diagnostic push 43 | #pragma clang diagnostic ignored "-Warray-bounds" 44 | #endif 45 | -------------------------------------------------------------------------------- /src/etl/private/diagnostic_cxx_20_compat_push.h: -------------------------------------------------------------------------------- 1 | ///\file 2 | 3 | /****************************************************************************** 4 | The MIT License(MIT) 5 | 6 | Embedded Template Library. 7 | https://github.com/ETLCPP/etl 8 | https://www.etlcpp.com 9 | 10 | Copyright(c) 2023 John Wellbelove 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining a copy 13 | of this software and associated documentation files(the "Software"), to deal 14 | in the Software without restriction, including without limitation the rights 15 | to use, copy, modify, merge, publish, distribute, sublicense, and / or sell 16 | copies of the Software, and to permit persons to whom the Software is 17 | furnished to do so, subject to the following conditions : 18 | 19 | The above copyright notice and this permission notice shall be included in all 20 | copies or substantial portions of the Software. 21 | 22 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 25 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 26 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 27 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 28 | SOFTWARE. 29 | ******************************************************************************/ 30 | 31 | /* 32 | * The header include guard has been intentionally omitted. 33 | * This file is intended to evaluated multiple times by design. 34 | */ 35 | 36 | #if defined(__GNUC__) && (__GNUC__ >= 10) && !defined(__clang__) && !defined(__llvm__) 37 | #pragma GCC diagnostic push 38 | #pragma GCC diagnostic ignored "-Wc++20-compat" 39 | #endif 40 | 41 | #if defined(__clang__) || defined(__llvm__) 42 | #pragma clang diagnostic push 43 | #pragma clang diagnostic ignored "-Wc++20-compat" 44 | #endif 45 | -------------------------------------------------------------------------------- /src/etl/private/diagnostic_deprecated_push.h: -------------------------------------------------------------------------------- 1 | ///\file 2 | 3 | /****************************************************************************** 4 | The MIT License(MIT) 5 | 6 | Embedded Template Library. 7 | https://github.com/ETLCPP/etl 8 | https://www.etlcpp.com 9 | 10 | Copyright(c) 2023 John Wellbelove 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining a copy 13 | of this software and associated documentation files(the "Software"), to deal 14 | in the Software without restriction, including without limitation the rights 15 | to use, copy, modify, merge, publish, distribute, sublicense, and / or sell 16 | copies of the Software, and to permit persons to whom the Software is 17 | furnished to do so, subject to the following conditions : 18 | 19 | The above copyright notice and this permission notice shall be included in all 20 | copies or substantial portions of the Software. 21 | 22 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 25 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 26 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 27 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 28 | SOFTWARE. 29 | ******************************************************************************/ 30 | 31 | /* 32 | * The header include guard has been intentionally omitted. 33 | * This file is intended to evaluated multiple times by design. 34 | */ 35 | 36 | #if defined(__GNUC__) && !defined(__clang__) && !defined(__llvm__) 37 | #pragma GCC diagnostic push 38 | #pragma GCC diagnostic ignored "-Wdeprecated" 39 | #endif 40 | 41 | #if defined(__clang__) || defined(__llvm__) 42 | #pragma clang diagnostic push 43 | #pragma clang diagnostic ignored "-Wdeprecated" 44 | #endif 45 | -------------------------------------------------------------------------------- /src/etl/private/diagnostic_float_equal_push.h: -------------------------------------------------------------------------------- 1 | ///\file 2 | 3 | /****************************************************************************** 4 | The MIT License(MIT) 5 | 6 | Embedded Template Library. 7 | https://github.com/ETLCPP/etl 8 | https://www.etlcpp.com 9 | 10 | Copyright(c) 2022 John Wellbelove 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining a copy 13 | of this software and associated documentation files(the "Software"), to deal 14 | in the Software without restriction, including without limitation the rights 15 | to use, copy, modify, merge, publish, distribute, sublicense, and / or sell 16 | copies of the Software, and to permit persons to whom the Software is 17 | furnished to do so, subject to the following conditions : 18 | 19 | The above copyright notice and this permission notice shall be included in all 20 | copies or substantial portions of the Software. 21 | 22 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 25 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 26 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 27 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 28 | SOFTWARE. 29 | ******************************************************************************/ 30 | 31 | /* 32 | * The header include guard has been intentionally omitted. 33 | * This file is intended to evaluated multiple times by design. 34 | */ 35 | 36 | #if defined(__GNUC__) && !defined(__clang__) && !defined(__llvm__) 37 | #pragma GCC diagnostic push 38 | #pragma GCC diagnostic ignored "-Wfloat-equal" 39 | #endif 40 | 41 | #if defined(__clang__) || defined(__llvm__) 42 | #pragma clang diagnostic push 43 | #pragma clang diagnostic ignored "-Wfloat-equal" 44 | #endif 45 | -------------------------------------------------------------------------------- /src/etl/private/diagnostic_null_dereference_push.h: -------------------------------------------------------------------------------- 1 | ///\file 2 | 3 | /****************************************************************************** 4 | The MIT License(MIT) 5 | 6 | Embedded Template Library. 7 | https://github.com/ETLCPP/etl 8 | https://www.etlcpp.com 9 | 10 | Copyright(c) 2024 John Wellbelove 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining a copy 13 | of this software and associated documentation files(the "Software"), to deal 14 | in the Software without restriction, including without limitation the rights 15 | to use, copy, modify, merge, publish, distribute, sublicense, and / or sell 16 | copies of the Software, and to permit persons to whom the Software is 17 | furnished to do so, subject to the following conditions : 18 | 19 | The above copyright notice and this permission notice shall be included in all 20 | copies or substantial portions of the Software. 21 | 22 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 25 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 26 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 27 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 28 | SOFTWARE. 29 | ******************************************************************************/ 30 | 31 | /* 32 | * The header include guard has been intentionally omitted. 33 | * This file is intended to evaluated multiple times by design. 34 | */ 35 | 36 | #if defined(__GNUC__) && !defined(__clang__) && !defined(__llvm__) 37 | #pragma GCC diagnostic push 38 | #pragma GCC diagnostic ignored "-Wnull-dereference" 39 | #endif 40 | 41 | #if defined(__clang__) || defined(__llvm__) 42 | #pragma clang diagnostic push 43 | #pragma clang diagnostic ignored "-Wnull-dereference" 44 | #endif 45 | -------------------------------------------------------------------------------- /src/etl/private/diagnostic_pessimizing-move_push.h: -------------------------------------------------------------------------------- 1 | ///\file 2 | 3 | /****************************************************************************** 4 | The MIT License(MIT) 5 | 6 | Embedded Template Library. 7 | https://github.com/ETLCPP/etl 8 | https://www.etlcpp.com 9 | 10 | Copyright(c) 2022 John Wellbelove 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining a copy 13 | of this software and associated documentation files(the "Software"), to deal 14 | in the Software without restriction, including without limitation the rights 15 | to use, copy, modify, merge, publish, distribute, sublicense, and / or sell 16 | copies of the Software, and to permit persons to whom the Software is 17 | furnished to do so, subject to the following conditions : 18 | 19 | The above copyright notice and this permission notice shall be included in all 20 | copies or substantial portions of the Software. 21 | 22 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 25 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 26 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 27 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 28 | SOFTWARE. 29 | ******************************************************************************/ 30 | 31 | /* 32 | * The header include guard has been intentionally omitted. 33 | * This file is intended to evaluated multiple times by design. 34 | */ 35 | 36 | #if defined(__clang__) || defined(__llvm__) 37 | #pragma clang diagnostic push 38 | #pragma clang diagnostic ignored "-Wpessimizing-move" 39 | #endif 40 | -------------------------------------------------------------------------------- /src/etl/private/diagnostic_pessimizing_move_push.h: -------------------------------------------------------------------------------- 1 | ///\file 2 | 3 | /****************************************************************************** 4 | The MIT License(MIT) 5 | 6 | Embedded Template Library. 7 | https://github.com/ETLCPP/etl 8 | https://www.etlcpp.com 9 | 10 | Copyright(c) 2022 John Wellbelove 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining a copy 13 | of this software and associated documentation files(the "Software"), to deal 14 | in the Software without restriction, including without limitation the rights 15 | to use, copy, modify, merge, publish, distribute, sublicense, and / or sell 16 | copies of the Software, and to permit persons to whom the Software is 17 | furnished to do so, subject to the following conditions : 18 | 19 | The above copyright notice and this permission notice shall be included in all 20 | copies or substantial portions of the Software. 21 | 22 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 25 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 26 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 27 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 28 | SOFTWARE. 29 | ******************************************************************************/ 30 | 31 | /* 32 | * The header include guard has been intentionally omitted. 33 | * This file is intended to evaluated multiple times by design. 34 | */ 35 | 36 | #if defined(__GNUC__) && !defined(__clang__) && !defined(__llvm__) 37 | #pragma GCC diagnostic push 38 | #pragma GCC diagnostic ignored "-Wpessimizing-move" 39 | #endif 40 | 41 | #if defined(__clang__) || defined(__llvm__) 42 | #pragma clang diagnostic push 43 | #pragma clang diagnostic ignored "-Wpessimizing-move" 44 | #endif 45 | -------------------------------------------------------------------------------- /src/etl/private/diagnostic_pop.h: -------------------------------------------------------------------------------- 1 | ///\file 2 | 3 | /****************************************************************************** 4 | The MIT License(MIT) 5 | 6 | Embedded Template Library. 7 | https://github.com/ETLCPP/etl 8 | https://www.etlcpp.com 9 | 10 | Copyright(c) 2022 John Wellbelove 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining a copy 13 | of this software and associated documentation files(the "Software"), to deal 14 | in the Software without restriction, including without limitation the rights 15 | to use, copy, modify, merge, publish, distribute, sublicense, and / or sell 16 | copies of the Software, and to permit persons to whom the Software is 17 | furnished to do so, subject to the following conditions : 18 | 19 | The above copyright notice and this permission notice shall be included in all 20 | copies or substantial portions of the Software. 21 | 22 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 25 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 26 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 27 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 28 | SOFTWARE. 29 | ******************************************************************************/ 30 | 31 | /* 32 | * The header include guard has been intentionally omitted. 33 | * This file is intended to evaluated multiple times by design. 34 | */ 35 | 36 | #if defined(__GNUC__) && !defined(__clang__) && !defined(__llvm__) 37 | #pragma GCC diagnostic pop 38 | #endif 39 | 40 | #if defined(__clang__) || defined(__llvm__) 41 | #pragma clang diagnostic pop 42 | #endif 43 | -------------------------------------------------------------------------------- /src/etl/private/diagnostic_self_assign_overloaded_push.h: -------------------------------------------------------------------------------- 1 | ///\file 2 | 3 | /****************************************************************************** 4 | The MIT License(MIT) 5 | 6 | Embedded Template Library. 7 | https://github.com/ETLCPP/etl 8 | https://www.etlcpp.com 9 | 10 | Copyright(c) 2022 John Wellbelove 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining a copy 13 | of this software and associated documentation files(the "Software"), to deal 14 | in the Software without restriction, including without limitation the rights 15 | to use, copy, modify, merge, publish, distribute, sublicense, and / or sell 16 | copies of the Software, and to permit persons to whom the Software is 17 | furnished to do so, subject to the following conditions : 18 | 19 | The above copyright notice and this permission notice shall be included in all 20 | copies or substantial portions of the Software. 21 | 22 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 25 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 26 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 27 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 28 | SOFTWARE. 29 | ******************************************************************************/ 30 | 31 | /* 32 | * The header include guard has been intentionally omitted. 33 | * This file is intended to evaluated multiple times by design. 34 | */ 35 | 36 | #if defined(__GNUC__) && !defined(__clang__) && !defined(__llvm__) 37 | #pragma GCC diagnostic push 38 | #endif 39 | 40 | #if defined(__clang__) || defined(__llvm__) 41 | #pragma clang diagnostic push 42 | #pragma clang diagnostic ignored "-Wself-assign-overloaded" 43 | #endif 44 | -------------------------------------------------------------------------------- /src/etl/private/diagnostic_stringop_overread_push.h: -------------------------------------------------------------------------------- 1 | ///\file 2 | 3 | /****************************************************************************** 4 | The MIT License(MIT) 5 | 6 | Embedded Template Library. 7 | https://github.com/ETLCPP/etl 8 | https://www.etlcpp.com 9 | 10 | Copyright(c) 2023 John Wellbelove 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining a copy 13 | of this software and associated documentation files(the "Software"), to deal 14 | in the Software without restriction, including without limitation the rights 15 | to use, copy, modify, merge, publish, distribute, sublicense, and / or sell 16 | copies of the Software, and to permit persons to whom the Software is 17 | furnished to do so, subject to the following conditions : 18 | 19 | The above copyright notice and this permission notice shall be included in all 20 | copies or substantial portions of the Software. 21 | 22 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 25 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 26 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 27 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 28 | SOFTWARE. 29 | ******************************************************************************/ 30 | 31 | /* 32 | * The header include guard has been intentionally omitted. 33 | * This file is intended to evaluated multiple times by design. 34 | */ 35 | 36 | #if defined(__GNUC__) && (__GNUC__ >= 11) && !defined(__clang__) && !defined(__llvm__) 37 | #pragma GCC diagnostic push 38 | #pragma GCC diagnostic ignored "-Wstringop-overread" 39 | #endif 40 | 41 | #if defined(__clang__) || defined(__llvm__) 42 | #pragma clang diagnostic push 43 | #endif 44 | -------------------------------------------------------------------------------- /src/etl/private/diagnostic_uninitialized_push.h: -------------------------------------------------------------------------------- 1 | ///\file 2 | 3 | /****************************************************************************** 4 | The MIT License(MIT) 5 | 6 | Embedded Template Library. 7 | https://github.com/ETLCPP/etl 8 | https://www.etlcpp.com 9 | 10 | Copyright(c) 2022 John Wellbelove 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining a copy 13 | of this software and associated documentation files(the "Software"), to deal 14 | in the Software without restriction, including without limitation the rights 15 | to use, copy, modify, merge, publish, distribute, sublicense, and / or sell 16 | copies of the Software, and to permit persons to whom the Software is 17 | furnished to do so, subject to the following conditions : 18 | 19 | The above copyright notice and this permission notice shall be included in all 20 | copies or substantial portions of the Software. 21 | 22 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 25 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 26 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 27 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 28 | SOFTWARE. 29 | ******************************************************************************/ 30 | 31 | /* 32 | * The header include guard has been intentionally omitted. 33 | * This file is intended to evaluated multiple times by design. 34 | */ 35 | 36 | #if defined(__GNUC__) && !defined(__clang__) && !defined(__llvm__) 37 | #pragma GCC diagnostic push 38 | #pragma GCC diagnostic ignored "-Wuninitialized" 39 | #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" 40 | #endif 41 | 42 | #if defined(__clang__) || defined(__llvm__) 43 | #pragma clang diagnostic push 44 | #pragma clang diagnostic ignored "-Wuninitialized" 45 | #endif 46 | -------------------------------------------------------------------------------- /src/etl/private/diagnostic_unused_function_push.h: -------------------------------------------------------------------------------- 1 | ///\file 2 | 3 | /****************************************************************************** 4 | The MIT License(MIT) 5 | 6 | Embedded Template Library. 7 | https://github.com/ETLCPP/etl 8 | https://www.etlcpp.com 9 | 10 | Copyright(c) 2022 John Wellbelove 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining a copy 13 | of this software and associated documentation files(the "Software"), to deal 14 | in the Software without restriction, including without limitation the rights 15 | to use, copy, modify, merge, publish, distribute, sublicense, and / or sell 16 | copies of the Software, and to permit persons to whom the Software is 17 | furnished to do so, subject to the following conditions : 18 | 19 | The above copyright notice and this permission notice shall be included in all 20 | copies or substantial portions of the Software. 21 | 22 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 25 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 26 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 27 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 28 | SOFTWARE. 29 | ******************************************************************************/ 30 | 31 | /* 32 | * The header include guard has been intentionally omitted. 33 | * This file is intended to evaluated multiple times by design. 34 | */ 35 | 36 | #if defined(__GNUC__) && !defined(__clang__) && !defined(__llvm__) 37 | #pragma GCC diagnostic push 38 | #pragma GCC diagnostic ignored "-Wunused-function" 39 | #endif 40 | 41 | #if defined(__clang__) || defined(__llvm__) 42 | #pragma clang diagnostic push 43 | #pragma clang diagnostic ignored "-Wunused-function" 44 | #endif 45 | -------------------------------------------------------------------------------- /src/etl/private/diagnostic_useless_cast_push.h: -------------------------------------------------------------------------------- 1 | ///\file 2 | 3 | /****************************************************************************** 4 | The MIT License(MIT) 5 | 6 | Embedded Template Library. 7 | https://github.com/ETLCPP/etl 8 | https://www.etlcpp.com 9 | 10 | Copyright(c) 2023 John Wellbelove 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining a copy 13 | of this software and associated documentation files(the "Software"), to deal 14 | in the Software without restriction, including without limitation the rights 15 | to use, copy, modify, merge, publish, distribute, sublicense, and / or sell 16 | copies of the Software, and to permit persons to whom the Software is 17 | furnished to do so, subject to the following conditions : 18 | 19 | The above copyright notice and this permission notice shall be included in all 20 | copies or substantial portions of the Software. 21 | 22 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 25 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 26 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 27 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 28 | SOFTWARE. 29 | ******************************************************************************/ 30 | 31 | /* 32 | * The header include guard has been intentionally omitted. 33 | * This file is intended to evaluated multiple times by design. 34 | */ 35 | 36 | #if defined(__GNUC__) && !defined(__clang__) && !defined(__llvm__) 37 | #pragma GCC diagnostic push 38 | #pragma GCC diagnostic ignored "-Wuseless-cast" 39 | #endif 40 | 41 | #if defined(__clang__) || defined(__llvm__) 42 | #pragma clang diagnostic push 43 | #endif 44 | -------------------------------------------------------------------------------- /src/etl/private/dynamic_extent.h: -------------------------------------------------------------------------------- 1 | ///\file 2 | 3 | /****************************************************************************** 4 | The MIT License(MIT) 5 | 6 | Embedded Template Library. 7 | https://github.com/ETLCPP/etl 8 | https://www.etlcpp.com 9 | 10 | Copyright(c) 2022 John Wellbelove 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining a copy 13 | of this software and associated documentation files(the "Software"), to deal 14 | in the Software without restriction, including without limitation the rights 15 | to use, copy, modify, merge, publish, distribute, sublicense, and / or sell 16 | copies of the Software, and to permit persons to whom the Software is 17 | furnished to do so, subject to the following conditions : 18 | 19 | The above copyright notice and this permission notice shall be included in all 20 | copies or substantial portions of the Software. 21 | 22 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 25 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 26 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 27 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 28 | SOFTWARE. 29 | ******************************************************************************/ 30 | 31 | #ifndef ETL_DYNAMIC_EXTENT_INCLUDED 32 | #define ETL_DYNAMIC_EXTENT_INCLUDED 33 | 34 | #include "../platform.h" 35 | #include "../integral_limits.h" 36 | 37 | namespace etl 38 | { 39 | static ETL_CONSTANT size_t dynamic_extent = etl::integral_limits::max; 40 | } 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /src/etl/private/minmax_pop.h: -------------------------------------------------------------------------------- 1 | ///\file 2 | 3 | /****************************************************************************** 4 | The MIT License(MIT) 5 | 6 | Embedded Template Library. 7 | https://github.com/ETLCPP/etl 8 | https://www.etlcpp.com 9 | 10 | Copyright(c) 2018 John Wellbelove 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining a copy 13 | of this software and associated documentation files(the "Software"), to deal 14 | in the Software without restriction, including without limitation the rights 15 | to use, copy, modify, merge, publish, distribute, sublicense, and / or sell 16 | copies of the Software, and to permit persons to whom the Software is 17 | furnished to do so, subject to the following conditions : 18 | 19 | The above copyright notice and this permission notice shall be included in all 20 | copies or substantial portions of the Software. 21 | 22 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 25 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 26 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 27 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 28 | SOFTWARE. 29 | ******************************************************************************/ 30 | 31 | // The header include guard has been intentionally omitted. 32 | // This file is intended to evaluated multiple times by design. 33 | #ifdef ETL_PUSHED_MIN_MAX 34 | #if !defined(ETL_COMPILER_GREEN_HILLS) && !defined(ETL_COMPILER_IAR) && !defined(ETL_COMPILER_TASKING) 35 | #if !defined(ETL_COMPILER_ARM5) 36 | #pragma pop_macro("min") 37 | #pragma pop_macro("max") 38 | #else 39 | #ifdef ETL_RESTORE_MIN 40 | #define min(a,b) ((a)<(b)?(a):(b)) 41 | #undef ETL_RESTORE_MIN 42 | #endif 43 | 44 | #ifdef ETL_RESTORE_MAX 45 | #define max(a,b) ((a)<(b)?(b):(a)) 46 | #undef ETL_RESTORE_MAX 47 | #endif 48 | #endif 49 | #endif 50 | 51 | #undef ETL_PUSHED_MIN_MAX 52 | 53 | #else 54 | #error minmax_pop without matching push 55 | #endif 56 | -------------------------------------------------------------------------------- /src/etl/private/minmax_push.h: -------------------------------------------------------------------------------- 1 | ///\file 2 | 3 | /****************************************************************************** 4 | The MIT License(MIT) 5 | 6 | Embedded Template Library. 7 | https://github.com/ETLCPP/etl 8 | https://www.etlcpp.com 9 | 10 | Copyright(c) 2018 John Wellbelove 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining a copy 13 | of this software and associated documentation files(the "Software"), to deal 14 | in the Software without restriction, including without limitation the rights 15 | to use, copy, modify, merge, publish, distribute, sublicense, and / or sell 16 | copies of the Software, and to permit persons to whom the Software is 17 | furnished to do so, subject to the following conditions : 18 | 19 | The above copyright notice and this permission notice shall be included in all 20 | copies or substantial portions of the Software. 21 | 22 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 25 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 26 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 27 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 28 | SOFTWARE. 29 | ******************************************************************************/ 30 | 31 | // The header include guard has been intentionally omitted. 32 | // This file is intended to evaluated multiple times by design. 33 | #ifndef ETL_PUSHED_MIN_MAX 34 | #if !defined(ETL_COMPILER_GREEN_HILLS) && !defined(ETL_COMPILER_IAR) && !defined(ETL_COMPILER_TASKING) 35 | #if !defined(ETL_COMPILER_ARM5) 36 | #pragma push_macro("min") 37 | #pragma push_macro("max") 38 | #endif 39 | 40 | #ifdef min 41 | #ifndef ETL_RESTORE_MIN 42 | #define ETL_RESTORE_MIN 43 | #endif 44 | #undef min 45 | #endif 46 | 47 | #ifdef max 48 | #ifndef ETL_RESTORE_MAX 49 | #define ETL_RESTORE_MAX 50 | #endif 51 | #undef max 52 | #endif 53 | #endif 54 | 55 | #define ETL_PUSHED_MIN_MAX 56 | 57 | #else 58 | #error minmax_push without matching pop 59 | #endif 60 | -------------------------------------------------------------------------------- /src/etl/profiles/arduino_arm.h: -------------------------------------------------------------------------------- 1 | ///\file 2 | 3 | /****************************************************************************** 4 | The MIT License(MIT) 5 | 6 | Embedded Template Library. 7 | https://github.com/ETLCPP/etl 8 | https://www.etlcpp.com 9 | 10 | Copyright(c) 2017 John Wellbelove 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining a copy 13 | of this software and associated documentation files(the "Software"), to deal 14 | in the Software without restriction, including without limitation the rights 15 | to use, copy, modify, merge, publish, distribute, sublicense, and / or sell 16 | copies of the Software, and to permit persons to whom the Software is 17 | furnished to do so, subject to the following conditions : 18 | 19 | The above copyright notice and this permission notice shall be included in all 20 | copies or substantial portions of the Software. 21 | 22 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 25 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 26 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 27 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 28 | SOFTWARE. 29 | ******************************************************************************/ 30 | 31 | #ifndef ETL_ARDUINO_INCLUDED 32 | #define ETL_ARDUINO_INCLUDED 33 | 34 | //***************************************************************************** 35 | // Arduino 36 | //***************************************************************************** 37 | 38 | #define ETL_TARGET_DEVICE_ARM 39 | #define ETL_TARGET_OS_NONE 40 | #define ETL_COMPILER_GCC 41 | #define ETL_CPP11_SUPPORTED 0 42 | #define ETL_CPP14_SUPPORTED 0 43 | #define ETL_CPP17_SUPPORTED 0 44 | #define ETL_NO_NULLPTR_SUPPORT 1 45 | #define ETL_NO_LARGE_CHAR_SUPPORT 1 46 | #define ETL_CPP11_TYPE_TRAITS_IS_TRIVIAL_SUPPORTED 0 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /src/etl/profiles/armv5.h: -------------------------------------------------------------------------------- 1 | ///\file 2 | 3 | /****************************************************************************** 4 | The MIT License(MIT) 5 | 6 | Embedded Template Library. 7 | https://github.com/ETLCPP/etl 8 | https://www.etlcpp.com 9 | 10 | Copyright(c) 2017 John Wellbelove 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining a copy 13 | of this software and associated documentation files(the "Software"), to deal 14 | in the Software without restriction, including without limitation the rights 15 | to use, copy, modify, merge, publish, distribute, sublicense, and / or sell 16 | copies of the Software, and to permit persons to whom the Software is 17 | furnished to do so, subject to the following conditions : 18 | 19 | The above copyright notice and this permission notice shall be included in all 20 | copies or substantial portions of the Software. 21 | 22 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 25 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 26 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 27 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 28 | SOFTWARE. 29 | ******************************************************************************/ 30 | 31 | #ifndef ETL_ARMV5_INCLUDED 32 | #define ETL_ARMV5_INCLUDED 33 | 34 | //***************************************************************************** 35 | // ARM Compiler Version 5 36 | //***************************************************************************** 37 | 38 | #define ETL_TARGET_DEVICE_ARM 39 | #define ETL_TARGET_OS_NONE 40 | #define ETL_COMPILER_ARM5 41 | #define ETL_CPP11_SUPPORTED 0 42 | #define ETL_CPP14_SUPPORTED 0 43 | #define ETL_CPP17_SUPPORTED 0 44 | #define ETL_NO_NULLPTR_SUPPORT (__cplusplus < 201103L) 45 | #define ETL_NO_LARGE_CHAR_SUPPORT (__cplusplus < 201103L) 46 | #define ETL_CPP11_TYPE_TRAITS_IS_TRIVIAL_SUPPORTED 0 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /src/etl/profiles/armv5_no_stl.h: -------------------------------------------------------------------------------- 1 | ///\file 2 | 3 | /****************************************************************************** 4 | The MIT License(MIT) 5 | 6 | Embedded Template Library. 7 | https://github.com/ETLCPP/etl 8 | https://www.etlcpp.com 9 | 10 | Copyright(c) 2018 John Wellbelove 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining a copy 13 | of this software and associated documentation files(the "Software"), to deal 14 | in the Software without restriction, including without limitation the rights 15 | to use, copy, modify, merge, publish, distribute, sublicense, and / or sell 16 | copies of the Software, and to permit persons to whom the Software is 17 | furnished to do so, subject to the following conditions : 18 | 19 | The above copyright notice and this permission notice shall be included in all 20 | copies or substantial portions of the Software. 21 | 22 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 25 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 26 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 27 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 28 | SOFTWARE. 29 | ******************************************************************************/ 30 | 31 | #ifndef ETL_ARMV5_NO_STL_INCLUDED 32 | #define ETL_ARMV5_NO_STL_INCLUDED 33 | 34 | //***************************************************************************** 35 | // ARM Compiler Version 5 36 | //***************************************************************************** 37 | 38 | #define ETL_TARGET_DEVICE_ARM 39 | #define ETL_TARGET_OS_NONE 40 | #define ETL_COMPILER_ARM5 41 | #define ETL_CPP11_SUPPORTED 0 42 | #define ETL_CPP14_SUPPORTED 0 43 | #define ETL_CPP17_SUPPORTED 0 44 | #define ETL_NO_NULLPTR_SUPPORT (__cplusplus < 201103L) 45 | #define ETL_NO_LARGE_CHAR_SUPPORT (__cplusplus < 201103L) 46 | #define ETL_CPP11_TYPE_TRAITS_IS_TRIVIAL_SUPPORTED 0 47 | #define ETL_NO_STL 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /src/etl/profiles/armv6.h: -------------------------------------------------------------------------------- 1 | ///\file 2 | 3 | /****************************************************************************** 4 | The MIT License(MIT) 5 | 6 | Embedded Template Library. 7 | https://github.com/ETLCPP/etl 8 | https://www.etlcpp.com 9 | 10 | Copyright(c) 2017 John Wellbelove 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining a copy 13 | of this software and associated documentation files(the "Software"), to deal 14 | in the Software without restriction, including without limitation the rights 15 | to use, copy, modify, merge, publish, distribute, sublicense, and / or sell 16 | copies of the Software, and to permit persons to whom the Software is 17 | furnished to do so, subject to the following conditions : 18 | 19 | The above copyright notice and this permission notice shall be included in all 20 | copies or substantial portions of the Software. 21 | 22 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 25 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 26 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 27 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 28 | SOFTWARE. 29 | ******************************************************************************/ 30 | 31 | #ifndef ETL_ARMV6_INCLUDED 32 | #define ETL_ARMV6_INCLUDED 33 | 34 | //***************************************************************************** 35 | // ARM Compiler Version 6 36 | //***************************************************************************** 37 | 38 | #define ETL_TARGET_DEVICE_ARM 39 | #define ETL_TARGET_OS_NONE 40 | #define ETL_COMPILER_CLANG 41 | #define ETL_CPP11_SUPPORTED 1 42 | #define ETL_CPP14_SUPPORTED 0 43 | #define ETL_CPP17_SUPPORTED 0 44 | #define ETL_NO_NULLPTR_SUPPORT 0 45 | #define ETL_NO_LARGE_CHAR_SUPPORT 0 46 | #define ETL_CPP11_TYPE_TRAITS_IS_TRIVIAL_SUPPORTED 1 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /src/etl/profiles/armv6_no_stl.h: -------------------------------------------------------------------------------- 1 | ///\file 2 | 3 | /****************************************************************************** 4 | The MIT License(MIT) 5 | 6 | Embedded Template Library. 7 | https://github.com/ETLCPP/etl 8 | https://www.etlcpp.com 9 | 10 | Copyright(c) 2018 John Wellbelove 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining a copy 13 | of this software and associated documentation files(the "Software"), to deal 14 | in the Software without restriction, including without limitation the rights 15 | to use, copy, modify, merge, publish, distribute, sublicense, and / or sell 16 | copies of the Software, and to permit persons to whom the Software is 17 | furnished to do so, subject to the following conditions : 18 | 19 | The above copyright notice and this permission notice shall be included in all 20 | copies or substantial portions of the Software. 21 | 22 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 25 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 26 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 27 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 28 | SOFTWARE. 29 | ******************************************************************************/ 30 | 31 | #ifndef ETL_ARMV6_NO_STL_INCLUDED 32 | #define ETL_ARMV6_NO_STL_INCLUDED 33 | 34 | //***************************************************************************** 35 | // ARM Compiler Version 6 36 | //***************************************************************************** 37 | 38 | #define ETL_TARGET_DEVICE_ARM 39 | #define ETL_TARGET_OS_NONE 40 | #define ETL_COMPILER_ARM6 41 | #define ETL_CPP11_SUPPORTED 1 42 | #define ETL_CPP14_SUPPORTED 0 43 | #define ETL_CPP17_SUPPORTED 0 44 | #define ETL_NO_NULLPTR_SUPPORT 0 45 | #define ETL_NO_LARGE_CHAR_SUPPORT 0 46 | #define ETL_CPP11_TYPE_TRAITS_IS_TRIVIAL_SUPPORTED 1 47 | #define ETL_NO_STL 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /src/etl/profiles/armv7.h: -------------------------------------------------------------------------------- 1 | ///\file 2 | 3 | /****************************************************************************** 4 | The MIT License(MIT) 5 | 6 | Embedded Template Library. 7 | https://github.com/ETLCPP/etl 8 | https://www.etlcpp.com 9 | 10 | Copyright(c) 2018 John Wellbelove 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining a copy 13 | of this software and associated documentation files(the "Software"), to deal 14 | in the Software without restriction, including without limitation the rights 15 | to use, copy, modify, merge, publish, distribute, sublicense, and / or sell 16 | copies of the Software, and to permit persons to whom the Software is 17 | furnished to do so, subject to the following conditions : 18 | 19 | The above copyright notice and this permission notice shall be included in all 20 | copies or substantial portions of the Software. 21 | 22 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 25 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 26 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 27 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 28 | SOFTWARE. 29 | ******************************************************************************/ 30 | 31 | #ifndef ETL_ARMV7_INCLUDED 32 | #define ETL_ARMV7_INCLUDED 33 | 34 | //***************************************************************************** 35 | // ARM Compiler Version 7 36 | //***************************************************************************** 37 | 38 | #define ETL_TARGET_DEVICE_ARM 39 | #define ETL_TARGET_OS_NONE 40 | #define ETL_COMPILER_CLANG 41 | #define ETL_CPP11_SUPPORTED 1 42 | #define ETL_CPP14_SUPPORTED 1 43 | #define ETL_CPP17_SUPPORTED 0 44 | #define ETL_NO_NULLPTR_SUPPORT 0 45 | #define ETL_NO_LARGE_CHAR_SUPPORT 0 46 | #define ETL_CPP11_TYPE_TRAITS_IS_TRIVIAL_SUPPORTED 1 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /src/etl/profiles/armv7_no_stl.h: -------------------------------------------------------------------------------- 1 | ///\file 2 | 3 | /****************************************************************************** 4 | The MIT License(MIT) 5 | 6 | Embedded Template Library. 7 | https://github.com/ETLCPP/etl 8 | https://www.etlcpp.com 9 | 10 | Copyright(c) 2019 John Wellbelove 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining a copy 13 | of this software and associated documentation files(the "Software"), to deal 14 | in the Software without restriction, including without limitation the rights 15 | to use, copy, modify, merge, publish, distribute, sublicense, and / or sell 16 | copies of the Software, and to permit persons to whom the Software is 17 | furnished to do so, subject to the following conditions : 18 | 19 | The above copyright notice and this permission notice shall be included in all 20 | copies or substantial portions of the Software. 21 | 22 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 25 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 26 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 27 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 28 | SOFTWARE. 29 | ******************************************************************************/ 30 | 31 | #ifndef ETL_ARMV7_NO_STL_INCLUDED 32 | #define ETL_ARMV7_NO_STL_INCLUDED 33 | 34 | //***************************************************************************** 35 | // ARM Compiler Version 7 36 | //***************************************************************************** 37 | 38 | #define ETL_TARGET_DEVICE_ARM 39 | #define ETL_TARGET_OS_NONE 40 | #define ETL_COMPILER_CLANG 41 | #define ETL_CPP11_SUPPORTED 1 42 | #define ETL_CPP14_SUPPORTED 1 43 | #define ETL_CPP17_SUPPORTED 0 44 | #define ETL_NO_NULLPTR_SUPPORT 0 45 | #define ETL_NO_LARGE_CHAR_SUPPORT 0 46 | #define ETL_CPP11_TYPE_TRAITS_IS_TRIVIAL_SUPPORTED 1 47 | #define ETL_NO_STL 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /src/etl/profiles/auto.h: -------------------------------------------------------------------------------- 1 | ///\file 2 | 3 | /****************************************************************************** 4 | The MIT License(MIT) 5 | 6 | Embedded Template Library. 7 | https://github.com/ETLCPP/etl 8 | https://www.etlcpp.com 9 | 10 | Copyright(c) 2019 jwellbelove 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining a copy 13 | of this software and associated documentation files(the "Software"), to deal 14 | in the Software without restriction, including without limitation the rights 15 | to use, copy, modify, merge, publish, distribute, sublicense, and / or sell 16 | copies of the Software, and to permit persons to whom the Software is 17 | furnished to do so, subject to the following conditions : 18 | 19 | The above copyright notice and this permission notice shall be included in all 20 | copies or substantial portions of the Software. 21 | 22 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 25 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 26 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 27 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 28 | SOFTWARE. 29 | ******************************************************************************/ 30 | 31 | #ifndef ETL_AUTO_PROFILE_INCLUDED 32 | #define ETL_AUTO_PROFILE_INCLUDED 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /src/etl/profiles/clang_generic.h: -------------------------------------------------------------------------------- 1 | ///\file 2 | 3 | /****************************************************************************** 4 | The MIT License(MIT) 5 | 6 | Embedded Template Library. 7 | https://github.com/ETLCPP/etl 8 | https://www.etlcpp.com 9 | 10 | Copyright(c) 2017 John Wellbelove 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining a copy 13 | of this software and associated documentation files(the "Software"), to deal 14 | in the Software without restriction, including without limitation the rights 15 | to use, copy, modify, merge, publish, distribute, sublicense, and / or sell 16 | copies of the Software, and to permit persons to whom the Software is 17 | furnished to do so, subject to the following conditions : 18 | 19 | The above copyright notice and this permission notice shall be included in all 20 | copies or substantial portions of the Software. 21 | 22 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 25 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 26 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 27 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 28 | SOFTWARE. 29 | ******************************************************************************/ 30 | 31 | #ifndef ETL_CLANG_GENERIC_INCLUDED 32 | #define ETL_CLANG_GENERIC_INCLUDED 33 | 34 | //***************************************************************************** 35 | // CLang 36 | //***************************************************************************** 37 | 38 | #define ETL_TARGET_DEVICE_GENERIC 39 | #define ETL_TARGET_OS_NONE 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /src/etl/profiles/clang_generic_no_stl.h: -------------------------------------------------------------------------------- 1 | ///\file 2 | 3 | /****************************************************************************** 4 | The MIT License(MIT) 5 | 6 | Embedded Template Library. 7 | https://github.com/ETLCPP/etl 8 | https://www.etlcpp.com 9 | 10 | Copyright(c) 2017 John Wellbelove 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining a copy 13 | of this software and associated documentation files(the "Software"), to deal 14 | in the Software without restriction, including without limitation the rights 15 | to use, copy, modify, merge, publish, distribute, sublicense, and / or sell 16 | copies of the Software, and to permit persons to whom the Software is 17 | furnished to do so, subject to the following conditions : 18 | 19 | The above copyright notice and this permission notice shall be included in all 20 | copies or substantial portions of the Software. 21 | 22 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 25 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 26 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 27 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 28 | SOFTWARE. 29 | ******************************************************************************/ 30 | 31 | #ifndef ETL_CLANG_GENERIC_NO_STL_INCLUDED 32 | #define ETL_CLANG_GENERIC_NO_STL_INCLUDED 33 | 34 | //***************************************************************************** 35 | // CLang 36 | //***************************************************************************** 37 | 38 | #define ETL_TARGET_DEVICE_GENERIC 39 | #define ETL_TARGET_OS_NONE 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /src/etl/profiles/cpp03.h: -------------------------------------------------------------------------------- 1 | ///\file 2 | 3 | /****************************************************************************** 4 | The MIT License(MIT) 5 | 6 | Embedded Template Library. 7 | https://github.com/ETLCPP/etl 8 | https://www.etlcpp.com 9 | 10 | Copyright(c) 2017 John Wellbelove 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining a copy 13 | of this software and associated documentation files(the "Software"), to deal 14 | in the Software without restriction, including without limitation the rights 15 | to use, copy, modify, merge, publish, distribute, sublicense, and / or sell 16 | copies of the Software, and to permit persons to whom the Software is 17 | furnished to do so, subject to the following conditions : 18 | 19 | The above copyright notice and this permission notice shall be included in all 20 | copies or substantial portions of the Software. 21 | 22 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 25 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 26 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 27 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 28 | SOFTWARE. 29 | ******************************************************************************/ 30 | 31 | #ifndef ETL_CPP03_INCLUDED 32 | #define ETL_CPP03_INCLUDED 33 | 34 | //***************************************************************************** 35 | // Generic C++03 36 | //***************************************************************************** 37 | 38 | #define ETL_TARGET_DEVICE_GENERIC 39 | #define ETL_TARGET_OS_NONE 40 | #define ETL_COMPILER_GENERIC 41 | #define ETL_CPP11_SUPPORTED 0 42 | #define ETL_CPP14_SUPPORTED 0 43 | #define ETL_CPP17_SUPPORTED 0 44 | #define ETL_NO_NULLPTR_SUPPORT 1 45 | #define ETL_NO_LARGE_CHAR_SUPPORT 1 46 | #define ETL_CPP11_TYPE_TRAITS_IS_TRIVIAL_SUPPORTED 0 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /src/etl/profiles/cpp03_no_stl.h: -------------------------------------------------------------------------------- 1 | ///\file 2 | 3 | /****************************************************************************** 4 | The MIT License(MIT) 5 | 6 | Embedded Template Library. 7 | https://github.com/ETLCPP/etl 8 | https://www.etlcpp.com 9 | 10 | Copyright(c) 2018 John Wellbelove 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining a copy 13 | of this software and associated documentation files(the "Software"), to deal 14 | in the Software without restriction, including without limitation the rights 15 | to use, copy, modify, merge, publish, distribute, sublicense, and / or sell 16 | copies of the Software, and to permit persons to whom the Software is 17 | furnished to do so, subject to the following conditions : 18 | 19 | The above copyright notice and this permission notice shall be included in all 20 | copies or substantial portions of the Software. 21 | 22 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 25 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 26 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 27 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 28 | SOFTWARE. 29 | ******************************************************************************/ 30 | 31 | #ifndef ETL_CPP03_NO_STL_INCLUDED 32 | #define ETL_CPP03_NO_STL_INCLUDED 33 | 34 | //***************************************************************************** 35 | // Generic C++03 36 | //***************************************************************************** 37 | 38 | #define ETL_TARGET_DEVICE_GENERIC 39 | #define ETL_TARGET_OS_NONE 40 | #define ETL_COMPILER_GENERIC 41 | #define ETL_CPP11_SUPPORTED 0 42 | #define ETL_CPP14_SUPPORTED 0 43 | #define ETL_CPP17_SUPPORTED 0 44 | #define ETL_NO_NULLPTR_SUPPORT 1 45 | #define ETL_NO_LARGE_CHAR_SUPPORT 1 46 | #define ETL_CPP11_TYPE_TRAITS_IS_TRIVIAL_SUPPORTED 0 47 | #define ETL_NO_STL 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /src/etl/profiles/cpp11.h: -------------------------------------------------------------------------------- 1 | ///\file 2 | 3 | /****************************************************************************** 4 | The MIT License(MIT) 5 | 6 | Embedded Template Library. 7 | https://github.com/ETLCPP/etl 8 | https://www.etlcpp.com 9 | 10 | Copyright(c) 2017 John Wellbelove 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining a copy 13 | of this software and associated documentation files(the "Software"), to deal 14 | in the Software without restriction, including without limitation the rights 15 | to use, copy, modify, merge, publish, distribute, sublicense, and / or sell 16 | copies of the Software, and to permit persons to whom the Software is 17 | furnished to do so, subject to the following conditions : 18 | 19 | The above copyright notice and this permission notice shall be included in all 20 | copies or substantial portions of the Software. 21 | 22 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 25 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 26 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 27 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 28 | SOFTWARE. 29 | ******************************************************************************/ 30 | 31 | #ifndef ETL_CPP11_INCLUDED 32 | #define ETL_CPP11_INCLUDED 33 | 34 | //***************************************************************************** 35 | // Generic C++11 36 | //***************************************************************************** 37 | 38 | #define ETL_TARGET_DEVICE_GENERIC 39 | #define ETL_TARGET_OS_NONE 40 | #define ETL_COMPILER_GENERIC 41 | #define ETL_CPP11_SUPPORTED 1 42 | #define ETL_CPP14_SUPPORTED 0 43 | #define ETL_CPP17_SUPPORTED 0 44 | #define ETL_NO_NULLPTR_SUPPORT 0 45 | #define ETL_NO_LARGE_CHAR_SUPPORT 0 46 | #define ETL_CPP11_TYPE_TRAITS_IS_TRIVIAL_SUPPORTED 1 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /src/etl/profiles/cpp11_no_stl.h: -------------------------------------------------------------------------------- 1 | ///\file 2 | 3 | /****************************************************************************** 4 | The MIT License(MIT) 5 | 6 | Embedded Template Library. 7 | https://github.com/ETLCPP/etl 8 | https://www.etlcpp.com 9 | 10 | Copyright(c) 2018 John Wellbelove 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining a copy 13 | of this software and associated documentation files(the "Software"), to deal 14 | in the Software without restriction, including without limitation the rights 15 | to use, copy, modify, merge, publish, distribute, sublicense, and / or sell 16 | copies of the Software, and to permit persons to whom the Software is 17 | furnished to do so, subject to the following conditions : 18 | 19 | The above copyright notice and this permission notice shall be included in all 20 | copies or substantial portions of the Software. 21 | 22 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 25 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 26 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 27 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 28 | SOFTWARE. 29 | ******************************************************************************/ 30 | 31 | #ifndef ETL_CPP11_NO_STL_INCLUDED 32 | #define ETL_CPP11_NO_STL_INCLUDED 33 | 34 | //***************************************************************************** 35 | // Generic C++11 36 | //***************************************************************************** 37 | 38 | #define ETL_TARGET_DEVICE_GENERIC 39 | #define ETL_TARGET_OS_NONE 40 | #define ETL_COMPILER_GENERIC 41 | #define ETL_CPP11_SUPPORTED 1 42 | #define ETL_CPP14_SUPPORTED 0 43 | #define ETL_CPP17_SUPPORTED 0 44 | #define ETL_NO_NULLPTR_SUPPORT 0 45 | #define ETL_NO_LARGE_CHAR_SUPPORT 0 46 | #define ETL_CPP11_TYPE_TRAITS_IS_TRIVIAL_SUPPORTED 0 47 | #define ETL_NO_STL 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /src/etl/profiles/cpp14.h: -------------------------------------------------------------------------------- 1 | ///\file 2 | 3 | /****************************************************************************** 4 | The MIT License(MIT) 5 | 6 | Embedded Template Library. 7 | https://github.com/ETLCPP/etl 8 | https://www.etlcpp.com 9 | 10 | Copyright(c) 2017 John Wellbelove 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining a copy 13 | of this software and associated documentation files(the "Software"), to deal 14 | in the Software without restriction, including without limitation the rights 15 | to use, copy, modify, merge, publish, distribute, sublicense, and / or sell 16 | copies of the Software, and to permit persons to whom the Software is 17 | furnished to do so, subject to the following conditions : 18 | 19 | The above copyright notice and this permission notice shall be included in all 20 | copies or substantial portions of the Software. 21 | 22 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 25 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 26 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 27 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 28 | SOFTWARE. 29 | ******************************************************************************/ 30 | 31 | #ifndef ETL_CPP14_INCLUDED 32 | #define ETL_CPP14_INCLUDED 33 | 34 | //***************************************************************************** 35 | // Generic C++14 36 | //***************************************************************************** 37 | 38 | #define ETL_TARGET_DEVICE_GENERIC 39 | #define ETL_TARGET_OS_NONE 40 | #define ETL_COMPILER_GENERIC 41 | #define ETL_CPP11_SUPPORTED 1 42 | #define ETL_CPP14_SUPPORTED 1 43 | #define ETL_CPP17_SUPPORTED 0 44 | #define ETL_NO_NULLPTR_SUPPORT 0 45 | #define ETL_NO_LARGE_CHAR_SUPPORT 0 46 | #define ETL_CPP11_TYPE_TRAITS_IS_TRIVIAL_SUPPORTED 1 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /src/etl/profiles/cpp14_no_stl.h: -------------------------------------------------------------------------------- 1 | ///\file 2 | 3 | /****************************************************************************** 4 | The MIT License(MIT) 5 | 6 | Embedded Template Library. 7 | https://github.com/ETLCPP/etl 8 | https://www.etlcpp.com 9 | 10 | Copyright(c) 2017 John Wellbelove 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining a copy 13 | of this software and associated documentation files(the "Software"), to deal 14 | in the Software without restriction, including without limitation the rights 15 | to use, copy, modify, merge, publish, distribute, sublicense, and / or sell 16 | copies of the Software, and to permit persons to whom the Software is 17 | furnished to do so, subject to the following conditions : 18 | 19 | The above copyright notice and this permission notice shall be included in all 20 | copies or substantial portions of the Software. 21 | 22 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 25 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 26 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 27 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 28 | SOFTWARE. 29 | ******************************************************************************/ 30 | 31 | #ifndef ETL_CPP14_NO_STL_INCLUDED 32 | #define ETL_CPP14_NO_STL_INCLUDED 33 | 34 | //***************************************************************************** 35 | // Generic C++14 36 | //***************************************************************************** 37 | 38 | #define ETL_TARGET_DEVICE_GENERIC 39 | #define ETL_TARGET_OS_NONE 40 | #define ETL_COMPILER_GENERIC 41 | #define ETL_CPP11_SUPPORTED 1 42 | #define ETL_CPP14_SUPPORTED 1 43 | #define ETL_CPP17_SUPPORTED 0 44 | #define ETL_NO_NULLPTR_SUPPORT 0 45 | #define ETL_NO_LARGE_CHAR_SUPPORT 0 46 | #define ETL_CPP11_TYPE_TRAITS_IS_TRIVIAL_SUPPORTED 0 47 | #define ETL_NO_STL 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /src/etl/profiles/cpp17.h: -------------------------------------------------------------------------------- 1 | ///\file 2 | 3 | /****************************************************************************** 4 | The MIT License(MIT) 5 | 6 | Embedded Template Library. 7 | https://github.com/ETLCPP/etl 8 | https://www.etlcpp.com 9 | 10 | Copyright(c) 2018 John Wellbelove 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining a copy 13 | of this software and associated documentation files(the "Software"), to deal 14 | in the Software without restriction, including without limitation the rights 15 | to use, copy, modify, merge, publish, distribute, sublicense, and / or sell 16 | copies of the Software, and to permit persons to whom the Software is 17 | furnished to do so, subject to the following conditions : 18 | 19 | The above copyright notice and this permission notice shall be included in all 20 | copies or substantial portions of the Software. 21 | 22 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 25 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 26 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 27 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 28 | SOFTWARE. 29 | ******************************************************************************/ 30 | 31 | #ifndef ETL_CPP17_INCLUDED 32 | #define ETL_CPP17_INCLUDED 33 | 34 | //***************************************************************************** 35 | // Generic C++17 36 | //***************************************************************************** 37 | 38 | #define ETL_TARGET_DEVICE_GENERIC 39 | #define ETL_TARGET_OS_NONE 40 | #define ETL_COMPILER_GENERIC 41 | #define ETL_CPP11_SUPPORTED 1 42 | #define ETL_CPP14_SUPPORTED 1 43 | #define ETL_CPP17_SUPPORTED 1 44 | #define ETL_NO_NULLPTR_SUPPORT 0 45 | #define ETL_NO_LARGE_CHAR_SUPPORT 0 46 | #define ETL_CPP11_TYPE_TRAITS_IS_TRIVIAL_SUPPORTED 1 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /src/etl/profiles/cpp17_no_stl.h: -------------------------------------------------------------------------------- 1 | ///\file 2 | 3 | /****************************************************************************** 4 | The MIT License(MIT) 5 | 6 | Embedded Template Library. 7 | https://github.com/ETLCPP/etl 8 | https://www.etlcpp.com 9 | 10 | Copyright(c) 2018 John Wellbelove 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining a copy 13 | of this software and associated documentation files(the "Software"), to deal 14 | in the Software without restriction, including without limitation the rights 15 | to use, copy, modify, merge, publish, distribute, sublicense, and / or sell 16 | copies of the Software, and to permit persons to whom the Software is 17 | furnished to do so, subject to the following conditions : 18 | 19 | The above copyright notice and this permission notice shall be included in all 20 | copies or substantial portions of the Software. 21 | 22 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 25 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 26 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 27 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 28 | SOFTWARE. 29 | ******************************************************************************/ 30 | 31 | #ifndef ETL_CPP17_NO_STL_INCLUDED 32 | #define ETL_CPP17_NO_STL_INCLUDED 33 | 34 | //***************************************************************************** 35 | // Generic C++17 without STL support 36 | //***************************************************************************** 37 | 38 | #define ETL_TARGET_DEVICE_GENERIC 39 | #define ETL_TARGET_OS_NONE 40 | #define ETL_COMPILER_GENERIC 41 | #define ETL_CPP11_SUPPORTED 1 42 | #define ETL_CPP14_SUPPORTED 1 43 | #define ETL_CPP17_SUPPORTED 1 44 | #define ETL_NO_NULLPTR_SUPPORT 0 45 | #define ETL_NO_LARGE_CHAR_SUPPORT 0 46 | #define ETL_CPP11_TYPE_TRAITS_IS_TRIVIAL_SUPPORTED 0 47 | #define ETL_NO_STL 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /src/etl/profiles/gcc_generic.h: -------------------------------------------------------------------------------- 1 | ///\file 2 | 3 | /****************************************************************************** 4 | The MIT License(MIT) 5 | 6 | Embedded Template Library. 7 | https://github.com/ETLCPP/etl 8 | https://www.etlcpp.com 9 | 10 | Copyright(c) 2017 John Wellbelove 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining a copy 13 | of this software and associated documentation files(the "Software"), to deal 14 | in the Software without restriction, including without limitation the rights 15 | to use, copy, modify, merge, publish, distribute, sublicense, and / or sell 16 | copies of the Software, and to permit persons to whom the Software is 17 | furnished to do so, subject to the following conditions : 18 | 19 | The above copyright notice and this permission notice shall be included in all 20 | copies or substantial portions of the Software. 21 | 22 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 25 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 26 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 27 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 28 | SOFTWARE. 29 | ******************************************************************************/ 30 | 31 | #ifndef ETL_GCC_GENERIC_INCLUDED 32 | #define ETL_GCC_GENERIC_INCLUDED 33 | 34 | //***************************************************************************** 35 | // GCC 36 | //***************************************************************************** 37 | 38 | #define ETL_TARGET_DEVICE_GENERIC 39 | #define ETL_TARGET_OS_NONE 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /src/etl/profiles/gcc_generic_no_stl.h: -------------------------------------------------------------------------------- 1 | ///\file 2 | 3 | /****************************************************************************** 4 | The MIT License(MIT) 5 | 6 | Embedded Template Library. 7 | https://github.com/ETLCPP/etl 8 | https://www.etlcpp.com 9 | 10 | Copyright(c) 2017 John Wellbelove 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining a copy 13 | of this software and associated documentation files(the "Software"), to deal 14 | in the Software without restriction, including without limitation the rights 15 | to use, copy, modify, merge, publish, distribute, sublicense, and / or sell 16 | copies of the Software, and to permit persons to whom the Software is 17 | furnished to do so, subject to the following conditions : 18 | 19 | The above copyright notice and this permission notice shall be included in all 20 | copies or substantial portions of the Software. 21 | 22 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 25 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 26 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 27 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 28 | SOFTWARE. 29 | ******************************************************************************/ 30 | 31 | #ifndef ETL_GCC_GENERIC_NO_STL_INCLUDED 32 | #define ETL_GCC_GENERIC_NO_STL_INCLUDED 33 | 34 | //***************************************************************************** 35 | // GCC 36 | //***************************************************************************** 37 | 38 | #define ETL_TARGET_DEVICE_GENERIC 39 | #define ETL_TARGET_OS_NONE 40 | #define ETL_NO_STL 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /src/etl/profiles/gcc_linux_x86.h: -------------------------------------------------------------------------------- 1 | ///\file 2 | 3 | /****************************************************************************** 4 | The MIT License(MIT) 5 | 6 | Embedded Template Library. 7 | https://github.com/ETLCPP/etl 8 | https://www.etlcpp.com 9 | 10 | Copyright(c) 2017 John Wellbelove 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining a copy 13 | of this software and associated documentation files(the "Software"), to deal 14 | in the Software without restriction, including without limitation the rights 15 | to use, copy, modify, merge, publish, distribute, sublicense, and / or sell 16 | copies of the Software, and to permit persons to whom the Software is 17 | furnished to do so, subject to the following conditions : 18 | 19 | The above copyright notice and this permission notice shall be included in all 20 | copies or substantial portions of the Software. 21 | 22 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 25 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 26 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 27 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 28 | SOFTWARE. 29 | ******************************************************************************/ 30 | 31 | #ifndef ETL_GCC_LINUX_X86_INCLUDED 32 | #define ETL_GCC_LINUX_X86_INCLUDED 33 | 34 | //***************************************************************************** 35 | // GCC 36 | //***************************************************************************** 37 | 38 | #define ETL_TARGET_DEVICE_X86 39 | #define ETL_TARGET_OS_LINUX 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /src/etl/profiles/gcc_linux_x86_no_stl.h: -------------------------------------------------------------------------------- 1 | ///\file 2 | 3 | /****************************************************************************** 4 | The MIT License(MIT) 5 | 6 | Embedded Template Library. 7 | https://github.com/ETLCPP/etl 8 | https://www.etlcpp.com 9 | 10 | Copyright(c) 2017 John Wellbelove 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining a copy 13 | of this software and associated documentation files(the "Software"), to deal 14 | in the Software without restriction, including without limitation the rights 15 | to use, copy, modify, merge, publish, distribute, sublicense, and / or sell 16 | copies of the Software, and to permit persons to whom the Software is 17 | furnished to do so, subject to the following conditions : 18 | 19 | The above copyright notice and this permission notice shall be included in all 20 | copies or substantial portions of the Software. 21 | 22 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 25 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 26 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 27 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 28 | SOFTWARE. 29 | ******************************************************************************/ 30 | 31 | #ifndef ETL_GCC_LINUX_X86_NO_STL_INCLUDED 32 | #define ETL_GCC_LINUX_X86_NO_STL_INCLUDED 33 | 34 | //***************************************************************************** 35 | // GCC 36 | //***************************************************************************** 37 | 38 | #define ETL_TARGET_DEVICE_X86 39 | #define ETL_TARGET_OS_LINUX 40 | #define ETL_NO_STL 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /src/etl/profiles/gcc_windows_x86.h: -------------------------------------------------------------------------------- 1 | ///\file 2 | 3 | /****************************************************************************** 4 | The MIT License(MIT) 5 | 6 | Embedded Template Library. 7 | https://github.com/ETLCPP/etl 8 | https://www.etlcpp.com 9 | 10 | Copyright(c) 2017 John Wellbelove 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining a copy 13 | of this software and associated documentation files(the "Software"), to deal 14 | in the Software without restriction, including without limitation the rights 15 | to use, copy, modify, merge, publish, distribute, sublicense, and / or sell 16 | copies of the Software, and to permit persons to whom the Software is 17 | furnished to do so, subject to the following conditions : 18 | 19 | The above copyright notice and this permission notice shall be included in all 20 | copies or substantial portions of the Software. 21 | 22 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 25 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 26 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 27 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 28 | SOFTWARE. 29 | ******************************************************************************/ 30 | 31 | #ifndef ETL_GCC_WINDOWS_X86_INCLUDED 32 | #define ETL_GCC_WINDOWS_X86_INCLUDED 33 | 34 | //***************************************************************************** 35 | // GCC 36 | //***************************************************************************** 37 | 38 | #define ETL_TARGET_DEVICE_X86 39 | #define ETL_TARGET_OS_WINDOWS 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /src/etl/profiles/gcc_windows_x86_no_stl.h: -------------------------------------------------------------------------------- 1 | ///\file 2 | 3 | /****************************************************************************** 4 | The MIT License(MIT) 5 | 6 | Embedded Template Library. 7 | https://github.com/ETLCPP/etl 8 | https://www.etlcpp.com 9 | 10 | Copyright(c) 2017 John Wellbelove 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining a copy 13 | of this software and associated documentation files(the "Software"), to deal 14 | in the Software without restriction, including without limitation the rights 15 | to use, copy, modify, merge, publish, distribute, sublicense, and / or sell 16 | copies of the Software, and to permit persons to whom the Software is 17 | furnished to do so, subject to the following conditions : 18 | 19 | The above copyright notice and this permission notice shall be included in all 20 | copies or substantial portions of the Software. 21 | 22 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 25 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 26 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 27 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 28 | SOFTWARE. 29 | ******************************************************************************/ 30 | 31 | #ifndef ETL_GCC_WINDOWS_X86_NO_STL_INCLUDED 32 | #define ETL_GCC_WINDOWS_X86_NO_STL_INCLUDED 33 | 34 | //***************************************************************************** 35 | // GCC 36 | //***************************************************************************** 37 | 38 | #define ETL_TARGET_DEVICE_X86 39 | #define ETL_TARGET_OS_WINDOWS 40 | #define ETL_NO_STL 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /src/etl/profiles/msvc_x86.h: -------------------------------------------------------------------------------- 1 | ///\file 2 | 3 | /****************************************************************************** 4 | The MIT License(MIT) 5 | 6 | Embedded Template Library. 7 | https://github.com/ETLCPP/etl 8 | https://www.etlcpp.com 9 | 10 | Copyright(c) 2017 John Wellbelove 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining a copy 13 | of this software and associated documentation files(the "Software"), to deal 14 | in the Software without restriction, including without limitation the rights 15 | to use, copy, modify, merge, publish, distribute, sublicense, and / or sell 16 | copies of the Software, and to permit persons to whom the Software is 17 | furnished to do so, subject to the following conditions : 18 | 19 | The above copyright notice and this permission notice shall be included in all 20 | copies or substantial portions of the Software. 21 | 22 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 25 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 26 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 27 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 28 | SOFTWARE. 29 | ******************************************************************************/ 30 | 31 | #ifndef ETL_MSVC_X86_INCLUDED 32 | #define ETL_MSVC_X86_INCLUDED 33 | 34 | //***************************************************************************** 35 | // Microsoft Visual Studio 36 | //***************************************************************************** 37 | 38 | #define ETL_TARGET_DEVICE_X86 39 | #define ETL_TARGET_OS_WINDOWS 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /src/etl/profiles/msvc_x86_no_stl.h: -------------------------------------------------------------------------------- 1 | ///\file 2 | 3 | /****************************************************************************** 4 | The MIT License(MIT) 5 | 6 | Embedded Template Library. 7 | https://github.com/ETLCPP/etl 8 | https://www.etlcpp.com 9 | 10 | Copyright(c) 2020 John Wellbelove 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining a copy 13 | of this software and associated documentation files(the "Software"), to deal 14 | in the Software without restriction, including without limitation the rights 15 | to use, copy, modify, merge, publish, distribute, sublicense, and / or sell 16 | copies of the Software, and to permit persons to whom the Software is 17 | furnished to do so, subject to the following conditions : 18 | 19 | The above copyright notice and this permission notice shall be included in all 20 | copies or substantial portions of the Software. 21 | 22 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 25 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 26 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 27 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 28 | SOFTWARE. 29 | ******************************************************************************/ 30 | 31 | #ifndef ETL_MSVC_X86_NO_STL_INCLUDED 32 | #define ETL_MSVC_X86_NO_STL_INCLUDED 33 | 34 | //***************************************************************************** 35 | // Microsoft Visual Studio 36 | //***************************************************************************** 37 | 38 | #define ETL_TARGET_DEVICE_X86 39 | #define ETL_TARGET_OS_WINDOWS 40 | #define ETL_NO_STL 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /src/etl/profiles/segger_gcc_stlport.h: -------------------------------------------------------------------------------- 1 | ///\file 2 | 3 | /****************************************************************************** 4 | The MIT License(MIT) 5 | 6 | Embedded Template Library. 7 | https://github.com/ETLCPP/etl 8 | https://www.etlcpp.com 9 | 10 | Copyright(c) 2017 John Wellbelove 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining a copy 13 | of this software and associated documentation files(the "Software"), to deal 14 | in the Software without restriction, including without limitation the rights 15 | to use, copy, modify, merge, publish, distribute, sublicense, and / or sell 16 | copies of the Software, and to permit persons to whom the Software is 17 | furnished to do so, subject to the following conditions : 18 | 19 | The above copyright notice and this permission notice shall be included in all 20 | copies or substantial portions of the Software. 21 | 22 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 25 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 26 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 27 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 28 | SOFTWARE. 29 | ******************************************************************************/ 30 | 31 | #ifndef ETL_SEGGER_GCC_INCLUDED 32 | #define ETL_SEGGER_GCC_INCLUDED 33 | 34 | //***************************************************************************** 35 | // GCC 36 | //***************************************************************************** 37 | 38 | #define ETL_TARGET_DEVICE_GENERIC 39 | #define ETL_TARGET_OS_NONE 40 | #ifdef __cplusplus 41 | #define ETL_CPP11_SUPPORTED (__cplusplus >= 201103L) 42 | #define ETL_CPP14_SUPPORTED (__cplusplus >= 201402L) 43 | #define ETL_CPP17_SUPPORTED (__cplusplus >= 201703L) 44 | #else 45 | #define ETL_CPP11_SUPPORTED 0 46 | #define ETL_CPP14_SUPPORTED 0 47 | #define ETL_CPP17_SUPPORTED 0 48 | #endif 49 | #define ETL_NO_NULLPTR_SUPPORT 1 50 | #define ETL_NO_LARGE_CHAR_SUPPORT ETL_CPP11_NOT_SUPPORTED 51 | #define ETL_CPP11_TYPE_TRAITS_IS_TRIVIAL_SUPPORTED 0 52 | #define ETL_STLPORT 1 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /src/etl/profiles/ticc.h: -------------------------------------------------------------------------------- 1 | ///\file 2 | 3 | /****************************************************************************** 4 | The MIT License(MIT) 5 | 6 | Embedded Template Library. 7 | https://github.com/ETLCPP/etl 8 | https://www.etlcpp.com 9 | 10 | Copyright(c) 2017 John Wellbelove 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining a copy 13 | of this software and associated documentation files(the "Software"), to deal 14 | in the Software without restriction, including without limitation the rights 15 | to use, copy, modify, merge, publish, distribute, sublicense, and / or sell 16 | copies of the Software, and to permit persons to whom the Software is 17 | furnished to do so, subject to the following conditions : 18 | 19 | The above copyright notice and this permission notice shall be included in all 20 | copies or substantial portions of the Software. 21 | 22 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 25 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 26 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 27 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 28 | SOFTWARE. 29 | ******************************************************************************/ 30 | 31 | #ifndef ETL_TICC_INCLUDED 32 | #define ETL_TICC_INCLUDED 33 | 34 | //***************************************************************************** 35 | // Texas Instruments Code Composer 36 | //***************************************************************************** 37 | 38 | #define ETL_TARGET_DEVICE_GENERIC 39 | #define ETL_TARGET_OS_NONE 40 | #define ETL_CPP11_SUPPORTED 0 41 | #define ETL_CPP14_SUPPORTED 0 42 | #define ETL_CPP17_SUPPORTED 0 43 | #define ETL_NO_NULLPTR_SUPPORT 1 44 | #define ETL_NO_LARGE_CHAR_SUPPORT 1 45 | #define ETL_CPP11_TYPE_TRAITS_IS_TRIVIAL_SUPPORTED 0 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /src/etl/profiles/ticc_no_stl.h: -------------------------------------------------------------------------------- 1 | ///\file 2 | 3 | /****************************************************************************** 4 | The MIT License(MIT) 5 | 6 | Embedded Template Library. 7 | https://github.com/ETLCPP/etl 8 | https://www.etlcpp.com 9 | 10 | Copyright(c) 2020 John Wellbelove 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining a copy 13 | of this software and associated documentation files(the "Software"), to deal 14 | in the Software without restriction, including without limitation the rights 15 | to use, copy, modify, merge, publish, distribute, sublicense, and / or sell 16 | copies of the Software, and to permit persons to whom the Software is 17 | furnished to do so, subject to the following conditions : 18 | 19 | The above copyright notice and this permission notice shall be included in all 20 | copies or substantial portions of the Software. 21 | 22 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 25 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 26 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 27 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 28 | SOFTWARE. 29 | ******************************************************************************/ 30 | 31 | #ifndef ETL_TICC_NO_STL_INCLUDED 32 | #define ETL_TICC_NO_STL_INCLUDED 33 | 34 | //***************************************************************************** 35 | // Texas Instruments Code Composer 36 | //***************************************************************************** 37 | 38 | #define ETL_TARGET_DEVICE_GENERIC 39 | #define ETL_TARGET_OS_NONE 40 | #define ETL_CPP11_SUPPORTED 0 41 | #define ETL_CPP14_SUPPORTED 0 42 | #define ETL_CPP17_SUPPORTED 0 43 | #define ETL_NO_NULLPTR_SUPPORT 1 44 | #define ETL_NO_LARGE_CHAR_SUPPORT 1 45 | #define ETL_CPP11_TYPE_TRAITS_IS_TRIVIAL_SUPPORTED 0 46 | #define ETL_NO_STL 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /src/etl/radix.h: -------------------------------------------------------------------------------- 1 | ///\file 2 | 3 | /****************************************************************************** 4 | The MIT License(MIT) 5 | 6 | Embedded Template Library. 7 | https://github.com/ETLCPP/etl 8 | https://www.etlcpp.com 9 | 10 | Copyright(c) 2014 John Wellbelove 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining a copy 13 | of this software and associated documentation files(the "Software"), to deal 14 | in the Software without restriction, including without limitation the rights 15 | to use, copy, modify, merge, publish, distribute, sublicense, and / or sell 16 | copies of the Software, and to permit persons to whom the Software is 17 | furnished to do so, subject to the following conditions : 18 | 19 | The above copyright notice and this permission notice shall be included in all 20 | copies or substantial portions of the Software. 21 | 22 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 25 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 26 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 27 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 28 | SOFTWARE. 29 | ******************************************************************************/ 30 | 31 | #ifndef ETL_RADIX_INCLUDED 32 | #define ETL_RADIX_INCLUDED 33 | 34 | #include "platform.h" 35 | #include "enum_type.h" 36 | 37 | #include 38 | 39 | ///\defgroup radix radix 40 | /// Radix constants for binary, octal, decimal and hex. 41 | ///\ingroup etl 42 | 43 | namespace etl 44 | { 45 | /// \ingroup radix 46 | struct radix 47 | { 48 | enum enum_type 49 | { 50 | undefined = 0, 51 | binary = 2, 52 | octal = 8, 53 | decimal = 10, 54 | hexadecimal = 16 55 | }; 56 | 57 | ETL_DECLARE_ENUM_TYPE(radix, uint_least8_t) 58 | ETL_ENUM_TYPE(undefined, "undefined") 59 | ETL_ENUM_TYPE(binary, "binary") 60 | ETL_ENUM_TYPE(octal, "octal") 61 | ETL_ENUM_TYPE(decimal, "decimal") 62 | ETL_ENUM_TYPE(hexadecimal, "hexadecimal") 63 | ETL_END_ENUM_TYPE 64 | }; 65 | } 66 | 67 | #endif 68 | -------------------------------------------------------------------------------- /src/etl/spsc_queue.h: -------------------------------------------------------------------------------- 1 | ///\file 2 | 3 | /****************************************************************************** 4 | The MIT License(MIT) 5 | 6 | Embedded Template Library. 7 | https://github.com/ETLCPP/etl 8 | https://www.etlcpp.com 9 | 10 | Copyright(c) 2018 jwellbelove, Mark Kitson 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining a copy 13 | of this software and associated documentation files(the "Software"), to deal 14 | in the Software without restriction, including without limitation the rights 15 | to use, copy, modify, merge, publish, distribute, sublicense, and / or sell 16 | copies of the Software, and to permit persons to whom the Software is 17 | furnished to do so, subject to the following conditions : 18 | 19 | The above copyright notice and this permission notice shall be included in all 20 | copies or substantial portions of the Software. 21 | 22 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 25 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 26 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 27 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 28 | SOFTWARE. 29 | ******************************************************************************/ 30 | 31 | #ifndef __ETL_SPSC_QUEUE__ 32 | #define __ETL_SPSC_QUEUE__ 33 | 34 | #include "platform.h" 35 | #include "atomic.h" 36 | 37 | #if ETL_HAS_ATOMIC 38 | #include "spsc_queue_atomic.h" 39 | #endif 40 | 41 | #if defined(ETL_OS_FREERTOS) 42 | #include "spsc_queue_freertos.h" 43 | #endif 44 | 45 | #include "spsc_queue_isr.h" 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /src/etl/sqrt.h: -------------------------------------------------------------------------------- 1 | ///\file 2 | 3 | /****************************************************************************** 4 | The MIT License(MIT) 5 | 6 | Embedded Template Library. 7 | https://github.com/ETLCPP/etl 8 | https://www.etlcpp.com 9 | 10 | Copyright(c) 2017 John Wellbelove 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining a copy 13 | of this software and associated documentation files(the "Software"), to deal 14 | in the Software without restriction, including without limitation the rights 15 | to use, copy, modify, merge, publish, distribute, sublicense, and / or sell 16 | copies of the Software, and to permit persons to whom the Software is 17 | furnished to do so, subject to the following conditions : 18 | 19 | The above copyright notice and this permission notice shall be included in all 20 | copies or substantial portions of the Software. 21 | 22 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 25 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 26 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 27 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 28 | SOFTWARE. 29 | ******************************************************************************/ 30 | 31 | #ifndef ETL_SQRT_INCLUDED 32 | #define ETL_SQRT_INCLUDED 33 | 34 | #include "platform.h" 35 | #include "type_traits.h" 36 | #include "constant.h" 37 | 38 | #include 39 | 40 | namespace etl 41 | { 42 | //*************************************************************************** 43 | /// Calculates the smallest value that, when squared, will be not greater than VALUE. 44 | //*************************************************************************** 45 | template 46 | struct sqrt 47 | { 48 | typedef typename etl::conditional<((I * I) > VALUE), 49 | etl::constant, 50 | etl::sqrt >::type type; 51 | 52 | #if ETL_USING_CPP11 53 | static constexpr size_t value = type::value; 54 | #else 55 | enum 56 | { 57 | // Recursive definition. 58 | value = type::value 59 | }; 60 | #endif 61 | }; 62 | 63 | #if ETL_USING_CPP11 64 | template 65 | constexpr size_t sqrt::value; 66 | #endif 67 | 68 | #if ETL_USING_CPP17 69 | template 70 | inline constexpr size_t sqrt_v = sqrt::value; 71 | #endif 72 | } 73 | 74 | #endif 75 | -------------------------------------------------------------------------------- /src/etl/static_assert.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | The MIT License(MIT) 3 | 4 | Embedded Template Library. 5 | https://github.com/ETLCPP/etl 6 | https://www.etlcpp.com 7 | 8 | Copyright(c) 2014 John Wellbelove 9 | 10 | Permission is hereby granted, free of charge, to any person obtaining a copy 11 | of this software and associated documentation files(the "Software"), to deal 12 | in the Software without restriction, including without limitation the rights 13 | to use, copy, modify, merge, publish, distribute, sublicense, and / or sell 14 | copies of the Software, and to permit persons to whom the Software is 15 | furnished to do so, subject to the following conditions : 16 | 17 | The above copyright notice and this permission notice shall be included in all 18 | copies or substantial portions of the Software. 19 | 20 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 23 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 25 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | SOFTWARE. 27 | ******************************************************************************/ 28 | 29 | #ifndef ETL_ETL_STATIC_ASSERT_INCLUDED 30 | #define ETL_ETL_STATIC_ASSERT_INCLUDED 31 | 32 | #include "platform.h" 33 | 34 | #if (ETL_USING_CPP11) 35 | #define ETL_STATIC_ASSERT(Condition, Message) static_assert(Condition, Message) 36 | #else 37 | template 38 | struct ETL_ETL_STATIC_ASSERT_FAILED; 39 | 40 | template <> 41 | struct ETL_ETL_STATIC_ASSERT_FAILED {}; 42 | 43 | #define ETL_SA1(a,b) a##b 44 | #define ETL_SA2(a,b) ETL_SA1(a,b) 45 | #define ETL_STATIC_ASSERT(Condition, Message) \ 46 | enum \ 47 | { \ 48 | ETL_SA2(dummy, __LINE__) = sizeof(ETL_ETL_STATIC_ASSERT_FAILED(Condition)>) \ 49 | } 50 | #endif 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /src/etl/string_stream.h: -------------------------------------------------------------------------------- 1 | ///\file 2 | 3 | /****************************************************************************** 4 | The MIT License(MIT) 5 | 6 | Embedded Template Library. 7 | https://github.com/ETLCPP/etl 8 | https://www.etlcpp.com 9 | 10 | Copyright(c) 2020 John Wellbelove 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining a copy 13 | of this software and associated documentation files(the "Software"), to deal 14 | in the Software without restriction, including without limitation the rights 15 | to use, copy, modify, merge, publish, distribute, sublicense, and / or sell 16 | copies of the Software, and to permit persons to whom the Software is 17 | furnished to do so, subject to the following conditions : 18 | 19 | The above copyright notice and this permission notice shall be included in all 20 | copies or substantial portions of the Software. 21 | 22 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 25 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 26 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 27 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 28 | SOFTWARE. 29 | ******************************************************************************/ 30 | 31 | #ifndef ETL_STRING_STREAM_INCLUDED 32 | #define ETL_STRING_STREAM_INCLUDED 33 | 34 | ///\ingroup string 35 | 36 | #include "platform.h" 37 | #include "string.h" 38 | #include "format_spec.h" 39 | #include "to_string.h" 40 | #include "string_view.h" 41 | #include "basic_string_stream.h" 42 | 43 | namespace etl 44 | { 45 | typedef etl::basic_string_stream string_stream; 46 | } 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /src/etl/stringify.h: -------------------------------------------------------------------------------- 1 | #ifndef ETL_ETL_STRINGIFY_INCLUDED 2 | #define ETL_ETL_STRINGIFY_INCLUDED 3 | 4 | #ifndef STRINGIFY 5 | /** Helper macro for STRINGIFY. */ 6 | #define STRINGIFY_1(...) #__VA_ARGS__ 7 | 8 | /** 9 | * Indirect stringification. 10 | * 11 | * Doing two levels allows the parameter to be a macro itself. 12 | * For example, compile with `-DFOO=bar`, `STRINGIFY(FOO)` converts to "bar". 13 | * 14 | * \param x will be converted to one string, including the spaces and commas between arguments. 15 | * For example `STRINGIFY( a , b )` will be expanded to "a , b". 16 | */ 17 | #define STRINGIFY(...) STRINGIFY_1(__VA_ARGS__) 18 | #endif /* STRINGIFY */ 19 | 20 | #endif /* ETL_ETL_STRINGIFY_INCLUDED */ 21 | -------------------------------------------------------------------------------- /src/etl/u16format_spec.h: -------------------------------------------------------------------------------- 1 | ///\file 2 | 3 | /****************************************************************************** 4 | The MIT License(MIT) 5 | 6 | Embedded Template Library. 7 | https://github.com/ETLCPP/etl 8 | https://www.etlcpp.com 9 | 10 | Copyright(c) 2019 John Wellbelove 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining a copy 13 | of this software and associated documentation files(the "Software"), to deal 14 | in the Software without restriction, including without limitation the rights 15 | to use, copy, modify, merge, publish, distribute, sublicense, and / or sell 16 | copies of the Software, and to permit persons to whom the Software is 17 | furnished to do so, subject to the following conditions : 18 | 19 | The above copyright notice and this permission notice shall be included in all 20 | copies or substantial portions of the Software. 21 | 22 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 25 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 26 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 27 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 28 | SOFTWARE. 29 | ******************************************************************************/ 30 | 31 | #ifndef ETL_U16FORMAT_SPEC_INCLUDED 32 | #define ETL_U16FORMAT_SPEC_INCLUDED 33 | 34 | ///\ingroup string 35 | 36 | #include "platform.h" 37 | #include "basic_format_spec.h" 38 | #include "u16string.h" 39 | 40 | namespace etl 41 | { 42 | typedef etl::basic_format_spec u16format_spec; 43 | } 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /src/etl/u16string_stream.h: -------------------------------------------------------------------------------- 1 | ///\file 2 | 3 | /****************************************************************************** 4 | The MIT License(MIT) 5 | 6 | Embedded Template Library. 7 | https://github.com/ETLCPP/etl 8 | https://www.etlcpp.com 9 | 10 | Copyright(c) 2020 John Wellbelove 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining a copy 13 | of this software and associated documentation files(the "Software"), to deal 14 | in the Software without restriction, including without limitation the rights 15 | to use, copy, modify, merge, publish, distribute, sublicense, and / or sell 16 | copies of the Software, and to permit persons to whom the Software is 17 | furnished to do so, subject to the following conditions : 18 | 19 | The above copyright notice and this permission notice shall be included in all 20 | copies or substantial portions of the Software. 21 | 22 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 25 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 26 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 27 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 28 | SOFTWARE. 29 | ******************************************************************************/ 30 | 31 | #ifndef ETL_U16STRING_STREAM_INCLUDED 32 | #define ETL_U16STRING_STREAM_INCLUDED 33 | 34 | ///\ingroup string 35 | 36 | #include "platform.h" 37 | #include "u16string.h" 38 | #include "u16format_spec.h" 39 | #include "to_u16string.h" 40 | #include "string_view.h" 41 | #include "basic_string_stream.h" 42 | 43 | namespace etl 44 | { 45 | typedef etl::basic_string_stream u16string_stream; 46 | } 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /src/etl/u32format_spec.h: -------------------------------------------------------------------------------- 1 | ///\file 2 | 3 | /****************************************************************************** 4 | The MIT License(MIT) 5 | 6 | Embedded Template Library. 7 | https://github.com/ETLCPP/etl 8 | https://www.etlcpp.com 9 | 10 | Copyright(c) 2019 John Wellbelove 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining a copy 13 | of this software and associated documentation files(the "Software"), to deal 14 | in the Software without restriction, including without limitation the rights 15 | to use, copy, modify, merge, publish, distribute, sublicense, and / or sell 16 | copies of the Software, and to permit persons to whom the Software is 17 | furnished to do so, subject to the following conditions : 18 | 19 | The above copyright notice and this permission notice shall be included in all 20 | copies or substantial portions of the Software. 21 | 22 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 25 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 26 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 27 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 28 | SOFTWARE. 29 | ******************************************************************************/ 30 | 31 | #ifndef ETL_U32FORMAT_SPEC_INCLUDED 32 | #define ETL_U32FORMAT_SPEC_INCLUDED 33 | 34 | ///\ingroup string 35 | 36 | #include "platform.h" 37 | #include "basic_format_spec.h" 38 | #include "u32string.h" 39 | 40 | namespace etl 41 | { 42 | typedef etl::basic_format_spec u32format_spec; 43 | } 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /src/etl/u32string_stream.h: -------------------------------------------------------------------------------- 1 | ///\file 2 | 3 | /****************************************************************************** 4 | The MIT License(MIT) 5 | 6 | Embedded Template Library. 7 | https://github.com/ETLCPP/etl 8 | https://www.etlcpp.com 9 | 10 | Copyright(c) 2020 John Wellbelove 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining a copy 13 | of this software and associated documentation files(the "Software"), to deal 14 | in the Software without restriction, including without limitation the rights 15 | to use, copy, modify, merge, publish, distribute, sublicense, and / or sell 16 | copies of the Software, and to permit persons to whom the Software is 17 | furnished to do so, subject to the following conditions : 18 | 19 | The above copyright notice and this permission notice shall be included in all 20 | copies or substantial portions of the Software. 21 | 22 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 25 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 26 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 27 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 28 | SOFTWARE. 29 | ******************************************************************************/ 30 | 31 | #ifndef ETL_U32STRING_STREAM_INCLUDED 32 | #define ETL_U32STRING_STREAM_INCLUDED 33 | 34 | ///\ingroup string 35 | 36 | #include "platform.h" 37 | #include "u32string.h" 38 | #include "u32format_spec.h" 39 | #include "to_u32string.h" 40 | #include "string_view.h" 41 | #include "basic_string_stream.h" 42 | 43 | namespace etl 44 | { 45 | typedef etl::basic_string_stream u32string_stream; 46 | } 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /src/etl/u8format_spec.h: -------------------------------------------------------------------------------- 1 | ///\file 2 | 3 | /****************************************************************************** 4 | The MIT License(MIT) 5 | 6 | Embedded Template Library. 7 | https://github.com/ETLCPP/etl 8 | https://www.etlcpp.com 9 | 10 | Copyright(c) 2023 John Wellbelove 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining a copy 13 | of this software and associated documentation files(the "Software"), to deal 14 | in the Software without restriction, including without limitation the rights 15 | to use, copy, modify, merge, publish, distribute, sublicense, and / or sell 16 | copies of the Software, and to permit persons to whom the Software is 17 | furnished to do so, subject to the following conditions : 18 | 19 | The above copyright notice and this permission notice shall be included in all 20 | copies or substantial portions of the Software. 21 | 22 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 25 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 26 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 27 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 28 | SOFTWARE. 29 | ******************************************************************************/ 30 | 31 | #ifndef ETL_U8FORMAT_SPEC_INCLUDED 32 | #define ETL_U8FORMAT_SPEC_INCLUDED 33 | 34 | ///\ingroup string 35 | 36 | #include "platform.h" 37 | #include "basic_format_spec.h" 38 | #include "u8string.h" 39 | 40 | namespace etl 41 | { 42 | typedef etl::basic_format_spec u8format_spec; 43 | } 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /src/etl/u8string_stream.h: -------------------------------------------------------------------------------- 1 | ///\file 2 | 3 | /****************************************************************************** 4 | The MIT License(MIT) 5 | 6 | Embedded Template Library. 7 | https://github.com/ETLCPP/etl 8 | https://www.etlcpp.com 9 | 10 | Copyright(c) 2023 John Wellbelove 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining a copy 13 | of this software and associated documentation files(the "Software"), to deal 14 | in the Software without restriction, including without limitation the rights 15 | to use, copy, modify, merge, publish, distribute, sublicense, and / or sell 16 | copies of the Software, and to permit persons to whom the Software is 17 | furnished to do so, subject to the following conditions : 18 | 19 | The above copyright notice and this permission notice shall be included in all 20 | copies or substantial portions of the Software. 21 | 22 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 25 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 26 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 27 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 28 | SOFTWARE. 29 | ******************************************************************************/ 30 | 31 | #ifndef ETL_U8STRING_STREAM_INCLUDED 32 | #define ETL_U8STRING_STREAM_INCLUDED 33 | 34 | ///\ingroup string 35 | 36 | #include "platform.h" 37 | #include "u8string.h" 38 | #include "u8format_spec.h" 39 | #include "to_u8string.h" 40 | #include "string_view.h" 41 | #include "basic_string_stream.h" 42 | 43 | namespace etl 44 | { 45 | typedef etl::basic_string_stream u8string_stream; 46 | } 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /src/etl/uncopyable.h: -------------------------------------------------------------------------------- 1 | ///\file 2 | 3 | /****************************************************************************** 4 | The MIT License(MIT) 5 | 6 | Embedded Template Library. 7 | https://github.com/ETLCPP/etl 8 | https://www.etlcpp.com 9 | 10 | Copyright(c) 2024 BMW AG 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining a copy 13 | of this software and associated documentation files(the "Software"), to deal 14 | in the Software without restriction, including without limitation the rights 15 | to use, copy, modify, merge, publish, distribute, sublicense, and / or sell 16 | copies of the Software, and to permit persons to whom the Software is 17 | furnished to do so, subject to the following conditions : 18 | 19 | The above copyright notice and this permission notice shall be included in all 20 | copies or substantial portions of the Software. 21 | 22 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 25 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 26 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 27 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 28 | SOFTWARE. 29 | ******************************************************************************/ 30 | 31 | #ifndef ETL_UNCOPYABLE_INCLUDED 32 | #define ETL_UNCOPYABLE_INCLUDED 33 | 34 | #include "platform.h" 35 | 36 | namespace etl 37 | { 38 | #if ETL_USING_CPP11 39 | //*************************************************************************** 40 | /// An uncopyable base class. 41 | /// Can be used to make a class uncopyable by deriving from it. 42 | //*************************************************************************** 43 | class uncopyable 44 | { 45 | public: 46 | 47 | uncopyable(uncopyable const&) = delete; 48 | uncopyable& operator=(uncopyable const&) = delete; 49 | 50 | protected: 51 | 52 | uncopyable() = default; 53 | ~uncopyable() = default; 54 | }; 55 | 56 | #endif 57 | } 58 | 59 | #endif 60 | -------------------------------------------------------------------------------- /src/etl/variant.h: -------------------------------------------------------------------------------- 1 | ///\file 2 | 3 | /****************************************************************************** 4 | The MIT License(MIT) 5 | 6 | Embedded Template Library. 7 | https://github.com/ETLCPP/etl 8 | https://www.etlcpp.com 9 | 10 | Copyright(c) 2014 John Wellbelove 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining a copy 13 | of this software and associated documentation files(the "Software"), to deal 14 | in the Software without restriction, including without limitation the rights 15 | to use, copy, modify, merge, publish, distribute, sublicense, and / or sell 16 | copies of the Software, and to permit persons to whom the Software is 17 | furnished to do so, subject to the following conditions : 18 | 19 | The above copyright notice and this permission notice shall be included in all 20 | copies or substantial portions of the Software. 21 | 22 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 25 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 26 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 27 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 28 | SOFTWARE. 29 | ******************************************************************************/ 30 | 31 | #ifndef ETL_VARIANT_INCLUDED 32 | #define ETL_VARIANT_INCLUDED 33 | 34 | #include "platform.h" 35 | 36 | #if ETL_USING_LEGACY_VARIANT 37 | #include "private/variant_legacy.h" // etl::variant 38 | #else 39 | #include "private/variant_legacy.h" // etl::legacy::variant 40 | #include "private/variant_variadic.h" // etl::variant 41 | #endif 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /src/etl/wformat_spec.h: -------------------------------------------------------------------------------- 1 | ///\file 2 | 3 | /****************************************************************************** 4 | The MIT License(MIT) 5 | 6 | Embedded Template Library. 7 | https://github.com/ETLCPP/etl 8 | https://www.etlcpp.com 9 | 10 | Copyright(c) 2019 John Wellbelove 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining a copy 13 | of this software and associated documentation files(the "Software"), to deal 14 | in the Software without restriction, including without limitation the rights 15 | to use, copy, modify, merge, publish, distribute, sublicense, and / or sell 16 | copies of the Software, and to permit persons to whom the Software is 17 | furnished to do so, subject to the following conditions : 18 | 19 | The above copyright notice and this permission notice shall be included in all 20 | copies or substantial portions of the Software. 21 | 22 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 25 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 26 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 27 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 28 | SOFTWARE. 29 | ******************************************************************************/ 30 | 31 | #ifndef ETL_WFORMAT_SPEC_INCLUDED 32 | #define ETL_WFORMAT_SPEC_INCLUDED 33 | 34 | ///\ingroup string 35 | 36 | #include "platform.h" 37 | #include "basic_format_spec.h" 38 | #include "wstring.h" 39 | 40 | namespace etl 41 | { 42 | typedef etl::basic_format_spec wformat_spec; 43 | } 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /src/etl/wstring_stream.h: -------------------------------------------------------------------------------- 1 | ///\file 2 | 3 | /****************************************************************************** 4 | The MIT License(MIT) 5 | 6 | Embedded Template Library. 7 | https://github.com/ETLCPP/etl 8 | https://www.etlcpp.com 9 | 10 | Copyright(c) 2020 John Wellbelove 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining a copy 13 | of this software and associated documentation files(the "Software"), to deal 14 | in the Software without restriction, including without limitation the rights 15 | to use, copy, modify, merge, publish, distribute, sublicense, and / or sell 16 | copies of the Software, and to permit persons to whom the Software is 17 | furnished to do so, subject to the following conditions : 18 | 19 | The above copyright notice and this permission notice shall be included in all 20 | copies or substantial portions of the Software. 21 | 22 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 25 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 26 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 27 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 28 | SOFTWARE. 29 | ******************************************************************************/ 30 | 31 | #ifndef ETL_WSTRING_STREAM_INCLUDED 32 | #define ETL_WSTRING_STREAM_INCLUDED 33 | 34 | ///\ingroup string 35 | 36 | #include "platform.h" 37 | #include "string.h" 38 | #include "wformat_spec.h" 39 | #include "to_wstring.h" 40 | #include "string_view.h" 41 | #include "basic_string_stream.h" 42 | 43 | namespace etl 44 | { 45 | typedef etl::basic_string_stream wstring_stream; 46 | } 47 | 48 | #endif 49 | --------------------------------------------------------------------------------