Xerces-C++: XSTypeDefinition.hpp Source File

Xerces-C++ 3.2.2

XSTypeDefinition.hpp
Go to the documentation of this file.
1 /*
2 * Licensed to the Apache Software Foundation (ASF) under one or more
3 * contributor license agreements. See the NOTICE file distributed with
4 * this work for additional information regarding copyright ownership.
5 * The ASF licenses this file to You under the Apache License, Version 2.0
6 * (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18 /*
19 * $Id: XSTypeDefinition.hpp 1801237 2017-07-07 21:55:11Z scantor $
20 */
21
22 #if !defined(XERCESC_INCLUDE_GUARD_XSTYPEDEFINITION_HPP)
23 #define XERCESC_INCLUDE_GUARD_XSTYPEDEFINITION_HPP
24
25 #include <xercesc/framework/psvi/XSObject.hpp>
26
27 XERCES_CPP_NAMESPACE_BEGIN
28
29 // forward declarations
30 class XSNamespaceItem;
31
39 class XMLPARSER_EXPORT XSTypeDefinition : public XSObject
40 {
41 public:
42
43 enum TYPE_CATEGORY {
47 COMPLEX_TYPE = 15,
51 SIMPLE_TYPE = 16
52 };
53
54 // Constructors and Destructor
55 // -----------------------------------------------------------------------
58
67 XSTypeDefinition
68 (
69 TYPE_CATEGORY typeCategory
70 , XSTypeDefinition* const xsBaseType
71 , XSModel* const xsModel
72 , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
73 );
74
76
79 virtual ~XSTypeDefinition();
81
82 //---------------------
85
90 virtual const XMLCh* getName() const = 0;
91
96 virtual const XMLCh* getNamespace() const = 0;
97
103 virtual XSNamespaceItem *getNamespaceItem() = 0;
104
106
107 //---------------------
111
115 TYPE_CATEGORY getTypeCategory() const;
116
121 virtual XSTypeDefinition *getBaseType() = 0;
122
131 bool isFinal(short toTest);
132
143 short getFinal() const;
144
149 virtual bool getAnonymous() const = 0;
150
158 virtual bool derivedFromType(const XSTypeDefinition* const ancestorType) = 0;
159
168 bool derivedFrom(const XMLCh* typeNamespace,
169 const XMLCh* name);
170
172
173 //----------------------------------
177
179 private:
180
181 // -----------------------------------------------------------------------
182 // Unimplemented constructors and operators
183 // -----------------------------------------------------------------------
184 XSTypeDefinition(const XSTypeDefinition&);
185 XSTypeDefinition & operator=(const XSTypeDefinition &);
186
187 protected:
188
189 // -----------------------------------------------------------------------
190 // data members
191 // -----------------------------------------------------------------------
192 // fTypeCategory
193 // whether this is a simpleType or complexType
194 // fFinal
195 // the final properties which is set by the derived class.
196 TYPE_CATEGORY fTypeCategory;
197 short fFinal;
198 XSTypeDefinition* fBaseType; // owned by XSModel
199 };
200
201 inline XSTypeDefinition::TYPE_CATEGORY XSTypeDefinition::getTypeCategory() const
202 {
203 return fTypeCategory;
204 }
205
206 inline short XSTypeDefinition::getFinal() const
207 {
208 return fFinal;
209 }
210
211
212 XERCES_CPP_NAMESPACE_END
213
214 #endif
XMLPlatformUtils::fgMemoryManager
static MemoryManager * fgMemoryManager
The configurable memory manager.
Definition: PlatformUtils.hpp:121
XSObject::getName
virtual const XMLCh * getName() const
The name of type NCName of this declaration as defined in XML Namespaces.
XSObject::getNamespaceItem
virtual XSNamespaceItem * getNamespaceItem()
A namespace schema information item corresponding to the target namespace of the component, if it&#39;s globally declared; or null otherwise.
XSNamespaceItem
Definition: XSNamespaceItem.hpp:53
XSTypeDefinition::fBaseType
XSTypeDefinition * fBaseType
Definition: XSTypeDefinition.hpp:198
XMLPARSER_EXPORT
#define XMLPARSER_EXPORT
Definition: XercesDefs.hpp:163
XSModel
Definition: XSModel.hpp:59
XSTypeDefinition::fTypeCategory
TYPE_CATEGORY fTypeCategory
Definition: XSTypeDefinition.hpp:196
MemoryManager
Configurable memory manager.
Definition: MemoryManager.hpp:39
XSObject::getNamespace
virtual const XMLCh * getNamespace() const
The [target namespace] of this object, or null if it is unspecified.
XMLCh
uint16_t XMLCh
Definition: Xerces_autoconf_config.hpp:120
XSTypeDefinition::fFinal
short fFinal
Definition: XSTypeDefinition.hpp:197
XERCES_CPP_NAMESPACE_BEGIN
#define XERCES_CPP_NAMESPACE_BEGIN
Definition: XercesDefs.hpp:112
XSTypeDefinition::TYPE_CATEGORY
TYPE_CATEGORY
Definition: XSTypeDefinition.hpp:43
XSObject
Definition: XSObject.hpp:42
XERCES_CPP_NAMESPACE_END
#define XERCES_CPP_NAMESPACE_END
Definition: XercesDefs.hpp:113
XSTypeDefinition::getFinal
short getFinal() const
For complex types the returned value is a bit combination of the subset of {DERIVATION_EXTENSION, DERIVATION_RESTRICTION} corresponding to final set of this type or DERIVATION_NONE.
Definition: XSTypeDefinition.hpp:206
XSObject.hpp
XSTypeDefinition::getTypeCategory
TYPE_CATEGORY getTypeCategory() const
Return whether this type definition is a simple type or complex type.
Definition: XSTypeDefinition.hpp:201
XSTypeDefinition
This class represents a complexType or simpleType definition.
Definition: XSTypeDefinition.hpp:39