one way you could do it would be to use the boost.serialisation library and simply save the state of each class that has an option.
for instance, let's assume you're making a game, and you have the following options
- screen resolution
- difficulty
- environmental options (gravity) etc
- control bindings
so lets say we have the following classes
Code:
class RenderingEngine
{
// stuff
private:
int m_screenHeight;
int m_screenWidth;
};
class AI
{
// stuff
private:
enum Difficulty
{
GRANNY,
MOM,
GIRLFRIEND,
MATE,
HAS_NO_LIFE_AND_PLAYS_ALL_DAY
};
Difficulty m_diff;
};
class World
{
// stuff
private:
int m_gravity
};
class UserInput
{
// stuff
private:
std::map<Key, Command> m_controls;
};
you could then use a visitor pattern to call Serialise on each object.
Sorry, I'd meant to write more, but I have to head out now. I'll post more later.