All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List.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 List.h
22 
23  \brief It is used to define a simple type element as a list of values.
24 */
25 
26 #ifndef __TERRALIB_XSD_INTERNAL_LIST_H
27 #define __TERRALIB_XSD_INTERNAL_LIST_H
28 
29 // TerraLib
30 #include "SimpleTypeConstructor.h"
31 
32 namespace te
33 {
34  namespace xsd
35  {
36 // Forward declarations
37  class QName;
38  class SimpleType;
39 
40  /*!
41  \class List
42 
43  \brief It is used to define a simple type element as a list of values.
44  */
46  {
47  public:
48 
49  /*!
50  \brief Constructor.
51 
52  \param ann An annotation.
53  \param id It specifies a unique ID for the element.
54 
55  \note The List object will take the ownership of the annotation and id.
56  */
57  List(Annotation* ann = 0, std::string* id = 0);
58 
59  /*!
60  \brief Copy constructor.
61 
62  \param rhs Right-hand-side object.
63  */
64  List(const List& rhs);
65 
66  /*! \brief Destructor. */
67  ~List();
68 
69  /*!
70  \brief Assignment operator.
71 
72  \param rhs Right-hand-side object.
73 
74  \return A reference to this object.
75  */
76  List& operator=(const List& rhs);
77 
78  /*!
79  \brief It returns name of a built-in data type or simpleType element defined in this or another schema.
80 
81  \return The name of a built-in data type or simpleType element defined in this or another schema.
82  */
83  QName* getItemType() const;
84 
85  /*!
86  \brief It returns list internal simple type.
87 
88  \return The list internal simple type.
89  */
90  SimpleType* getSimpleType() const;
91 
92  /*!
93  \brief It sets the name of a built-in data type or simpleType element defined in this or another schema.
94 
95  \param name The name of a built-in data type or simpleType element defined in this or another schema.
96 
97  \note Setting a reference will turn to NULL the internal simpleType.
98  \note The List object will take the ownership of the given pointer.
99  */
100  void setItemType(QName* name);
101 
102  /*!
103  \brief It sets the list internal simple type.
104 
105  \param a The list internal simple type.
106 
107  \note Setting a reference will turn to NULL the itemType.
108  \note The List object will take the ownership of the given pointer.
109  */
110  void setSimpleType(SimpleType* a);
111 
112  SimpleTypeConstructor* clone() const;
113 
114  private:
115 
116  QName* m_itemType; //!< It specifies the name of a built-in data type or simpleType element defined in this or another schema. This attribute is not allowed if the content contains a simpleType element, otherwise it is required
117  SimpleType* m_internalSimpleType; //!< Used when the list has an internal simple type. (Optional if m_itemType is present)
118  };
119 
120  } // end namespace xsd
121 } // end namespace te
122 
123 #endif // __TERRALIB_XSD_INTERNAL_LIST_H
It is used to define a simple type element as a list of values.
Definition: List.h:45
A base class for SympleType elements. List, Union and Restriction4SimpleType is derived from this bas...
SimpleType * m_internalSimpleType
Used when the list has an internal simple type. (Optional if m_itemType is present) ...
Definition: List.h:117
A base class for SimpleType elements. List, Union and Restriction4SimpleType is derived from this bas...
#define TEXSDEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:60
A class to be used to represent XML qualified names.
Definition: QName.h:49
QName * m_itemType
It specifies the name of a built-in data type or simpleType element defined in this or another schema...
Definition: List.h:116
A class that models a XSD annotation element.
Definition: Annotation.h:55
It models a XML Schema SimpleType element.
Definition: SimpleType.h:54