Finality Engine
Loading...
Searching...
No Matches
FINALITY::ScriptModule Class Reference

Loads and replaces native script libraries with ABI validation. More...

#include <ScriptModule.h>

Public Member Functions

 ScriptModule ()
 ~ScriptModule ()
 ScriptModule (const ScriptModule &)=delete
ScriptModule & operator= (const ScriptModule &)=delete
bool Load (const std::filesystem::path &library, const std::filesystem::path &shadowDirectory, Scene *scene, std::string &error)
 Validates and loads a compiled native script module.
void Unload ()
bool IsLoaded () const
uint64_t GetGeneration () const

Detailed Description

Loads and replaces native script libraries with ABI validation.

The module loads a shadow copy, validates its ABI and registers definitions against the engine. Definitions and instances retain a module lease so native code stays mapped while it is still referenced.

Usage
Build GameScripts.dll against the matching engine toolchain and headers. Load reports diagnostics through its error argument. A failed reload must not discard the previous working implementation.

Definition at line 48 of file ScriptModule.h.

Constructor & Destructor Documentation

◆ ScriptModule() [1/2]

FINALITY::ScriptModule::ScriptModule ( )

◆ ~ScriptModule()

FINALITY::ScriptModule::~ScriptModule ( )

◆ ScriptModule() [2/2]

FINALITY::ScriptModule::ScriptModule ( const ScriptModule & )
delete

Member Function Documentation

◆ operator=()

ScriptModule & FINALITY::ScriptModule::operator= ( const ScriptModule & )
delete

◆ Load()

bool FINALITY::ScriptModule::Load ( const std::filesystem::path & library,
const std::filesystem::path & shadowDirectory,
Scene * scene,
std::string & error )

Validates and loads a compiled native script module.

Parameters
libraryCompiled module built against the matching engine ABI.
shadowDirectoryWritable directory for unique loaded library copies.
sceneScene whose attached instances participate in replacement; may be null.
errorReceives a diagnostic when loading or registration fails.
Returns
True when the new module is accepted. Definitions and instances retain module leases so replacement does not unload code while surviving objects still need it. Failed loading preserves the prior module.

◆ Unload()

void FINALITY::ScriptModule::Unload ( )

◆ IsLoaded()

bool FINALITY::ScriptModule::IsLoaded ( ) const

◆ GetGeneration()

uint64_t FINALITY::ScriptModule::GetGeneration ( ) const

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