Turi Create  4.0
unity_global_interface.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_CLIENT_GLOBAL_HPP
7 #define TURI_UNITY_CLIENT_GLOBAL_HPP
8 #include <memory>
9 #include <vector>
10 #include <string>
11 #include <map>
12 #include <model_server/lib/api/unity_sarray_interface.hpp>
13 #include <model_server/lib/api/unity_graph_interface.hpp>
14 #include <model_server/lib/toolkit_function_response.hpp>
15 #include <model_server/lib/api/client_base_types.hpp>
16 #include <core/system/cppipc/magic_macros.hpp>
17 
18 namespace turi {
19 
20 
21 #if DOXYGEN_DOCUMENTATION
22 // Doxygen fake documentation
23 
24 /**
25  * \ingroup unity
26  * The \ref turi::unity_global and \ref turi::unity_global_base classes
27  * implement a singleton object on the server side which is exposed to the
28  * client via the cppipc system. This singleton object provides other
29  * miscellaneous uncategorized services (global functions) to the python layer.
30  * See \ref turi::unity_global for detailed documentation of the functions.
31  */
33  public:
34  std::vector<std::string> list_toolkit_functions();
35  std::string get_version();
36  std::string get_graph_dag();
37 
38  toolkit_function_response_type run_toolkit(std::string name, variant_map_type& opts);
39 
40  std::shared_ptr<unity_sgraph_base> load_graph(std::string file);
41 };
42 #endif
43 
44 typedef std::map<std::string, flexible_type> global_configuration_type;
45 
47  (std::vector<std::string>, list_toolkit_functions, )
48  (std::vector<std::string>, list_toolkit_classes, )
49  (global_configuration_type, describe_toolkit_function, (std::string))
50  (global_configuration_type, describe_toolkit_class, (std::string))
51  (std::shared_ptr<model_base>, create_toolkit_class, (std::string))
52  (std::string, get_version, )
53  (std::string, get_graph_dag, )
54  (toolkit_function_response_type, run_toolkit, (std::string)(variant_map_type&))
55  (std::shared_ptr<unity_sgraph_base>, load_graph, (std::string))
56  (variant_map_type, load_model, (const std::string&))
57  (void, save_model, (std::shared_ptr<model_base>)(const variant_map_type&)(const std::string&))
58  (void, save_model2, (const std::string&)(const variant_map_type&)(const std::string&))
59  (flexible_type, eval_lambda, (const std::string&)(const flexible_type&))
60  (flexible_type, eval_dict_lambda, (const std::string&)(const std::vector<std::string>&)(const std::vector<flexible_type>&))
61  (std::vector<flexible_type>, parallel_eval_lambda, (const std::string&)(const std::vector<flexible_type>&))
62  (std::string, __read__, (const std::string&))
63  (void, __write__, (const std::string&)(const std::string&))
64  (bool, __mkdir__, (const std::string&))
65  (bool, __chmod__, (const std::string&)(short))
66  (size_t, __get_heap_size__, )
67  (size_t, __get_allocated_size__, )
68  (void, set_log_level, (size_t))
69  (global_configuration_type, list_globals, (bool))
70  (std::string, set_global, (std::string)(flexible_type))
71  (std::shared_ptr<unity_sarray_base>, create_sequential_sarray, (ssize_t)(ssize_t)(bool))
72  (std::string, load_toolkit, (std::string)(std::string))
73  (std::vector<std::string>, list_toolkit_functions_in_dynamic_module, (std::string))
74  (std::vector<std::string>, list_toolkit_classes_in_dynamic_module, (std::string))
75  (std::string, get_current_cache_file_location, )
76  (std::string, get_turicreate_object_type, (const std::string&))
77  )
78 } // namespace turi
79 
80 #endif // TURI_UNITY_CLIENT_GLOBALS_HPP
set_global_error_codes set_global(std::string name, flexible_type val)
#define GENERATE_INTERFACE_AND_PROXY(base_name, proxy_name, functions)