FCT
载入中...
搜索中...
未找到
Computation.h
浏览该文件的文档.
1
//
2
// Created by Administrator on 2025/3/16.
3
//
4
#include "
../ThirdParty.h
"
5
#ifndef FCT_COMPUTATION_H
6
#define FCT_COMPUTATION_H
7
template
<
typename
T>
8
class
Computation
{
9
private
:
10
std::future<T>
m_future
;
11
T
m_value
;
12
bool
m_isFuture
;
13
public
:
14
Computation
(std::future<T>&& future) {
15
m_future
= future;
16
m_isFuture
=
true
;
17
}
18
Computation
(T value) {
19
m_value
= value;
20
m_isFuture
=
false
;
21
}
22
T
get
() {
23
if
(
m_isFuture
) {
24
return
m_future
;
25
}
26
return
m_value
;
27
}
28
};
29
#endif
//FCT_COMPUTATION_H
ThirdParty.h
Computation::Computation
Computation(std::future< T > &&future)
定义
Computation.h:14
Computation::get
T get()
定义
Computation.h:22
Computation::Computation
Computation(T value)
定义
Computation.h:18
Computation::m_future
std::future< T > m_future
定义
Computation.h:10
Computation::m_isFuture
bool m_isFuture
定义
Computation.h:12
Computation::m_value
T m_value
定义
Computation.h:11
src
MutilThreadBase
Computation.h
制作者
1.14.0