Identifiable.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 Identifiable.h
22 
23  \brief A base class for XSD classes that must provide a unique ID property.
24 */
25 
26 #ifndef __TERRALIB_XSD_INTERNAL_IDENTIFIABLE_H
27 #define __TERRALIB_XSD_INTERNAL_IDENTIFIABLE_H
28 
29 // TerraLib
30 #include "Config.h"
31 
32 // STL
33 #include <string>
34 
35 namespace te
36 {
37  namespace xsd
38  {
39  /*!
40  \class Identifiable
41 
42  \brief A base class for XSD classes that must provide a unique ID property.
43 
44  \sa Annotation, Attribute, Schema
45  */
47  {
48  public:
49 
50  /*!
51  \brief it sets the id.
52 
53  \param id The id to be associated to the object. It will take the ownership of the given string.
54  */
55  void setId(std::string* id);
56 
57  /*! \brief It returns a pointer (may be NULL) to the object id. */
58  std::string* getId() const;
59 
60  protected:
61 
62  /*!
63  \brief Constructor.
64 
65  \param id The unique ID for the XSD element.
66 
67  \note The Identifiable object will take the ownership of the informed pointer.
68  */
69  Identifiable(std::string* id = 0);
70 
71  /*!
72  \brief Copy constructor.
73 
74  \param rhs Right-hand-side object.
75  */
76  Identifiable(const Identifiable& rhs);
77 
78  /*! \brief Protected non-virtual destructor. */
79  ~Identifiable();
80 
81  /*!
82  \brief Assignment operator.
83 
84  \param rhs Right-hand-side object.
85 
86  \return A reference to this object.
87  */
88  Identifiable& operator=(const Identifiable& rhs);
89 
90  private:
91 
92  std::string* m_id; //!< It specifies a unique identifier for the element. (Optional)
93  };
94 
95  } // end namespace xsd
96 } // end namespace te
97 
98 #endif // __TERRALIB_XSD_INTERNAL_IDENTIFIABLE_H
Configuration flags for the XSD Module of TerraLib.
std::string * m_id
It specifies a unique identifier for the element. (Optional)
Definition: Identifiable.h:92
A base class for XSD classes that must provide a unique ID property.
Definition: Identifiable.h:46
URI C++ Library.
#define TEXSDEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:57