mirror of
https://gitcode.com/gh_mirrors/es/esp32-opencv.git
synced 2025-08-06 18:24:38 +08:00
initial commit
This commit is contained in:
71
esp32/lib/opencv/opencv2/core/detail/async_promise.hpp
Normal file
71
esp32/lib/opencv/opencv2/core/detail/async_promise.hpp
Normal file
@ -0,0 +1,71 @@
|
||||
// This file is part of OpenCV project.
|
||||
// It is subject to the license terms in the LICENSE file found in the top-level directory
|
||||
// of this distribution and at http://opencv.org/license.html.
|
||||
|
||||
#ifndef OPENCV_CORE_ASYNC_PROMISE_HPP
|
||||
#define OPENCV_CORE_ASYNC_PROMISE_HPP
|
||||
|
||||
#include "../async.hpp"
|
||||
|
||||
#include "exception_ptr.hpp"
|
||||
|
||||
namespace cv {
|
||||
|
||||
/** @addtogroup core_async
|
||||
@{
|
||||
*/
|
||||
|
||||
|
||||
/** @brief Provides result of asynchronous operations
|
||||
|
||||
*/
|
||||
class CV_EXPORTS AsyncPromise
|
||||
{
|
||||
public:
|
||||
~AsyncPromise() CV_NOEXCEPT;
|
||||
AsyncPromise() CV_NOEXCEPT;
|
||||
explicit AsyncPromise(const AsyncPromise& o) CV_NOEXCEPT;
|
||||
AsyncPromise& operator=(const AsyncPromise& o) CV_NOEXCEPT;
|
||||
void release() CV_NOEXCEPT;
|
||||
|
||||
/** Returns associated AsyncArray
|
||||
@note Can be called once
|
||||
*/
|
||||
AsyncArray getArrayResult();
|
||||
|
||||
/** Stores asynchronous result.
|
||||
@param[in] value result
|
||||
*/
|
||||
void setValue(InputArray value);
|
||||
|
||||
// TODO "move" setters
|
||||
|
||||
#if CV__EXCEPTION_PTR
|
||||
/** Stores exception.
|
||||
@param[in] exception exception to be raised in AsyncArray
|
||||
*/
|
||||
void setException(std::exception_ptr exception);
|
||||
#endif
|
||||
|
||||
/** Stores exception.
|
||||
@param[in] exception exception to be raised in AsyncArray
|
||||
*/
|
||||
void setException(const cv::Exception& exception);
|
||||
|
||||
#ifdef CV_CXX11
|
||||
explicit AsyncPromise(AsyncPromise&& o) { p = o.p; o.p = NULL; }
|
||||
AsyncPromise& operator=(AsyncPromise&& o) CV_NOEXCEPT { std::swap(p, o.p); return *this; }
|
||||
#endif
|
||||
|
||||
|
||||
// PImpl
|
||||
typedef struct AsyncArray::Impl Impl; friend struct AsyncArray::Impl;
|
||||
inline void* _getImpl() const CV_NOEXCEPT { return p; }
|
||||
protected:
|
||||
Impl* p;
|
||||
};
|
||||
|
||||
|
||||
//! @}
|
||||
} // namespace
|
||||
#endif // OPENCV_CORE_ASYNC_PROMISE_HPP
|
27
esp32/lib/opencv/opencv2/core/detail/exception_ptr.hpp
Normal file
27
esp32/lib/opencv/opencv2/core/detail/exception_ptr.hpp
Normal file
@ -0,0 +1,27 @@
|
||||
// This file is part of OpenCV project.
|
||||
// It is subject to the license terms in the LICENSE file found in the top-level directory
|
||||
// of this distribution and at http://opencv.org/license.html.
|
||||
|
||||
#ifndef OPENCV_CORE_DETAILS_EXCEPTION_PTR_H
|
||||
#define OPENCV_CORE_DETAILS_EXCEPTION_PTR_H
|
||||
|
||||
#ifndef CV__EXCEPTION_PTR
|
||||
# if defined(__ANDROID__) && defined(ATOMIC_INT_LOCK_FREE) && ATOMIC_INT_LOCK_FREE < 2
|
||||
# define CV__EXCEPTION_PTR 0 // Not supported, details: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58938
|
||||
# elif defined(CV_CXX11)
|
||||
# define CV__EXCEPTION_PTR 1
|
||||
# elif defined(_MSC_VER)
|
||||
# define CV__EXCEPTION_PTR (_MSC_VER >= 1600)
|
||||
# elif defined(__clang__)
|
||||
# define CV__EXCEPTION_PTR 0 // C++11 only (see above)
|
||||
# elif defined(__GNUC__) && defined(__GXX_EXPERIMENTAL_CXX0X__)
|
||||
# define CV__EXCEPTION_PTR (__GXX_EXPERIMENTAL_CXX0X__ > 0)
|
||||
# endif
|
||||
#endif
|
||||
#ifndef CV__EXCEPTION_PTR
|
||||
# define CV__EXCEPTION_PTR 0
|
||||
#elif CV__EXCEPTION_PTR
|
||||
# include <exception> // std::exception_ptr
|
||||
#endif
|
||||
|
||||
#endif // OPENCV_CORE_DETAILS_EXCEPTION_PTR_H
|
Reference in New Issue
Block a user