OpenCV  5.0.0alpha
Open Source Computer Vision
Loading...
Searching...
No Matches
cv::TLSDataAccumulator< T > Class Template Reference

TLS data accumulator with gathering methods. More...

#include <opencv2/core/utils/tls.hpp>

Collaboration diagram for cv::TLSDataAccumulator< T >:

Public Member Functions

 TLSDataAccumulator ()
 
 ~TLSDataAccumulator ()
 
void cleanup ()
 Release associated thread data.
 
void cleanupDetachedData ()
 Release associated thread data returned by detachData() call.
 
std::vector< T * > & detachData ()
 Get and detach data from all threads.
 
void gather (std::vector< T * > &data) const
 Get data from all threads.
 
void release ()
 Release associated thread data and free TLS key.
 
- Public Member Functions inherited from cv::TLSData< T >
 TLSData ()
 
 ~TLSData ()
 
void cleanup ()
 Release associated thread data.
 
T * get () const
 Get data associated with key.
 
T & getRef () const
 Get data associated with key.
 

Protected Member Functions

void _cleanupDetachedData ()
 
void _cleanupTerminatedData ()
 
virtual void * createDataInstance () const CV_OVERRIDE
 Wrapper to allocate data by template.
 
virtual void deleteDataInstance (void *pData) const CV_OVERRIDE
 Wrapper to release data by template.
 
- Protected Member Functions inherited from cv::TLSData< T >
- Protected Member Functions inherited from cv::TLSDataContainer
 TLSDataContainer ()
 
virtual ~TLSDataContainer ()
 
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 * getData () const
 
void release ()
 
void cleanup ()
 Release created TLS data container objects. It is similar to release() call, but it keeps TLS container valid.
 

Detailed Description

template<typename T>
class cv::TLSDataAccumulator< T >

TLS data accumulator with gathering methods.

Constructor & Destructor Documentation

◆ TLSDataAccumulator()

template<typename T >
cv::TLSDataAccumulator< T >::TLSDataAccumulator ( )
inline

◆ ~TLSDataAccumulator()

template<typename T >
cv::TLSDataAccumulator< T >::~TLSDataAccumulator ( )
inline
Here is the call graph for this function:

Member Function Documentation

◆ _cleanupDetachedData()

template<typename T >
void cv::TLSDataAccumulator< T >::_cleanupDetachedData ( )
inlineprotected
Here is the call graph for this function:

◆ _cleanupTerminatedData()

template<typename T >
void cv::TLSDataAccumulator< T >::_cleanupTerminatedData ( )
inlineprotected
Here is the call graph for this function:

◆ cleanup()

template<typename T >
void cv::TLSDataAccumulator< T >::cleanup ( )
inline

Release associated thread data.

Here is the call graph for this function:

◆ cleanupDetachedData()

template<typename T >
void cv::TLSDataAccumulator< T >::cleanupDetachedData ( )
inline

Release associated thread data returned by detachData() call.

Here is the call graph for this function:

◆ createDataInstance()

template<typename T >
virtual void * cv::TLSDataAccumulator< T >::createDataInstance ( ) const
inlineprotectedvirtual

Wrapper to allocate data by template.

Reimplemented from cv::TLSData< T >.

◆ deleteDataInstance()

template<typename T >
virtual void cv::TLSDataAccumulator< T >::deleteDataInstance ( void * pData) const
inlineprotectedvirtual

Wrapper to release data by template.

Reimplemented from cv::TLSData< T >.

◆ detachData()

template<typename T >
std::vector< T * > & cv::TLSDataAccumulator< T >::detachData ( )
inline

Get and detach data from all threads.

Call cleanupDetachedData() when returned vector is not needed anymore.

Returns
Vector with associated data. Content is preserved (including lifetime of attached data pointers) until next detachData()/cleanupDetachedData()/cleanup()/release() calls
Here is the call graph for this function:

◆ gather()

template<typename T >
void cv::TLSDataAccumulator< T >::gather ( std::vector< T * > & data) const
inline

Get data from all threads.

Deprecated
replaced by detachData()

Lifetime of vector data is valid until next detachData()/cleanup()/release() calls

Parameters
[out]dataresult buffer (should be empty)
Here is the call graph for this function:

◆ release()

template<typename T >
void cv::TLSDataAccumulator< T >::release ( )
inline

Release associated thread data and free TLS key.

Here is the call graph for this function:

The documentation for this class was generated from the following file: