diff options
author | BSolonenko <BSolonenko@luxoft.com> | 2018-02-09 17:02:50 +0200 |
---|---|---|
committer | Ira Lytvynenko (GitHub) <ILytvynenko@luxoft.com> | 2018-06-26 12:01:44 +0300 |
commit | 1454fb654e9c8cd3b54338160483dc7be9698222 (patch) | |
tree | 469b90ed1d262b0f29fd3f94775512ea51ffe505 /src | |
parent | 645a9ac403c2c62e11b65cfbf45d9a7919c7e91b (diff) | |
download | sdl_core-1454fb654e9c8cd3b54338160483dc7be9698222.tar.gz |
Refactoring CommandImpl, CommandRequestImpl and CommandResponseImpl
In CommandImpl added rpc_service_, hmi_capabilities_ and policy_handler_
fields. Also changed constructors CommandImpl, CommandRequestImpl and
CommandResponseImpl.
Diffstat (limited to 'src')
6 files changed, 44 insertions, 10 deletions
diff --git a/src/components/application_manager/include/application_manager/commands/command_impl.h b/src/components/application_manager/include/application_manager/commands/command_impl.h index 5fee7500ce..be79d9e8d1 100644 --- a/src/components/application_manager/include/application_manager/commands/command_impl.h +++ b/src/components/application_manager/include/application_manager/commands/command_impl.h @@ -63,7 +63,10 @@ class CommandImpl : public Command { * @param message Incoming SmartObject message **/ CommandImpl(const MessageSharedPtr& message, - ApplicationManager& application_manager); + ApplicationManager& application_manager, + rpc_service::RPCService& rpc_service, + HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handler); /** * @brief CommandImpl class destructor @@ -173,6 +176,9 @@ class CommandImpl : public Command { uint32_t default_timeout_; bool allowed_to_terminate_; ApplicationManager& application_manager_; + rpc_service::RPCService& rpc_service_; + HMICapabilities& hmi_capabilities_; + policy::PolicyHandlerInterface& policy_handler_; #ifdef ENABLE_LOG static log4cxx::LoggerPtr logger_; diff --git a/src/components/application_manager/include/application_manager/commands/command_request_impl.h b/src/components/application_manager/include/application_manager/commands/command_request_impl.h index 74a884a223..e790fc9af6 100644 --- a/src/components/application_manager/include/application_manager/commands/command_request_impl.h +++ b/src/components/application_manager/include/application_manager/commands/command_request_impl.h @@ -110,7 +110,10 @@ class CommandRequestImpl : public CommandImpl, enum HashUpdateMode { kSkipHashUpdate, kDoHashUpdate }; CommandRequestImpl(const MessageSharedPtr& message, - ApplicationManager& application_manager); + ApplicationManager& application_manager, + rpc_service::RPCService& rpc_service, + HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handler); ~CommandRequestImpl(); diff --git a/src/components/application_manager/include/application_manager/commands/command_response_impl.h b/src/components/application_manager/include/application_manager/commands/command_response_impl.h index 44c58a8102..06e73db191 100644 --- a/src/components/application_manager/include/application_manager/commands/command_response_impl.h +++ b/src/components/application_manager/include/application_manager/commands/command_response_impl.h @@ -44,7 +44,10 @@ namespace commands { class CommandResponseImpl : public CommandImpl { public: CommandResponseImpl(const MessageSharedPtr& message, - ApplicationManager& application_manager); + ApplicationManager& application_manager, + rpc_service::RPCService& rpc_service, + HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handler); virtual ~CommandResponseImpl(); virtual bool Init(); virtual bool CleanUp(); diff --git a/src/components/application_manager/src/commands/command_impl.cc b/src/components/application_manager/src/commands/command_impl.cc index b928184148..22f6a822ff 100644 --- a/src/components/application_manager/src/commands/command_impl.cc +++ b/src/components/application_manager/src/commands/command_impl.cc @@ -44,11 +44,17 @@ const int32_t CommandImpl::mobile_protocol_type_ = 0; const int32_t CommandImpl::protocol_version_ = 3; CommandImpl::CommandImpl(const MessageSharedPtr& message, - ApplicationManager& application_manager) + ApplicationManager& application_manager, + rpc_service::RPCService& rpc_service, + HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handler) : message_(message) , default_timeout_(application_manager.get_settings().default_timeout()) , allowed_to_terminate_(true) - , application_manager_(application_manager) {} + , application_manager_(application_manager) + , rpc_service_(rpc_service) + , hmi_capabilities_(hmi_capabilities) + , policy_handler_(policy_handler) {} CommandImpl::~CommandImpl() { CleanUp(); diff --git a/src/components/application_manager/src/commands/command_request_impl.cc b/src/components/application_manager/src/commands/command_request_impl.cc index 36217e9bc3..15aa7df682 100644 --- a/src/components/application_manager/src/commands/command_request_impl.cc +++ b/src/components/application_manager/src/commands/command_request_impl.cc @@ -195,9 +195,17 @@ ResponseInfo::ResponseInfo(const hmi_apis::Common_Result::eType result, hmi_apis::Common_Result::UNSUPPORTED_RESOURCE == result_code; } -CommandRequestImpl::CommandRequestImpl(const MessageSharedPtr& message, - ApplicationManager& application_manager) - : CommandImpl(message, application_manager) +CommandRequestImpl::CommandRequestImpl( + const MessageSharedPtr& message, + ApplicationManager& application_manager, + rpc_service::RPCService& rpc_service, + HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handler) + : CommandImpl(message, + application_manager, + rpc_service, + hmi_capabilities, + policy_handler) , EventObserver(application_manager.event_dispatcher()) , current_state_(kAwaitingHMIResponse) , hash_update_mode_(kSkipHashUpdate) diff --git a/src/components/application_manager/src/commands/command_response_impl.cc b/src/components/application_manager/src/commands/command_response_impl.cc index 01eccf552e..8a39bc6bed 100644 --- a/src/components/application_manager/src/commands/command_response_impl.cc +++ b/src/components/application_manager/src/commands/command_response_impl.cc @@ -39,8 +39,16 @@ namespace application_manager { namespace commands { CommandResponseImpl::CommandResponseImpl( - const MessageSharedPtr& message, ApplicationManager& application_manager) - : CommandImpl(message, application_manager) {} + const MessageSharedPtr& message, + ApplicationManager& application_manager, + rpc_service::RPCService& rpc_service, + HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handler) + : CommandImpl(message, + application_manager, + rpc_service, + hmi_capabilities, + policy_handler) {} CommandResponseImpl::~CommandResponseImpl() {} |