summaryrefslogtreecommitdiff
path: root/src/components/application_manager/src/application_data_impl.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/application_manager/src/application_data_impl.cc')
-rw-r--r--src/components/application_manager/src/application_data_impl.cc57
1 files changed, 2 insertions, 55 deletions
diff --git a/src/components/application_manager/src/application_data_impl.cc b/src/components/application_manager/src/application_data_impl.cc
index e5fb6d4eab..56fc88ffe3 100644
--- a/src/components/application_manager/src/application_data_impl.cc
+++ b/src/components/application_manager/src/application_data_impl.cc
@@ -1,4 +1,4 @@
-/*
+/**
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -32,10 +32,8 @@
#include "application_manager/application_data_impl.h"
#include "application_manager/smart_object_keys.h"
-#include "utils/logger.h"
namespace application_manager {
-CREATE_LOGGERPTR_GLOBAL(logger_, "ApplicationDataImpl")
InitialApplicationDataImpl::InitialApplicationDataImpl()
: app_types_(NULL),
@@ -279,30 +277,6 @@ const NsSmartDeviceLink::NsSmartObjects::SmartObject* DynamicApplicationDataImpl
return menu_icon_;
}
-void DynamicApplicationDataImpl::load_global_properties(
- const smart_objects::SmartObject& properties_so) {
- SetGlobalProperties(properties_so.getElement(strings::vr_help_title),
- &DynamicApplicationData::set_vr_help_title);
-
- SetGlobalProperties(properties_so.getElement(strings::vr_help),
- &DynamicApplicationData::set_vr_help);
-
- SetGlobalProperties(properties_so.getElement(strings::timeout_prompt),
- &DynamicApplicationData::set_timeout_prompt);
-
- SetGlobalProperties(properties_so.getElement(strings::help_prompt),
- &DynamicApplicationData::set_help_prompt);
-
- SetGlobalProperties(properties_so.getElement(strings::keyboard_properties),
- &DynamicApplicationData::set_keyboard_props);
-
- SetGlobalProperties(properties_so.getElement(strings::menu_title),
- &DynamicApplicationData::set_menu_title);
-
- SetGlobalProperties(properties_so.getElement(strings::menu_icon),
- &DynamicApplicationData::set_menu_icon);
-}
-
void DynamicApplicationDataImpl::set_help_prompt(
const smart_objects::SmartObject& help_prompt) {
if (help_prompt_) {
@@ -394,31 +368,15 @@ void DynamicApplicationDataImpl::set_menu_icon(
menu_icon_= new smart_objects::SmartObject(menu_icon);
}
-void DynamicApplicationDataImpl::SetGlobalProperties(
- const smart_objects::SmartObject& param,
- void (DynamicApplicationData::*callback)(
- const NsSmartDeviceLink::NsSmartObjects::SmartObject&)) {
-
- smart_objects::SmartType so_type = param.getType();
- if (so_type != smart_objects::SmartType::SmartType_Invalid &&
- so_type != smart_objects::SmartType::SmartType_Null) {
- if (callback) {
- (this->*callback)(param);
- }
- } else {
- LOG4CXX_WARN(logger_, "Invalid or Null smart object");
- }
-}
void DynamicApplicationDataImpl::AddCommand(
uint32_t cmd_id, const smart_objects::SmartObject& command) {
- sync_primitives::AutoLock lock(commands_lock_);
commands_[cmd_id] = new smart_objects::SmartObject(command);
}
void DynamicApplicationDataImpl::RemoveCommand(uint32_t cmd_id) {
- sync_primitives::AutoLock lock(commands_lock_);
CommandsMap::iterator it = commands_.find(cmd_id);
+
if (commands_.end() != it) {
delete it->second;
commands_.erase(it);
@@ -427,7 +385,6 @@ void DynamicApplicationDataImpl::RemoveCommand(uint32_t cmd_id) {
smart_objects::SmartObject* DynamicApplicationDataImpl::FindCommand(
uint32_t cmd_id) {
- sync_primitives::AutoLock lock(commands_lock_);
CommandsMap::const_iterator it = commands_.find(cmd_id);
if (it != commands_.end()) {
return it->second;
@@ -439,12 +396,10 @@ smart_objects::SmartObject* DynamicApplicationDataImpl::FindCommand(
// TODO(VS): Create common functions for processing collections
void DynamicApplicationDataImpl::AddSubMenu(
uint32_t menu_id, const smart_objects::SmartObject& menu) {
- sync_primitives::AutoLock lock(sub_menu_lock_);
sub_menu_[menu_id] = new smart_objects::SmartObject(menu);
}
void DynamicApplicationDataImpl::RemoveSubMenu(uint32_t menu_id) {
- sync_primitives::AutoLock lock(sub_menu_lock_);
SubMenuMap::iterator it = sub_menu_.find(menu_id);
if (sub_menu_.end() != it) {
@@ -455,7 +410,6 @@ void DynamicApplicationDataImpl::RemoveSubMenu(uint32_t menu_id) {
smart_objects::SmartObject* DynamicApplicationDataImpl::FindSubMenu(
uint32_t menu_id) const {
- sync_primitives::AutoLock lock(sub_menu_lock_);
SubMenuMap::const_iterator it = sub_menu_.find(menu_id);
if (it != sub_menu_.end()) {
return it->second;
@@ -466,7 +420,6 @@ smart_objects::SmartObject* DynamicApplicationDataImpl::FindSubMenu(
bool DynamicApplicationDataImpl::IsSubMenuNameAlreadyExist(
const std::string& name) {
- sync_primitives::AutoLock lock(sub_menu_lock_);
for (SubMenuMap::iterator it = sub_menu_.begin();
sub_menu_.end() != it;
++it) {
@@ -480,12 +433,10 @@ bool DynamicApplicationDataImpl::IsSubMenuNameAlreadyExist(
void DynamicApplicationDataImpl::AddChoiceSet(
uint32_t choice_set_id, const smart_objects::SmartObject& choice_set) {
- sync_primitives::AutoLock lock(choice_set_map_lock_);
choice_set_map_[choice_set_id] = new smart_objects::SmartObject(choice_set);
}
void DynamicApplicationDataImpl::RemoveChoiceSet(uint32_t choice_set_id) {
- sync_primitives::AutoLock lock(choice_set_map_lock_);
ChoiceSetMap::iterator it = choice_set_map_.find(choice_set_id);
if (choice_set_map_.end() != it) {
@@ -496,7 +447,6 @@ void DynamicApplicationDataImpl::RemoveChoiceSet(uint32_t choice_set_id) {
smart_objects::SmartObject* DynamicApplicationDataImpl::FindChoiceSet(
uint32_t choice_set_id) {
- sync_primitives::AutoLock lock(choice_set_map_lock_);
ChoiceSetMap::const_iterator it = choice_set_map_.find(choice_set_id);
if (it != choice_set_map_.end()) {
return it->second;
@@ -507,13 +457,11 @@ smart_objects::SmartObject* DynamicApplicationDataImpl::FindChoiceSet(
void DynamicApplicationDataImpl::AddPerformInteractionChoiceSet(
uint32_t choice_set_id, const smart_objects::SmartObject& vr_commands) {
- sync_primitives::AutoLock lock(performinteraction_choice_set_lock_);
performinteraction_choice_set_map_[choice_set_id] =
new smart_objects::SmartObject(vr_commands);
}
void DynamicApplicationDataImpl::DeletePerformInteractionChoiceSetMap() {
- sync_primitives::AutoLock lock(performinteraction_choice_set_lock_);
PerformChoiceSetMap::iterator it = performinteraction_choice_set_map_.begin();
for (; performinteraction_choice_set_map_.end() != it; ++it) {
delete it->second;
@@ -524,7 +472,6 @@ void DynamicApplicationDataImpl::DeletePerformInteractionChoiceSetMap() {
smart_objects::SmartObject*
DynamicApplicationDataImpl::FindPerformInteractionChoiceSet(
uint32_t choice_set_id) const {
- sync_primitives::AutoLock lock(performinteraction_choice_set_lock_);
PerformChoiceSetMap::const_iterator it = performinteraction_choice_set_map_
.find(choice_set_id);