-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrmSource.h
More file actions
56 lines (45 loc) · 1.33 KB
/
rmSource.h
File metadata and controls
56 lines (45 loc) · 1.33 KB
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
/*******************************************************************
*
* DESCRIPTION: Atomic Model RmSource
*
* AUTHOR: Abdullah Alfaify
*
* EMAIL: mailto://aalfa064@uottawa.ca
*
* DATE: 14/12/2011
*
*******************************************************************/
#ifndef __RMSOURCE_H
#define __RMSOURCE_H
#include "atomic.h" // class Atomic
class RmSource : public Atomic
{
public:
RmSource( const string &name = "RmSource" ); //Default constructor
virtual string className() const ;
protected:
Model &initFunction();
Model &externalFunction( const ExternalMessage & );
Model &internalFunction( const InternalMessage & );
Model &outputFunction( const InternalMessage & );
private:
const Port &out , &mg , &rmCount;
Time preparationTime;
int BufferMaxSize; // used for compression with received buffer size in order to send or not
int requierdToSend; // to check how many RM should be sent to fill up the buffer
// buffer here is like storage place which has a capacity, but raw material source is unlimited.
enum State{
generate ,
wait
};
State state;
int counter; //to count RM
Time timeLeft; // we will use it to sent immediately
}; // class RmSource
// ** inline ** //
inline
string RmSource::className() const
{
return "RmSource" ;
}
#endif //__RMSOURCE_H