All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Static Public Member Functions | List of all members
openfluid::base::RuntimeEnvironment Class Reference

#include <base/RuntimeEnv.hpp>

Public Member Functions

 ~RuntimeEnvironment ()
 
std::string getVersion () const
 
std::string getFullVersion () const
 
std::string getMajorMinorVersion () const
 
void setInputDir (const std::string &InputDir)
 
std::string getInputDir () const
 
void setOutputDir (const std::string &OutputDir)
 
std::string getOutputDir () const
 
void setDateTimeOutputDir ()
 
std::string getMarketBagDir () const
 
std::string getMarketBagVersionDir () const
 
std::string getMarketBagSimVersionDir () const
 
std::string getMarketBagObsVersionDir () const
 
std::string getMarketBagBuildVersionDir () const
 
std::string getMarketBagDataVersionDir () const
 
std::string getMarketBagBinSubDir () const
 
std::string getMarketBagSrcSubDir () const
 
std::string getDefaultConfigFile () const
 
std::string getConfigFilePath (std::string Filename) const
 
std::string getUserHomeDir () const
 
std::string getUserDataPath (std::string RelativePath) const
 
void prepareUserDataDirectory () const
 
std::string getTempDir () const
 
std::string getInputFullPath (std::string Filename) const
 
std::string getOutputFullPath (std::string Filename) const
 
std::string getSimulatorPluginFullPath (const std::string &Filename) const
 
void addExtraSimulatorsPluginsPaths (std::string SemicolonSeparatedPaths)
 
void resetExtraSimulatorsPluginsPaths ()
 
std::vector< std::string > getDefaultSimulatorsPluginsPaths () const
 
std::vector< std::string > getExtraSimulatorsPluginsPaths () const
 
std::vector< std::string > getSimulatorsPluginsPaths () const
 
std::string getObserverPluginFullPath (const std::string &Filename) const
 
void addExtraObserversPluginsPaths (const std::string &SemicolonSeparatedPaths)
 
void resetExtraObserversPluginsPaths ()
 
std::vector< std::string > getDefaultObserversPluginsPaths () const
 
std::vector< std::string > getExtraObserversPluginsPaths () const
 
std::vector< std::string > getObserversPluginsPaths () const
 
std::string getInstallPrefix () const
 
std::string getCommonResourcesDir () const
 
std::string getCommonResourceFilePath (std::string RelativeFilePath) const
 
std::string getAppResourcesDir (std::string AppName) const
 
std::string getAppResourceFilePath (std::string AppName, std::string RelativeFilePath) const
 
std::string getTranslationsDir () const
 
std::string getProvidedExamplesDir () const
 
std::string getUserExamplesDir () const
 
openfluid::base::EnvironmentPropertiesextraProperties ()
 
bool isClearOutputDir () const
 
void setClearOutputDir (bool ClearDir)
 
openfluid::base::EnvironmentPropertieswareEnvironment () const
 
std::string getHostName () const
 
std::string getUserID () const
 
std::string getArch () const
 
unsigned int getSimulatorsMaxNumThreads () const
 
void setSimulatorsMaxNumThreads (const unsigned int &MaxNumThreads)
 
void setValuesBufferSize (const unsigned int StepsNbr)
 
unsigned int getValuesBufferSize () const
 
bool isUserValuesBufferSize () const
 
void unsetUserValuesBufferSize ()
 
void linkToProject ()
 
void detachFromProject ()
 
bool isLinkedToProject () const
 
bool isSimulationProfilingEnabled () const
 
void setSimulationProfilingEnabled (bool Profiling)
 
void processWareParams (openfluid::ware::WareParams_t &Params) const
 

Static Public Member Functions

static RuntimeEnvironmentinstance ()
 

Constructor & Destructor Documentation

openfluid::base::RuntimeEnvironment::~RuntimeEnvironment ( )

Destructor

Member Function Documentation

void openfluid::base::RuntimeEnvironment::addExtraObserversPluginsPaths ( const std::string &  SemicolonSeparatedPaths)

Adds search paths for plugins, separated by semicolon characters (i.e. /path/to/plugs:another/path/to/plugs). These paths are added at the top of the search paths list.

Parameters
[in]SemicolonSeparatedPathsa collection of paths separated by semicolons, as a std::string
void openfluid::base::RuntimeEnvironment::addExtraSimulatorsPluginsPaths ( std::string  SemicolonSeparatedPaths)

Adds search paths for plugins, separated by semicolon characters (i.e. /path/to/plugs:another/path/to/plugs). These paths are added at the top of the search paths list.

Parameters
[in]SemicolonSeparatedPathsa collection of paths separated by semicolons, as a std::string
void openfluid::base::RuntimeEnvironment::detachFromProject ( )
openfluid::base::EnvironmentProperties& openfluid::base::RuntimeEnvironment::extraProperties ( )
inline

Returns the extra properties list

Returns
the extra properties list
std::string openfluid::base::RuntimeEnvironment::getAppResourceFilePath ( std::string  AppName,
std::string  RelativeFilePath 
) const

Returns the path for a given file, relative a given application resources path

Parameters
[in]AppNameThe given application name
[in]RelativeFilePathThe given file
Returns
the path for a given file in the given application resources
std::string openfluid::base::RuntimeEnvironment::getAppResourcesDir ( std::string  AppName) const

Returns the path for resources of a given application, taking into account the install prefix path

Parameters
[in]AppNameThe given application name
Returns
the path for resources of a given application
std::string openfluid::base::RuntimeEnvironment::getArch ( ) const
inline

Returns the local system architecture (if could be determined)

Returns
the local architecture
std::string openfluid::base::RuntimeEnvironment::getCommonResourceFilePath ( std::string  RelativeFilePath) const

Returns the path for a given file, relative to the common resources path

Parameters
[in]RelativeFilePathThe given file
Returns
the path for a given file in the common resources
std::string openfluid::base::RuntimeEnvironment::getCommonResourcesDir ( ) const

Returns the path for common resources, taking into account the install prefix path

Returns
the path for common resources
std::string openfluid::base::RuntimeEnvironment::getConfigFilePath ( std::string  Filename) const
inline

Returns the path for a given config file (i.e. $HOME/.openfluid/Filename)

Parameters
[in]Filenamethe given config file name
Returns
the path
std::string openfluid::base::RuntimeEnvironment::getDefaultConfigFile ( ) const
inline

Returns the default config file path (i.e. $HOME/.openfluid/openfluid.conf)

Returns
the default config file path
std::vector<std::string> openfluid::base::RuntimeEnvironment::getDefaultObserversPluginsPaths ( ) const
inline
std::vector<std::string> openfluid::base::RuntimeEnvironment::getDefaultSimulatorsPluginsPaths ( ) const
inline
std::vector<std::string> openfluid::base::RuntimeEnvironment::getExtraObserversPluginsPaths ( ) const
inline
std::vector<std::string> openfluid::base::RuntimeEnvironment::getExtraSimulatorsPluginsPaths ( ) const
inline
std::string openfluid::base::RuntimeEnvironment::getFullVersion ( ) const
inline

Returns the full version of OpenFLUID, including status (alpha, beta, rc, ...)

Returns
the full version as a std::string
std::string openfluid::base::RuntimeEnvironment::getHostName ( ) const
inline

Returns the local host name (if could be determined)

Returns
the local host name
std::string openfluid::base::RuntimeEnvironment::getInputDir ( ) const
inline

Returns the input directory

Returns
the input directory
std::string openfluid::base::RuntimeEnvironment::getInputFullPath ( std::string  Filename) const
inline

Returns the path for a given input file (i.e. InputDir/Filename)

Parameters
[in]FilenameThe given input file name
Returns
the path for a given input file
std::string openfluid::base::RuntimeEnvironment::getInstallPrefix ( ) const
inline

Returns the install prefix path. The install prefix is given at compile time, but can be overriden by the OPENFLUID_INSTALL_PREFIX environment variable (recommended on windows systems).

Returns
the install prefix path
std::string openfluid::base::RuntimeEnvironment::getMajorMinorVersion ( ) const
inline

Returns the version of OpenFLUID, composed of major and minor numbers

Returns
the major.minor version as a std::string
std::string openfluid::base::RuntimeEnvironment::getMarketBagBinSubDir ( ) const
inline
Returns
the binairies market bag subdirectory
std::string openfluid::base::RuntimeEnvironment::getMarketBagBuildVersionDir ( ) const
inline
Returns
the market bag directory for builderexts of the current version (i.e. $HOME/.openfluid/market-bag/2.0.0/builderexts)
std::string openfluid::base::RuntimeEnvironment::getMarketBagDataVersionDir ( ) const
inline
Returns
the market bag directory for datasets of the current version (i.e. $HOME/.openfluid/market-bag/2.0.0/datasets)
std::string openfluid::base::RuntimeEnvironment::getMarketBagDir ( ) const
inline

Returns the market bag directory (i.e. $HOME/.openfluid/market-bag)

Returns
the market bag directory
std::string openfluid::base::RuntimeEnvironment::getMarketBagObsVersionDir ( ) const
inline
Returns
the market bag directory for observers of the current version (i.e. $HOME/.openfluid/market-bag/2.0.0/observers)
std::string openfluid::base::RuntimeEnvironment::getMarketBagSimVersionDir ( ) const
inline
Returns
the market bag directory for simulators of the current version (i.e. $HOME/.openfluid/market-bag/2.0.0/simulators)
std::string openfluid::base::RuntimeEnvironment::getMarketBagSrcSubDir ( ) const
inline
Returns
the sources market bag subdirectory
std::string openfluid::base::RuntimeEnvironment::getMarketBagVersionDir ( ) const
inline
Returns
the market bag directory for the current OpenFLUID version (i.e. $HOME/.openfluid/market-bag/2.0.0)
std::string openfluid::base::RuntimeEnvironment::getObserverPluginFullPath ( const std::string &  Filename) const

Returns the path for a given observer plugin file, taking into account the observer plugins path search order

Parameters
[in]FilenameThe given observer plugin file name
Returns
the first path found for a given observer plugin file
std::vector<std::string> openfluid::base::RuntimeEnvironment::getObserversPluginsPaths ( ) const
inline

Returns the ordered list of paths used to search for observer plugins

Returns
the ordered list of paths
std::string openfluid::base::RuntimeEnvironment::getOutputDir ( ) const
inline

Returns the output directory

Returns
the output directory
std::string openfluid::base::RuntimeEnvironment::getOutputFullPath ( std::string  Filename) const
inline

Returns the path for a given output file (i.e. OutputDir/Filename)

Parameters
[in]FilenameThe given output file name
Returns
the path for a given output file
std::string openfluid::base::RuntimeEnvironment::getProvidedExamplesDir ( ) const
inline

Returns the path for provided examples, taking into account the install prefix path

Returns
the path for provided examples
std::string openfluid::base::RuntimeEnvironment::getSimulatorPluginFullPath ( const std::string &  Filename) const

Returns the path for a given simulator plugin file, taking into account the simulator plugins path search order

Parameters
[in]FilenameThe given simulator plugin file name
Returns
the first path found for a given simulator plugin file
unsigned int openfluid::base::RuntimeEnvironment::getSimulatorsMaxNumThreads ( ) const
inline
std::vector<std::string> openfluid::base::RuntimeEnvironment::getSimulatorsPluginsPaths ( ) const
inline

Returns the ordered list of paths used to search for simulator plugins

Returns
the ordered list of paths
std::string openfluid::base::RuntimeEnvironment::getTempDir ( ) const
inline

Returns the path of the temporary directory

Returns
the path of the temporary directory
std::string openfluid::base::RuntimeEnvironment::getTranslationsDir ( ) const

Returns the translations directory

Returns
the path for translationslocale directory
std::string openfluid::base::RuntimeEnvironment::getUserDataPath ( std::string  RelativePath) const
inline

Returns the absolute path for a given relative path in the user OpenFLUID directory (i.e. $HOME/.openfluid/RelativePath)

Parameters
[in]RelativePaththe given relative path
Returns
the absolute path
std::string openfluid::base::RuntimeEnvironment::getUserExamplesDir ( ) const
inline

Returns the path for examples in user's directory

Returns
the path for user's examples
std::string openfluid::base::RuntimeEnvironment::getUserHomeDir ( ) const
inline

Returns the absolute path of the home directory

Returns
the absolute path
std::string openfluid::base::RuntimeEnvironment::getUserID ( ) const
inline

Returns the local user ID (if could be determined)

Returns
the local user ID
unsigned int openfluid::base::RuntimeEnvironment::getValuesBufferSize ( ) const
inline
std::string openfluid::base::RuntimeEnvironment::getVersion ( ) const
inline

Returns the version of OpenFLUID

Returns
the version as a std::string
static RuntimeEnvironment* openfluid::base::RuntimeEnvironment::instance ( )
static
bool openfluid::base::RuntimeEnvironment::isClearOutputDir ( ) const
inline

Returns the clear output directory flag

bool openfluid::base::RuntimeEnvironment::isLinkedToProject ( ) const
inline
bool openfluid::base::RuntimeEnvironment::isSimulationProfilingEnabled ( ) const
inline
bool openfluid::base::RuntimeEnvironment::isUserValuesBufferSize ( ) const
inline
void openfluid::base::RuntimeEnvironment::linkToProject ( )
void openfluid::base::RuntimeEnvironment::prepareUserDataDirectory ( ) const

Checks the user data directory and create missing subdirectories and files

void openfluid::base::RuntimeEnvironment::processWareParams ( openfluid::ware::WareParams_t Params) const
void openfluid::base::RuntimeEnvironment::resetExtraObserversPluginsPaths ( )
inline
void openfluid::base::RuntimeEnvironment::resetExtraSimulatorsPluginsPaths ( )
inline
void openfluid::base::RuntimeEnvironment::setClearOutputDir ( bool  ClearDir)
inline

Sets the clear output directory flag

Parameters
[in]ClearDirThe value of the flag
void openfluid::base::RuntimeEnvironment::setDateTimeOutputDir ( )

Sets the output directory as a directory located in the user data directory, with a name based on the current date-time

void openfluid::base::RuntimeEnvironment::setInputDir ( const std::string &  InputDir)
inline

Sets the input directory, overriding the default input dir

Parameters
[in]InputDirThe input directory
void openfluid::base::RuntimeEnvironment::setOutputDir ( const std::string &  OutputDir)
inline

Sets the output directory, overriding the default output dir

Parameters
[in]OutputDirThe output directory
void openfluid::base::RuntimeEnvironment::setSimulationProfilingEnabled ( bool  Profiling)
inline
void openfluid::base::RuntimeEnvironment::setSimulatorsMaxNumThreads ( const unsigned int &  MaxNumThreads)
inline
void openfluid::base::RuntimeEnvironment::setValuesBufferSize ( const unsigned int  StepsNbr)
inline
void openfluid::base::RuntimeEnvironment::unsetUserValuesBufferSize ( )
inline
openfluid::base::EnvironmentProperties* openfluid::base::RuntimeEnvironment::wareEnvironment ( ) const
inline

The documentation for this class was generated from the following file: