The wire_marshal attribute


   typedef  [wire_marshal( transmissible_type)]   type_specifier  user_type;

This attribute is a type attribute used in the IDL file and is somewhat similar in syntax and semantic to the transmit_as attribute. Each user-specific type has a corresponding transmissible type that defines the wire representation.

The user can define his specific type quite freely, (simple types, pointer types and composite types may be used) although some restrictions apply. The main one is that the type object needs to have well defined (fixed) memory size. If the changeable size needs to be accommodated, the type should have a pointer field as opposed to a conformant array; or it can be a pointer to the interesting type. General restrictions apply as usual. Specific restrictions related to embedding affect the way types can be specified. For more information see the "User type vs. wire type" section.

The [wire_marshal] attribute cannot be used with [allocate()] attribute (directly or indirectly) as the engine doesn't control the memory allocation for the type. Also the wire type cannot be an interface pointer (these may be marshaled directly) or a full pointer (we cannot take care of the aliasing).

The following is a list of additional points regarding wire_marshal: