Skip to content
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

drewr95
Copy link
Contributor

@drewr95 drewr95 commented Jan 12, 2025

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).

@drewr95 drewr95 changed the title Implement Signal Library Implement Signal Jan 12, 2025
///\todo Support for return types other than void (aggregate etc.)
//***************************************************************************
template <typename T, size_t LENGTH, typename TSlot = etl::delegate<T>>
class signal final
Copy link
Contributor

@jwellbelove jwellbelove Jan 13, 2025

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.

Copy link
Contributor Author

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 :)

@jwellbelove
Copy link
Contributor

I'll pull what you currently have to a branch, so I can have a play with it.

@jwellbelove jwellbelove changed the base branch from master to pull-request/#1012-Implement-Signal January 25, 2025 10:51
@jwellbelove jwellbelove merged commit b826d69 into ETLCPP:pull-request/#1012-Implement-Signal Jan 25, 2025
63 checks passed
@drewr95
Copy link
Contributor Author

drewr95 commented Jan 27, 2025

I'll pull what you currently have to a branch, so I can have a play with it.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

2 participants