checkout_token Class Template Reference
[Synchronisation Library]

#include <stlsoft/synch/checkout_token.hpp>

List of all members.


Detailed Description

template<typename CT, typename MT>
class stlsoft::checkout_token< CT, MT >

This class acts as a.

For example, consider that you have a class X whose resources are to be accessible to multiple threads, defined as follows:

  class X
  {
  public:
    typedef std::queue<int>   queue_type;

  public:
    void lock();
    void unlock();

  public:
    que
  };

Rather than relying on the good actions of the user, we can instead bind the locking of X's resources with access to its queue, using checkout_token, as follows:


Public Types

Member Types
typedef CT accessed_class_type
 The type whose resources are to be protected.
typedef MT accessed_member_type
typedef checkout_token< CT, MT > class_type
 The current instantation of the type.

Public Member Functions

Construction
 checkout_token (accessed_class_type &ac, accessed_member_type am)
 Locks.
 checkout_token (class_type const &rhs)
 Cop.
Accessors
accessed_member_type member ()

Member Typedef Documentation

typedef CT accessed_class_type

The type whose resources are to be protected.

typedef checkout_token<CT, MT> class_type

The current instantation of the type.


Constructor & Destructor Documentation

checkout_token ( accessed_class_type ac,
accessed_member_type  am 
) [inline]

Locks.

checkout_token ( class_type const &  rhs  )  [inline]

Cop.


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

Generated on Thu Jun 10 08:59:01 2010 for STLSoft by  doxygen 1.5.6