using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
namespace BansheeEngine
{
///
/// Object you may use to check on the results of an asynchronous operation. Contains uninitialized data until IsComplete
/// returns true.
///
[ShowInInspector]
public partial class AsyncOp : ScriptObject
{
private AsyncOp(bool __dummy0) { }
protected AsyncOp() { }
/// Returns true if the async operation has completed.
[ShowInInspector]
[NativeWrapper]
public bool IsComplete
{
get { return Internal_isComplete(mCachedPtr); }
}
/// Retrieves the value returned by the async operation. Only valid if IsComplete returns true.
[ShowInInspector]
[NativeWrapper]
public object ReturnValue
{
get { return Internal_getReturnValue(mCachedPtr); }
}
/// Blocks the caller thread until the AsyncOp completes.
public void BlockUntilComplete()
{
Internal_blockUntilComplete(mCachedPtr);
}
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern bool Internal_isComplete(IntPtr thisPtr);
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern object Internal_getReturnValue(IntPtr thisPtr);
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern void Internal_blockUntilComplete(IntPtr thisPtr);
}
}