oasys::ScopeLockIf Class Reference

#include <Lock.h>

List of all members.


Detailed Description

Same as ScopeLock from above, but with a boolean predicate.

Only locks if true. Useful for cases where locking is optional, but putting things in an if scope will null the scope of the ScopeLock.

Definition at line 231 of file Lock.h.

Public Member Functions

 ScopeLockIf (Lock *l, const char *lock_user, bool use_lock)
 ScopeLockIf (const Lock *l, const char *lock_user, bool use_lock)
 ScopeLockIf (oasys::ScopePtr< Lock > l, const char *lock_user, bool use_lock)
 ScopeLockIf (std::auto_ptr< Lock > l, const char *lock_user, bool use_lock)
void do_lock (const char *lock_user)
void unlock ()
 ~ScopeLockIf ()

Protected Attributes

Locklock_
bool use_lock_


Constructor & Destructor Documentation

oasys::ScopeLockIf::ScopeLockIf ( Lock l,
const char *  lock_user,
bool  use_lock 
) [inline]

Definition at line 233 of file Lock.h.

References do_lock().

oasys::ScopeLockIf::ScopeLockIf ( const Lock l,
const char *  lock_user,
bool  use_lock 
) [inline]

Definition at line 241 of file Lock.h.

References do_lock().

oasys::ScopeLockIf::ScopeLockIf ( oasys::ScopePtr< Lock l,
const char *  lock_user,
bool  use_lock 
) [inline]

Definition at line 249 of file Lock.h.

References do_lock().

oasys::ScopeLockIf::ScopeLockIf ( std::auto_ptr< Lock l,
const char *  lock_user,
bool  use_lock 
) [inline]

Definition at line 257 of file Lock.h.

References do_lock().

oasys::ScopeLockIf::~ScopeLockIf (  )  [inline]

Definition at line 283 of file Lock.h.

References lock_, unlock(), and use_lock_.


Member Function Documentation

void oasys::ScopeLockIf::do_lock ( const char *  lock_user  )  [inline]

Definition at line 265 of file Lock.h.

References ASSERT, oasys::Lock::lock(), lock_, oasys::Lock::scope_lock_count_, and use_lock_.

Referenced by ScopeLockIf().

void oasys::ScopeLockIf::unlock (  )  [inline]

Definition at line 274 of file Lock.h.

References lock_, oasys::Lock::scope_lock_count_, oasys::Lock::unlock(), and use_lock_.

Referenced by ~ScopeLockIf().


Member Data Documentation

Lock* oasys::ScopeLockIf::lock_ [protected]

Definition at line 291 of file Lock.h.

Referenced by do_lock(), unlock(), and ~ScopeLockIf().

bool oasys::ScopeLockIf::use_lock_ [protected]

Definition at line 292 of file Lock.h.

Referenced by do_lock(), unlock(), and ~ScopeLockIf().


The documentation for this class was generated from the following file:
Generated on Fri Dec 22 14:48:07 2006 for DTN Reference Implementation by  doxygen 1.5.1