1 | /*
|
---|
2 | * Copyright 2003,2004 The Apache Software Foundation.
|
---|
3 | *
|
---|
4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
---|
5 | * you may not use this file except in compliance with the License.
|
---|
6 | * You may obtain a copy of the License at
|
---|
7 | *
|
---|
8 | * http://www.apache.org/licenses/LICENSE-2.0
|
---|
9 | *
|
---|
10 | * Unless required by applicable law or agreed to in writing, software
|
---|
11 | * distributed under the License is distributed on an "AS IS" BASIS,
|
---|
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
---|
13 | * See the License for the specific language governing permissions and
|
---|
14 | * limitations under the License.
|
---|
15 | */
|
---|
16 |
|
---|
17 | /*
|
---|
18 | * $Log: XSModelGroup.hpp,v $
|
---|
19 | * Revision 1.6 2004/09/08 13:56:08 peiyongz
|
---|
20 | * Apache License Version 2.0
|
---|
21 | *
|
---|
22 | * Revision 1.5 2003/12/01 23:23:26 neilg
|
---|
23 | * fix for bug 25118; thanks to Jeroen Witmond
|
---|
24 | *
|
---|
25 | * Revision 1.4 2003/11/21 17:29:53 knoaman
|
---|
26 | * PSVI update
|
---|
27 | *
|
---|
28 | * Revision 1.3 2003/11/14 22:47:53 neilg
|
---|
29 | * fix bogus log message from previous commit...
|
---|
30 | *
|
---|
31 | * Revision 1.2 2003/11/14 22:33:30 neilg
|
---|
32 | * Second phase of schema component model implementation.
|
---|
33 | * Implement XSModel, XSNamespaceItem, and the plumbing necessary
|
---|
34 | * to connect them to the other components.
|
---|
35 | * Thanks to David Cargill.
|
---|
36 | *
|
---|
37 | * Revision 1.1 2003/09/16 14:33:36 neilg
|
---|
38 | * PSVI/schema component model classes, with Makefile/configuration changes necessary to build them
|
---|
39 | *
|
---|
40 | */
|
---|
41 |
|
---|
42 | #if !defined(XSMODELGROUP_HPP)
|
---|
43 | #define XSMODELGROUP_HPP
|
---|
44 |
|
---|
45 | #include <xercesc/framework/psvi/XSObject.hpp>
|
---|
46 |
|
---|
47 | XERCES_CPP_NAMESPACE_BEGIN
|
---|
48 |
|
---|
49 | /**
|
---|
50 | * This class describes all properties of a Schema Model Group
|
---|
51 | * component.
|
---|
52 | * This is *always* owned by the validator /parser object from which
|
---|
53 | * it is obtained.
|
---|
54 | */
|
---|
55 |
|
---|
56 | // forward declarations
|
---|
57 | class XSAnnotation;
|
---|
58 | class XSParticle;
|
---|
59 |
|
---|
60 | class XMLPARSER_EXPORT XSModelGroup : public XSObject
|
---|
61 | {
|
---|
62 | public:
|
---|
63 |
|
---|
64 | // Content model compositors
|
---|
65 | enum COMPOSITOR_TYPE {
|
---|
66 | /**
|
---|
67 | * This constant value signifies a sequence operator.
|
---|
68 | */
|
---|
69 | COMPOSITOR_SEQUENCE = 1,
|
---|
70 | /**
|
---|
71 | * This constant value signifies a choice operator.
|
---|
72 | */
|
---|
73 | COMPOSITOR_CHOICE = 2,
|
---|
74 | /**
|
---|
75 | * This content model represents a simplified version of the SGML
|
---|
76 | * &-Connector and is limited to the top-level of any content model.
|
---|
77 | * No element in the all content model may appear more than once.
|
---|
78 | */
|
---|
79 | COMPOSITOR_ALL = 3
|
---|
80 | };
|
---|
81 |
|
---|
82 | // Constructors and Destructor
|
---|
83 | // -----------------------------------------------------------------------
|
---|
84 | /** @name Constructors */
|
---|
85 | //@{
|
---|
86 |
|
---|
87 | /**
|
---|
88 | * The default constructor
|
---|
89 | *
|
---|
90 | * @param compositorType
|
---|
91 | * @param particleList
|
---|
92 | * @param annot
|
---|
93 | * @param xsModel
|
---|
94 | * @param manager The configurable memory manager
|
---|
95 | */
|
---|
96 | XSModelGroup
|
---|
97 | (
|
---|
98 | COMPOSITOR_TYPE compositorType
|
---|
99 | , XSParticleList* const particleList
|
---|
100 | , XSAnnotation* const annot
|
---|
101 | , XSModel* const xsModel
|
---|
102 | , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
|
---|
103 | );
|
---|
104 |
|
---|
105 | //@};
|
---|
106 |
|
---|
107 | /** @name Destructor */
|
---|
108 | //@{
|
---|
109 | ~XSModelGroup();
|
---|
110 | //@}
|
---|
111 |
|
---|
112 | //---------------------
|
---|
113 | /** @name XSModelGroup methods */
|
---|
114 | //@{
|
---|
115 |
|
---|
116 | /**
|
---|
117 | * [compositor]: one of all, choice or sequence. The valid constants
|
---|
118 | * values are:
|
---|
119 | * <code>COMPOSITOR_SEQUENCE, COMPOSITOR_CHOICE, COMPOSITOR_ALL</code>.
|
---|
120 | */
|
---|
121 | COMPOSITOR_TYPE getCompositor() const;
|
---|
122 |
|
---|
123 | /**
|
---|
124 | * A list of [particles].
|
---|
125 | */
|
---|
126 | XSParticleList *getParticles() const;
|
---|
127 |
|
---|
128 | /**
|
---|
129 | * Optional. An [annotation].
|
---|
130 | */
|
---|
131 | XSAnnotation *getAnnotation() const;
|
---|
132 |
|
---|
133 | //@}
|
---|
134 |
|
---|
135 | //----------------------------------
|
---|
136 | /** methods needed by implementation */
|
---|
137 |
|
---|
138 | //@{
|
---|
139 |
|
---|
140 | //@}
|
---|
141 | private:
|
---|
142 |
|
---|
143 | // -----------------------------------------------------------------------
|
---|
144 | // Unimplemented constructors and operators
|
---|
145 | // -----------------------------------------------------------------------
|
---|
146 | XSModelGroup(const XSModelGroup&);
|
---|
147 | XSModelGroup & operator=(const XSModelGroup &);
|
---|
148 |
|
---|
149 | protected:
|
---|
150 |
|
---|
151 | // -----------------------------------------------------------------------
|
---|
152 | // data members
|
---|
153 | // -----------------------------------------------------------------------
|
---|
154 | COMPOSITOR_TYPE fCompositorType;
|
---|
155 | XSParticleList* fParticleList;
|
---|
156 | XSAnnotation* fAnnotation;
|
---|
157 | };
|
---|
158 |
|
---|
159 | inline XSModelGroup::COMPOSITOR_TYPE XSModelGroup::getCompositor() const
|
---|
160 | {
|
---|
161 | return fCompositorType;
|
---|
162 | }
|
---|
163 |
|
---|
164 | inline XSParticleList* XSModelGroup::getParticles() const
|
---|
165 | {
|
---|
166 | return fParticleList;
|
---|
167 | }
|
---|
168 |
|
---|
169 | inline XSAnnotation* XSModelGroup::getAnnotation() const
|
---|
170 | {
|
---|
171 | return fAnnotation;
|
---|
172 | }
|
---|
173 |
|
---|
174 | XERCES_CPP_NAMESPACE_END
|
---|
175 |
|
---|
176 | #endif
|
---|