5 #ifndef OPENCV_UTILS_TLS_HPP
6 #define OPENCV_UTILS_TLS_HPP
8 #ifndef OPENCV_CORE_UTILITY_H
9 #error "tls.hpp must be included after opencv2/core/utility.hpp or opencv2/core.hpp"
17 namespace details {
class TlsStorage; }
46 friend class cv::details::TlsStorage;
118 data.reserve(
data.size() + dataFromTerminatedThreads.
size());
121 data.push_back((
T*)*i);
141 detachedData.
reserve(dataVoid.
size() + dataFromTerminatedThreads.
size());
146 dataFromTerminatedThreads.
clear();
197 detachedData.
clear();
207 dataFromTerminatedThreads.
clear();
225 dataFromTerminatedThreads.
push_back((
T*)pData);
TLS data accumulator with gathering methods.
Definition: tls.hpp:89
virtual void * createDataInstance() const CV_OVERRIDE
Wrapper to allocate data by template.
Definition: tls.hpp:211
TLSDataAccumulator()
Definition: tls.hpp:95
void cleanup()
Release associated thread data.
Definition: tls.hpp:166
void cleanupDetachedData()
Release associated thread data returned by detachData() call.
Definition: tls.hpp:157
void _cleanupDetachedData()
Definition: tls.hpp:191
void release()
Release associated thread data and free TLS key.
Definition: tls.hpp:178
std::vector< T * > & detachData()
Get and detach data from all threads.
Definition: tls.hpp:132
void gather(std::vector< T * > &data) const
Get data from all threads.
Definition: tls.hpp:108
~TLSDataAccumulator()
Definition: tls.hpp:96
virtual void deleteDataInstance(void *pData) const CV_OVERRIDE
Wrapper to release data by template.
Definition: tls.hpp:216
void _cleanupTerminatedData()
Definition: tls.hpp:201
virtual void * createDataInstance() const =0
void detachData(std::vector< void * > &data)
get TLS data and detach all data from threads (similar to cleanup() call)
void gatherData(std::vector< void * > &data) const
void cleanup()
Release created TLS data container objects. It is similar to release() call, but it keeps TLS contain...
virtual void deleteDataInstance(void *pData) const =0
virtual ~TLSDataContainer()
Simple TLS data class.
Definition: tls.hpp:64
void cleanup()
Release associated thread data.
Definition: tls.hpp:73
virtual void * createDataInstance() const CV_OVERRIDE
Wrapper to allocate data by template.
Definition: tls.hpp:80
T * get() const
Get data associated with key.
Definition: tls.hpp:69
virtual void deleteDataInstance(void *pData) const CV_OVERRIDE
Wrapper to release data by template.
Definition: tls.hpp:82
T & getRef() const
Get data associated with key.
Definition: tls.hpp:70
~TLSData()
Definition: tls.hpp:67
TLSData()
Definition: tls.hpp:66
InputArrayOfArrays InputArrayOfArrays InputOutputArray InputOutputArray InputOutputArray InputOutputArray Size InputOutputArray InputOutputArray T
Definition: calib3d.hpp:1867
void * data
Definition: core_c.h:427
#define CV_EXPORTS
Definition: cvdef.h:435
#define CV_OVERRIDE
Definition: cvdef.h:792
#define CV_Assert(expr)
Checks a condition at runtime and throws exception if it fails.
Definition: base.hpp:342
#define CV_DbgAssert(expr)
Definition: base.hpp:375
"black box" representation of the file storage associated with a file on disk.
Definition: calib3d.hpp:441