6 #ifndef TURI_UNITY_GLOBAL_HPP 7 #define TURI_UNITY_GLOBAL_HPP 9 #include <model_server/lib/unity_base_types.hpp> 10 #include <model_server/lib/toolkit_function_specification.hpp> 11 #include <model_server/lib/toolkit_function_registry.hpp> 12 #include <model_server/lib/toolkit_class_registry.hpp> 13 #include <model_server/lib/api/unity_global_interface.hpp> 29 struct so_registration_list {
31 std::string modulename;
32 std::string original_soname;
33 std::string effective_soname;
34 std::vector<std::string> functions;
35 std::vector<std::string> classes;
38 std::map<std::string, so_registration_list> dynamic_loaded_toolkits;
39 variant_map_type load_model_impl(
turi::iarchive& iarc,
bool include_data);
42 static constexpr
char const *
const OLD_CLASS_MAGIC_HEADER =
"GLMODELX";
43 static constexpr
char const *
const CLASS_MAGIC_HEADER =
"TCMODEL0";
65 std::shared_ptr<unity_sgraph_base>
load_graph(std::string fname);
95 variant_map_type
load_model(
const std::string& url);
97 variant_map_type load_model_from_data(std::istream& data);
106 void save_model(std::shared_ptr<model_base> tkclass,
107 const variant_map_type& sidedata,
const std::string& url);
109 void save_model_to_data(std::shared_ptr<model_base> tkclass, std::ostream& out);
120 const variant_map_type& sidedata,
const std::string& url);
163 variant_map_type& arguments);
180 const std::vector<std::string>&
keys,
181 const std::vector<flexible_type>& args);
187 const std::vector<flexible_type>& arg);
199 std::string
__read__(
const std::string& url);
209 void __write__(
const std::string& url,
const std::string& content);
223 bool __chmod__(
const std::string& url,
short mode);
253 std::map<std::string, flexible_type>
list_globals(
bool runtime_modifiable);
299 std::string module_subpath);
flexible_type eval_dict_lambda(const std::string &pylambda_string, const std::vector< std::string > &keys, const std::vector< flexible_type > &args)
std::map< std::string, flexible_type > describe_toolkit_class(std::string class_name)
std::string set_global(std::string key, flexible_type value)
std::string load_toolkit(std::string soname, std::string module_subpath)
std::vector< std::string > list_toolkit_classes()
size_t __get_heap_size__()
void save_model2(const std::string &model_name, const variant_map_type &sidedata, const std::string &url)
The serialization input archive object which, provided with a reference to an istream, will read from the istream, providing deserialization capabilities.
void model_variant_deep_save(const variant_type &var, oarchive &oarc)
flexible_type eval_lambda(const std::string &pylambda_string, const flexible_type &arg)
variant_map_type load_model(const std::string &url)
std::string get_version()
std::set< Key > keys(const std::map< Key, T > &map)
std::vector< std::string > list_toolkit_classes_in_dynamic_module(std::string soname)
std::string get_current_cache_file_location()
boost::make_recursive_variant< flexible_type, std::shared_ptr< unity_sgraph_base >, dataframe_t, std::shared_ptr< model_base >, std::shared_ptr< unity_sframe_base >, std::shared_ptr< unity_sarray_base >, std::map< std::string, boost::recursive_variant_ >, std::vector< boost::recursive_variant_ >, boost::recursive_wrapper< function_closure_info > >::type variant_type
std::vector< std::string > list_toolkit_functions()
std::string __read__(const std::string &url)
unity_global(toolkit_function_registry *_toolkit_functions, toolkit_class_registry *_classes)
std::string get_turicreate_object_type(const std::string &url)
std::vector< std::string > list_toolkit_functions_in_dynamic_module(std::string soname)
void set_log_level(size_t)
toolkit_function_registry * get_toolkit_function_registry()
void save_model(std::shared_ptr< model_base > tkclass, const variant_map_type &sidedata, const std::string &url)
std::shared_ptr< unity_sarray_base > create_sequential_sarray(ssize_t size, ssize_t start, bool reverse)
void __write__(const std::string &url, const std::string &content)
toolkit_function_response_type run_toolkit(std::string toolkit_name, variant_map_type &arguments)
bool __mkdir__(const std::string &url)
size_t __get_allocated_size__()
std::map< std::string, flexible_type > describe_toolkit_function(std::string toolkitname)
std::map< std::string, flexible_type > list_globals(bool runtime_modifiable)
toolkit_class_registry * get_toolkit_class_registry()
The serialization output archive object which, provided with a reference to an ostream, will write to the ostream, providing serialization capabilities.
bool __chmod__(const std::string &url, short mode)
std::string get_graph_dag()
void model_variant_deep_load(variant_type &var, iarchive &iarc)
std::vector< flexible_type > parallel_eval_lambda(const std::string &pylambda_string, const std::vector< flexible_type > &arg)
std::shared_ptr< model_base > create_toolkit_class(std::string class_name)
std::shared_ptr< unity_sgraph_base > load_graph(std::string fname)