All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Sequence.cpp
Go to the documentation of this file.
1 /* Copyright (C) 2008 National Institute For Space Research (INPE) - Brazil.
2 
3  This file is part of the TerraLib - a Framework for building GIS enabled applications.
4 
5  TerraLib is free software: you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation, either version 3 of the License,
8  or (at your option) any later version.
9 
10  TerraLib 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
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with TerraLib. See COPYING. If not, write to
17  TerraLib Team at <terralib-team@terralib.org>.
18  */
19 
20 /*!
21  \file Sequence.cpp
22 
23  \brief This class models a sequence element in a XML Schema.
24 */
25 
26 // TerraLib
27 #include "Any.h"
28 #include "Choice.h"
29 #include "Element.h"
30 #include "Group.h"
31 #include "Sequence.h"
32 
33 te::xsd::Sequence::Sequence(unsigned int minOccurs, unsigned int maxOccurs, Annotation* ann, std::string* id)
34  : Occurs(minOccurs, maxOccurs),
35  Identifiable(id),
36  Annotated(ann)
37 {
38 }
39 
41  : Occurs(rhs),
42  Identifiable(rhs),
43  Annotated(rhs)
44 {
45 }
46 
48 {
49 }
50 
52 {
53  return *this;
54 }
55 
56 const boost::ptr_vector<te::xsd::Element>& te::xsd::Sequence::getElements() const
57 {
58  return m_elementVec;
59 }
60 
61 const boost::ptr_vector<te::xsd::Content>& te::xsd::Sequence::getContents() const
62 {
63  return m_contentVec;
64 }
65 
66 const boost::ptr_vector<te::xsd::Any>& te::xsd::Sequence::getAnys() const
67 {
68  return m_anyVec;
69 }
70 
72 {
73  m_elementVec.push_back(e);
74 }
75 
77 {
78  m_contentVec.push_back(c);
79 }
80 
82 {
83  m_anyVec.push_back(a);
84 }
85 
87 {
88  return new Sequence(*this);
89 }
A base class for XSD classes that may allow annotation.
Definition: Annotated.h:49
This class models a group element in a XML Schema.
A base class for XSD classes that have occurs attributes.
Definition: Occurs.h:43
const boost::ptr_vector< Any > & getAnys() const
It returns the list of any elements of Choice.
Definition: Sequence.cpp:66
This class models the element of a XML Schema.
Definition: Element.h:56
This class models a sequence element in a XML Schema.
Definition: Sequence.h:58
A base class for elements that are not definitions nor declarations. This class is just for creating ...
Definition: Content.h:43
void addElement(Element *e)
It adds an element to this Sequence element.
Definition: Sequence.cpp:71
It models the XML Schema any element.
Definition: Any.h:49
const boost::ptr_vector< Content > & getContents() const
It returns the list of Content elements of Choice.
Definition: Sequence.cpp:61
A base class for XSD classes that must provide a unique ID property.
Definition: Identifiable.h:46
Sequence & operator=(const Sequence &rhs)
Assignment operator.
Definition: Sequence.cpp:51
Sequence(unsigned int minOccurs=1, unsigned int maxOccurs=1, Annotation *ann=0, std::string *id=0)
Constructor.
Definition: Sequence.cpp:33
const boost::ptr_vector< Element > & getElements() const
It returns the list of elements of All.
Definition: Sequence.cpp:56
This class models the XML Schema choice element.
void addAny(Any *a)
It adds an any to this Sequence element.
Definition: Sequence.cpp:81
void addContent(Content *c)
It adds a Content element to this Sequence element.
Definition: Sequence.cpp:76
Content * clone() const
Definition: Sequence.cpp:86
A class that models a XSD annotation element.
Definition: Annotation.h:55
It models the XML Schema any element.
~Sequence()
Destructor.
Definition: Sequence.cpp:47