Turi Create  4.0
toolkit_function_invocation.hpp
1 /* Copyright © 2017 Apple Inc. All rights reserved.
2  *
3  * Use of this source code is governed by a BSD-3-clause license that can
4  * be found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause
5  */
6 #ifndef TURI_UNITY_TOOLKIT_INVOCATION_HPP
7 #define TURI_UNITY_TOOLKIT_INVOCATION_HPP
8 #include <string>
9 #include <functional>
10 #include <model_server/lib/variant.hpp>
11 #include <model_server/lib/toolkit_class_registry.hpp>
12 namespace turi {
13 
14 /**
15  * \ingroup unity
16  * The arguments used to invoke the toolkit execution.
17  * See \ref toolkit_function_specification for details.
18  */
21  progress = [=](std::string s) {
22  logstream(LOG_INFO) << "PROGRESS: " << s << std::endl;
23  };
24  }
25  /**
26  * The parameters passed to the toolkit from the user.
27  * The options set will be cleaned: every option in
28  * \ref toolkit_function_specification::default_options will show appear here,
29  * and there will not be extraneous options.
30  */
31  variant_map_type params;
32 
33  /**
34  * A pointer to a function which prints execution progress.
35  */
36  std::function<void(std::string)> progress;
37 
38  /**
39  * A pointer to the class registry.
40  */
42 };
43 
44 }
45 
46 #endif
#define logstream(lvl)
Definition: logger.hpp:276
#define LOG_INFO
Definition: logger.hpp:101
std::function< void(std::string)> progress