SymbolLibrary.h
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/qt/widgets/se/SymbolLibrary.h
22 
23  \brief This class represents a library of symbols.
24 */
25 
26 #ifndef __TERRALIB_QT_WIDGETS_SE_INTERNAL_SYMBOLLIBRARY_H
27 #define __TERRALIB_QT_WIDGETS_SE_INTERNAL_SYMBOLLIBRARY_H
28 
29 // TerraLib
30 #include "../Config.h"
31 
32 // STL
33 #include <map>
34 #include <string>
35 
36 namespace te
37 {
38  namespace qt
39  {
40  namespace widgets
41  {
42 // Forward declarations
43  class Symbol;
44 
45  /*!
46  \class SymbolLibrary
47 
48  \brief This class represents a library of symbols.
49 
50  \sa Symbol, SymbolLibaryManager
51  */
53  {
54  public:
55 
56  /*! \brief Constructor. */
57  SymbolLibrary(const std::string& name);
58 
59  /*! \brief Destructor. */
60  ~SymbolLibrary();
61 
62  /*!
63  \brief It inserts a new symbol to this library.
64 
65  \param symbol The new symbol that will be added to this library.
66  */
67  void insert(Symbol* symbol);
68 
69  /*!
70  \brief It removes the symbol from this library.
71 
72  \param symbol The symbol to be removed.
73 
74  \exception Exception If the symbol doesn't exist it will raise an exception.
75  */
76  void remove(Symbol* symbol);
77 
78  /*!
79  \brief It returns the symbol identified by a given id or NULL if none is found.
80 
81  \param name The id of the symbol we are looking for.
82 
83  \return A pointer to a symbol or NULL if none is found.
84  */
85  Symbol* findById(const std::string& id) const;
86 
87  /*!
88  \brief It returns a pair of iterators over the symbols of this library.
89 
90  \return A pair of iterators over the symbols of this library where pair.first will be
91  the beginning and pair.second will be the end iterator.
92  */
93  std::pair<std::map<std::string, Symbol*>::const_iterator,
94  std::map<std::string, Symbol*>::const_iterator> getIterator() const;
95 
96  const std::string& getName() const;
97 
98  /*! \brief It removes all symbols from this library. */
99  void clear();
100 
101  private:
102 
103  std::string m_name; //!< The name of the symbol library.
104  std::map<std::string, Symbol*> m_symbolMap; //!< The set of symbols.
105  };
106 
107  } // end namespace widgets
108  } // end namespace qt
109 } // end namespace te
110 
111 #endif // __TERRALIB_QT_WIDGETS_SE_INTERNAL_SYMBOLLIBRARY_H
std::map< std::string, Symbol * > m_symbolMap
The set of symbols.
mydialect insert("+", new te::da::BinaryOpEncoder("+"))
URI C++ Library.
This class represents a library of symbols.
Definition: SymbolLibrary.h:52
This class represents a symbol. TODO: More description!
Definition: Symbol.h:54
std::string m_name
The name of the symbol library.
#define TEQTWIDGETSEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:63