diff options
Diffstat (limited to 'src/components/application_manager/test/mock/include/application_manager/request_controller.h')
-rw-r--r-- | src/components/application_manager/test/mock/include/application_manager/request_controller.h | 50 |
1 files changed, 39 insertions, 11 deletions
diff --git a/src/components/application_manager/test/mock/include/application_manager/request_controller.h b/src/components/application_manager/test/mock/include/application_manager/request_controller.h index 2bc5f54666..efe6b1c4e8 100644 --- a/src/components/application_manager/test/mock/include/application_manager/request_controller.h +++ b/src/components/application_manager/test/mock/include/application_manager/request_controller.h @@ -1,4 +1,4 @@ -/** +/* * Copyright (c) 2014, Ford Motor Company * All rights reserved. * @@ -120,7 +120,7 @@ class RequestController { * @return Result code * */ - TResult addMobileRequest(const MobileRequestPtr& request, + TResult addMobileRequest(const RequestPtr request, const mobile_apis::HMILevel::eType& hmi_level); @@ -146,7 +146,7 @@ class RequestController { * @param mobile_corellation_id Active mobile request correlation ID * */ - void terminateMobileRequest(const uint32_t& mobile_correlation_id); + void terminateMobileRequest(const uint32_t& mobile_correlation_id, const uint32_t& connection_key); /** @@ -177,6 +177,12 @@ class RequestController { */ void terminateAllHMIRequests(); + + /** + * @brief Terminates all requests from Mobile + */ + void terminateAllMobileRequests(); + /** * @brief Updates request timeout * @@ -188,30 +194,50 @@ class RequestController { const uint32_t& mobile_correlation_id, const uint32_t& new_timeout); + /* + * @brief Function Should be called when Low Voltage is occured + */ + void OnLowVoltage(); + + /* + * @brief Function Should be called when Low Voltage is occured + */ + void OnWakeUp(); + + bool IsLowVoltage(); protected: /** - * @brief Checs if this app as able to add new requests, or limits was exceeded + * @brief Check if this app is able to add new requests, or limits was exceeded * @param app_id - application id * @param app_time_scale - time scale (seconds) - * @param max_request_per_time_scale - maximum count of request that should be allowed for app_time_scale secconds + * @param max_request_per_time_scale - maximum count of request that should be allowed for app_time_scale seconds + * @return True if new request could be added, false otherwise */ - bool checkTimeScaleMaxRequest(const uint32_t& app_id, + bool CheckTimeScaleMaxRequest(const uint32_t& app_id, const uint32_t& app_time_scale, const uint32_t& max_request_per_time_scale); /** - * @brief Checs if this app as able to add new requests in current hmi_level, or limits was exceeded + * @brief Check if this app is able to add new requests in current hmi_level, or limits was exceeded * @param hmi_level - hmi level * @param app_id - application id * @param app_time_scale - time scale (seconds) - * @param max_request_per_time_scale - maximum count of request that should be allowed for app_time_scale secconds + * @param max_request_per_time_scale - maximum count of request that should be allowed for app_time_scale seconds + * @return True if new request could be added, false otherwise */ - bool checkHMILevelTimeScaleMaxRequest(const mobile_apis::HMILevel::eType& hmi_level, + bool CheckHMILevelTimeScaleMaxRequest(const mobile_apis::HMILevel::eType& hmi_level, const uint32_t& app_id, const uint32_t& app_time_scale, const uint32_t& max_request_per_time_scale); + /** + * @brief Check Posibility to add new requests, or limits was exceeded + * @param pending_requests_amount - maximum count of request that should be allowed for all applications + * @return True if new request could be added, false otherwise + */ + bool CheckPendingRequestsAmount(const uint32_t& pending_requests_amount); + void onTimer(); /** @@ -220,6 +246,7 @@ class RequestController { */ void UpdateTimer(); + private: // Data types @@ -229,7 +256,7 @@ class RequestController { Worker(RequestController* requestController); virtual ~Worker(); virtual void threadMain(); - virtual bool exitThreadMain(); + virtual void exitThreadMain(); protected: private: RequestController* request_controller_; @@ -242,7 +269,7 @@ class RequestController { uint32_t pool_size_; sync_primitives::ConditionalVariable cond_var_; - std::list<MobileRequestPtr> mobile_request_list_; + std::list<RequestPtr> mobile_request_list_; sync_primitives::Lock mobile_request_list_lock_; RequestInfoSet pending_request_set_; @@ -256,6 +283,7 @@ class RequestController { timer::TimerThread<RequestController> timer_; static const uint32_t dafault_sleep_time_ = UINT_MAX; + bool is_low_voltage_; DISALLOW_COPY_AND_ASSIGN(RequestController); }; |