Field.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 Field.h
22 
23  \brief It models the field element of an XML Schema.
24 */
25 
26 #ifndef __TERRALIB_XSD_INTERNAL_FIELD_H
27 #define __TERRALIB_XSD_INTERNAL_FIELD_H
28 
29 // TerraLib
30 #include "Annotated.h"
31 #include "Identifiable.h"
32 
33 // STL
34 #include <string>
35 
36 namespace te
37 {
38  namespace xsd
39  {
40  /*!
41  \class Field
42 
43  \brief It models the field element of an XML Schema.
44 
45  \note Parent elements: key, keyref, unique.
46  */
47  class TEXSDEXPORT Field : public Identifiable, public Annotated
48  {
49  public:
50 
51  /*!
52  \brief Constructor.
53 
54  \param id It specifies a unique ID for the element. It may be a NULL value.
55  \param xpath It identifies a single element or attribute whose content or value is used for the constraint. It is required a non-NULL value.
56 
57  \note The Field object will take the ownership of the given pointers.
58  */
59  Field(std::string* xpath, 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  Field(const Field& rhs);
69 
70  /*! \brief Destructor. */
71  ~Field();
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  Field& operator=(const Field& rhs);
83 
84  /*!
85  \brief It returns the xpath expression of the Field element.
86 
87  \return The xpath expression.
88  */
89  std::string* getXPath() const;
90 
91  /*!
92  \brief It sets the xpath expression of the Field element.
93 
94  \param xpath It specifies the xpath expression of the Field element.
95 
96  \note The Field object will take the ownership of the given pointer.
97  */
98  void setXPath(std::string* xpath);
99 
100  private:
101 
102  std::string* m_xpath; //!< It identifies a single element or attribute whose content or value is used for the constraint. (Required)
103  };
104 
105  } // end namespace xsd
106 } // end namespace te
107 
108 #endif // __TERRALIB_XSD_INTERNAL_FIELD_H
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.
It models the field element of an XML Schema.
Definition: Field.h:47
std::string * m_xpath
It identifies a single element or attribute whose content or value is used for the constraint...
Definition: Field.h:102
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