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

ACE_Test_and_Set Class Template Reference

Implements the classic ``test and set'' operation. More...

#include <Test_and_Set.h>

Inheritance diagram for ACE_Test_and_Set

Inheritance graph
[legend]
Collaboration diagram for ACE_Test_and_Set:

Collaboration graph
[legend]
List of all members.

Public Methods

 ACE_Test_and_Set (TYPE initial_value = 0)
TYPE is_set (void) const
 Returns true if we are set, else false.

TYPE set (TYPE)
 Sets the <is_set_> status, returning the original value of <is_set_>.

virtual int handle_signal (int signum, siginfo_t * = 0, ucontext_t * = 0)
 Called when object is signaled by OS (either via UNIX signals or when a Win32 object becomes signaled).


Private Attributes

TYPE is_set_
 Keeps track of our state.

ACE_LOCK lock_
 Protect the state from race conditions.


Detailed Description

template<class ACE_LOCK, class TYPE> template class ACE_Test_and_Set

Implements the classic ``test and set'' operation.

This class keeps track of the status of <is_set_>, which can be set based on various events (such as receipt of a signal). This class is derived from so that it can be "signaled" by a Reactor when a signal occurs. We assume that <TYPE> is a data type that can be assigned the value 0 or 1.


Constructor & Destructor Documentation

template<classACE_LOCK, classTYPE>
const char *get_rcsid_ace _ ACE_Test_and_Set< ACE_LOCK,TYPE >::ACE_Test_and_Set<ACE_LOCK, TYPE> ( TYPE initial_value = 0 ) [inline]
 


Member Function Documentation

template<classACE_LOCK, classTYPE>
int ACE_Test_and_Set<ACE_LOCK, TYPE>::handle_signal ( int signum,
siginfo_t * siginfo = 0,
ucontext_t * ucontext = 0 ) [virtual]
 

Called when object is signaled by OS (either via UNIX signals or when a Win32 object becomes signaled).

Reimplemented from ACE_Event_Handler.

template<classACE_LOCK, classTYPE>
TYPE ACE_Test_and_Set<ACE_LOCK, TYPE>::is_set ( void ) const
 

Returns true if we are set, else false.

template<classACE_LOCK, classTYPE>
TYPE ACE_Test_and_Set<ACE_LOCK, TYPE>::set ( TYPE status )
 

Sets the <is_set_> status, returning the original value of <is_set_>.


Member Data Documentation

template<classACE_LOCK, classTYPE>
TYPE ACE_Test_and_Set<ACE_LOCK, TYPE>::is_set_ [private]
 

Keeps track of our state.

template<classACE_LOCK, classTYPE>
ACE_LOCK ACE_Test_and_Set<ACE_LOCK, TYPE>::lock_ [private]
 

Protect the state from race conditions.


The documentation for this class was generated from the following files:
Generated at Fri Oct 5 07:05:02 2001 for ACE by doxygen1.2.3 written by Dimitri van Heesch, © 1997-2000