PTLib  Version 2.14.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
PAtomicBoolean Class Reference

This class implements an atomic "test and set" boolean. More...

#include <critsec.h>

Inheritance diagram for PAtomicBoolean:
Collaboration diagram for PAtomicBoolean:

Public Member Functions

 PAtomicBoolean (bool value=false)
 Create a PAtomicBoolean with the specified initial value. More...
 
__inline operator bool () const
 
__inline PAtomicBooleanoperator= (bool value)
 Assign a value to the atomic boolean. More...
 
__inline bool operator! () const
 Test if atomic integer has a zero value. More...
 
bool TestAndSet (bool value)
 Test Set the value of the atomic boolean. More...
 

Friends

__inline ostream & operator<< (ostream &strm, const PAtomicBoolean &b)
 

Additional Inherited Members

- Private Types inherited from PAtomicBase
typedef int IntegerType
 
- Private Member Functions inherited from PAtomicBase
 ~PAtomicBase ()
 Destroy the atomic integer. More...
 
 PAtomicBase (IntegerType value)
 

Detailed Description

This class implements an atomic "test and set" boolean.

Constructor & Destructor Documentation

PAtomicBoolean::PAtomicBoolean ( bool  value = false)
inlineexplicit

Create a PAtomicBoolean with the specified initial value.

Parameters
valueinitial value

Member Function Documentation

__inline PAtomicBoolean::operator bool ( ) const
inline
Returns
Returns the value of the atomic boolean

References PAtomicBase::m_value.

__inline bool PAtomicBoolean::operator! ( ) const
inline

Test if atomic integer has a zero value.

References PAtomicBase::m_value.

__inline PAtomicBoolean& PAtomicBoolean::operator= ( bool  value)
inline

Assign a value to the atomic boolean.

References PAtomicBase::m_value.

__inline bool PAtomicBoolean::TestAndSet ( bool  value)

Test Set the value of the atomic boolean.

the previous value.

Parameters
valuevalue to set

References PAtomicBase::m_value.

Friends And Related Function Documentation

__inline ostream& operator<< ( ostream &  strm,
const PAtomicBoolean b 
)
friend

The documentation for this class was generated from the following file: