Skip to content

555 refactor event system - #558

Merged
BartolomeyKant merged 12 commits into
mainfrom
555-refactor-event-system
Sep 25, 2026
Merged

BartolomeyKant merged 12 commits into
mainfrom
555-refactor-event-system

Conversation

@BartolomeyKant

@BartolomeyKant BartolomeyKant commented Sep 23, 2026 •

Copy link
Copy Markdown
Collaborator

closes #555

Two main changes in this PR:

  • Event System - now it uses centralized EventSystem object to manage all events. To define an event Event<void(args...)> object must be created and initialize with EventSystem& or any EventContext type. Each registered event obtain a key, each Subscription stores pointer to event system, key to registered event and pointer to assigned handler which is used later to unsubscribe.
  • ApiProtocol - now every Api class must be derived from DeclareApi CRTP class and provide templated ApiList consteval function intended to be invoked with Api as template parameter. ApiList must return TypeList of RegMethod<MessageId, pointer to memeber function>. This is just an interface. To make client implementation call ClientMethod<&Api::Method>(args...) from that Method. To make server implementation, just do what you must to do in that Method. For client implementations messages are built without allocations - all messages temporary stored in generic storage with specified capacity - PacketList, suitable to store any message from that Api class.

@BartolomeyKant BartolomeyKant self-assigned this Sep 23, 2026
@BartolomeyKant
BartolomeyKant force-pushed the 555-refactor-event-system branch 2 times, most recently from 1f9eb5d to 1e3716a Compare September 23, 2026 11:50
@BartolomeyKant
BartolomeyKant force-pushed the 555-refactor-event-system branch from 1e3716a to db158fe Compare September 23, 2026 12:01
@BartolomeyKant
BartolomeyKant force-pushed the 555-refactor-event-system branch from db158fe to d0dfa73 Compare September 24, 2026 13:32
@BartolomeyKant
BartolomeyKant merged commit 16a5e69 into main Sep 25, 2026
14 checks passed
@BartolomeyKant
BartolomeyKant deleted the 555-refactor-event-system branch September 25, 2026 04:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor event system

1 participant