Occurs.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 Lesser 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 Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser 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 Occurs.h
22 
23  \brief A base class for XSD classes that have occurs attributes.
24 */
25 
26 #ifndef __TERRALIB_XSD_INTERNAL_OCCURS_H
27 #define __TERRALIB_XSD_INTERNAL_OCCURS_H
28 
29 // TerraLib
30 #include "Config.h"
31 
32 namespace te
33 {
34  namespace xsd
35  {
36  /*!
37  \class Occurs
38 
39  \brief A base class for XSD classes that have occurs attributes.
40 
41  \sa All, Any, Choice, Group, LocalElement, Sequence
42  */
44  {
45  public:
46 
47  /*!
48  \brief It returns the minOccurs values.
49 
50  \return The minOccurs value.
51  */
52  const unsigned int getMinOccurs() const;
53 
54  /*!
55  \brief It returns the maxOccurs values.
56 
57  \return The maxOccurs value.
58  */
59  const unsigned int getMaxOccurs() const;
60 
61  /*!
62  \brief It sets the minOccurs value.
63 
64  \param minOccurs The minOccurs value. The value can be any number >= 0.
65  */
66  void setMinOccurs(unsigned int minOccurs);
67 
68  /*!
69  \brief It sets the maxOccurs value.
70 
71  \param maxOccurs The maxOccurs value. The value can be any number >= 0.
72 
73  \note If you want to set no limit on the maximum number, use the value "unbounded" defined as te::xsd::Occurs::unbounded.
74  */
75  void setMaxOccurs(unsigned int maxOccurs);
76 
77  protected:
78 
79  /*!
80  \brief Constructor.
81 
82  \param minOccurs The minimum number of times the element can occur.
83  \param maxOccurs The maximum number of times the element can occur.
84  */
85  Occurs(unsigned int minOccurs = 1, unsigned int maxOccurs = 1);
86 
87  /*!
88  \brief Copy constructor.
89 
90  \param rhs Right-hand-side object.
91  */
92  Occurs(const Occurs& rhs);
93 
94  /*! \brief Destructor. */
95  ~Occurs();
96 
97  /*!
98  \brief Assignment operator.
99 
100  \param rhs Right-hand-side object.
101 
102  \return A reference to this object.
103  */
104  Occurs& operator=(const Occurs& rhs);
105 
106  public:
107 
108  static const unsigned int unbounded; //!< Identifer for "unbounded" max values.
109 
110  protected:
111 
112  unsigned int m_minOccurs; //!< It specifies the minimum number of times the any element can occur in the parent element. The value can be any number >= 0. Default value is 1. (Optional)
113  unsigned int m_maxOccurs; //!< It specifies the maximum number of times the any element can occur in the parent element. The value can be any number >= 0, or if you want to set no limit on the maximum number, use the value "unbounded". Default value is 1. (Optional)
114  };
115 
116  } // end namespace xsd
117 } // end namespace te
118 
119 #endif // __TERRALIB_XSD_INTERNAL_OCCURS_H
Configuration flags for the XSD Module of TerraLib.
static const unsigned int unbounded
Identifer for "unbounded" max values.
Definition: Occurs.h:108
A base class for XSD classes that have occurs attributes.
Definition: Occurs.h:43
unsigned int m_maxOccurs
It specifies the maximum number of times the any element can occur in the parent element. The value can be any number >= 0, or if you want to set no limit on the maximum number, use the value "unbounded". Default value is 1. (Optional)
Definition: Occurs.h:113
URI C++ Library.
#define TEXSDEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:57
unsigned int m_minOccurs
It specifies the minimum number of times the any element can occur in the parent element. The value can be any number >= 0. Default value is 1. (Optional)
Definition: Occurs.h:112