plugify 1.0.0.0
Loading...
Searching...
No Matches
Public Member Functions | List of all members
plugify::IPlugifyProvider Class Reference

Wrapper handle for the PlugifyProvider, which is provided to the user and implemented in the core. More...

#include <plugify_provider.hpp>

Inheritance diagram for plugify::IPlugifyProvider:
Inheritance graph
[legend]
Collaboration diagram for plugify::IPlugifyProvider:
Collaboration graph
[legend]

Public Member Functions

void Log (std::string_view msg, Severity severity) const
 Log a message with a specified severity level.
 
std::filesystem::path_view GetBaseDir () const noexcept
 Get the base directory of the Plugify system.
 
bool IsPreferOwnSymbols () const noexcept
 Checks if the preference for using own symbols is enabled.
 
bool IsPluginLoaded (std::string_view name, std::optional< plg::version > requiredVersion={}, bool minimum=false) const noexcept
 Checks if a plugin with the specified name is loaded.
 
bool IsModuleLoaded (std::string_view name, std::optional< plg::version > requiredVersion={}, bool minimum=false) const noexcept
 Checks if a language module with the specified name is loaded.
 
PluginHandle FindPlugin (std::string_view name) const noexcept
 Finds a plugin by its name.
 
ModuleHandle FindModule (std::string_view name) const noexcept
 Finds a language module by its name.
 
- Public Member Functions inherited from plugify::Handle< PlugifyProvider >
 Handle () noexcept
 Default constructor. Initializes the handle with a null pointer.
 
 Handle (PlugifyProvider &impl) noexcept
 Constructs a Handle object from an instance of type T.
 
 Handle (const Handle &)=default
 Copy constructor. Creates a new Handle object from another Handle object.
 
 Handle (Handle &&)=default
 Move constructor. Transfers ownership from another Handle object.
 
auto operator<=> (const Handle &) const=default
 Comparison operator (<=>) for comparing two Handle objects.
 
Handleoperator= (const Handle &) &=default
 Copy assignment operator. Copies the handle from another Handle object.
 
Handleoperator= (const Handle &) &&=delete
 Copy assignment operator for rvalue references is deleted.
 
Handleoperator= (Handle &&) &=default
 Move assignment operator. Transfers ownership from another Handle object.
 
Handleoperator= (Handle &&) &&=delete
 Move assignment operator for rvalue references is deleted.
 
 operator bool () const noexcept
 Explicit conversion operator to bool, indicating if the pointer is non-zero.
 
 operator uintptr_t () const noexcept
 Converts the Handle object to a uintptr_t.
 
 operator void * () const noexcept
 Converts the Handle object to a void pointer.
 

Additional Inherited Members

- Protected Attributes inherited from plugify::Handle< PlugifyProvider >
PlugifyProvider * _impl
 A pointer to the referenced implementation of type T.
 

Detailed Description

Wrapper handle for the PlugifyProvider, which is provided to the user and implemented in the core.

Definition at line 24 of file plugify_provider.hpp.

Member Function Documentation

◆ FindModule()

ModuleHandle plugify::IPlugifyProvider::FindModule ( std::string_view  name) const
noexcept

Finds a language module by its name.

This function attempts to find a language module with the specified name in the Plugify system. If a module with the given name is found, a handle to it is returned. Otherwise, an empty handle value is returned.

Parameters
nameThe name of the language module to find.
Returns
A handle to the module if found, or an empty handle if not found.

◆ FindPlugin()

PluginHandle plugify::IPlugifyProvider::FindPlugin ( std::string_view  name) const
noexcept

Finds a plugin by its name.

This function attempts to find a plugin with the specified name in the Plugify system. If a plugin with the given name is found, a handle to it is returned. Otherwise, an empty handle is returned.

Parameters
nameThe name of the plugin to find.
Returns
A handle to the plugin if found, or an empty handle if not found.

◆ GetBaseDir()

std::filesystem::path_view plugify::IPlugifyProvider::GetBaseDir ( ) const
noexcept

Get the base directory of the Plugify system.

Returns
Reference to the base directory path.

◆ IsModuleLoaded()

bool plugify::IPlugifyProvider::IsModuleLoaded ( std::string_view  name,
std::optional< plg::version requiredVersion = {},
bool  minimum = false 
) const
noexcept

Checks if a language module with the specified name is loaded.

This function checks if a language module with the specified name is currently loaded. Optionally, you can specify a required version and set the minimum parameter to true to check if the loaded version meets or exceeds the required version.

Parameters
nameThe name of the language module to check.
requiredVersionOptional required version of the language module.
minimumIf true, checks if the loaded version meets or exceeds the required version.
Returns
True if the language module is loaded and meets the version requirements, false otherwise.

◆ IsPluginLoaded()

bool plugify::IPlugifyProvider::IsPluginLoaded ( std::string_view  name,
std::optional< plg::version requiredVersion = {},
bool  minimum = false 
) const
noexcept

Checks if a plugin with the specified name is loaded.

This function checks if a plugin with the specified name is currently loaded. Optionally, you can specify a required version and set the minimum parameter to true to check if the loaded version meets or exceeds the required version.

Parameters
nameThe name of the plugin to check.
requiredVersionOptional required version of the plugin.
minimumIf true, checks if the loaded version meets or exceeds the required version.
Returns
True if the plugin is loaded and meets the version requirements, false otherwise.

◆ IsPreferOwnSymbols()

bool plugify::IPlugifyProvider::IsPreferOwnSymbols ( ) const
noexcept

Checks if the preference for using own symbols is enabled.

This function returns whether the preference for loading symbols from the library itself (as opposed to shared libraries) is enabled. This can be useful in environments where symbol conflicts might arise and isolating symbols to their respective libraries is necessary.

Note
Start using RTLD_DEEPBIND flag by default.
Returns
True if the preference for using own symbols is enabled, false otherwise.

◆ Log()

void plugify::IPlugifyProvider::Log ( std::string_view  msg,
Severity  severity 
) const

Log a message with a specified severity level.

Parameters
msgThe message to log.
severityThe severity level of the log message.

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