All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 
52 const std::string&
54 {
55  return m_annotId;
56 }
57 
58 void
60 {
61  assert(!uri.empty());
62 
63  m_annotURI = uri;
64 }
65 
66 const std::string&
68 {
69  return m_annotURI;
70 }
71 
72 void
74 {
75  assert(!eid.empty());
76 
77  m_elementId = eid;
78 }
79 
80 const std::string&
82 {
83  return m_elementId;
84 }
85 
86 void
88 {
89  assert(!ename.empty());
90 
91  m_elementName = ename;
92 }
93 
94 const std::string&
96 {
97  return m_elementName;
98 }
99 
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.
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.