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 ACE_LOCK.

SYNOPSIS

#include <ace/Synch_T.h>

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

DESCRIPTION

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

Initialization and termination methods.

inline ACE_Guard (ACE_LOCK &l): lock_ (&l);

inline ACE_Guard (ACE_LOCK &l, int block): lock_ (&l);

inline ~ACE_Guard (void);

Lock accessors.

inline int acquire (void);

inline int tryacquire (void);

inline int release (void);

Utility methods.

inline int locked (void);

inline int remove (void);

void dump (void) const;

ACE_ALLOC_HOOK_DECLARE; Declare the dynamic allocation hooks.

Prevent assignment and initialization.

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

AUTHOR

Doug Schmidt

LIBRARY

ace