-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconcent.h
65 lines (54 loc) · 1.36 KB
/
concent.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
/*******************************************************************
*
* DESCRIPTION: Atomic Model Concentrador
*
* AUTHOR: Ariel Gonzalez
*
* EMAIL: mailto://egonzalz@dc.uba.ar
* mailto://agonzalez@tecnet-ibermatica.com.ar
*
* DATE: 27/9/2003
*
*******************************************************************/
#ifndef __CONCE_H
#define __CONCE_H
#include "atomic.h" // class Atomic
#include "datos.h" // tipos de datos y conversiones
#define TAM_COLA 15
class Concentrador : public Atomic
{
public:
Concentrador( const string &name = "Concentrador" ); //Default constructor
virtual string className() const ;
protected:
Model &initFunction();
Model &externalFunction( const ExternalMessage & );
Model &internalFunction( const InternalMessage & );
Model &outputFunction( const InternalMessage & );
private:
const Port &in1;
const Port &in2;
const Port ∈
Port &out1;
Port &out2;
Port &out;
// parametros
Time timeout;
Time ultimo_ingreso;
Time tiempo_restante;
// variables de estado
typedef struct { int origen; int origen_red; Value msg; } Pedido;
typedef list<Pedido> ColaConcentrador ;
ColaConcentrador q ;
int hay_pedido ;
int respuesta_lista ;
int respuesta_enviada ;
Value respuesta;
}; // class Concentrador
// ** inline ** //
inline
string Concentrador::className() const
{
return "Concentrador" ;
}
#endif //__CONCE_H