The Battle for Wesnoth  1.19.0-dev
Public Types | Public Member Functions | Static Public Member Functions | Static Private Attributes | List of all members
game_events::wml_action Class Reference

#include <action_wml.hpp>

Public Types

typedef void(* handler) (const queued_event &, const vconfig &)
 
typedef std::map< std::string, handlermap
 

Public Member Functions

 wml_action (const std::string &tag, handler function)
 Using this constructor for a static object outside action_wml.cpp will likely lead to a static initialization fiasco. More...
 

Static Public Member Functions

static map::const_iterator begin ()
 The first registered action. More...
 
static map::const_iterator end ()
 One past the last registered action. More...
 
static const mapregistry ()
 

Static Private Attributes

static map registry_
 Tracks the known action handlers. More...
 

Detailed Description

Definition at line 42 of file action_wml.hpp.

Member Typedef Documentation

◆ handler

typedef void(* game_events::wml_action::handler) (const queued_event &, const vconfig &)

Definition at line 44 of file action_wml.hpp.

◆ map

typedef std::map<std::string, handler> game_events::wml_action::map

Definition at line 45 of file action_wml.hpp.

Constructor & Destructor Documentation

◆ wml_action()

game_events::wml_action::wml_action ( const std::string &  tag,
handler  function 
)

Using this constructor for a static object outside action_wml.cpp will likely lead to a static initialization fiasco.

Parameters
[in]tagThe WML tag for this action.
[in]functionThe callback for this action.

Definition at line 200 of file action_wml.cpp.

References registry_.

Member Function Documentation

◆ begin()

static map::const_iterator game_events::wml_action::begin ( )
inlinestatic

The first registered action.

Definition at line 54 of file action_wml.hpp.

References registry_.

◆ end()

static map::const_iterator game_events::wml_action::end ( )
inlinestatic

One past the last registered action.

Definition at line 56 of file action_wml.hpp.

References registry_.

◆ registry()

static const map& game_events::wml_action::registry ( )
inlinestatic

Definition at line 57 of file action_wml.hpp.

References registry_.

Referenced by game_lua_kernel::game_lua_kernel().

Member Data Documentation

◆ registry_

wml_action::map game_events::wml_action::registry_
staticprivate

Tracks the known action handlers.

Definition at line 60 of file action_wml.hpp.

Referenced by begin(), end(), registry(), and wml_action().


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