From 25989911010af46f8f943ed765cffca412ab4afd Mon Sep 17 00:00:00 2001 From: Somin Kim Date: Wed, 6 Apr 2016 11:17:31 +0900 Subject: [PATCH] Applying Tizen C++ coding style to provider initialization Change-Id: Icb44282ca2adf5309471e11ef93198ed6220a082 Signed-off-by: Somin Kim --- ...ext_provider.h => CustomContextProvider.h} | 26 +++++++++++-------- ...ext_provider.h => DeviceContextProvider.h} | 12 +++++---- ...text_provider.h => PlaceContextProvider.h} | 12 +++++---- ...provider.h => StatisticsContextProvider.h} | 12 +++++---- src/custom/custom_context_provider.cpp | 4 +-- src/device/device_context_provider.cpp | 4 +-- src/place/place_context_provider.cpp | 4 +-- .../statistics_context_provider.cpp | 4 +-- 8 files changed, 44 insertions(+), 34 deletions(-) rename include/{custom_context_provider.h => CustomContextProvider.h} (56%) rename include/{place_context_provider.h => DeviceContextProvider.h} (75%) rename include/{device_context_provider.h => PlaceContextProvider.h} (76%) rename include/{statistics_context_provider.h => StatisticsContextProvider.h} (74%) diff --git a/include/custom_context_provider.h b/include/CustomContextProvider.h similarity index 56% rename from include/custom_context_provider.h rename to include/CustomContextProvider.h index 918dfa6..c75d63e 100644 --- a/include/custom_context_provider.h +++ b/include/CustomContextProvider.h @@ -14,20 +14,24 @@ * limitations under the License. */ -#ifndef __CONTEXT_CUSTOM_CONTEXT_PROVIDER_H__ -#define __CONTEXT_CUSTOM_CONTEXT_PROVIDER_H__ +#ifndef _CONTEXT_CUSTOM_CONTEXT_PROVIDER_H_ +#define _CONTEXT_CUSTOM_CONTEXT_PROVIDER_H_ namespace ctx { - bool init_custom_context_provider(); + + bool initCustomContextProvider(); namespace custom_context_provider { - int addItem(std::string subject, std::string name, ctx::Json tmpl, const char* owner, bool is_init = false); - int removeItem(std::string subject); - int publishData(std::string subject, ctx::Json fact); - ContextProviderBase* create(void* data); - void destroy(void* data); - } -} + int addItem(std::string subject, std::string name, ctx::Json tmpl, const char* owner, bool isInit = false); + int removeItem(std::string subject); + int publishData(std::string subject, ctx::Json fact); + + ContextProviderBase* create(void* data); + void destroy(void* data); + + } /* namespace custom_context_provider */ + +} /* namespace ctx */ -#endif //__CONTEXT_CUSTOM_CONTEXT_PROVIDER_H__ +#endif /* End of _CONTEXT_CUSTOM_CONTEXT_PROVIDER_H_ */ diff --git a/include/place_context_provider.h b/include/DeviceContextProvider.h similarity index 75% rename from include/place_context_provider.h rename to include/DeviceContextProvider.h index 407838b..1e47323 100644 --- a/include/place_context_provider.h +++ b/include/DeviceContextProvider.h @@ -14,11 +14,13 @@ * limitations under the License. */ -#ifndef __CONTEXT_PLACE_CONTEXT_PROVIDER_H__ -#define __CONTEXT_PLACE_CONTEXT_PROVIDER_H__ +#ifndef _CONTEXT_DEVICE_CONTEXT_PROVIDER_H_ +#define _CONTEXT_DEVICE_CONTEXT_PROVIDER_H_ namespace ctx { - bool init_place_context_provider(); -} -#endif /* __CONTEXT_PLACE_CONTEXT_PROVIDER_H__ */ + bool initDeviceContextProvider(); + +} /* namespace ctx */ + +#endif /* End of _CONTEXT_DEVICE_CONTEXT_PROVIDER_H_ */ diff --git a/include/device_context_provider.h b/include/PlaceContextProvider.h similarity index 76% rename from include/device_context_provider.h rename to include/PlaceContextProvider.h index 09ef1e7..e7585b0 100644 --- a/include/device_context_provider.h +++ b/include/PlaceContextProvider.h @@ -14,11 +14,13 @@ * limitations under the License. */ -#ifndef __CONTEXT_DEVICE_CONTEXT_PROVIDER_H__ -#define __CONTEXT_DEVICE_CONTEXT_PROVIDER_H__ +#ifndef _CONTEXT_PLACE_CONTEXT_PROVIDER_H_ +#define _CONTEXT_PLACE_CONTEXT_PROVIDER_H_ namespace ctx { - bool init_device_context_provider(); -} -#endif //__CONTEXT_DEVICE_CONTEXT_PROVIDER_H__ + bool initPlaceContextProvider(); + +} /* namespace ctx */ + +#endif /* End of _CONTEXT_PLACE_CONTEXT_PROVIDER_H_ */ diff --git a/include/statistics_context_provider.h b/include/StatisticsContextProvider.h similarity index 74% rename from include/statistics_context_provider.h rename to include/StatisticsContextProvider.h index b45c3fd..f356719 100644 --- a/include/statistics_context_provider.h +++ b/include/StatisticsContextProvider.h @@ -14,11 +14,13 @@ * limitations under the License. */ -#ifndef __CONTEXT_STATISTICS_CONTEXT_PROVIDER_H__ -#define __CONTEXT_STATISTICS_CONTEXT_PROVIDER_H__ +#ifndef _CONTEXT_STATISTICS_CONTEXT_PROVIDER_H_ +#define _CONTEXT_STATISTICS_CONTEXT_PROVIDER_H_ namespace ctx { - bool init_statistics_context_provider(); -} -#endif /* __CONTEXT_STATISTICS_CONTEXT_PROVIDER_H__ */ + bool initStatisticsContextProvider(); + +} /* namespace ctx */ + +#endif /* End of _CONTEXT_STATISTICS_CONTEXT_PROVIDER_H_ */ diff --git a/src/custom/custom_context_provider.cpp b/src/custom/custom_context_provider.cpp index 88aca00..5bec97e 100644 --- a/src/custom/custom_context_provider.cpp +++ b/src/custom/custom_context_provider.cpp @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include "custom_base.h" std::map custom_map; @@ -59,7 +59,7 @@ EXTAPI void ctx::custom_context_provider::destroy(void *data) } } -EXTAPI bool ctx::init_custom_context_provider() +EXTAPI bool ctx::initCustomContextProvider() { // Create custom template db std::string q = std::string("CREATE TABLE IF NOT EXISTS context_trigger_custom_template ") diff --git a/src/device/device_context_provider.cpp b/src/device/device_context_provider.cpp index 39fcf7d..1e42e20 100644 --- a/src/device/device_context_provider.cpp +++ b/src/device/device_context_provider.cpp @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include "system/system_types.h" #include "social/social_types.h" @@ -75,7 +75,7 @@ void registerProvider(const char *subject, const char *privilege) provider::submit_trigger_item(); } -EXTAPI bool ctx::init_device_context_provider() +EXTAPI bool ctx::initDeviceContextProvider() { registerProvider(DEVICE_ST_SUBJ_ALARM, NULL); registerProvider(DEVICE_ST_SUBJ_TIME, NULL); diff --git a/src/place/place_context_provider.cpp b/src/place/place_context_provider.cpp index 6bcf1c3..c3efaef 100644 --- a/src/place/place_context_provider.cpp +++ b/src/place/place_context_provider.cpp @@ -17,7 +17,7 @@ #include #include #include -#include +#include #ifdef _MOBILE_ #include "geofence/place_geofence.h" @@ -36,7 +36,7 @@ void registerProvider(const char *subject, const char *privilege) ctx::context_manager::registerProvider(subject, providerInfo); } -EXTAPI bool ctx::init_place_context_provider() +EXTAPI bool ctx::initPlaceContextProvider() { #ifdef _MOBILE_ registerProvider(PLACE_SUBJ_GEOFENCE, PLACE_PRIV_GEOFENCE); diff --git a/src/statistics/statistics_context_provider.cpp b/src/statistics/statistics_context_provider.cpp index 2d305eb..1fa29ee 100644 --- a/src/statistics/statistics_context_provider.cpp +++ b/src/statistics/statistics_context_provider.cpp @@ -16,7 +16,7 @@ #include #include #include -#include +#include #include "app/app_stats_provider.h" @@ -43,7 +43,7 @@ void registerProvider(const char *subject, const char *privilege) ctx::context_manager::registerProvider(subject, providerInfo); } -EXTAPI bool ctx::init_statistics_context_provider() +EXTAPI bool ctx::initStatisticsContextProvider() { app_statistics_provider::create(NULL); registerProvider(APP_SUBJ_RECENTLY_USED, APP_HISTORY_PRIV); -- 2.34.1