All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
AppInfo.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 AppInfo.cpp
22 
23  \brief This class models an object that specifies information to be used by applications.
24 */
25 
26 // TerraLib
27 #include "AppInfo.h"
28 
29 te::xsd::AppInfo::AppInfo(std::string* source, std::string* value)
30  : m_source(source),
31  m_value(value)
32 {
33 }
34 
36  : m_source(0),
37  m_value(0)
38 {
39  m_source = rhs.m_source ? new std::string(*rhs.m_source) : 0;
40  m_value = rhs.m_value ? new std::string(*rhs.m_value) : 0;
41 }
42 
44 {
45  delete m_source;
46  delete m_value;
47 }
48 
50 {
51  if(this != &rhs)
52  {
53  delete m_source;
54 
55  m_source = rhs.m_source ? new std::string(*rhs.m_source) : 0;
56 
57  delete m_value;
58 
59  m_value = rhs.m_value ? new std::string(*rhs.m_value) : 0;
60  }
61 
62  return *this;
63 }
64 
65 void te::xsd::AppInfo::setValue(std::string* value)
66 {
67  delete m_value;
68  m_value = value;
69 }
70 
71 void te::xsd::AppInfo::setSource(std::string* source)
72 {
73  delete m_source;
74  m_source = source;
75 }
76 
77 std::string* te::xsd::AppInfo::getValue() const
78 {
79  return m_value;
80 }
81 
82 std::string* te::xsd::AppInfo::getSource() const
83 {
84  return m_source;
85 }
86 
88 {
89  return new AppInfo(*this);
90 }
91 
92 
std::string * m_source
An URI that specifies the source of the application information. (Optional)
Definition: AppInfo.h:115
std::string * getValue() const
It returns the information associated to the annotation.
Definition: AppInfo.cpp:77
This class models an object that specifies information to be used by applications.
Definition: AppInfo.h:48
~AppInfo()
Destructor.
Definition: AppInfo.cpp:43
AnnotationItem * clone() const
It creates a clone of the annotation item.
Definition: AppInfo.cpp:87
This class models an object that specifies information to be used by applications.
AppInfo(std::string *source, std::string *value)
Constructor.
Definition: AppInfo.cpp:29
void setValue(std::string *value)
It sets the information to be used by the application.
Definition: AppInfo.cpp:65
AppInfo & operator=(const AppInfo &rhs)
Assignment operator.
Definition: AppInfo.cpp:49
std::string * getSource() const
It returns the URI that specifies the source of the information.
Definition: AppInfo.cpp:82
void setSource(std::string *source)
It sets the URI that specifies the source of the information.
Definition: AppInfo.cpp:71
std::string * m_value
An information to be used by the application. (Required)
Definition: AppInfo.h:116
A base class for XSD annotation elements.