aboutsummaryrefslogtreecommitdiffstats
path: root/src/policy_manager/policy_manager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/policy_manager/policy_manager.cpp')
-rw-r--r--src/policy_manager/policy_manager.cpp20
1 files changed, 6 insertions, 14 deletions
diff --git a/src/policy_manager/policy_manager.cpp b/src/policy_manager/policy_manager.cpp
index 448c18d..fb468df 100644
--- a/src/policy_manager/policy_manager.cpp
+++ b/src/policy_manager/policy_manager.cpp
@@ -20,7 +20,6 @@
#include <istream>
#include <thread>
#include <map>
-#include <queue>
#include <systemd/sd-event.h>
#include <json-c/json.h>
#include "policy_manager.hpp"
@@ -59,17 +58,10 @@ typedef struct CarElement {
int changed;
} CarElement;
-typedef struct EventInfo {
- int event;
- std::string role;
- uint64_t delay;
-} EventInfo;
-
struct sd_event* event_loop;
std::map<int, struct sd_event_source*> event_source_list;
std::map<int, std::string> g_req_role_list;
PolicyManager::CallbackTable callback;
-std::queue<EventInfo> g_event_info_queue;
std::unordered_map<std::string, CarElement> g_prv_car_elements;
std::unordered_map<std::string, CarElement> g_crr_car_elements;
@@ -751,7 +743,7 @@ int PolicyManager::setInputEventData(json_object* json_in) {
}
// Set event info to the queue
- pm::EventInfo event_info;
+ EventInfo event_info;
event_info.event = (event_no | category_no | area_no);
if (nullptr == role) {
event_info.role = std::string("");
@@ -760,7 +752,7 @@ int PolicyManager::setInputEventData(json_object* json_in) {
event_info.role = std::string(role);
}
event_info.delay = 0;
- pm::g_event_info_queue.push(event_info);
+ this->event_info_queue.push(event_info);
return 0;
}
@@ -769,12 +761,12 @@ int PolicyManager::executeStateTransition() {
HMI_DEBUG("wm:pm", "Call");
int ret;
- pm::EventInfo event_info;
+ EventInfo event_info;
- while (!pm::g_event_info_queue.empty()) {
+ while (!this->event_info_queue.empty()) {
// Get event info from queue and delete
- event_info = pm::g_event_info_queue.front();
- pm::g_event_info_queue.pop();
+ event_info = this->event_info_queue.front();
+ this->event_info_queue.pop();
// Set event info for checking policy
ret = checkPolicyEntry(event_info.event, event_info.delay, event_info.role);