add an OptionManagerWatcher_AutoRegister class

This commit is contained in:
Maxime Coste 2013-04-02 13:57:04 +02:00
parent a18241a03b
commit b9f5dbd3b5

View File

@ -162,6 +162,29 @@ public:
}
};
struct OptionManagerRegisterFuncs
{
static void insert(OptionManager& options, OptionManagerWatcher& watcher)
{
options.register_watcher(watcher);
}
static void remove(OptionManager& options, OptionManagerWatcher& watcher)
{
options.unregister_watcher(watcher);
}
};
class OptionManagerWatcher_AutoRegister
: public OptionManagerWatcher,
public AutoRegister<OptionManagerWatcher_AutoRegister,
OptionManagerRegisterFuncs, OptionManager>
{
public:
OptionManagerWatcher_AutoRegister(OptionManager& options)
: AutoRegister(options) {}
};
}
#endif // option_manager_hh_INCLUDED