add an OptionManagerWatcher_AutoRegister class
This commit is contained in:
parent
a18241a03b
commit
b9f5dbd3b5
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user