-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcoordin.h
75 lines (53 loc) · 1.54 KB
/
coordin.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
/*******************************************************************
*
* DESCRIPTION: class Coordinator
*
* AUTHOR: Amir Barylko & Jorge Beyoglonian
* Version 2: Daniel A. Rodriguez
*
* EMAIL: mailto://[email protected]
* mailto://[email protected]
* mailto://[email protected]
*
* DATE: 27/6/1998
* DATE: 04/6/1999 (v2)
*
*******************************************************************/
#ifndef __COORDINATOR_H
#define __COORDINATOR_H
/** include files **/
#include "process.h" // class Processor
/** forward declarations **/
class Coupled ;
/** declarations **/
class Coordinator: public Processor
{
public:
Coordinator( Coupled * ); //constructor
Processor &receive( const InitMessage & ) ;
Processor &receive( const InternalMessage & ) ;
Processor &receive( const OutputMessage & ) ;
Processor &receive( const ExternalMessage & ) ;
Processor &receive( const DoneMessage & ) ;
protected:
Coordinator(const Coordinator & ) ; // Copy constructor
Coordinator& operator=(const Coordinator & ) ; // Assignment operator
int operator==(const Coordinator & ) const ; // Equality operator
Processor &id( const ProcId &pid ) ;
const ProcId &inminentChild() const
{return inminent;}
Coordinator &inminentChild( const ProcId & ) ;
long doneCount;
long receivedX;
private:
ProcId inminent ;
Coordinator &recalcInminentChild() ;
}; // class Coordinator
/** inline **/
inline
Coordinator &Coordinator::inminentChild( const ProcId &mid )
{
inminent = mid ;
return *this ;
}
#endif //__COORDINATOR_H