-
Notifications
You must be signed in to change notification settings - Fork 43
/
Copy pathDynamicTypesIDLExamples.idl
227 lines (200 loc) · 3.51 KB
/
DynamicTypesIDLExamples.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
//!--TYPEINFORMATION
@extensibility(APPENDABLE) @nested
struct TypeIdentfierWithSize
{
TypeIdentifier type_id;
unsigned long typeobject_serialized_size;
};
@extensibility(APPENDABLE) @nested
struct TypeIdentifierWithDependencies
{
TypeIdentfierWithSize typeid_with_size;
long dependent_type_id_count;
sequence<TypeIdentfierWithSize> dependent_typeids;
};
@extensibility(MUTABLE) @nested
struct TypeInformation
{
@id(0x1001) TypeIdentifierWithDependencies minimal;
@id(0x1002) TypeIdentifierWithDependencies complete;
};
//!--
//!--TYPEOBJECT
@extensibility(APPENDABLE) @nested
union TypeObject switch(octet)
{
case EK_COMPLETE:
CompleteTypeObject complete;
case EK_MINIMAL:
MinimalTypeObject minimal;
};
//!--
//!--IDL_PRIMITIVES
struct PrimitivesStruct
{
boolean my_bool;
octet my_octet;
char my_char;
wchar my_wchar;
long my_long;
unsigned long my_ulong;
int8 my_int8;
uint8 my_uint8;
short my_short;
unsigned short my_ushort;
long long my_longlong;
unsigned long long my_ulonglong;
float my_float;
double my_double;
long double my_longdouble;
};
//!--
//!--IDL_STRINGS
struct StringsStruct
{
string my_string;
wstring my_wstring;
string<41925> my_bounded_string;
wstring<20925> my_bounded_wstring;
};
//!--
//!--IDL_ENUM
enum MyEnum
{
A,
B,
C
};
struct EnumStruct
{
MyEnum my_enum;
};
//!--
//!--IDL_BITMASK
@bit_bound(8)
bitmask MyBitMask
{
@position(0) flag0,
flag1,
flag2,
@position(5) flag5
};
struct BitmaskStruct
{
MyBitMask my_bitmask;
};
//!--
//!--IDL_TYPEDEF
typedef MyEnum MyAliasedEnum;
typedef string<100> MyAliasedBoundedString;
typedef MyAliasedEnum MyRecursiveAlias;
struct AliasStruct
{
MyAliasedEnum my_aliased_enum;
MyAliasedBoundedString my_aliased_bounded_string;
MyRecursiveAlias my_recursive_alias;
};
//!--
//!--IDL_SEQUENCES
struct SequenceStruct
{
sequence<MyBitMask> bitmask_sequence;
sequence<short, 5> short_sequence;
};
//!--
//!--IDL_ARRAYS
struct ArrayStruct
{
long long_array[2][3][4];
};
//!--
//!--IDL_ARRAYS_JSON
struct ArrayStruct
{
long long_array[2][3];
};
//!--
//!--IDL_MAPS
struct MapStruct
{
map<string, MyAliasedBoundedString> string_alias_unbounded_map;
map<short, long, 2> short_long_map;
};
//!--
//!--IDL_STRUCT
struct InnerStruct
{
@id(0x10) long first;
};
struct ParentStruct
{
float first;
long long second;
};
struct ComplexStruct : ParentStruct
{
InnerStruct complex_member;
};
//!--
//!--IDL_UNION
union InnerUnion switch (short)
{
case 0:
@id(0x10) PrimitivesStruct first;
case 1:
default:
long long second;
};
union ComplexUnion switch (long)
{
case 0:
case 1:
long third;
default:
InnerUnion fourth;
};
//!--
//!--IDL_BITSET
bitset ParentBitSet
{
bitfield<3> a;
bitfield<1> b;
bitfield<4>;
bitfield<10> c;
bitfield<12, short> d;
};
bitset ChildBitSet : ParentBitSet
{
bitfield<1> e;
bitfield<20, unsigned long> f;
};
struct BitsetStruct
{
ChildBitSet my_bitset;
};
//!--
//!--IDL_BITSET_JSON
bitset MyBitSet
{
bitfield<3> a;
bitfield<1> b;
bitfield<4>;
bitfield<10> c;
bitfield<12, short> d;
};
struct BitsetStruct
{
MyBitSet my_bitset;
};
//!--
//!--IDL_CUSTOM_ANNOTATION
@annotation MyAnnotation
{
short length;
};
@MyAnnotation(length = 5)
struct AnnotatedStruct
{
@MyAnnotation(length = 10) string string_var;
};
//!--