mv_machine_learning: code refactoring to AsyncManager
[Issue type] : code refactoring
Do code refactoring to AsyncManager by introducing new public member functions -
push() and pop() - and by moving existing all member functions as private ones
excepting isWorking(), popFromInput() and pushToOutput() which are used
in InferenceCallback function of the object detection task group.
By doing this, it can support async API with AsyncManager easily because
what each task group has to do for it is to call push() in PerformAsync()
and to call pop() in getOutput(). In addition, this patch moves the logic
of inferenceCallback() to lamda block of performAsync().
For async API support, what each task group have to do is,
void TaskGroup::performAsync()
{
...
// create AsyncManager class with lamda function.
...
_async_manager->push(inputVectors);
}
void TaskGroup::getOutput()
{
if (_async_manager) {
...
_current_result = _async_manager->pop();
}
...
}
Change-Id: I022c71b921b5351d739ba685c188625806162000
Signed-off-by: Inki Dae <inki.dae@samsung.com>