TerraLib and TerraView Wiki Page

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
wiki:documentation:devguide:core:library [2016/10/03 15:20]
carolina.santos
wiki:documentation:devguide:core:library [2016/10/04 13:59] (current)
carolina.santos [Additional References]
Line 1: Line 1:
 ====== TerraLib.Core:​ Library ====== ====== TerraLib.Core:​ Library ======
  
-A classe ​**te::​core::​Library** ​fornece suporte à manipulação de bibliotecas compartilhadas ​(DLLs, SO, DyLibs).+The class **the::​core::​Library** ​supports the handling of shared libraries ​(DLLs, SO, DyLibs).
  
-Esta classe pode ser utilizada para carregar qualquer biblioteca compartilhada e para acessar qualquer endereço dentro dela.+This class can be used to charge any shared library and to access any address in it.
  
-Tanto nos ambiente ​Unix (Linux ​Mac OS X) ou Windows, ​se uma biblioteca compartilhada possuir dependências e for carregadaessas outras bibliotecas deverão encontrar-se em um caminho ​(path) ​que o sistema operacional reconheça como válido para que elas sejam implicitamente carregadasPara isso algumas variáveis de ambiente podem ser ajustadas para dizer a lista de pastas que contém bibliotecas compartilhadas em cada sistema operacional:+Both Unix (Linux ​and Mac OS X) and Windows, ​if a shared library has dependencies and it is loadedthese other libraries will find themselves on a path (path) ​that the operating system recognizes as valid, so they are implicitly loadedFor that, some environment variables can be adjusted to say the list of folders that contain shared libraries on each operating system:
  
-  * No __Mac OS X__, as variáveis de ambiente ​**PATH**, **DYLD_LIBRARY_PATH**,​ **DYLD_FALLBACK_LIBRARY_PATH** ​**DYLD_FRAMEWORK_FALLBACK_PATH** ​podem ser ajustadas para conter a lista de pastas que contém bibliotecas compartilhadas+  * In __Mac OS X__, the environment variables ​**PATH**, **DYLD_LIBRARY_PATH**,​ **DYLD_FALLBACK_LIBRARY_PATH** ​and **DYLD_FRAMEWORK_FALLBACK_PATH** ​can be adjusted to contain the list of folders that contain shared libraries
-  * No __Linux__, ​as variáveis de ambiente ​**PATH** ​**LD_LIBRARY_PATH** ​podem ser ajustadas para conter a lista de pastas que contém bibliotecas compartilhadas+  * In __Linux__, ​the environment variables ​**PATH** ​and **LD_LIBRARY_PATH** ​can be adjusted to contain the list of folders that contain shared libraries
-  * No __Windows__, ​a variável de ambiente ​**PATH** ​pode ser ajustada para conter a lista de pastas que contém bibliotecas compartilhadas.+  * In __Windows__, ​the environment variable ​**PATH** ​can be adjusted to contain the list of folders that contain shared libraries.
  
-Em geralnenhum sistema operacional suporta a carga dinâmica de bibliotecas de forma simultânea por múltiplas ​threads. ​Desta forma, a classe Library realiza uma serialização à chamada do método ​load+In generalno operating system supports dynamic loading of libraries simultaneously by multiple ​threads. ​Thusthe Library class performs ​serialization of the call load method.
- +
-Outra classe utilitária deste pacote é a classe LibraryManager,​ um singleton que pode ser utilizado pelas aplicações para observar as bibliotecas compartilhadas gerenciadas pela aplicação. Este singleton não controla o tempo de vida das bibliotecas compartilhadas,​ apenas faz uma referência a elas. Essas referências serão automaticamente removidas quando o objeto da classe Library representando a biblioteca compartilhada for destruído (sair de escopo).+
  
 +Another utility class of this package is the LibraryManager class, a singleton that can be used by applications to observe the shared libraries managed by the application. This singleton does not control the lifetime of shared libraries, only makes a reference to them. These references will be automatically removed when the object of the Library class representing the shared library is destroyed (out of scope).
 ===== API ===== ===== API =====
  
 ==== C++ ==== ==== C++ ====
  
-API para gerenciamento de bibliotecas na TerraLib ​é definida pela classe ​**Library**, ​mostrada abaixo:+The API for managing libraries in TerraLib ​is defined by the **Library** ​classshown below:
  
 <code cpp> <code cpp>
Line 33: Line 32:
       \warning Shared libraries should not be loaded concurrently by multiple threads.       \warning Shared libraries should not be loaded concurrently by multiple threads.
      */      */
-    class TECOREEXPORT ​Library : public boost::​noncopyable+    class Library : public boost::​noncopyable
     {     {
       public:       public:
Line 128: Line 127:
          */          */
         static std::string getSearchPath();​         static std::string getSearchPath();​
- +        ​
-      private: +
- +
-        struct Impl; +
- +
-        Impl* m_pimpl;+
     };     };
  
Line 140: Line 134:
 </​code>​ </​code>​
  
-A classe ​**LibraryManager**, ​mostrada abaixoé um singleton ​que pode ser utilizado para registrar todas as bibliotecas compartilhadas carregadas por um sistema ​(aplicação). Atente-se ao fato de que este singleton ​não irá tomar a propriedade da biblioteca muito menos irá compartilhá-laele apenas irá observar as bibliotecas carregadasPor issovocê deverá controlar o tempo de vida das bibliotecas compatilhadas.+The **LibraryManager** ​classshown belowis a singleton ​that can be used to record all shared libraries loaded by a system ​(application). Pay attention to the fact that this singleton ​will not take the library property much less will share itit will only observe the loaded librariesThereforeyou should control the lifetime of shared libraries.
  
 <code cpp> <code cpp>
Line 180: Line 174:
       like an observer of known libraries.       like an observer of known libraries.
      */      */
-    class TECOREEXPORT ​LibraryManager+    class LibraryManager
     {     {
       public:       public:
Line 241: Line 235:
         static LibraryManager&​ instance();         static LibraryManager&​ instance();
  
-      protected: 
- 
-        /*! \brief Singleton constructor must be private or protected. */ 
-        LibraryManager();​ 
- 
-        /*! \brief Singleton destructor must be private or protected. */ 
-        ~LibraryManager();​ 
- 
-// no copy allowed 
-        LibraryManager(const LibraryManager&​);​ 
-        LibraryManager&​ operator=(const LibraryManager&​);​ 
- 
-      private: 
- 
-        struct Impl; 
- 
-        Impl* m_pimpl; 
     };     };
  
Line 264: Line 241:
 </​code>​ </​code>​
  
-===== Exemplos ​=====+===== Examples ​=====
  
-Este exemplo constrói uma biblioteca dinâmica que contém ​implementação de uma função para cálculo do fatorial de um número inteiro e um programa executável que realiza ​carga dinâmica da biblioteca gerada.+This example constructs ​dynamic library that contains the implementation of function for calculating the factor of an integer and an executable program that performs the dynamic load library generated.
  
-A biblioteca gerada possui o seguinte nome: //​terralib_example_core_lib_function//​.+The generated library has the following name: //​terralib_example_core_lib_function//​.
  
-A seguir um exemplo que mostra como carregar uma biblioteca compartilhada:+Here is an example that shows how to load a shared library:
  
 <code cpp> <code cpp>
Line 373: Line 350:
 </​code>​ </​code>​
  
-===== Referências ​=====+===== Additional References ​=====
  
-  * [[http://​www.boost.org/​doc/​libs/​1_62_0/​doc/​html/​boost_dll.html | Boost.DLL]]+  * No references