From 5a99b18cad24d9e9cb06a6558754a1b56b1dab76 Mon Sep 17 00:00:00 2001 From: Hu Yueh-Wei Date: Thu, 5 Dec 2024 09:38:20 +0800 Subject: [PATCH] chore: organize the internal APIs of the C++ binding to ensure they are all private (#368) * chore: organize the internal APIs of the C++ binding to ensure they are all private * chore: organize the internal APIs of the C++ binding to ensure they are all private * chore: organize the internal APIs of the C++ binding to ensure they are all private --- .vscode/launch.json | 4 +- .../ten_runtime/binding/cpp/detail/addon.h | 16 ++++-- .../binding/cpp/detail/addon_manager.h | 6 ++- .../binding/cpp/detail/extension.h | 15 ++++-- .../ten_runtime/binding/cpp/detail/ten_env.h | 54 +++++++++---------- .../binding/cpp/detail/ten_env_impl.h | 5 +- .../binding/cpp/detail/ten_env_proxy.h | 39 ++------------ .../cpp/detail/ten_env_internal_accessor.h | 28 +++------- .../py_init_extension_cpp/src/main.cc | 12 +++-- .../simple_http_server_cpp/src/main.cc | 8 +-- .../cmd_conversion/cmd_conversion_data.cc | 4 +- .../cmd_conversion/cmd_conversion_graph.cc | 4 +- .../cmd_conversion_graph_default_uri.cc | 4 +- .../cmd_conversion/cmd_conversion_path.cc | 4 +- .../cmd_conversion_path_array_1.cc | 4 +- .../cmd_conversion_path_array_2.cc | 4 +- .../cmd_conversion_path_array_3.cc | 4 +- .../cmd_conversion_path_array_4.cc | 4 +- .../cmd_conversion_path_array_5.cc | 4 +- .../cmd_conversion_path_array_6.cc | 4 +- .../cmd_conversion_path_array_7.cc | 4 +- .../cmd_conversion_path_keep_original.cc | 4 +- .../cmd_conversion_path_nested_1.cc | 4 +- .../cmd_conversion_path_nested_2.cc | 4 +- .../cmd_conversion_path_nested_3.cc | 4 +- .../cmd_conversion_path_nested_4.cc | 4 +- .../cmd_conversion_path_nested_5.cc | 5 +- .../cmd_conversion_path_nested_6.cc | 4 +- .../command/command_check_cmd_out.cc | 4 +- .../smoke/extension_test/dest/specify_dest.cc | 5 +- .../engine/batch_send_msgs_in_migration.cc | 4 +- .../wrong_engine_then_correct_in_migration.cc | 4 +- .../error/failed_to_connect_to_remote.cc | 4 +- .../http_server_extension_close_app.cc | 4 +- .../http_server_extension_two_extensions.cc | 4 +- .../predefined_graph_basic_1.cc | 4 +- .../predefined_graph_basic_2.cc | 4 +- .../predefined_graph_engine_own_eventloop.cc | 4 +- .../predefined_graph_multi_app.cc | 4 +- .../predefined_graph_multi_extension_1.cc | 4 +- .../predefined_graph_multi_extension_2.cc | 4 +- .../predefined_graph_multi_extension_3.cc | 4 +- .../predefined_graph_multi_extension_4.cc | 4 +- .../predefined_graph_no_auto_start.cc | 4 +- ...fined_graph_two_standalone_extensions_1.cc | 4 +- ...fined_graph_two_standalone_extensions_2.cc | 4 +- .../start_graph_and_communicate.cc | 4 +- .../start_graph/start_graph_from_extension.cc | 4 +- .../start_predefined_graph_cross_app.cc | 4 +- .../start_predefined_graph_from_extension.cc | 4 +- .../start_two_predefined_graphs.cc | 4 +- .../interface_out_cmd_in_schema.cc | 5 +- .../interface_out_cmd_not_in_schema.cc | 5 +- .../interface_out_result_error.cc | 10 ++-- tests/ten_runtime/smoke/msg_test/msg_10.cc | 4 +- tests/ten_runtime/smoke/msg_test/msg_12.cc | 4 +- tests/ten_runtime/smoke/msg_test/msg_13.cc | 4 +- tests/ten_runtime/smoke/msg_test/msg_9.cc | 4 +- .../notify_test/member_func_in_lambda_3.cc | 4 +- .../smoke/notify_test/normal_func.cc | 3 +- .../notify_test/normal_func_with_user_data.cc | 3 +- .../property/property_access_app_store.cc | 4 +- .../property_access_app_store_async.cc | 4 +- .../smoke/property/property_all.cc | 8 +-- .../smoke/property/property_connect_cmd.cc | 4 +- .../smoke/property/property_extension.cc | 9 ++-- .../smoke/property/property_get_float64.cc | 4 +- ...property_get_float64_type_but_int_value.cc | 4 +- .../smoke/property/property_get_int32.cc | 4 +- .../property/property_in_graph_use_env_1.cc | 4 +- .../property/property_in_graph_use_env_2.cc | 4 +- .../smoke/property/property_prebuilt_graph.cc | 4 +- .../smoke/property/property_set_float32.cc | 8 +-- .../smoke/property/property_set_int32.cc | 8 +-- .../result_conversion/result_conversion_1.cc | 4 +- .../schema_cmd_property_required.cc | 8 +-- .../smoke/schema_test/schema_cmd_result.cc | 8 +-- .../schema_test/schema_cmd_result_error.cc | 8 +-- .../smoke/schema_test/schema_data_prop.cc | 8 +-- .../smoke/schema_test/schema_on_cmd.cc | 8 +-- .../smoke/schema_test/schema_send_cmd.cc | 4 +- .../schema_set_extension_property.cc | 4 +- .../schema_test/schema_set_property_buf.cc | 4 +- .../schema_test/schema_set_property_ptr.cc | 4 +- 84 files changed, 250 insertions(+), 278 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 3496e31392..8984668049 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -440,9 +440,9 @@ "name": "app (C/C++) (lldb, launch)", "type": "lldb", "request": "launch", - "program": "${workspaceFolder}/out/linux/x64/tests/ten_runtime/integration/cpp/hello_world/hello_world_app/bin/hello_world_app_source", + "program": "${workspaceFolder}/out/linux/x64/tests/ten_runtime/integration/cpp/check_start_graph/check_start_graph_app/bin/check_start_graph_source", "args": [], - "cwd": "${workspaceFolder}/out/linux/x64/tests/ten_runtime/integration/cpp/hello_world/hello_world_app", + "cwd": "${workspaceFolder}/out/linux/x64/tests/ten_runtime/integration/cpp/check_start_graph/check_start_graph_app", "env": { "ASAN_OPTIONS": "use_sigaltstack=0", }, diff --git a/core/include/ten_runtime/binding/cpp/detail/addon.h b/core/include/ten_runtime/binding/cpp/detail/addon.h index cb3f33c2c7..6eb0a6148f 100644 --- a/core/include/ten_runtime/binding/cpp/detail/addon.h +++ b/core/include/ten_runtime/binding/cpp/detail/addon.h @@ -43,11 +43,6 @@ class addon_t { addon_t &operator=(const addon_t &&) = delete; // @} - // @{ - // Internal use only. - ::ten_addon_t *get_c_addon() const { return c_addon; } - // @} - protected: virtual void on_init(ten_env_t &ten_env) { ten_env.on_init_done(); } @@ -62,6 +57,10 @@ class addon_t { ten_addon_t *c_addon; ten_env_t *cpp_ten_env{}; + friend class addon_internal_accessor_t; + + ::ten_addon_t *get_c_addon() const { return c_addon; } + virtual void on_create_instance_impl(ten_env_t &ten_env, const char *name, void *context) = 0; @@ -202,6 +201,13 @@ struct addon_context_t { } // namespace +class addon_internal_accessor_t { + public: + static ::ten_addon_t *get_c_addon(const addon_t *addon) { + return addon->get_c_addon(); + } +}; + class extension_addon_t : public addon_t { private: void on_create_instance_impl(ten_env_t &ten_env, const char *name, diff --git a/core/include/ten_runtime/binding/cpp/detail/addon_manager.h b/core/include/ten_runtime/binding/cpp/detail/addon_manager.h index ebdcc392f8..4c34a65e30 100644 --- a/core/include/ten_runtime/binding/cpp/detail/addon_manager.h +++ b/core/include/ten_runtime/binding/cpp/detail/addon_manager.h @@ -31,8 +31,10 @@ ten_path_get_module_path(/* NOLINTNEXTLINE */ \ (void *) \ ____ten_addon_##NAME##_register_handler__); \ - ten_addon_register_extension(#NAME, ten_string_get_raw_str(base_dir), \ - addon_instance->get_c_addon(), register_ctx); \ + ten_addon_register_extension( \ + #NAME, ten_string_get_raw_str(base_dir), \ + ten::addon_internal_accessor_t::get_c_addon(addon_instance), \ + register_ctx); \ ten_string_destroy(base_dir); \ } \ TEN_CONSTRUCTOR(____ten_addon_##NAME##_registrar____) { \ diff --git a/core/include/ten_runtime/binding/cpp/detail/extension.h b/core/include/ten_runtime/binding/cpp/detail/extension.h index f312e715c0..fcac60465c 100644 --- a/core/include/ten_runtime/binding/cpp/detail/extension.h +++ b/core/include/ten_runtime/binding/cpp/detail/extension.h @@ -55,11 +55,6 @@ class extension_t { extension_t &operator=(const extension_t &&) = delete; // @} - // @{ - // Internal use only. - ::ten_extension_t *get_c_extension() const { return c_extension; } - // @} - protected: explicit extension_t(const std::string &name) : // In order to keep type safety in C++, the type of the 'ten' @@ -125,6 +120,9 @@ class extension_t { private: friend class ten_env_t; friend class extension_group_t; + friend class extension_internal_accessor_t; + + ::ten_extension_t *get_c_extension() const { return c_extension; } using cpp_extension_on_cmd_func_t = void (extension_t:: *)(ten_env_t &, std::unique_ptr); @@ -532,4 +530,11 @@ class extension_t { ten_env_t *cpp_ten_env; }; +class extension_internal_accessor_t { + public: + static ::ten_extension_t *get_c_extension(const extension_t *extension) { + return extension->get_c_extension(); + } +}; + } // namespace ten diff --git a/core/include/ten_runtime/binding/cpp/detail/ten_env.h b/core/include/ten_runtime/binding/cpp/detail/ten_env.h index 3113e45609..7794af348b 100644 --- a/core/include/ten_runtime/binding/cpp/detail/ten_env.h +++ b/core/include/ten_runtime/binding/cpp/detail/ten_env.h @@ -201,25 +201,6 @@ class ten_env_t { return rc; } - static void proxy_handle_return_error(::ten_env_t *ten_env, void *user_data, - ::ten_error_t *err) { - TEN_ASSERT(ten_env, "Should not happen."); - - auto *error_handler = static_cast(user_data); - auto *cpp_ten_env = - static_cast(ten_binding_handle_get_me_in_target_lang( - reinterpret_cast(ten_env))); - - if (err != nullptr) { - error_t cpp_err(err, false); - (*error_handler)(*cpp_ten_env, &cpp_err); - } else { - (*error_handler)(*cpp_ten_env, nullptr); - } - - delete error_handler; - } - // If the 'cmd' has already been a command in the backward path, a extension // could use this API to return the 'cmd' further. bool return_result_directly(std::unique_ptr &&cmd, @@ -736,14 +717,6 @@ class ten_env_t { return rc; } - void *get_attached_target(error_t *err = nullptr) { - TEN_ASSERT(c_ten_env, "Should not happen."); - - return ten_binding_handle_get_me_in_target_lang( - reinterpret_cast( - ten_env_get_attached_target(c_ten_env))); - } - #define TEN_ENV_LOG_VERBOSE(ten_env, msg) \ do { \ (ten_env).log(TEN_LOG_LEVEL_VERBOSE, __func__, __FILE__, __LINE__, (msg)); \ @@ -804,8 +777,35 @@ class ten_env_t { ::ten_env_t *get_c_ten_env() { return c_ten_env; } + void *get_attached_target(error_t *err = nullptr) { + TEN_ASSERT(c_ten_env, "Should not happen."); + + return ten_binding_handle_get_me_in_target_lang( + reinterpret_cast( + ten_env_get_attached_target(c_ten_env))); + } + bool init_manifest_from_json(const char *json_str, error_t *err); + static void proxy_handle_return_error(::ten_env_t *ten_env, void *user_data, + ::ten_error_t *err) { + TEN_ASSERT(ten_env, "Should not happen."); + + auto *error_handler = static_cast(user_data); + auto *cpp_ten_env = + static_cast(ten_binding_handle_get_me_in_target_lang( + reinterpret_cast(ten_env))); + + if (err != nullptr) { + error_t cpp_err(err, false); + (*error_handler)(*cpp_ten_env, &cpp_err); + } else { + (*error_handler)(*cpp_ten_env, nullptr); + } + + delete error_handler; + } + bool send_cmd_internal(std::unique_ptr &&cmd, result_handler_func_t &&result_handler = nullptr, bool is_ex = false, error_t *err = nullptr) { diff --git a/core/include/ten_runtime/binding/cpp/detail/ten_env_impl.h b/core/include/ten_runtime/binding/cpp/detail/ten_env_impl.h index c1110ba2da..f13e32b554 100644 --- a/core/include/ten_runtime/binding/cpp/detail/ten_env_impl.h +++ b/core/include/ten_runtime/binding/cpp/detail/ten_env_impl.h @@ -6,8 +6,6 @@ // #pragma once -#include - #include "ten_runtime/binding/cpp/detail/addon.h" #include "ten_runtime/binding/cpp/detail/extension.h" #include "ten_runtime/binding/cpp/detail/ten_env.h" @@ -27,7 +25,8 @@ inline bool ten_env_t::on_create_instance_done(void *instance, void *context, switch (cpp_context->task) { case ADDON_TASK_CREATE_EXTENSION: - c_instance = static_cast(instance)->get_c_extension(); + c_instance = extension_internal_accessor_t::get_c_extension( + static_cast(instance)); break; default: TEN_ASSERT(0, "Should not happen."); diff --git a/core/include/ten_runtime/binding/cpp/detail/ten_env_proxy.h b/core/include/ten_runtime/binding/cpp/detail/ten_env_proxy.h index 6886bf7bcf..c8db43f31b 100644 --- a/core/include/ten_runtime/binding/cpp/detail/ten_env_proxy.h +++ b/core/include/ten_runtime/binding/cpp/detail/ten_env_proxy.h @@ -102,7 +102,7 @@ class ten_env_proxy_t { ten_env_proxy_t &operator=(ten_env_proxy_t &&other) = delete; // @} - bool acquire_lock_mode(error_t *err) { + bool acquire_lock_mode(error_t *err = nullptr) { if (c_ten_env_proxy == nullptr) { TEN_ASSERT(0, "Invalid argument."); return false; @@ -112,9 +112,7 @@ class ten_env_proxy_t { c_ten_env_proxy, err != nullptr ? err->get_c_error() : nullptr); } - bool acquire_lock_mode() { return acquire_lock_mode(nullptr); } - - bool release_lock_mode(error_t *err) { + bool release_lock_mode(error_t *err = nullptr) { if (c_ten_env_proxy == nullptr) { TEN_ASSERT(0, "Invalid argument."); return false; @@ -124,9 +122,8 @@ class ten_env_proxy_t { c_ten_env_proxy, err != nullptr ? err->get_c_error() : nullptr); } - bool release_lock_mode() { return release_lock_mode(nullptr); } - - bool notify(notify_std_func_t &¬ify_func, bool sync, error_t *err) { + bool notify(notify_std_func_t &¬ify_func, bool sync = false, + error_t *err = nullptr) { auto *info = new proxy_notify_info_t(std::move(notify_func)); auto rc = @@ -139,20 +136,8 @@ class ten_env_proxy_t { return rc; } - bool notify(notify_std_func_t &¬ify_func, bool sync) { - return notify(std::move(notify_func), sync, nullptr); - } - - bool notify(notify_std_func_t &¬ify_func, error_t *err) { - return notify(std::move(notify_func), false, err); - } - - bool notify(notify_std_func_t &¬ify_func) { - return notify(std::move(notify_func), false, nullptr); - } - bool notify(notify_std_with_user_data_func_t &¬ify_func, void *user_data, - bool sync, error_t *err) { + bool sync = false, error_t *err = nullptr) { auto *info = new proxy_notify_info_t(std::move(notify_func), user_data); auto rc = @@ -165,20 +150,6 @@ class ten_env_proxy_t { return rc; } - bool notify(notify_std_with_user_data_func_t &¬ify_func, void *user_data, - bool sync) { - return notify(std::move(notify_func), user_data, sync, nullptr); - } - - bool notify(notify_std_with_user_data_func_t &¬ify_func, void *user_data, - error_t *err) { - return notify(std::move(notify_func), user_data, false, err); - } - - bool notify(notify_std_with_user_data_func_t &¬ify_func, void *user_data) { - return notify(std::move(notify_func), user_data, false, nullptr); - } - private: ::ten_env_proxy_t *c_ten_env_proxy; diff --git a/core/include_internal/ten_runtime/binding/cpp/detail/ten_env_internal_accessor.h b/core/include_internal/ten_runtime/binding/cpp/detail/ten_env_internal_accessor.h index 0a4048a761..9b4287daa8 100644 --- a/core/include_internal/ten_runtime/binding/cpp/detail/ten_env_internal_accessor.h +++ b/core/include_internal/ten_runtime/binding/cpp/detail/ten_env_internal_accessor.h @@ -12,30 +12,18 @@ namespace ten { class ten_env_internal_accessor_t { public: - explicit ten_env_internal_accessor_t(ten_env_t *ten_env) : ten_env(ten_env) {} - ~ten_env_internal_accessor_t() = default; - - // @{ - ten_env_internal_accessor_t(const ten_env_internal_accessor_t &) = delete; - ten_env_internal_accessor_t(ten_env_internal_accessor_t &&) = delete; - ten_env_internal_accessor_t &operator=(const ten_env_internal_accessor_t &) = - delete; - ten_env_internal_accessor_t &operator=(ten_env_internal_accessor_t &&) = - delete; - // @} - - bool init_manifest_from_json(const char *json_str, error_t *err) { - return ten_env->init_manifest_from_json(json_str, err); + static bool init_manifest_from_json(ten_env_t &ten_env, const char *json_str, + error_t *err = nullptr) { + return ten_env.init_manifest_from_json(json_str, err); } - bool init_manifest_from_json(const char *json_str) { - return ten_env->init_manifest_from_json(json_str, nullptr); + static ::ten_env_t *get_c_ten_env(ten_env_t &ten_env) { + return ten_env.get_c_ten_env(); } - ::ten_env_t *get_c_ten_env() const { return ten_env->get_c_ten_env(); } - - private: - ten_env_t *ten_env; + static void *get_attached_target(ten_env_t &ten_env, error_t *err = nullptr) { + return ten_env.get_attached_target(err); + } }; } // namespace ten diff --git a/packages/core_extensions/py_init_extension_cpp/src/main.cc b/packages/core_extensions/py_init_extension_cpp/src/main.cc index 07d92f5ca8..15f1db77d8 100644 --- a/packages/core_extensions/py_init_extension_cpp/src/main.cc +++ b/packages/core_extensions/py_init_extension_cpp/src/main.cc @@ -14,6 +14,7 @@ #include "include_internal/ten_runtime/metadata/manifest.h" #include "include_internal/ten_runtime/ten_env/ten_env.h" #include "ten_runtime/addon/addon_manager.h" +#include "ten_runtime/binding/cpp/detail/addon.h" #include "ten_runtime/binding/cpp/detail/ten_env.h" #include "ten_runtime/binding/cpp/ten.h" #include "ten_utils/container/list_str.h" @@ -262,8 +263,8 @@ class py_init_addon_t : public ten::addon_t { // can perform. Through a private API, it accesses the C `ten_env_t`, // enabling special operations that only TEN framework developers are // allowed to execute. - ten::ten_env_internal_accessor_t ten_env_internal_accessor(&ten_env); - ten_env_t *c_ten_env = ten_env_internal_accessor.get_c_ten_env(); + ten_env_t *c_ten_env = + ten::ten_env_internal_accessor_t::get_c_ten_env(ten_env); auto *c_app = static_cast( c_ten_env->attached_target.addon_host->user_data); TEN_ASSERT(c_app, "Should not happen."); @@ -435,9 +436,10 @@ static void ____ten_addon_py_init_extension_cpp_register_handler____( ten_path_get_module_path(/* NOLINTNEXTLINE */ (void *) ____ten_addon_py_init_extension_cpp_register_handler____); - ten_addon_register_extension("py_init_extension_cpp", - ten_string_get_raw_str(base_dir), - addon_instance->get_c_addon(), register_ctx); + ten_addon_register_extension( + "py_init_extension_cpp", ten_string_get_raw_str(base_dir), + ten::addon_internal_accessor_t::get_c_addon(addon_instance), + register_ctx); ten_string_destroy(base_dir); } diff --git a/packages/example_extensions/simple_http_server_cpp/src/main.cc b/packages/example_extensions/simple_http_server_cpp/src/main.cc index d7b65e4a2e..ef1a23e8c0 100644 --- a/packages/example_extensions/simple_http_server_cpp/src/main.cc +++ b/packages/example_extensions/simple_http_server_cpp/src/main.cc @@ -12,8 +12,8 @@ #include #include +#include "include_internal/ten_runtime/binding/cpp/ten.h" #include "include_internal/ten_utils/lib/buf.h" -#include "ten_runtime/binding/cpp/ten.h" #include "ten_utils/lib/buf.h" #define DEFAULT_BUF_CAPACITY 512 @@ -648,7 +648,8 @@ void send_ten_msg_with_req_body( } auto *ext = static_cast( - ten_env.get_attached_target()); + ten::ten_env_internal_accessor_t::get_attached_target( + ten_env)); assert(ext && "Failed to get the attached extension."); if (!ext->is_stopping) { @@ -687,7 +688,8 @@ void send_ten_msg_without_req_body( } auto *ext = static_cast( - ten_env.get_attached_target()); + ten::ten_env_internal_accessor_t::get_attached_target( + ten_env)); assert(ext && "Failed to get the attached extension."); if (!ext->is_stopping) { diff --git a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_data.cc b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_data.cc index abc9a1ad36..88442ee929 100644 --- a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_data.cc +++ b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_data.cc @@ -75,8 +75,8 @@ class test_extension_2 : public ten::extension_t { class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { - ten::ten_env_internal_accessor_t ten_env_internal_accessor(&ten_env); - bool rc = ten_env_internal_accessor.init_manifest_from_json( + bool rc = ten::ten_env_internal_accessor_t::init_manifest_from_json( + ten_env, // clang-format off R"###({ "type": "app", diff --git a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_graph.cc b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_graph.cc index fcfe3e5c64..dcfef61869 100644 --- a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_graph.cc +++ b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_graph.cc @@ -45,8 +45,8 @@ class test_extension_2 : public ten::extension_t { class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { - ten::ten_env_internal_accessor_t ten_env_internal_accessor(&ten_env); - bool rc = ten_env_internal_accessor.init_manifest_from_json( + bool rc = ten::ten_env_internal_accessor_t::init_manifest_from_json( + ten_env, // clang-format off R"###({ "type": "app", diff --git a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_graph_default_uri.cc b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_graph_default_uri.cc index e8b57e814f..54e92c4cb2 100644 --- a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_graph_default_uri.cc +++ b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_graph_default_uri.cc @@ -44,8 +44,8 @@ class test_extension_2 : public ten::extension_t { class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { - ten::ten_env_internal_accessor_t ten_env_internal_accessor(&ten_env); - bool rc = ten_env_internal_accessor.init_manifest_from_json( + bool rc = ten::ten_env_internal_accessor_t::init_manifest_from_json( + ten_env, // clang-format off R"###({ "type": "app", diff --git a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path.cc b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path.cc index 6e106be2a5..14837f1fe7 100644 --- a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path.cc +++ b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path.cc @@ -48,8 +48,8 @@ class test_extension_2 : public ten::extension_t { class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { - ten::ten_env_internal_accessor_t ten_env_internal_accessor(&ten_env); - bool rc = ten_env_internal_accessor.init_manifest_from_json( + bool rc = ten::ten_env_internal_accessor_t::init_manifest_from_json( + ten_env, // clang-format off R"###({ "type": "app", diff --git a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_array_1.cc b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_array_1.cc index 946c49f123..8d07718803 100644 --- a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_array_1.cc +++ b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_array_1.cc @@ -48,8 +48,8 @@ class test_extension_2 : public ten::extension_t { class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { - ten::ten_env_internal_accessor_t ten_env_internal_accessor(&ten_env); - bool rc = ten_env_internal_accessor.init_manifest_from_json( + bool rc = ten::ten_env_internal_accessor_t::init_manifest_from_json( + ten_env, // clang-format off R"###({ "type": "app", diff --git a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_array_2.cc b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_array_2.cc index 57e449fba3..fd2d2d6a92 100644 --- a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_array_2.cc +++ b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_array_2.cc @@ -50,8 +50,8 @@ class test_extension_2 : public ten::extension_t { class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { - ten::ten_env_internal_accessor_t ten_env_internal_accessor(&ten_env); - bool rc = ten_env_internal_accessor.init_manifest_from_json( + bool rc = ten::ten_env_internal_accessor_t::init_manifest_from_json( + ten_env, // clang-format off R"###({ "type": "app", diff --git a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_array_3.cc b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_array_3.cc index 6ddb21f038..41bb2be09c 100644 --- a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_array_3.cc +++ b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_array_3.cc @@ -51,8 +51,8 @@ class test_extension_2 : public ten::extension_t { class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { - ten::ten_env_internal_accessor_t ten_env_internal_accessor(&ten_env); - bool rc = ten_env_internal_accessor.init_manifest_from_json( + bool rc = ten::ten_env_internal_accessor_t::init_manifest_from_json( + ten_env, R"###({ "type": "app", "name": "test_app", diff --git a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_array_4.cc b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_array_4.cc index ad59bfd2bd..eebd4746f4 100644 --- a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_array_4.cc +++ b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_array_4.cc @@ -51,8 +51,8 @@ class test_extension_2 : public ten::extension_t { class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { - ten::ten_env_internal_accessor_t ten_env_internal_accessor(&ten_env); - bool rc = ten_env_internal_accessor.init_manifest_from_json( + bool rc = ten::ten_env_internal_accessor_t::init_manifest_from_json( + ten_env, // clang-format off R"###({ "type": "app", diff --git a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_array_5.cc b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_array_5.cc index 66b8323e56..1ce5497cc4 100644 --- a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_array_5.cc +++ b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_array_5.cc @@ -51,8 +51,8 @@ class test_extension_2 : public ten::extension_t { class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { - ten::ten_env_internal_accessor_t ten_env_internal_accessor(&ten_env); - bool rc = ten_env_internal_accessor.init_manifest_from_json( + bool rc = ten::ten_env_internal_accessor_t::init_manifest_from_json( + ten_env, // clang-format off R"###({ "type": "app", diff --git a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_array_6.cc b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_array_6.cc index 2664da2008..5c24a8fd32 100644 --- a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_array_6.cc +++ b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_array_6.cc @@ -51,8 +51,8 @@ class test_extension_2 : public ten::extension_t { class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { - ten::ten_env_internal_accessor_t ten_env_internal_accessor(&ten_env); - bool rc = ten_env_internal_accessor.init_manifest_from_json( + bool rc = ten::ten_env_internal_accessor_t::init_manifest_from_json( + ten_env, // clang-format off R"###({ "type": "app", diff --git a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_array_7.cc b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_array_7.cc index 4708e96bcc..aa4e6a2f7f 100644 --- a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_array_7.cc +++ b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_array_7.cc @@ -51,8 +51,8 @@ class test_extension_2 : public ten::extension_t { class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { - ten::ten_env_internal_accessor_t ten_env_internal_accessor(&ten_env); - bool rc = ten_env_internal_accessor.init_manifest_from_json( + bool rc = ten::ten_env_internal_accessor_t::init_manifest_from_json( + ten_env, // clang-format off R"###({ "type": "app", diff --git a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_keep_original.cc b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_keep_original.cc index 60b9f12986..bf975e2462 100644 --- a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_keep_original.cc +++ b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_keep_original.cc @@ -50,8 +50,8 @@ class test_extension_2 : public ten::extension_t { class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { - ten::ten_env_internal_accessor_t ten_env_internal_accessor(&ten_env); - bool rc = ten_env_internal_accessor.init_manifest_from_json( + bool rc = ten::ten_env_internal_accessor_t::init_manifest_from_json( + ten_env, // clang-format off R"###({ "type": "app", diff --git a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_nested_1.cc b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_nested_1.cc index 18207089cf..1345d570f2 100644 --- a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_nested_1.cc +++ b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_nested_1.cc @@ -50,8 +50,8 @@ class test_extension_2 : public ten::extension_t { class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { - ten::ten_env_internal_accessor_t ten_env_internal_accessor(&ten_env); - bool rc = ten_env_internal_accessor.init_manifest_from_json( + bool rc = ten::ten_env_internal_accessor_t::init_manifest_from_json( + ten_env, // clang-format off R"###({ "type": "app", diff --git a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_nested_2.cc b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_nested_2.cc index 819d5ce5ec..3bca8e8bf2 100644 --- a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_nested_2.cc +++ b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_nested_2.cc @@ -50,8 +50,8 @@ class test_extension_2 : public ten::extension_t { class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { - ten::ten_env_internal_accessor_t ten_env_internal_accessor(&ten_env); - bool rc = ten_env_internal_accessor.init_manifest_from_json( + bool rc = ten::ten_env_internal_accessor_t::init_manifest_from_json( + ten_env, // clang-format off R"###({ "type": "app", diff --git a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_nested_3.cc b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_nested_3.cc index 798c89c18d..06e30ae196 100644 --- a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_nested_3.cc +++ b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_nested_3.cc @@ -50,8 +50,8 @@ class test_extension_2 : public ten::extension_t { class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { - ten::ten_env_internal_accessor_t ten_env_internal_accessor(&ten_env); - bool rc = ten_env_internal_accessor.init_manifest_from_json( + bool rc = ten::ten_env_internal_accessor_t::init_manifest_from_json( + ten_env, // clang-format off R"###({ "type": "app", diff --git a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_nested_4.cc b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_nested_4.cc index 9150f7cf63..863a369169 100644 --- a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_nested_4.cc +++ b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_nested_4.cc @@ -50,8 +50,8 @@ class test_extension_2 : public ten::extension_t { class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { - ten::ten_env_internal_accessor_t ten_env_internal_accessor(&ten_env); - bool rc = ten_env_internal_accessor.init_manifest_from_json( + bool rc = ten::ten_env_internal_accessor_t::init_manifest_from_json( + ten_env, // clang-format off R"###({ "type": "app", diff --git a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_nested_5.cc b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_nested_5.cc index 8a2361045f..6f277c7f4a 100644 --- a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_nested_5.cc +++ b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_nested_5.cc @@ -51,9 +51,8 @@ class test_extension_2 : public ten::extension_t { class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { - ten::ten_env_internal_accessor_t ten_env_internal_accessor(&ten_env); - - bool rc = ten_env_internal_accessor.init_manifest_from_json( + bool rc = ten::ten_env_internal_accessor_t::init_manifest_from_json( + ten_env, // clang-format off R"###({ "type": "app", diff --git a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_nested_6.cc b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_nested_6.cc index 07fe1c30d8..2f50be676e 100644 --- a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_nested_6.cc +++ b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_nested_6.cc @@ -50,8 +50,8 @@ class test_extension_2 : public ten::extension_t { class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { - ten::ten_env_internal_accessor_t ten_env_internal_accessor(&ten_env); - bool rc = ten_env_internal_accessor.init_manifest_from_json( + bool rc = ten::ten_env_internal_accessor_t::init_manifest_from_json( + ten_env, // clang-format off R"###({ "type": "app", diff --git a/tests/ten_runtime/smoke/extension_test/command/command_check_cmd_out.cc b/tests/ten_runtime/smoke/extension_test/command/command_check_cmd_out.cc index ed9ee3e0dd..4d85c599fd 100644 --- a/tests/ten_runtime/smoke/extension_test/command/command_check_cmd_out.cc +++ b/tests/ten_runtime/smoke/extension_test/command/command_check_cmd_out.cc @@ -47,8 +47,8 @@ class test_extension_2 : public ten::extension_t { class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { - ten::ten_env_internal_accessor_t ten_env_internal_accessor(&ten_env); - bool rc = ten_env_internal_accessor.init_manifest_from_json( + bool rc = ten::ten_env_internal_accessor_t::init_manifest_from_json( + ten_env, // clang-format off R"({ "type": "app", diff --git a/tests/ten_runtime/smoke/extension_test/dest/specify_dest.cc b/tests/ten_runtime/smoke/extension_test/dest/specify_dest.cc index bf3e0d0f38..6c9dea0bc4 100644 --- a/tests/ten_runtime/smoke/extension_test/dest/specify_dest.cc +++ b/tests/ten_runtime/smoke/extension_test/dest/specify_dest.cc @@ -172,8 +172,9 @@ class business_app : public ten::app_t { // The graph merely describes which extensions are included, nothing more. // It does not contain any logic for interaction; all logic for interaction // is written in the code. - ten::ten_env_internal_accessor_t ten_env_internal_accessor(&ten_env); - bool rc = ten_env_internal_accessor.init_manifest_from_json( + + bool rc = ten::ten_env_internal_accessor_t::init_manifest_from_json( + ten_env, // clang-format off R"({ "type": "app", diff --git a/tests/ten_runtime/smoke/extension_test/engine/batch_send_msgs_in_migration.cc b/tests/ten_runtime/smoke/extension_test/engine/batch_send_msgs_in_migration.cc index 9152fb70b5..c4c271ea99 100644 --- a/tests/ten_runtime/smoke/extension_test/engine/batch_send_msgs_in_migration.cc +++ b/tests/ten_runtime/smoke/extension_test/engine/batch_send_msgs_in_migration.cc @@ -27,8 +27,8 @@ class test_migration : public ten::extension_t { class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { - ten::ten_env_internal_accessor_t ten_env_internal_accessor(&ten_env); - bool rc = ten_env_internal_accessor.init_manifest_from_json( + bool rc = ten::ten_env_internal_accessor_t::init_manifest_from_json( + ten_env, // clang-format off R"({ "type": "app", diff --git a/tests/ten_runtime/smoke/extension_test/engine/wrong_engine_then_correct_in_migration.cc b/tests/ten_runtime/smoke/extension_test/engine/wrong_engine_then_correct_in_migration.cc index 44c803fdbe..a86ef6d858 100644 --- a/tests/ten_runtime/smoke/extension_test/engine/wrong_engine_then_correct_in_migration.cc +++ b/tests/ten_runtime/smoke/extension_test/engine/wrong_engine_then_correct_in_migration.cc @@ -28,8 +28,8 @@ class test_migration : public ten::extension_t { class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { - ten::ten_env_internal_accessor_t ten_env_internal_accessor(&ten_env); - bool rc = ten_env_internal_accessor.init_manifest_from_json( + bool rc = ten::ten_env_internal_accessor_t::init_manifest_from_json( + ten_env, // clang-format off R"({ "type": "app", diff --git a/tests/ten_runtime/smoke/extension_test/error/failed_to_connect_to_remote.cc b/tests/ten_runtime/smoke/extension_test/error/failed_to_connect_to_remote.cc index 94dc3da10c..c69da45835 100644 --- a/tests/ten_runtime/smoke/extension_test/error/failed_to_connect_to_remote.cc +++ b/tests/ten_runtime/smoke/extension_test/error/failed_to_connect_to_remote.cc @@ -55,8 +55,8 @@ class test_predefined_graph : public ten::extension_t { class test_app_1 : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { - ten::ten_env_internal_accessor_t ten_env_internal_accessor(&ten_env); - bool rc = ten_env_internal_accessor.init_manifest_from_json( + bool rc = ten::ten_env_internal_accessor_t::init_manifest_from_json( + ten_env, // clang-format off R"({ "type": "app", diff --git a/tests/ten_runtime/smoke/extension_test/http_server_extension/http_server_extension_close_app.cc b/tests/ten_runtime/smoke/extension_test/http_server_extension/http_server_extension_close_app.cc index 360ea1ef5a..543dc3ea56 100644 --- a/tests/ten_runtime/smoke/extension_test/http_server_extension/http_server_extension_close_app.cc +++ b/tests/ten_runtime/smoke/extension_test/http_server_extension/http_server_extension_close_app.cc @@ -39,8 +39,8 @@ TEN_CPP_REGISTER_ADDON_AS_EXTENSION( class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) final { - ten::ten_env_internal_accessor_t ten_env_internal_accessor(&ten_env); - bool rc = ten_env_internal_accessor.init_manifest_from_json( + bool rc = ten::ten_env_internal_accessor_t::init_manifest_from_json( + ten_env, // clang-format off R"({ "type": "app", diff --git a/tests/ten_runtime/smoke/extension_test/http_server_extension/http_server_extension_two_extensions.cc b/tests/ten_runtime/smoke/extension_test/http_server_extension/http_server_extension_two_extensions.cc index 6dc1a00e55..141691bf92 100644 --- a/tests/ten_runtime/smoke/extension_test/http_server_extension/http_server_extension_two_extensions.cc +++ b/tests/ten_runtime/smoke/extension_test/http_server_extension/http_server_extension_two_extensions.cc @@ -38,8 +38,8 @@ TEN_CPP_REGISTER_ADDON_AS_EXTENSION( class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) final { - ten::ten_env_internal_accessor_t ten_env_internal_accessor(&ten_env); - bool rc = ten_env_internal_accessor.init_manifest_from_json( + bool rc = ten::ten_env_internal_accessor_t::init_manifest_from_json( + ten_env, // clang-format off R"({ "type": "app", diff --git a/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_basic_1.cc b/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_basic_1.cc index a4dc14f362..987f9e1b54 100644 --- a/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_basic_1.cc +++ b/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_basic_1.cc @@ -29,8 +29,8 @@ class test_predefined_graph : public ten::extension_t { class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { - ten::ten_env_internal_accessor_t ten_env_internal_accessor(&ten_env); - bool rc = ten_env_internal_accessor.init_manifest_from_json( + bool rc = ten::ten_env_internal_accessor_t::init_manifest_from_json( + ten_env, // clang-format off R"({ "type": "app", diff --git a/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_basic_2.cc b/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_basic_2.cc index ae6b4477db..35db3df29c 100644 --- a/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_basic_2.cc +++ b/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_basic_2.cc @@ -108,8 +108,8 @@ class test_predefined_graph : public ten::extension_t { class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { - ten::ten_env_internal_accessor_t ten_env_internal_accessor(&ten_env); - bool rc = ten_env_internal_accessor.init_manifest_from_json( + bool rc = ten::ten_env_internal_accessor_t::init_manifest_from_json( + ten_env, // clang-format off R"({ "type": "app", diff --git a/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_engine_own_eventloop.cc b/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_engine_own_eventloop.cc index c87bb10f11..59aa18dc9e 100644 --- a/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_engine_own_eventloop.cc +++ b/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_engine_own_eventloop.cc @@ -32,8 +32,8 @@ class test_predefined_graph : public ten::extension_t { class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { - ten::ten_env_internal_accessor_t ten_env_internal_accessor(&ten_env); - bool rc = ten_env_internal_accessor.init_manifest_from_json( + bool rc = ten::ten_env_internal_accessor_t::init_manifest_from_json( + ten_env, // clang-format off R"({ "type": "app", diff --git a/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_multi_app.cc b/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_multi_app.cc index 400fa6f8bb..b3b8ab4c7e 100644 --- a/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_multi_app.cc +++ b/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_multi_app.cc @@ -46,8 +46,8 @@ class test_extension_2 : public ten::extension_t { class test_app_1 : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { - ten::ten_env_internal_accessor_t ten_env_internal_accessor(&ten_env); - bool rc = ten_env_internal_accessor.init_manifest_from_json( + bool rc = ten::ten_env_internal_accessor_t::init_manifest_from_json( + ten_env, // clang-format off R"({ "type": "app", diff --git a/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_multi_extension_1.cc b/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_multi_extension_1.cc index eeb8e6bc3c..f61f967c32 100644 --- a/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_multi_extension_1.cc +++ b/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_multi_extension_1.cc @@ -45,8 +45,8 @@ class test_extension_2 : public ten::extension_t { class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { - ten::ten_env_internal_accessor_t ten_env_internal_accessor(&ten_env); - bool rc = ten_env_internal_accessor.init_manifest_from_json( + bool rc = ten::ten_env_internal_accessor_t::init_manifest_from_json( + ten_env, // clang-format off R"({ "type": "app", diff --git a/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_multi_extension_2.cc b/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_multi_extension_2.cc index afa364b734..7bc5edece7 100644 --- a/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_multi_extension_2.cc +++ b/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_multi_extension_2.cc @@ -46,8 +46,8 @@ class test_extension_2 : public ten::extension_t { class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { - ten::ten_env_internal_accessor_t ten_env_internal_accessor(&ten_env); - bool rc = ten_env_internal_accessor.init_manifest_from_json( + bool rc = ten::ten_env_internal_accessor_t::init_manifest_from_json( + ten_env, // clang-format off R"({ "type": "app", diff --git a/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_multi_extension_3.cc b/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_multi_extension_3.cc index 336699cd06..104c6da9aa 100644 --- a/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_multi_extension_3.cc +++ b/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_multi_extension_3.cc @@ -45,8 +45,8 @@ class test_extension_2 : public ten::extension_t { class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { - ten::ten_env_internal_accessor_t ten_env_internal_accessor(&ten_env); - bool rc = ten_env_internal_accessor.init_manifest_from_json( + bool rc = ten::ten_env_internal_accessor_t::init_manifest_from_json( + ten_env, // clang-format off R"({ "type": "app", diff --git a/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_multi_extension_4.cc b/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_multi_extension_4.cc index 747e4786dd..519bfee9de 100644 --- a/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_multi_extension_4.cc +++ b/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_multi_extension_4.cc @@ -62,8 +62,8 @@ class test_extension_3 : public ten::extension_t { class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { - ten::ten_env_internal_accessor_t ten_env_internal_accessor(&ten_env); - bool rc = ten_env_internal_accessor.init_manifest_from_json( + bool rc = ten::ten_env_internal_accessor_t::init_manifest_from_json( + ten_env, // clang-format off R"({ "type": "app", diff --git a/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_no_auto_start.cc b/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_no_auto_start.cc index 8f9982f273..553e43ad43 100644 --- a/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_no_auto_start.cc +++ b/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_no_auto_start.cc @@ -29,8 +29,8 @@ class test_predefined_graph : public ten::extension_t { class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { - ten::ten_env_internal_accessor_t ten_env_internal_accessor(&ten_env); - bool rc = ten_env_internal_accessor.init_manifest_from_json( + bool rc = ten::ten_env_internal_accessor_t::init_manifest_from_json( + ten_env, // clang-format off R"({ "type": "app", diff --git a/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_two_standalone_extensions_1.cc b/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_two_standalone_extensions_1.cc index 0b20d8f633..ab9d7c89a7 100644 --- a/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_two_standalone_extensions_1.cc +++ b/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_two_standalone_extensions_1.cc @@ -27,8 +27,8 @@ class test_predefined_graph : public ten::extension_t { class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { - ten::ten_env_internal_accessor_t ten_env_internal_accessor(&ten_env); - bool rc = ten_env_internal_accessor.init_manifest_from_json( + bool rc = ten::ten_env_internal_accessor_t::init_manifest_from_json( + ten_env, // clang-format off R"({ "type": "app", diff --git a/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_two_standalone_extensions_2.cc b/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_two_standalone_extensions_2.cc index 8b979dbc30..0c0edad20f 100644 --- a/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_two_standalone_extensions_2.cc +++ b/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_two_standalone_extensions_2.cc @@ -27,8 +27,8 @@ class test_predefined_graph : public ten::extension_t { class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { - ten::ten_env_internal_accessor_t ten_env_internal_accessor(&ten_env); - bool rc = ten_env_internal_accessor.init_manifest_from_json( + bool rc = ten::ten_env_internal_accessor_t::init_manifest_from_json( + ten_env, // clang-format off R"({ "type": "app", diff --git a/tests/ten_runtime/smoke/extension_test/start_graph/start_graph_and_communicate.cc b/tests/ten_runtime/smoke/extension_test/start_graph/start_graph_and_communicate.cc index 99d564ecfe..e1eca340df 100644 --- a/tests/ten_runtime/smoke/extension_test/start_graph/start_graph_and_communicate.cc +++ b/tests/ten_runtime/smoke/extension_test/start_graph/start_graph_and_communicate.cc @@ -105,8 +105,8 @@ class test_predefined_graph : public ten::extension_t { class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { - ten::ten_env_internal_accessor_t ten_env_internal_accessor(&ten_env); - bool rc = ten_env_internal_accessor.init_manifest_from_json( + bool rc = ten::ten_env_internal_accessor_t::init_manifest_from_json( + ten_env, // clang-format off R"({ "type": "app", diff --git a/tests/ten_runtime/smoke/extension_test/start_graph/start_graph_from_extension.cc b/tests/ten_runtime/smoke/extension_test/start_graph/start_graph_from_extension.cc index 2699f6446b..9f62c98766 100644 --- a/tests/ten_runtime/smoke/extension_test/start_graph/start_graph_from_extension.cc +++ b/tests/ten_runtime/smoke/extension_test/start_graph/start_graph_from_extension.cc @@ -83,8 +83,8 @@ class test_predefined_graph : public ten::extension_t { class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { - ten::ten_env_internal_accessor_t ten_env_internal_accessor(&ten_env); - bool rc = ten_env_internal_accessor.init_manifest_from_json( + bool rc = ten::ten_env_internal_accessor_t::init_manifest_from_json( + ten_env, // clang-format off R"({ "type": "app", diff --git a/tests/ten_runtime/smoke/extension_test/start_graph/start_predefined_graph_cross_app.cc b/tests/ten_runtime/smoke/extension_test/start_graph/start_predefined_graph_cross_app.cc index 49ae0a35b5..c1fd721128 100644 --- a/tests/ten_runtime/smoke/extension_test/start_graph/start_predefined_graph_cross_app.cc +++ b/tests/ten_runtime/smoke/extension_test/start_graph/start_predefined_graph_cross_app.cc @@ -118,8 +118,8 @@ class test_predefined_graph : public ten::extension_t { class test_app_1 : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { - ten::ten_env_internal_accessor_t ten_env_internal_accessor(&ten_env); - bool rc = ten_env_internal_accessor.init_manifest_from_json( + bool rc = ten::ten_env_internal_accessor_t::init_manifest_from_json( + ten_env, // clang-format off R"({ "type": "app", diff --git a/tests/ten_runtime/smoke/extension_test/start_graph/start_predefined_graph_from_extension.cc b/tests/ten_runtime/smoke/extension_test/start_graph/start_predefined_graph_from_extension.cc index a10b551918..9ba5569c98 100644 --- a/tests/ten_runtime/smoke/extension_test/start_graph/start_predefined_graph_from_extension.cc +++ b/tests/ten_runtime/smoke/extension_test/start_graph/start_predefined_graph_from_extension.cc @@ -100,8 +100,8 @@ class test_predefined_graph : public ten::extension_t { class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { - ten::ten_env_internal_accessor_t ten_env_internal_accessor(&ten_env); - bool rc = ten_env_internal_accessor.init_manifest_from_json( + bool rc = ten::ten_env_internal_accessor_t::init_manifest_from_json( + ten_env, // clang-format off R"({ "type": "app", diff --git a/tests/ten_runtime/smoke/extension_test/start_graph/start_two_predefined_graphs.cc b/tests/ten_runtime/smoke/extension_test/start_graph/start_two_predefined_graphs.cc index 3fa1a8f717..03186cd320 100644 --- a/tests/ten_runtime/smoke/extension_test/start_graph/start_two_predefined_graphs.cc +++ b/tests/ten_runtime/smoke/extension_test/start_graph/start_two_predefined_graphs.cc @@ -108,8 +108,8 @@ class test_predefined_graph : public ten::extension_t { class test_app_1 : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { - ten::ten_env_internal_accessor_t ten_env_internal_accessor(&ten_env); - bool rc = ten_env_internal_accessor.init_manifest_from_json( + bool rc = ten::ten_env_internal_accessor_t::init_manifest_from_json( + ten_env, // clang-format off R"({ "type": "app", diff --git a/tests/ten_runtime/smoke/interface_test/interface_out_cmd_in_schema.cc b/tests/ten_runtime/smoke/interface_test/interface_out_cmd_in_schema.cc index 1aacb6c015..f72de821c0 100644 --- a/tests/ten_runtime/smoke/interface_test/interface_out_cmd_in_schema.cc +++ b/tests/ten_runtime/smoke/interface_test/interface_out_cmd_in_schema.cc @@ -21,9 +21,8 @@ class test_extension_1 : public ten::extension_t { explicit test_extension_1(const std::string &name) : ten::extension_t(name) {} void on_configure(ten::ten_env_t &ten_env) override { - ten::ten_env_internal_accessor_t ten_env_internal_accessor(&ten_env); - bool rc = ten_env_internal_accessor.init_manifest_from_json( - R"({ + bool rc = ten::ten_env_internal_accessor_t::init_manifest_from_json(ten_env, + R"({ "type": "extension", "name": "test_extension_1", "version": "0.1.0", diff --git a/tests/ten_runtime/smoke/interface_test/interface_out_cmd_not_in_schema.cc b/tests/ten_runtime/smoke/interface_test/interface_out_cmd_not_in_schema.cc index e824fa9828..af9c92859c 100644 --- a/tests/ten_runtime/smoke/interface_test/interface_out_cmd_not_in_schema.cc +++ b/tests/ten_runtime/smoke/interface_test/interface_out_cmd_not_in_schema.cc @@ -21,9 +21,8 @@ class test_extension_1 : public ten::extension_t { explicit test_extension_1(const std::string &name) : ten::extension_t(name) {} void on_configure(ten::ten_env_t &ten_env) override { - ten::ten_env_internal_accessor_t ten_env_internal_accessor(&ten_env); - bool rc = ten_env_internal_accessor.init_manifest_from_json( - R"({ + bool rc = ten::ten_env_internal_accessor_t::init_manifest_from_json(ten_env, + R"({ "type": "extension", "name": "test_extension_1", "version": "0.1.0", diff --git a/tests/ten_runtime/smoke/interface_test/interface_out_result_error.cc b/tests/ten_runtime/smoke/interface_test/interface_out_result_error.cc index 47cb6b7694..ac5e8ff892 100644 --- a/tests/ten_runtime/smoke/interface_test/interface_out_result_error.cc +++ b/tests/ten_runtime/smoke/interface_test/interface_out_result_error.cc @@ -21,9 +21,8 @@ class test_extension_1 : public ten::extension_t { explicit test_extension_1(const std::string &name) : ten::extension_t(name) {} void on_configure(ten::ten_env_t &ten_env) override { - ten::ten_env_internal_accessor_t ten_env_internal_accessor(&ten_env); - bool rc = ten_env_internal_accessor.init_manifest_from_json( - R"({ + bool rc = ten::ten_env_internal_accessor_t::init_manifest_from_json(ten_env, + R"({ "type": "extension", "name": "test_extension_1", "version": "0.1.0", @@ -64,9 +63,8 @@ class test_extension_2 : public ten::extension_t { explicit test_extension_2(const std::string &name) : ten::extension_t(name) {} void on_configure(ten::ten_env_t &ten_env) override { - ten::ten_env_internal_accessor_t ten_env_internal_accessor(&ten_env); - bool rc = ten_env_internal_accessor.init_manifest_from_json( - R"({ + bool rc = ten::ten_env_internal_accessor_t::init_manifest_from_json(ten_env, + R"({ "type": "extension", "name": "test_extension_2", "version": "0.1.0", diff --git a/tests/ten_runtime/smoke/msg_test/msg_10.cc b/tests/ten_runtime/smoke/msg_test/msg_10.cc index c6ef4c4abc..2f63e8a10e 100644 --- a/tests/ten_runtime/smoke/msg_test/msg_10.cc +++ b/tests/ten_runtime/smoke/msg_test/msg_10.cc @@ -24,8 +24,8 @@ class test_extension_1 : public ten::extension_t { void on_configure(ten::ten_env_t &ten_env) override { // clang-format off - ten::ten_env_internal_accessor_t ten_env_internal_accessor(&ten_env); - bool rc = ten_env_internal_accessor.init_manifest_from_json( + + bool rc = ten::ten_env_internal_accessor_t::init_manifest_from_json(ten_env, R"({ "type": "extension", "name": "msg_10__extension_1", diff --git a/tests/ten_runtime/smoke/msg_test/msg_12.cc b/tests/ten_runtime/smoke/msg_test/msg_12.cc index 562a04de20..6eae35b7fa 100644 --- a/tests/ten_runtime/smoke/msg_test/msg_12.cc +++ b/tests/ten_runtime/smoke/msg_test/msg_12.cc @@ -25,8 +25,8 @@ class test_extension_1 : public ten::extension_t { void on_configure(ten::ten_env_t &ten_env) override { // clang-format off - ten::ten_env_internal_accessor_t ten_env_internal_accessor(&ten_env); - bool rc = ten_env_internal_accessor.init_manifest_from_json( + + bool rc = ten::ten_env_internal_accessor_t::init_manifest_from_json(ten_env, R"({ "type": "extension", "name": "msg_12__extension_1", diff --git a/tests/ten_runtime/smoke/msg_test/msg_13.cc b/tests/ten_runtime/smoke/msg_test/msg_13.cc index a5256b3409..d8b39aa3f3 100644 --- a/tests/ten_runtime/smoke/msg_test/msg_13.cc +++ b/tests/ten_runtime/smoke/msg_test/msg_13.cc @@ -24,8 +24,8 @@ class test_extension_1 : public ten::extension_t { void on_configure(ten::ten_env_t &ten_env) override { // clang-format off - ten::ten_env_internal_accessor_t ten_env_internal_accessor(&ten_env); - bool rc = ten_env_internal_accessor.init_manifest_from_json( + + bool rc = ten::ten_env_internal_accessor_t::init_manifest_from_json(ten_env, R"({ "type": "extension", "name": "msg_13__extension_1", diff --git a/tests/ten_runtime/smoke/msg_test/msg_9.cc b/tests/ten_runtime/smoke/msg_test/msg_9.cc index 40c4a364dc..83bf259e4f 100644 --- a/tests/ten_runtime/smoke/msg_test/msg_9.cc +++ b/tests/ten_runtime/smoke/msg_test/msg_9.cc @@ -25,8 +25,8 @@ class test_extension_1 : public ten::extension_t { void on_configure(ten::ten_env_t &ten_env) override { // clang-format off - ten::ten_env_internal_accessor_t ten_env_internal_accessor(&ten_env); - bool rc = ten_env_internal_accessor.init_manifest_from_json( + + bool rc = ten::ten_env_internal_accessor_t::init_manifest_from_json(ten_env, R"({ "type": "extension", "name": "msg_9__extension_1", diff --git a/tests/ten_runtime/smoke/notify_test/member_func_in_lambda_3.cc b/tests/ten_runtime/smoke/notify_test/member_func_in_lambda_3.cc index e33e09f97a..ed41a3e4f1 100644 --- a/tests/ten_runtime/smoke/notify_test/member_func_in_lambda_3.cc +++ b/tests/ten_runtime/smoke/notify_test/member_func_in_lambda_3.cc @@ -75,9 +75,7 @@ void outer_thread_main(test_extension *ext, ten::ten_env_proxy_t *ten_env_proxy) { while (true) { if (ext->trigger) { - ten_env_proxy->notify([](ten::ten_env_t &ten_env) { - auto *ext = - static_cast(ten_env.get_attached_target()); + ten_env_proxy->notify([ext](ten::ten_env_t &ten_env) { ext->extension_on_notify(ten_env); }); diff --git a/tests/ten_runtime/smoke/notify_test/normal_func.cc b/tests/ten_runtime/smoke/notify_test/normal_func.cc index 9c5b8e0857..190c958261 100644 --- a/tests/ten_runtime/smoke/notify_test/normal_func.cc +++ b/tests/ten_runtime/smoke/notify_test/normal_func.cc @@ -75,7 +75,8 @@ class test_extension : public ten::extension_t { }; void extension_on_notify(ten::ten_env_t &ten_env) { - auto *ext = static_cast(ten_env.get_attached_target()); + auto *ext = static_cast( + ten::ten_env_internal_accessor_t::get_attached_target(ten_env)); auto cmd_result = ten::cmd_result_t::create(TEN_STATUS_CODE_OK); cmd_result->set_property("detail", "hello world, too"); ten_env.return_result(std::move(cmd_result), std::move(ext->hello_world_cmd)); diff --git a/tests/ten_runtime/smoke/notify_test/normal_func_with_user_data.cc b/tests/ten_runtime/smoke/notify_test/normal_func_with_user_data.cc index 264a7c8e5b..4b70305066 100644 --- a/tests/ten_runtime/smoke/notify_test/normal_func_with_user_data.cc +++ b/tests/ten_runtime/smoke/notify_test/normal_func_with_user_data.cc @@ -83,7 +83,8 @@ void extension_on_notify(ten::ten_env_t &ten_env, void *user_data) { EXPECT_EQ(*int64_data, 3); delete int64_data; - auto *ext = static_cast(ten_env.get_attached_target()); + auto *ext = static_cast( + ten::ten_env_internal_accessor_t::get_attached_target(ten_env)); auto cmd_result = ten::cmd_result_t::create(TEN_STATUS_CODE_OK); cmd_result->set_property("detail", "hello world, too"); ten_env.return_result(std::move(cmd_result), std::move(ext->hello_world_cmd)); diff --git a/tests/ten_runtime/smoke/property/property_access_app_store.cc b/tests/ten_runtime/smoke/property/property_access_app_store.cc index a90fd0e27f..84f43d2bc2 100644 --- a/tests/ten_runtime/smoke/property/property_access_app_store.cc +++ b/tests/ten_runtime/smoke/property/property_access_app_store.cc @@ -43,8 +43,8 @@ class test_property_access_app_store_2 : public ten::extension_t { class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { - ten::ten_env_internal_accessor_t ten_env_internal_accessor(&ten_env); - bool rc = ten_env_internal_accessor.init_manifest_from_json( + bool rc = ten::ten_env_internal_accessor_t::init_manifest_from_json( + ten_env, // clang-format off R"({ "type": "app", diff --git a/tests/ten_runtime/smoke/property/property_access_app_store_async.cc b/tests/ten_runtime/smoke/property/property_access_app_store_async.cc index 2fcb48f913..b51f116fd3 100644 --- a/tests/ten_runtime/smoke/property/property_access_app_store_async.cc +++ b/tests/ten_runtime/smoke/property/property_access_app_store_async.cc @@ -37,8 +37,8 @@ class test_property_access_app_store_async_2 : public ten::extension_t { class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { - ten::ten_env_internal_accessor_t ten_env_internal_accessor(&ten_env); - bool rc = ten_env_internal_accessor.init_manifest_from_json( + bool rc = ten::ten_env_internal_accessor_t::init_manifest_from_json( + ten_env, // clang-format off R"({ "type": "app", diff --git a/tests/ten_runtime/smoke/property/property_all.cc b/tests/ten_runtime/smoke/property/property_all.cc index 5abf634888..ec548fe464 100644 --- a/tests/ten_runtime/smoke/property/property_all.cc +++ b/tests/ten_runtime/smoke/property/property_all.cc @@ -41,8 +41,8 @@ class test_extension : public ten::extension_t { explicit test_extension(const std::string &name) : ten::extension_t(name) {} void on_configure(ten::ten_env_t &ten_env) override { - ten::ten_env_internal_accessor_t ten_env_internal_accessor(&ten_env); - bool rc = ten_env_internal_accessor.init_manifest_from_json( + bool rc = ten::ten_env_internal_accessor_t::init_manifest_from_json( + ten_env, // clang-format off "{\ \"type\": \"extension\",\ @@ -96,8 +96,8 @@ class test_extension : public ten::extension_t { class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { - ten::ten_env_internal_accessor_t ten_env_internal_accessor(&ten_env); - bool rc = ten_env_internal_accessor.init_manifest_from_json( + bool rc = ten::ten_env_internal_accessor_t::init_manifest_from_json( + ten_env, // clang-format off "{\ \"type\": \"app\",\ diff --git a/tests/ten_runtime/smoke/property/property_connect_cmd.cc b/tests/ten_runtime/smoke/property/property_connect_cmd.cc index 9314987efe..5f3839f38c 100644 --- a/tests/ten_runtime/smoke/property/property_connect_cmd.cc +++ b/tests/ten_runtime/smoke/property/property_connect_cmd.cc @@ -41,8 +41,8 @@ class test_extension : public ten::extension_t { class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { - ten::ten_env_internal_accessor_t ten_env_internal_accessor(&ten_env); - bool rc = ten_env_internal_accessor.init_manifest_from_json( + bool rc = ten::ten_env_internal_accessor_t::init_manifest_from_json( + ten_env, // clang-format off "{\ \"type\": \"app\",\ diff --git a/tests/ten_runtime/smoke/property/property_extension.cc b/tests/ten_runtime/smoke/property/property_extension.cc index 861c5a2607..03a3e25d75 100644 --- a/tests/ten_runtime/smoke/property/property_extension.cc +++ b/tests/ten_runtime/smoke/property/property_extension.cc @@ -29,8 +29,9 @@ class test_extension : public ten::extension_t { void on_configure(ten::ten_env_t &ten_env) override { // Define the property. - ten::ten_env_internal_accessor_t ten_env_internal_accessor(&ten_env); - bool rc = ten_env_internal_accessor.init_manifest_from_json( + + bool rc = ten::ten_env_internal_accessor_t::init_manifest_from_json( + ten_env, // clang-format off "{\ \"type\": \"extension\",\ @@ -76,8 +77,8 @@ class test_extension : public ten::extension_t { class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { - ten::ten_env_internal_accessor_t ten_env_internal_accessor(&ten_env); - bool rc = ten_env_internal_accessor.init_manifest_from_json( + bool rc = ten::ten_env_internal_accessor_t::init_manifest_from_json( + ten_env, // clang-format off "{\ \"type\": \"app\",\ diff --git a/tests/ten_runtime/smoke/property/property_get_float64.cc b/tests/ten_runtime/smoke/property/property_get_float64.cc index b4193e5976..f698c269cf 100644 --- a/tests/ten_runtime/smoke/property/property_get_float64.cc +++ b/tests/ten_runtime/smoke/property/property_get_float64.cc @@ -40,8 +40,8 @@ class test_extension : public ten::extension_t { class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { - ten::ten_env_internal_accessor_t ten_env_internal_accessor(&ten_env); - bool rc = ten_env_internal_accessor.init_manifest_from_json( + bool rc = ten::ten_env_internal_accessor_t::init_manifest_from_json( + ten_env, // clang-format off "{\ \"type\": \"app\",\ diff --git a/tests/ten_runtime/smoke/property/property_get_float64_type_but_int_value.cc b/tests/ten_runtime/smoke/property/property_get_float64_type_but_int_value.cc index 4c7f849d3e..2d082268af 100644 --- a/tests/ten_runtime/smoke/property/property_get_float64_type_but_int_value.cc +++ b/tests/ten_runtime/smoke/property/property_get_float64_type_but_int_value.cc @@ -40,8 +40,8 @@ class test_extension : public ten::extension_t { class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { - ten::ten_env_internal_accessor_t ten_env_internal_accessor(&ten_env); - bool rc = ten_env_internal_accessor.init_manifest_from_json( + bool rc = ten::ten_env_internal_accessor_t::init_manifest_from_json( + ten_env, // clang-format off "{\ \"type\": \"app\",\ diff --git a/tests/ten_runtime/smoke/property/property_get_int32.cc b/tests/ten_runtime/smoke/property/property_get_int32.cc index db57a208c7..46a1f2aaf2 100644 --- a/tests/ten_runtime/smoke/property/property_get_int32.cc +++ b/tests/ten_runtime/smoke/property/property_get_int32.cc @@ -78,8 +78,8 @@ class test_extension : public ten::extension_t { class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { - ten::ten_env_internal_accessor_t ten_env_internal_accessor(&ten_env); - bool rc = ten_env_internal_accessor.init_manifest_from_json( + bool rc = ten::ten_env_internal_accessor_t::init_manifest_from_json( + ten_env, // clang-format off "{\ \"type\": \"app\",\ diff --git a/tests/ten_runtime/smoke/property/property_in_graph_use_env_1.cc b/tests/ten_runtime/smoke/property/property_in_graph_use_env_1.cc index 6291c12ad5..d4e82115de 100644 --- a/tests/ten_runtime/smoke/property/property_in_graph_use_env_1.cc +++ b/tests/ten_runtime/smoke/property/property_in_graph_use_env_1.cc @@ -38,8 +38,8 @@ class test_extension : public ten::extension_t { class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { - ten::ten_env_internal_accessor_t ten_env_internal_accessor(&ten_env); - bool rc = ten_env_internal_accessor.init_manifest_from_json( + bool rc = ten::ten_env_internal_accessor_t::init_manifest_from_json( + ten_env, // clang-format off R"({ "type": "app", diff --git a/tests/ten_runtime/smoke/property/property_in_graph_use_env_2.cc b/tests/ten_runtime/smoke/property/property_in_graph_use_env_2.cc index 4a7ed9c812..3632cc2696 100644 --- a/tests/ten_runtime/smoke/property/property_in_graph_use_env_2.cc +++ b/tests/ten_runtime/smoke/property/property_in_graph_use_env_2.cc @@ -38,8 +38,8 @@ class test_extension : public ten::extension_t { class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { - ten::ten_env_internal_accessor_t ten_env_internal_accessor(&ten_env); - bool rc = ten_env_internal_accessor.init_manifest_from_json( + bool rc = ten::ten_env_internal_accessor_t::init_manifest_from_json( + ten_env, // clang-format off R"({ "type": "app", diff --git a/tests/ten_runtime/smoke/property/property_prebuilt_graph.cc b/tests/ten_runtime/smoke/property/property_prebuilt_graph.cc index d4f43d01e7..7e9b821602 100644 --- a/tests/ten_runtime/smoke/property/property_prebuilt_graph.cc +++ b/tests/ten_runtime/smoke/property/property_prebuilt_graph.cc @@ -38,8 +38,8 @@ class test_extension : public ten::extension_t { class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { - ten::ten_env_internal_accessor_t ten_env_internal_accessor(&ten_env); - bool rc = ten_env_internal_accessor.init_manifest_from_json( + bool rc = ten::ten_env_internal_accessor_t::init_manifest_from_json( + ten_env, // clang-format off R"({ "type": "app", diff --git a/tests/ten_runtime/smoke/property/property_set_float32.cc b/tests/ten_runtime/smoke/property/property_set_float32.cc index bac223ba59..27537f552b 100644 --- a/tests/ten_runtime/smoke/property/property_set_float32.cc +++ b/tests/ten_runtime/smoke/property/property_set_float32.cc @@ -25,8 +25,8 @@ class test_extension : public ten::extension_t { explicit test_extension(const std::string &name) : ten::extension_t(name) {} void on_configure(ten::ten_env_t &ten_env) override { - ten::ten_env_internal_accessor_t ten_env_internal_accessor(&ten_env); - bool rc = ten_env_internal_accessor.init_manifest_from_json( + bool rc = ten::ten_env_internal_accessor_t::init_manifest_from_json( + ten_env, // clang-format off "{\ \"type\": \"extension\",\ @@ -67,8 +67,8 @@ class test_extension : public ten::extension_t { class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { - ten::ten_env_internal_accessor_t ten_env_internal_accessor(&ten_env); - bool rc = ten_env_internal_accessor.init_manifest_from_json( + bool rc = ten::ten_env_internal_accessor_t::init_manifest_from_json( + ten_env, // clang-format off "{\ \"type\": \"app\",\ diff --git a/tests/ten_runtime/smoke/property/property_set_int32.cc b/tests/ten_runtime/smoke/property/property_set_int32.cc index d05846eb6c..ca8c5a2462 100644 --- a/tests/ten_runtime/smoke/property/property_set_int32.cc +++ b/tests/ten_runtime/smoke/property/property_set_int32.cc @@ -25,8 +25,8 @@ class test_extension : public ten::extension_t { explicit test_extension(const std::string &name) : ten::extension_t(name) {} void on_configure(ten::ten_env_t &ten_env) override { - ten::ten_env_internal_accessor_t ten_env_internal_accessor(&ten_env); - bool rc = ten_env_internal_accessor.init_manifest_from_json( + bool rc = ten::ten_env_internal_accessor_t::init_manifest_from_json( + ten_env, // clang-format off "{\ \"type\": \"extension\",\ @@ -65,8 +65,8 @@ class test_extension : public ten::extension_t { class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { - ten::ten_env_internal_accessor_t ten_env_internal_accessor(&ten_env); - bool rc = ten_env_internal_accessor.init_manifest_from_json( + bool rc = ten::ten_env_internal_accessor_t::init_manifest_from_json( + ten_env, // clang-format off "{\ \"type\": \"app\",\ diff --git a/tests/ten_runtime/smoke/result_conversion/result_conversion_1.cc b/tests/ten_runtime/smoke/result_conversion/result_conversion_1.cc index 53cea6eb1e..0060549409 100644 --- a/tests/ten_runtime/smoke/result_conversion/result_conversion_1.cc +++ b/tests/ten_runtime/smoke/result_conversion/result_conversion_1.cc @@ -59,8 +59,8 @@ class test_extension_2 : public ten::extension_t { class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { - ten::ten_env_internal_accessor_t ten_env_internal_accessor(&ten_env); - bool rc = ten_env_internal_accessor.init_manifest_from_json( + bool rc = ten::ten_env_internal_accessor_t::init_manifest_from_json( + ten_env, // clang-format off R"###({ "type": "app", diff --git a/tests/ten_runtime/smoke/schema_test/schema_cmd_property_required.cc b/tests/ten_runtime/smoke/schema_test/schema_cmd_property_required.cc index 8227ce90f4..6d5795deb5 100644 --- a/tests/ten_runtime/smoke/schema_test/schema_cmd_property_required.cc +++ b/tests/ten_runtime/smoke/schema_test/schema_cmd_property_required.cc @@ -20,8 +20,8 @@ class test_extension_1 : public ten::extension_t { explicit test_extension_1(const std::string &name) : ten::extension_t(name) {} void on_configure(ten::ten_env_t &ten_env) override { - ten::ten_env_internal_accessor_t ten_env_internal_accessor(&ten_env); - bool rc = ten_env_internal_accessor.init_manifest_from_json( + bool rc = ten::ten_env_internal_accessor_t::init_manifest_from_json( + ten_env, // clang-format off R"({ "type": "extension", @@ -85,8 +85,8 @@ class test_extension_2 : public ten::extension_t { explicit test_extension_2(const std::string &name) : ten::extension_t(name) {} void on_configure(ten::ten_env_t &ten_env) override { - ten::ten_env_internal_accessor_t ten_env_internal_accessor(&ten_env); - bool rc = ten_env_internal_accessor.init_manifest_from_json( + bool rc = ten::ten_env_internal_accessor_t::init_manifest_from_json( + ten_env, // clang-format off R"({ "type": "extension", diff --git a/tests/ten_runtime/smoke/schema_test/schema_cmd_result.cc b/tests/ten_runtime/smoke/schema_test/schema_cmd_result.cc index 39eceb5282..b70f11a244 100644 --- a/tests/ten_runtime/smoke/schema_test/schema_cmd_result.cc +++ b/tests/ten_runtime/smoke/schema_test/schema_cmd_result.cc @@ -22,8 +22,8 @@ class test_extension_1 : public ten::extension_t { void on_configure(ten::ten_env_t &ten_env) override { // clang-format off - ten::ten_env_internal_accessor_t ten_env_internal_accessor(&ten_env); - bool rc = ten_env_internal_accessor.init_manifest_from_json( + + bool rc = ten::ten_env_internal_accessor_t::init_manifest_from_json(ten_env, R"({ "type": "extension", "name": "schema_cmd_result__test_extension_1", @@ -63,8 +63,8 @@ class test_extension_2 : public ten::extension_t { explicit test_extension_2(const std::string &name) : ten::extension_t(name) {} void on_configure(ten::ten_env_t &ten_env) override { - ten::ten_env_internal_accessor_t ten_env_internal_accessor(&ten_env); - bool rc = ten_env_internal_accessor.init_manifest_from_json( + bool rc = ten::ten_env_internal_accessor_t::init_manifest_from_json( + ten_env, // clang-format off R"({ "type": "extension", diff --git a/tests/ten_runtime/smoke/schema_test/schema_cmd_result_error.cc b/tests/ten_runtime/smoke/schema_test/schema_cmd_result_error.cc index 4fe4e47ad9..2bbc75d4bc 100644 --- a/tests/ten_runtime/smoke/schema_test/schema_cmd_result_error.cc +++ b/tests/ten_runtime/smoke/schema_test/schema_cmd_result_error.cc @@ -21,8 +21,8 @@ class test_extension_1 : public ten::extension_t { explicit test_extension_1(const std::string &name) : ten::extension_t(name) {} void on_configure(ten::ten_env_t &ten_env) override { - ten::ten_env_internal_accessor_t ten_env_internal_accessor(&ten_env); - bool rc = ten_env_internal_accessor.init_manifest_from_json( + bool rc = ten::ten_env_internal_accessor_t::init_manifest_from_json( + ten_env, // clang-format off R"({ "type": "extension", @@ -65,8 +65,8 @@ class test_extension_2 : public ten::extension_t { void on_configure(ten::ten_env_t &ten_env) override { // clang-format off - ten::ten_env_internal_accessor_t ten_env_internal_accessor(&ten_env); - bool rc = ten_env_internal_accessor.init_manifest_from_json( + + bool rc = ten::ten_env_internal_accessor_t::init_manifest_from_json(ten_env, R"({ "type": "extension", "name": "schema_cmd_result_error__test_extension_2", diff --git a/tests/ten_runtime/smoke/schema_test/schema_data_prop.cc b/tests/ten_runtime/smoke/schema_test/schema_data_prop.cc index a0d52f7095..2447b64a6d 100644 --- a/tests/ten_runtime/smoke/schema_test/schema_data_prop.cc +++ b/tests/ten_runtime/smoke/schema_test/schema_data_prop.cc @@ -30,8 +30,8 @@ class test_extension_1 : public ten::extension_t { void on_configure(ten::ten_env_t &ten_env) override { // clang-format off - ten::ten_env_internal_accessor_t ten_env_internal_accessor(&ten_env); - bool rc = ten_env_internal_accessor.init_manifest_from_json( + + bool rc = ten::ten_env_internal_accessor_t::init_manifest_from_json(ten_env, R"({ "type": "extension", "name": "schema_data_prop__test_extension_1", @@ -99,8 +99,8 @@ class test_extension_2 : public ten::extension_t { explicit test_extension_2(const std::string &name) : ten::extension_t(name) {} void on_configure(ten::ten_env_t &ten_env) override { - ten::ten_env_internal_accessor_t ten_env_internal_accessor(&ten_env); - bool rc = ten_env_internal_accessor.init_manifest_from_json( + bool rc = ten::ten_env_internal_accessor_t::init_manifest_from_json( + ten_env, // clang-format off R"({ "type": "extension", diff --git a/tests/ten_runtime/smoke/schema_test/schema_on_cmd.cc b/tests/ten_runtime/smoke/schema_test/schema_on_cmd.cc index ddcc2022ec..fed9435918 100644 --- a/tests/ten_runtime/smoke/schema_test/schema_on_cmd.cc +++ b/tests/ten_runtime/smoke/schema_test/schema_on_cmd.cc @@ -43,12 +43,12 @@ class test_extension_2 : public ten::extension_t { explicit test_extension_2(const std::string &name) : ten::extension_t(name) {} void on_configure(ten::ten_env_t &ten_env) override { - ten::ten_env_internal_accessor_t ten_env_internal_accessor(&ten_env); - bool rc = ten_env_internal_accessor.init_manifest_from_json( - "invalid json string"); + bool rc = ten::ten_env_internal_accessor_t::init_manifest_from_json( + ten_env, "invalid json string"); ASSERT_EQ(rc, false); - rc = ten_env_internal_accessor.init_manifest_from_json( + rc = ten::ten_env_internal_accessor_t::init_manifest_from_json( + ten_env, // clang-format off R"({ "type": "extension", diff --git a/tests/ten_runtime/smoke/schema_test/schema_send_cmd.cc b/tests/ten_runtime/smoke/schema_test/schema_send_cmd.cc index 33b051d481..60964a4565 100644 --- a/tests/ten_runtime/smoke/schema_test/schema_send_cmd.cc +++ b/tests/ten_runtime/smoke/schema_test/schema_send_cmd.cc @@ -20,8 +20,8 @@ class test_extension_1 : public ten::extension_t { explicit test_extension_1(const std::string &name) : ten::extension_t(name) {} void on_configure(ten::ten_env_t &ten_env) override { - ten::ten_env_internal_accessor_t ten_env_internal_accessor(&ten_env); - bool rc = ten_env_internal_accessor.init_manifest_from_json( + bool rc = ten::ten_env_internal_accessor_t::init_manifest_from_json( + ten_env, // clang-format off R"({ "type": "extension", diff --git a/tests/ten_runtime/smoke/schema_test/schema_set_extension_property.cc b/tests/ten_runtime/smoke/schema_test/schema_set_extension_property.cc index 7eb647a478..17cb05508a 100644 --- a/tests/ten_runtime/smoke/schema_test/schema_set_extension_property.cc +++ b/tests/ten_runtime/smoke/schema_test/schema_set_extension_property.cc @@ -22,8 +22,8 @@ class test_extension : public ten::extension_t { explicit test_extension(const std::string &name) : ten::extension_t(name) {} void on_configure(ten::ten_env_t &ten_env) override { - ten::ten_env_internal_accessor_t ten_env_internal_accessor(&ten_env); - bool rc = ten_env_internal_accessor.init_manifest_from_json( + bool rc = ten::ten_env_internal_accessor_t::init_manifest_from_json( + ten_env, // clang-format off R"({ "type": "extension", diff --git a/tests/ten_runtime/smoke/schema_test/schema_set_property_buf.cc b/tests/ten_runtime/smoke/schema_test/schema_set_property_buf.cc index b2b2364a55..58af653454 100644 --- a/tests/ten_runtime/smoke/schema_test/schema_set_property_buf.cc +++ b/tests/ten_runtime/smoke/schema_test/schema_set_property_buf.cc @@ -23,8 +23,8 @@ class test_extension_1 : public ten::extension_t { explicit test_extension_1(const std::string &name) : ten::extension_t(name) {} void on_configure(ten::ten_env_t &ten_env) override { - ten::ten_env_internal_accessor_t ten_env_internal_accessor(&ten_env); - bool rc = ten_env_internal_accessor.init_manifest_from_json( + bool rc = ten::ten_env_internal_accessor_t::init_manifest_from_json( + ten_env, // clang-format off R"({ "type": "extension", diff --git a/tests/ten_runtime/smoke/schema_test/schema_set_property_ptr.cc b/tests/ten_runtime/smoke/schema_test/schema_set_property_ptr.cc index 5396934560..67adf2c1a6 100644 --- a/tests/ten_runtime/smoke/schema_test/schema_set_property_ptr.cc +++ b/tests/ten_runtime/smoke/schema_test/schema_set_property_ptr.cc @@ -22,8 +22,8 @@ class test_extension_1 : public ten::extension_t { explicit test_extension_1(const std::string &name) : ten::extension_t(name) {} void on_configure(ten::ten_env_t &ten_env) override { - ten::ten_env_internal_accessor_t ten_env_internal_accessor(&ten_env); - bool rc = ten_env_internal_accessor.init_manifest_from_json( + bool rc = ten::ten_env_internal_accessor_t::init_manifest_from_json( + ten_env, // clang-format off R"({ "type": "extension",