OpenCurves  0.9
Curves::CurveList Class Reference

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...
 

Detailed Description

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.

Constructor & Destructor Documentation

Curves::CurveList::CurveList ( QMutex &  mutex,
const QList< PlotInstance * > &  curves 
)

Constructor: internal use only.

Parameters
mutexThe mutex to lock.
curvesThe curves list.

Member Function Documentation

const_iterator Curves::CurveList::begin ( ) const
inline

Begin iteration of the curves.

Must not be released.

Returns
The iterator to the first item.
const_iterator Curves::CurveList::end ( ) const
inline

End iterator.

Must not be released.

Returns
The iterator after the last item.
const QList<PlotInstance *>& Curves::CurveList::list ( ) const
inline

Direct access to the underlying list (thread-safe).

There is no guarantee the list items will remain valid.

Returns
The underlying curve list

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