The Battle for Wesnoth  1.19.5+dev
Public Types | Public Member Functions | Static Public Member Functions | List of all members
synced_command Class Reference

#include <synced_commands.hpp>

Public Types

typedef std::function< void(const std::string &)> error_handler_function
 
typedef bool(* handler) (const config &, action_spectator &spectator)
 
typedef std::map< std::string, handlermap
 

Public Member Functions

 synced_command (const std::string &tag, handler function)
 

Static Public Member Functions

static mapregistry ()
 using static function variable instead of static member variable to prevent static initialization fiasco when used in other files. More...
 

Detailed Description

Definition at line 49 of file synced_commands.hpp.

Member Typedef Documentation

◆ error_handler_function

typedef std::function<void(const std::string&)> synced_command::error_handler_function

Definition at line 55 of file synced_commands.hpp.

◆ handler

typedef bool(* synced_command::handler) (const config &, action_spectator &spectator)

Definition at line 59 of file synced_commands.hpp.

◆ map

typedef std::map<std::string, handler> synced_command::map

Definition at line 60 of file synced_commands.hpp.

Constructor & Destructor Documentation

◆ synced_command()

synced_command::synced_command ( const std::string &  tag,
handler  function 
)
Parameters
[in]tagThe replay tag for this action.
[in]functionThe callback for this action.

Definition at line 54 of file synced_commands.cpp.

References registry(), and markup::tag().

Member Function Documentation

◆ registry()

synced_command::map & synced_command::registry ( )
static

using static function variable instead of static member variable to prevent static initialization fiasco when used in other files.

Definition at line 60 of file synced_commands.cpp.

Referenced by intf_invoke_synced_command(), synced_context::run(), synced_context::run_in_synced_context_if_not_already(), and synced_command().


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