diff options
author | Yuta Doi <yuta-d@witz-inc.co.jp> | 2018-06-20 21:17:41 +0900 |
---|---|---|
committer | Yuta Doi <yuta-d@witz-inc.co.jp> | 2018-06-20 21:17:41 +0900 |
commit | 64643feb50a184030a6f25ba9354d5fe41df49c8 (patch) | |
tree | bbd2d04b20e41c17e22933790cb079ab7fc2470d | |
parent | cffad8be821cf9226bce993f18a2451fc9fd8646 (diff) |
Modify member variable name
Change-Id: Ic9100cfc33c664d3dfa935c4c7131efd8dd2f1f7
Signed-off-by: Yuta Doi <yuta-d@witz-inc.co.jp>
-rw-r--r-- | src/app.cpp | 60 | ||||
-rw-r--r-- | src/app.hpp | 16 | ||||
-rw-r--r-- | src/layout_manager/layout.cpp | 8 | ||||
-rw-r--r-- | src/layout_manager/layout.hpp | 2 | ||||
-rw-r--r-- | src/low_can_client.cpp | 82 | ||||
-rw-r--r-- | src/low_can_client.hpp | 20 | ||||
-rw-r--r-- | src/main.cpp | 16 | ||||
-rw-r--r-- | src/policy_manager/policy_manager.cpp | 44 | ||||
-rw-r--r-- | src/policy_manager/policy_manager.hpp | 12 |
9 files changed, 130 insertions, 130 deletions
diff --git a/src/app.cpp b/src/app.cpp index 4f7a971..4fbf639 100644 --- a/src/app.cpp +++ b/src/app.cpp @@ -122,13 +122,13 @@ void App::updateCarStates(json_object* json_out) { // Update state and emit event if ("parking_brake_off" == parking_brake_state) { - this->crr_car_info_.parking_brake_stt = false; + this->crr_car_info.parking_brake_stt = false; #if 0 // FOR ALS: using lightstatus brake, so do not emit parking brake event this->emitParkingBrakeOff(); #endif } else if ("parking_brake_on" == parking_brake_state) { - this->crr_car_info_.parking_brake_stt = true; + this->crr_car_info.parking_brake_stt = true; #if 0 // FOR ALS: using lightstatus brake, so do not emit parking brake event this->emitParkingBrakeOn(); #endif @@ -153,10 +153,10 @@ void App::updateCarStates(json_object* json_out) { // Update state if ("accel_pedal_off" == accel_pedal_state) { - this->crr_car_info_.accel_pedal_stt = false; + this->crr_car_info.accel_pedal_stt = false; } else if ("accel_pedal_on" == accel_pedal_state) { - this->crr_car_info_.accel_pedal_stt = true; + this->crr_car_info.accel_pedal_stt = true; } else { HMI_DEBUG("wm", "Unknown accel pedal state"); @@ -178,11 +178,11 @@ void App::updateCarStates(json_object* json_out) { // Update state and emit event if ("lightstatus_brake_off" == lightstatus_brake_state) { - this->crr_car_info_.lightstatus_brake_stt = false; + this->crr_car_info.lightstatus_brake_stt = false; this->emitLightstatusBrakeOff(); } else if ("lightstatus_brake_on" == lightstatus_brake_state) { - this->crr_car_info_.lightstatus_brake_stt = true; + this->crr_car_info.lightstatus_brake_stt = true; this->emitLightstatusBrakeOn(); } else { @@ -205,11 +205,11 @@ void App::updateCarStates(json_object* json_out) { // Emit car event if ("car_stop" == car_state) { - this->crr_car_info_.car_stt = "stop"; + this->crr_car_info.car_stt = "stop"; this->emitCarStop(); } else if ("car_run" == car_state) { - this->crr_car_info_.car_stt = "run"; + this->crr_car_info.car_stt = "run"; this->emitCarRun(); } else { @@ -232,11 +232,11 @@ void App::updateCarStates(json_object* json_out) { // Update state and emit event if ("lamp_off" == lamp_state) { - this->crr_car_info_.headlamp_stt = false; + this->crr_car_info.headlamp_stt = false; this->emitHeadlampOff(); } else if ("lamp_on" == lamp_state) { - this->crr_car_info_.headlamp_stt = true; + this->crr_car_info.headlamp_stt = true; this->emitHeadlampOn(); } else { @@ -365,11 +365,11 @@ App::App(wl::display *d) } // Initialize current car info - this->crr_car_info_.parking_brake_stt = true; - this->crr_car_info_.accel_pedal_stt = false; - this->crr_car_info_.accel_pedal_pos = 0; - this->crr_car_info_.car_stt = "stop"; - this->crr_car_info_.headlamp_stt = false; + this->crr_car_info.parking_brake_stt = true; + this->crr_car_info.accel_pedal_stt = false; + this->crr_car_info.accel_pedal_pos = 0; + this->crr_car_info.car_stt = "stop"; + this->crr_car_info.headlamp_stt = false; } int App::init() { @@ -391,16 +391,16 @@ int App::init() { #endif // Initialize PolicyManager - this->pm_.initialize(); + this->pm.initialize(); // Register callback to PolicyManager PolicyManager::CallbackTable callback; callback.onStateTransitioned = rm::onStateTransitioned; callback.onError = rm::onError; - this->pm_.registerCallback(callback); + this->pm.registerCallback(callback); // Initialize LayoutManager - this->lm_.initialize(); + this->lm.initialize(); // Make afb event for (int i=Event_Val_Min; i<=Event_Val_Max; i++) { @@ -525,9 +525,9 @@ void App::layout_commit() { const char* App::convertDrawingNameToRole(char const *drawing_name) { const char* role; - if (this->drawingname2role_.find(drawing_name) != this->drawingname2role_.end()) { + if (this->drawingname2role.find(drawing_name) != this->drawingname2role.end()) { // drawing_name is old role. So convert to new role. - role = this->drawingname2role_[drawing_name].c_str(); + role = this->drawingname2role[drawing_name].c_str(); } else { // drawing_name is new role. @@ -599,10 +599,10 @@ void App::allocateWindowResource(char const *event, char const *drawing_name, } // Set input event data - this->pm_.setInputEventData(json_in); + this->pm.setInputEventData(json_in); // Execute state transition - this->pm_.executeStateTransition(); + this->pm.executeStateTransition(); // Release json_object json_object_put(json_in); @@ -832,7 +832,7 @@ result<int> App::api_request_surface(char const *drawing_name) { } // Set map of (role, drawing_name) - this->role2drawingname_[role] = std::string(drawing_name); + this->role2drawingname[role] = std::string(drawing_name); return Ok<int>(id); } @@ -1021,7 +1021,7 @@ void App::deactivate(std::string role) { HMI_ERROR("wm", "Surface does not exist"); return; } - std::string drawing_name = this->role2drawingname_[role]; + std::string drawing_name = this->role2drawingname[role]; HMI_DEBUG("wm", "Deactivate role:%s (drawing_name:%s)", role.c_str(), drawing_name.c_str()); @@ -1059,7 +1059,7 @@ void App::setSurfaceSize(const char* role, const char* area) { HMI_DEBUG("wm", "role:%s area:%s", role, area); // Get size of current area - compositor::rect size = this->lm_.getAreaSize(area); + compositor::rect size = this->lm.getAreaSize(area); // Set destination to the display rectangle auto const &surface_id = this->lookup_id(role); @@ -1081,7 +1081,7 @@ void App::setSurfaceSize(const char* role, const char* area) { size.x, size.y, size.w, size.h); // Emit syncDraw event - const char* drawing_name = this->role2drawingname_[role].c_str(); + const char* drawing_name = this->role2drawingname[role].c_str(); this->emit_syncdraw(drawing_name, area, size.x, size.y, size.w, size.h); @@ -1090,7 +1090,7 @@ void App::setSurfaceSize(const char* role, const char* area) { } void App::setAccelPedalPos(double val) { - this->crr_car_info_.accel_pedal_pos = val; + this->crr_car_info.accel_pedal_pos = val; } extern const char* kDefaultAppDb; @@ -1148,12 +1148,12 @@ int App::loadAppDb() { } HMI_DEBUG("wm", "> role:%s", role); - this->drawingname2role_[app] = std::string(role); + this->drawingname2role[app] = std::string(role); } // Check - for(auto itr = this->drawingname2role_.begin(); - itr != this->drawingname2role_.end(); ++itr) { + for(auto itr = this->drawingname2role.begin(); + itr != this->drawingname2role.end(); ++itr) { HMI_DEBUG("wm", "app:%s role:%s", itr->first.c_str(), itr->second.c_str()); } diff --git a/src/app.hpp b/src/app.hpp index 84b02c0..83b887f 100644 --- a/src/app.hpp +++ b/src/app.hpp @@ -253,12 +253,12 @@ struct App { private: typedef std::map<std::string, std::string> RoleState; - PolicyManager pm_; - LayoutManager lm_; - std::unordered_map<std::string, std::string> drawingname2role_; - std::unordered_map<std::string, std::string> role2drawingname_; - std::unordered_map<int, int> appid2role_; - CarInfo crr_car_info_; + PolicyManager pm; + LayoutManager lm; + std::unordered_map<std::string, std::string> drawingname2role; + std::unordered_map<std::string, std::string> role2drawingname; + std::unordered_map<int, int> appid2role; + CarInfo crr_car_info; std::map<std::string, RoleState> crr_layer_state; void updateCarStates(json_object* json_out); @@ -268,8 +268,8 @@ private: const char* convertDrawingNameToRole(char const *drawing_name); #if 0 - struct id_allocator app_id_alloc_; - std::unordered_map<std::string, int> appname2appid_; + struct id_allocator app_id_alloc; + std::unordered_map<std::string, int> appname2appid; #endif optional<int> lookup_id(char const *name); diff --git a/src/layout_manager/layout.cpp b/src/layout_manager/layout.cpp index 49381cc..a3952c4 100644 --- a/src/layout_manager/layout.cpp +++ b/src/layout_manager/layout.cpp @@ -41,7 +41,7 @@ int LayoutManager::initialize() { } compositor::rect LayoutManager::getAreaSize(const char* area) { - return this->area2size_[area]; + return this->area2size[area]; } extern const char* kDefaultLayoutDb; @@ -106,12 +106,12 @@ int LayoutManager::loadLayoutDb() { area_size.w = jh::getIntFromJson(json_rect, "w"); area_size.h = jh::getIntFromJson(json_rect, "h"); - this->area2size_[area] = area_size; + this->area2size[area] = area_size; } // Check - for(auto itr = this->area2size_.begin(); - itr != this->area2size_.end(); ++itr) { + for(auto itr = this->area2size.begin(); + itr != this->area2size.end(); ++itr) { HMI_DEBUG("wm:lm", "area:%s x:%d y:%d w:%d h:%d", itr->first.c_str(), itr->second.x, itr->second.y, itr->second.w, itr->second.h); diff --git a/src/layout_manager/layout.hpp b/src/layout_manager/layout.hpp index 648d80e..952765f 100644 --- a/src/layout_manager/layout.hpp +++ b/src/layout_manager/layout.hpp @@ -55,7 +55,7 @@ private: LayoutManager(LayoutManager &&) = delete; LayoutManager &operator=(LayoutManager &&) = delete; - std::unordered_map<std::string, compositor::rect> area2size_; + std::unordered_map<std::string, compositor::rect> area2size; int loadLayoutDb(); }; diff --git a/src/low_can_client.cpp b/src/low_can_client.cpp index e0568e5..4afe4c3 100644 --- a/src/low_can_client.cpp +++ b/src/low_can_client.cpp @@ -27,14 +27,14 @@ extern "C" { namespace wm { LowCanClient::LowCanClient() : - vehicle_speed_(0), - trans_gear_pos_(0), - headlamp_status_(FALSE), - parking_brake_status_(TRUE), - accel_pedal_pos_(0), - accel_pedal_stt_(FALSE), - lightstatus_brake_status_(TRUE), - is_changed_accel_pedal_stt_(false) + vehicle_speed(0), + trans_gear_pos(0), + headlamp_status(FALSE), + parking_brake_status(TRUE), + accel_pedal_pos(0), + accel_pedal_stt(FALSE), + lightstatus_brake_status(TRUE), + is_changed_accel_pedal_stt(false) { HMI_DEBUG("wm:lcc", "Call"); } @@ -62,12 +62,12 @@ void LowCanClient::initialize() { // Set Event json_object *json_obj = json_object_new_object(); json_object_object_add(json_obj, "event", - json_object_new_string(this->kSignalName_[i])); + json_object_new_string(this->kSignalName[i])); // Set filter - if (0 != strcmp("", this->kFilterValue_[i])) { + if (0 != strcmp("", this->kFilterValue[i])) { json_object_object_add(json_obj, "filter", - json_tokener_parse(this->kFilterValue_[i])); + json_tokener_parse(this->kFilterValue[i])); } HMI_DEBUG("wm:lcc", "subscribe message:%s", json_object_get_string(json_obj)); @@ -88,51 +88,51 @@ const char* LowCanClient::analyzeCanSignal(struct json_object *object) { const char* name = jh::getStringFromJson(object, "name"); HMI_DEBUG("wm:lcc", "CAN signal name:%s", name); - if (strstr(name, this->kSignalName_[SignalNoVehicliSpeed])) { + if (strstr(name, this->kSignalName[SignalNoVehicliSpeed])) { // Update vehicle speed - this->vehicle_speed_ = jh::getIntFromJson(object, "value"); - HMI_DEBUG("wm:lcc", "Update vehicle speed:%d", this->vehicle_speed_); + this->vehicle_speed = jh::getIntFromJson(object, "value"); + HMI_DEBUG("wm:lcc", "Update vehicle speed:%d", this->vehicle_speed); } - else if (strstr(name, this->kSignalName_[SignalNoTransGearPos])) { + else if (strstr(name, this->kSignalName[SignalNoTransGearPos])) { // Update transmission gear position - this->trans_gear_pos_ = jh::getIntFromJson(object, "value"); - HMI_DEBUG("wm:lcc", "Update transmission gear position:%d", this->trans_gear_pos_); + this->trans_gear_pos = jh::getIntFromJson(object, "value"); + HMI_DEBUG("wm:lcc", "Update transmission gear position:%d", this->trans_gear_pos); } - else if (strstr(name, this->kSignalName_[SignalNoHeadlame])) { + else if (strstr(name, this->kSignalName[SignalNoHeadlame])) { // Update headlamp status - this->headlamp_status_ = jh::getBoolFromJson(object, "value"); - HMI_DEBUG("wm:lcc", "Update headlamp status:%d", this->headlamp_status_); + this->headlamp_status = jh::getBoolFromJson(object, "value"); + HMI_DEBUG("wm:lcc", "Update headlamp status:%d", this->headlamp_status); } - else if (strstr(name, this->kSignalName_[SignalNoParkingBrake])) { + else if (strstr(name, this->kSignalName[SignalNoParkingBrake])) { // Update parking gear status - this->parking_brake_status_ = jh::getBoolFromJson(object, "value"); - HMI_DEBUG("wm:lcc", "Update parking brake status:%d", this->parking_brake_status_); + this->parking_brake_status = jh::getBoolFromJson(object, "value"); + HMI_DEBUG("wm:lcc", "Update parking brake status:%d", this->parking_brake_status); } - else if (strstr(name, this->kSignalName_[SignalNoAccelPedalPos])) { + else if (strstr(name, this->kSignalName[SignalNoAccelPedalPos])) { // Clear flag for whether accel pedal state is changed - this->is_changed_accel_pedal_stt_ = false; + this->is_changed_accel_pedal_stt = false; // Update accelerator pedal status - this->accel_pedal_pos_ = jh::getDoubleFromJson(object, "value"); - HMI_DEBUG("wm:lcc", "Update accelerator pedal position:%lf", this->accel_pedal_pos_); + this->accel_pedal_pos = jh::getDoubleFromJson(object, "value"); + HMI_DEBUG("wm:lcc", "Update accelerator pedal position:%lf", this->accel_pedal_pos); bool accel_pedal_stt; - if (0 != this->accel_pedal_pos_) { + if (0 != this->accel_pedal_pos) { accel_pedal_stt = true; } else { accel_pedal_stt = false; } - if (accel_pedal_stt != this->accel_pedal_stt_) { - this->is_changed_accel_pedal_stt_ = true; - this->accel_pedal_stt_ = accel_pedal_stt; + if (accel_pedal_stt != this->accel_pedal_stt) { + this->is_changed_accel_pedal_stt = true; + this->accel_pedal_stt = accel_pedal_stt; } } - else if (strstr(name, this->kSignalName_[SignalNoLightstatusBrake])) { + else if (strstr(name, this->kSignalName[SignalNoLightstatusBrake])) { // Update lightstatus brake status - this->lightstatus_brake_status_ = jh::getBoolFromJson(object, "value"); - HMI_DEBUG("wm:lcc", "Update lightstatus brake status:%d", this->lightstatus_brake_status_); + this->lightstatus_brake_status = jh::getBoolFromJson(object, "value"); + HMI_DEBUG("wm:lcc", "Update lightstatus brake status:%d", this->lightstatus_brake_status); } return name; @@ -141,43 +141,43 @@ const char* LowCanClient::analyzeCanSignal(struct json_object *object) { bool LowCanClient::isChangedAccelPedalState() { HMI_DEBUG("wm:lcc", "Call"); - return this->is_changed_accel_pedal_stt_; + return this->is_changed_accel_pedal_stt; } int LowCanClient::getCurrentTransGearState() { HMI_DEBUG("wm:lcc", "Call"); - return this->trans_gear_pos_; + return this->trans_gear_pos; } bool LowCanClient::getCurrentHeadlampState() { HMI_DEBUG("wm:lcc", "Call"); - return (bool)this->headlamp_status_; + return (bool)this->headlamp_status; } bool LowCanClient::getCurrentParkingBrakeState() { HMI_DEBUG("wm:lcc", "Call"); - return (bool)this->parking_brake_status_; + return (bool)this->parking_brake_status; } double LowCanClient::getCurrentAccelPedalPosition() { HMI_DEBUG("wm:lcc", "Call"); - return this->accel_pedal_pos_; + return this->accel_pedal_pos; } bool LowCanClient::getCurrentAccelPedalState() { HMI_DEBUG("wm:lcc", "Call"); - return this->accel_pedal_stt_; + return this->accel_pedal_stt; } bool LowCanClient::getCurrentLightstatusBrakeState() { HMI_DEBUG("wm:lcc", "Call"); - return (bool)this->lightstatus_brake_status_; + return (bool)this->lightstatus_brake_status; } diff --git a/src/low_can_client.hpp b/src/low_can_client.hpp index 390d752..3eb654e 100644 --- a/src/low_can_client.hpp +++ b/src/low_can_client.hpp @@ -45,7 +45,7 @@ public: SignalNoMax = SignalNum - 1, }; - const std::vector<const char*> kSignalName_{ + const std::vector<const char*> kSignalName{ "vehicle.speed", "transmission_gear_position", "headlamp_status", @@ -86,7 +86,7 @@ private: TransGearPosValN, }; - const std::vector<const char*> kFilterValue_{ + const std::vector<const char*> kFilterValue{ "", // vehicle.speed "", // transmission_gear_position "", // headlamp_status @@ -95,15 +95,15 @@ private: "", // lightstatus.brake }; - int vehicle_speed_; - int trans_gear_pos_; - json_bool headlamp_status_; - json_bool parking_brake_status_; - double accel_pedal_pos_; - bool accel_pedal_stt_; - json_bool lightstatus_brake_status_; + int vehicle_speed; + int trans_gear_pos; + json_bool headlamp_status; + json_bool parking_brake_status; + double accel_pedal_pos; + bool accel_pedal_stt; + json_bool lightstatus_brake_status; - bool is_changed_accel_pedal_stt_; + bool is_changed_accel_pedal_stt; }; } // namespace wm diff --git a/src/main.cpp b/src/main.cpp index e07c2a1..f7ec927 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -40,10 +40,10 @@ typedef struct wmClientCtxt{ struct afb_instance { std::unique_ptr<wl::display> display; - wm::LowCanClient lcc_; + wm::LowCanClient lcc; wm::App app; - afb_instance() : display{new wl::display}, lcc_{}, app{this->display.get()} {} + afb_instance() : display{new wl::display}, lcc{}, app{this->display.get()} {} int init(); }; @@ -53,7 +53,7 @@ std::mutex binding_m; int afb_instance::init() { // Initialize LowCanClient class - this->lcc_.initialize(); + this->lcc.initialize(); // Initialize App class return this->app.init(); @@ -654,7 +654,7 @@ void on_event(const char *event, struct json_object *object){ // If receive low can signal if (strstr(event, "low-can")) { - wm::LowCanClient *lcc = &(g_afb_instance->lcc_); + wm::LowCanClient *lcc = &(g_afb_instance->lcc); wm::App *app = &(g_afb_instance->app); // Analyze low can signal @@ -662,7 +662,7 @@ void on_event(const char *event, struct json_object *object){ // If car info is updated, set event name const char *can_event = nullptr; - if (strstr(signal_name, lcc->kSignalName_[lcc->SignalNoParkingBrake])) { + if (strstr(signal_name, lcc->kSignalName[lcc->SignalNoParkingBrake])) { HMI_DEBUG("wm", "Parking Brake state is changed"); // Set event @@ -673,7 +673,7 @@ void on_event(const char *event, struct json_object *object){ can_event = "parking_brake_off"; } } - else if (strstr(signal_name, lcc->kSignalName_[lcc->SignalNoAccelPedalPos])) { + else if (strstr(signal_name, lcc->kSignalName[lcc->SignalNoAccelPedalPos])) { // Update accel pedal position app->setAccelPedalPos(lcc->getCurrentAccelPedalPosition()); @@ -689,7 +689,7 @@ void on_event(const char *event, struct json_object *object){ } } } - else if (strstr(signal_name, lcc->kSignalName_[lcc->SignalNoHeadlame])) { + else if (strstr(signal_name, lcc->kSignalName[lcc->SignalNoHeadlame])) { HMI_DEBUG("wm", "Headlamp state is changed"); // Set event @@ -700,7 +700,7 @@ void on_event(const char *event, struct json_object *object){ can_event = "headlamp_off"; } } - else if (strstr(signal_name, lcc->kSignalName_[lcc->SignalNoLightstatusBrake])) { + else if (strstr(signal_name, lcc->kSignalName[lcc->SignalNoLightstatusBrake])) { HMI_DEBUG("wm", "Lightstatus Brake state is changed"); // Set event diff --git a/src/policy_manager/policy_manager.cpp b/src/policy_manager/policy_manager.cpp index 19a6a0b..448c18d 100644 --- a/src/policy_manager/policy_manager.cpp +++ b/src/policy_manager/policy_manager.cpp @@ -84,12 +84,12 @@ std::unordered_map<std::string, LayoutState> g_default_layouts; PolicyManager::PolicyManager() : - eventname2no_(), - categoryname2no_(), - areaname2no_(), - role2category_(), - category2role_(), - role2defaultarea_() + eventname2no(), + categoryname2no(), + areaname2no(), + role2category(), + category2role(), + role2defaultarea() { HMI_DEBUG("wm:pm", "Call"); } @@ -102,17 +102,17 @@ int PolicyManager::initialize() { // Create convert map for (int i = stm::gStmEventNoMin; i <= stm::gStmEventNoMax; i++) { HMI_DEBUG("wm:pm", "event name:%s no:%d", stm::gStmEventName[i], stm::gStmEventNo[i]); - this->eventname2no_[stm::gStmEventName[i]] = stm::gStmEventNo[i]; + this->eventname2no[stm::gStmEventName[i]] = stm::gStmEventNo[i]; } for (int i = stm::gStmCategoryNoMin; i <= stm::gStmCategoryNoMax; i++) { HMI_DEBUG("wm:pm", "category name:%s no:%d", stm::gStmCategoryName[i], stm::gStmCategoryNo[i]); - this->categoryname2no_[stm::gStmCategoryName[i]] = stm::gStmCategoryNo[i]; + this->categoryname2no[stm::gStmCategoryName[i]] = stm::gStmCategoryNo[i]; } for (int i = stm::gStmAreaNoMin; i <= stm::gStmAreaNoMax; i++) { HMI_DEBUG("wm:pm", "area name:%s no:%d", stm::gStmAreaName[i], stm::gStmAreaNo[i]); - this->areaname2no_[stm::gStmAreaName[i]] = stm::gStmAreaNo[i]; + this->areaname2no[stm::gStmAreaName[i]] = stm::gStmAreaNo[i]; } // Load role.db @@ -718,7 +718,7 @@ int PolicyManager::setInputEventData(json_object* json_in) { int event_no = 0; if (nullptr != event) { // Convert name to number - event_no = this->eventname2no_[event]; + event_no = this->eventname2no[event]; HMI_DEBUG("wm:pm", "event(%s:%d)", event, event_no); } @@ -729,7 +729,7 @@ int PolicyManager::setInputEventData(json_object* json_in) { HMI_DEBUG("wm:pm", "role(%s)", role); // Convert role to category - const char* category = this->role2category_[role].c_str(); + const char* category = this->role2category[role].c_str(); if (0 == strcmp("", category)) { HMI_ERROR("wm:pm", "Error!!"); return -1; @@ -737,7 +737,7 @@ int PolicyManager::setInputEventData(json_object* json_in) { HMI_DEBUG("wm:pm", "category(%s)", category); // Convert name to number - category_no = categoryname2no_[category]; + category_no = categoryname2no[category]; HMI_DEBUG("wm:pm", "role(%s), category(%s:%d)", role, category, category_no); } @@ -746,7 +746,7 @@ int PolicyManager::setInputEventData(json_object* json_in) { int area_no = 0; if (nullptr != area) { // Convert name to number - area_no = areaname2no_[area]; + area_no = areaname2no[area]; HMI_DEBUG("wm:pm", "area(%s:%d)", area, area_no); } @@ -857,26 +857,26 @@ int PolicyManager::loadRoleDb() { std::string role = this->deleteSpace(*itr); std::string area = this->deleteSpace(vct_areas[0]); - this->role2category_[role] = std::string(category); - this->role2defaultarea_[role] = area; + this->role2category[role] = std::string(category); + this->role2defaultarea[role] = area; } - this->category2role_[std::string(category)] = std::string(roles); + this->category2role[std::string(category)] = std::string(roles); } // Check - HMI_DEBUG("wm:pm", "Check role2category_"); - for (auto& x:this->role2category_){ + HMI_DEBUG("wm:pm", "Check role2category"); + for (auto& x:this->role2category){ HMI_DEBUG("wm:pm", "key:%s, val:%s", x.first.c_str(), x.second.c_str()); } - HMI_DEBUG("wm:pm", "Check role2defaultarea_"); - for (auto& x:this->role2defaultarea_){ + HMI_DEBUG("wm:pm", "Check role2defaultarea"); + for (auto& x:this->role2defaultarea){ HMI_DEBUG("wm:pm", "key:%s, val:%s", x.first.c_str(), x.second.c_str()); } - HMI_DEBUG("wm:pm", "Check category2role_"); - for (auto& x:this->category2role_){ + HMI_DEBUG("wm:pm", "Check category2role"); + for (auto& x:this->category2role){ HMI_DEBUG("wm:pm", "key:%s, val:%s", x.first.c_str(), x.second.c_str()); } diff --git a/src/policy_manager/policy_manager.hpp b/src/policy_manager/policy_manager.hpp index 3e380f0..6233a77 100644 --- a/src/policy_manager/policy_manager.hpp +++ b/src/policy_manager/policy_manager.hpp @@ -53,13 +53,13 @@ private: PolicyManager &operator=(PolicyManager &&) = delete; // Convert map - std::unordered_map<std::string, int> eventname2no_; - std::unordered_map<std::string, int> categoryname2no_; - std::unordered_map<std::string, int> areaname2no_; + std::unordered_map<std::string, int> eventname2no; + std::unordered_map<std::string, int> categoryname2no; + std::unordered_map<std::string, int> areaname2no; - std::unordered_map<std::string, std::string> role2category_; - std::unordered_map<std::string, std::string> category2role_; - std::unordered_map<std::string, std::string> role2defaultarea_; + std::unordered_map<std::string, std::string> role2category; + std::unordered_map<std::string, std::string> category2role; + std::unordered_map<std::string, std::string> role2defaultarea; void initializeLocalState(); int initializeSdEventLoop(); |