Restriction4ComplexContent.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 Restriction4ComplexContent.h
22 
23  \brief The restriction class can be used to define restrictions on a complexContent.
24 */
25 
26 #ifndef __TERRALIB_XSD_INTERNAL_RESTRICTION4COMPLEXCONTENT_H
27 #define __TERRALIB_XSD_INTERNAL_RESTRICTION4COMPLEXCONTENT_H
28 
29 // TerraLib
30 #include "Annotated.h"
31 #include "Identifiable.h"
32 #include "TypeDerivation.h"
33 
34 // Boost
35 #include <boost/ptr_container/ptr_vector.hpp>
36 
37 namespace te
38 {
39  namespace xsd
40  {
41 // Forward declarations
42  class AnyAttribute;
43  class AbstractAttribute;
44  class Content;
45  class QName;
46 
47  /*!
48  \class Restriction4ComplexContent
49 
50  \brief The restriction class can be used to define restrictions on a complexContent.
51  */
53  {
54  public:
55 
56  /*!
57  \brief Constructor.
58 
59  \param id It specifies a unique ID for the element. It can be a NULL value.
60  \param base It specifies the name of a built-in data type, simpleType element, or complexType element defined in this schema or another schema. It can not be a NULL value.
61 
62  \note The Restriction4ComplexContent object will take the ownership of the given pointers.
63  */
64  Restriction4ComplexContent(std::string* id, QName* base);
65 
66  /*!
67  \brief Copy constructor.
68 
69  \param rhs Right-hand-side object.
70 
71  \todo Implement!
72  */
74 
75  /*! \brief Destructor. */
77 
78  /*!
79  \brief Assignment operator.
80 
81  \param rhs Right-hand-side object.
82 
83  \return A reference to this object.
84 
85  \todo Implement!
86  */
88 
89  /*!
90  \brief It returns the name of a built-in data type, simple type or complex type that will be restricted.
91 
92  \return The name of a built-in data type, simple type or complex type that will be restricted.
93  */
94  QName* getBase() const;
95 
96  /*!
97  \brief It returns the content of this restriction.
98 
99  \return The content of this restriction.
100  */
101  Content* getContent() const;
102 
103  /*!
104  \brief It returns the anyAttribute defined on this restriction.
105 
106  \return The anyAttribute.
107  */
108  AnyAttribute* getAnyAttribute() const;
109 
110  /*!
111  \brief It sets the name of a built-in data type, simple type or complex type that will be restricted.
112 
113  \param base The name of a built-in data type, simple type or complex type that will be restricted.
114 
115  \note The Restriction4ComplexContent object will take the ownership of the given pointer.
116  */
117  void setBase(QName* base);
118 
119  /*!
120  \brief It sets the group content. It can be one of: group |all | choice | sequence.
121 
122  \param c The appropriate content to this restriction.
123 
124  \note The Restriction4ComplexContent object will take the ownership of the given pointer.
125  */
126  void setContent(Content* c);
127 
128  /*!
129  \brief It adds an attribute to this restriction.
130 
131  \param a The attribute that will be added.
132 
133  \note The Restriction4ComplexContent object will take the ownership of the given pointer.
134  */
135  void addAttribute(AbstractAttribute* a);
136 
137  /*!
138  \brief It sets the anyAttribute to this restriction.
139 
140  \param a It specifies the anyAttribute.
141 
142  \note The Restriction4ComplexContent object will take the ownership of the given pointer.
143  */
144  void setAnyAttribute(AnyAttribute* a);
145 
146  // TODO
147  TypeDerivation* clone() const { return 0; }
148 
149  private:
150 
151  QName* m_base; //!< It specifies the name of a built-in data type, simpleType element, or complexType element defined in this schema or another schema. (Required)
152  Content* m_content; //!< It can be: group |all | choice | sequence. (Optional)
153  boost::ptr_vector<AbstractAttribute> m_attributeVec; //!< The list of attributes (attributes and attributeGroups). (Optional)
154  AnyAttribute* m_anyAttr; //!< The anyAttribute element. (Optional)
155  };
156 
157  } // end namespace xsd
158 } // end namespace te
159 
160 #endif // __TERRALIB_XSD_INTERNAL_RESTRICTION4COMPLEXCONTENT_H
Content * m_content
It can be: group |all | choice | sequence. (Optional)
A base class for XSD classes that may allow annotation.
Definition: Annotated.h:49
The restriction class can be used to define restrictions on a complexContent.
A base class for XSD classes that may allow annotation.
QName * m_base
It specifies the name of a built-in data type, simpleType element, or complexType element defined in ...
A base class for elements that are not definitions nor declarations. This class is just for creating ...
Definition: Content.h:43
SimpleType, SimpleContent and ComplexContent can be used to extend other types. This is just a base c...
It models an XML anyAttribute element.
Definition: AnyAttribute.h:49
This is the base class for XML Schema Attribute classes.
A base class for XSD classes that must provide a unique ID property.
Definition: Identifiable.h:46
URI C++ Library.
SimpleType, SimpleContent and ComplexContent can be extend other types. This is just a base class for...
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 to be used to represent XML qualified names.
Definition: QName.h:49
AnyAttribute * m_anyAttr
The anyAttribute element. (Optional)
boost::ptr_vector< AbstractAttribute > m_attributeVec
The list of attributes (attributes and attributeGroups). (Optional)