Modified GeofenceMonitorHandle, DeviceProviderBase to apply Tizen C++ coding style 49/65449/4
authorSomin Kim <somin926.kim@samsung.com>
Fri, 8 Apr 2016 05:07:36 +0000 (14:07 +0900)
committerSomin Kim <somin926.kim@samsung.com>
Thu, 14 Apr 2016 06:41:19 +0000 (15:41 +0900)
Change-Id: Ia3b663a0c1527a719d621053a35753f84a3fad9d
Signed-off-by: Somin Kim <somin926.kim@samsung.com>
src/device/DeviceProviderBase.cpp
src/place/geofence/GeofenceMonitorHandle.cpp
src/place/geofence/GeofenceMonitorHandle.h

index b3aab6e..db8e069 100644 (file)
@@ -17,8 +17,8 @@
 #include <system_info.h>
 #include "DeviceProviderBase.h"
 
-ctx::DeviceProviderBase::DeviceProviderBase()
-       __beingSubscribed(false)
+ctx::DeviceProviderBase::DeviceProviderBase() :
+       __beingSubscribed(false)
 {
 }
 
index 52b4b07..cdb60ee 100644 (file)
@@ -142,54 +142,54 @@ void ctx::GeofenceMonitorHandle::__updateState(int fenceId, geofence_state_e sta
        __geoStateMap[fenceId] = state;
 }
 
-static const char* get_state_string(geofence_state_e state)
-{
-       switch (state) {
-               case GEOFENCE_STATE_IN:
-                       return PLACE_GEOFENCE_IN;
-               case GEOFENCE_STATE_OUT:
-                       return PLACE_GEOFENCE_OUT;
-               case GEOFENCE_STATE_UNCERTAIN:
-                       return PLACE_GEOFENCE_UNCERTAIN;
-               default:
-                       return PLACE_GEOFENCE_UNCERTAIN;
-       }
-}
-
 void ctx::GeofenceMonitorHandle::__emitStateChange()
 {
-       geofence_state_e current_state = GEOFENCE_STATE_UNCERTAIN;
+       geofence_state_e currentState = GEOFENCE_STATE_UNCERTAIN;
        int outCount = 0;
 
        for (auto it = __geoStateMap.begin(); it != __geoStateMap.end(); ++it) {
                if (it->second == GEOFENCE_STATE_IN) {
-                       current_state = GEOFENCE_STATE_IN;
+                       currentState = GEOFENCE_STATE_IN;
                        break;
                } else if (it->second == GEOFENCE_STATE_OUT) {
-                       ++ outCount;
+                       ++outCount;
                }
        }
 
-       if (current_state != GEOFENCE_STATE_IN && outCount > 0) {
-               current_state = GEOFENCE_STATE_OUT;
+       if (currentState != GEOFENCE_STATE_IN && outCount > 0) {
+               currentState = GEOFENCE_STATE_OUT;
        }
 
-       if (current_state == __prevState) {
+       if (currentState == __prevState) {
                return;
        }
 
-       __prevState = current_state;
+       __prevState = currentState;
 
        Json option;
        option.set(NULL, PLACE_GEOFENCE_PLACE_ID, __placeId);
 
        Json data;
        data.set(NULL, PLACE_GEOFENCE_PLACE_ID, __placeId);
-       data.set(NULL, PLACE_GEOFENCE_EVENT, get_state_string(current_state));
+       data.set(NULL, PLACE_GEOFENCE_EVENT, __getStateString(currentState));
 
        context_manager::publish(PLACE_SUBJ_GEOFENCE, option, ERR_NONE, data);
 }
 
+const char* ctx::GeofenceMonitorHandle::__getStateString(geofence_state_e state)
+{
+       switch (state) {
+       case GEOFENCE_STATE_IN:
+               return PLACE_GEOFENCE_IN;
+       case GEOFENCE_STATE_OUT:
+               return PLACE_GEOFENCE_OUT;
+       case GEOFENCE_STATE_UNCERTAIN:
+               return PLACE_GEOFENCE_UNCERTAIN;
+       default:
+               return PLACE_GEOFENCE_UNCERTAIN;
+       }
+}
+
 bool ctx::GeofenceMonitorHandle::__fenceListCb(int geofenceId, geofence_h fence, int fenceIndex, int fenceCount, void* userData)
 {
        _D("FenceID: %d, Index: %d, Count: %d", geofenceId, fenceIndex, fenceCount);
index 3f15432..2dc17ff 100644 (file)
@@ -45,6 +45,8 @@ namespace ctx {
                void __updateFence(int fenceId, geofence_manage_e manage);
                void __updateState(int fenceId, geofence_state_e state);
 
+               static const char* __getStateString(geofence_state_e state);
+
                static bool __fenceListCb(int geofenceId, geofence_h fence, int fenceIndex, int fenceCount, void* userData);
                static void __fenceEventCb(int placeId, int geofenceId, geofence_manager_error_e error, geofence_manage_e manage, void* userData);
                static void __fenceStateCb(int geofenceId, geofence_state_e state, void* userData);