Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-16 10:34:30

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_CMREPEATINGLEAF_HPP)
0023 #define XERCESC_INCLUDE_GUARD_CMREPEATINGLEAF_HPP
0024 
0025 #include <xercesc/validators/common/CMLeaf.hpp>
0026 
0027 
0028 XERCES_CPP_NAMESPACE_BEGIN
0029 
0030 //
0031 //  A compound content model leaf node which carries occurence information.
0032 //
0033 class CMRepeatingLeaf : public CMLeaf
0034 {
0035 public :
0036     // -----------------------------------------------------------------------
0037     //  Constructors
0038     // -----------------------------------------------------------------------
0039     CMRepeatingLeaf
0040     (
0041           QName* const         element
0042         , int                  minOccurs
0043         , int                  maxOccurs
0044         , unsigned int         position
0045         , unsigned int         maxStates
0046         , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
0047     );
0048     CMRepeatingLeaf
0049     (
0050           QName* const         element
0051         , int                  minOccurs
0052         , int                  maxOccurs
0053         , unsigned int         position
0054         , bool                 adopt
0055         , unsigned int         maxStates
0056         , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
0057     );
0058 
0059 
0060     // -----------------------------------------------------------------------
0061     //  Getter methods
0062     // -----------------------------------------------------------------------
0063     int getMinOccurs() const;
0064     int getMaxOccurs() const;
0065 
0066     virtual bool isRepeatableLeaf() const;
0067 
0068 private :
0069     // -----------------------------------------------------------------------
0070     //  Private data members
0071     //
0072     //  fMinOccurs
0073     //  fMaxOccurs
0074     //      The cardinality of the repeating leaf
0075     //
0076     // -----------------------------------------------------------------------
0077     int             fMinOccurs;
0078     int             fMaxOccurs;
0079 
0080     // -----------------------------------------------------------------------
0081     //  Unimplemented constructors and operators
0082     // -----------------------------------------------------------------------
0083     CMRepeatingLeaf(const CMRepeatingLeaf&);
0084     CMRepeatingLeaf& operator=(const CMRepeatingLeaf&);
0085 };
0086 
0087 
0088 // -----------------------------------------------------------------------
0089 //  Constructors
0090 // -----------------------------------------------------------------------
0091 inline CMRepeatingLeaf::CMRepeatingLeaf(   QName* const               element
0092                                          , int                        minOccurs
0093                                          , int                        maxOccurs
0094                                          , unsigned int               position
0095                                          , unsigned int               maxStates
0096                                          ,       MemoryManager* const manager) :
0097     CMLeaf(element, position, maxStates, manager)
0098     , fMinOccurs(minOccurs)
0099     , fMaxOccurs(maxOccurs)
0100 {
0101 }
0102 
0103 inline CMRepeatingLeaf::CMRepeatingLeaf(   QName* const               element
0104                                          , int                        minOccurs
0105                                          , int                        maxOccurs
0106                                          , unsigned int               position
0107                                          , bool                       adopt
0108                                          , unsigned int               maxStates
0109                                          ,       MemoryManager* const manager) :
0110     CMLeaf(element, position, adopt, maxStates, manager)
0111     , fMinOccurs(minOccurs)
0112     , fMaxOccurs(maxOccurs)
0113 {
0114 }
0115 
0116 // ---------------------------------------------------------------------------
0117 //  Getter methods
0118 // ---------------------------------------------------------------------------
0119 inline int CMRepeatingLeaf::getMinOccurs() const
0120 {
0121     return fMinOccurs;
0122 }
0123 
0124 inline int CMRepeatingLeaf::getMaxOccurs() const
0125 {
0126     return fMaxOccurs;
0127 }
0128 
0129 inline bool CMRepeatingLeaf::isRepeatableLeaf() const
0130 {
0131     return true;
0132 }
0133 
0134 XERCES_CPP_NAMESPACE_END
0135 
0136 #endif