Forums  +  C++ and Sockets  +  C++ and SQL: MySQL, sqlite, ODBC  +  Miscellaneous Projects
Logo
~Database~
~ C++ ~
~Contact~

Database::Lock Class Reference

Mutex helper class. More...

Collaboration diagram for Database::Lock:

Collaboration graph
List of all members.

Public Member Functions

 Lock (Mutex &mutex, bool use)
 ~Lock ()

Private Attributes

Mutexm_mutex
bool m_b_use

Detailed Description

Mutex helper class.

Definition at line 80 of file Database.h.


Constructor & Destructor Documentation

Database::Lock::Lock ( Mutex mutex,
bool  use 
)

Definition at line 271 of file Database.cpp.

References Database::Mutex::Lock(), m_b_use, and m_mutex.

00271                                         : m_mutex(mutex),m_b_use(use) 
00272 {
00273         if (m_b_use) 
00274         {
00275                 m_mutex.Lock();
00276         }
00277 }

Database::Lock::~Lock (  ) 

Definition at line 280 of file Database.cpp.

References m_b_use, m_mutex, and Database::Mutex::Unlock().

00281 {
00282         if (m_b_use) 
00283         {
00284                 m_mutex.Unlock();
00285         }
00286 }


Member Data Documentation

Definition at line 85 of file Database.h.

Referenced by Lock(), and ~Lock().

bool Database::Lock::m_b_use [private]

Definition at line 86 of file Database.h.

Referenced by Lock(), and ~Lock().


The documentation for this class was generated from the following files:
Page, code, and content Copyright (C) 2006 by Anders Hedström