Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 096257cc authored by Siarhei Vishniakou's avatar Siarhei Vishniakou
Browse files

Use std::variant for NotifyArgs

Previously, NotifyArgs was a base class and we relied on inheritance in
order to refer to these args in a generic manner.

Unfortunately, this prevents us from being able to cast into a
descendant. If you got NotifyArgs, there was no way to figure out its
type.

In this CL, we switch to std::variant. Doing this allows us to remove
the inheritance, and several other functions. The classes are now mostly
about data.

This allows us to receive a generic NotifyArgs object and cast it into
NotifyMotionArgs (for example). This also allows us to separate
NotifyArgs from the InputListener interface (not done in this CL).

Furthermore, we don't need to store the args as unique_ptr anymore.

Bug: 211379801
Test: m checkinput
Change-Id: I5b10d485a9eb27b4ffb6a3a6e21227f52ac3dede
parent 007713dd
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment