IceShard 1
A personal game engine project, with development focused on 2D/2.5D games.
Loading...
Searching...
No Matches
ice::ModuleRegister Class Referenceabstract

Type to manage loading and unloading of modules and their APIs. More...

#include <ice/module_register.hxx>

Inheritance diagram for ice::ModuleRegister:
ice::ModuleQuery

Public Member Functions

virtual ~ModuleRegister () noexcept=default
virtual bool load_module (ice::Allocator &alloc, ice::String path) noexcept=0
 Loads a module from a given path.
virtual bool load_module (ice::Allocator &alloc, ice::FnModuleLoad *load_fn, ice::FnModuleUnload *unload_fn, bool from_shared_library) noexcept=0
 Loads a module using explicit load and unload functions. This is a less preferred way of loading modules, use load_module<T>(ice::Allocator&) instead.
virtual bool load_module (ice::Allocator &alloc, ice::ModuleInfo const &module_info) noexcept
 Loads a module using a module info structure.
template<typename T>
requires (ice::concepts::ModuleType<T> || ice::concepts::ModuleLoadable<T>)
bool load_module (ice::Allocator &alloc) noexcept
 Loads a module using a module type. This is the preferred way of loading modules implicitly.
Public Member Functions inherited from ice::ModuleQuery
virtual ~ModuleQuery () noexcept=default
virtual bool query_api (ice::StringID_Arg api_name, ice::u32 version, ice::ModuleAPI &out_api) const noexcept
 Queries an API info for the given name and version.
virtual bool query_apis (ice::StringID_Arg api_name, ice::u32 version, ice::ModuleAPI *out_array, ice::u32 *inout_array_size) const noexcept=0
 Queries all API infos for the given name and version.
template<typename Type>
requires (ice::concepts::APIType<Type>)
bool query_api (Type &api_struct) const noexcept
 Queries a single API for the given API struct.
template<typename Type>
requires (ice::concepts::APIType<Type>)
bool query_apis (ice::Array< Type > &out_apis) const noexcept
 Queries all APIs for the given API struct.

Detailed Description

Type to manage loading and unloading of modules and their APIs.

Constructor & Destructor Documentation

◆ ~ModuleRegister()

virtual ice::ModuleRegister::~ModuleRegister ( )
virtualdefaultnoexcept

Member Function Documentation

◆ load_module() [1/4]

template<typename T>
requires (ice::concepts::ModuleType<T> || ice::concepts::ModuleLoadable<T>)
bool ice::ModuleRegister::load_module ( ice::Allocator & alloc)
inlinenoexcept

Loads a module using a module type. This is the preferred way of loading modules implicitly.

◆ load_module() [2/4]

virtual bool ice::ModuleRegister::load_module ( ice::Allocator & alloc,
ice::FnModuleLoad * load_fn,
ice::FnModuleUnload * unload_fn,
bool from_shared_library )
pure virtualnoexcept

Loads a module using explicit load and unload functions. This is a less preferred way of loading modules, use load_module<T>(ice::Allocator&) instead.

Parameters
[in]allocThe allocator to use for the module.
[in]load_fnThe function to call when loading the module.
[in]unload_fnThe function to call when unloading the module.

◆ load_module() [3/4]

virtual bool ice::ModuleRegister::load_module ( ice::Allocator & alloc,
ice::ModuleInfo const & module_info )
inlinevirtualnoexcept

Loads a module using a module info structure.

◆ load_module() [4/4]

virtual bool ice::ModuleRegister::load_module ( ice::Allocator & alloc,
ice::String path )
pure virtualnoexcept

Loads a module from a given path.

Note
This path needs to be a valid .dll, .so or .dylib file depending on the platform.
Parameters
[in]allocThe allocator to use for the module.
[in]pathThe path to the module file.

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