Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:15:20

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_XERCESGROUPINFO_HPP)
0023 #define XERCESC_INCLUDE_GUARD_XERCESGROUPINFO_HPP
0024 
0025 
0026 /**
0027   * The class act as a place holder to store group information.
0028   *
0029   * The class is intended for internal use.
0030   */
0031 
0032 // ---------------------------------------------------------------------------
0033 //  Includes
0034 // ---------------------------------------------------------------------------
0035 #include <xercesc/util/RefVectorOf.hpp>
0036 #include <xercesc/validators/schema/SchemaElementDecl.hpp>
0037 
0038 #include <xercesc/internal/XSerializable.hpp>
0039 
0040 XERCES_CPP_NAMESPACE_BEGIN
0041 
0042 // ---------------------------------------------------------------------------
0043 //  Forward Declarations
0044 // ---------------------------------------------------------------------------
0045 class ContentSpecNode;
0046 class XSDLocator;
0047 
0048 
0049 class VALIDATORS_EXPORT XercesGroupInfo : public XSerializable, public XMemory
0050 {
0051 public:
0052     // -----------------------------------------------------------------------
0053     //  Public Constructors/Destructor
0054     // -----------------------------------------------------------------------
0055     XercesGroupInfo
0056     (
0057         unsigned int groupNameId
0058         , unsigned int groupNamespaceId
0059         , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
0060     );
0061     ~XercesGroupInfo();
0062 
0063     // -----------------------------------------------------------------------
0064     //  Getter methods
0065     // -----------------------------------------------------------------------
0066     bool                     getCheckElementConsistency() const;
0067     unsigned int             getScope() const;
0068     XMLSize_t                elementCount() const;
0069     ContentSpecNode*         getContentSpec() const;
0070     SchemaElementDecl*       elementAt(const XMLSize_t index);
0071     const SchemaElementDecl* elementAt(const XMLSize_t index) const;
0072     XSDLocator*              getLocator() const;
0073     XercesGroupInfo*         getBaseGroup() const;
0074     unsigned int             getNameId() const;
0075     unsigned int             getNamespaceId() const;
0076 
0077     // -----------------------------------------------------------------------
0078     //  Setter methods
0079     // -----------------------------------------------------------------------
0080     void setScope(const unsigned int other);
0081     void setContentSpec(ContentSpecNode* const other);
0082     void addElement(SchemaElementDecl* const toAdd);
0083     void setLocator(XSDLocator* const aLocator);
0084     void setBaseGroup(XercesGroupInfo* const baseGroup);
0085     void setCheckElementConsistency(const bool aValue);
0086 
0087     /***
0088      * Support for Serialization/De-serialization
0089      ***/
0090     DECL_XSERIALIZABLE(XercesGroupInfo)
0091     XercesGroupInfo(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
0092 
0093 private:
0094     // -----------------------------------------------------------------------
0095     //  Unimplemented constructors and operators
0096     // -----------------------------------------------------------------------
0097     XercesGroupInfo(const XercesGroupInfo& elemInfo);
0098     XercesGroupInfo& operator= (const XercesGroupInfo& other);
0099 
0100     // -----------------------------------------------------------------------
0101     //  Private data members
0102     // -----------------------------------------------------------------------
0103     bool                            fCheckElementConsistency;
0104     unsigned int                    fScope;
0105     unsigned int                    fNameId;
0106     unsigned int                    fNamespaceId;
0107     ContentSpecNode*                fContentSpec;
0108     RefVectorOf<SchemaElementDecl>* fElements;
0109     XercesGroupInfo*                fBaseGroup; // redefine by restriction
0110     XSDLocator*                     fLocator;
0111 };
0112 
0113 // ---------------------------------------------------------------------------
0114 //  XercesGroupInfo: Getter methods
0115 // ---------------------------------------------------------------------------
0116 inline unsigned int XercesGroupInfo::getScope() const {
0117 
0118     return fScope;
0119 }
0120 
0121 inline XMLSize_t XercesGroupInfo::elementCount() const {
0122 
0123     return fElements->size();
0124 }
0125 
0126 inline ContentSpecNode* XercesGroupInfo::getContentSpec() const {
0127 
0128     return fContentSpec;
0129 }
0130 
0131 inline SchemaElementDecl*
0132 XercesGroupInfo::elementAt(const XMLSize_t index) {
0133 
0134     return fElements->elementAt(index);
0135 }
0136 
0137 inline const SchemaElementDecl*
0138 XercesGroupInfo::elementAt(const XMLSize_t index) const {
0139 
0140     return fElements->elementAt(index);
0141 }
0142 
0143 inline XSDLocator* XercesGroupInfo::getLocator() const {
0144 
0145     return fLocator;
0146 }
0147 
0148 inline XercesGroupInfo* XercesGroupInfo::getBaseGroup() const {
0149 
0150     return fBaseGroup;
0151 }
0152 
0153 inline bool XercesGroupInfo::getCheckElementConsistency() const {
0154 
0155     return fCheckElementConsistency;
0156 }
0157 
0158 inline unsigned int XercesGroupInfo::getNameId() const
0159 {
0160     return fNameId;
0161 }
0162 
0163 inline unsigned int XercesGroupInfo::getNamespaceId() const
0164 {
0165     return fNamespaceId;
0166 }
0167 
0168 // ---------------------------------------------------------------------------
0169 //  XercesGroupInfo: Setter methods
0170 // ---------------------------------------------------------------------------}
0171 inline void XercesGroupInfo::setScope(const unsigned int other) {
0172 
0173     fScope = other;
0174 }
0175 
0176 inline void XercesGroupInfo::setContentSpec(ContentSpecNode* const other) {
0177 
0178     fContentSpec = other;
0179 }
0180 
0181 inline void XercesGroupInfo::addElement(SchemaElementDecl* const elem) {
0182 
0183     if (!fElements->containsElement(elem))
0184         fElements->addElement(elem);
0185 }
0186 
0187 inline void XercesGroupInfo::setBaseGroup(XercesGroupInfo* const baseGroup) {
0188 
0189     fBaseGroup = baseGroup;
0190 }
0191 
0192 inline void XercesGroupInfo::setCheckElementConsistency(const bool aValue) {
0193 
0194     fCheckElementConsistency = aValue;
0195 }
0196 
0197 XERCES_CPP_NAMESPACE_END
0198 
0199 #endif
0200 
0201 /**
0202   * End of file XercesGroupInfo.hpp
0203   */
0204