00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 #if !defined(XSTYPEDEFINITION_HPP)
00022 #define XSTYPEDEFINITION_HPP
00023 
00024 #include <xercesc/framework/psvi/XSObject.hpp>
00025 
00026 XERCES_CPP_NAMESPACE_BEGIN
00027 
00028 
00029 class XSNamespaceItem;
00030 
00038 class  XSTypeDefinition : public XSObject
00039 {
00040 public:
00041 
00042     enum TYPE_CATEGORY {
00046         COMPLEX_TYPE              = 15,
00050         SIMPLE_TYPE               = 16
00051     };
00052 
00053     
00054     
00057 
00066     XSTypeDefinition
00067     (
00068         TYPE_CATEGORY             typeCategory
00069         , XSTypeDefinition* const xsBaseType
00070         , XSModel* const          xsModel
00071         , MemoryManager* const    manager = XMLPlatformUtils::fgMemoryManager
00072     );
00073 
00075 
00078     virtual ~XSTypeDefinition();
00080 
00081     
00084 
00089     virtual const XMLCh* getName() = 0;
00090 
00095     virtual const XMLCh* getNamespace() = 0;
00096 
00102     virtual XSNamespaceItem *getNamespaceItem() = 0;
00103 
00105 
00106     
00110 
00114     TYPE_CATEGORY getTypeCategory() const;
00115 
00120     virtual XSTypeDefinition *getBaseType() = 0;
00121 
00130     bool isFinal(short toTest);
00131 
00142     short getFinal() const;
00143 
00148     virtual bool getAnonymous() const = 0;
00149 
00157     virtual bool derivedFromType(const XSTypeDefinition* const ancestorType) = 0;
00158 
00167     bool derivedFrom(const XMLCh* typeNamespace, 
00168                                const XMLCh* name);
00169 
00171 
00172     
00176 
00178 private:
00179 
00180     
00181     
00182     
00183     XSTypeDefinition(const XSTypeDefinition&);
00184     XSTypeDefinition & operator=(const XSTypeDefinition &);
00185 
00186 protected:
00187 
00188     
00189     
00190     
00191     
00192     
00193     
00194     
00195     TYPE_CATEGORY     fTypeCategory;
00196     short             fFinal;
00197     XSTypeDefinition* fBaseType; 
00198 };
00199 
00200 inline XSTypeDefinition::TYPE_CATEGORY XSTypeDefinition::getTypeCategory() const
00201 {
00202     return fTypeCategory;
00203 }
00204 
00205 inline short XSTypeDefinition::getFinal() const
00206 {
00207     return fFinal;
00208 }
00209 
00210 
00211 XERCES_CPP_NAMESPACE_END
00212 
00213 #endif