C++ TargetRTS
Loading...
Searching...
No Matches
RTObserver.h
1/*
2 * Licensed Materials - Property of HCL and/or IBM
3 * Copyright HCL Technologies Ltd. 2016, 2021. All Rights Reserved.
4 * Copyright IBM Corporation 1999, 2016. All Rights Reserved.
5 *
6 * U.S. Government Users Restricted Rights - Use, duplication or
7 * disclosure restricted by GSA ADP Schedule.
8 */
9
10#ifndef __RTObserver_h__
11#define __RTObserver_h__ included
12
13#ifdef PRAGMA
14#pragma interface
15#endif
16
17#ifndef __RTElasticArray_h__
18#include <RTElasticArray.h>
19#endif
20
21class RTDaemon;
22class RTDaemonInfo;
23class RTDebugger;
24class RTEventInfo;
25class RTTcpSocket;
26
28{
29protected:
30 enum LastFlowCmd { FlowNone, FlowPause, FlowResume };
31
32 RTDebugger * debugger;
33 RTTcpSocket * socket;
34 int observerId;
35 RTDaemon * daemon;
36 RTElasticArray daemons;
37 RTDaemon * superDaemon;
38
39 int bufSize;
40 int bufUsed;
41 char * inBuffer;
42
43 int haltByProbe;
44 int resumeToRun;
45 LastFlowCmd lastFlowCmd;
46
47public:
48 RTObserver( RTDebugger * theDebugger,
49 RTTcpSocket * theSocket,
50 int theObsId,
51 const char * initBuf = nullptr,
52 int initLen = 0 );
53
54 virtual ~RTObserver( void );
55 int setDaemon( int daemonNr );
56
57 void cmdCommand ( const char * commandString );
58 void cmdCreateDaemon ( int daemonNr );
59 void cmdDestroyDaemon( int daemonNr );
60
61 int addInfo( RTDaemonInfo * theInfo );
62 int delInfo( RTDaemonInfo * theInfo );
63
64 int prepareEvent( RTEventInfo & eventInfo );
65 void dispatchEvent( RTEventInfo & eventInfo );
66
67 virtual int evtChain( int daemonId,
68 const RTDaemonInfo & daemonInfo,
69 const RTEventInfo & eventInfo );
70 virtual int evtState( int daemonId,
71 const RTDaemonInfo & daemonInfo,
72 const RTEventInfo & eventInfo );
73
74 virtual int evtPresence( int daemonId,
75 const RTDaemonInfo & daemonInfo,
76 const RTEventInfo & eventInfo );
77
78 virtual int evtReference( int daemonId,
79 const RTDaemonInfo & daemonInfo,
80 const RTEventInfo & eventInfo );
81
82 virtual int evtMessageIn( int daemonId,
83 const RTDaemonInfo & daemonInfo,
84 const RTEventInfo & eventInfo );
85
86 virtual int evtMessageOut( int daemonId,
87 const RTDaemonInfo & daemonInfo,
88 const RTEventInfo & eventInfo );
89
90 virtual int evtMessageOutIn( int daemonId,
91 const RTDaemonInfo & sndDaemonInfo,
92 const RTDaemonInfo & recDaemonInfo,
93 const RTEventInfo & eventInfo );
94
95 virtual int evtRtsStatus( int daemonId,
96 const RTEventInfo & eventInfo );
97
98 virtual int evtVariable( int daemonId,
99 const RTDaemonInfo & daemonInfo,
100 const RTEventInfo & eventInfo );
101
102 virtual int evtChildren( int daemonId,
103 const RTDaemonInfo & daemonInfo,
104 const RTEventInfo & eventInfo );
105
106 virtual int evtHistory( int daemonId,
107 const RTDaemonInfo & daemonInfo,
108 const RTEventInfo & eventInfo );
109
110 virtual int evtMessageQueue( int daemonId,
111 const RTDaemonInfo & daemonInfo,
112 const RTEventInfo & eventInfo );
113
114 virtual int receiveData ( void );
115 virtual int transmitData( void );
116
117 int readData( char * buf, int buflen );
118 int sendData( const char * buf, int buflen = 0 );
119
120private:
121 // unavailable methods
122 RTObserver( const RTObserver & );
123 RTObserver & operator=( const RTObserver & );
124}; //lint !e1712
125
126#endif // __RTObserver_h__
Definition: RTDaemon.h:31
Definition: RTDaemonInfo.h:24
Definition: RTDebugger.h:58
Definition: RTElasticArray.h:22
Definition: RTEventInfo.h:26
Definition: RTObserver.h:28
Definition: RTTcpSocket.h:24