-- IDL module extracted from ITU-T Z.168 (05/2012)

module ttcnExample { // *********** // Basic Types // *********** const long number = 017; // 017 == 0xF == 15 const long size = ( ( number << 3 ) % 0x1F ) & 0123; const float decimal = 15.7; const char letter = ''A''; const wchar wideLetter = L''A''; const boolean isValid = TRUE; const octet anOctet = 0x55; // limited to 8 bit const string myName = "my name"; const wstring wideMyName = L"my name"; typedef string MyString; // ***************** // Constructed Types // ***************** typedef struct NC { MyString id; MyString kind; } NameComponent; union MyUnion switch( long ) { case 0 : boolean b; case 1 : char c; case 2 : octet o; case 3 : short s; }; enum NotFoundReason { missing_node, not_context, not_object }; // ************** // Template Types // ************** typedef sequence <NameComponent> Name; typedef sequence <NameComponent> Key; typedef fixed<12,7> Fix; // ****************** // Complex Declarator // ****************** typedef long NumberList[100]; native MyNativeVariable; // ******************** // Valuetype Definition // ******************** valuetype StringValue string; valuetype EmployeeRecord { // note this is not a CORBA::Object // state definition private string name; private string email; private string SSN; // initializer factory init(in string name, in string SSN); }; // ******************** // Interface Definition // ******************** interface NamingContext { attribute string object_type; readonly attribute Key external_form_id; exception NotFoundException { NotFoundReason why; Name rest_of_name; }; MyString bind( in Name n, inout Object obj, out Object myObj ) raises( NotFoundException ) context ( "Hostname" ); oneway void rebind( in Name n, in Object obj ); }; // end of interface NamingContext }; // end of module ttcnExample