sk::rt::Locker< L > Class Template Reference

A class to perform scope locking. More...

#include <Locker.hxx>

List of all members.

Public Member Functions

 Locker (L &lock)
 Constructs a locker class.
 ~Locker ()
 Handles the locker instance destruction.


Detailed Description

template<typename L>
class sk::rt::Locker< L >

A class to perform scope locking.

This class will call method lock() on a specified resource in the constructor and unlock() in the destructor of the last instance in a copy chain. Creating instances of this class on the stack (e.g. automatic variables or temporaries) will guarantee unlocking even in presense of exceptions due to C++ stack unwinding feature.

Usage:


Constructor & Destructor Documentation

template<typename L >
sk::rt::Locker< L >::Locker ( L &  lock  )  [inline]

Constructs a locker class.

The constructor will lock a specified resource by calling its lock() method.

template<typename L >
sk::rt::Locker< L >::~Locker (  )  [inline]

Handles the locker instance destruction.

When this locker goes out of scope, it will call unlock() on the resource it has been costructed with, when it is the last instance in a copy chain.


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

Generated on Tue Mar 3 12:36:09 2009 for stemkit-cpp by  doxygen 1.5.8