Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Sep 30, 2009, 12:00:16 AM (15 years ago)
Author:
rgrieder
Message:

Extracted path related parts of Core into a new PathConfig class. This should decrease the mess in Core.cc a little bit.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core5/src/libraries/core/Core.h

    r5738 r5836  
    2828 */
    2929
    30 /**
    31 @file
    32 @brief
    33     Declaration of the Core class.
    34 @details
    35     The Core class is a singleton, only used to configure some variables
    36     in the core through the config-file.
    37 */
    38 
    3930#ifndef _Core_H__
    4031#define _Core_H__
     
    5546    @brief
    5647        The Core class is a singleton used to configure the program basics.
    57     @details
    58         The class provides information about the data, config and log path.
    59         It determines those by the use of platform specific functions.
    6048    @remark
    6149        You should only create this singleton once because it destroys the identifiers!
     
    8573            static void  resetLanguage();
    8674
    87             static void tsetExternalDataPath(const std::string& path);
    88             //! Returns the path to the data files as boost::filesystem::path
    89             static const boost::filesystem::path& getDataPath();
    90             //! Returns the path to the external data files as boost::filesystem::path
    91             static const boost::filesystem::path& getExternalDataPath();
    92             //! Returns the path to the config files as boost::filesystem::path
    93             static const boost::filesystem::path& getConfigPath();
    94             //! Returns the path to the log files as boost::filesystem::path
    95             static const boost::filesystem::path& getLogPath();
    96             //! Returns the path to the root folder as boost::filesystem::path
    97             static const boost::filesystem::path& getRootPath();
    98             //! Returns the path to the data files as std::string
    99             static std::string getDataPathString();
    100             //! Returns the path to the external data files as std::string
    101             static std::string getExternalDataPathString();
    102             //! Returns the path to the config files as std::string
    103             static std::string getConfigPathString();
    104             //! Returns the path to the log files as std::string
    105             static std::string getLogPathString();
    106             //! Returns the path to the root folder as std::string
    107             static std::string getRootPathString();
    108 
    109             static bool isDevelopmentRun() { return getInstance().bDevRun_; }
    110 
    11175        private:
    11276            Core(const Core&); //!< Don't use (undefined symbol)
     
    11882            void unloadGraphics();
    11983
    120             void setFixedPaths();
    121             void setConfigurablePaths();
    12284            void setThreadAffinity(int limitToCPU);
    12385
    12486            // Mind the order for the destruction!
     87            scoped_ptr<PathConfig>        pathConfig_;
    12588            scoped_ptr<DynLibManager>     dynLibManager_;
    12689            scoped_ptr<SignalHandler>     signalHandler_;
     
    138101            scoped_ptr<GUIManager>        guiManager_;          //!< Interface to GUI
    139102
    140             bool                          bDevRun_;             //!< True for runs in the build directory (not installed)
    141103            bool                          bGraphicsLoaded_;
    142 
    143104            static Core* singletonPtr_s;
    144105    };
Note: See TracChangeset for help on using the changeset viewer.