wsdlpull
1.23
Toggle main menu visibility
Loading...
Searching...
No Matches
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
/* */
Qname.h
SchemaParserException.h
Schema.h
XmlUtils.h
Schema::ContentModel::setMin
void setMin(const int &m)
Definition
ContentModel.h:122
Schema::ContentModel::begin
ContentsIterator begin()
Definition
ContentModel.h:91
Schema::ContentModel::ContentHolder
std::pair< ContentType, ContentDiscriminator > ContentHolder
Definition
ContentModel.h:53
Schema::ContentModel::matchforwardRef
void matchforwardRef(const std::string &name, Element &e)
Definition
ContentModel.cpp:103
Schema::ContentModel::addGroup
void addGroup(const Group &e, bool own=false)
Definition
ContentModel.cpp:51
Schema::ContentModel::addElement
void addElement(const Element &e)
Definition
ContentModel.cpp:27
Schema::ContentModel::Contents
std::list< ContentHolder > Contents
Definition
ContentModel.h:54
Schema::ContentModel::getCompositor
Schema::Compositor getCompositor() const
Definition
ContentModel.h:84
Schema::ContentModel::getMin
int getMin() const
Definition
ContentModel.h:106
Schema::ContentModel::setMax
void setMax(const int &m)
Definition
ContentModel.h:130
Schema::ContentModel::end
ContentsIterator end()
Definition
ContentModel.h:98
Schema::ContentModel::ContentModel
ContentModel(Schema::Compositor)
Definition
ContentModel.cpp:79
Schema::ContentModel::addContentModel
void addContentModel(const ContentModel *c)
Definition
ContentModel.cpp:66
Schema::ContentModel::ContentsIterator
std::list< ContentHolder >::iterator ContentsIterator
Definition
ContentModel.h:55
Schema::ContentModel::getNumParticles
int getNumParticles() const
Definition
ContentModel.h:138
Schema::ContentModel::anyContents
bool anyContents() const
Definition
ContentModel.h:145
Schema::ContentModel::Container
@ Container
Definition
ContentModel.h:50
Schema::ContentModel::Particle
@ Particle
Definition
ContentModel.h:48
Schema::ContentModel::ParticleGroup
@ ParticleGroup
Definition
ContentModel.h:49
Schema::ContentModel::getMax
int getMax() const
Definition
ContentModel.h:114
Schema::Element
Definition
Element.h:31
Schema::Group
Definition
Group.h:34
Schema
Definition
Annotation.h:27
Schema::Compositor
Compositor
Definition
Schema.h:32
Schema::ContentModel::ContentType
Definition
ContentModel.h:41
Schema::ContentModel::ContentType::c
ContentModel * c
Definition
ContentModel.h:44
Schema::ContentModel::ContentType::e
Element * e
Definition
ContentModel.h:42
Schema::ContentModel::ContentType::g
Group * g
Definition
ContentModel.h:43
wsdlpull_export.h
WSDLPULL_EXPORT
#define WSDLPULL_EXPORT
Definition
wsdlpull_export.h:30
Generated by
1.17.0