While any instance of this class exists, attempts to save the game via any call to play_controller will be temporarily postponed: the call will return immediately without performing the save, but the save method will then be reinvoked from this class's destructor. More...
#include <save_blocker.hpp>

Classes | |
| class | save_unblocker |
| An exception-safe means of making sure that unblock() gets called after try_block(). More... | |
Public Member Functions | |
| save_blocker () | |
| ~save_blocker () | |
Static Public Member Functions | |
| static bool | saves_are_blocked () |
| static void | on_unblock (play_controller *controller, void(play_controller::*callback)()) |
Static Protected Member Functions | |
| static void | block () |
| static bool | try_block () |
| static void | unblock () |
Static Private Attributes | |
| static play_controller * | controller_ = NULL |
| static void(play_controller::* | callback_ )() = NULL |
| static SDL_sem * | sem_ = SDL_CreateSemaphore(1) |
Friends | |
| class | play_controller |
While any instance of this class exists, attempts to save the game via any call to play_controller will be temporarily postponed: the call will return immediately without performing the save, but the save method will then be reinvoked from this class's destructor.
If multiple save attempts are performed, only the last will be carried out.
Definition at line 31 of file save_blocker.hpp.
| save_blocker::save_blocker | ( | ) |
Definition at line 22 of file save_blocker.cpp.
References block().

| save_blocker::~save_blocker | ( | ) |
Definition at line 26 of file save_blocker.cpp.
References callback_, controller_, and unblock().

| void save_blocker::block | ( | ) | [static, protected] |
Definition at line 49 of file save_blocker.cpp.
References sem_.
Referenced by save_blocker().

| void save_blocker::on_unblock | ( | play_controller * | controller, | |
| void(play_controller::*)() | callback | |||
| ) | [static] |
Definition at line 35 of file save_blocker.cpp.
References callback_, controller_, try_block(), and unblock().
Referenced by play_controller::save_game(), play_controller::save_map(), and play_controller::save_replay().


| bool save_blocker::saves_are_blocked | ( | ) | [static] |
Definition at line 45 of file save_blocker.cpp.
References sem_.
| bool save_blocker::try_block | ( | ) | [static, protected] |
Definition at line 53 of file save_blocker.cpp.
References sem_.
Referenced by on_unblock(), play_controller::save_game(), play_controller::save_map(), and play_controller::save_replay().

| void save_blocker::unblock | ( | ) | [static, protected] |
Definition at line 57 of file save_blocker.cpp.
References sem_.
Referenced by on_unblock(), ~save_blocker(), and save_blocker::save_unblocker::~save_unblocker().

friend class play_controller [friend] |
Definition at line 39 of file save_blocker.hpp.
void(play_controller::* save_blocker::callback_)() = NULL [static, private] |
Definition at line 55 of file save_blocker.hpp.
Referenced by on_unblock(), and ~save_blocker().
play_controller * save_blocker::controller_ = NULL [static, private] |
Definition at line 54 of file save_blocker.hpp.
Referenced by on_unblock(), and ~save_blocker().
SDL_sem * save_blocker::sem_ = SDL_CreateSemaphore(1) [static, private] |
Definition at line 56 of file save_blocker.hpp.
Referenced by block(), saves_are_blocked(), try_block(), and unblock().
| Generated by doxygen 1.7.1 on Thu May 24 2012 01:15:53 for The Battle for Wesnoth | Gna! | Forum | Wiki | CIA | devdocs |