Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Data Structures   File List   Namespace Members   Data Fields   Globals   Related Pages   Examples  

Wait Class Reference
[Synchronisation]

Inherits ProcessObserver, DefLabeledObject, and TraceProducer.


Detailed Description

Wait for termination of #n process objects

Author:
Ralf Gerstenberger

Note:
Wait supports Trace
Wait is used to synchronise a process with the termination of one ore more partner processes.

Since:
1.0


Public Member Functions

 Wait (Simulation *s, Label l)
 Construction.

 Wait (Simulation *s, Label l, Process *oP1)
 Construction and wait.

 Wait (Simulation *s, Label l, Process *oP1, Process *oP2, bool all=true)
 Construction.

 Wait (Simulation *s, Label l, Process *oP1, Process *oP2, Process *oP3, bool all=true)
 Construction.

 Wait (Simulation *s, Label l, int size, Process *oP[], bool all=true)
 Construction.

virtual ~Wait ()
 Destructor.

void addProcess (Process *p)
 Add process p to observed list.

void removeProcess (Process *p)
 Remove process p from observed list.

bool getCondition () const
 Get Condition (wait for one or all observed Process objects to finish).

void setCondition (bool all=true)
 Set Condition (wait for one or all observed Process objects to finish).

bool wait ()
 Wait for (one) all observed process to finish.

virtual TracegetTrace () const
 Pointer to trace.

virtual void onDestroy (Process *sender)
virtual void onChangeState (Process *sender, Process::State oldState, Process::State newState)

Static Public Attributes

Wait specific marks
const MarkTypeId baseMarkId = 1000
const MarkType markCreate = MarkType("create", baseMarkId+1, typeid(Wait))
const MarkType markDestroy = MarkType("destroy", baseMarkId+2, typeid(Wait))
const MarkType markWait = MarkType("wait", baseMarkId+10, typeid(Wait))
const MarkType markContinue = MarkType("continue", baseMarkId+11, typeid(Wait))
const TagId baseTagId = 1000


Constructor & Destructor Documentation

Wait Simulation s,
Label  l
 

Construction.

Parameters:
s pointer to Simulation object
l label of this object

Wait Simulation s,
Label  l,
Process oP1
 

Construction and wait.

This constructor creates a Wait object and waits for Process oP1 to finish. If the blocked Process is interrupted, it is reactivated and the constructor returns. To check whether the process was interrupted, use the isInterrupted() method of Process.

Parameters:
s pointer to Simulation object
l label of this object
oP1 process to wait for

Wait Simulation s,
Label  l,
Process oP1,
Process oP2,
bool  all = true
 

Construction.

This constructor creates a Wait object and waits for the Process objects oP1 and (or) oP2 to finish. If the blocked Process is interrupted, it is reactivated and the constructor returns. To check whether the process was interrupted, use the isInterrupted() method of Process.

Parameters:
s pointer to Simulation object
l label of this object
oP1 first process to wait for
oP2 second process to wait for
all wait for all processes

Wait Simulation s,
Label  l,
Process oP1,
Process oP2,
Process oP3,
bool  all = true
 

Construction.

This constructor creates a Wait object and waits for the Process objects oP1, oP2 and(or) oP3 to finish. If the blocked Process is interrupted, it is reactivated and the constructor returns. To check whether the process was interrupted, use the isInterrupted() method of Process.

Parameters:
s pointer to Simulation object
l label of this object
oP1 first process to wait for
oP2 second process to wait for
oP3 third process to wait for
all wait for all processes

Wait Simulation s,
Label  l,
int  size,
Process oP[],
bool  all = true
 

Construction.

This constructor creates a Wait object and waits for the Process objects stored in oP to finish. If the blocked Process is interrupted, it is reactivated and the constructor returns. To check whether the process was interrupted, use the isInterrupted() method of Process.

Parameters:
s pointer to Simulation object
l abel of this object
size number of processes in oP
oP processes to wait for
all wait for all processes


Member Function Documentation

bool wait  ) 
 

Wait for (one) all observed process to finish.

Wait for one or all observed processes to finish. If the blocked Process is interrupted int is reactivated and wait() returns false. Otherwise wait() returns true.


Generated on Mon Aug 11 10:36:07 2003 for ODEMx by doxygen1.3