-
Notifications
You must be signed in to change notification settings - Fork 55
Executor
Yuzhen Huang edited this page Sep 28, 2016
·
1 revision
Some APIs of Executors:
template <typename InputFormatT, typename ParseT>
void load(InputFormatT& infmt, const ParseT& parse);
template <typename InputFormatT, typename ParseT>
void load(InputFormatT& infmt, const std::vector<ChannelBase*>& out_channel, const ParseT& parse);
template <typename ObjT>
void globalize(ObjList<ObjT>& obj_list);
template <typename ObjT, typename ExecT>
void list_execute(ObjList<ObjT>& obj_list, ExecT execute, int num_iters = 1);
template <typename ObjT, typename ExecT>
void list_execute(ObjList<ObjT>& obj_list, const std::vector<ChannelBase*>& in_channel,
const std::vector<ChannelBase*>& out_channel, ExecT execute, int num_iters = 1);
Some usages:
load(infmt, parse_wc);
list_execute(word_list, [&ch](Word& word) { ... });
load(infmt, {&ch}, parse_wc);
list_execute(word_list, {&ch}, {},
[&ch](Word& word) { ... });