// input is sequence of symbols // CallbackT must be callable with (size_t what, size_t where) // template <typename InputIterT, typename CallbackT> void search( char const *input_it, char const *input_end, results<std::vector<std::string> >& callback) { for ( ; input_it != input_end; ++input_it, where_++) { char const& input = *input_it; { state_t next; while ((next = goto_(state_, input)) == AC_FAIL_STATE) { state_ = fail_(state_); } state_ = next; } { std::set<std::size_t> const& out_node = output_[state_]; typename std::set<size_t>::const_iterator output_it; for (output_it = out_node.begin(); output_it != out_node.end(); ++output_it) { callback(*output_it, where_); } } } }
/** * Same as fullfill, but instead of calling the continuation function, * it will call the error handler function with the ec. */ void error(boost::system::error_code const& ec) { if (fail_) fail_(ec); else last_ec_.store(ec); error_.store(true); }