Chat-O-Matic/application/preferences/PreferencesContainer.h
2010-05-19 18:49:41 +00:00

37 lines
716 B
C++

/*
* Copyright 2010, Oliver Ruiz Dorantes. All rights reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef _PREFERENCES_CONTAINER_H
#define _PREFERENCES_CONTAINER_H
#include <libsupport/Singleton.h>
// TODO: added to main singleton class?
template<typename T> T* Singleton<T>::fInstance = 0;
template<class SettingsType>
class PreferencesContainer : public Singleton<PreferencesContainer<SettingsType> > {
public:
static const char* fFilename;
static SettingsType*
Item()
{
return &(Singleton<PreferencesContainer<SettingsType> >::Get()->fSettings);
}
// TODO:
// status_t Save();
// status_t Load();
private:
SettingsType fSettings;
};
#endif // _PREFERENCES_CONTAINER_H