Annotation.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 Annotation.h
22 
23  \brief A class that models a XSD annotation element.
24 */
25 
26 #ifndef __TERRALIB_XSD_INTERNAL_ANNOTATION_H
27 #define __TERRALIB_XSD_INTERNAL_ANNOTATION_H
28 
29 // TerraLib
30 #include "Identifiable.h"
31 
32 // Boost
33 #include <boost/ptr_container/ptr_vector.hpp>
34 
35 // STL
36 #include <string>
37 #include <map>
38 
39 namespace te
40 {
41  namespace xsd
42  {
43 // Forward declarations
44  class AnnotationItem;
45 
46  /*!
47  \class Annotation
48 
49  \brief A class that models a XSD annotation element.
50 
51  \sa AnnotationItem, AppInfo, Documentation, Identifiable, Annotated, Attribute
52 
53  \note Parent element: any element.
54  */
56  {
57  public:
58 
59  /*!
60  \brief Constructor.
61 
62  \param id It specifies a unique ID for the annotation.
63 
64  \note The annotation will take the ownership of the id.
65  */
66  Annotation(std::string* id = 0);
67 
68  /*!
69  \brief Copy constructor.
70 
71  \param rhs Right-hand-side object.
72  */
73  Annotation(const Annotation& rhs);
74 
75  /*! \brief Destructor. */
76  ~Annotation();
77 
78  /*!
79  \brief Assignment operator.
80 
81  \param rhs Right-hand-side object.
82 
83  \return A reference to this object.
84  */
85  Annotation& operator=(const Annotation& rhs);
86 
87  /*!
88  \brief It inserts the documentation (for human or for machine) into the annotation.
89 
90  \param item Some documentation.
91 
92  \pre Don't inform a NULL pointer
93 
94  \note The annotation will take the ownership of the given item.
95  */
96  void add(AnnotationItem* item);
97 
98  /*!
99  \brief Add a property with non-schema namespace to the attribute.
100 
101  \param key The name of the property.
102  \param value The value of the property.
103  */
104  //void addOtherAttribute(std::string key, std::string value);
105 
106  /*! \brief Returns a pointer to the vector of Annotation's items (AppInfos and/or Documentations) */
107  const boost::ptr_vector<AnnotationItem>& getItems() const;
108 
109  /*!
110  \brief It returns a map with other properties of the attribute element.
111 
112  \return Other properties of the attribute element as a key-value map.
113  */
114  //std::map<std::string, std::string>* getOtherAttributes() const;
115 
116  private:
117 
118  boost::ptr_vector<AnnotationItem> m_itemVec; //!< The list of comments for humans or for machines. (Optional)
119  //std::map<std::string, std::string>* m_otherAttributes; //!< A list of other attributes with non-schema namespace (Optional).
120  };
121 
122  } // end namespace xsd
123 } // end namespace te
124 
125 #endif // __TERRALIB_XSD_INTERNAL_ANNOTATION_H
126 
A base class for XSD classes that must provide a unique ID property.
Definition: Identifiable.h:46
URI C++ Library.
boost::ptr_vector< AnnotationItem > m_itemVec
It returns a map with other properties of the attribute element.
Definition: Annotation.h:118
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 base class for XSD annotation elements.
A class that models a XSD annotation element.
Definition: Annotation.h:55