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.WaitFileEventLatenceBase Class Reference

Base class for classes that impelement methods that block until a file or directory is created or deleted. More...

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

Classes

class  ExampleLatence
 Class containing examples for More...
 

Public Member Functions

override bool Condition ()
 This method should be overridden in derived classes. More...
 
- Public Member Functions inherited from IG.Lib.WaitCondition
 WaitCondition ()
 Creates event waiter with properties initialized to default values. More...
 
 WaitCondition (int minSleepMs, double maxRelativeLatency)
 Creates event waiter with properties initialized to specified values (or to default valuse for those parameters that are not specified). More...
 
 WaitCondition (int minSleepMs, int maxSleepMs, double maxRelativeLatency, bool sleepFirst)
 Creates event waiter with properties initialized to specified values (or to default valuse for those parameters that are not specified). More...
 
override bool Condition ()
 Function that returns true if unblocking condition is satisfied, and false otherwise. If the condition delegate is set then the delegate is used to evaluate the condition, otherwise the protected method ConditionFunction() is used. The condition can therefore be adjusted in one of the following ways: More...
 
override void Wait ()
 Blocks until the specified condition gets satisfied. See class description for details. More...
 
override string ToString ()
 
- Public Member Functions inherited from IG.Lib.WaitConditionBase
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...
 

Static Public Member Functions

static void ExampleBlockCreateRemoveLatence (string filePath)
 Monitors the specified file and successively blocks until it is created and then until it is removed. This procedure is repeated twice. More...
 
static void ExampleBlockCreateRemoveLatence (string filePath, int numSwitches)
 Monitors the specified file and successively blocks until it is created and then until it is removed. More...
 
static void ExampleBlockCreateRemoveLatence (string filePath, int numSwitches, bool waitDirectory)
 Monitors the specified file and successively blocks until it is created and then until it is removed. More...
 
static void TestSpeedBlockCreateRemoveLatence (string filePath)
 Test of speed of reaction of file/directory creation and removal blocking waits. A specified number of alternate creations and removals are perfomed in a parallel thread, with specified delay between them. In the main thread, blocking waits are performed waiting for creation/removal in an infinite loop, and it is counted how many events are captured and how many are missed. More...
 
static void TestSpeedBlockCreateRemoveLatence (string filePath, int numSwitches, int sleepMs)
 Test of speed of reaction of file/directory creation and removal blocking waits. A specified number of alternate creations and removals are perfomed in a parallel thread, with specified delay between them. In the main thread, blocking waits are performed waiting for creation/removal in an infinite loop, and it is counted how many events are captured and how many are missed. More...
 
static void TestSpeedBlockCreateRemoveLatence (string filePath, int numSwitches, int sleepMs, bool waitDirectory)
 Test of speed of reaction of file/directory creation and removal blocking waits. A specified number of alternate creations and removals are perfomed in a parallel thread, with specified delay between them. In the main thread, blocking waits are performed waiting for creation/removal in an infinite loop, and it is counted how many events are captured and how many are missed. More...
 

Protected Member Functions

 WaitFileEventLatenceBase (string fileOrdirectoryPath)
 
sealed override bool ConditionFunction ()
 Must not be used! More...
 
- Protected Member Functions inherited from IG.Lib.WaitCondition
virtual void InitWaitCondition ()
 Initializes object properties with default values. More...
 
virtual void InitWaitCondition (int minSleepMs, double maxRelativeLatency)
 Initializes blocking parameters to the specified values (or to default values for those parameters that are not specified). More...
 
virtual void InitWaitCondition (int minSleepMs, int maxSleepMs, double maxRelativeLatency, bool sleepFirst)
 Initializes blocking parameters. More...
 

Protected Attributes

string _fileOrDirectoryPath
 File or directory name. More...
 
- Protected Attributes inherited from IG.Lib.WaitCondition
ConditionDelegateBase _conditionDelegate = null
 
int _minSleepMs = 1
 
StopWatch1 _timer = null
 

Properties

string Path [get, set]
 Get or set path of the file on which the particular event is waited for. More...
 
sealed override
ConditionDelegateBase 
ConditionDelegate [protected get, set]
 Setter of this property must not be used! More...
 
- Properties inherited from IG.Lib.WaitCondition
virtual ConditionDelegateBase ConditionDelegate [protected get, set]
 Contains function that is called to evaluate the unblocking condition. If this delegate is set and Condition() is not overridden then the delegate is used to check whether the unblocking condition is satisfied. More...
 
virtual int MinSleepMs [get, set]
 Minimal sleeping time, in milliseconds, between successive condition checks. If less than 0 then minimal sleeping time is not specified, so there may be no sleeping. More...
 
virtual int MaxSleepMs [get, set]
 Maximal sleeping time, in milliseconds, between successive condition checks. If less than 0 then maximal sleeping time is not specified and sleeping interval is not bounded above. If set to 0 then no sleeping will be performed between successive checks (max. sleeping time overrides the minimal sleeping time). More...
 
virtual double MaxRelativeLatency [get, set]
 Maximal relative latency of waiting procedure. Sleeping time chosen between two successive condition check willl be chosen smaller or equal to total elapsed waiting time multiplied by this number. If less than 0 then maximal relative latency is not specified. If minimal sleeping time is specified then it overrides the sleeping time calculated according to this parameter. More...
 
virtual bool SleepFirst [get, set]
 If true and if minimal sleeping time is larger than 0, then sleep for minimal sleeping time will be performed before the first check for unblocking condition. More...
 
StopWatch1 Timer [get]
 Timer that measures the total time elapsed when waiting for fulfillment of unblocking condition. Used to evaluate appropriate sleeping times that will not cause too much latency. More...
 
- Properties inherited from IG.Lib.WaitConditionBase
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]
 
- Properties inherited from IG.Lib.IWaitFileEvent
string Path [get, set]
 Path of the file or directory on which the particular event is waited for. Can be specified as relative path, but is internally stored as fully qualified path. More...
 

Private Member Functions

 WaitFileEventLatenceBase ()
 

Detailed Description

Base class for classes that impelement methods that block until a file or directory is created or deleted.

$A Igor Jun10;

Constructor & Destructor Documentation

IG.Lib.WaitFileEventLatenceBase.WaitFileEventLatenceBase ( )
inlineprivate
IG.Lib.WaitFileEventLatenceBase.WaitFileEventLatenceBase ( string  fileOrdirectoryPath)
inlineprotected

Member Function Documentation

override bool IG.Lib.WaitFileEventLatenceBase.Condition ( )
inline

This method should be overridden in derived classes.

Implements IG.Lib.IWaitCondition.

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

sealed override bool IG.Lib.WaitFileEventLatenceBase.ConditionFunction ( )
inlineprotectedvirtual

Must not be used!

Reimplemented from IG.Lib.WaitCondition.

static void IG.Lib.WaitFileEventLatenceBase.ExampleBlockCreateRemoveLatence ( string  filePath)
inlinestatic

Monitors the specified file and successively blocks until it is created and then until it is removed. This procedure is repeated twice.

Parameters
filePathFile whose creation and removal is monitored.

References IG.Lib.WaitFileEventLatenceBase.ExampleLatence.ExampleBlockCreateRemove().

static void IG.Lib.WaitFileEventLatenceBase.ExampleBlockCreateRemoveLatence ( string  filePath,
int  numSwitches 
)
inlinestatic

Monitors the specified file and successively blocks until it is created and then until it is removed.

Parameters
filePathFile whose creation and removal is monitored.
numSwitchesNumber of iterations (creation/removal waits).

References IG.Lib.WaitFileEventLatenceBase.ExampleLatence.ExampleBlockCreateRemove().

static void IG.Lib.WaitFileEventLatenceBase.ExampleBlockCreateRemoveLatence ( string  filePath,
int  numSwitches,
bool  waitDirectory 
)
inlinestatic

Monitors the specified file and successively blocks until it is created and then until it is removed.

Parameters
filePathFile whose creation and removal is monitored.
numSwitchesNumber of iterations (creation/removal waits).
waitDirectoryIf true then creation/removal of a directory is waiting.

References IG.Lib.WaitFileEventLatenceBase.ExampleLatence.ExampleBlockCreateRemove().

static void IG.Lib.WaitFileEventLatenceBase.TestSpeedBlockCreateRemoveLatence ( string  filePath)
inlinestatic

Test of speed of reaction of file/directory creation and removal blocking waits. A specified number of alternate creations and removals are perfomed in a parallel thread, with specified delay between them. In the main thread, blocking waits are performed waiting for creation/removal in an infinite loop, and it is counted how many events are captured and how many are missed.

Parameters
filePathFile whose creation and removal is monitored.

References IG.Lib.WaitFileEventLatenceBase.ExampleLatence.TestSpeedBlockCreateRemove().

static void IG.Lib.WaitFileEventLatenceBase.TestSpeedBlockCreateRemoveLatence ( string  filePath,
int  numSwitches,
int  sleepMs 
)
inlinestatic

Test of speed of reaction of file/directory creation and removal blocking waits. A specified number of alternate creations and removals are perfomed in a parallel thread, with specified delay between them. In the main thread, blocking waits are performed waiting for creation/removal in an infinite loop, and it is counted how many events are captured and how many are missed.

Parameters
filePathFile whose creation and removal is monitored.
numSwitchesNumber of iterations (creation/removal waits).
sleepMsNumber of milliseconds to sleep between examples.

References IG.Lib.WaitFileEventLatenceBase.ExampleLatence.TestSpeedBlockCreateRemove().

static void IG.Lib.WaitFileEventLatenceBase.TestSpeedBlockCreateRemoveLatence ( string  filePath,
int  numSwitches,
int  sleepMs,
bool  waitDirectory 
)
inlinestatic

Test of speed of reaction of file/directory creation and removal blocking waits. A specified number of alternate creations and removals are perfomed in a parallel thread, with specified delay between them. In the main thread, blocking waits are performed waiting for creation/removal in an infinite loop, and it is counted how many events are captured and how many are missed.

Parameters
filePathFile whose creation and removal is monitored.
numSwitchesNumber of iterations (creation/removal waits).
sleepMsNumber of milliseconds to sleep between examples.
waitDirectoryIf true then creation/removal of a directory is waiting.

References IG.Lib.WaitFileEventLatenceBase.ExampleLatence.TestSpeedBlockCreateRemove().

Member Data Documentation

string IG.Lib.WaitFileEventLatenceBase._fileOrDirectoryPath
protected

File or directory name.

Property Documentation

string IG.Lib.WaitFileEventLatenceBase.Path
getset

Get or set path of the file on which the particular event is waited for.

sealed override ConditionDelegateBase IG.Lib.WaitFileEventLatenceBase.ConditionDelegate
protected getset

Setter of this property must not be used!


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