Used to share macros between cache objects You have to create transaction object to load all macros to memory and share them subsequent cache loads. More...
#include <config_cache.hpp>
Public Types | |
enum | state { FREE , NEW , ACTIVE , LOCKED } |
Public Member Functions | |
config_cache_transaction (const config_cache_transaction &)=delete | |
config_cache_transaction & | operator= (const config_cache_transaction &)=delete |
config_cache_transaction () | |
~config_cache_transaction () | |
void | lock () |
Lock the transaction so no more macros are added. More... | |
Private Member Functions | |
const std::vector< std::string > & | get_define_files () const |
void | add_define_file (const std::string &file) |
preproc_map & | get_active_map (const preproc_map &defines_map) |
void | add_defines_map_diff (preproc_map &defines_map) |
Static Private Member Functions | |
static state | get_state () |
static bool | is_active () |
static config_cache_transaction & | instance () |
Private Attributes | |
std::vector< std::string > | define_filenames_ |
preproc_map | active_map_ |
Static Private Attributes | |
static state | state_ = FREE |
static config_cache_transaction * | active_ = nullptr |
Friends | |
class | config_cache |
class | fake_transaction |
Used to share macros between cache objects You have to create transaction object to load all macros to memory and share them subsequent cache loads.
If transaction is locked all stored macros are still available but new macros aren't added.
Definition at line 198 of file config_cache.hpp.
Enumerator | |
---|---|
FREE | |
NEW | |
ACTIVE | |
LOCKED |
Definition at line 212 of file config_cache.hpp.
|
delete |
game_config::config_cache_transaction::config_cache_transaction | ( | ) |
game_config::config_cache_transaction::~config_cache_transaction | ( | ) |
Definition at line 411 of file config_cache.cpp.
|
private |
Definition at line 427 of file config_cache.cpp.
References define_filenames_.
Referenced by game_config::config_cache::read_cache().
|
private |
Definition at line 444 of file config_cache.cpp.
References ACTIVE, active_map_, get_state(), LOCKED, and swap().
Referenced by game_config::config_cache::add_defines_map_diff().
|
private |
Definition at line 432 of file config_cache.cpp.
References ACTIVE, active_map_, get_state(), NEW, and state_.
Referenced by game_config::config_cache::add_define(), game_config::config_cache::make_copy_map(), and game_config::config_cache::remove_define().
|
private |
Definition at line 422 of file config_cache.cpp.
References define_filenames_.
|
inlinestaticprivate |
Definition at line 230 of file config_cache.hpp.
References state_.
Referenced by add_defines_map_diff(), and get_active_map().
|
inlinestaticprivate |
Definition at line 240 of file config_cache.hpp.
References active_.
Referenced by game_config::config_cache::add_define(), game_config::config_cache::add_defines_map_diff(), game_config::config_cache::make_copy_map(), game_config::config_cache::read_cache(), game_config::config_cache::read_defines_file(), game_config::config_cache::read_defines_queue(), and game_config::config_cache::remove_define().
|
inlinestaticprivate |
Definition at line 235 of file config_cache.hpp.
References active_.
Referenced by game_config::config_cache::add_define(), game_config::fake_transaction::fake_transaction(), and game_config::config_cache::remove_define().
void game_config::config_cache_transaction::lock | ( | ) |
Lock the transaction so no more macros are added.
Definition at line 417 of file config_cache.cpp.
References LOCKED, and state_.
Referenced by BOOST_AUTO_TEST_CASE(), and game_config_manager::load_game_config().
|
delete |
|
friend |
Definition at line 221 of file config_cache.hpp.
|
friend |
Definition at line 222 of file config_cache.hpp.
|
inlinestaticprivate |
Definition at line 225 of file config_cache.hpp.
Referenced by config_cache_transaction(), instance(), is_active(), and ~config_cache_transaction().
|
private |
Definition at line 228 of file config_cache.hpp.
Referenced by add_defines_map_diff(), and get_active_map().
|
private |
Definition at line 227 of file config_cache.hpp.
Referenced by add_define_file(), and get_define_files().
Definition at line 224 of file config_cache.hpp.
Referenced by config_cache_transaction(), get_active_map(), get_state(), lock(), and ~config_cache_transaction().