orxonox::Core Class Reference

The Core class is a singleton used to configure the program basics. More...

#include <src/core/Core.h>

List of all members.

Public Member Functions

 Core (int argc, char **argv)
 Determines the executable path, checks for build directory runs, creates the output directories and sets up the other core library singletons.
void setConfigValues ()
void update (const Clock &time)
 ~Core ()
 Sets the bool to true to avoid static functions accessing a deleted object.

Static Public Member Functions

static const
boost::filesystem::path
getConfigPath ()
 Returns the path to the config files as boost::filesystem::path.
static std::string getConfigPathString ()
 Returns the path to the config files as std::string.
static CoregetInstance ()
static const std::stringgetLanguage ()
 Returns the configured language.
static const
boost::filesystem::path
getLogPath ()
 Returns the path to the log files as boost::filesystem::path.
static std::string getLogPathString ()
 Returns the path to the log files as std::string.
static const
boost::filesystem::path
getMediaPath ()
 Returns the path to the config files as boost::filesystem::path.
static std::string getMediaPathString ()
 Returns the path to the data files as std::string.
static int getSoftDebugLevel (OutputHandler::OutputDevice device=OutputHandler::LD_All)
 Returns the softDebugLevel for the given device (returns a default-value if the class is right about to be created).
static void resetLanguage ()
 Sets the language in the config-file back to the default.
static void setSoftDebugLevel (OutputHandler::OutputDevice device, int level)
 Sets the softDebugLevel for the given device. Please use this only temporary and restore the value afterwards, as it overrides the configured value.
static void tsetMediaPath (const std::string &path)

Private Member Functions

void checkDevBuild ()
 Checks for "orxonox_dev_build.keep_me" in the executable diretory. If found it means that this is not an installed run, hence we don't write the logs and config files to ~/.orxonox.
 Core (const Core &)
 Don't use (undefined symbol).
void createDirectories ()
void setExecutablePath ()
 Compares the executable path with the working directory.
void setThreadAffinity (int limitToCPU)

Private Attributes

ConfigFileManagerconfigFileManager_
CoreConfigurationconfiguration_
bool isDevBuild_
 True for builds in the build directory (not installed).
LanguagelanguageInstance_
LuaBindluaBind_
Shellshell_
SignalHandlersignalHandler_
TclBindtclBind_
TclThreadManagertclThreadManager_

Static Private Attributes

static CoresingletonRef_s = 0
 Static pointer to the singleton.


Detailed Description

The Core class is a singleton used to configure the program basics.

The class provides information about the media, config and log path. It determines those by the use of platform specific functions.


Constructor & Destructor Documentation

orxonox::Core::Core ( int  argc,
char **  argv 
)

orxonox::Core::~Core (  ) 

orxonox::Core::Core ( const Core  )  [private]

Don't use (undefined symbol).


Member Function Documentation

void orxonox::Core::checkDevBuild (  )  [private]

void orxonox::Core::createDirectories (  )  [private]

const boost::filesystem::path & orxonox::Core::getConfigPath (  )  [static]

std::string orxonox::Core::getConfigPathString (  )  [static]

Returns the path to the config files as std::string.

References orxonox::CoreConfiguration::configPath_, configuration_, and getInstance().

static Core& orxonox::Core::getInstance (  )  [inline, static]

const std::string & orxonox::Core::getLanguage (  )  [static]

const boost::filesystem::path & orxonox::Core::getLogPath (  )  [static]

std::string orxonox::Core::getLogPathString (  )  [static]

const boost::filesystem::path & orxonox::Core::getMediaPath (  )  [static]

std::string orxonox::Core::getMediaPathString (  )  [static]

int orxonox::Core::getSoftDebugLevel ( OutputHandler::OutputDevice  device = OutputHandler::LD_All  )  [static]

void orxonox::Core::resetLanguage (  )  [static]

Sets the language in the config-file back to the default.

References configuration_, getInstance(), and orxonox::CoreConfiguration::resetLanguage().

Referenced by orxonox::Language::readTranslatedLanguageFile().

void orxonox::Core::setConfigValues (  ) 

void orxonox::Core::setExecutablePath (  )  [private]

Compares the executable path with the working directory.

References configuration_, orxonox::CoreConfiguration::executablePath_, and ThrowException.

Referenced by Core().

void orxonox::Core::setSoftDebugLevel ( OutputHandler::OutputDevice  device,
int  level 
) [static]

void orxonox::Core::setThreadAffinity ( int  limitToCPU  )  [private]

Note:
The code of this function has been copied and adjusted from OGRE, an open source graphics engine. (Object-oriented Graphics Rendering Engine) For the latest info, see http://www.ogre3d.org/
Copyright (c) 2000-2008 Torus Knot Software Ltd

OGRE is licensed under the LGPL. For more info, see OGRE license.

Referenced by Core().

void orxonox::Core::tsetMediaPath ( const std::string path  )  [static]

void orxonox::Core::update ( const Clock time  ) 


Member Data Documentation

Referenced by Core(), and ~Core().

True for builds in the build directory (not installed).

Referenced by checkDevBuild().

Referenced by Core(), and ~Core().

Referenced by Core(), and ~Core().

Referenced by Core(), and ~Core().

Referenced by Core(), and ~Core().

Core * orxonox::Core::singletonRef_s = 0 [static, private]

Static pointer to the singleton.

Referenced by Core(), and getInstance().

Referenced by Core(), and ~Core().

Referenced by Core(), update(), and ~Core().


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

Generated on Tue Jul 28 16:22:26 2009 for Orxonox by  doxygen 1.5.6