RAII helper class to control the lifetime of a WML hotkey_command. More...
#include <hotkey_command.hpp>
Public Member Functions | |
wml_hotkey_record (const wml_hotkey_record &)=delete | |
Don't allow copying so objects don't get erased early. More... | |
const wml_hotkey_record & | operator= (const wml_hotkey_record &)=delete |
wml_hotkey_record (wml_hotkey_record &&)=default | |
But we do want move semantics. More... | |
wml_hotkey_record & | operator= (wml_hotkey_record &&)=default |
wml_hotkey_record (const std::string &id, const t_string &description, const config &default_hotkey) | |
Registers a hotkey_command for a WML hotkey with the given ID if one does not already exist. More... | |
~wml_hotkey_record () | |
Private Attributes | |
std::function< void()> | cleanup_ {} |
Handles removing the associated hotkey_command on this object's destruction. More... | |
RAII helper class to control the lifetime of a WML hotkey_command.
Definition at line 326 of file hotkey_command.hpp.
|
delete |
Don't allow copying so objects don't get erased early.
|
default |
But we do want move semantics.
hotkey::wml_hotkey_record::wml_hotkey_record | ( | const std::string & | id, |
const t_string & | description, | ||
const config & | default_hotkey | ||
) |
Registers a hotkey_command for a WML hotkey with the given ID if one does not already exist.
Definition at line 386 of file hotkey_command.cpp.
References hotkey::add_hotkey(), cleanup_, DBG_G, config::empty(), ERR_CF, hotkey::has_hotkey_item(), hotkey::HKCAT_CUSTOM, hotkey::HOTKEY_WML, id, hotkey::load_from_config(), LOG_G, and hotkey::scope_game.
hotkey::wml_hotkey_record::~wml_hotkey_record | ( | ) |
Definition at line 420 of file hotkey_command.cpp.
References cleanup_.
|
delete |
|
default |
|
private |
Handles removing the associated hotkey_command on this object's destruction.
Definition at line 344 of file hotkey_command.hpp.
Referenced by wml_hotkey_record(), and ~wml_hotkey_record().