IGLib  1.7.2
The IGLib base library for development of numerical, technical and business applications.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
IG.Lib.WaitConditionBase Class Referenceabstract

Base class for objects that perform waiting until a condition is fulfilled. More...

+ Inheritance diagram for IG.Lib.WaitConditionBase:
+ Collaboration diagram for IG.Lib.WaitConditionBase:

Public Member Functions

abstract bool Condition ()
 Returns true if unblocking condition is satisfied, and false otherwise. More...
 
virtual void CancelOne ()
 Cancels the current waiting for the condition (if one is going on) and unblocks the thread on which waiting was called (possibly with some latency). More...
 
virtual void CancelAll ()
 Cancel the current waiting for the condition on all threads. More...
 
abstract void Wait ()
 Blocks until the specified condition gets satisfied. See class description for details. More...
 

Properties

object Lock [get]
 This object's central lock object to be used by other object. Do not use this object for locking in class' methods, for this you should use InternalLock. More...
 
object InternalLock [get]
 Used internally for locking access to internal fields. More...
 
object WaitLock [get]
 Must be used only for locking waiting the Waiting() block (since it is potentially time consuming). More...
 
virtual bool IsWaiting [get, protected set]
 True if waiting for unblocking condition is currently performed, and false otherwise. Setting should only be done within the waiting function. More...
 
virtual bool CancelFlag [get, set]
 If this flag is set then the current waiting (if one is going on) will be cancelled. More...
 
- Properties inherited from IG.Lib.IWaitCondition
bool IsWaiting [get]
 Returns true if waiting for unblocking condition is currently performed, and false otherwise. Setting should only be done within the waiting function. More...
 
- Properties inherited from IG.Lib.ILockable
object Lock [get]
 

Private Attributes

object mainlock = new object()
 
object internallock = new object()
 
object waitlock = new object()
 
int _numWaiting = 0
 
bool _canceFlag = false
 

Detailed Description

Base class for objects that perform waiting until a condition is fulfilled.

Member Function Documentation

virtual void IG.Lib.WaitConditionBase.CancelOne ( )
inlinevirtual

Cancels the current waiting for the condition (if one is going on) and unblocks the thread on which waiting was called (possibly with some latency).

Implements IG.Lib.IWaitCondition.

Reimplemented in IG.Lib.WaitFileEventBaseByProxyLatence, and IG.Lib.WaitFileEventBase.

Referenced by IG.Lib.WaitFileEventBaseByProxyLatence.CancelOne().

virtual void IG.Lib.WaitConditionBase.CancelAll ( )
inlinevirtual

Cancel the current waiting for the condition on all threads.

Implements IG.Lib.IWaitCondition.

Reimplemented in IG.Lib.WaitFileEventBase.

abstract void IG.Lib.WaitConditionBase.Wait ( )
pure virtual

Blocks until the specified condition gets satisfied. See class description for details.

This method will normally not be overridden, except with intention to change the condition check time plan. When overriding, use the original method as template.

Implements IG.Lib.IWaitCondition.

Implemented in IG.Lib.WaitFileEventBaseByProxyLatence, IG.Lib.WaitDirectoryRemoval, IG.Lib.WaitDirectoryCreation, IG.Lib.WaitFileRemoval, IG.Lib.WaitFileCreation, IG.Lib.WaitFileEventBase, and IG.Lib.WaitCondition.

Member Data Documentation

object IG.Lib.WaitConditionBase.mainlock = new object()
private
object IG.Lib.WaitConditionBase.internallock = new object()
private
object IG.Lib.WaitConditionBase.waitlock = new object()
private
int IG.Lib.WaitConditionBase._numWaiting = 0
private
bool IG.Lib.WaitConditionBase._canceFlag = false
private

Property Documentation

object IG.Lib.WaitConditionBase.Lock
get

This object's central lock object to be used by other object. Do not use this object for locking in class' methods, for this you should use InternalLock.

object IG.Lib.WaitConditionBase.InternalLock
getprotected

Used internally for locking access to internal fields.

object IG.Lib.WaitConditionBase.WaitLock
getprotected

Must be used only for locking waiting the Waiting() block (since it is potentially time consuming).

virtual bool IG.Lib.WaitConditionBase.IsWaiting
getprotected set

True if waiting for unblocking condition is currently performed, and false otherwise. Setting should only be done within the waiting function.

virtual bool IG.Lib.WaitConditionBase.CancelFlag
getsetprotected

If this flag is set then the current waiting (if one is going on) will be cancelled.


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