The Battle for Wesnoth  1.19.17+dev
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
help::help_manager Class Reference

The help implementation caches data parsed from the game_config. More...

#include <help.hpp>

Public Member Functions

 help_manager (const help_manager &)=delete
 
help_manageroperator= (const help_manager &)=delete
 
void verify_cache ()
 Regenerates the cached help topics if necessary. More...
 
const sectiontoplevel_section () const
 

Static Public Member Functions

static std::shared_ptr< help_managerget_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_managersingleton_
 

Detailed Description

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.

Definition at line 42 of file help.hpp.

Constructor & Destructor Documentation

◆ help_manager() [1/2]

help::help_manager::help_manager ( const help_manager )
delete

◆ help_manager() [2/2]

help::help_manager::help_manager ( )
privatedefault

Private default constructor.

Use get_instance to get a managed instance instead.

Member Function Documentation

◆ get_instance()

std::shared_ptr< help_manager > help::help_manager::get_instance ( )
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().

◆ operator=()

help_manager& help::help_manager::operator= ( const help_manager )
delete

◆ toplevel_section()

const section& help::help_manager::toplevel_section ( ) const
inline

Definition at line 54 of file help.hpp.

References default_toplevel_.

◆ verify_cache()

void help::help_manager::verify_cache ( )

Member Data Documentation

◆ default_toplevel_

section help::help_manager::default_toplevel_
private

The default toplevel.

Definition at line 73 of file help.hpp.

Referenced by toplevel_section(), and verify_cache().

◆ hidden_sections_

section help::help_manager::hidden_sections_
private

All sections and topics not referenced from the default toplevel.

Definition at line 76 of file help.hpp.

Referenced by verify_cache().

◆ last_debug_state_

boost::tribool help::help_manager::last_debug_state_ {boost::indeterminate}
private

Definition at line 70 of file help.hpp.

Referenced by verify_cache().

◆ last_num_encountered_terrains_

int help::help_manager::last_num_encountered_terrains_ {-1}
private

Definition at line 68 of file help.hpp.

Referenced by verify_cache().

◆ last_num_encountered_units_

int help::help_manager::last_num_encountered_units_ {-1}
private

Definition at line 67 of file help.hpp.

Referenced by verify_cache().

◆ singleton_

std::shared_ptr<help_manager> help::help_manager::singleton_
inlinestaticprivate

Definition at line 78 of file help.hpp.

Referenced by get_instance().


The documentation for this class was generated from the following files: