Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GUI2: finished refactoring out usage of boost::mpl
dispatcher::has_event called the private find() function, which after a whole bunch of jumping around essentially checked that the signal queue for the given event was not empty. This was a run-time op, yet the code was set up using SFINAE in order to for has_handler::oper() to call the event_signal function corresponding to the event's queue (ie, the mouse queue for a mouse-type event). Since this code was written before the era of constexpr, event type validation was done using boost::mpl, which, in this case, resulted in a monstrous amalgamation of build-time template specialization for a run-time check. I'm not certain, but I believe it might have resulted in an specialization of find() (or at least, implementation::find()) for every single event type (each member of the ui_event enum). This converts the code to a purely run-time check and throws out all the template stuff. It also removes the relevant event_signal overload dealing with events in a set. The version dealing with function types is preserved as it's used in the fire_event() implementation and is a fairly standard usecase of SFINAE. The has_handler class has also been converted to a static function since it's no longer needed for template specializations in find(). And finally, is_raw_event had to be renamed to is_raw_event_event to allow simple name completion in IMPLEMENT_RUNTIME_EVENT_SIGNAL_CHECK. I could have also renamed the raw event queue to signal_raw_queue but I figured keeping the name as signal_raw_event_queue made its purpose clearer.
- Loading branch information
Showing
4 changed files
with
62 additions
and
317 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.