00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef _DECAF_UTIL_CONCURRENT_FUTURE_H_
00019 #define _DECAF_UTIL_CONCURRENT_FUTURE_H_
00020
00021 #include <decaf/util/Config.h>
00022
00023 #include <decaf/util/concurrent/TimeUnit.h>
00024
00025 namespace decaf {
00026 namespace util {
00027 namespace concurrent {
00028
00029 class DECAF_API FutureType {
00030 public:
00031
00032 virtual ~FutureType() {}
00033
00054 virtual bool cancel(bool mayInterruptIfRunning) = 0;
00055
00060 virtual bool isCancelled() const = 0;
00061
00068 virtual bool isDone() const = 0;
00069
00070 };
00071
00087 template<typename V>
00088 class Future : public FutureType {
00089 public:
00090
00091 virtual ~Future() {}
00092
00102 virtual V get() = 0;
00103
00120 virtual V get(long long timeout, const TimeUnit& unit) = 0;
00121
00122 };
00123
00124 }}}
00125
00126 #endif