Skip to content

Class endstone::PluginLoader

ClassList > endstone > PluginLoader

Represents a plugin loader, which handles direct access to specific types of plugins.

  • #include <endstone/plugin/plugin_loader.h>

Public Functions

Type Name
PluginLoader (Server & server)
PluginLoader (const PluginLoader &) = delete
virtual void disablePlugin (Plugin & plugin) const
Disables the specified plugin Attempting to disable a plugin that is not enabled will have no effect.
virtual void enablePlugin (Plugin & plugin) const
Enables the specified plugin Attempting to enable a plugin that is already enabled will have no effect.
virtual std::vector< std::string > getPluginFileFilters () const = 0
Returns a list of all filename filters expected by this PluginLoader .
Server & getServer () const
Retrieves the Server object associated with thePluginLoader .
virtual Plugin * loadPlugin (std::string file) = 0
virtual std::vector< Plugin * > loadPlugins (std::string directory)
Loads the plugin contained within the specified directory.
PluginLoader & operator= (const PluginLoader &) = delete
virtual ~PluginLoader () = default

Protected Attributes

Type Name
Server & server_

Public Functions Documentation

function PluginLoader [½]

inline explicit endstone::PluginLoader::PluginLoader (
    Server & server
) 

function PluginLoader [2/2]

endstone::PluginLoader::PluginLoader (
    const PluginLoader &
) = delete

function disablePlugin

Disables the specified plugin Attempting to disable a plugin that is not enabled will have no effect.

inline virtual void endstone::PluginLoader::disablePlugin (
    Plugin & plugin
) const

Parameters:


function enablePlugin

Enables the specified plugin Attempting to enable a plugin that is already enabled will have no effect.

inline virtual void endstone::PluginLoader::enablePlugin (
    Plugin & plugin
) const

Parameters:


function getPluginFileFilters

Returns a list of all filename filters expected by this PluginLoader .

virtual std::vector< std::string > endstone::PluginLoader::getPluginFileFilters () const = 0

Returns:

The filters


function getServer

Retrieves the Server object associated with thePluginLoader .

inline Server & endstone::PluginLoader::getServer () const

This function returns a reference to the Server object that the PluginLoader is associated with.

Returns:

The Server reference.


function loadPlugin

virtual Plugin * endstone::PluginLoader::loadPlugin (
    std::string file
) = 0

Loads the plugin contained in the specified file

Parameters:

  • file File to attempt to load

Returns:

Plugin that was contained in the specified file, or nullptr if unsuccessful


function loadPlugins

Loads the plugin contained within the specified directory.

inline virtual std::vector< Plugin * > endstone::PluginLoader::loadPlugins (
    std::string directory
) 

Parameters:

  • directory Directory to check for plugins

Returns:

A list of all plugins loaded


function operator=

PluginLoader & endstone::PluginLoader::operator= (
    const PluginLoader &
) = delete

function ~PluginLoader

virtual endstone::PluginLoader::~PluginLoader () = default

Protected Attributes Documentation

variable server_

Server& endstone::PluginLoader::server_;


The documentation for this class was generated from the following file include/endstone/plugin/plugin_loader.h