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... | |
void | insert_to_active (const preproc_map::value_type &def) |
Used to let std::for_each insert new defines to active_map map to active. 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_ = 0 |
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 196 of file config_cache.hpp.
Enumerator | |
---|---|
FREE | |
NEW | |
ACTIVE | |
LOCKED |
Definition at line 216 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 422 of file config_cache.cpp.
|
private |
Definition at line 438 of file config_cache.cpp.
References define_filenames_.
Referenced by game_config::config_cache::read_cache().
|
private |
Definition at line 477 of file config_cache.cpp.
References ACTIVE, active_map_, get_state(), insert_to_active(), and LOCKED.
Referenced by game_config::config_cache::add_defines_map_diff().
|
private |
Definition at line 443 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 433 of file config_cache.cpp.
References define_filenames_.
Referenced by game_config::config_cache::read_defines_queue().
|
inlinestaticprivate |
Definition at line 234 of file config_cache.hpp.
References state_.
Referenced by add_defines_map_diff(), and get_active_map().
void game_config::config_cache_transaction::insert_to_active | ( | const preproc_map::value_type & | def | ) |
Used to let std::for_each insert new defines to active_map map to active.
Definition at line 498 of file config_cache.cpp.
References active_map_.
Referenced by add_defines_map_diff(), and game_config::config_cache::read_defines_file().
|
inlinestaticprivate |
Definition at line 244 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 239 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 428 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 225 of file config_cache.hpp.
|
friend |
Definition at line 226 of file config_cache.hpp.
|
staticprivate |
Definition at line 229 of file config_cache.hpp.
Referenced by config_cache_transaction(), instance(), is_active(), and ~config_cache_transaction().
|
private |
Definition at line 232 of file config_cache.hpp.
Referenced by add_defines_map_diff(), get_active_map(), and insert_to_active().
|
private |
Definition at line 231 of file config_cache.hpp.
Referenced by add_define_file(), and get_define_files().
|
staticprivate |
Definition at line 228 of file config_cache.hpp.
Referenced by config_cache_transaction(), get_active_map(), get_state(), lock(), and ~config_cache_transaction().