-
-
Notifications
You must be signed in to change notification settings - Fork 466
Implement Signal #1012
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement Signal #1012
Conversation
empty when disconnecting a signal
///\todo Support for return types other than void (aggregate etc.) | ||
//*************************************************************************** | ||
template <typename T, size_t LENGTH, typename TSlot = etl::delegate<T>> | ||
class signal final |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this class is meant to support C++03 then you should use ETL_FINAL
.
You can check basic compatibility from C++03 to C++20 by running the script etl/test/run-syntax-checks.sh
on Linux. You need both GCC and clang installed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My primary goal was to be c++14 compliant since that is what I use, but I tried to be as lower compliant as possible. I didn't know that script existed, thanks, I'll run it and see what I find :)
I'll pull what you currently have to a branch, so I can have a play with it. |
b826d69
into
ETLCPP:pull-request/#1012-Implement-Signal
Yeah that's fine, thank you for looking at this. Sorry, work has gotten busy and so I've been putting this off. Feel free to separate via 03 vs 11+ if you'd like or however you see fit. I know some places have a *_legacy header. |
I know for sure that people will be asking how to use this across threads. |
@jwellbelove No we are still single process here though we are about to go multi-core at some point. Would you mind keeping me in the loop? I'd like to stay informed as that is not my expertise :) |
* feat: initial implementation of signal * feat: correctly calculate the end iterator * test: construct of signal * feat: add connected method * test: connecting a slot to a signal * feat: use ETL_CONSTEXPR14 for begin() and end() * test: disconnect slots from signal * test: disconnecting all slots from the signal * test: calling a signal * test: expected string * feat: include algorithm * test: fix broken construct test for constexpr object * test: call empty * feat: add support for cxx03 * test: create test object for each test * feat: handle for cpp11 supported * style: formatted #if * test: only make a constexpr one for c++14 and on * feat: fix windows 32bit compile issues with any_of usage * feat: support constructing lambda delegate for cxx11 * refactor: remove unecessary check if signal is empty when disconnecting a signal * refactor: make _end be constexpr --------- Co-authored-by: Drew Rife <[email protected]>
…com/ETLCPP/etl into pull-request/#1012-Implement-Signal
…com/ETLCPP/etl into pull-request/#1012-Implement-Signal
…com/ETLCPP/etl into pull-request/#1012-Implement-Signal
# Conflicts: # .gitignore # arduino/library-arduino.json # arduino/library-arduino.properties # include/etl/basic_string.h # include/etl/file_error_numbers.h # include/etl/hfsm.h # include/etl/memory.h # include/etl/string_view.h # include/etl/version.h # library.json # library.properties # support/Release notes.txt # test/test_hfsm.cpp # test/test_string_utilities.cpp # test/vs2022/etl.vcxproj.filters # version.txt
* feat: initial implementation of signal * feat: correctly calculate the end iterator * test: construct of signal * feat: add connected method * test: connecting a slot to a signal * feat: use ETL_CONSTEXPR14 for begin() and end() * test: disconnect slots from signal * test: disconnecting all slots from the signal * test: calling a signal * test: expected string * feat: include algorithm * test: fix broken construct test for constexpr object * test: call empty * feat: add support for cxx03 * test: create test object for each test * feat: handle for cpp11 supported * style: formatted #if * test: only make a constexpr one for c++14 and on * feat: fix windows 32bit compile issues with any_of usage * feat: support constructing lambda delegate for cxx11 * refactor: remove unecessary check if signal is empty when disconnecting a signal * refactor: make _end be constexpr --------- Co-authored-by: Drew Rife <[email protected]> Added -Wformat-security Optimisation of strings Optimisation of strings Optimisation of strings Optimisation of strings Optimisation of strings Updated release Added #include "file_error_numbers.h" Fixed conditional compilation Added ability to use call_if when using etl::delegate as the slot_type Fixed conditional compilation Added ability to use call_if when using etl::delegate as the slot_type # Conflicts: # include/etl/signal.h Fixed conditional compilation Added ability to use call_if when using etl::delegate as the slot_type # Conflicts: # include/etl/signal.h Fixed unused parameter Added etl::trivial_vector More trivial_vector functions Abandoned trivial_vector experiment. Work in progress Work in progress Work in progress Project updates
Initial implementation of signal for #666
I implemented something very similar to this on other software and thought this would be useful for this project. I would like to use this version over my other implementation.
Some other things that could be added at some point is being able to pass in an aggregator or some kind of module that can act on all the signals (think sumnation, product, etc).