OpenCurves
0.9
|
A thread safe capture of a list of curves internal to a Curves
object.
More...
#include <curves.h>
Public Types | |
typedef QList< PlotInstance * >::iterator | iterator |
The iterator type. | |
typedef QList< PlotInstance * >::const_iterator | const_iterator |
The const_iterator type. | |
Public Member Functions | |
CurveList (QMutex &mutex, const QList< PlotInstance * > &curves) | |
Constructor: internal use only. More... | |
~CurveList () | |
Destructor: releases the mutex. | |
void | release () |
Releases the curve list and lock allowing other threads to access the data. The object becomes invalid for further use. | |
const_iterator | begin () const |
Begin iteration of the curves. More... | |
const_iterator | end () const |
End iterator. More... | |
const QList< PlotInstance * > & | list () const |
Direct access to the underlying list (thread-safe). More... | |
A thread safe capture of a list of curves internal to a Curves
object.
This provides a way to access one of the lists of PlotInstance
objects in a Curves
instance while maintaining thread safety. The curve list is locked while this object exists. Thus it is critical that the CurveList
object go out of scope before attempting to access another CurveList
.
Curves::CurveList::CurveList | ( | QMutex & | mutex, |
const QList< PlotInstance * > & | curves | ||
) |
Constructor: internal use only.
mutex | The mutex to lock. |
curves | The curves list. |
|
inline |
Begin iteration of the curves.
Must not be released.
|
inline |
End iterator.
Must not be released.
|
inline |
Direct access to the underlying list (thread-safe).
There is no guarantee the list items will remain valid.