Xerces-C++ 3.2.5
XSParticle.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_XSPARTICLE_HPP)
23#define XERCESC_INCLUDE_GUARD_XSPARTICLE_HPP
24
26
28
36// forward declarations
38class XSModelGroup;
39class XSWildcard;
40
42{
43public:
44
45 // possible terms of this particle
46 enum TERM_TYPE {
47 /*
48 * an empty particle
49 */
50 TERM_EMPTY = 0,
51 /*
52 * the particle has element content
53 */
55 /*
56 * the particle's content is a model group
57 */
59 /*
60 * the particle's content is a wildcard
61 */
62 TERM_WILDCARD = XSConstants::WILDCARD
63 };
64
65 // Constructors and Destructor
66 // -----------------------------------------------------------------------
69
82 (
83 TERM_TYPE termType
84 , XSModel* const xsModel
85 , XSObject* const particleTerm
86 , XMLSize_t minOccurs
87 , XMLSize_t maxOccurs
88 , bool unbounded
89 , MemoryManager* const manager
90 );
91
93
98
99 //---------------------
102
106 XMLSize_t getMinOccurs() const;
107
112 XMLSize_t getMaxOccurs() const;
113
117 bool getMaxOccursUnbounded() const;
118
123 TERM_TYPE getTermType() const;
124
132
140
148
150
151 //----------------------------------
154
156private:
157
158 // -----------------------------------------------------------------------
159 // Unimplemented constructors and operators
160 // -----------------------------------------------------------------------
161 XSParticle(const XSParticle&);
162 XSParticle & operator=(const XSParticle &);
163
164protected:
165
166 // -----------------------------------------------------------------------
167 // data members
168 // -----------------------------------------------------------------------
174};
175
177{
178 return fMinOccurs;
179}
180
182{
183 return fMaxOccurs;
184}
185
187{
188 return fUnbounded;
189}
190
192{
193 return fTermType;
194}
195
197
198#endif
#define XMLPARSER_EXPORT
Definition XercesDefs.hpp:163
#define XERCES_CPP_NAMESPACE_BEGIN
Definition XercesDefs.hpp:112
#define XERCES_CPP_NAMESPACE_END
Definition XercesDefs.hpp:113
size_t XMLSize_t
Definition Xerces_autoconf_config.hpp:112
Configurable memory manager.
Definition MemoryManager.hpp:40
@ WILDCARD
The object describes a wildcard.
Definition XSConstants.hpp:97
@ ELEMENT_DECLARATION
The object describes an element declaration.
Definition XSConstants.hpp:69
@ MODEL_GROUP_DEFINITION
The object describes a model group definition.
Definition XSConstants.hpp:85
Definition XSElementDeclaration.hpp:45
Definition XSModelGroup.hpp:41
Definition XSModel.hpp:60
Definition XSObject.hpp:43
Definition XSParticle.hpp:42
TERM_TYPE getTermType() const
Returns the type of the [term]: one of TERM_EMPTY, TERM_ELEMENT, TERM_MODELGROUP, or TERM_WILDCARD.
Definition XSParticle.hpp:191
XSParticle(TERM_TYPE termType, XSModel *const xsModel, XSObject *const particleTerm, XMLSize_t minOccurs, XMLSize_t maxOccurs, bool unbounded, MemoryManager *const manager)
The default constructor.
XSObject * fTerm
Definition XSParticle.hpp:173
XSElementDeclaration * getElementTerm()
If this particle has an [element declaration] for its term, this method returns that declaration; oth...
TERM_TYPE
Definition XSParticle.hpp:46
XSModelGroup * getModelGroupTerm()
If this particle has a [model group] for its term, this method returns that definition; otherwise,...
XMLSize_t getMinOccurs() const
[min occurs]: determines the minimum number of terms that can occur.
Definition XSParticle.hpp:176
XMLSize_t fMaxOccurs
Definition XSParticle.hpp:171
TERM_TYPE fTermType
Definition XSParticle.hpp:169
XMLSize_t fMinOccurs
Definition XSParticle.hpp:170
bool getMaxOccursUnbounded() const
[max occurs] whether the maxOccurs value is unbounded.
Definition XSParticle.hpp:186
XSWildcard * getWildcardTerm()
If this particle has an [wildcard] for its term, this method returns that declaration; otherwise,...
XMLSize_t getMaxOccurs() const
[max occurs] determines the maximum number of terms that can occur.
Definition XSParticle.hpp:181
bool fUnbounded
Definition XSParticle.hpp:172
Definition XSWildcard.hpp:42