Asynchronous API#
Classes#
Name |
Description |
|---|---|
Returns result of asynchronous operations. |
|
Provides result of asynchronous operations. |
Class cv::AsyncArray#
Returns result of asynchronous operations.
#include <opencv2/core/async.hpp>Collaboration diagram for cv::AsyncArray:
Friends#
Return |
Name |
Description |
|---|---|---|
|
Detailed Description#
-
class AsyncArray#
Returns result of asynchronous operations.
Object has attached asynchronous state. Assignment operator doesn’t clone asynchronous state (it is shared between all instances).
Result can be fetched via get() method only once.
- Examples
- samples/dnn/object_detection.cpp.
Constructor & Destructor Documentation#
AsyncArray()#
Python:
cv.AsyncArray() -> <AsyncArray object>
AsyncArray()#
cv::AsyncArray::AsyncArray(AsyncArray && o)
Python:
cv.AsyncArray() -> <AsyncArray object>
AsyncArray()#
cv::AsyncArray::AsyncArray(const AsyncArray & o)
Python:
cv.AsyncArray() -> <AsyncArray object>
~AsyncArray()#
Member Function Documentation#
_getImpl()#
void * cv::AsyncArray::_getImpl()
get()#
void cv::AsyncArray::get(OutputArray dst)
Python:
cv.AsyncArray.get([, dst]) -> dst
cv.AsyncArray.get(timeoutNs[, dst]) -> retval, dst
Fetch the result. Waits for result until container has valid result. Throws exception if exception was stored as a result.
Throws exception on invalid container state.
Note
Result or stored exception can be fetched only once.
Parameters
dst— destination array
get()#
template<typename _Rep, typename _Period>
bool cv::AsyncArray::get(
OutputArray dst,
const std::chrono::duration< _Rep, _Period > & timeout )
Python:
cv.AsyncArray.get([, dst]) -> dst
cv.AsyncArray.get(timeoutNs[, dst]) -> retval, dst
get()#
bool cv::AsyncArray::get(
OutputArray dst,
double timeoutNs )
Python:
cv.AsyncArray.get([, dst]) -> dst
cv.AsyncArray.get(timeoutNs[, dst]) -> retval, dst
Here is the call graph for this function:
get()#
bool cv::AsyncArray::get(
OutputArray dst,
int64 timeoutNs )
Python:
cv.AsyncArray.get([, dst]) -> dst
cv.AsyncArray.get(timeoutNs[, dst]) -> retval, dst
Retrieving the result with timeout
Note
Result or stored exception can be fetched only once.
Parameters
dst— destination arraytimeoutNs— timeout in nanoseconds, -1 for infinite wait
Returns
true if result is ready, false if the timeout has expired
operator=()#
AsyncArray & cv::AsyncArray::operator=(AsyncArray && o)
operator=()#
AsyncArray & cv::AsyncArray::operator=(const AsyncArray & o)
release()#
void cv::AsyncArray::release()
Python:
cv.AsyncArray.release()
valid()#
bool cv::AsyncArray::valid()
Python:
cv.AsyncArray.valid() -> retval
wait_for()#
template<typename _Rep, typename _Period>
bool cv::AsyncArray::wait_for(const std::chrono::duration< _Rep, _Period > & timeout)
Python:
cv.AsyncArray.wait_for(timeoutNs) -> retval
wait_for()#
bool cv::AsyncArray::wait_for(double timeoutNs)
Python:
cv.AsyncArray.wait_for(timeoutNs) -> retval
Here is the call graph for this function:
wait_for()#
bool cv::AsyncArray::wait_for(int64 timeoutNs)
Python:
cv.AsyncArray.wait_for(timeoutNs) -> retval
Member Data Documentation#
p#
Impl * cv::AsyncArray::p
Source file#
The documentation for this class was generated from the following file:
opencv2/core/async.hpp
Class cv::AsyncPromise#
Provides result of asynchronous operations.
#include <opencv2/core/detail/async_promise.hpp>Collaboration diagram for cv::AsyncPromise:
Friends#
Return |
Name |
Description |
|---|---|---|
|
Detailed Description#
Provides result of asynchronous operations.
Member Typedef Documentation#
Impl#
typedef struct AsyncArray::Impl cv::AsyncPromise::Impl
Constructor & Destructor Documentation#
AsyncPromise()#
AsyncPromise()#
AsyncPromise()#
cv::AsyncPromise::AsyncPromise(const AsyncPromise & o)
~AsyncPromise()#
Member Function Documentation#
_getImpl()#
void * cv::AsyncPromise::_getImpl()
getArrayResult()#
AsyncArray cv::AsyncPromise::getArrayResult()
Returns associated AsyncArray
Note
Can be called once
operator=()#
AsyncPromise & cv::AsyncPromise::operator=(AsyncPromise && o)
operator=()#
AsyncPromise & cv::AsyncPromise::operator=(const AsyncPromise & o)
release()#
void cv::AsyncPromise::release()
setException()#
void cv::AsyncPromise::setException(const cv::Exception & exception)
Stores exception.
Parameters
exception— exception to be raised in AsyncArray
setValue()#
void cv::AsyncPromise::setValue(InputArray value)
Stores asynchronous result.
Parameters
value— result
Member Data Documentation#
p#
Impl * cv::AsyncPromise::p
Source file#
The documentation for this class was generated from the following file:
opencv2/core/detail/async_promise.hpp