-
Notifications
You must be signed in to change notification settings - Fork 0
/
TestCommand.idl
50 lines (41 loc) · 1.26 KB
/
TestCommand.idl
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
module TestCommand
{
/* ValueKind is the discriminator of the 'value' union of a KeyValue */
enum ValueKind {
VALUEKIND_STRING,
VALUEKIND_LONG,
VALUEKIND_FLOAT,
VALUEKIND_BOOLEAN
};
enum CommandKind {
ADD_COMMAND,
REMOVE_COMMAND
};
union Value switch(ValueKind) {
case VALUEKIND_STRING: /* Value is a string */
string sValue;
case VALUEKIND_LONG: /* Value is a long number */
long lValue;
case VALUEKIND_FLOAT: /* Value is a floating-point number */
float fValue;
case VALUEKIND_BOOLEAN: /* Value is a boolean */
boolean bValue;
};
/* Generic key:value type, where value is an union supporting various kinds of values */
struct KeyValue {
string keyval; /* String key */
Value value;
};
union Kind switch(CommandKind) {
case ADD_COMMAND: /* Add command */
sequence<KeyValue> addCmd;
case REMOVE_COMMAND: /* Remove command */
sequence<KeyValue> rmvCmd;
};
struct TestCommandMsg
{
long command_Id;
Kind kind;
};
#pragma keylist TestCommandMsg command_Id
};