From: Somin Kim Date: Wed, 6 Apr 2016 02:17:31 +0000 (+0900) Subject: Applying Tizen C++ coding style to provider initialization X-Git-Tag: submit/tizen/20160408.073002^2~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=25989911010af46f8f943ed765cffca412ab4afd;p=platform%2Fcore%2Fcontext%2Fcontext-provider.git Applying Tizen C++ coding style to provider initialization Change-Id: Icb44282ca2adf5309471e11ef93198ed6220a082 Signed-off-by: Somin Kim --- diff --git a/include/CustomContextProvider.h b/include/CustomContextProvider.h new file mode 100644 index 0000000..c75d63e --- /dev/null +++ b/include/CustomContextProvider.h @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2016 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef _CONTEXT_CUSTOM_CONTEXT_PROVIDER_H_ +#define _CONTEXT_CUSTOM_CONTEXT_PROVIDER_H_ + +namespace ctx { + + bool initCustomContextProvider(); + + namespace custom_context_provider { + + 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 /* End of _CONTEXT_CUSTOM_CONTEXT_PROVIDER_H_ */ diff --git a/include/DeviceContextProvider.h b/include/DeviceContextProvider.h new file mode 100644 index 0000000..1e47323 --- /dev/null +++ b/include/DeviceContextProvider.h @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2015 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef _CONTEXT_DEVICE_CONTEXT_PROVIDER_H_ +#define _CONTEXT_DEVICE_CONTEXT_PROVIDER_H_ + +namespace ctx { + + bool initDeviceContextProvider(); + +} /* namespace ctx */ + +#endif /* End of _CONTEXT_DEVICE_CONTEXT_PROVIDER_H_ */ diff --git a/include/PlaceContextProvider.h b/include/PlaceContextProvider.h new file mode 100644 index 0000000..e7585b0 --- /dev/null +++ b/include/PlaceContextProvider.h @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2015 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef _CONTEXT_PLACE_CONTEXT_PROVIDER_H_ +#define _CONTEXT_PLACE_CONTEXT_PROVIDER_H_ + +namespace ctx { + + bool initPlaceContextProvider(); + +} /* namespace ctx */ + +#endif /* End of _CONTEXT_PLACE_CONTEXT_PROVIDER_H_ */ diff --git a/include/StatisticsContextProvider.h b/include/StatisticsContextProvider.h new file mode 100644 index 0000000..f356719 --- /dev/null +++ b/include/StatisticsContextProvider.h @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2015 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef _CONTEXT_STATISTICS_CONTEXT_PROVIDER_H_ +#define _CONTEXT_STATISTICS_CONTEXT_PROVIDER_H_ + +namespace ctx { + + bool initStatisticsContextProvider(); + +} /* namespace ctx */ + +#endif /* End of _CONTEXT_STATISTICS_CONTEXT_PROVIDER_H_ */ diff --git a/include/custom_context_provider.h b/include/custom_context_provider.h deleted file mode 100644 index 918dfa6..0000000 --- a/include/custom_context_provider.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2016 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef __CONTEXT_CUSTOM_CONTEXT_PROVIDER_H__ -#define __CONTEXT_CUSTOM_CONTEXT_PROVIDER_H__ - -namespace ctx { - bool init_custom_context_provider(); - - 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); - } -} - -#endif //__CONTEXT_CUSTOM_CONTEXT_PROVIDER_H__ diff --git a/include/device_context_provider.h b/include/device_context_provider.h deleted file mode 100644 index 09ef1e7..0000000 --- a/include/device_context_provider.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2015 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef __CONTEXT_DEVICE_CONTEXT_PROVIDER_H__ -#define __CONTEXT_DEVICE_CONTEXT_PROVIDER_H__ - -namespace ctx { - bool init_device_context_provider(); -} - -#endif //__CONTEXT_DEVICE_CONTEXT_PROVIDER_H__ diff --git a/include/place_context_provider.h b/include/place_context_provider.h deleted file mode 100644 index 407838b..0000000 --- a/include/place_context_provider.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2015 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef __CONTEXT_PLACE_CONTEXT_PROVIDER_H__ -#define __CONTEXT_PLACE_CONTEXT_PROVIDER_H__ - -namespace ctx { - bool init_place_context_provider(); -} - -#endif /* __CONTEXT_PLACE_CONTEXT_PROVIDER_H__ */ diff --git a/include/statistics_context_provider.h b/include/statistics_context_provider.h deleted file mode 100644 index b45c3fd..0000000 --- a/include/statistics_context_provider.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2015 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#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__ */ 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);