Open 3D Engine AzCore API Reference 23.10.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
AZ::ScriptSystemRequests Class Referenceabstract

#include <ScriptSystemBus.h>

Inherits AZ::EBusTraits.

Public Types

using MutexType = AZStd::recursive_mutex
 
- Public Types inherited from AZ::EBusTraits
using AllocatorType = AZ::Internal::EBusEnvironmentAllocator
 
using BusIdType = NullBusId
 
using BusIdOrderCompare = NullBusIdCompare
 
using BusHandlerOrderCompare = BusHandlerCompareDefault
 
using MutexType = NullMutex
 
using EventQueueMutexType = NullMutex
 
template<class Bus >
using ConnectionPolicy = EBusConnectionPolicy< Bus >
 
template<class Context >
using StoragePolicy = EBusEnvironmentStoragePolicy< Context >
 
template<class Bus >
using RouterPolicy = EBusRouterPolicy< Bus >
 
using EventProcessingPolicy = EBusEventProcessingPolicy
 
template<typename DispatchMutex , bool IsLocklessDispatch>
using DispatchLockGuard = AZStd::conditional_t< IsLocklessDispatch, AZ::Internal::NullLockGuard< DispatchMutex >, AZStd::scoped_lock< DispatchMutex > >
 
template<typename ContextMutex >
using ConnectLockGuard = AZStd::conditional_t< AZStd::is_same_v< ContextMutex, AZ::NullMutex >, AZ::Internal::NullLockGuard< ContextMutex >, AZStd::unique_lock< ContextMutex > >
 
template<typename ContextMutex >
using BindLockGuard = AZStd::scoped_lock< ContextMutex >
 
template<typename ContextMutex >
using CallstackTrackerLockGuard = AZStd::conditional_t< AZStd::is_same_v< ContextMutex, AZ::NullMutex >, AZ::Internal::NullLockGuard< ContextMutex >, AZStd::unique_lock< ContextMutex > >
 

Public Member Functions

virtual ScriptContextAddContext (ScriptContext *context, int garbageCollectorStep)=0
 
virtual ScriptContextAddContextWithId (ScriptContextId id)=0
 Add a context with an ID, the system will handle the ownership of the context (delete it when removed and the system deactivates)
 
virtual bool RemoveContext (ScriptContext *context)=0
 Removes a script context (without calling delete on it)
 
virtual bool RemoveContextWithId (ScriptContextId id)=0
 Removes and deletes a script context.
 
virtual ScriptContextGetContext (ScriptContextId id)=0
 Returns the script context that has been registered with the app, if there is one.
 
virtual void GarbageCollect ()=0
 Full GC will be performed.
 
virtual void GarbageCollectStep (int numberOfSteps)=0
 Step GC.
 
virtual bool Load (const Data::Asset< ScriptAsset > &asset, const char *mode, ScriptContextId id)=0
 
virtual ScriptLoadResult LoadAndGetNativeContext (const Data::Asset< ScriptAsset > &asset, const char *mode, ScriptContextId id)=0
 
virtual void ClearAssetReferences (Data::AssetId assetBaseId)=0
 
virtual void RestoreDefaultRequireHook (ScriptContextId id)=0
 
virtual void UseInMemoryRequireHook (const InMemoryScriptModules &modules, ScriptContextId id)=0
 

Static Public Attributes

static const AZ::EBusHandlerPolicy HandlerPolicy = EBusHandlerPolicy::Single
 
- Static Public Attributes inherited from AZ::EBusTraits
static constexpr EBusHandlerPolicy HandlerPolicy = EBusHandlerPolicy::Multiple
 
static constexpr EBusAddressPolicy AddressPolicy = EBusAddressPolicy::Single
 
static constexpr bool EnableEventQueue = false
 
static constexpr bool EventQueueingActiveByDefault = true
 
static constexpr bool EnableQueuedReferences = false
 
static constexpr bool LocklessDispatch = false
 

Additional Inherited Members

- Protected Member Functions inherited from AZ::EBusTraits
 ~EBusTraits ()=default
 

Detailed Description

Event for communication with the component main application. There can be only one application at a time. This is why this but is set to support only one client/listener.

Member Function Documentation

◆ AddContext()

virtual ScriptContext * AZ::ScriptSystemRequests::AddContext ( ScriptContext context,
int  garbageCollectorStep 
)
pure virtual

Add a context with based on user created context, the system will not delete such context.

Parameters
garbageCollectorStepyou can pass -1 to use the internal system default step, otherwise you can use any value >=1

◆ ClearAssetReferences()

virtual void AZ::ScriptSystemRequests::ClearAssetReferences ( Data::AssetId  assetBaseId)
pure virtual

Clear the script asset cached in ScriptSystemComponent.

◆ Load()

virtual bool AZ::ScriptSystemRequests::Load ( const Data::Asset< ScriptAsset > &  asset,
const char *  mode,
ScriptContextId  id 
)
pure virtual

Load script asset into the a context. If the load succeeds, the script table will be on top of the stack

Parameters
assetscript asset
idthe id of the context to load the script in
Returns
whether or not the asset load succeeded

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