blob: 79599bb43a48425f99e5698488cdb3f5ee495435 (
plain)
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
|
//=========================================================================
// Valuebox of structs
//=========================================================================
// "Fixed" struct
struct Fixed_Struct1
{ long l;
struct Bstruct {short s1; short s2; } abstruct;
};
// "Variable" struct
struct Variable_Struct1
{ long l;
string str;
};
typedef Variable_Struct1 TDvariable_struct1;
interface InterfaceFwd;
interface Interface1
{
long getval(in short s);
};
enum Pet { dog, cat, fish, rhinoceros };
typedef short short_array[15];
union Union1 switch(long)
{
case 1: long m1;
case 2: Pet m2;
};
typedef sequence<long> LongSeq;
typedef octet oct_array[10];
typedef sequence <Pet> PetSeq;
// Use all possible types inside a struct
struct Variable_Struct2
{
long len; // predefined type
any whatever; // predefined type
Pet apet; // enum
oct_array octet_array; // array
short_array td_array; // typedefed array
Interface1 intf1; // interface
InterfaceFwd intf2; // interface fwd
string str; // string
wstring wstr; // string
LongSeq ls; // typedef sequence
PetSeq sqq; // sequence
struct NestedStruct1 { short s; string str2; } ns1; // structure
Variable_Struct1 NestedStruct2;
TDvariable_struct1 NestedStruct3;
Union1 un; // union
};
valuetype VBfixed_struct1 Fixed_Struct1;
valuetype VBvariable_struct1 Variable_Struct1;
valuetype VBvariable_struct2 Variable_Struct2;
interface InterfaceFwd
{
long getval(in short s);
};
|