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