The Battle for Wesnoth  1.15.1+dev
Public Member Functions | Private Attributes | List of all members
gui2::event::dispatcher_implementation::has_handler Class Reference

A helper class to find out whether dispatcher has an handler for a certain event. More...

#include <dispatcher_private.hpp>

Public Member Functions

 has_handler (const dispatcher::event_queue_type event_type, dispatcher &dispatcher)
 Constructor. More...
 
template<typename T >
bool oper (ui_event event)
 Tests whether a handler for an event is available. More...
 

Private Attributes

dispatcher::event_queue_type event_type_
 
dispatcherdispatcher_
 

Detailed Description

A helper class to find out whether dispatcher has an handler for a certain event.

Definition at line 122 of file dispatcher_private.hpp.

Constructor & Destructor Documentation

◆ has_handler()

gui2::event::dispatcher_implementation::has_handler::has_handler ( const dispatcher::event_queue_type  event_type,
dispatcher dispatcher 
)
inline

Constructor.

Parameters
event_typeThe type of event to look for.
dispatcherThe dispatcher whose signal queue is used.

Definition at line 131 of file dispatcher_private.hpp.

Member Function Documentation

◆ oper()

template<typename T >
bool gui2::event::dispatcher_implementation::has_handler::oper ( ui_event  event)
inline

Tests whether a handler for an event is available.

It tests for both the event and the event_type send in the constructor.

Template Parameters
TA key from an event set used to instantiate the proper event_signal function.
Parameters
eventThe event to get the signal for.
Returns
Whether or not the handler is found.

Definition at line 151 of file dispatcher_private.hpp.

References gui2::event::dispatcher::child, dispatcher_, event_type_, gui2::event::dispatcher::post, and gui2::event::dispatcher::pre.

Member Data Documentation

◆ dispatcher_

dispatcher& gui2::event::dispatcher_implementation::has_handler::dispatcher_
private

Definition at line 173 of file dispatcher_private.hpp.

Referenced by oper().

◆ event_type_

dispatcher::event_queue_type gui2::event::dispatcher_implementation::has_handler::event_type_
private

Definition at line 172 of file dispatcher_private.hpp.

Referenced by oper().


The documentation for this class was generated from the following file: