-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtupleclient.cpp
More file actions
65 lines (55 loc) · 1.83 KB
/
tupleclient.cpp
File metadata and controls
65 lines (55 loc) · 1.83 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
57
58
59
60
61
62
63
64
65
/*******************************************************************
*
* DESCRIPTION: class TupleClient
*
* AUTHOR: Umar Farooq
*
* EMAIL: ufarooq@sce.carleton.ca
*
* DATE: 17/10/2003
*
*******************************************************************/
/** include files **/
#include <math.h>
#include "tupleclient.h" // base header
#include "message.h" // InternalMessage ....
#include "mainsimu.h" // class MainSimulator
/*******************************************************************
* Function Name: TupleClient
* Description: constructor
********************************************************************/
Tupleclient::Tupleclient( const string &name )
: Atomic( name )
, inCObject( addInputPort( "inCObject" ) )
, outCObject( addOutputPort( "outCObject" ) )
{ }
Model &Tupleclient::initFunction()
{
writeTime = "00:00:02:000";
return *this ;
}
/*******************************************************************
* Function Name: externalFunction
********************************************************************/
Model &Tupleclient::externalFunction( const ExternalMessage &msg )
{
oid = static_cast< int >( msg.value() ) ;
holdIn( active,writeTime) ;
return *this ;
}
/*******************************************************************
* Function Name: internalFunction
********************************************************************/
Model &Tupleclient::internalFunction( const InternalMessage & )
{
passivate();
return *this;
}
/*******************************************************************
* Function Name: outputFunction
********************************************************************/
Model &Tupleclient::outputFunction( const InternalMessage &msg )
{
sendOutput( msg.time(), outCObject, oid );
return *this;
}