[[project @ 2005-01-07 18:19:38 by unknown_lamer] unknown_lamer**20050107181938 Call watchers from BotConfig::set_watcher_list (BotConfig is almost done) ] { hunk ./ChangeLog 1 +2005-01-07 Clinton Ebadi + + * source/BotConfig.C (set_option_value): call watcher list + (run_fun_): Added to support watcher list calling + hunk ./source/BotConfig.C 102 - void operator()(BotConfig::t_value val) + void operator() (BotConfig::t_value val) hunk ./source/BotConfig.C 107 + + struct run_fun_ + { + std::string key; + BotConfig::t_value_list& vals; + bool appended; + + run_fun_ (std::string k, BotConfig::t_value_list& vl, bool a) + : key (k), vals (vl), appended (a) + {} + + void operator() (BotConfig::t_watcher w) + { + w (key, vals, appended); + } + }; hunk ./source/BotConfig.C 129 + hunk ./source/BotConfig.C 138 - else - cf_iter->second.first = values; + else + cf_iter->second.first = values; hunk ./source/BotConfig.C 141 -} hunk ./source/BotConfig.C 142 - + // Call Watchers + std::for_each (cf_iter->second.second.begin (), + cf_iter->second.second.end (), + run_fun_ (key, values, append)); +} hunk ./source/BotConfig.H 35 - typedef void (*t_watcher) (std::string, t_value_list, bool); + typedef void (*t_watcher) (std::string key, t_value_list vals, bool appended); }