class PIntCondMutex

This is a PCondMutex for which the conditional is the value of an integer

Inheritance:


Public Methods

[more] Overrides from class PObject
[more] Condition access functions

Public Members

[more] Construction


Inherited from PCondMutex:

Public Methods

ovirtual void WaitCondition()
ovirtual void Signal()
ovirtual BOOL Condition()
ovirtual void OnWait()


Inherited from PMutex:


Inherited from PSemaphore:

Public Methods

Operations


Inherited from PObject:

Public Methods

Run Time Type functions

I/O functions

Public Members

Comparison functions


Documentation

This is a PCondMutex for which the conditional is the value of an integer
o Construction

oenum Operation
defines possible operators on current value and target value

o LT
Less than

o LE
Less than or equal to

o EQ
Equal to

o GE
Greater than or equal to

o GT
Greater than

o PIntCondMutex( int value = 0, int target = 0, Operation operation = LE )
Create a cond mutex using an integer
Parameters:
- value initial value if the integer
target - target vaue which causes the mutex to unlock
operation - comparison operator

o Overrides from class PObject

ovoid PrintOn(ostream & strm) const
Print the object on the stream. This will be of the form "(value < target)".

o Condition access functions

ovirtual BOOL Condition()
This is the condition that must be met for the WaitCondition() function to acquire the mutex.

Returns:
TRUE if condition is met.

o operator int() const
Get the current value of the condition variable.
Returns:
Current condition variable value.

oPIntCondMutex& operator=(int newval)
Assign new condition value. Use the Wait() function to acquire the mutex, modify the value, then release the mutex, possibly releasing the thread in the WaitCondition() function if the condition was met by the operation.

Returns:
The object reference for consecutive operations in the same statement.

oPIntCondMutex& operator++()
Increment condition value. Use the Wait() function to acquire the mutex, modify the value, then release the mutex, possibly releasing the thread in the WaitCondition() function if the condition was met by the operation.

Returns:
The object reference for consecutive operations in the same statement.

oPIntCondMutex& operator+=(int inc)
Add to condition value. Use the Wait() function to acquire the mutex, modify the value, then release the mutex, possibly releasing the thread in the WaitCondition() function if the condition was met by the operation.

Returns:
The object reference for consecutive operations in the same statement.

oPIntCondMutex& operator--()
Decrement condition value. Use the Wait() function to acquire the mutex, modify the value, then release the mutex, possibly releasing the thread in the WaitCondition() function if the condition was met by the operation.

Returns:
The object reference for consecutive operations in the same statement.

oPIntCondMutex& operator-=(int dec)
Subtract from condition value. Use the Wait() function to acquire the mutex, modify the value, then release the mutex, possibly releasing the thread in the WaitCondition() function if the condition was met by the operation.

Returns:
The object reference for consecutive operations in the same statement.


This class has no child classes.

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.