ComplexContent.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 ComplexContent.h
22 
23  \brief It models an XML Schema complexContent element.
24 */
25 
26 #ifndef __TERRALIB_XSD_INTERNAL_COMPLEXCONTENT_H
27 #define __TERRALIB_XSD_INTERNAL_COMPLEXCONTENT_H
28 
29 // TerraLib
30 #include "Annotated.h"
31 #include "Identifiable.h"
32 
33 namespace te
34 {
35  namespace xsd
36  {
37 // Forward declarations
38  class TypeDerivation;
39 
40  /*!
41  \class ComplexContent
42 
43  \brief It models an XML Schema complexContent element.
44 
45  The ComplexContent element defines extensions or restrictions on a complex type that contains mixed content or elements only.
46 
47  \note Parent elements: complexType
48  */
50  {
51  public:
52 
53  /*!
54  \brief Constructor.
55 
56  \param dev It specifies the element content and can be: restriction | extension.
57  \param ann An annotation.
58  \param id It specifies a unique ID for the element.
59 
60  \note The ComplexContent object will take the ownership of the pointers.
61  */
62  ComplexContent(TypeDerivation* dev = 0, Annotation* ann = 0, std::string* id = 0);
63 
64  /*!
65  \brief Copy constructor.
66 
67  \param rhs Right-hand-side object.
68  */
69  ComplexContent(const ComplexContent& rhs);
70 
71  /*! \brief Destructor. */
72  ~ComplexContent();
73 
74  /*!
75  \brief Assignment operator.
76 
77  \param rhs Right-hand-side object.
78 
79  \return A reference to this object.
80  */
81  ComplexContent& operator=(const ComplexContent& rhs);
82 
83  /*!
84  \brief If the ComplexContent is mixed or not.
85 
86  \return True if the ComplexContent is mixed and false if not.
87  */
88  bool isMixed();
89 
90  /*!
91  \brief It returns the derivation type of this ComplexContent.
92 
93  \return The derivation type: restriction | extension.
94  */
95  TypeDerivation* getTypeDerivation() const;
96 
97  /*!
98  \brief It specifies whether character data is allowed to appear between the child elements of this complexType element.
99 
100  \param v True indicates that character data is allowed to appear between the child elements of this complexType element.
101  */
102  void setAsMixed(bool v);
103 
104  /*!
105  \brief It sets the derivation type of this ComplexContent: (restriction | extension).
106 
107  \param t The derivation type of this ComplexContent.
108 
109  \note The ComplexContent object will take the ownership of the given TypeDerivation.
110  */
111  void setTypeDerivation(TypeDerivation* t);
112 
113  private:
114 
115  bool m_mixed; //!< It specifies whether character data is allowed to appear between the child elements of this complexType element. Default is false. (Optional)
116  TypeDerivation* m_derivation; //!< It can be: restriction (Restriction4ComplexContent) | extension. (Required)
117  };
118 
119  } // end namespace xsd
120 } // end namespace te
121 
122 #endif // __TERRALIB_XSD_INTERNAL_COMPLEXCONTENT_H
It models an XML Schema complexContent element.
A base class for XSD classes that may allow annotation.
Definition: Annotated.h:49
A base class for XSD classes that may allow annotation.
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...
TypeDerivation * m_derivation
It can be: restriction (Restriction4ComplexContent) | extension. (Required)
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
bool m_mixed
It specifies whether character data is allowed to appear between the child elements of this complexTy...
A class that models a XSD annotation element.
Definition: Annotation.h:55