Xerces-C++  3.2.3
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$
20  */
21 
22 #if !defined(XERCESC_INCLUDE_GUARD_XSTYPEDEFINITION_HPP)
23 #define XERCESC_INCLUDE_GUARD_XSTYPEDEFINITION_HPP
24 
26 
28 
29 // forward declarations
30 class XSNamespaceItem;
31 
40 {
41 public:
42 
47  COMPLEX_TYPE = 15,
51  SIMPLE_TYPE = 16
52  };
53 
54  // Constructors and Destructor
55  // -----------------------------------------------------------------------
58 
68  (
69  TYPE_CATEGORY typeCategory
70  , XSTypeDefinition* const xsBaseType
71  , XSModel* const xsModel
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  // -----------------------------------------------------------------------
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.
197  short fFinal;
198  XSTypeDefinition* fBaseType; // owned by XSModel
199 };
200 
202 {
203  return fTypeCategory;
204 }
205 
206 inline short XSTypeDefinition::getFinal() const
207 {
208  return fFinal;
209 }
210 
211 
213 
214 #endif
XSObject::getNamespaceItem
virtual XSNamespaceItem * getNamespaceItem()
A namespace schema information item corresponding to the target namespace of the component,...
XERCES_CPP_NAMESPACE_BEGIN
#define XERCES_CPP_NAMESPACE_BEGIN
Definition: XercesDefs.hpp:112
XSNamespaceItem
Definition: XSNamespaceItem.hpp:53
XSTypeDefinition::fFinal
short fFinal
Definition: XSTypeDefinition.hpp:197
XSObject
Definition: XSObject.hpp:42
XERCES_CPP_NAMESPACE_END
#define XERCES_CPP_NAMESPACE_END
Definition: XercesDefs.hpp:113
XSObject::getName
virtual const XMLCh * getName() const
The name of type NCName of this declaration as defined in XML Namespaces.
XSModel
Definition: XSModel.hpp:59
XSTypeDefinition::TYPE_CATEGORY
TYPE_CATEGORY
Definition: XSTypeDefinition.hpp:43
XSObject.hpp
XSTypeDefinition::getFinal
short getFinal() const
For complex types the returned value is a bit combination of the subset of {DERIVATION_EXTENSION,...
Definition: XSTypeDefinition.hpp:206
XMLCh
uint16_t XMLCh
Definition: Xerces_autoconf_config.hpp:120
XSTypeDefinition::getTypeCategory
TYPE_CATEGORY getTypeCategory() const
Return whether this type definition is a simple type or complex type.
Definition: XSTypeDefinition.hpp:201
XMLPlatformUtils::fgMemoryManager
static MemoryManager * fgMemoryManager
The configurable memory manager.
Definition: PlatformUtils.hpp:121
XSTypeDefinition
This class represents a complexType or simpleType definition.
Definition: XSTypeDefinition.hpp:39
XSObject::getNamespace
virtual const XMLCh * getNamespace() const
The [target namespace] of this object, or null if it is unspecified.
MemoryManager
Configurable memory manager.
Definition: MemoryManager.hpp:39
XMLPARSER_EXPORT
#define XMLPARSER_EXPORT
Definition: XercesDefs.hpp:163
XSTypeDefinition::fTypeCategory
TYPE_CATEGORY fTypeCategory
Definition: XSTypeDefinition.hpp:196
XSTypeDefinition::fBaseType
XSTypeDefinition * fBaseType
Definition: XSTypeDefinition.hpp:198