openModeller  Version 1.5.0
os_specific.cpp File Reference
#include <os_specific.hh>
#include <openmodeller/Log.hh>
#include <openmodeller/AlgorithmFactory.hh>
#include <openmodeller/Settings.hh>
#include <iostream>
#include <stdlib.h>
#include <sys/stat.h>
#include <sys/param.h>
#include <errno.h>
#include <unistd.h>
#include <fstream>
#include <dlfcn.h>
#include <dirent.h>
#include <string.h>
#include <sys/time.h>
#include <sys/resource.h>
Include dependency graph for os_specific.cpp:

Go to the source code of this file.

Typedefs

typedef struct dirent TDirent
 

Functions

DLLHandle dllOpen (char const *dll_file_name)
 
void * dllFunction (DLLHandle handle, char const *function_name)
 
int dllClose (DLLHandle handle)
 
const char * dllError (DLLHandle)
 
void setupExternalResources ()
 
std::string omDataPath (std::string dir)
 
vector< string > initialPluginPath ()
 
int filter (const TDirent *dir)
 
vector< string > scanDirectory (string dir)
 
int initRandom (unsigned int new_seed)
 
std::string getWorkingPath ()
 
bool pathExists (const std::string path)
 
bool createPath (const std::string path)
 

Typedef Documentation

typedef struct dirent TDirent

Definition at line 253 of file os_specific.cpp.

Function Documentation

bool createPath ( const std::string  path)

Creates (recursively) the specified path. path Path to be created

Returns
Succeeded or not.

Definition at line 421 of file os_specific.cpp.

Referenced by CacheManager::cache(), createPath(), CacheManager::initialize(), and CacheManager::isCached().

int dllClose ( DLLHandle  handle)

Definition at line 79 of file os_specific.cpp.

Referenced by AlgorithmFactory::DLL::~DLL().

const char* dllError ( DLLHandle  )

Definition at line 88 of file os_specific.cpp.

void* dllFunction ( DLLHandle  handle,
char const *  function_name 
)

Definition at line 70 of file os_specific.cpp.

DLLHandle dllOpen ( char const *  dll_file_name)

Definition at line 61 of file os_specific.cpp.

int filter ( const TDirent dir)

Filter the file's names that refers to a dynamic shared libraries.

Definition at line 271 of file os_specific.cpp.

Referenced by scanDirectory().

std::string getWorkingPath ( )

Returns the current working path.

Returns
Working path.

Definition at line 398 of file os_specific.cpp.

Referenced by CacheManager::initialize().

vector<string> initialPluginPath ( )

Retrieve initial library path.

Returns
Vector of directories.

Definition at line 140 of file os_specific.cpp.

Referenced by AlgorithmFactory::searchDefaultDirs().

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.

Parameters
new_seedOptional seed that can be explicitly provided.
Returns
Not zero if the generator was initiated.

Definition at line 353 of file os_specific.cpp.

Referenced by Random::Random(), and splitOccurrences().

std::string omDataPath ( std::string  dir = "")

Return the om data directory, optionally setting it through the parameter.

Parameters
dirDefault directory.
Returns
dir openModeller data directory.

Definition at line 102 of file os_specific.cpp.

Referenced by AquaMaps::_readSpeciesData().

bool pathExists ( const std::string  path)

Indicates if the specified path exists in the file system. path Path to be tested

Returns
Yes or no.

Definition at line 407 of file os_specific.cpp.

Referenced by CacheManager::initialize().

vector<string> scanDirectory ( string  dir)

Definition at line 297 of file os_specific.cpp.

References filter().

Referenced by AlgorithmFactory::p_addDir().

Here is the call graph for this function:

void setupExternalResources ( )

Set up external resources (GDAL & proj4 configuration, om algorithms & data paths).

Definition at line 95 of file os_specific.cpp.

Referenced by main().