This class groups some functions used to interact with the operating system environment. More...
#include <utils.h>
Public Types | |
typedef map< string, XMLElement > | ParameterList |
Static Public Member Functions | |
static const string & | getLogFile () |
static int | getProcessorCores () |
static void | loadModule (string lib, ParameterList ¶meters) |
Function to dynamically load a shared library in frePPLe. | |
static void | printModules () |
static string | searchFile (const string) |
static void | setLogFile (const string &x) |
Detailed Description
This class groups some functions used to interact with the operating system environment.
It handles:
- The location of the configuration files.
- The maximum number of processors / threads to be used by frePPLe.
- An output stream for logging all output.
- Dynamic loading of a shared library.
Member Typedef Documentation
typedef map<string,XMLElement> frepple::utils::Environment::ParameterList |
Member Function Documentation
static const string& frepple::utils::Environment::getLogFile | ( | ) | [inline, static] |
int frepple::utils::Environment::getProcessorCores | ( | ) | [static] |
Returns the number of processor cores on your machine.
Definition at line 170 of file utils/library.cpp.
void frepple::utils::Environment::loadModule | ( | string | lib, |
ParameterList & | parameters | ||
) | [static] |
Function to dynamically load a shared library in frePPLe.
After loading the library, the function "initialize" of the module is executed.
The current implementation supports the following platforms:
- Windows
- Linux
- Unix systems supporting the dlopen function in the standard way. Some unix systems have other or deviating APIs. A pretty messy story :-<
Definition at line 234 of file utils/library.cpp.
void frepple::utils::Environment::printModules | ( | ) | [static] |
Print all modules that have been loaded.
Definition at line 466 of file utils/actions.cpp.
string frepple::utils::Environment::searchFile | ( | const string | filename | ) | [static] |
Search for a file with a given name.
The following directories are searched in sequence to find a match:
- The current directory.
- The directory reffered to by the variable FREPPLE_HOME, if it is defined.
- The data directory as configured during the compilation. This applies only to linux / unix.
- The library directory as configured during the compilation. This applies only to linux / unix.
Definition at line 114 of file utils/library.cpp.
void frepple::utils::Environment::setLogFile | ( | const string & | x | ) | [static] |
Updates the filename for logging error messages and warnings. The file is also opened for writing and the standard output and standard error output streams are redirected to it.
If the filename starts with '+' the log file is appended to instead of being overwritten.
Definition at line 192 of file utils/library.cpp.
The documentation for this class was generated from the following files:
Documentation generated for frePPLe by
