All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Module.cpp
Go to the documentation of this file.
1 /* Copyright (C) 2001-2009 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/common/Module.cpp
22 
23  \brief This singleton defines an entry in the Platform for the TerraLib Common Runtime module.
24 */
25 
26 // TerraLib
27 #include "Enums.h"
28 #include "LibraryManager.h"
29 #include "Logger.h"
30 #include "Module.h"
31 #include "TerraLib.h"
32 #include "Translator.h"
33 #include "UnitsOfMeasureManager.h"
34 
35 // STL
36 #include <cstdlib>
37 
38 #if TE_USE_GNU_TEXT_UTILITIES
39 // GNU Text Utilities -> it is not true for now!
40 #include <locale.h>
41 #endif
42 
44 
46 {
50  };
51 
52 // initialize TerraLib singleton
54 
55 //
56  setlocale(LC_ALL, "");
57 
58 // let's start all singletons in the right order and other stuffs that must be in the static initialization!
59 
60 // initialize the translator singleton and the common runtime multilanguage support
62 
63 // initialize the singleton LibraryManager
65 
66 // initialize the singleton CharSetManager
67 // CharEncodingManager::getInstance();
68 
69 // initialize the singleton CountryManager
70 // CountryManager::getInstance();
71 
72 // initialize the singleton LanguageManager
73 // LanguageManager::getInstance();
74 
75 // initialize the singleton UnitsOfMeasureManager
77 
78 // let's start the logger if the developer wants TerraLib to make it automatically during static initialization
79 #if TE_LOGGER_DO_AUTOMATIC_INITIALIZATION && TE_LOGGER_DO_STATIC_INITIALIZATION
81 #endif
82 }
83 
85 {
86 #if TE_LOGGER_DO_AUTOMATIC_INITIALIZATION && TE_LOGGER_DO_STATIC_INITIALIZATION
88 #endif
89 
91 }
92 
94 {
95 // let's start the logger if developer want TerraLib to make it automatically during static initialization
96 #if TE_LOGGER_DO_AUTOMATIC_INITIALIZATION && !TE_LOGGER_DO_STATIC_INITIALIZATION
98 #endif
99 
100 #ifdef TE_AUTOMATIC_INITIALIZATION
102 #endif
103 
104  TE_LOG_TRACE(TR_COMMON("TerraLib Common Runtime initialized!"));
105 }
106 
108 {
109  TE_LOG_TRACE(TR_COMMON("TerraLib Common Runtime finalized!"));
110 
111 #if TE_LOGGER_DO_AUTOMATIC_INITIALIZATION && !TE_LOGGER_DO_STATIC_INITIALIZATION
113 #endif
114 }
115 
116 
This internal structure is used to model the basic information about a TerraLib module.
Definition: TerraLib.h:97
#define TE_COMMON_MODULE_NAME
Definition: Config.h:34
#define TE_COMMON_TEXT_DOMAIN_DIR
It contains the translation catalog directory.
Definition: Config.h:155
const te::at::Module & sm_module
This is a helper function that will be automatically called when the TerraLib Annotation Text module ...
Definition: Module.cpp:53
#define TE_LOGGER_MAKE_DEFAULT_FINALIZATION()
This macro can be used to make logger default finalization.
Definition: Config.h:263
#define TE_LOG_TRACE(msg)
Use this tag in order to log a message to a specified logger with the TRACE level.
Definition: Config.h:418
Module()
The singleton constructor will make some initializations.
Definition: Module.cpp:45
This singleton defines an entry in the Platform for the TerraLib Common Runtime module.
Definition: Module.h:50
void remove(const std::string &moduleName)
It removes the module entry identified by the given name.
Definition: TerraLib.cpp:101
General enumerations.
A singleton that can be used to observe the available libraries in the system.
static void finalize()
This is the cleanup function for the TerraLib Common Runtime module.
Definition: Module.cpp:107
static void initialize()
This is the startup function for the TerraLib Common Runtime module.
Definition: Module.cpp:93
#define TE_ADD_TEXT_DOMAIN(domain, domaindir, codeset)
It adds the given text domain located at domain-dir with the given codeset to the multilingual system...
Definition: Config.h:118
#define TR_COMMON(message)
It marks a string in order to get translated. This is the mark used in the Common module of TerraLib...
Definition: Config.h:173
This class is designed to manage the log of information in TerraLib.
This singleton defines an entry in the Platform for the TerraLib Common Runtime module.
void init()
It initializes the list of well kown units of measure.
A singleton class for dealing with units-of-measure.
#define TE_LOGGER_MAKE_DEFAULT_INITIALIZATION()
This macro can be used to make logger default initialization.
Definition: Config.h:252
static Module & getInstance()
It returns a reference to the singleton instance.
An utility class to control the startup and cleanup of the TerraLib Platform and its resources...
#define TE_COMMON_TEXT_DOMAIN
It contains the name of the text domain used in the translation of messages in the TerraLib Common mo...
Definition: Config.h:148
void add(const Module &m)
It registers the module in the TerraLib Platform.
Definition: TerraLib.cpp:95
This class is designed for dealing with multi-language text translation in TerraLib.