wsdlpull svntrunk
Loading...
Searching...
No Matches
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>
26#include "xmlpull/Qname.h"
27#include "xmlpull/XmlUtils.h"
28#include "schemaparser/Schema.h"
30
31namespace Schema {
32
33class Group;
34class Element;
35
37{
38public:
39
40 typedef union
41 {
46
47 typedef enum {
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
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
74private:
75 Schema::Compositor m_compositor;
76 Contents contents_;
77 int minOccurs,maxOccurs;
78 int nParticles;
79 bool anyContent_;
80};
81
82inline
85{
86 return m_compositor;
87}
88
89inline
92{
93 return contents_.begin();
94}
95
96inline
99{
100 return contents_.end();
101}
102
103
104inline
105int
107{
108 return minOccurs;
109
110}
111
112inline
113int
115{
116 return maxOccurs;
117
118}
119
120inline
121void
123{
124 minOccurs=m;
125
126}
127
128inline
129void
131{
132 maxOccurs=m;
133
134}
135
136inline
137int
139{
140 return nParticles;
141}
142
143inline
144bool
146{
147 return anyContent_;
148}
149}
150#endif /* */
void setMin(const int &m)
ContentsIterator begin()
std::pair< ContentType, ContentDiscriminator > ContentHolder
std::list< ContentHolder > Contents
Schema::Compositor getCompositor() const
void setMax(const int &m)
ContentsIterator end()
std::list< ContentHolder >::iterator ContentsIterator
int getNumParticles() const
bool anyContents() const
Compositor
Definition Schema.h:32
#define WSDLPULL_EXPORT