You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
Acollapsed_vec is a size and an offset pointing into a pool. It provides contiguous memory while being able to store an unbounded number of elements. The main limitation of acollapsed_vec is that it's insertable only when its end points to the end of the pool.
Strings constitute a special case: achar_pool is generated for them to prevent many small allocations.
The pools are freed by using utility functionsuxsd::clear_pools() anduxsd::clear_strings().clear_strings is provided separately since it can be useful to keep the strings around after freeing the generated structures.
3. Data types
You can find the generated types for your schema in output header filefoo_uxsdcxx.h. The mapping rules of XSD types to C++ types are such:
<xs:complexType> definitions correspond to C++ structst_{name}. For complexTypes in global scope,name refers to thename attribute of the type. For complexTypes defined inside elements,name refers to thename attribute of the parent element.
An<xs:attribute> generates a struct field with a C++ type corresponding to its<xs:simpleType> as defined below.
A model group such as<xs:choice>,<xs:sequence> or<xs:all> generates struct fields with C++ types corresponding to the types of the elements inside.
If an element can occur more than once, acollapsed_vec<T, T_pool> is generated.
If an element can occur zero times, another fieldbool has_T is generated to indicate whether the element is found.
<xs:simpleType> can take many forms.
<xs:union> corresponds to a tagged union type, such as:
Atomic builtins, such asxs:string orxs:int generate a field of the corresponding C++ type(const char *,int...)
<xs:restriction>s of simple types are not supported, except one case where an<xs:string> is restricted to<xs:enumeration> values. C++ enums are generated for such constructs. As an example, the following XSD: