The Battle for Wesnoth  1.17.0-dev
Classes | Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
plugins_manager Class Reference

#include <manager.hpp>

Classes

struct  event
 

Public Member Functions

 plugins_manager (application_lua_kernel *)
 
 ~plugins_manager ()
 
lua_kernel_baseget_kernel_base ()
 
void play_slice (const plugins_context &)
 
void notify_event (const std::string &name, const config &data)
 
 MAKE_ENUM (STATUS,(NONE, "not created")(RUNNING, "running")(STOPPED, "stopped"))
 
std::size_t size ()
 
STATUS get_status (std::size_t idx)
 
std::string get_detailed_status (std::size_t idx)
 
std::string get_name (std::size_t idx)
 
bool any_running ()
 
std::size_t load_plugin (const std::string &name, const std::string &filename)
 
std::size_t add_plugin (const std::string &name, const std::string &prog)
 
void start_plugin (std::size_t idx)
 

Static Public Member Functions

static plugins_managerget ()
 

Private Attributes

std::vector< pluginplugins_
 
std::shared_ptr< bool > playing_
 
std::unique_ptr< application_lua_kernelkernel_
 

Detailed Description

Definition at line 34 of file manager.hpp.

Constructor & Destructor Documentation

◆ plugins_manager()

plugins_manager::plugins_manager ( application_lua_kernel kernel)

Definition at line 44 of file manager.cpp.

References add_plugin(), kernel_, and start_plugin().

◆ ~plugins_manager()

plugins_manager::~plugins_manager ( )

Definition at line 57 of file manager.cpp.

Member Function Documentation

◆ add_plugin()

std::size_t plugins_manager::add_plugin ( const std::string &  name,
const std::string &  prog 
)

Definition at line 119 of file manager.cpp.

References plugin::is_file, plugin::name, p, plugins_, and plugin::source.

Referenced by game_launcher::init_lua_script(), and plugins_manager().

◆ any_running()

bool plugins_manager::any_running ( )

Definition at line 207 of file manager.cpp.

References get_status(), i, and size().

Referenced by gui2::dialogs::modal_dialog::show().

◆ get()

plugins_manager * plugins_manager::get ( )
static

◆ get_detailed_status()

std::string plugins_manager::get_detailed_status ( std::size_t  idx)

Definition at line 84 of file manager.cpp.

References plugins_.

Referenced by game_launcher::init_lua_script().

◆ get_kernel_base()

lua_kernel_base * plugins_manager::get_kernel_base ( )

Definition at line 64 of file manager.cpp.

References kernel_.

Referenced by game_launcher::init_lua_script().

◆ get_name()

std::string plugins_manager::get_name ( std::size_t  idx)

Definition at line 95 of file manager.cpp.

References plugins_.

Referenced by game_launcher::init_lua_script(), and intf_describe_plugins().

◆ get_status()

plugins_manager::STATUS plugins_manager::get_status ( std::size_t  idx)

Definition at line 73 of file manager.cpp.

References gui2::NONE, and plugins_.

Referenced by any_running(), and intf_describe_plugins().

◆ load_plugin()

std::size_t plugins_manager::load_plugin ( const std::string &  name,
const std::string &  filename 
)

Definition at line 132 of file manager.cpp.

References plugin::is_file, plugin::name, p, plugins_, and plugin::source.

◆ MAKE_ENUM()

plugins_manager::MAKE_ENUM ( STATUS  ,
(NONE, "not created")(RUNNING, "running")(STOPPED, "stopped")   
)

◆ notify_event()

void plugins_manager::notify_event ( const std::string &  name,
const config data 
)

Definition at line 145 of file manager.cpp.

References plugins_, and size().

Referenced by events::menu_handler::add_chat_message(), and gui2::chatbox::process_message().

◆ play_slice()

void plugins_manager::play_slice ( const plugins_context ctxt)

Definition at line 159 of file manager.cpp.

References DBG_PLG, playing_, plugins_, and size().

Referenced by plugins_context::play_slice().

◆ size()

std::size_t plugins_manager::size ( )

◆ start_plugin()

void plugins_manager::start_plugin ( std::size_t  idx)

Definition at line 102 of file manager.cpp.

References DBG_PLG, kernel_, and plugins_.

Referenced by game_launcher::init_lua_script(), and plugins_manager().

Member Data Documentation

◆ kernel_

std::unique_ptr<application_lua_kernel> plugins_manager::kernel_
private

Definition at line 73 of file manager.hpp.

Referenced by get_kernel_base(), plugins_manager(), and start_plugin().

◆ playing_

std::shared_ptr<bool> plugins_manager::playing_
private

Definition at line 72 of file manager.hpp.

Referenced by play_slice().

◆ plugins_

std::vector<plugin> plugins_manager::plugins_
private

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