All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
All.h
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.h
22 
23  \brief This class models an XML Schema all element.
24 */
25 
26 #ifndef __TERRALIB_XSD_INTERNAL_ALL_H
27 #define __TERRALIB_XSD_INTERNAL_ALL_H
28 
29 // TerraLib
30 #include "Annotated.h"
31 #include "Content.h"
32 #include "Identifiable.h"
33 #include "Occurs.h"
34 
35 // Boost
36 #include <boost/ptr_container/ptr_vector.hpp>
37 
38 namespace te
39 {
40  namespace xsd
41  {
42 // Forward declarations
43  class Element;
44 
45  /*!
46  \class All
47 
48  \brief This class models an XML Schema all element.
49 
50  The all element specifies that the child elements can appear in any order and that each child element can occur zero or one time.
51 
52  \note Parent elements: group, complexType, restriction (both simpleContent and complexContent), extension (both simpleContent and complexContent).
53  */
54  class TEXSDEXPORT All : public Content, public Occurs, public Identifiable, public Annotated
55  {
56  public:
57 
58  /*!
59  \brief Constructor.
60 
61  \param id It specifies a unique ID for the element. It can be a NULL value.
62  \param minOccurs The minimum number of times the element can occur.
63  \param maxOccurs The maximum number of times the element can occur.
64  */
65  All(unsigned int minOccurs = 1, unsigned int maxOccurs = 1, Annotation* ann = 0, std::string* id = 0);
66 
67  /*!
68  \brief Copy constructor.
69 
70  \param rhs Right-hand-side object.
71  */
72  All(const All& rhs);
73 
74  /*! \brief Destructor. */
75  ~All();
76 
77  /*!
78  \brief Assignment operator.
79 
80  \param rhs Right-hand-side object.
81 
82  \return A reference to this object.
83  */
84  All& operator=(const All& rhs);
85 
86  /*!
87  \brief It returns the list of elements of All.
88 
89  \return The list of elements.
90  */
91  const boost::ptr_vector<Element>& getElements() const;
92 
93  /*!
94  \brief It adds an element to this All element.
95 
96  \param e The element that will be added.
97 
98  \note The All object will take the ownership of the given pointer.
99  */
100  void addElement(Element* e);
101 
102  Content* clone() const;
103 
104  private:
105 
106  boost::ptr_vector<Element> m_elementVec; //!< Lis of elements. (Optional)
107  };
108 
109  } // end namespace xsd
110 } // end namespace te
111 
112 #endif // __TERRALIB_XSD_INTERNAL_ALL_H
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
A base class for XSD classes that may allow annotation.
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
A base class for elements that are not definitions nor declarations. This class is just for creating ...
A base class for XSD classes that must provide a unique ID property.
Definition: Identifiable.h:46
A base class for XSD classes that have occurs attributes.
A base class for XSD classes that must provide a unique ID property.
#define TEXSDEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:60
A class that models a XSD annotation element.
Definition: Annotation.h:55