Orxonox  0.0.5 Codename: Arcturus
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | Friends | List of all members
orxonox::ApplicationPaths Class Reference

The ApplicationPaths class is a singleton which provides static paths of the application. More...

#include </home/jenkins/workspace/orxonox_doxygen_trunk/src/libraries/core/ApplicationPaths.h>

Inheritance diagram for orxonox::ApplicationPaths:
orxonox::Singleton< ApplicationPaths >

Public Member Functions

 ApplicationPaths ()
 Retrieves the executable path and sets all hard coded fixed paths (currently only the module and the plugin paths) Also checks for "orxonox_dev_build.keep_me" in the executable directory. More...
 
 ~ApplicationPaths ()
 
std::map< std::string, std::string > getModulePaths ()
 Returns a map with all modules declared by a *.module file in the module folder; key = module-name, value = library-path (content of the file). More...
 
std::map< std::string, std::string > getPluginPaths ()
 Returns a map with all plugins declared by a *.plugin file in the plugin folder; key = plugin-name, value = library-path (content of the file). More...
 

Static Public Member Functions

static bool buildDirectoryRun ()
 Return true for runs in the build directory (not installed) More...
 
static const boost::filesystem::pathgetExecutablePath ()
 Returns the path to the executable folder as boost::filesystem::path. More...
 
static std::string getExecutablePathString ()
 Returns the path to the executable folder as std::string. More...
 
static const boost::filesystem::pathgetModulePath ()
 Returns the path to the modules as boost::filesystem::path. More...
 
static std::string getModulePathString ()
 Returns the path to the modules as std::string. More...
 
static const boost::filesystem::pathgetPluginPath ()
 Returns the path to the plugins as boost::filesystem::path. More...
 
static std::string getPluginPathString ()
 Returns the path to the plugins as std::string. More...
 
static const boost::filesystem::pathgetRootPath ()
 Returns the path to the root folder as boost::filesystem::path. More...
 
static std::string getRootPathString ()
 Returns the path to the root folder as std::string. More...
 
- Static Public Member Functions inherited from orxonox::Singleton< ApplicationPaths >
static bool exists ()
 Tells whether the singleton has been created. More...
 
static ApplicationPathsgetInstance ()
 Returns a reference to the singleton instance. More...
 

Private Member Functions

 ApplicationPaths (const ApplicationPaths &)=delete
 
std::map< std::string, std::string > getModuleOrPluginPaths (boost::filesystem::path &directory, const std::string &extension)
 
ApplicationPathsoperator= (const ApplicationPaths &)=delete
 

Private Attributes

bool bBuildDirectoryRun_
 True for runs in the build directory (not installed) More...
 
boost::filesystem::pathexecutablePath_
 Path to the executable. More...
 
boost::filesystem::pathmodulePath_
 Path to the modules. More...
 
boost::filesystem::pathpluginPath_
 Path to the plugins. More...
 
boost::filesystem::pathrootPath_
 Path to the parent directory of the ones above if program was installed with relative paths. More...
 

Static Private Attributes

static ApplicationPathssingletonPtr_s = nullptr
 Static pointer to the singleton. More...
 

Friends

class Singleton< ApplicationPaths >
 

Additional Inherited Members

- Protected Member Functions inherited from orxonox::Singleton< ApplicationPaths >
 Singleton ()
 Constructor sets the singleton instance pointer. More...
 
virtual ~Singleton ()
 Destructor resets the singleton instance pointer. More...
 

Detailed Description

The ApplicationPaths class is a singleton which provides static paths of the application.

The class provides information about the executable, root and module/plugin path. It determines those by the use of platform specific functions.

Remarks
Not all paths are always available:
  • root only when installed copyable

Constructor & Destructor Documentation

orxonox::ApplicationPaths::ApplicationPaths ( )

Retrieves the executable path and sets all hard coded fixed paths (currently only the module and the plugin paths) Also checks for "orxonox_dev_build.keep_me" in the executable directory.

If found it means that this is not an installed run, hence we don't write the logs and config files to ~/.orxonox

Exceptions
GeneralException
orxonox::ApplicationPaths::~ApplicationPaths ( )
orxonox::ApplicationPaths::ApplicationPaths ( const ApplicationPaths )
privatedelete

Member Function Documentation

static bool orxonox::ApplicationPaths::buildDirectoryRun ( )
inlinestatic

Return true for runs in the build directory (not installed)

static const boost::filesystem::path& orxonox::ApplicationPaths::getExecutablePath ( )
inlinestatic

Returns the path to the executable folder as boost::filesystem::path.

std::string orxonox::ApplicationPaths::getExecutablePathString ( )
static

Returns the path to the executable folder as std::string.

std::map< std::string, std::string > orxonox::ApplicationPaths::getModuleOrPluginPaths ( boost::filesystem::path directory,
const std::string &  extension 
)
private
static const boost::filesystem::path& orxonox::ApplicationPaths::getModulePath ( )
inlinestatic

Returns the path to the modules as boost::filesystem::path.

std::map< std::string, std::string > orxonox::ApplicationPaths::getModulePaths ( )

Returns a map with all modules declared by a *.module file in the module folder; key = module-name, value = library-path (content of the file).

std::string orxonox::ApplicationPaths::getModulePathString ( )
static

Returns the path to the modules as std::string.

static const boost::filesystem::path& orxonox::ApplicationPaths::getPluginPath ( )
inlinestatic

Returns the path to the plugins as boost::filesystem::path.

std::map< std::string, std::string > orxonox::ApplicationPaths::getPluginPaths ( )

Returns a map with all plugins declared by a *.plugin file in the plugin folder; key = plugin-name, value = library-path (content of the file).

std::string orxonox::ApplicationPaths::getPluginPathString ( )
static

Returns the path to the plugins as std::string.

static const boost::filesystem::path& orxonox::ApplicationPaths::getRootPath ( )
inlinestatic

Returns the path to the root folder as boost::filesystem::path.

std::string orxonox::ApplicationPaths::getRootPathString ( )
static

Returns the path to the root folder as std::string.

ApplicationPaths& orxonox::ApplicationPaths::operator= ( const ApplicationPaths )
privatedelete

Friends And Related Function Documentation

friend class Singleton< ApplicationPaths >
friend

Member Data Documentation

bool orxonox::ApplicationPaths::bBuildDirectoryRun_
private

True for runs in the build directory (not installed)

boost::filesystem::path& orxonox::ApplicationPaths::executablePath_
private

Path to the executable.

boost::filesystem::path& orxonox::ApplicationPaths::modulePath_
private

Path to the modules.

boost::filesystem::path& orxonox::ApplicationPaths::pluginPath_
private

Path to the plugins.

boost::filesystem::path& orxonox::ApplicationPaths::rootPath_
private

Path to the parent directory of the ones above if program was installed with relative paths.

ApplicationPaths * orxonox::ApplicationPaths::singletonPtr_s = nullptr
staticprivate

Static pointer to the singleton.


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