NAME

ACE_Guard - This data structure is meant to be used within a method or function... It performs automatic aquisition and release of a parameterized synchronization object LOCK.

SYNOPSIS


#include <ace/Synch_T.h>


template<class LOCK>
class ACE_Guard
{
  public:
    inline ACE_Guard (LOCK &l, int block = 1): lock_ (&l);
    inline ~ACE_Guard (void);
    inline int locked (void);
    inline int remove (void);
    inline int acquire (void);
    inline int tryacquire (void);
    inline int release (void);
    void dump (void) const;
  protected:
    inline ACE_Guard (LOCK *lock);
    LOCK *lock_;
    int owner_;
  private:
    inline void operator= (const ACE_Guard<LOCK> &);
    inline ACE_Guard (const ACE_Guard<LOCK> &);
};

DESCRIPTION

The LOCK class given as an actual parameter must provide at the very least the acquire, tryacquire, release, and remove methods.

Prevent assignment and initialization.

inline void operator= (const ACE_Guard<LOCK> &);
inline ACE_Guard (const ACE_Guard<LOCK> &);

AUTHOR

Doug Schmidt

LIBRARY

ace