#include <dlfcn.h>
#include <algorithm>
#include <pkgmgr-info.h>
+#include <deque>
namespace multiassistant
{
void CWakeupEngineManager::add_engine(string name, string path)
{
- sleep(10);
MWR_LOGD("Name (%s), Filepath(%s)", name.c_str(), path.c_str());
char* error = NULL;
string engine_name;
} CallbackUserData;
- static vector<CallbackUserData> callback_user_data;
+ static deque<CallbackUserData> callback_user_data;
CallbackUserData user_data;
user_data.manager = this;
if (info.interface.set_wakeup_event_callback) {
info.interface.set_wakeup_event_callback(
[](wakeup_event_info info, void* user_data) {
- CallbackUserData *callback_user_data = static_cast<CallbackUserData*>(user_data);
- if (nullptr == callback_user_data) return;
- if (nullptr == callback_user_data->manager) return;
- callback_user_data->manager->on_wakeup_event(callback_user_data->engine_name, info);
+ CallbackUserData *data = static_cast<CallbackUserData*>(user_data);
+ if (nullptr == data) return;
+ if (nullptr == data->manager) return;
+ data->manager->on_wakeup_event(data->engine_name, info);
}, &(callback_user_data.back()));
}
if (info.interface.set_audio_data_require_status_callback) {
info.interface.set_audio_data_require_status_callback(
[](bool require, void* user_data) {
- CallbackUserData *callback_user_data = static_cast<CallbackUserData*>(user_data);
- if (nullptr == callback_user_data) return;
- if (nullptr == callback_user_data->manager) return;
- callback_user_data->manager->on_audio_data_require_status(callback_user_data->engine_name, require);
+ CallbackUserData *data = static_cast<CallbackUserData*>(user_data);
+ if (nullptr == data) return;
+ if (nullptr == data->manager) return;
+ data->manager->on_audio_data_require_status(data->engine_name, require);
}, &(callback_user_data.back()));
}