32 Commits

Author SHA1 Message Date
John Wellbelove
aeb8e4f734 Formatted source files 2026-04-02 14:11:45 +01:00
John Wellbelove
7ef01fcaed
Enforce worse-case O(log n) dispatch for messages when using message router for c++11 and up (#1312)
* Added compare_message_id

* Added new C++11 and up message routing code using a sorted type_list

* Renamed compare_message)id to compare_message_id_less

* Added documenation for compare_message_id_less

Added static asserts for message type template parameters

* Added optimisation for contiguous message IDs

Added more Doxygen documentation

* Added etl::type_list_all_of, etl::type_list_any_of, and etl::type_list_none_of

* Added etl::type_list_is_unique

* Added common definitions to all router types

* Added static_asserts to check message types

* Added etl::type_list to etl::nth_type

* Added missing 'typename' to type_list nth_type

* Added type_list_is_empty

* indentation fix

* Renamed type_list_prepend & type_list_append to type_list_push_front & type_list_push_back respectively

* Added tests for make_index_sequence & make_index_sequence_with_offset

* Add more features to etl::type_list (#1307)

* Remove AppVeyor build status badge

Removed AppVeyor build status badge from README.

* Update README.md

* Update CONTRIBUTING.md

Updated the instructions for contributing.

* Added etl::type_list to etl::observer

* Added etl::type_list to etl::nth_type

* Added missing 'typename' to type_list nth_type

* Fix for issue 1276 "Data corruption in the etl::bip_buffer_spsc_atomic" (#1277)

* Reproduce data corruption bug in the `etl::bip_buffer_spsc_atomic`.

* Fix data corruption bug in the `etl::bip_buffer_spsc_atomic`.

* Added type_list definitions for nth_type and observer

* Added etl::type_list to etl::variant

* Updated comments

* Addedetl::type~_list to message_router, observer, visitor

# Conflicts:
#	include/etl/observer.h
#	test/vs2022/etl.vcxproj.filters

* Added member type_list type to tuple

* Work in progress

* Copy changes from other source

* Removed unused tests

* Fix iter_swap namespace

* Add type_list functionality to etl::variant using etl::variant_from_type_list

* Add type_list functionality to etl::message_packet using etl::message_packet_from_type_list

* Add type_list functionality to etl::message_router using etl::message_router_from_type_list

* Add type_list functionality to etl::observer using etl::observer_from_type_list

* Add type_list functionality to etl::tuple using etl::tuple_from_type_list

* Allow etl::make_index_sequence to be created from an etl::type_list

* Add type_list functionality to etl::visitor using etl::visitor_from_type_list

* Fix iter_swap namespace

* Allow creation of a message_packet with no message types

* Allow creation of a message_router with no message types

* Updated VS2022 project files

* Added missing test files CMakeLists.txt

* Fix C++03 compatibility

Fixed unused aregument warnings

* Synced message_packet generator to updated code

* Synced message_router generator to updated code

* Synced message_router generator to updated code

# Conflicts:
#	include/etl/generators/message_router_generator.h
#	include/etl/message_router.h

* Fixed missing zero message specialisation for <= C++14

* Fixed missing zero message specialisation for <= C++14

* Fix year_month arithmetic and correct chrono API behavior (#1257)

* Fix & add more tests for year_month arithmetic

* Minor addtions to previous commit

* More missing values to be uninitialized

* Update the default constructors to = default and correct default constructor tests accordingly

* Fix & add more tests for year_month arithmetic

* Minor addtions to previous commit

* More missing values to be uninitialized

* Update the default constructors to = default and correct default constructor tests accordingly

* Restore default constructor behavior for chrono calender

* Suppress warnings from std in optimized builds (#1259)

When testing with ./run-tests.sh 23 3 10, some warnings from
std surfaced which resulted in build errors.

* Add template deduction guide for span from vector (#1264)

* Create span from vector deduction

* Use ivector for deduction.  Add vector_ext to test

* Add vector pointer to test

* Finish tests

* Initialize pdata_ext and others

* Document how to implement platform specifics (#1262)

Some interfaces need to be implemented in every project
or platform using the ETL:

* etl_get_high_resolution_clock
* etl_get_system_clock
* etl_get_steady_clock
* etl_putchar

Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>

* Fix etl::as_bytes for etl::span<const T> (#1266)

A missing 'const' in the etl::as_bytes implementation was causing a
compile-time error when etl::as_bytes was called on a span of const
values.

Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>

* Remove some UB in test_vector_non_trivial.cpp (#1268)

Some of the tests' UB are detectable by Gcc15 and thus give a compile error due to warnings-as-error flag.

Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>

* Update C++26 deprecated constructs to ensure future standard compliance (#1267)

* Update C++26 deprecated constructs to ensure future standard compliance

I replaced std::is_trivial with a combination of std::is_trivially_default_constructible and std::is_trivially_copyable. Additionally, I added the required comma before the ellipsis in variadic functions to match updated language specifications.

* Some additional is_trivial related changes not found directly when compiling tests in C++26

---------

Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>

* Fix return value of get_token_list (#1271)

Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>

* Fix etl::tuple template signature error in pair assignment operator (#1265)

* Fix etl::tuple template signature error in pair assignment operator

* Remove AppVeyor build status badge

Removed AppVeyor build status badge from README.

* Update README.md

* Update etl::tuple to explicitly use etl::pair or std::pair in assignment operator

* Added tests for etl::tuple assignment from pair

---------

Co-authored-by: Bryton Flecker <bflecker@swe.com>
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>

* Remove advance() on static spans (#1281)

* Remove AppVeyor build status badge

Removed AppVeyor build status badge from README.

* Update README.md

* Update CONTRIBUTING.md

Updated the instructions for contributing.

* Fix for issue 1276 "Data corruption in the etl::bip_buffer_spsc_atomic" (#1277)

* Reproduce data corruption bug in the `etl::bip_buffer_spsc_atomic`.

* Fix data corruption bug in the `etl::bip_buffer_spsc_atomic`.

* Remove advance() on static spans

Since the size of a static span is constant, we can't reasonably
advance() on it.

---------

Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
Co-authored-by: Sergei <sergej.shirokov@gmail.com>

* Add missing includes (#1286)

* Remove AppVeyor build status badge

Removed AppVeyor build status badge from README.

* Update README.md

* Update CONTRIBUTING.md

Updated the instructions for contributing.

* Fix for issue 1276 "Data corruption in the etl::bip_buffer_spsc_atomic" (#1277)

* Reproduce data corruption bug in the `etl::bip_buffer_spsc_atomic`.

* Fix data corruption bug in the `etl::bip_buffer_spsc_atomic`.

* Add missing includes

Before this change, the includes needed to be done explicitly by
files using basic_string_stream.h, and be included first. This
was error prone, especially if includes are reordered (e.g. via
the currently defined clang-format rules).

---------

Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
Co-authored-by: Sergei <sergej.shirokov@gmail.com>

* Move comparison operators of etl::expected to namespace etl (#1287)

* Remove AppVeyor build status badge

Removed AppVeyor build status badge from README.

* Update README.md

* Update CONTRIBUTING.md

Updated the instructions for contributing.

* Fix for issue 1276 "Data corruption in the etl::bip_buffer_spsc_atomic" (#1277)

* Reproduce data corruption bug in the `etl::bip_buffer_spsc_atomic`.

* Fix data corruption bug in the `etl::bip_buffer_spsc_atomic`.

* Move comparison operators of etl::expected to namespace etl

---------

Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
Co-authored-by: Sergei <sergej.shirokov@gmail.com>

* Make typed_storage constructor constexpr (#1291)

* Remove AppVeyor build status badge

Removed AppVeyor build status badge from README.

* Update README.md

* Update CONTRIBUTING.md

Updated the instructions for contributing.

* Fix for issue 1276 "Data corruption in the etl::bip_buffer_spsc_atomic" (#1277)

* Reproduce data corruption bug in the `etl::bip_buffer_spsc_atomic`.

* Fix data corruption bug in the `etl::bip_buffer_spsc_atomic`.

* Make typed_storage constructor constexpr

---------

Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
Co-authored-by: Sergei <sergej.shirokov@gmail.com>

* Add basic_format_arg constructor for ibasic_string (#1288)

* Allow string as format arg

* Remove AppVeyor build status badge

Removed AppVeyor build status badge from README.

* Update README.md

* Update CONTRIBUTING.md

Updated the instructions for contributing.

* Fix for issue 1276 "Data corruption in the etl::bip_buffer_spsc_atomic" (#1277)

* Reproduce data corruption bug in the `etl::bip_buffer_spsc_atomic`.

* Fix data corruption bug in the `etl::bip_buffer_spsc_atomic`.

* Added test string escaped

* Add temporary string test

---------

Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
Co-authored-by: Sergei <sergej.shirokov@gmail.com>

* QR Code for Github

* Added etl::visitor_from_type_list

* accepts(id) for empty router passes on to a sucessor

* Fixed incorrect comment from 'tuple' to 'message_router'

* PR review changes

* PR review changes

* Fixed internal constexptr flag in message_packet

* Fixed unused variable in unti test

* Added new type_list features

Added make_index_sequence_with_offset

* Renamed type_list_select_from_sequence to type_list_select_from_index_sequence

* Replaced type_list_size<TTypeList>::value with TTypeList::size internally for better clarity.

* Added etl::type_list_remove, etl::type_list_remove_if, etl::type_list_unique, etl::type_list_pop_front, etl::type_list_pop_back

* Add ref-qualifiers to basic_format_spec (#1292)

* Remove AppVeyor build status badge

Removed AppVeyor build status badge from README.

* Update README.md

* Update CONTRIBUTING.md

Updated the instructions for contributing.

* Fix for issue 1276 "Data corruption in the etl::bip_buffer_spsc_atomic" (#1277)

* Reproduce data corruption bug in the `etl::bip_buffer_spsc_atomic`.

* Fix data corruption bug in the `etl::bip_buffer_spsc_atomic`.

* feat: use ref-qualifiers for basic_format_spec

Converted the l-value methods to ref-qualified and also added r-value ref-qualified methods.

---------

Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
Co-authored-by: Sergei <sergej.shirokov@gmail.com>

* Add support for size_t and unsigned long to etl::format (#1290)

* Remove AppVeyor build status badge

Removed AppVeyor build status badge from README.

* Update README.md

* Update CONTRIBUTING.md

Updated the instructions for contributing.

* Fix for issue 1276 "Data corruption in the etl::bip_buffer_spsc_atomic" (#1277)

* Reproduce data corruption bug in the `etl::bip_buffer_spsc_atomic`.

* Fix data corruption bug in the `etl::bip_buffer_spsc_atomic`.

* Add support for size_t and unsigned long to etl::format

* Document list of supported types in etl::supported_format_types

* Add further types and tests for etl::format

---------

Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
Co-authored-by: Sergei <sergej.shirokov@gmail.com>

* Deduce underlying storage size when constructing string_ext from char[]. (#1269)

* Deduce underlying storage size when constructing string_ext from char[].

This removes the need for passing sizeof(storage) to the constructor.

* Add array constructors for the other string types.

- u16string_ext
- u32string_ext
- u8string_ext
- wstring_ext

* Add additional constructors to match existing API.

* Fix inconsistent test argument order.

---------

Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>

* Added etl::type_list_all_of, etl::type_list_any_of, and etl::type_list_none_of

* Added etl::type_list_is_unique

* Added type_list_is_empty

* indentation fix

* Fix merge error

* Renamed type_list_prepend & type_list_append to type_list_push_front & type_list_push_back respectively

* Added tests for make_index_sequence & make_index_sequence_with_offset

* Resolve coderabbit review issues

* Resolve coderabbit review issues

* Resolve coderabbit review issues

* Resolve coderabbit review issues

* Added  etl::type_list_indices_of_type which create an etl::index_sequence of all of the indexes of a specified type in an etl::type_list

* Updated comments

* Resolve coderabbit review issues

Added index_sequence utility to support type_list utilities. Added additional index_sequence utilities for completeness

* Added etl::index_sequence_cat, etl::index_sequence_pop_front, etl::index_sequence_pop_back, etl::index_sequence_at

* Fix 'unused variable' error in index_sequence tests

---------

Co-authored-by: John Wellbelove <john.wellbelove@etlcpp.co.uk>
Co-authored-by: Sergei <sergej.shirokov@gmail.com>
Co-authored-by: John Wellbelove <john.wellbelove@etlcpp.com>
Co-authored-by: Bo Rydberg <2945606+bolry@users.noreply.github.com>
Co-authored-by: Roland Reichwein <Roland.Reichwein@bmw.de>
Co-authored-by: Mike Bloom <91038685+mike919192@users.noreply.github.com>
Co-authored-by: taltenbach <92919739+taltenbach@users.noreply.github.com>
Co-authored-by: Bryton Flecker <fleckerbr@gmail.com>
Co-authored-by: Bryton Flecker <bflecker@swe.com>
Co-authored-by: Drew Rife <drew.rife95@gmail.com>
Co-authored-by: Marco Nilsson <marco@zyax.se>

* Moved O(1)/O(logN) index search test to get_dispatch_index_from_message_id

Updated message_router generator

* Fixed C++03 compatibilty

* Replaced is_base_of with is_message

* Missing 'return' in chrono example

* Fixed doxygen comments

* Check message inherits from etl::message<>

* Copilot & coderabbit review changes

Check for no duplicated message IDs
Added diagnostic disable
Make Message_Id_Start an etl::message_id_t type

* Synchronised message_router_generator.h

* Modified the "All message IDs must be unique" static_assert to directly use the index_sequence of message IDs

Added addition index_sequence utilities to support this change.

* Changed Router1 definition to use unordered message ids to check message sorting in message_router

* Added has_message_id and compare_message_id_less to message.h

* Moved member type definitions to a traits class

message_packet, message_types, sorted_message_types

* Sync message_router_generator to changes

* Fixed C++03 compatibility

---------

Co-authored-by: John Wellbelove <john.wellbelove@etlcpp.com>
Co-authored-by: John Wellbelove <john.wellbelove@etlcpp.co.uk>
Co-authored-by: Sergei <sergej.shirokov@gmail.com>
Co-authored-by: Bo Rydberg <2945606+bolry@users.noreply.github.com>
Co-authored-by: Roland Reichwein <Roland.Reichwein@bmw.de>
Co-authored-by: Mike Bloom <91038685+mike919192@users.noreply.github.com>
Co-authored-by: taltenbach <92919739+taltenbach@users.noreply.github.com>
Co-authored-by: Bryton Flecker <fleckerbr@gmail.com>
Co-authored-by: Bryton Flecker <bflecker@swe.com>
Co-authored-by: Drew Rife <drew.rife95@gmail.com>
Co-authored-by: Marco Nilsson <marco@zyax.se>
2026-02-26 10:34:14 +00:00
John Wellbelove
1e2b69bc95 PR review changes 2026-02-05 10:53:08 +00:00
John Wellbelove
ff03b2807d Fix C++03 compatibility
Fixed unused aregument warnings
2026-01-28 22:24:46 +00:00
John Wellbelove
a4ee9d01aa Allow creation of a message_router with no message types 2026-01-28 17:45:29 +00:00
John Wellbelove
1243099471 Add type_list functionality to etl::message_router using etl::message_router_from_type_list 2026-01-28 17:25:08 +00:00
John Wellbelove
d884719098 Fixed all 'extra semicolon' warnings 2025-12-16 09:15:26 +00:00
John Wellbelove
ed8321e54e removed redundant parameters 2024-11-30 10:18:10 +00:00
John Wellbelove
de63fcbc5d Removed using directive in derived message router classes. 2024-11-30 09:34:14 +00:00
John Wellbelove
45fb06af3f Changes require for non-virtual messages 2023-08-18 20:51:36 +01:00
John Wellbelove
baa47d1c33 Updated copyright notice 2022-06-10 21:45:37 +01:00
John Wellbelove
c691991538 Removed warning from compilation 2021-10-01 18:41:35 +01:00
John Wellbelove
7f6548e02b Added successor handling for accepts
Added successor handling for pre-C++17 message router
2021-09-09 16:07:51 +01:00
John Wellbelove
417c3b9e77 Expanded compiled variants for scripts 2021-08-13 16:32:43 +01:00
John Wellbelove
7bb438bf1b Added the option to derive etl::message<> from a custom parent class 2021-06-30 20:57:42 +01:00
John Wellbelove
dbfa71944f Abstracted unit test framework header 2021-03-05 13:52:34 +00:00
John Wellbelove
97a6e6a035 Squashed commit of the following:
commit 04ba91bcccc8e12867962bc3746665f430672a23
Author: John Wellbelove <github@wellbelove.co.uk>
Date:   Sat Feb 6 10:43:34 2021 +0000

    Updated shared message unit test

commit fababc5cf748073464b4294a50c201cb0aa4fa13
Author: John Wellbelove <github@wellbelove.co.uk>
Date:   Fri Feb 5 09:41:52 2021 +0000

    Updated FSM generator

commit ff287bcf0a833ca70933354b42b8b036b422ff81
Author: John Wellbelove <github@wellbelove.co.uk>
Date:   Fri Feb 5 09:35:56 2021 +0000

    Updated message router generator

commit 52724e1e62b55dad81e2f80dd656026d828b3214
Author: John Wellbelove <github@wellbelove.co.uk>
Date:   Thu Feb 4 13:06:50 2021 +0000

    Updated unit tests

commit 0d89105262aa050577ccc17ddc6eece9f4fc5d18
Author: John Wellbelove <github@wellbelove.co.uk>
Date:   Tue Feb 2 20:09:35 2021 +0000

    Interim commit

commit ce8385ff24826103c7a55267ccf3f8a31f517e0b
Author: John Wellbelove <github@wellbelove.co.uk>
Date:   Tue Feb 2 18:13:29 2021 +0000

    Squashed commit of the following:

    commit 007b56d03513887636b84fc246e57d6c4f8b777e
    Author: John Wellbelove <github@wellbelove.co.uk>
    Date:   Tue Feb 2 18:09:51 2021 +0000

        Squashed commit of the following:

        commit 6107c4538be149137209d85e5f41031291bc7150
        Author: John Wellbelove <github@wellbelove.co.uk>
        Date:   Tue Feb 2 12:15:31 2021 +0000

            Added move constructor and move assignment to etl::shared_message

        commit c9a5716012db9b614ea67660ebf64dcb790ce571
        Author: John Wellbelove <github@wellbelove.co.uk>
        Date:   Sun Jan 31 12:36:29 2021 +0000

            Squashed commit of the following:

            commit e5f4eb6fb38c337c82fcc250f17a8f21eb788975
            Author: John Wellbelove <github@wellbelove.co.uk>
            Date:   Sun Jan 31 12:34:49 2021 +0000

                Squashed commit of the following:

                commit 23c5f1d3f9b13ff9e46ce3de96aefeb655d5ed97
                Author: John Wellbelove <github@wellbelove.co.uk>
                Date:   Sun Jan 31 12:32:35 2021 +0000

                    Fixed rollover error for etl::queue_spsc_atomic

                    Added 'required_alignment' parameter to 'allocate' for etl::imemeory_block_allocator.
                    Updated QueuedMessageRouter example

    commit e5f4eb6fb38c337c82fcc250f17a8f21eb788975
    Author: John Wellbelove <github@wellbelove.co.uk>
    Date:   Sun Jan 31 12:34:49 2021 +0000

        Squashed commit of the following:

        commit 23c5f1d3f9b13ff9e46ce3de96aefeb655d5ed97
        Author: John Wellbelove <github@wellbelove.co.uk>
        Date:   Sun Jan 31 12:32:35 2021 +0000

            Fixed rollover error for etl::queue_spsc_atomic

            Added 'required_alignment' parameter to 'allocate' for etl::imemeory_block_allocator.
            Updated QueuedMessageRouter example

commit c9a5716012db9b614ea67660ebf64dcb790ce571
Author: John Wellbelove <github@wellbelove.co.uk>
Date:   Sun Jan 31 12:36:29 2021 +0000

    Squashed commit of the following:

    commit e5f4eb6fb38c337c82fcc250f17a8f21eb788975
    Author: John Wellbelove <github@wellbelove.co.uk>
    Date:   Sun Jan 31 12:34:49 2021 +0000

        Squashed commit of the following:

        commit 23c5f1d3f9b13ff9e46ce3de96aefeb655d5ed97
        Author: John Wellbelove <github@wellbelove.co.uk>
        Date:   Sun Jan 31 12:32:35 2021 +0000

            Fixed rollover error for etl::queue_spsc_atomic

            Added 'required_alignment' parameter to 'allocate' for etl::imemeory_block_allocator.
            Updated QueuedMessageRouter example
2021-02-07 11:02:49 +00:00
John Wellbelove
f3ace52884 Initial design 2020-05-04 13:32:19 +01:00
John Wellbelove
e323f2267f Changed http://www.etlcpp.com to https://www.etlcpp.com 2020-05-01 10:22:36 +01:00
John Wellbelove
cdeef0fecc Updated message router and FSM
Deprecated is_null_router(), added is_producer() and is_consumer()
2020-04-14 10:12:52 +01:00
John Wellbelove
5332cffe44 Add message producer 2020-04-10 15:17:07 +01:00
John Wellbelove
c90c7967c6 Added etl::message_packet classes 2020-03-23 19:49:24 +00:00
John Wellbelove
83347ccfdd Work in progress 2020-01-09 11:15:50 +00:00
John Wellbelove
94c5eed5a4 Work in progress 2020-01-04 11:49:22 +00:00
John Wellbelove
bd008350a2 Merge remote-tracking branch 'origin/feature/changed_include_paths' into development
# Conflicts:
#	include/etl/version.h
2018-07-28 21:55:27 +01:00
John Wellbelove
9f4fe86df9 Added 'successor' member to allow implementation 'Chain Of Responsibility' pattern. 2017-11-30 16:56:22 +00:00
John Wellbelove
a742749849 Merge branch 'development' 2017-11-01 09:33:17 +00:00
John Wellbelove
69704e8b6a Made it optional for messages to be virtual.
By default they are not.
Can be made virtual by defining ETL_MESSAGES_ARE_VIRTUAL in the project settings.
2017-08-17 15:33:29 +01:00
John Wellbelove
740e8b4dd6 Reverted message_id to a virtual function 2017-07-31 19:31:39 +01:00
John Wellbelove
f70850f7f5 Lastest FSM and router changes.
Added message_bus.
Created generators for largest and smallest.
2017-07-28 20:34:58 +01:00
John Wellbelove
0ccdd4fab4 Lastest versions of FSM, Message Router and supporting functionality. 2017-07-25 11:30:00 +01:00
John Wellbelove
04a9cb7bba Changed FSM to be based on message router 2017-07-21 20:11:02 +01:00