CommonLibVR
GFxTask.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "RE/G/GRefCountBase.h"
4 #include "RE/G/GStats.h"
5 
6 namespace RE
7 {
8  class GFxTask : public GRefCountBase<GFxTask, GStatGroups::kGStat_Default_Mem>
9  {
10  public:
11  enum class TaskId
12  {
13  kType_Computation = 0x00010000,
14  kType_IO = 0x00020000,
15  kType_Mask = 0x00FF0000,
16 
21  kMovieBind = kType_IO | 3,
22  };
23 
24  enum class TaskState
25  {
26  kIdle,
27  kPending,
28  kRunning,
29  kAbandoned,
30  kFinished,
31  };
32 
34  thisTaskId(a_id),
36  {}
37 
38  ~GFxTask() override // 00
39  {}
40 
41  // add
42  virtual void Execute() = 0; // 01
43 
44  virtual void OnAbandon([[maybe_unused]] bool a_started) // 02
45  {}
46 
47  inline TaskId GetTaskId() const
48  {
49  return thisTaskId;
50  }
51 
52  inline TaskId GetTaskType() const
53  {
54  return static_cast<TaskId>(std::to_underlying(thisTaskId) & std::to_underlying(TaskId::kType_Mask));
55  }
56 
57  inline TaskState GetTaskState() const
58  {
59  return currentState;
60  }
61 
62  // members
64  volatile TaskState currentState; // 14
65  private:
66  KEEP_FOR_RE()
67  };
68  static_assert(sizeof(GFxTask) == 0x18);
69 }
#define KEEP_FOR_RE()
Definition: PCH.h:713
Definition: GFxTask.h:9
TaskState
Definition: GFxTask.h:25
TaskId GetTaskId() const
Definition: GFxTask.h:47
virtual void OnAbandon([[maybe_unused]] bool a_started)
Definition: GFxTask.h:44
TaskId GetTaskType() const
Definition: GFxTask.h:52
GFxTask(TaskId a_id=TaskId::kUnknown)
Definition: GFxTask.h:33
TaskId thisTaskId
Definition: GFxTask.h:63
TaskState GetTaskState() const
Definition: GFxTask.h:57
TaskId
Definition: GFxTask.h:12
~GFxTask() override
Definition: GFxTask.h:38
virtual void Execute()=0
volatile TaskState currentState
Definition: GFxTask.h:64
Definition: GRefCountBase.h:12
Definition: AbsorbEffect.h:6
@ kIdle
Definition: PlayerCharacter.h:87