ULAPI  8.0
Public Member Functions | Protected Attributes | List of all members
ULLockable Class Reference

ULLockable can be used as a parent class for any class whose operations need to be made atomic in a threaded context. More...

#include <ullockable.h>

Public Member Functions

 ULLockable ()
 
 ULLockable (const ULLockable &lockable)
 
virtual ~ULLockable ()
 
const ULLockableoperator= (const ULLockable &lockable)
 
void clear ()
 
ULLockgetLock ()
 
void setLock (ULLock *newLock)
 

Protected Attributes

ULLocklock
 

Detailed Description

ULLockable can be used as a parent class for any class whose operations need to be made atomic in a threaded context.

Each ULLockable object has a pointer to a ULLock, which may be null (in which case no locking operations will take place) or point to some instance of a subclass of ULLock suitable for the platform on which the code is running.

ULLockable depends on ULScopeLocker, which implements a variant of the "Scoped Locking" pattern (http://www.cs.wustl.edu/~schmidt/PDF/ScopedLocking.pdf).

A typical use of a ULLockable object would involve steps like this:

Constructor & Destructor Documentation

ULLockable::ULLockable ( )

Default constructor.

ULLockable::ULLockable ( const ULLockable lockable)

Copy constructor.

ULLockable::~ULLockable ( )
virtual

Destructor.

Member Function Documentation

void ULLockable::clear ( )

Initializes this object to its default state (i.e. no ULLock is assigned to it).

ULLock * ULLockable::getLock ( )

Accessor for the ULLock object associated with this ULLockable object.

const ULLockable & ULLockable::operator= ( const ULLockable lockable)

Assignment operator.

void ULLockable::setLock ( ULLock newLock)

Accessor for the ULLock object associated with this ULLockable object.

Member Data Documentation

ULLock* ULLockable::lock
protected

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