Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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: 1308
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: Wed May 14 22:22:02 CEST 2025

Total time taken to generate the page: 0.03025 seconds