EPICS ARCHIVER V4
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups
Public Member Functions | List of all members
ConcurrentPtrList Class Reference

A List that allows concurrent access. More...

#include <ConcurrentList.h>

Inheritance diagram for ConcurrentPtrList:
ConcurrentList< T > ConcurrentList< class SinglePeriodScanList > ConcurrentList< ProcessVariableStateListener > ConcurrentList< ProcessVariableValueListener >

Public Member Functions

 ConcurrentPtrList ()
 Construct a new list. More...
 
virtual ~ConcurrentPtrList ()
 Delete list and all its elements. More...
 
OrderedMutexgetMutex ()
 
bool isEmpty (Guard &guard)
 
size_t size (Guard &guard)
 
void add (Guard &guard, void *item)
 Add an item to the list. More...
 
bool removeIfFound (Guard &guard, void *item)
 Remove an item from the list. More...
 
void remove (Guard &guard, void *item)
 Remove an item from the list. More...
 
class ConcurrentPtrListIterator iterator (Guard &guard)
 Obtain iterator, positioned at the start of the list. More...
 

Detailed Description

A List that allows concurrent access.

One can add or remove elements while someone else is traversing the list. Of course the list is locked in add(), next(), .., but not for the full duration of traversal.

Constructor & Destructor Documentation

ConcurrentPtrList::ConcurrentPtrList ( )

Construct a new list.

virtual ConcurrentPtrList::~ConcurrentPtrList ( )
virtual

Delete list and all its elements.

Member Function Documentation

void ConcurrentPtrList::add ( Guard guard,
void *  item 
)

Add an item to the list.

The position of that item on the list is not necessarily predicatable. Typically at the end, but may be at a 'reused' location.

OrderedMutex& ConcurrentPtrList::getMutex ( )
inline
Returns
Returns the mutex for the Guard passed to other methods.
bool ConcurrentPtrList::isEmpty ( Guard guard)
Returns
Returns true if the list is empty.
class ConcurrentPtrListIterator ConcurrentPtrList::iterator ( Guard guard)

Obtain iterator, positioned at the start of the list.

void ConcurrentPtrList::remove ( Guard guard,
void *  item 
)

Remove an item from the list.

Exceptions
GenericExceptionif item is not found on the list.
bool ConcurrentPtrList::removeIfFound ( Guard guard,
void *  item 
)

Remove an item from the list.

Returns
Returns true if item was found and removed.
size_t ConcurrentPtrList::size ( Guard guard)
Returns
Returns number of entries.

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