MetadataAnnotation.cpp
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 terralib/metadata/MetadataAnnotation.cpp
22  */
23 
24 // TerraLib
25 #include "MetadataAnnotation.h"
26 
27 // STL
28 #include <cassert>
29 
30 // Boost
31 #include <boost/lexical_cast.hpp>
32 #include <boost/uuid/uuid.hpp>
33 #include <boost/uuid/uuid_generators.hpp>
34 #include <boost/uuid/uuid_io.hpp>
35 
37  m_annotId(aid),
38  m_annotURI(""),
39  m_elementId(""),
40  m_elementName("")
41 {
42  if (m_annotId.empty())
43  {
44  boost::uuids::uuid tag = boost::uuids::random_generator()();
45  m_annotId = boost::lexical_cast<std::string>(tag);
46  }
47 }
48 
50 
51 const std::string&
53 {
54  return m_annotId;
55 }
56 
57 void
59 {
60  assert(!uri.empty());
61 
62  m_annotURI = uri;
63 }
64 
65 const std::string&
67 {
68  return m_annotURI;
69 }
70 
71 void
73 {
74  assert(!eid.empty());
75 
76  m_elementId = eid;
77 }
78 
79 const std::string&
81 {
82  return m_elementId;
83 }
84 
85 void
87 {
88  assert(!ename.empty());
89 
90  m_elementName = ename;
91 }
92 
93 const std::string&
95 {
96  return m_elementName;
97 }
98 
void setAnnotationURI(const std::string &uri)
Sets the link to the metadata.
const std::string & getAnnotationURI() const
Gets the link to the metadata.
const std::string & getElementId() const
Gets the element being annotated identifier.
const std::string & getAnnotationtId() const
Gets the annotation identifier.
~MetadataAnnotation()
Destructor.
void setElementName(const std::string &ename)
Set the element being annotated name.
MetadataAnnotation(const std::string &aid=std::string(""))
Constructor.
void setElementId(const std::string &eid)
Sets the TerrsLib element idenfification.
const std::string & getElementName() const
Gets the element being annotated name.