C++ TargetRTS
Loading...
Searching...
No Matches
endeTarg.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 __endeTarg_h__
11#define __endeTarg_h__ included
12
13#ifndef __endeBoth_h__
14#include <endeBoth.h>
15#endif
16
17#ifdef __cplusplus
18extern "C"
19{
20#endif
21
22/*||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
23||
24|| Public Toolset functions:
25||
26+|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||*/
27
28/*----------------------------------------------------------------------------
29| Encode information into the buf.
30+-----------------------------------------------------------------------------
31| Common parameters:
32| - TO_bufferInfo *buf:
33| + YOU malloc buf->data and set buf->size accordingly.
34| - TO_daemonInfo *daemon:
35| + YOU set daemon->number to the desired daemon number.
36| + YOU set daemon->invokeID to any string identifier.
37+-----------------------------------------------------------------------------
38| If encoding was successful:
39| - returns ENC_SUCCESS and sets buf->status to same as return value
40| - fills buf->data with encoded bytes
41| - sets buf->used to number of bytes actually used
42|
43| If encoding was unsuccessful:
44| - returns != ENC_SUCCESS (see enum encodingResult for details),
45| and sets buf->status to same as return value
46| - sets buf->used to roughly where in buf->data something went wrong
47+-----------------------------------------------------------------------------
48| Example adding an actor to an existing daemon:
49|
50| TO_bufferInfo buf;
51| TO_daemonInfo daemon;
52| TO_actorInfo info;
53|
54| // YOU set the buf.data, buf.size and daemon.* fields
55| // You don't need to set buf.used or buf.status
56|
57| // YOU set all the info.* fields
58|
59| TO_encodeAddActor( &buf, &daemon, &info );
60| switch( buf.status )
61| {
62| case ENC_SUCCESS:
63| // Cool! Please feel free to use buf.data in any way you like.
64| break;
65| case ENC_BAD_PARM:
66| // One or both parameters to TO_encodeAddActor were null pointers.
67| break;
68| case ENC_BAD_FUNC_TYPE:
69| // You tried to encode an unknown function number.
70| break;
71| case ENC_OVERFLOW:
72| // The buffer (buf.data) is too small. Try again with double size.
73| break;
74| }
75+---------------------------------------------------------------------------*/
76
77/*----------------------------------------------------------------------------
78| Result code from any Toolset operation
79+---------------------------------------------------------------------------*/
80int TO_encodeResultCode( TO_bufferInfo * buf,
81 TO_daemonInfo * daemon,
82 TO_resultCode * code );
83
84/*----------------------------------------------------------------------------
85| Event Presence
86+---------------------------------------------------------------------------*/
87int TO_encodeEvtPresence( TO_bufferInfo * buf,
88 TO_daemonInfo * daemon,
89 TO_evtPresence * evt );
90
91/*----------------------------------------------------------------------------
92| Event Reference
93+---------------------------------------------------------------------------*/
94int TO_encodeEvtReference( TO_bufferInfo * buf,
95 TO_daemonInfo * daemon,
96 TO_evtReference * evt );
97
98/*----------------------------------------------------------------------------
99| Event Chain
100+---------------------------------------------------------------------------*/
101int TO_encodeEvtChain( TO_bufferInfo * buf,
102 TO_daemonInfo * daemon,
103 TO_evtChain * evt );
104
105/*----------------------------------------------------------------------------
106| Event State
107+---------------------------------------------------------------------------*/
108int TO_encodeEvtState( TO_bufferInfo * buf,
109 TO_daemonInfo * daemon,
110 TO_evtState * evt );
111/*----------------------------------------------------------------------------
112| Event Variable
113+---------------------------------------------------------------------------*/
114int TO_encodeEvtVariable( TO_bufferInfo * buf,
115 TO_daemonInfo * daemon,
116 TO_evtVariable * evt );
117
118
119/*----------------------------------------------------------------------------
120| Event Children
121+---------------------------------------------------------------------------*/
122int TO_encodeEvtChildren( TO_bufferInfo * buf,
123 TO_daemonInfo * daemon,
124 TO_evtChildren * evt );
125
126/*----------------------------------------------------------------------------
127| Event Message Out
128+---------------------------------------------------------------------------*/
129int TO_encodeEvtMsgOut( TO_bufferInfo * buf,
130 TO_daemonInfo * daemon,
131 TO_evtMsgOut * evt );
132
133/*----------------------------------------------------------------------------
134| Event Message In
135+---------------------------------------------------------------------------*/
136int TO_encodeEvtMsgIn( TO_bufferInfo * buf,
137 TO_daemonInfo * daemon,
138 TO_evtMsgIn * evt );
139
140/*----------------------------------------------------------------------------
141| Event Message OutIn
142+---------------------------------------------------------------------------*/
143int TO_encodeEvtMsgOutIn( TO_bufferInfo * buf,
144 TO_daemonInfo * daemon,
145 TO_evtMsgOutIn * evt );
146
147/*----------------------------------------------------------------------------
148| Event Target Status
149+---------------------------------------------------------------------------*/
150int TO_encodeEvtRtsStatus( TO_bufferInfo * buf,
151 TO_daemonInfo * daemon,
152 TO_evtRtsStatus * evt );
153
154/*----------------------------------------------------------------------------
155| Event History
156+---------------------------------------------------------------------------*/
157int TO_encodeEvtHistory( TO_bufferInfo * buf,
158 TO_daemonInfo * daemon,
159 TO_evtHistory * evt );
160
161/*----------------------------------------------------------------------------
162| Message Queue
163+---------------------------------------------------------------------------*/
164int TO_encodeEvtMsgQueue( TO_bufferInfo * buf,
165 TO_daemonInfo * daemon,
166 TO_evtMsgQueue * evt );
167
168#ifdef __cplusplus
169}
170#endif
171
172#endif // __endeTarg_h__
Definition: endeBoth.h:351
Definition: endeBoth.h:144
Definition: endeBoth.h:263
Definition: endeBoth.h:287
Definition: endeBoth.h:336
Definition: endeBoth.h:306
Definition: endeBoth.h:296
Definition: endeBoth.h:315
Definition: endeBoth.h:344
Definition: endeBoth.h:248
Definition: endeBoth.h:256
Definition: endeBoth.h:329
Definition: endeBoth.h:271
Definition: endeBoth.h:278
Definition: endeBoth.h:238