Message.h 8.74 KB
Newer Older
legoc's avatar
legoc committed
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
/*
 * Copyright 2015 Institut Laue-Langevin
 *
 * Licensed under the EUPL, Version 1.1 only (the "License");
 * You may not use this work except in compliance with the Licence.
 * You may obtain a copy of the Licence at:
 *
 * http://joinup.ec.europa.eu/software/page/eupl
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the Licence is distributed on an "AS IS" basis,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the Licence for the specific language governing permissions and
 * limitations under the Licence.
 */

#ifndef CAMEO_MESSAGE_H_
#define CAMEO_MESSAGE_H_

#include <string>

namespace cameo {

namespace message {

26
	constexpr const char* TYPE = "type";
legoc's avatar
legoc committed
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

	const int SYNC = 1;
	const int START = 2;
	const int STOP = 3;
	const int CONNECT = 4;
	const int SHOW_ALL = 5;
	const int SHOW = 6;
	const int ENABLE_STREAM = 7;
	const int IS_ALIVE = 8;
	const int SEND_PARAMETERS = 9;
	const int KILL = 10;
	const int STATUS = 11;
	const int ALL_AVAILABLE = 12;
	const int OUTPUT = 13;
	const int SET_STATUS = 14;
	const int GET_STATUS = 15;
	const int CREATE_PUBLISHER = 16;
	const int TERMINATE_PUBLISHER = 17;
	const int CONNECT_PUBLISHER = 18;
	const int SUBSCRIBE_PUBLISHER = 19;
	const int CANCEL = 20;
	const int SET_RESULT = 21;
	const int REQUEST_PORT = 22;
	const int CONNECT_PORT = 23;
	const int REMOVE_PORT = 24;
	const int REQUEST = 25;
	const int RESPONSE = 26;
	const int STARTED_UNMANAGED = 27;
	const int TERMINATED_UNMANAGED = 28;
56
	const int IMPL_VERSION = 29;
legoc's avatar
legoc committed
57

58
59
60
61
62
63
64
65
66
67
68
	namespace Event {
		constexpr const char* CANCEL = "CANCEL";
		constexpr const char* STREAM = "STREAM";
		constexpr const char* ENDSTREAM = "ENDSTREAM";
		constexpr const char* SYNC = "SYNC";
		constexpr const char* STATUS = "STATUS";
		constexpr const char* RESULT = "RESULT";
		constexpr const char* PORT = "PORT";
		constexpr const char* PUBLISHER = "PUBLISHER";
	}

legoc's avatar
legoc committed
69
	namespace StartRequest {
70
71
72
		constexpr const char* NAME = "name"; // required string name = 1;
		constexpr const char* ARGS = "args"; // repeated string args = 2;
		constexpr const char* INSTANCE_REFERENCE = "instanceReference"; // required string instanceReference = 3;
legoc's avatar
legoc committed
73
74
75
	}

	namespace RequestResponse {
76
77
		constexpr const char* VALUE = "value"; // required int32 value = 1;
		constexpr const char* MESSAGE = "message"; // optional string message = 2;
legoc's avatar
legoc committed
78
79
80
	}

	namespace StopRequest {
81
		constexpr const char* ID = "id"; // required int32 id = 1;
legoc's avatar
legoc committed
82
83
84
	}

	namespace ConnectRequest {
85
		constexpr const char* NAME = "name"; // required string name = 1;
legoc's avatar
legoc committed
86
87
88
	}

	namespace ApplicationConfig {
89
90
91
92
93
94
		constexpr const char* NAME = "name"; // required string name = 1;
		constexpr const char* DESCRIPTION = "description"; // optional string description = 2;
		constexpr const char* RUNS_SINGLE = "runsSingle"; // required bool runsSingle = 3;
		constexpr const char* RESTART = "restart"; // required bool restart = 4;
		constexpr const char* STARTING_TIME = "startingTime"; // required int32 startingTime = 5;
		constexpr const char* STOPPING_TIME = "stoppingTime"; // required int32 stoppingTime = 7;
legoc's avatar
legoc committed
95
96
97
	}

	namespace AllAvailableResponse {
98
		constexpr const char* APPLICATION_CONFIG = "applicationConfig"; // repeated ApplicationConfig applicationConfig = 1;
legoc's avatar
legoc committed
99
100
101
	}

	namespace StatusEvent {
102
103
104
105
		constexpr const char* ID = "id"; // required int32 id = 1;
		constexpr const char* NAME = "name"; // required string name = 2;
		constexpr const char* APPLICATION_STATE = "applicationState"; // required int32 applicationState = 3;
		constexpr const char* PAST_APPLICATION_STATES = "pastApplicationStates"; // required int32 pastApplicationStates = 4;
legoc's avatar
legoc committed
106
107
108
	}

	namespace PublisherEvent {
109
110
111
		constexpr const char* ID = "id"; // required int32 id = 1;
		constexpr const char* NAME = "name"; // required string name = 2;
		constexpr const char* PUBLISHER_NAME = "publisherName"; // required string publisherName = 3;
legoc's avatar
legoc committed
112
113
114
	}

	namespace ResultEvent {
115
116
117
		constexpr const char* ID = "id"; // required int32 id = 1;
		constexpr const char* NAME = "name"; // required string name = 2;
		constexpr const char* DATA = "data"; // required bytes data = 3;
legoc's avatar
legoc committed
118
119
120
	}

	namespace PortEvent {
121
122
123
		constexpr const char* ID = "id"; // required int32 id = 1;
		constexpr const char* NAME = "name"; // required string name = 2;
		constexpr const char* PORT_NAME = "portName"; // required string portName = 3;
legoc's avatar
legoc committed
124
125
126
	}

	namespace ApplicationInfo {
127
128
129
130
131
132
		constexpr const char* ID = "id"; // required int32 id = 1;
		constexpr const char* NAME = "name"; // required string name = 2;
		constexpr const char* APPLICATION_STATE = "applicationState"; // required int32 applicationState = 3;
		constexpr const char* PAST_APPLICATION_STATES = "pastApplicationStates"; // required int32 pastApplicationStates = 4;
		constexpr const char* ARGS = "args"; // required string args = 5;
		constexpr const char* PID = "pid"; // optional int64 pid = 6;
legoc's avatar
legoc committed
133
134
135
	}

	namespace ApplicationInfoListResponse {
136
		constexpr const char* APPLICATION_INFO = "applicationInfo"; // repeated ApplicationInfo applicationInfo = 1;
legoc's avatar
legoc committed
137
138
139
	}

	namespace ShowStreamRequest {
140
		constexpr const char* ID = "id"; // required int32 id = 1;
legoc's avatar
legoc committed
141
142
143
	}

	namespace IsAliveRequest {
144
		constexpr const char* ID = "id"; // required int32 id = 1;
legoc's avatar
legoc committed
145
146
147
	}

	namespace IsAliveResponse {
148
		constexpr const char* IS_ALIVE = "isAlive"; // required bool isAlive = 1;
legoc's avatar
legoc committed
149
150
151
	}

	namespace ApplicationStream {
152
153
		constexpr const char* ID = "id"; // required int32 id = 1;
		constexpr const char* MESSAGE = "message"; // required string message = 2;
154
		constexpr const char* EOL = "eol"; // boolean
legoc's avatar
legoc committed
155
156
157
	}

	namespace SendParametersRequest {
158
159
		constexpr const char* ID = "id"; // required int32 id = 1;
		constexpr const char* PARAMETERS = "parameters"; // repeated string parameters = 2;
legoc's avatar
legoc committed
160
161
162
	}

	namespace KillRequest {
163
		constexpr const char* ID = "id"; // required int32 id = 1;
legoc's avatar
legoc committed
164
165
166
	}

	namespace OutputRequest {
167
		constexpr const char* NAME = "name"; // required string name = 1;
legoc's avatar
legoc committed
168
169
170
	}

	namespace SetStatusRequest {
171
172
		constexpr const char* ID = "id"; // required int32 id = 1;
		constexpr const char* APPLICATION_STATE = "applicationState"; // required int32 applicationState = 2;
legoc's avatar
legoc committed
173
174
175
	}

	namespace GetStatusRequest {
176
		constexpr const char* ID = "id"; // required int32 id = 1;
legoc's avatar
legoc committed
177
178
179
	}

	namespace SetResultRequest {
180
181
		constexpr const char* ID = "id"; // required int32 id = 1;
		constexpr const char* DATA = "data"; // required bytes data = 2;
legoc's avatar
legoc committed
182
183
184
	}

	namespace RequestPortRequest {
185
186
		constexpr const char* ID = "id"; // required int32 id = 1;
		constexpr const char* NAME = "name"; // required string name = 2;
legoc's avatar
legoc committed
187
188
189
	}

	namespace ConnectPortRequest {
190
191
		constexpr const char* ID = "id"; // required int32 id = 1;
		constexpr const char* NAME = "name"; // required string name = 2;
legoc's avatar
legoc committed
192
193
194
	}

	namespace RemovePortRequest {
195
196
		constexpr const char* ID = "id"; // required int32 id = 1;
		constexpr const char* NAME = "name"; // required string name = 2;
legoc's avatar
legoc committed
197
198
199
	}

	namespace CreatePublisherRequest {
200
201
202
		constexpr const char* ID = "id"; // required int32 id = 1;
		constexpr const char* NAME = "name"; // required string name = 2;
		constexpr const char* NUMBER_OF_SUBSCRIBERS = "numberOfSubscribers"; // required int32 numberOfSubscribers = 3;
legoc's avatar
legoc committed
203
204
205
	}

	namespace TerminatePublisherRequest {
206
207
		constexpr const char* ID = "id"; // required int32 id = 1;
		constexpr const char* NAME = "name"; // required string name = 2;
legoc's avatar
legoc committed
208
209
210
	}

	namespace ConnectPublisherRequest {
211
212
		constexpr const char* APPLICATION_ID = "applicationId"; // required int32 applicationId = 1;
		constexpr const char* PUBLISHER_NAME = "publisherName"; // required string publisherName = 2;
legoc's avatar
legoc committed
213
214
215
	}

	namespace PublisherResponse {
216
217
218
219
		constexpr const char* MESSAGE = "message"; // optional string message = 1;
		constexpr const char* PUBLISHER_PORT = "publisherPort"; // required int32 publisherPort = 2;
		constexpr const char* SYNCHRONIZER_PORT = "synchronizerPort"; // required int32 synchronizerPort = 3;
		constexpr const char* NUMBER_OF_SUBSCRIBERS = "numberOfSubscribers"; // optional int32 numberOfSubscribers = 4;
legoc's avatar
legoc committed
220
221
222
	}

	namespace Request {
223
224
225
226
227
		constexpr const char* APPLICATION_NAME = "applicationName"; // required string applicationName = 1;
		constexpr const char* APPLICATION_ID = "applicationId"; // required int32 applicationId = 2;
		constexpr const char* SERVER_URL = "serverUrl"; // required string serverUrl = 5;
		constexpr const char* SERVER_PORT = "serverPort"; // required int32 serverPort = 6;
		constexpr const char* REQUESTER_PORT = "requesterPort"; // required int32 requesterPort = 7;
legoc's avatar
legoc committed
228
229
230
	}

	namespace StartedUnmanagedRequest {
231
232
		constexpr const char* NAME = "name"; // required string name = 1;
		constexpr const char* PID = "pid"; // optional int64 pid = 2;
legoc's avatar
legoc committed
233
234
235
	}

	namespace TerminatedUnmanagedRequest {
236
		constexpr const char* ID = "id"; // required int32 id = 1;
legoc's avatar
legoc committed
237
	}
238
239
240
241
242
243
244

	namespace VersionResponse {
		constexpr const char* MAJOR = "major";
		constexpr const char* MINOR = "minor";
		constexpr const char* REVISION = "revision";
	}

legoc's avatar
legoc committed
245
246
247
248
249
250
}

}

#endif