Public Types | Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | Friends

game_config::config_cache_transaction Class Reference

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>

Collaboration diagram for game_config::config_cache_transaction:
Collaboration graph
[legend]

List of all members.

Public Types

enum  state { FREE, NEW, ACTIVE, LOCKED }
typedef std::vector< std::string > filenames

Public Member Functions

 config_cache_transaction ()
 ~config_cache_transaction ()
void lock ()
 Lock the transaction so no more macros are added.
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.

Private Member Functions

const filenamesget_define_files () const
void add_define_file (const std::string &)
preproc_mapget_active_map (const preproc_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_transactioninstance ()

Private Attributes

filenames define_filenames_
preproc_map active_map_

Static Private Attributes

static state state_ = FREE
static config_cache_transactionactive_ = 0

Friends

class config_cache
class fake_transaction

Detailed Description

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 158 of file config_cache.hpp.


Member Typedef Documentation

typedef std::vector<std::string> game_config::config_cache_transaction::filenames

Definition at line 172 of file config_cache.hpp.


Member Enumeration Documentation

Enumerator:
FREE 
NEW 
ACTIVE 
LOCKED 

Definition at line 167 of file config_cache.hpp.


Constructor & Destructor Documentation

game_config::config_cache_transaction::config_cache_transaction (  ) 

Definition at line 340 of file config_cache.cpp.

References active_, FREE, and state_.

game_config::config_cache_transaction::~config_cache_transaction (  ) 

Definition at line 349 of file config_cache.cpp.

References active_, and state_.


Member Function Documentation

void game_config::config_cache_transaction::add_define_file ( const std::string &  file  )  [private]

Definition at line 365 of file config_cache.cpp.

References define_filenames_.

void game_config::config_cache_transaction::add_defines_map_diff ( preproc_map defines_map  )  [private]

Definition at line 384 of file config_cache.cpp.

References ACTIVE, active_map_, game_config::compare_define(), get_state(), insert_to_active(), and LOCKED.

Here is the call graph for this function:

preproc_map & game_config::config_cache_transaction::get_active_map ( const preproc_map defines_map  )  [private]

Definition at line 370 of file config_cache.cpp.

References active_map_, get_state(), NEW, and state_.

Here is the call graph for this function:

const config_cache_transaction::filenames & game_config::config_cache_transaction::get_define_files (  )  const [private]

Definition at line 360 of file config_cache.cpp.

References define_filenames_.

static state game_config::config_cache_transaction::get_state (  )  [inline, static, private]

Definition at line 186 of file config_cache.hpp.

References state_.

Referenced by add_defines_map_diff(), and get_active_map().

Here is the caller graph for this function:

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 407 of file config_cache.cpp.

References active_map_.

Referenced by add_defines_map_diff().

Here is the caller graph for this function:

static config_cache_transaction& game_config::config_cache_transaction::instance (  )  [inline, static, private]

Definition at line 190 of file config_cache.hpp.

References active_.

static bool game_config::config_cache_transaction::is_active (  )  [inline, static, private]

Definition at line 188 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().

Here is the caller graph for this function:

void game_config::config_cache_transaction::lock (  ) 

Lock the transaction so no more macros are added.

Definition at line 355 of file config_cache.cpp.

References state_.

Referenced by BOOST_AUTO_TEST_CASE(), and game_controller::load_game_cfg().

Here is the caller graph for this function:


Friends And Related Function Documentation

friend class config_cache [friend]

Definition at line 192 of file config_cache.hpp.

friend class fake_transaction [friend]

Definition at line 193 of file config_cache.hpp.


Member Data Documentation

Definition at line 184 of file config_cache.hpp.

Referenced by add_defines_map_diff(), get_active_map(), and insert_to_active().

Definition at line 183 of file config_cache.hpp.

Referenced by add_define_file(), and get_define_files().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated by doxygen 1.7.1 on Thu May 24 2012 01:20:43 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs