XSParticle.hpp
Go to the documentation of this file.
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* $Id: XSParticle.hpp 883665 2009-11-24 11:41:38Z borisk $
*/
#if !defined(XERCESC_INCLUDE_GUARD_XSPARTICLE_HPP)
#define XERCESC_INCLUDE_GUARD_XSPARTICLE_HPP
#include <xercesc/framework/psvi/XSObject.hpp>
XERCES_CPP_NAMESPACE_BEGIN
// forward declarations
class XSElementDeclaration;
class XSModelGroup;
class XSWildcard;
class XMLPARSER_EXPORT XSParticle : public XSObject
{
public:
// possible terms of this particle
enum TERM_TYPE {
/*
* an empty particle
*/
TERM_EMPTY = 0,
/*
* the particle has element content
*/
TERM_ELEMENT = XSConstants::ELEMENT_DECLARATION,
/*
* the particle's content is a model group
*/
TERM_MODELGROUP = XSConstants::MODEL_GROUP_DEFINITION,
/*
* the particle's content is a wildcard
*/
TERM_WILDCARD = XSConstants::WILDCARD
};
// Constructors and Destructor
// -----------------------------------------------------------------------
XSParticle
(
TERM_TYPE termType
, XSModel* const xsModel
, XSObject* const particleTerm
, XMLSize_t minOccurs
, XMLSize_t maxOccurs
, bool unbounded
, MemoryManager* const manager
);
~XSParticle();
//---------------------
XMLSize_t getMinOccurs() const;
XMLSize_t getMaxOccurs() const;
bool getMaxOccursUnbounded() const;
TERM_TYPE getTermType() const;
XSElementDeclaration *getElementTerm();
XSModelGroup *getModelGroupTerm();
XSWildcard *getWildcardTerm();
//----------------------------------
private:
// -----------------------------------------------------------------------
// Unimplemented constructors and operators
// -----------------------------------------------------------------------
XSParticle(const XSParticle&);
XSParticle & operator=(const XSParticle &);
protected:
// -----------------------------------------------------------------------
// data members
// -----------------------------------------------------------------------
TERM_TYPE fTermType;
XMLSize_t fMinOccurs;
XMLSize_t fMaxOccurs;
bool fUnbounded;
XSObject* fTerm;
};
inline XMLSize_t XSParticle::getMinOccurs() const
{
return fMinOccurs;
}
inline XMLSize_t XSParticle::getMaxOccurs() const
{
return fMaxOccurs;
}
inline bool XSParticle::getMaxOccursUnbounded() const
{
return fUnbounded;
}
inline XSParticle::TERM_TYPE XSParticle::getTermType() const
{
return fTermType;
}
XERCES_CPP_NAMESPACE_END
#endif
XSParticle::fTerm
XSObject * fTerm
Definition: XSParticle.hpp:173
XSModelGroup
Definition: XSModelGroup.hpp:40
XSParticle::fUnbounded
bool fUnbounded
Definition: XSParticle.hpp:172
XSWildcard
Definition: XSWildcard.hpp:41
XSParticle::getMinOccurs
XMLSize_t getMinOccurs() const
[min occurs]: determines the minimum number of terms that can occur.
Definition: XSParticle.hpp:176
XSParticle::getMaxOccurs
XMLSize_t getMaxOccurs() const
[max occurs] determines the maximum number of terms that can occur.
Definition: XSParticle.hpp:181
XSConstants::WILDCARD
The object describes a wildcard.
Definition: XSConstants.hpp:97
XSElementDeclaration
Definition: XSElementDeclaration.hpp:44
XSConstants::ELEMENT_DECLARATION
The object describes an element declaration.
Definition: XSConstants.hpp:69
XMLPARSER_EXPORT
#define XMLPARSER_EXPORT
Definition: XercesDefs.hpp:163
XSModel
Definition: XSModel.hpp:59
XSParticle::getMaxOccursUnbounded
bool getMaxOccursUnbounded() const
[max occurs] whether the maxOccurs value is unbounded.
Definition: XSParticle.hpp:186
XSParticle::getTermType
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::fMaxOccurs
XMLSize_t fMaxOccurs
Definition: XSParticle.hpp:171
MemoryManager
Configurable memory manager.
Definition: MemoryManager.hpp:39
XERCES_CPP_NAMESPACE_BEGIN
#define XERCES_CPP_NAMESPACE_BEGIN
Definition: XercesDefs.hpp:112
XSParticle::TERM_TYPE
TERM_TYPE
Definition: XSParticle.hpp:46
XSObject
Definition: XSObject.hpp:42
XMLSize_t
size_t XMLSize_t
Definition: Xerces_autoconf_config.hpp:110
XSParticle::fMinOccurs
XMLSize_t fMinOccurs
Definition: XSParticle.hpp:170
XERCES_CPP_NAMESPACE_END
#define XERCES_CPP_NAMESPACE_END
Definition: XercesDefs.hpp:113
XSObject.hpp
XSParticle::fTermType
TERM_TYPE fTermType
Definition: XSParticle.hpp:169
XSParticle
Definition: XSParticle.hpp:41
XSConstants::MODEL_GROUP_DEFINITION
The object describes a model group definition.
Definition: XSConstants.hpp:85