openModeller
Version 1.4.0
|
#include <vector>
#include <string>
#include <unistd.h>
Go to the source code of this file.
Defines | |
#define | UNUSED(symbol) |
#define | Sleep(x) usleep((x)*1000) |
Typedefs | |
typedef void * | DLLHandle |
Functions | |
DLLHandle | dllOpen (char const *dll_file_name) |
void * | dllFunction (DLLHandle, char const *function_name) |
int | dllClose (DLLHandle) |
const char * | dllError (DLLHandle) |
dllexp void | setupExternalResources () |
dllexp std::string | omDataPath (std::string dir="") |
std::vector< std::string > | initialPluginPath () |
std::vector< std::string > | scanDirectory (std::string dir) |
dllexp int | initRandom (unsigned int new_seed=0) |
std::string | getWorkingPath () |
bool | pathExists (const std::string path) |
bool | createPath (const std::string path) |
#define Sleep | ( | x | ) | usleep((x)*1000) |
Definition at line 75 of file os_specific.hh.
Referenced by EnvironmentImpl::changeMask(), and EnvironmentImpl::loadLayers().
#define UNUSED | ( | symbol | ) |
Declaration of OS specific functions.
LICENSE INFORMATION
Copyright(c) 2003 by CRIA - Centro de Referencia em Informacao Ambiental
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details:
http://www.gnu.org/copyleft/gpl.html #ifdef WIN32 #define dllexp __declspec(dllimport) #define OM_XML_DLL_EXPORT __declspec(dllimport) #define OM_ALG_DLL_EXPORT __declspec(dllexport) #endif
Definition at line 60 of file os_specific.hh.
Referenced by SvmAlgorithm::_setConfiguration(), OpenModeller::calculateModelStatistics(), main(), EnvironmentImpl::makeLayer(), AlgorithmImpl::setConfiguration(), OccurrencesImpl::setConfiguration(), and OpenModeller::setProjectionConfiguration().
typedef void* DLLHandle |
Definition at line 86 of file os_specific.hh.
bool createPath | ( | const std::string | path | ) |
Creates (recursively) the specified path. path Path to be created
Definition at line 421 of file os_specific.cpp.
References createPath(), and pathExists().
Referenced by CacheManager::cache(), createPath(), CacheManager::initialize(), and CacheManager::isCached().
Definition at line 79 of file os_specific.cpp.
Referenced by AlgorithmFactory::DLL::~DLL().
Definition at line 88 of file os_specific.cpp.
References error.
void* dllFunction | ( | DLLHandle | , |
char const * | function_name | ||
) |
Definition at line 70 of file os_specific.cpp.
Definition at line 61 of file os_specific.cpp.
std::string getWorkingPath | ( | ) |
Returns the current working path.
Definition at line 398 of file os_specific.cpp.
Referenced by CacheManager::initialize().
std::vector<std::string> initialPluginPath | ( | ) |
Retrieve initial library path.
Definition at line 140 of file os_specific.cpp.
References Settings::count(), Log::debug(), Settings::get(), AlgorithmFactory::getDefaultAlgDir(), and Log::instance().
Referenced by AlgorithmFactory::searchDefaultDirs().
dllexp int initRandom | ( | unsigned int | new_seed = 0 | ) |
Generates a pseudo-random seed and initializes the system random sequence generator. The seed is based in the micro-seconds of the current machine time.
new_seed | Optional seed that can be explicitly provided. |
Definition at line 353 of file os_specific.cpp.
References Log::debug(), and Log::instance().
Referenced by Random::Random(), and splitOccurrences().
dllexp std::string omDataPath | ( | std::string | dir = "" | ) |
Return the om data directory, optionally setting it through the parameter.
dir | Default directory. |
Definition at line 102 of file os_specific.cpp.
References Settings::count(), and Settings::get().
Referenced by AquaMaps::_readSpeciesData(), and setupExternalResources().
bool pathExists | ( | const std::string | path | ) |
Indicates if the specified path exists in the file system. path Path to be tested
Definition at line 407 of file os_specific.cpp.
Referenced by createPath(), and CacheManager::initialize().
std::vector<std::string> scanDirectory | ( | std::string | dir | ) |
Scan directory entries.
dir | Path of the directory to be scanned. (pass by value, routine needs local copy). |
dllexp void setupExternalResources | ( | ) |
Set up external resources (GDAL & proj4 configuration, om algorithms & data paths).
Definition at line 95 of file os_specific.cpp.
References omDataPath(), and AlgorithmFactory::setDefaultAlgDir().
Referenced by main().