20 #ifndef PROGRAM_OPTIONS_ACCUMULATOR_HPP
21 #define PROGRAM_OPTIONS_ACCUMULATOR_HPP
23 #include <boost/program_options/value_semantic.hpp>
24 #include <boost/any.hpp>
25 #include <boost/function.hpp>
58 virtual std::string
name()
const {
return std::string(); }
73 virtual void parse(boost::any& value_store,
74 const std::vector<std::string>& new_tokens,
77 assert(new_tokens.empty());
78 if (value_store.empty()) value_store =
T();
79 boost::any_cast<
T&>(value_store) += _interval;
84 value_store = _default;
89 virtual void notify(
const boost::any& value_store)
const {
90 if (_notifier) _notifier(boost::any_cast<T>(value_store));
96 boost::function1<void, const T&> _notifier;