-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathScheduledFuture.h
More file actions
64 lines (51 loc) · 1.46 KB
/
Copy pathScheduledFuture.h
File metadata and controls
64 lines (51 loc) · 1.46 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#pragma once
#include "BaseLib/CommonDefines.h"
#include "BaseLib/Templates/FutureRunnable.h"
#include "BaseLib/Templates/MethodInterfaces.h"
#include "BaseLib/Templates/Lifecycle.h"
namespace BaseLib { namespace Templates
{
class ScheduledFutureCallbacks
: public FutureCallbacks
{
public:
virtual ~ScheduledFutureCallbacks() {}
virtual void OnTimeoutDo(std::function<void ()>) = 0;
};
class ScheduledRunnableFuture
: public RunnableFuture
, public IsReadyMethod
, public IsExecutingMethod
, public IsTimeoutMethod
, public TriggerMethod
, public SuspendMethod
, public ResumeMethod
, public IsSuspendedMethod
, public ReadyInMethod<Duration>
, public TimeoutInMethod<Duration>
, public DetachMethod<bool>
, public IsAttachedMethod
{
public:
virtual ~ScheduledRunnableFuture() {}
CLASS_TRAITS(ScheduledRunnableFuture)
};
template <typename Policy>
class ScheduledRunnablePolicyFuture
: public ScheduledRunnableFuture
, public PolicyMethod<Policy>
{
public:
virtual ~ScheduledRunnablePolicyFuture() {}
CLASS_TRAITS(ScheduledRunnablePolicyFuture)
};
template <typename Return, typename Policy>
class ScheduledFutureResult
: public ScheduledRunnablePolicyFuture<Policy>
, public ResultMethod1<std::pair<Status::FutureStatus, Return>, int64>
{
public:
virtual ~ScheduledFutureResult() {}
CLASS_TRAITS(ScheduledFutureResult)
};
}}