Vowpal Wabbit
search_hooktask.h
Go to the documentation of this file.
1 /*
2 CoPyright (c) by respective owners including Yahoo!, Microsoft, and
3 individual contributors. All rights reserved. Released under a BSD
4 license as described in the file LICENSE.
5  */
6 #pragma once
7 #include "search.h"
8 
9 namespace HookTask
10 {
12 void finish(Search::search&);
13 void run(Search::search&, multi_ex&);
17 
18 struct task_data
19 {
20  void (*run_f)(Search::search&);
23  void* run_object; // for python this will really be a (py::object*), but we don't want basic VW to have to know about
24  // hook
25  void* setup_object; // for python this will really be a (py::object*), but we don't want basic VW to have to know
26  // about hook
27  void* takedown_object; // for python this will really be a (py::object*), but we don't want basic VW to have to know
28  // about hook
30  void*); // we can't delete run_object on our own because we don't know its size, so provide a hook
31  void (*delete_extra_data)(task_data&); // ditto for extra_data and extra_data2
32  VW::config::options_i* arg; // so that hook can access command line variables
33  const void* extra_data; // any extra data that might be needed
34  const void* extra_data2; // any (more) extra data that might be needed
35  size_t num_actions; // cache for easy access
36 };
37 } // namespace HookTask
void finish(Search::search &sch)
void run(Search::search &sch, multi_ex &)
void run_takedown(Search::search &sch, multi_ex &)
Search::search_task task
void(* run_takedown_f)(Search::search &)
const void * extra_data2
void run_setup(Search::search &sch, multi_ex &)
void(* delete_extra_data)(task_data &)
const void * extra_data
void(* run_f)(Search::search &)
std::vector< example * > multi_ex
Definition: example.h:122
void initialize(Search::search &sch, size_t &num_actions, options_i &arg)
VW::config::options_i * arg
void(* run_setup_f)(Search::search &)
void(* delete_run_object)(void *)