Redefine.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 Redefine.h
22 
23  \brief It models a XML Schema redefine.
24 */
25 
26 #ifndef __TERRALIB_XSD_INTERNAL_REDEFINE_H
27 #define __TERRALIB_XSD_INTERNAL_REDEFINE_H
28 
29 // TerraLib
30 #include "Identifiable.h"
31 
32 // Boost
33 #include <boost/ptr_container/ptr_vector.hpp>
34 
35 namespace te
36 {
37  namespace xsd
38  {
39 // Forward declarations
40  class Annotation;
41  class AttributeGroup;
42  class Group;
43  class Type;
44 
45  /*!
46  \class Redefine
47 
48  \brief It models a XML Schema redefine.
49 
50  \note Parent elements: schema.
51  */
53  {
54  public:
55 
56  /*!
57  \brief Constructor.
58 
59  \param schemaLocation It specifies the URI to the location of a schema document.
60  \param id It specifies a unique ID for the element. It can be a NULL value.
61  */
62  Redefine(const std::string& schemaLocation, std::string* id = 0);
63 
64  /*!
65  \brief Copy constructor.
66 
67  \param rhs Right-hand-side object.
68 
69  \todo Implement!
70  */
71  Redefine(const Redefine& rhs);
72 
73  /*! \brief Destructor. */
74  ~Redefine();
75 
76  /*!
77  \brief Assignment operator.
78 
79  \param rhs Right-hand-side object.
80 
81  \return A reference to this object.
82 
83  \todo Implement!
84  */
85  Redefine& operator=(const Redefine& rhs);
86 
87  /*!
88  \brief It returns the location of the redefined schema.
89 
90  \return The schema location.
91  */
92  const std::string& getSchemaLocation() const;
93 
94  /*!
95  \brief It returns the list of annotations at redefine element.
96 
97  \return The list of annotations at redefine element.
98  */
99  const boost::ptr_vector<Annotation>& getAnnotations() const;
100 
101  /*!
102  \brief It returns the list of simple and complex types at redefine element.
103 
104  \return The list of simple and complex types at redefine element.
105  */
106  const boost::ptr_vector<Type>& getTypes() const;
107 
108  /*!
109  \brief It returns the list of group declarations at redefine element.
110 
111  \return The list of group declarations at redefine element.
112  */
113  const boost::ptr_vector<Group>& getGroups() const;
114 
115  /*!
116  \brief It returns the list of attribute group declarations at redefine element.
117 
118  \return The list of attribute group declarations at redefine element.
119  */
120  const boost::ptr_vector<AttributeGroup>& getAttributeGroups() const;
121 
122  /*!
123  \brief It sets the location of the redefined schema.
124 
125  \param schemaLocation The schema location.
126  */
127  void setSchemaLocation(const std::string& schemaLocation);
128 
129  /*!
130  \brief It inserts an annotation into the redefine.
131 
132  \param ann Some annotation.
133 
134  \note The redefine will take the ownership of the given pointer.
135  */
136  void addAnnotation(Annotation* ann);
137 
138  /*!
139  \brief It inserts a type into the redefine.
140 
141  \param t Some type.
142 
143  \note The redefine will take the ownership of the given pointer.
144  */
145  void addType(Type* t);
146 
147  /*!
148  \brief It inserts a group into the redefine.
149 
150  \param g Some group.
151 
152  \note The redefine will take the ownership of the given pointer.
153  */
154  void addGroup(Group* g);
155 
156  /*!
157  \brief It inserts an attribute group into the redefine.
158 
159  \param ag Some attribute group.
160 
161  \note The redefine will take the ownership of the given pointer.
162  */
163  void addAttributeGroup(AttributeGroup* ag);
164 
165  private:
166 
167  std::string m_schemaLocation; //!< It specifies a URI to the location of a schema document. (Required)
168  boost::ptr_vector<Annotation> m_annotationVec; //!< The list of annotations at redefine element. (Optional)
169  boost::ptr_vector<Type> m_typeVec; //!< The list of simple and complex types at redefine element. (Optional)
170  boost::ptr_vector<Group> m_groupVec; //!< The list of group declarations at redefine element. (Optional)
171  boost::ptr_vector<AttributeGroup> m_attributeGroupVec; //!< The list of attribute group declarations at redefine element. (Optional)
172  };
173 
174  } // end namespace xsd
175 } // end namespace te
176 
177 #endif // __TERRALIB_XSD_INTERNAL_REDEFINE_H
178 
boost::ptr_vector< Type > m_typeVec
The list of simple and complex types at redefine element. (Optional)
Definition: Redefine.h:169
boost::ptr_vector< AttributeGroup > m_attributeGroupVec
The list of attribute group declarations at redefine element. (Optional)
Definition: Redefine.h:171
std::string m_schemaLocation
It specifies a URI to the location of a schema document. (Required)
Definition: Redefine.h:167
boost::ptr_vector< Annotation > m_annotationVec
The list of annotations at redefine element. (Optional)
Definition: Redefine.h:168
It models a XML Schema redefine.
Definition: Redefine.h:52
boost::ptr_vector< Group > m_groupVec
The list of group declarations at redefine element. (Optional)
Definition: Redefine.h:170
A base class for XSD classes that must provide a unique ID property.
Definition: Identifiable.h:46
URI C++ Library.
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:57
A class that models a XSD annotation element.
Definition: Annotation.h:55
This class models a group element in a XML Schema.
Definition: Group.h:52
An abstract class for modeling the definition of a new XML Schema Type.
Definition: Type.h:65