U++ framework
Do not panic. Ask here before giving up.

Home » U++ Library support » U++ Core » How to program real U++ applications
Re: How to program real U++ applications [message #25968 is a reply to message #25966] Mon, 22 March 2010 16:27 Go to previous messageGo to previous message
mdelfede is currently offline  mdelfede
Messages: 1313
Registered: September 2007
Ultimate Contributor
I usually separate configuration from main class, so a "Settings" class wich contains all global settings. Example :

In "settings.h"

class Settings
{
    private:
......(all app wide settings here)

    public:
......(all getters/setters for public accessible settings)

};

Settings &globalSettings();


and, in "settings.cpp"

Settings &globalSettings()
{
    static Settings settings;

    return settings;
}


So the only public stuff is the global 'globalSettings()' function wich gives access to app-wide settings.
In settings constructor you can then put code to load (Xmlize) status, and in destructor code to save (Xmlize) status.

Ciao

Max
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Xmlize hates spaces
Next Topic: Strange issue with VectorMap<String, String>
Goto Forum:
  


Current Time: Thu Sep 17 04:38:22 GMT+2 2026

Total time taken to generate the page: 0.00785 seconds