The help implementation caches data parsed from the game_config. More...
#include <help.hpp>
Public Member Functions | |
| help_manager (const help_manager &)=delete | |
| help_manager & | operator= (const help_manager &)=delete |
| void | verify_cache () |
| Regenerates the cached help topics if necessary. More... | |
| const section & | toplevel_section () const |
Static Public Member Functions | |
| static std::shared_ptr< help_manager > | get_instance () |
| Returns the existing help_manager instance, or a newly allocated object otherwise. More... | |
Private Member Functions | |
| help_manager ()=default | |
| Private default constructor. More... | |
Private Attributes | |
| int | last_num_encountered_units_ {-1} |
| int | last_num_encountered_terrains_ {-1} |
| boost::tribool | last_debug_state_ {boost::indeterminate} |
| section | default_toplevel_ |
| The default toplevel. More... | |
| section | hidden_sections_ |
| All sections and topics not referenced from the default toplevel. More... | |
Static Private Attributes | |
| static std::shared_ptr< help_manager > | singleton_ |
The help implementation caches data parsed from the game_config.
This class is used to control the lifecycle of that cache, so that the cache will be cleared before the game_config itself changes.
Note: it's okay to call any of the help::show_* functions without creating an instance of help_manager - that will simply mean that the cache is cleared before the show function returns.
Creating two instances of this will cause an assert.
|
delete |
|
privatedefault |
Private default constructor.
Use get_instance to get a managed instance instead.
|
static |
Returns the existing help_manager instance, or a newly allocated object otherwise.
Definition at line 89 of file help.cpp.
References singleton_.
Referenced by help::show_help().
|
delete |
|
inline |
Definition at line 54 of file help.hpp.
References default_toplevel_.
| void help::help_manager::verify_cache | ( | ) |
Regenerates the cached help topics if necessary.
Definition at line 99 of file help.cpp.
References unit_type_data::build_all(), game_config::debug, default_toplevel_, prefs::encountered_terrains(), prefs::encountered_units(), help::generate_contents(), prefs::get(), unit_type::HELP_INDEXED, hidden_sections_, last_debug_state_, last_num_encountered_terrains_, last_num_encountered_units_, and unit_types.
|
private |
The default toplevel.
Definition at line 73 of file help.hpp.
Referenced by toplevel_section(), and verify_cache().
|
private |
All sections and topics not referenced from the default toplevel.
Definition at line 76 of file help.hpp.
Referenced by verify_cache().
|
private |
Definition at line 70 of file help.hpp.
Referenced by verify_cache().
|
private |
Definition at line 68 of file help.hpp.
Referenced by verify_cache().
|
private |
Definition at line 67 of file help.hpp.
Referenced by verify_cache().
|
inlinestaticprivate |
Definition at line 78 of file help.hpp.
Referenced by get_instance().