TeMetaModelCache.h

Go to the documentation of this file.
00001 /************************************************************************************
00002 TerraLib - a library for developing GIS applications.
00003 Copyright © 2001-2007 INPE and Tecgraf/PUC-Rio.
00004 
00005 This code is part of the TerraLib library.
00006 This library is free software; you can redistribute it and/or
00007 modify it under the terms of the GNU Lesser General Public
00008 License as published by the Free Software Foundation; either
00009 version 2.1 of the License, or (at your option) any later version.
00010 
00011 You should have received a copy of the GNU Lesser General Public
00012 License along with this library.
00013 
00014 The authors reassure the license terms regarding the warranties.
00015 They specifically disclaim any warranties, including, but not limited to,
00016 the implied warranties of merchantability and fitness for a particular purpose.
00017 The library provided hereunder is on an "as is" basis, and the authors have no
00018 obligation to provide maintenance, support, updates, enhancements, or modifications.
00019 In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
00020 indirect, special, incidental, or consequential damages arising out of the use
00021 of this library and its documentation.
00022 *************************************************************************************/
00023 /*! \file TeMetaModelCache.h
00024     \brief This file contains structures and definitions about TerraLib database meta model.
00025 */
00026 #ifndef  __TERRALIB_INTERNAL_METAMODELCACHE_H
00027 #define  __TERRALIB_INTERNAL_METAMODELCACHE_H
00028 
00029 #include "TeLayer.h"
00030 #include "TeAbstractTheme.h"
00031 #include "TeView.h"
00032 #include "TeProject.h"
00033 
00034 //! A class for storing TerraLib's metamodel objects (TeTheme, TeLayer, ...)
00035 /*!
00036         An instance of this class keeps track of 
00037         meta objects stored in a TerraLib Database.
00038         This instance can be shared by all database connections.
00039 
00040   \sa TeTheme, TeView, TeLayer, TeAttribute
00041 */
00042 class TL_DLL TeMetaModelCache
00043 {
00044         public: 
00045 
00046 
00047         //! Empty constructor
00048         TeMetaModelCache()
00049                 {}
00050 
00051         //! Destructor
00052         ~TeMetaModelCache()
00053                 { clear(); }
00054 
00055                 //! Clears metadata
00056                 void clear();
00057 
00058                 //! Returns the  map of layers in the database
00059                 TeLayerMap&     layerMap () 
00060                 { return layerMap_; }
00061 
00062                 //! Returns the  map of views in the database
00063                 TeViewMap&      viewMap () 
00064                 { return viewMap_; }
00065 
00066                 //! Returns the  map of themes in the database
00067                 TeThemeMap&     themeMap () 
00068                 { return themeMap_; }
00069 
00070                 //! Returns the  map of invalid themes in the database
00071                 TeThemeMap&     invalidThemeMap () 
00072                 { return invalidThemeMap_; }
00073 
00074                 //! Returns the  map of projects in the database
00075                 TeProjectMap&  projectMap ()
00076                 { return projectMap_; }
00077 
00078                 //! Returns the  map of legends in the database
00079                 TeLegendEntryMap& legendMap () 
00080                 { return legendMap_; }
00081 
00082                 //! Returns the set of relations between tables
00083                 multiset<int>& relationMSet () 
00084                 { return relationMSet_; }
00085 
00086                 map<int, map<string, string> >& mapThemeAlias()
00087                 {return mapThemeAlias_;}
00088 
00089     private:
00090 
00091         //! Copy constructor not allowed.
00092         TeMetaModelCache(const TeMetaModelCache& rhs);
00093 
00094                 //! Assignment operator not allowed.
00095         TeMetaModelCache& operator=(const TeMetaModelCache& rhs);
00096 
00097         private:
00098 
00099                 TeLayerMap                      layerMap_;                      //!< layer map    
00100         TeViewMap                       viewMap_;                       //!< view map     
00101         TeThemeMap                      themeMap_;                      //!< theme map  
00102                 TeThemeMap                      invalidThemeMap_;       //!< invalid theme map
00103         TeLegendEntryMap        legendMap_;                     //!< view map
00104         TeProjectMap            projectMap_;            //!< project map
00105         multiset<int>           relationMSet_;          //!< multiset of relations between tables
00106                 /*! \brief An associative container from theme identifier (int)
00107                            to legend alias (map<string, string>). The theme alias
00108                    is another container, where key is a string with a column name
00109                    used in a group that maps to a legend alias (string value).
00110                  */
00111                 map<int, map<string, string> > mapThemeAlias_;
00112 };
00113 
00114 
00115 
00116 #endif
00117 
00118 

Generated on Sun Jul 29 04:01:22 2012 for TerraLib - Development Source by  doxygen 1.5.3