Search Results for

    Show / Hide Table of Contents

    Class MainThreadManagedInvokeAction

    Helper class for easy invoking managed code on main thread before all game systems update.

    Inheritance
    Object
    Task
    MainThreadTask
    MainThreadManagedInvokeAction
    Inherited Members
    Task::_cancelFlag
    Task::_continueWith
    Task::_state
    Task::Cancel()
    Task::CancelAll(Array<T* , AllocationType>& tasks)
    Task::ContinueWith(Task* task)
    Task::ContinueWith(const Action& action, Object* target=nullptr)
    Task::ContinueWith(const Function<void()>& action, Object* target=nullptr)
    Task::ContinueWith(const Function<bool()>& action, Object* target=nullptr)
    Object::DeleteObject(float timeToLive = 0.0f, bool useGameTime=false)
    Object::DeleteObjectNow()
    MainThreadTask::Enqueue()
    Task::Execute()
    Object::Flags
    Task::GetContinueWithTask()
    Task::GetState()
    Task::HasReference(Object* obj)
    MainThreadTask::InitialDelay
    Task::IsCanceled()
    Task::IsCancelRequested()
    Task::IsEnded()
    Task::IsFailed()
    Task::IsFinished()
    Task::IsQueued()
    Task::IsRunning()
    NonCopyable::NonCopyable()
    NonCopyable::NonCopyable(const NonCopyable& )
    Task::OnCancel()
    Object::OnDeleteObject()
    Task::OnEnd()
    Task::OnFail()
    Task::OnFinish()
    Task::OnStart()
    NonCopyable::operator=(const NonCopyable& )
    Task::SetState(TaskState state)
    Task::Start()
    Task::StartNew(Task* task)
    Task::StartNew(const Function<void()>& action, Object* target=nullptr)
    Task::StartNew(Function<void()>::Signature action, Object* target=nullptr)
    Task::StartNew(T* callee)
    Task::StartNew(const Function<bool()>& action, Object* target=nullptr)
    Task::StartNew(Function<bool()>::Signature& action, Object* target=nullptr)
    MainThreadTask::ToString()
    Task::Wait(const TimeSpan& timeout)
    Task::Wait(double timeoutMilliseconds=-1)
    Task::WaitAll(const Span<Task* >& tasks, double timeoutMilliseconds=-1)
    Task::WaitAll(const Array<T* , AllocationType>& tasks, double timeoutMilliseconds=-1)
    Object::~Object()
    Assembly: FlaxEngine.dll
    File: Engine/Scripting/Internal/MainThreadManagedInvokeAction.h
    Syntax
    public class MainThreadManagedInvokeAction : public MainThreadTask

    Constructors

    MainThreadManagedInvokeAction(MObject* instance, MMethod* method, LogType exceptionLevel)

    Declaration
    public MainThreadManagedInvokeAction(MObject* instance, MMethod* method, LogType exceptionLevel)
    Parameters
    MObject instance

    MMethod method

    LogType exceptionLevel

    MainThreadManagedInvokeAction(MObject* instance, MMethod* method, LogType exceptionLevel, const ParamsBuilder& params)

    Declaration
    public MainThreadManagedInvokeAction(MObject* instance, MMethod* method, LogType exceptionLevel, const ParamsBuilder& params)
    Parameters
    MObject instance

    MMethod method

    LogType exceptionLevel

    ParamsBuilder params

    MainThreadManagedInvokeAction(void* methodThunk, LogType exceptionLevel, const ParamsBuilder& params)

    Declaration
    public MainThreadManagedInvokeAction(void* methodThunk, LogType exceptionLevel, const ParamsBuilder& params)
    Parameters
    void methodThunk

    LogType exceptionLevel

    ParamsBuilder params

    Methods

    Invoke(MMethod* method, MObject* instance=nullptr, LogType exceptionLevel=LogType::Error)

    Starts the new task or invokes this action now if already running on a main thread.

    Declaration
    public static MainThreadManagedInvokeAction* Invoke(MMethod* method, MObject* instance=nullptr, LogType exceptionLevel=LogType::Error)
    Parameters
    MMethod method

    The managed method.

    MObject instance

    The managed instance object.

    LogType exceptionLevel

    The exception logging error level.

    Returns
    MainThreadManagedInvokeAction

    The created task.

    Invoke(MMethod* method, ParamsBuilder& params, MObject* instance=nullptr, LogType exceptionLevel=LogType::Error)

    Starts the new task or invokes this action now if already running on a main thread.

    Declaration
    public static MainThreadManagedInvokeAction* Invoke(MMethod* method, ParamsBuilder& params, MObject* instance=nullptr, LogType exceptionLevel=LogType::Error)
    Parameters
    MMethod method

    The managed method.

    ParamsBuilder params

    The method parameters.

    MObject instance

    The managed instance object.

    LogType exceptionLevel

    The exception logging error level.

    Returns
    MainThreadManagedInvokeAction

    The created task.

    Invoke(void* methodThunk, ParamsBuilder& params, LogType exceptionLevel=LogType::Error)

    Starts the new task or invokes this action now if already running on a main thread.

    Declaration
    public static MainThreadManagedInvokeAction* Invoke(void* methodThunk, ParamsBuilder& params, LogType exceptionLevel=LogType::Error)
    Parameters
    void methodThunk

    The managed method thunk (must return void and has up to 4 parameters).

    ParamsBuilder params

    The method parameters.

    LogType exceptionLevel

    The exception logging error level.

    Returns
    MainThreadManagedInvokeAction

    The created task.

    InvokeNow(MMethod* method, ParamsBuilder& params, MObject* instance=nullptr, LogType exceptionLevel=LogType::Error)

    Invokes action now.

    Declaration
    public static void InvokeNow(MMethod* method, ParamsBuilder& params, MObject* instance=nullptr, LogType exceptionLevel=LogType::Error)
    Parameters
    MMethod method

    The managed method.

    ParamsBuilder params

    The method parameters.

    MObject instance

    The managed instance object.

    LogType exceptionLevel

    The exception logging error level.

    Run()

    Runs the task specified operations. It does not handle any task related logic, but only performs the actual job.

    Declaration
    protected virtual bool Run() override
    Returns
    bool

    The task execution result. Returns true if failed, otherwise false.

    Overrides
    Task::Run()

    See Also

    MainThreadTask
    • Improve this Doc
    • View Source
    In This Article
    Back to top Copyright © 2012-2024 Wojciech Figat