Skip to main content

VB7.0 - all Platforms:Deprecated Anonymous Types in CORBA IDL

  • February 16, 2013
  • 0 replies
  • 0 views

Problem:

  • Product Name: VisiBroker C
  • Product Version: 7.0 and later
  • Product Component: idl2cpp
  • Platform/OS Version: ALL

When wrote an IDL like:

struct Part {
   string id;
   string code;
   sequence <Part> array;
};

idl2cpp will not generate correct helper class for this IDL.

Resolution:

A workaround to rewrite the IDL as:

struct Part;
typedef sequence <Part> PartArray;
struct Part
{
  string id;
  string code;
  PartArray array;
};

will solve the problem.

CR7923 is filed for this issue.

Reference:

CORBA 2.6 Specification (formal/01-12-35):

3.10.6 Deprecated Anonymous Types
IDL currently permits the use of anonymous types in a number of places. For example:
struct Foo {
   long value;
   sequence<Foo> chain; // Legal (but deprecated)
}

Anonymous types cause a number of problems for language mappings and are therefore deprecated by this specification. Anonymous types will be removed in a future version, so new IDL should avoid use of anonymous types and use a typedef to name such types instead. Compilers need not issue a warning if a deprecated construct is encountered.

 
Support Case # 639021

#idl2cpp
#VisiBroker
#AnonymousTypes
#IDL
#Security