JenovaSDK API Reference
Developed by Hamid.Memar (MemarDesign™ LLC.)
 
Loading...
Searching...
No Matches
Global Memory Utilities (Anzen)

Functions

NativePtr GetGlobalPointer (MemoryID id)
 Gets a pointer from cross-reload global memory map.
 
NativePtr SetGlobalPointer (MemoryID id, NativePtr ptr)
 Sets a pointer in cross-reload global memory map.
If the memory ID already exists in the global memory map, the old pointer is replaced with the new one.
 
void DeleteGlobalPointer (MemoryID id)
 Deletes a pointer from cross-reload global memory map.
 
NativePtr AllocateGlobalMemory (MemoryID id, size_t size)
 Allocates and registers a memory block in cross-reload global memory map using a Unique ID.
 
void FreeGlobalMemory (MemoryID id)
 Frees and unregisters a memory block from cross-reload global memory map using its Unique ID.
 
godot::Variant GetGlobalVariable (VariableID id)
 Retrieves a cross-reload global variable as Variant using its Unique ID.
 
void SetGlobalVariable (VariableID id, godot::Variant var)
 Stores a Variant as cross-reload global variable using a Unique ID.
 
void ClearGlobalVariables ()
 Flushes all registered cross-reload global variables.
 

Detailed Description

This collection provides a set of functions for managing cross-reload global memory and variables, including pointer retrieval, setting and deletion, as well as memory allocation and deallocation.
đź“– Learn More about Global Memory/Variables

Function Documentation

◆ GetGlobalPointer()

NativePtr GetGlobalPointer ( MemoryID id)

Gets a pointer from cross-reload global memory map.

Parameters
idThe memory Unique ID to get the pointer of.
Returns
The retrived global pointer from global memory storage, nullptr if doesn't exist.

◆ SetGlobalPointer()

NativePtr SetGlobalPointer ( MemoryID id,
NativePtr ptr )

Sets a pointer in cross-reload global memory map.
If the memory ID already exists in the global memory map, the old pointer is replaced with the new one.

Parameters
idThe memory Unique ID to set the pointer of.
ptrThe pointer to set.
Returns
The old pointer associated with the memory Unique ID or the new pointer if the memory Unique ID was not previously mapped.

◆ DeleteGlobalPointer()

void DeleteGlobalPointer ( MemoryID id)

Deletes a pointer from cross-reload global memory map.

Parameters
idThe memory Unique ID to delete the pointer of.

◆ AllocateGlobalMemory()

NativePtr AllocateGlobalMemory ( MemoryID id,
size_t size )

Allocates and registers a memory block in cross-reload global memory map using a Unique ID.

Parameters
idThe memory Unique ID for block registration.
sizeThe size of the memory to allocate in bytes.
Returns
Address of the allocated global memory.

◆ FreeGlobalMemory()

void FreeGlobalMemory ( MemoryID id)

Frees and unregisters a memory block from cross-reload global memory map using its Unique ID.

Parameters
idThe memory Unique ID for block release and unregistration.

◆ GetGlobalVariable()

godot::Variant GetGlobalVariable ( VariableID id)

Retrieves a cross-reload global variable as Variant using its Unique ID.

Parameters
idThe Unique ID of the variable to be retrieved.
Returns
The retrieved global variable, Variant::NIL if variable doesn't exist.

◆ SetGlobalVariable()

void SetGlobalVariable ( VariableID id,
godot::Variant var )

Stores a Variant as cross-reload global variable using a Unique ID.

Parameters
idThe Unique ID for the variable to be stored.
varThe Variant to store as global variable.

◆ ClearGlobalVariables()

void ClearGlobalVariables ( )

Flushes all registered cross-reload global variables.