The Battle for Wesnoth  1.19.18+dev
Classes | 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>

Classes

class  implementation
 

Public Member Functions

 help_manager (const help_manager &)=delete
 
help_manageroperator= (const help_manager &)=delete
 
 ~help_manager ()
 Defined out-of-line so the implementation class is visible. More...
 
const sectionregenerate ()
 Regenerates the cached help topics if necessary. More...
 

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 ()
 Private default constructor. More...
 

Private Attributes

std::unique_ptr< implementationimpl_
 Pointer-to-implementation to reduce include dependencies. More...
 

Static Private Attributes

static std::weak_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 40 of file help.hpp.

Constructor & Destructor Documentation

◆ help_manager() [1/2]

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

◆ ~help_manager()

help::help_manager::~help_manager ( )
default

Defined out-of-line so the implementation class is visible.

◆ help_manager() [2/2]

help::help_manager::help_manager ( )
private

Private default constructor.

Use get_instance to get a managed instance instead.

Definition at line 144 of file help.cpp.

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 152 of file help.cpp.

References singleton_.

Referenced by help::show_help().

◆ operator=()

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

◆ regenerate()

const section & help::help_manager::regenerate ( )

Regenerates the cached help topics if necessary.

Returns
the toplevel section.

Definition at line 166 of file help.cpp.

References impl_.

Member Data Documentation

◆ impl_

std::unique_ptr<implementation> help::help_manager::impl_
private

Pointer-to-implementation to reduce include dependencies.

Definition at line 69 of file help.hpp.

Referenced by regenerate().

◆ singleton_

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

Definition at line 71 of file help.hpp.

Referenced by get_instance().


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