-
Couldn't load subscription status.
- Fork 9
Description
Currently, you cannot remove a callback unless you are certain any callbacks added after it have been removed. There is no way to confirm this at runtime.
We should create a key type that can be used to reference a specific callback, and use it to construct a (sorted) std::map<fenix_callback_key_t, fenix_callback_t>. We can then return the callback key to the user when a callback is added, and allow that key to be used to remove a callback. This key should also be passed to the callback function itself, to allow a callback to remove itself.
To avoid changing the callback function signature in the future, callbacks should take a single struct parameter, e.g. fenix_callback_info_t, that has all of the arguments within it. This way we can pass new data to callbacks over time while remaining backwards compatible.