-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
code qualityIssue is related to refactoring or improving code quality overall.Issue is related to refactoring or improving code quality overall.feature requestNew feature or requestNew feature or request
Milestone
Description
Motivation
Today, any struct that needs to handle events declares an EventManager attribute and a generic .on() method that simply delegates to the event manager’s registration function. However, this generic approach requires passing the event name as a first argument every time, which can be cumbersome and less ergonomic for users.
Expectation
The purpose of this task is to define a macro that uses the event enum to automatically:
- declares the public event enum along with its documentation
- generates a generic
.on()method for the associated class - generates specific alias methods like
.on_eventname(...)for each event variant, avoiding the need to explicitly pass the event each time - updates all examples and code samples to use the convenience alias methods rather than the generic version
API change:
There is no breaking change for library users, since the generic .on() method remains available for advanced use cases. However, examples and documentation should be updated to prefer the new convenience methods.
Metadata
Metadata
Assignees
Labels
code qualityIssue is related to refactoring or improving code quality overall.Issue is related to refactoring or improving code quality overall.feature requestNew feature or requestNew feature or request