All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Occurs.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 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.cpp
22 
23  \brief A base class for XSD classes that have occurs attributes.
24 */
25 
26 // TerraLib
27 #include "Occurs.h"
28 
29 // STL
30 #include <cassert>
31 #include <limits>
32 
33 const unsigned int te::xsd::Occurs::unbounded = std::numeric_limits<unsigned int>::max();
34 
35 const unsigned int te::xsd::Occurs::getMinOccurs() const
36 {
37  return m_minOccurs;
38 }
39 
40 const unsigned int te::xsd::Occurs::getMaxOccurs() const
41 {
42  return m_maxOccurs;
43 }
44 
45 void te::xsd::Occurs::setMinOccurs(unsigned int minOccurs)
46 {
47  m_minOccurs = minOccurs;
48 }
49 
50 void te::xsd::Occurs::setMaxOccurs(unsigned int maxOccurs)
51 {
52  m_maxOccurs = maxOccurs;
53 }
54 
55 te::xsd::Occurs::Occurs(unsigned int minOccurs, unsigned int maxOccurs)
56  : m_minOccurs(minOccurs),
57  m_maxOccurs(maxOccurs)
58 {
59 }
60 
62  : m_minOccurs(rhs.m_minOccurs),
63  m_maxOccurs(rhs.m_maxOccurs)
64 {
65 }
66 
68 {
69 }
70 
72 {
73  if(this != &rhs)
74  {
75  m_minOccurs = rhs.m_minOccurs;
76  m_maxOccurs = rhs.m_maxOccurs;
77  }
78 
79  return *this;
80 }
const unsigned int getMaxOccurs() const
It returns the maxOccurs values.
Definition: Occurs.cpp:40
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
void setMinOccurs(unsigned int minOccurs)
It sets the minOccurs value.
Definition: Occurs.cpp:45
void setMaxOccurs(unsigned int maxOccurs)
It sets the maxOccurs value.
Definition: Occurs.cpp:50
const unsigned int getMinOccurs() const
It returns the minOccurs values.
Definition: Occurs.cpp:35
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
A base class for XSD classes that have occurs attributes.
Occurs(unsigned int minOccurs=1, unsigned int maxOccurs=1)
Constructor.
Definition: Occurs.cpp:55
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
Occurs & operator=(const Occurs &rhs)
Assignment operator.
Definition: Occurs.cpp:71
~Occurs()
Destructor.
Definition: Occurs.cpp:67