List Type
An xsd:list type is used to model a space-separated list of values of a given type. This type is mapped to a linked-list type if its length is unbounded, or an array type if its length is bounded. The built-in OSRTDList type (run-time doubly linked list) is the type used for repeating sequences such as this. This list type can be used with the rtxDList run-time functions for building and manipulating lists. See the Doubly-Linked List Utility Functions section for more details.
In the case of C++, the built-in OSRTDListClass or OSRTObjListClass type is used. These classes extend the C OSRTDList structure and add constructors and methods for adding, finding, and removing items from the list. The generated C++ code contains overloaded versions of these methods that correspond to the specific type of the element within the list.
Unbounded Case
<xsd:simpleType name="TypeName"> <xsd:list itemType="Type"/> </xsd:simpleType> typedef OSRTDList TypeName; class TypeName : public OSRTDListClass { ... } ;
Bounded Case
The one exception to this mapping occurs when the referenced item type is an enumeration. In this case, a structure is generated with each enumerated item represented as a single bit. This is a more compact structure that is easier to work with for specifying enumerated items and for validation to make sure there are no duplicates in the list. The mapping for this special case is as follows:
Each of the bit fields in this type represents a declared enumeration item in the XSD definition. The _extItems field is added for extensibility purposes (i.e. if an unknown item is received it is added to this list). This construct will be used if a declared enumerated type is referenced (as is the case above) or if the list type contains an anonymous type with an enumeration list.
Copyright © Objective Systems 2002-2008 This document may be distributed in any form, electronic or otherwise, provided that it is distributed in its entirety and that the copyright and this notice are included. |
Objective Systems, Inc.55 Dowlin Forge RoadExton, Pennsylvania 19341 http://www.obj-sys.com Phone: (484) 875-9841 Toll-free: (877) 307-6855 (US only) Fax: (484) 875-9830 info@obj-sys.com |