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 81 of file Database.h.


Constructor & Destructor Documentation

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

Definition at line 212 of file Database.cpp.

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

00212                                         : m_mutex(mutex),m_b_use(use) 
00213 {
00214         if (m_b_use) 
00215         {
00216                 m_mutex.Lock();
00217         }
00218 }

Database::Lock::~Lock (  ) 

Definition at line 221 of file Database.cpp.

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

00222 {
00223         if (m_b_use) 
00224         {
00225                 m_mutex.Unlock();
00226         }
00227 }


Member Data Documentation

Definition at line 86 of file Database.h.

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

bool Database::Lock::m_b_use [private]

Definition at line 87 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