wsdlpull
1.23
Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
src
schemaparser
ContentModel.h
Go to the documentation of this file.
1
/*
2
* wsdlpull - A C++ parser for WSDL (Web services description language)
3
* Copyright (C) 2005-2007 Vivek Krishna
4
*
5
* This library is free software; you can redistribute it and/or
6
* modify it under the terms of the GNU Library General Public
7
* License as published by the Free Software Foundation; either
8
* version 2 of the License, or (at your option) any later version.
9
*
10
* This library is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
* Library General Public License for more details.
14
*
15
* You should have received a copy of the GNU Library General Public
16
* License along with this library; if not, write to the Free
17
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18
*/
19
20
#ifndef _CONTENTMODELH
21
#define _CONTENTMODELH
22
23
#include <list>
24
#include <utility>
25
#include "
xmlpull/wsdlpull_export.h
"
26
#include "
xmlpull/Qname.h
"
27
#include "
xmlpull/XmlUtils.h
"
28
#include "
schemaparser/Schema.h
"
29
#include "
schemaparser/SchemaParserException.h
"
30
31
namespace
Schema {
32
33
class
Group;
34
class
Element;
35
36
class
WSDLPULL_EXPORT
ContentModel
37
{
38
public
:
39
40
typedef
union
41
{
42
Element
*
e
;
43
Group
*
g
;
44
ContentModel
*
c
;
45
}
ContentType
;
46
47
typedef
enum
{
48
Particle
,
49
ParticleGroup
,
50
Container
51
} ContentDiscriminator;
52
53
typedef
std::pair<ContentType,ContentDiscriminator>
ContentHolder
;
54
typedef
std::list<ContentHolder>
Contents
;
55
typedef
std::list<ContentHolder>::iterator
ContentsIterator
;
56
57
58
ContentModel
(
Schema::Compositor
);
59
~
ContentModel
();
60
Schema::Compositor
getCompositor()
const
;
61
ContentsIterator
begin();
62
ContentsIterator
end();
63
void
addElement(
const
Element
& e);
64
void
addGroup(
const
Group
& e ,
bool
own=
false
);
65
void
addContentModel(
const
ContentModel
* c);
66
void
setMin(
const
int
& m);
67
void
setMax(
const
int
& m);
68
int
getMin()
const
;
69
int
getMax()
const
;
70
int
getNumParticles()
const
;
71
bool
anyContents()
const
;
72
void
matchforwardRef(
const
std::string &name,
Element
&e);
73
74
private
:
75
Schema::Compositor
m_compositor;
76
Contents
contents_;
77
int
minOccurs,maxOccurs;
78
int
nParticles;
79
bool
anyContent_;
80
};
81
82
inline
83
Schema::Compositor
84
ContentModel::getCompositor
()
const
85
{
86
return
m_compositor;
87
}
88
89
inline
90
ContentModel::ContentsIterator
91
ContentModel::begin
()
92
{
93
return
contents_.begin();
94
}
95
96
inline
97
ContentModel::ContentsIterator
98
ContentModel::end
()
99
{
100
return
contents_.end();
101
}
102
103
104
inline
105
int
106
ContentModel::getMin
()
const
107
{
108
return
minOccurs;
109
110
}
111
112
inline
113
int
114
ContentModel::getMax
()
const
115
{
116
return
maxOccurs;
117
118
}
119
120
inline
121
void
122
ContentModel::setMin
(
const
int
& m)
123
{
124
minOccurs=m;
125
126
}
127
128
inline
129
void
130
ContentModel::setMax
(
const
int
& m)
131
{
132
maxOccurs=m;
133
134
}
135
136
inline
137
int
138
ContentModel::getNumParticles
()
const
139
{
140
return
nParticles;
141
}
142
143
inline
144
bool
145
ContentModel::anyContents
()
const
146
{
147
return
anyContent_;
148
}
149
}
150
#endif
/* */
Generated by
1.8.1.1