All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Annotation.cpp
Go to the documentation of this file.
1 /* Copyright (C) 2010-2012 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.cpp
22 
23  \brief A class that models a XSD annotation element.
24 */
25 
26 // TerraLib
27 #include "Annotation.h"
28 #include "AnnotationItem.h"
29 #include "Identifiable.h"
30 
31 // STL
32 #include <cassert>
33 
35  : Identifiable(id)/*,
36  m_otherAttributes(0)*/
37 {
38 }
39 
41  : Identifiable(rhs)
42 {
43  for(std::size_t i = 0; i < rhs.m_itemVec.size(); ++i)
44  m_itemVec.push_back(rhs.m_itemVec[i].clone());
45 }
46 
48 {
49 }
50 
52 {
53  if(this != &rhs)
54  {
56 
57  for(std::size_t i = 0; i < rhs.m_itemVec.size(); ++i)
58  m_itemVec.push_back(rhs.m_itemVec[i].clone());
59  }
60 
61  return *this;
62 }
63 
65 {
66  assert(item);
67 
68  m_itemVec.push_back(item);
69 }
70 
71 const boost::ptr_vector<te::xsd::AnnotationItem>& te::xsd::Annotation::getItems() const
72 {
73  return m_itemVec;
74 }
75 
76 //std::map<std::string, std::string>* te::xsd::Annotation::getOtherAttributes() const
77 //{
78 // return m_otherAttributes;
79 //}
80 
81 //void te::xsd::Annotation::addOtherAttribute(std::string key, std::string value)
82 //{
83 // if(m_otherAttributes == 0)
84 // m_otherAttributes = new std::map<std::string, std::string>;
85 //
86 // m_otherAttributes->insert(std::pair<std::string, std::string>(key, value));
87 //}
A base class for XSD annotation elements.
A base class for XSD annotation elements.
void add(AnnotationItem *item)
It inserts the documentation (for human or for machine) into the annotation.
Definition: Annotation.cpp:64
A base class for XSD classes that must provide a unique ID property.
Definition: Identifiable.h:46
const boost::ptr_vector< AnnotationItem > & getItems() const
Add a property with non-schema namespace to the attribute.
Definition: Annotation.cpp:71
Annotation & operator=(const Annotation &rhs)
Assignment operator.
Definition: Annotation.cpp:51
~Annotation()
Destructor.
Definition: Annotation.cpp:47
A class that models a XSD annotation element.
Definition: Annotation.h:55
A base class for XSD classes that must provide a unique ID property.
Identifiable & operator=(const Identifiable &rhs)
Assignment operator.
Annotation(std::string *id=0)
Constructor.
Definition: Annotation.cpp:34
boost::ptr_vector< AnnotationItem > m_itemVec
It returns a map with other properties of the attribute element.
Definition: Annotation.h:118