The Battle for Wesnoth  1.17.0-dev
Public Member Functions | List of all members
gui2::executor Class Reference

Helper to make removing a timer in a callback safe. More...

Public Member Functions

 executor (std::size_t id)
 ~executor ()

Detailed Description

Helper to make removing a timer in a callback safe.

Upon creation it sets the executing id and clears the remove request flag.

If an remove_timer() is called for the id being executed it requests a remove the timer and exits remove_timer().

Upon destruction it tests whether there was a request to remove the id and does so. It also clears the executing id. It leaves the remove request flag since the execution function needs to know whether or not the event was removed.

Definition at line 76 of file timer.cpp.

Constructor & Destructor Documentation

◆ executor()

gui2::executor::executor ( std::size_t  id)

Definition at line 79 of file timer.cpp.

References id.

◆ ~executor()

gui2::executor::~executor ( )

Definition at line 85 of file timer.cpp.

References gui2::executing_id, and gui2::remove_timer().

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