EstervQrCode 1.1.1
Library for qr code manipulation
async_promise.hpp
1 // This file is part of OpenCV project.
2 // It is subject to the license terms in the LICENSE file found in the top-level directory
3 // of this distribution and at http://opencv.org/license.html.
4 
5 #ifndef OPENCV_CORE_ASYNC_PROMISE_HPP
6 #define OPENCV_CORE_ASYNC_PROMISE_HPP
7 
8 #include "../async.hpp"
9 
10 #include "exception_ptr.hpp"
11 
12 namespace cv {
13 
23 {
24 public:
28  AsyncPromise& operator=(const AsyncPromise& o) CV_NOEXCEPT;
29  void release() CV_NOEXCEPT;
30 
34  AsyncArray getArrayResult();
35 
39  void setValue(InputArray value);
40 
41  // TODO "move" setters
42 
43 #if CV__EXCEPTION_PTR
48 #endif
49 
53  void setException(const cv::Exception& exception);
54 
55  explicit AsyncPromise(AsyncPromise&& o) { p = o.p; o.p = NULL; }
56  AsyncPromise& operator=(AsyncPromise&& o) CV_NOEXCEPT { std::swap(p, o.p); return *this; }
57 
58 
59  // PImpl
60  typedef struct AsyncArray::Impl Impl; friend struct AsyncArray::Impl;
61  inline void* _getImpl() const CV_NOEXCEPT { return p; }
62 protected:
63  Impl* p;
64 };
65 
66 
68 } // namespace
69 #endif // OPENCV_CORE_ASYNC_PROMISE_HPP
Returns result of asynchronous operations.
Definition: async.hpp:30
friend struct Impl
Definition: async.hpp:92
Provides result of asynchronous operations.
Definition: async_promise.hpp:23
void setException(const cv::Exception &exception)
void setException(std::exception_ptr exception)
struct AsyncArray::Impl Impl
Definition: async_promise.hpp:60
void * _getImpl() const CV_NOEXCEPT
Definition: async_promise.hpp:61
~AsyncPromise() CV_NOEXCEPT
Impl * p
Definition: async_promise.hpp:63
AsyncPromise(AsyncPromise &&o)
Definition: async_promise.hpp:55
Class passed to an error.
Definition: core.hpp:115
CV__DEBUG_NS_END typedef const _InputArray & InputArray
Definition: mat.hpp:442
int CvScalar value
Definition: core_c.h:720
#define CV_EXPORTS
Definition: cvdef.h:435
#define CV_NOEXCEPT
Definition: cvdef.h:800
"black box" representation of the file storage associated with a file on disk.
Definition: calib3d.hpp:441
T swap(T... args)