Ark Server API (ASE) - Wiki
Loading...
Searching...
No Matches
API::PluginManager Class Reference

#include <PluginManager.h>

Public Member Functions

 PluginManager (const PluginManager &)=delete
 
 PluginManager (PluginManager &&)=delete
 
PluginManageroperator= (const PluginManager &)=delete
 
PluginManageroperator= (PluginManager &&)=delete
 
void LoadAllPlugins ()
 Find and load all plugins.
 
std::shared_ptr< Plugin > & LoadPlugin (const std::string &plugin_name) noexcept(false)
 Load plugin by it's name.
 
void UnloadPlugin (const std::string &plugin_name) noexcept(false)
 Unload plugin by it's name. Plugin must free all used resources.
 
std::vector< std::shared_ptr< Plugin > >::const_iterator FindPlugin (const std::string &plugin_name)
 Find plugin by it's name.
 
bool IsPluginLoaded (const std::string &plugin_name)
 Returns true if plugin was loaded, false otherwise.
 

Static Public Member Functions

static PluginManagerGet ()
 
static nlohmann::json GetAllPDBConfigs ()
 Get all plugin pdb configs.
 
static void DetectPluginChangesTimerCallback ()
 Checks for auto plugin reloads.
 

Private Member Functions

 PluginManager ()=default
 
 ~PluginManager ()=default
 
void CheckPluginsDependencies ()
 
void DetectPluginChanges ()
 

Static Private Member Functions

static nlohmann::json ReadPluginInfo (const std::string &plugin_name)
 
static nlohmann::json ReadPluginPDBConfig (const std::string &plugin_name)
 
static nlohmann::json ReadSettingsConfig ()
 

Private Attributes

std::vector< std::shared_ptr< Plugin > > loaded_plugins_
 
bool enable_plugin_reload_ {false}
 
int reload_sleep_seconds_ {5}
 
bool save_world_before_reload_ {true}
 
time_t next_reload_check_ {5}
 

Detailed Description

Definition at line 36 of file PluginManager.h.

Constructor & Destructor Documentation

◆ PluginManager() [1/3]

API::PluginManager::PluginManager ( const PluginManager & )
delete

◆ PluginManager() [2/3]

API::PluginManager::PluginManager ( PluginManager && )
delete

◆ PluginManager() [3/3]

API::PluginManager::PluginManager ( )
privatedefault

◆ ~PluginManager()

API::PluginManager::~PluginManager ( )
privatedefault

Member Function Documentation

◆ CheckPluginsDependencies()

void API::PluginManager::CheckPluginsDependencies ( )
private

Definition at line 265 of file PluginManager.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ DetectPluginChanges()

void API::PluginManager::DetectPluginChanges ( )
private

Definition at line 317 of file PluginManager.cpp.

+ Here is the caller graph for this function:

◆ DetectPluginChangesTimerCallback()

void API::PluginManager::DetectPluginChangesTimerCallback ( )
static

Checks for auto plugin reloads.

Definition at line 301 of file PluginManager.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ FindPlugin()

std::vector< std::shared_ptr< Plugin > >::const_iterator API::PluginManager::FindPlugin ( const std::string & plugin_name)

Find plugin by it's name.

Parameters
plugin_nameFile name of the plugin
Returns
An iterator to the loaded plugin

Definition at line 285 of file PluginManager.cpp.

+ Here is the caller graph for this function:

◆ Get()

PluginManager & API::PluginManager::Get ( )
static

Definition at line 15 of file PluginManager.cpp.

+ Here is the caller graph for this function:

◆ GetAllPDBConfigs()

nlohmann::json API::PluginManager::GetAllPDBConfigs ( )
static

Get all plugin pdb configs.

Definition at line 21 of file PluginManager.cpp.

+ Here is the call graph for this function:

◆ IsPluginLoaded()

bool API::PluginManager::IsPluginLoaded ( const std::string & plugin_name)

Returns true if plugin was loaded, false otherwise.

Definition at line 296 of file PluginManager.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ LoadAllPlugins()

void API::PluginManager::LoadAllPlugins ( )

Find and load all plugins.

Definition at line 89 of file PluginManager.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ LoadPlugin()

std::shared_ptr< Plugin > & API::PluginManager::LoadPlugin ( const std::string & plugin_name)

Load plugin by it's name.

Parameters
plugin_nameFile name of the plugin
Returns
Loaded plugin

Definition at line 149 of file PluginManager.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ operator=() [1/2]

PluginManager & API::PluginManager::operator= ( const PluginManager & )
delete

◆ operator=() [2/2]

PluginManager & API::PluginManager::operator= ( PluginManager && )
delete

◆ ReadPluginInfo()

nlohmann::json API::PluginManager::ReadPluginInfo ( const std::string & plugin_name)
staticprivate

Definition at line 234 of file PluginManager.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ReadPluginPDBConfig()

nlohmann::json API::PluginManager::ReadPluginPDBConfig ( const std::string & plugin_name)
staticprivate

Definition at line 48 of file PluginManager.cpp.

+ Here is the call graph for this function:

◆ ReadSettingsConfig()

nlohmann::json API::PluginManager::ReadSettingsConfig ( )
staticprivate

Definition at line 72 of file PluginManager.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ UnloadPlugin()

void API::PluginManager::UnloadPlugin ( const std::string & plugin_name)

Unload plugin by it's name. Plugin must free all used resources.

Parameters
plugin_nameFile name of the plugin

Definition at line 197 of file PluginManager.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ enable_plugin_reload_

bool API::PluginManager::enable_plugin_reload_ {false}
private

Definition at line 100 of file PluginManager.h.

◆ loaded_plugins_

std::vector<std::shared_ptr<Plugin> > API::PluginManager::loaded_plugins_
private

Definition at line 97 of file PluginManager.h.

◆ next_reload_check_

time_t API::PluginManager::next_reload_check_ {5}
private

Definition at line 103 of file PluginManager.h.

◆ reload_sleep_seconds_

int API::PluginManager::reload_sleep_seconds_ {5}
private

Definition at line 101 of file PluginManager.h.

◆ save_world_before_reload_

bool API::PluginManager::save_world_before_reload_ {true}
private

Definition at line 102 of file PluginManager.h.


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