blob: 2ccb3e0833f4f307c0fd285f7b03e14bd32310d4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
#pragma once
#include "Runtime/Threads/Mutex.h"
#include "Runtime/Threads/AtomicRefCounter.h"
#include "Runtime/BaseClasses/BaseObject.h"
class AsyncOperation
{
typedef void DelayedCall(Object* o, void* userData);
typedef void CleanupUserData (void* userData);
AtomicRefCounter m_RefCount;
DelayedCall* m_CoroutineDone;
CleanupUserData* m_CoroutineCleanup;
void* m_CoroutineData;
PPtr<Object> m_CoroutineBehaviour;
public:
AsyncOperation () { m_CoroutineDone = NULL; }
virtual ~AsyncOperation ();
virtual bool IsDone () = 0;
virtual float GetProgress () = 0;
virtual int GetPriority () { return 0; }
virtual void SetPriority (int priority) { }
virtual bool GetAllowSceneActivation () { return true; }
virtual void SetAllowSceneActivation (bool allow) { }
void Retain ();
void Release ();
bool HasCoroutineCallback () { return m_CoroutineDone != NULL; }
void SetCoroutineCallback ( DelayedCall* func, Object* coroutineBehaviour, void* userData, CleanupUserData* cleanup);
void InvokeCoroutine ();
void CleanupCoroutine ();
};
|