Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:14:52

0001 /*
0002  * Licensed to the Apache Software Foundation (ASF) under one or more
0003  * contributor license agreements.  See the NOTICE file distributed with
0004  * this work for additional information regarding copyright ownership.
0005  * The ASF licenses this file to You under the Apache License, Version 2.0
0006  * (the "License"); you may not use this file except in compliance with
0007  * the License.  You may obtain a copy of the License at
0008  *
0009  *      http://www.apache.org/licenses/LICENSE-2.0
0010  *
0011  * Unless required by applicable law or agreed to in writing, software
0012  * distributed under the License is distributed on an "AS IS" BASIS,
0013  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
0014  * See the License for the specific language governing permissions and
0015  * limitations under the License.
0016  */
0017 
0018 /*
0019  * $Id$
0020  */
0021 
0022 #if !defined(XERCESC_INCLUDE_GUARD_XSOBJECT_HPP)
0023 #define XERCESC_INCLUDE_GUARD_XSOBJECT_HPP
0024 
0025 #include <xercesc/util/PlatformUtils.hpp>
0026 #include <xercesc/framework/psvi/XSConstants.hpp>
0027 
0028 XERCES_CPP_NAMESPACE_BEGIN
0029 
0030 /**
0031  * The XSObject forms the base of the Schema Component Model.  It contains
0032  * all properties common to the majority of XML Schema components.
0033  * This is *always* owned by the validator /parser object from which
0034  * it is obtained.  It is designed to be subclassed; subclasses will
0035  * specify under what conditions it may be relied upon to have meaningful contents.
0036  */
0037 
0038 // forward declarations
0039 class XSNamespaceItem;
0040 class XSModel;
0041 
0042 class XMLPARSER_EXPORT XSObject : public XMemory
0043 {
0044 public:
0045 
0046     //  Constructors and Destructor
0047     // -----------------------------------------------------------------------
0048     /** @name Constructors */
0049     //@{
0050 
0051     /**
0052       * The default constructor
0053       *
0054       * @param  compType
0055       * @param  xsModel
0056       * @param  manager     The configurable memory manager
0057       */
0058     XSObject
0059     (
0060         XSConstants::COMPONENT_TYPE compType
0061         , XSModel* const xsModel
0062         , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
0063     );
0064 
0065     //@};
0066 
0067     /** @name Destructor */
0068     //@{
0069     virtual ~XSObject();
0070     //@}
0071 
0072     //---------------------
0073     /** @name XSObject methods */
0074 
0075     //@{
0076 
0077     /**
0078      *  The <code>type</code> of this object, i.e.
0079      * <code>ELEMENT_DECLARATION</code>.
0080      */
0081     XSConstants::COMPONENT_TYPE getType() const;
0082 
0083     /**
0084      * The name of type <code>NCName</code> of this declaration as defined in
0085      * XML Namespaces.
0086      */
0087     virtual const XMLCh* getName() const;
0088 
0089     /**
0090      *  The [target namespace] of this object, or <code>null</code> if it is
0091      * unspecified.
0092      */
0093     virtual const XMLCh* getNamespace() const;
0094 
0095     /**
0096      * A namespace schema information item corresponding to the target
0097      * namespace of the component, if it's globally declared; or null
0098      * otherwise.
0099      */
0100     virtual XSNamespaceItem *getNamespaceItem();
0101 
0102     /**
0103       * Optional.  Return a unique identifier for a component within this XSModel, to
0104       * optimize querying.  May not be defined for all types of component.
0105       * @return id unique for this type of component within this XSModel or 0
0106       *     to indicate that this is not supported for this type of component.
0107       */
0108     virtual XMLSize_t getId() const;
0109 
0110     //@}
0111 
0112     //----------------------------------
0113     /** methods needed by implementation */
0114 
0115     //@{
0116     /**
0117       * Set the id to be returned on getId().
0118       */
0119     void setId(XMLSize_t id);
0120     //@}
0121 
0122 private:
0123 
0124     // -----------------------------------------------------------------------
0125     //  Unimplemented constructors and operators
0126     // -----------------------------------------------------------------------
0127     XSObject(const XSObject&);
0128     XSObject & operator=(const XSObject &);
0129 
0130 protected:
0131 
0132     // -----------------------------------------------------------------------
0133     //  data members
0134     // -----------------------------------------------------------------------
0135     // fMemoryManager:
0136     //  used for any memory allocations
0137     // fComponentType
0138     //  the type of the actual component
0139     XSConstants::COMPONENT_TYPE fComponentType;
0140     XSModel*                    fXSModel;
0141     MemoryManager*              fMemoryManager;
0142     XMLSize_t                   fId;
0143 };
0144 
0145 inline XSConstants::COMPONENT_TYPE XSObject::getType() const
0146 {
0147     return fComponentType;
0148 }
0149 
0150 XERCES_CPP_NAMESPACE_END
0151 
0152 #endif