diff options
author | Alexey Rusakov <Kitsune-Ral@users.sf.net> | 2021-12-28 21:34:03 +0100 |
---|---|---|
committer | Alexey Rusakov <Kitsune-Ral@users.sf.net> | 2021-12-29 18:17:51 +0100 |
commit | 27bb7ba696ae803c6a6903f85fe14074b23b7bcc (patch) | |
tree | 66ffc7615b80c5c70992f82aa5daa69c4e618456 /lib/quotient_common.h | |
parent | ac7ee73cb4fa1ac05f7bcae1800cb79b36c7647f (diff) | |
download | libquotient-27bb7ba696ae803c6a6903f85fe14074b23b7bcc.tar.gz libquotient-27bb7ba696ae803c6a6903f85fe14074b23b7bcc.zip |
Use QLatin1String for event typeId's
Before all, this fixes the problem with double-initialising of type ids;
it could have been fixed with a smaller change but EventTypeRegistry
is fairly superfluous now when inline variables are a thing and it's
possible to have an extensible registry system using literally pointers
to the memory that are guaranteed to be unique. That being said,
event_type_t is still QLatin1String and not a bare const char* (or
void*), mostly to stay on the safe side when it comes to type
identities: unlike const char*, QLatin1String's are deep-compared,
meaning that matching for switchOnType (former visit) occurs a bit
slower now. This may change in the future; but this is the first step
in getting rid of EventTypeRegistry.
This change means that initializeTypeId is no more needed; also, two
static member functions, typeId() and matrixTypeId(), are being replaced
with a single inline static member variable, TypeId. This commit doesn't
apply that transition across the event types, meaning that you'll get
a pile of warnings when compiling the library. These warnings will be
tackled in further commits within this branch.
Diffstat (limited to 'lib/quotient_common.h')
0 files changed, 0 insertions, 0 deletions