All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
EnumType.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 EnumType.cpp
22 
23  \brief
24 
25  \ingroup layout
26 */
27 
28 // TerraLib
29 #include "EnumType.h"
30 #include <ios>
31 #include <iostream>
32 #include "../../../common/StringUtils.h"
33 
34 
35 te::layout::EnumType::EnumType( int id, std::string name, te::layout::AbstractEnum* parent ) :
36  m_id(id),
37  m_label(""),
38  m_parent(parent),
39  m_type(te::layout::EnumNone)
40 {
42 }
43 
45 {
46 
47 }
48 
50 {
51  return m_id;
52 }
53 
55 {
56  return m_name;
57 }
58 
59 void te::layout::EnumType::setName( std::string name )
60 {
61  m_name = te::common::Convert2UCase(name);
62 }
63 
65 {
66  return m_label;
67 }
68 
69 void te::layout::EnumType::setLabel( std::string label )
70 {
71  m_label = label;
72 }
73 
75 {
76  return m_parent;
77 }
78 
79 te::layout::EnumTypeFlags te::layout::EnumType::getType()
80 {
81  return m_type;
82 }
83 
84 void te::layout::EnumType::setType( te::layout::EnumTypeFlags type )
85 {
86  m_type = type;
87 }
te::layout::EnumTypeFlags getType()
Returns enum type.
Definition: EnumType.cpp:79
Abstract class to represent an enumeration.
Definition: AbstractEnum.h:48
std::string getName()
Returns name.
Definition: EnumType.cpp:54
std::string getLabel()
Returns label.
Definition: EnumType.cpp:64
void setLabel(std::string label)
Change label.
Definition: EnumType.cpp:69
EnumType(int id, std::string name, AbstractEnum *type)
Constructor.
Definition: EnumType.cpp:35
std::string Convert2UCase(const std::string &value)
It converts a string to upper case.
Definition: StringUtils.h:163
virtual ~EnumType()
Destructor.
Definition: EnumType.cpp:44
void setName(std::string name)
Change name.
Definition: EnumType.cpp:59
int getId()
Returns numeric value assigned.
Definition: EnumType.cpp:49
AbstractEnum * getParent()
Returns enum type.
Definition: EnumType.cpp:74
Class that represents the value of an enumeration. An enumeration is made of "1..n" objects EnumType...
EnumNone
Definition: AbstractType.h:133
std::string m_name
name
Definition: EnumType.h:124
void setType(te::layout::EnumTypeFlags type)
Sets enum type.
Definition: EnumType.cpp:84