KeyRef.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 KeyRef.h
22 
23  \brief This class models a keyref element from a XML Schema element.
24 */
25 
26 #ifndef __TERRALIB_XSD_INTERNAL_KEYREF_H
27 #define __TERRALIB_XSD_INTERNAL_KEYREF_H
28 
29 // TerraLib
30 #include "IdentityConstraint.h"
31 
32 namespace te
33 {
34  namespace xsd
35  {
36 // Forward declarations
37  class QName;
38 
39  /*!
40  \class KeyRef
41 
42  \brief This class models a keyref element from a XML Schema element.
43 
44  \note Parent elements: element.
45  */
47  {
48  public:
49 
50  /*!
51  \brief Constructor.
52 
53  \param id It specifies a unique ID for the element. It may be a NULL value.
54  \param name It specifies the name of the keyref element. It is required a non-NULL value.
55  \param ref It specifies the name of a key or unique element defined in this or another schema. It is required a non-NULL value.
56 
57  \note The KeyRef object will take the ownership of the given pointers.
58  */
59  KeyRef(QName* refer, std::string* name, Annotation* ann = 0, std::string* id = 0);
60 
61  /*!
62  \brief Copy constructor.
63 
64  \param rhs Right-hand-side object.
65 
66  \todo Implement!
67  */
68  KeyRef(const KeyRef& rhs);
69 
70  /*! \brief Destructor. */
71  ~KeyRef();
72 
73  /*!
74  \brief Assignment operator.
75 
76  \param rhs Right-hand-side object.
77 
78  \return A reference to this object.
79 
80  \todo Implement!
81  */
82  KeyRef& operator=(const KeyRef& rhs);
83 
84  /*!
85  \brief It returns the reference to a named element.
86 
87  \return The reference to a named element.
88  */
89  QName* getRef() const;
90 
91  /*!
92  \brief It sets a reference to a named attribute.
93 
94  \param ref A reference to a named attribute. Required a non-NULL value.
95 
96  \note The KeyRef object will take the ownership of the given pointer.
97  */
98  void setRef(QName* ref);
99 
100  IdentityConstraint* clone() const;
101 
102  private:
103 
104  QName* m_ref; //!< It specifies the name of a key or unique element defined in this or another schema. (Required)
105  };
106 
107  } // end namespace xsd
108 } // end namespace te
109 
110 #endif // __TERRALIB_XSD_INTERNAL_KEYREF_H
URI C++ Library.
This is the base class for XML Schema elements that are related to identity constraint.
QName * m_ref
It specifies the name of a key or unique element defined in this or another schema. (Required)
Definition: KeyRef.h:104
#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
This class models a keyref element from a XML Schema element.
Definition: KeyRef.h:46
A class that models a XSD annotation element.
Definition: Annotation.h:55
This is the base class for XML Schema elements that are related to identity constraint.