1 ///////////////////////////////////////////////////////////////////////////////
2 // Copyright (c) 2000-2014 Ericsson Telecom AB
3 // All rights reserved. This program and the accompanying materials
4 // are made available under the terms of the Eclipse Public License v1.0
5 // which accompanies this distribution, and is available at
6 // http://www.eclipse.org/legal/epl-v10.html
7 ///////////////////////////////////////////////////////////////////////////////
11 #include "RootType.hh"
22 unsigned long long int minOccurs;
23 unsigned long long int maxOccurs;
24 FieldType * order_attribute;
26 explicit EmbeddedType (int a_depth=0, unsigned long long int a_minOccurs=1, unsigned long long int a_maxOccurs=1,
27 FieldType * a_order_attribute=NULL)
31 , minOccurs(a_minOccurs)
32 , maxOccurs(a_maxOccurs)
33 , order_attribute(a_order_attribute)
42 FieldType * order_attribute;
43 FieldType * embed_values_attribute;
46 explicit GenerationType (FieldType * a_field = NULL, int a_depth = 0,
47 FieldType * a_order_attribute = NULL, FieldType * a_embed_values_attribute = NULL, int a_max_alt = 0)
50 , order_attribute(a_order_attribute)
51 , embed_values_attribute(a_embed_values_attribute)
63 explicit AttrBaseType (FieldType * a_base = NULL, int a_depth = 0)
72 * Type that contains information coming from XSD complexTypes, model group definitions
77 * * <complexType>, <group> and <attributeGroup> element whose parent element is <schema>
84 class ComplexType : public RootType
106 List<FieldType*> fields;
107 List<FieldType*> fields_final;
112 List<ComplexType_Mode> ctmode;
113 List<GenerationType> fieldGenInfo;
114 List<GenerationType> recGenInfo;
115 List<AttrBaseType> attributeBases;
116 List<EmbeddedType> embed_inSequence;
117 List<EmbeddedType> embed_inChoice;
118 List<EmbeddedType> embed_inAll;
120 Resolv_State resolved;
122 FieldType * generateField ();
123 FieldType * generateAttribute ();
124 FieldType * generateRecord (unsigned long long int a_minOccurs, unsigned long long int a_maxOccurs);
125 FieldType * generateUnion (unsigned long long int a_minOccurs, unsigned long long int a_maxOccurs);
127 void initialSettings ();
129 void reference_resolving_funtion (List<FieldType*> & container);
130 void sortAttributes ();
131 void nameConversion_names (const List<NamespaceType> & ns);
132 void nameConversion_types (const List<NamespaceType> & ns);
133 void nameConversion_fields (const List<NamespaceType> & ns);
134 void indent (FILE * file, int x) { for (int l = 0; l < x; ++l) fprintf(file, "\t"); }
136 void printVariant (FILE * file);
139 ComplexType (XMLParser * a_parser, TTCN3Module * a_module, ConstructType a_construct);
140 ComplexType (const ComplexType & other);
141 ComplexType (const SimpleType & other, CT_fromST c);
145 * inherited from RootType
147 void loadWithValues ();
148 void printToFile (FILE * file);
150 void modifyValues ();
151 void referenceResolving ();
152 void nameConversion (NameConversionMode mode, const List<NamespaceType> & ns);
153 void finalModification ();
154 bool hasUnresolvedReference ();
155 void dump (unsigned int depth) const ;
157 void everything_into_fields_final ();
159 void addToActualPath (const Mstring& text) {actualPath += text;}
161 void setWithUnion (bool b) {with_union = b;}
163 const List<EmbeddedType> & getEmbedInChoice () const {return embed_inChoice;}
165 const List<FieldType*> & getFields () const {return fields;}
166 const List<FieldType*> & getFieldsFinal () const {return fields_final;}
167 bool getWithUnion () const {return with_union;}
169 int getActualLevel () const {return actualLevel;}
170 const Mstring & getActualPath () const {return actualPath;}
171 ComplexType_Mode getMode() const {
172 return ctmode.empty() ? CT_undefined_mode : ctmode.front();
176 #endif /* COMPLEXTYPE_H_ */