Skip to content

Callback Improvements #89

@Matthew-Whitlock

Description

@Matthew-Whitlock

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions