// $Id: vb_struct.idl 91197 2010-07-24 07:38:30Z msmit $

//=========================================================================
// 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);
};
