All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
All.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 All.cpp
22 
23  \brief This class models an XML Schema all element.
24 */
25 
26 // TerraLib
27 #include "All.h"
28 #include "Annotation.h"
29 #include "Element.h"
30 
31 // STL
32 #include <cassert>
33 
34 te::xsd::All::All(unsigned int minOccurs, unsigned int maxOccurs, Annotation* ann, std::string* id)
35  : Occurs(minOccurs, maxOccurs),
36  Identifiable(id),
37  Annotated(ann)
38 {
39 }
40 
42  : Occurs(rhs),
43  Identifiable(rhs),
44  Annotated(rhs)
45 {
46  for(std::size_t i = 0; i < rhs.m_elementVec.size(); ++i)
47  m_elementVec.push_back(new Element(m_elementVec[i]));
48 }
49 
51 {
52 }
53 
55 {
56  if(this != &rhs)
57  {
58  Occurs::operator=(rhs);
59 
61 
63 
64  for(std::size_t i = 0; i < rhs.m_elementVec.size(); ++i)
65  m_elementVec.push_back(new Element(rhs.m_elementVec[i]));
66  }
67 
68  return *this;
69 }
70 
71 const boost::ptr_vector<te::xsd::Element>& te::xsd::All::getElements() const
72 {
73  return m_elementVec;
74 }
75 
77 {
78  m_elementVec.push_back(e);
79 }
80 
82 {
83  return new All(*this);
84 }
This class models an XML Schema all element.
Definition: All.h:54
A base class for XSD classes that may allow annotation.
Definition: Annotated.h:49
A base class for XSD classes that have occurs attributes.
Definition: Occurs.h:43
boost::ptr_vector< Element > m_elementVec
Lis of elements. (Optional)
Definition: All.h:106
Annotated & operator=(const Annotated &rhs)
Assignment operator.
Definition: Annotated.cpp:57
This class models the element of a XML Schema.
Definition: Element.h:56
A base class for elements that are not definitions nor declarations. This class is just for creating ...
Definition: Content.h:43
All(unsigned int minOccurs=1, unsigned int maxOccurs=1, Annotation *ann=0, std::string *id=0)
Constructor.
Definition: All.cpp:34
All & operator=(const All &rhs)
Assignment operator.
Definition: All.cpp:54
A class that models a XSD annotation element.
void addElement(Element *e)
It adds an element to this All element.
Definition: All.cpp:76
A base class for XSD classes that must provide a unique ID property.
Definition: Identifiable.h:46
~All()
Destructor.
Definition: All.cpp:50
const boost::ptr_vector< Element > & getElements() const
It returns the list of elements of All.
Definition: All.cpp:71
Identifiable & operator=(const Identifiable &rhs)
Assignment operator.
Content * clone() const
Definition: All.cpp:81
This class models an XML Schema all element.
A class that models a XSD annotation element.
Definition: Annotation.h:55
Occurs & operator=(const Occurs &rhs)
Assignment operator.
Definition: Occurs.cpp:71