aboutsummaryrefslogtreecommitdiff
path: root/lib/function_traits.h
diff options
context:
space:
mode:
authorAlexey Rusakov <Kitsune-Ral@users.sf.net>2022-08-12 16:46:01 +0200
committerAlexey Rusakov <Kitsune-Ral@users.sf.net>2022-09-04 18:42:11 +0200
commit17cd3beaefa5501a902e08c7644e8cd97c9091a0 (patch)
treeca98dd3a927bb45f6ff5f4749b5e04f83e4ed321 /lib/function_traits.h
parenta18f505fe7ca66556d66538a7c9b9ff31d2c1b29 (diff)
downloadlibquotient-17cd3beaefa5501a902e08c7644e8cd97c9091a0.tar.gz
libquotient-17cd3beaefa5501a902e08c7644e8cd97c9091a0.zip
Streamline event types
This commit introduces a few things to further reduce the boilerplate across event type definitions: - Event type is no more separately stored in Event and therefore no more passed to base event constructors. Until the previous commit, it was used by is() to quickly match the event type; with the new event metatype class, the same is achieved even quicker by comparing metatype pointers. - EventTemplate is a generalisation of StateEvent for all event types providing common constructor signatures and content() for (most) leaf event types. StateEvent therefore has become a partial specialisation of EventTemplate for types derived from StateEventBase; as the known client code base does not use it directly, a compatibility alias is not provided. Also, DEFINE_SIMPLE_EVENT now expands into a class deriving from EventTemplate. - On top of StateEvent->EventTemplate specialisation, KeyedStateEventBase and KeylessStateEventBase types are introduced with appropriate constructor signatures (with or without state_key, respectively) to allow `using` of them from derived event types. To facilitate writing of constraints, concepts for keyed and keyless state event types are also introduced; RoomStateView, e.g., makes use of those to provide appropriate method signatures. - typeId(), unknownEventTypeId(), UnknownEventTypeId are no more provided - they weren't used throughout the known code base (Quaternion, NeoChat), and the concept of "unknown event types" is hereby eliminated entirely. - RoomKeyEvent no more accepts senderId as a parameter; it has never been a good practice as the sender is assigned by Connection anyway.
Diffstat (limited to 'lib/function_traits.h')
0 files changed, 0 insertions, 0 deletions