LeviLamina
Loading...
Searching...
No Matches
DeferredTask.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5namespace Core {
6
7class DeferredTask {
8public:
9 // DeferredTask inner types define
10 enum class State : int {
11 Ready = 0,
12 Executing = 1,
13 Done = 2,
14 };
15
16public:
17 // member variables
18 // NOLINTBEGIN
24 // NOLINTEND
25
26public:
27 // prevent constructor by default
28 DeferredTask& operator=(DeferredTask const&);
29 DeferredTask(DeferredTask const&);
30 DeferredTask();
31
32public:
33 // member functions
34 // NOLINTBEGIN
35#ifdef LL_PLAT_C
36 MCNAPI DeferredTask(::std::function<void()> const& callback, bool canSkipExecution);
37
38 MCNAPI bool isDone();
39
40 MCNAPI bool tryExecute();
41
42 MCNAPI bool wait(::std::chrono::nanoseconds const& duration) const;
43
44 MCNAPI ~DeferredTask();
45#endif
46 // NOLINTEND
47
48public:
49 // constructor thunks
50 // NOLINTBEGIN
51#ifdef LL_PLAT_C
52 MCNAPI void* $ctor(::std::function<void()> const& callback, bool canSkipExecution);
53#endif
54 // NOLINTEND
55
56public:
57 // destructor thunk
58 // NOLINTBEGIN
59#ifdef LL_PLAT_C
60 MCNAPI void $dtor();
61#endif
62 // NOLINTEND
63};
64
65} // namespace Core
Definition Alias.h:14