TestToolBox::Synchronizer Class Reference

This class supports synchronization of parallel activities with a linear test sequence. More...

#include <Synchronizer.h>

Inheritance diagram for TestToolBox::Synchronizer:
Inheritance graph
Collaboration diagram for TestToolBox::Synchronizer:
Collaboration graph

List of all members.

Private Types

typedef ObjectLockT< SynchronizerObjectLock
 automatic locking facility

Private Attributes

long m_curSyncCount
 Counts calls of Sync().
long m_numSyncEventsToWaitFor
 Counter value at which the wait condition is fulfilled, i.e. WaitSync() returns.
long m_syncTimeoutMs
 Maximum timeout to wait if not all sync events occure. If this timeout elapses WaitSync() returns and an message is written to test protocol via m_pIEventReceiver.
HANDLE m_hSyncEvent
 Handle to the synchronization event.
 Interface for processing all important test situations (e.g. detected error situations).

Interface ISynchronizer

void ConnectWithEventReceiver (IEventReceiver *in_pIEventReceiver)
 Connect with callback interface. This method is intended to be used by the specific report facility of the test environment. The synchronizer will inform the tets environment through the callback interface when error conditions are detected.
void SetSyncTimeout (long in_timeoutMs)
 Define maximum timeout to wait for sync events.
void InitSync (long in_numSyncEventsToWaitFor)
 Init wait conditions. Define the number of events to wait for.
void WaitSync (const char *in_fileName=0, const long in_lineNum=0)
 Wait until the configured number of sync events has occurred. The number of sync events to wait for is given by the last call of InitSync(). If not all sync events arrive within a specific period of time a timeout error is generated and the function returns. The timeout is defined by the last call of SetSyncTimeout().
void Sync (const char *in_fileName=0, const long in_lineNum=0)
 Signals that a single sync event has occured. The event represents an arbitrary action that has occured during the test (e.g. an asynchronous callback was executed, a notification arrived, an asynchronous telegram was received). In most cases before generating the sync event the information about the kind of the event (e.g. the contents of the received telegram) has to be stored within the specific test environment to make possible an automatic verification of test events even in case of asynchronous occurance.

Detailed Description

This class supports synchronization of parallel activities with a linear test sequence.

The class counts the number of calls to member function Sync(). When the configured number of calls is reached the blocking call of WaitSync() returns.

See also:
Synchronizer.h (File documentation)
GrpTestExtensionsForBoost (unit test using boost.Test and Synchronizer)
Using Synchronizer (Usage documentation)

The documentation for this class was generated from the following file:
Generated on Fri May 27 22:57:34 2011 for TestToolBox by  doxygen 1.6.3