Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

ACE_Mutex_Invariants Class Reference

Mutex Invariants = INVARIANTS 1. Only one owner at a time. More...

#include <Token_Invariants.h>

List of all members.

Public Methods

 ACE_Mutex_Invariants (void)
 Default construction. More...

int acquired (void)
 Returns 1 on success, 0 when an invariant has been violated and -1 on error. More...

void releasing (void)
 Updates internal database. More...

 ACE_Mutex_Invariants (const ACE_Mutex_Invariants &rhs)
 Copy construction. More...

void operator= (const ACE_Mutex_Invariants &rhs)
 Copy. More...

void dump (void) const
 Dump the state of the class. More...


Private Attributes

int owners_
 Number of owners. This had better be 0 >= owners_ <= 1;. More...


Detailed Description

Mutex Invariants = INVARIANTS 1. Only one owner at a time.

Definition at line 41 of file Token_Invariants.h.


Constructor & Destructor Documentation

ACE_Mutex_Invariants::ACE_Mutex_Invariants void   
 

Default construction.

Definition at line 226 of file Token_Invariants.cpp.

00227 : owners_ (0)
00228 {
00229 }

ACE_Mutex_Invariants::ACE_Mutex_Invariants const ACE_Mutex_Invariants &    rhs
 

Copy construction.

Definition at line 250 of file Token_Invariants.cpp.

00251 : owners_ (rhs.owners_)
00252 {
00253 }


Member Function Documentation

int ACE_Mutex_Invariants::acquired void   
 

Returns 1 on success, 0 when an invariant has been violated and -1 on error.

Definition at line 232 of file Token_Invariants.cpp.

References owners_.

Referenced by ACE_Token_Invariant_Manager::mutex_acquired.

00233 {
00234   if (++owners_ > 1)
00235     {
00236       owners_ = 42;
00237       return 0;
00238     }
00239   else
00240     return 1;
00241 }

void ACE_Mutex_Invariants::dump void    const
 

Dump the state of the class.

Definition at line 262 of file Token_Invariants.cpp.

References ACE_BEGIN_DUMP, ACE_DEBUG, ACE_END_DUMP, ACE_LIB_TEXT, ACE_TRACE, LM_DEBUG, and owners_.

00263 {
00264   ACE_TRACE ("ACE_Mutex_Invariants::dump");
00265   ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this));
00266   ACE_DEBUG ((LM_DEBUG,  ACE_LIB_TEXT ("owners_ = %d\n"), owners_));
00267   ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP));
00268 }

void ACE_Mutex_Invariants::operator= const ACE_Mutex_Invariants &    rhs
 

Copy.

Definition at line 256 of file Token_Invariants.cpp.

References owners_.

00257 {
00258   owners_ = rhs.owners_;
00259 }

void ACE_Mutex_Invariants::releasing void   
 

Updates internal database.

Definition at line 244 of file Token_Invariants.cpp.

References owners_.

Referenced by ACE_Token_Invariant_Manager::mutex_releasing.

00245 {
00246   if (owners_ == 1)
00247     --owners_;
00248 }


Member Data Documentation

int ACE_Mutex_Invariants::owners_ [private]
 

Number of owners. This had better be 0 >= owners_ <= 1;.

Definition at line 67 of file Token_Invariants.h.

Referenced by acquired, dump, operator=, and releasing.


The documentation for this class was generated from the following files:
Generated on Mon Jun 16 12:50:49 2003 for ACE by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002