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 215 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)
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 217 of file Lock.h.

References do_lock().

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

Definition at line 225 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 233 of file Lock.h.

References do_lock().

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

Definition at line 259 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 241 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 250 of file Lock.h.

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

Referenced by dtn::ProphetEncounter::~ProphetEncounter(), and ~ScopeLockIf().


Member Data Documentation

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

Definition at line 267 of file Lock.h.

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

bool oasys::ScopeLockIf::use_lock_ [protected]

Definition at line 268 of file Lock.h.

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


The documentation for this class was generated from the following file:
Generated on Sat Sep 8 08:43:54 2007 for DTN Reference Implementation by  doxygen 1.5.3