mv_machine_learning: introduce machine_learning_native_remove function
authorVibhav Aggarwal <v.aggarwal@samsung.com>
Mon, 1 Apr 2024 07:11:23 +0000 (16:11 +0900)
committerKwanghoon Son <k.son@samsung.com>
Fri, 5 Apr 2024 04:56:10 +0000 (13:56 +0900)
[Issue type] new feature

Introduce machine_learning_native_remove(handle, task_name) function
to remove task matching `task_name` from the handle which was added
using machine_learning_native_add().

Change-Id: I4c341205737b91995da7992462a85d3655e997e2
Signed-off-by: Vibhav Aggarwal <v.aggarwal@samsung.com>
mv_machine_learning/common/include/native_capi.h
mv_machine_learning/common/src/native_capi.cpp

index b9be50505b86a49eaa8e16cdbce6585826bc92f5..377d2cba322898bc706755115d4f70a341bc7b99 100644 (file)
@@ -31,6 +31,7 @@ namespace machine_learning
 {
 void *machine_learning_native_create();
 void machine_learning_native_add(void *handle, const std::string &task_name, mediavision::common::ITask *task);
+void machine_learning_native_remove(void *handle, const std::string &task_name);
 void machine_learning_native_destroy(void *handle);
 void machine_learning_native_configure(void *handle, const std::string &task_name);
 void machine_learning_native_prepare(void *handle, const std::string &task_name);
index 868f8e341aabf6a9c6a79ff86beccc228e0f1068..5d028b01169d90e67ea35cbf1b4bd071242a499c 100644 (file)
@@ -47,6 +47,13 @@ void machine_learning_native_add(void *handle, const string &task_name, ITask *t
        context->__tasks.insert(make_pair(task_name, task));
 }
 
+void machine_learning_native_remove(void *handle, const string &task_name)
+{
+       auto context = static_cast<Context *>(handle);
+
+       context->__tasks.erase(task_name);
+}
+
 void machine_learning_native_destroy(void *handle)
 {
        auto context = static_cast<Context *>(handle);