|
|
| AZ_CLASS_ALLOCATOR (ScriptContext, AZ::SystemAllocator) |
| |
|
| ScriptContext (ScriptContextId id=ScriptContextIds::DefaultScriptContextId, IAllocator *allocator=nullptr, lua_State *nativeContext=nullptr) |
| |
|
void | BindTo (BehaviorContext *behaviorContext) |
| | Bind LUA context (VM) a specific behaviorContext.
|
| |
|
BehaviorContext * | GetBoundContext () const |
| |
|
ScriptContextId | GetId () const |
| |
|
bool | Execute (const char *script=nullptr, const char *dbgName=nullptr, size_t dataSize=0) |
| | execute all script loaded though load function, plus the one you supply as string
|
| |
| bool | LoadFromStream (IO::GenericStream *stream, const char *debugName, const char *mode, lua_State *thread=nullptr) |
| |
|
void | GarbageCollect () |
| | Perform a full garbage collect step, this can be slow prefer GargabeCollectStep for runtime garbage collect.
|
| |
|
size_t | GetMemoryUsage () const |
| | Return the amount of memory used, in bytes.
|
| |
| void | GarbageCollectStep (int numberOfSteps=2) |
| |
|
lua_State * | NativeContext () |
| |
|
bool | ExistsGlobal (const char *name) |
| |
|
bool | FindGlobal (const char *name, ScriptDataContext &dc) |
| |
|
bool | FindGlobal (int cachedIndex, ScriptDataContext &dc) |
| |
|
template<class T > |
| bool | ReadGlobal (const char *name, T &value) |
| |
|
template<class T > |
| bool | ReadGlobal (int cacheIndex, T &value) |
| |
|
template<class T > |
| void | AddReplaceGlobal (const char *name, const T &value) |
| |
|
void | RemoveGlobal (const char *name) |
| |
|
template<class T > |
| void | AddReplace (int cacheIndex, const T &value) |
| |
|
int | CacheGlobal (const char *name) |
| |
|
void | ReleaseCached (int cacheIndex) |
| | Release any cached resource (global or local)
|
| |
|
bool | Call (const char *functionName, ScriptDataContext &dc) |
| |
|
bool | CallCached (int cachedIndex, ScriptDataContext &dc) |
| |
|
bool | InspectTable (const char *tableName, ScriptDataContext &dc) |
| |
|
bool | InspectTableCached (int cachedIndex, ScriptDataContext &dc) |
| |
|
bool | ReadStack (ScriptDataContext &dc) |
| |
|
void | EnableDebug () |
| | Creates debug context (you can obtain vie GetDebugContext()). Depending on the implementation this can require more memory.
|
| |
|
void | DisableDebug () |
| | Destroys debug context.
|
| |
|
ScriptContextDebug * | GetDebugContext () |
| |
| void | DebugSetOwnerThread (AZStd::thread::id ownerThreadId) |
| |
| bool | DebugIsCallingThreadTheOwner () const |
| |
|
void | SetErrorHook (ErrorHook cb) |
| |
|
ErrorHook | GetErrorHook () const |
| |
|
void | Error (ErrorType error, bool doStackTrace, const char *format,...) |
| |
| void | SetRequireHook (RequireHook hook) |
| |
|
AZ::ScriptProperty * | ConstructScriptProperty (ScriptDataContext &dc, int valueIndex, const char *name=nullptr, bool restrictToPropertyArrays=false) |
| |