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$
*/
#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
XSObject.hpp
XMLPARSER_EXPORT
#define XMLPARSER_EXPORT
Definition XercesDefs.hpp:163
XERCES_CPP_NAMESPACE_BEGIN
#define XERCES_CPP_NAMESPACE_BEGIN
Definition XercesDefs.hpp:112
XERCES_CPP_NAMESPACE_END
#define XERCES_CPP_NAMESPACE_END
Definition XercesDefs.hpp:113
XMLSize_t
size_t XMLSize_t
Definition Xerces_autoconf_config.hpp:112
MemoryManager
Configurable memory manager.
Definition MemoryManager.hpp:40
XSConstants::WILDCARD
@ WILDCARD
The object describes a wildcard.
Definition XSConstants.hpp:97
XSConstants::ELEMENT_DECLARATION
@ ELEMENT_DECLARATION
The object describes an element declaration.
Definition XSConstants.hpp:69
XSConstants::MODEL_GROUP_DEFINITION
@ MODEL_GROUP_DEFINITION
The object describes a model group definition.
Definition XSConstants.hpp:85
XSElementDeclaration
Definition XSElementDeclaration.hpp:45
XSModelGroup
Definition XSModelGroup.hpp:41
XSModel
Definition XSModel.hpp:60
XSObject
Definition XSObject.hpp:43
XSParticle
Definition XSParticle.hpp:42
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::XSParticle
XSParticle(TERM_TYPE termType, XSModel *const xsModel, XSObject *const particleTerm, XMLSize_t minOccurs, XMLSize_t maxOccurs, bool unbounded, MemoryManager *const manager)
The default constructor.
XSParticle::fTerm
XSObject * fTerm
Definition XSParticle.hpp:173
XSParticle::getElementTerm
XSElementDeclaration * getElementTerm()
If this particle has an [element declaration] for its term, this method returns that declaration; oth...
XSParticle::TERM_TYPE
TERM_TYPE
Definition XSParticle.hpp:46
XSParticle::getModelGroupTerm
XSModelGroup * getModelGroupTerm()
If this particle has a [model group] for its term, this method returns that definition; otherwise,...
XSParticle::getMinOccurs
XMLSize_t getMinOccurs() const
[min occurs]: determines the minimum number of terms that can occur.
Definition XSParticle.hpp:176
XSParticle::fMaxOccurs
XMLSize_t fMaxOccurs
Definition XSParticle.hpp:171
XSParticle::fTermType
TERM_TYPE fTermType
Definition XSParticle.hpp:169
XSParticle::fMinOccurs
XMLSize_t fMinOccurs
Definition XSParticle.hpp:170
XSParticle::getMaxOccursUnbounded
bool getMaxOccursUnbounded() const
[max occurs] whether the maxOccurs value is unbounded.
Definition XSParticle.hpp:186
XSParticle::~XSParticle
~XSParticle()
XSParticle::getWildcardTerm
XSWildcard * getWildcardTerm()
If this particle has an [wildcard] for its term, this method returns that declaration; otherwise,...
XSParticle::getMaxOccurs
XMLSize_t getMaxOccurs() const
[max occurs] determines the maximum number of terms that can occur.
Definition XSParticle.hpp:181
XSParticle::fUnbounded
bool fUnbounded
Definition XSParticle.hpp:172
XSWildcard
Definition XSWildcard.hpp:42