File formatting for PPM source code
authorYounghyunJoo <yh_.joo@samsung.com>
Mon, 3 Aug 2015 02:30:40 +0000 (11:30 +0900)
committerMadan Lanka <lanka.madan@samsung.com>
Mon, 3 Aug 2015 05:39:19 +0000 (05:39 +0000)
Applied source code formatting for PPM code

Change-Id: I4c71da133477820388c2c17bb6c1bc4cf3ca4af0
Signed-off-by: YounghyunJoo <yh_.joo@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/2045
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Madan Lanka <lanka.madan@samsung.com>
service/protocol-plugin/plugin-manager/src/Android/jni/PluginManager.cpp
service/protocol-plugin/plugin-manager/src/Android/jni/PluginManager.h
service/protocol-plugin/plugin-manager/src/Config.cpp
service/protocol-plugin/plugin-manager/src/FelixAdapter.cpp
service/protocol-plugin/plugin-manager/src/PluginManagerImpl.cpp
service/protocol-plugin/sample-app/linux/mqtt/mqttclient.cpp
service/protocol-plugin/sample-app/tizen/PPMSampleApp/src/ppmsampleapp.cpp

index 0279730..7065cc7 100644 (file)
  * Method:    startPlugins
  * Signature: (Ljava/lang/String;Ljava/lang/String;)I
  */
-JNIEXPORT jint JNICALL Java_org_iotivity_service_ppm_PluginManager_jniStartPlugins(JNIEnv *env, jobject jobj,
+JNIEXPORT jint JNICALL Java_org_iotivity_service_ppm_PluginManager_jniStartPlugins(JNIEnv *env,
+        jobject jobj,
         jstring jkey, jstring jvalue)
 {
     LOGD("jniStartPlugins() Called.");
 
-    if((!jkey)||(!jvalue))
+    if ((!jkey) || (!jvalue))
         return 0;
     std::string ckey = env->GetStringUTFChars(jkey, 0);
     std::string cvalue = env->GetStringUTFChars(jvalue, 0);
@@ -50,12 +51,13 @@ JNIEXPORT jint JNICALL Java_org_iotivity_service_ppm_PluginManager_jniStartPlugi
  * Method:    stopPlugins
  * Signature: (Ljava/lang/String;Ljava/lang/String;)I
  */
-JNIEXPORT jint JNICALL Java_org_iotivity_service_ppm_PluginManager_jniStopPlugins(JNIEnv *env, jobject jobj,
+JNIEXPORT jint JNICALL Java_org_iotivity_service_ppm_PluginManager_jniStopPlugins(JNIEnv *env,
+        jobject jobj,
         jstring jkey, jstring jvalue)
 {
     LOGD("jniStopPlugins() Called.");
 
-    if((!jkey)||(!jvalue))
+    if ((!jkey) || (!jvalue))
         return 0;
     std::string ckey = env->GetStringUTFChars(jkey, 0);
     std::string cvalue = env->GetStringUTFChars(jvalue, 0);
@@ -68,7 +70,8 @@ JNIEXPORT jint JNICALL Java_org_iotivity_service_ppm_PluginManager_jniStopPlugin
  * Method:    jniRescanPlugin
  * Signature: (V)I
  */
-JNIEXPORT jint JNICALL Java_org_iotivity_service_ppm_PluginManager_jniRescanPlugin(JNIEnv *env, jobject jobj)
+JNIEXPORT jint JNICALL Java_org_iotivity_service_ppm_PluginManager_jniRescanPlugin(JNIEnv *env,
+        jobject jobj)
 {
     LOGD("jniRescanPlugin() Called.");
 
@@ -81,8 +84,9 @@ JNIEXPORT jint JNICALL Java_org_iotivity_service_ppm_PluginManager_jniRescanPlug
  * Method:    getPlugins
  * Signature: (V)[Lorg/iotivity/service/ppm/Plugin;
  */
-JNIEXPORT jobjectArray JNICALL Java_org_iotivity_service_ppm_PluginManager_jniGetPlugins(JNIEnv *env,
-        jobject jobj)
+JNIEXPORT jobjectArray JNICALL Java_org_iotivity_service_ppm_PluginManager_jniGetPlugins(
+    JNIEnv *env,
+    jobject jobj)
 {
     LOGD("jniGetPlugins() Called.");
 
@@ -110,7 +114,8 @@ JNIEXPORT jobjectArray JNICALL Java_org_iotivity_service_ppm_PluginManager_jniGe
  * Method:    getState
  * Signature: (Ljava/lang/String;)Ljava/lang/String;
  */
-JNIEXPORT jstring JNICALL Java_org_iotivity_service_ppm_PluginManager_jniGetState(JNIEnv *env, jobject jobj,
+JNIEXPORT jstring JNICALL Java_org_iotivity_service_ppm_PluginManager_jniGetState(JNIEnv *env,
+        jobject jobj,
         jstring jplugID)
 {
     LOGD("jniGetState() Called.");
index cc4df34..319a4ab 100644 (file)
@@ -55,7 +55,8 @@ JavaVM *jvm;
  * Method:    jniStartPlugins
  * Signature: (Ljava/lang/String;Ljava/lang/String;)I
  */
-JNIEXPORT jint JNICALL Java_org_iotivity_service_ppm_PluginManager_jniStartPlugins(JNIEnv *, jobject,
+JNIEXPORT jint JNICALL Java_org_iotivity_service_ppm_PluginManager_jniStartPlugins(JNIEnv *,
+        jobject,
         jstring, jstring);
 
 /*
@@ -63,7 +64,8 @@ JNIEXPORT jint JNICALL Java_org_iotivity_service_ppm_PluginManager_jniStartPlugi
  * Method:    jniStopPlugins
  * Signature: (Ljava/lang/String;Ljava/lang/String;)I
  */
-JNIEXPORT jint JNICALL Java_org_iotivity_service_ppm_PluginManager_jniStopPlugins(JNIEnv *, jobject, jstring,
+JNIEXPORT jint JNICALL Java_org_iotivity_service_ppm_PluginManager_jniStopPlugins(JNIEnv *, jobject,
+        jstring,
         jstring);
 
 /*
@@ -71,14 +73,16 @@ JNIEXPORT jint JNICALL Java_org_iotivity_service_ppm_PluginManager_jniStopPlugin
  * Method:    jniRescanPlugin
  * Signature: (V)I
  */
-JNIEXPORT jint JNICALL Java_org_iotivity_service_ppm_PluginManager_jniRescanPlugin(JNIEnv *, jobject);
+JNIEXPORT jint JNICALL Java_org_iotivity_service_ppm_PluginManager_jniRescanPlugin(JNIEnv *,
+        jobject);
 
 /*
  * Class:     org_iotivity_service_ppm_PluginManager
  * Method:    jniGetPlugins
  * Signature: (V)[Lorg/iotivity/service/ppm/Plugin;
  */
-JNIEXPORT jobjectArray JNICALL Java_org_iotivity_service_ppm_PluginManager_jniGetPlugins(JNIEnv *, jobject);
+JNIEXPORT jobjectArray JNICALL Java_org_iotivity_service_ppm_PluginManager_jniGetPlugins(JNIEnv *,
+        jobject);
 
 /*
  * Class:     org_iotivity_service_ppm_PluginManager
index c88859a..4553e2e 100644 (file)
@@ -132,7 +132,7 @@ PMRESULT Config::parsing(char *xmlData, xml_document<> *doc)
 
 PMRESULT Config::getXmlData(xml_node<> *pluginInfo, std::string key)
 {
-    if(pluginInfo == NULL)
+    if (pluginInfo == NULL)
     {
         return PM_S_FALSE;
     }
index b18efd9..c747cd7 100644 (file)
@@ -173,7 +173,7 @@ std::vector<Plugin> &FelixAdapter::getAllPlugins(void)
         mid = env->GetStaticMethodID(cls, "getValue",
                                      "(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;");
         std::string key = "Name";
-        jstring jname = (jstring)env->CallStaticObjectMethod(cls, mid, jid, 
+        jstring jname = (jstring)env->CallStaticObjectMethod(cls, mid, jid,
                         env->NewStringUTF(key.c_str()));
         std::string name = env->GetStringUTFChars(jname, 0);
         plugin->setValue("Name", name);
@@ -187,7 +187,7 @@ std::vector<Plugin> &FelixAdapter::getAllPlugins(void)
         // set ResourceURL value
         key = "Url";
         jstring juritype = (jstring)env->CallStaticObjectMethod(cls, mid, jid,
-                                env->NewStringUTF(key.c_str()));
+                           env->NewStringUTF(key.c_str()));
         std::string url = env->GetStringUTFChars(juritype, 0);
         plugin->setValue("Url", url);
 
@@ -208,7 +208,7 @@ std::vector<Plugin> *FelixAdapter::findPlugins(const std::string key, const std:
 
     jclass cls = env->FindClass("org/iotivity/service/ppm/FelixManager");
     jmethodID mid = env->GetStaticMethodID(cls, "findPlugins",
-                        "(Ljava/lang/String;Ljava/lang/String;)[Lorg/osgi/framework/Bundle;");
+                                           "(Ljava/lang/String;Ljava/lang/String;)[Lorg/osgi/framework/Bundle;");
 
     // call findPlugins() function
     jobjectArray jresultArray = (jobjectArray)env->CallStaticObjectMethod(cls, mid, (jstring)jkey,
@@ -243,9 +243,9 @@ std::vector<Plugin> *FelixAdapter::findPlugins(const std::string key, const std:
         // set Name value
         cls = env->FindClass("org/iotivity/service/ppm/FelixManager");
         mid = env->GetStaticMethodID(cls, "getValue",
-                    "(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;");
+                                     "(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;");
         std::string key = "Name";
-        jstring jname = (jstring)env->CallStaticObjectMethod(cls, mid, jid, 
+        jstring jname = (jstring)env->CallStaticObjectMethod(cls, mid, jid,
                         env->NewStringUTF(key.c_str()));
         std::string name = env->GetStringUTFChars(jname, 0);
         plugin->setValue("Name", name);
@@ -334,8 +334,8 @@ const std::string FelixAdapter::getState(const std::string plugID)
 
     jstring jplugID = env->NewStringUTF(plugID.c_str());
     jclass cls = env->FindClass("org/iotivity/service/ppm/FelixManager");
-    jmethodID mid = env->GetStaticMethodID(cls, "getState", 
-                    "(Ljava/lang/String;)Ljava/lang/String;");
+    jmethodID mid = env->GetStaticMethodID(cls, "getState",
+                                           "(Ljava/lang/String;)Ljava/lang/String;");
 
     // call getState() function
     jstring jresult = (jstring)env->CallStaticObjectMethod(cls, mid, jplugID);
index 785fe71..0d63e22 100644 (file)
@@ -43,8 +43,8 @@ extern "C" void destroy_object( PluginManagerImpl *object )
 PluginManagerImpl::PluginManagerImpl(void *args)
 {
 #ifndef ANDROID
-        m_args = args;
-        cppm = CpluffAdapter::Getinstance();
+    m_args = args;
+    cppm = CpluffAdapter::Getinstance();
 #endif
 #ifdef ANDROID
     m_args = args;
index 03f7c13..67abc20 100644 (file)
@@ -20,7 +20,7 @@
 
 /// @file mqttclient.cpp
 
-/// @brief Samplecode which controls MQTT-fan plugin using Protocol Plugin Manager. 
+/// @brief Samplecode which controls MQTT-fan plugin using Protocol Plugin Manager.
 
 #include <string>
 #include <cstdlib>
index b3bcc2d..5383695 100644 (file)
@@ -128,7 +128,7 @@ void onObserve(const HeaderOptions headerOptions, const OCRepresentation &rep,
         strcat(temp_string, buf);
         m_ThreadContext.log = temp_string;
         dlog_print(DLOG_INFO, LOG_TAG, " %s", m_ThreadContext.log);
-        ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateCallbackLog,
+        ecore_main_loop_thread_safe_call_sync((void *( *)(void *))updateCallbackLog,
                                               &m_ThreadContext);
 
         if (observe_count() > 30)
@@ -149,7 +149,7 @@ void onObserve(const HeaderOptions headerOptions, const OCRepresentation &rep,
         strcpy(temp_string, buf);
         m_ThreadContext.log = temp_string;
         dlog_print(DLOG_INFO, LOG_TAG, " %s", m_ThreadContext.log);
-        ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateCallbackLog,
+        ecore_main_loop_thread_safe_call_sync((void *( *)(void *))updateCallbackLog,
                                               &m_ThreadContext);
         std::exit(-1);
     }
@@ -185,7 +185,7 @@ void onPost2(const HeaderOptions &headerOptions, const OCRepresentation &rep, co
             strcat(temp_string, buf);
             m_ThreadContext.log = temp_string;
             dlog_print(DLOG_INFO, LOG_TAG, " %s", m_ThreadContext.log);
-            ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateCallbackLog,
+            ecore_main_loop_thread_safe_call_sync((void *( *)(void *))updateCallbackLog,
                                                   &m_ThreadContext);
         }
 
@@ -204,7 +204,7 @@ void onPost2(const HeaderOptions &headerOptions, const OCRepresentation &rep, co
         strcpy(temp_string, buf);
         m_ThreadContext.log = temp_string;
         dlog_print(DLOG_INFO, LOG_TAG, " %s", m_ThreadContext.log);
-        ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateCallbackLog,
+        ecore_main_loop_thread_safe_call_sync((void *( *)(void *))updateCallbackLog,
                                               &m_ThreadContext);
         std::exit(-1);
     }
@@ -240,7 +240,7 @@ void onPost(const HeaderOptions &headerOptions, const OCRepresentation &rep, con
             strcat(temp_string, buf);
             m_ThreadContext.log = temp_string;
             dlog_print(DLOG_INFO, LOG_TAG, " %s", m_ThreadContext.log);
-            ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateCallbackLog,
+            ecore_main_loop_thread_safe_call_sync((void *( *)(void *))updateCallbackLog,
                                                   &m_ThreadContext);
         }
 
@@ -263,7 +263,7 @@ void onPost(const HeaderOptions &headerOptions, const OCRepresentation &rep, con
         strcpy(temp_string, buf);
         m_ThreadContext.log = temp_string;
         dlog_print(DLOG_INFO, LOG_TAG, " %s", m_ThreadContext.log);
-        ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateCallbackLog,
+        ecore_main_loop_thread_safe_call_sync((void *( *)(void *))updateCallbackLog,
                                               &m_ThreadContext);
         std::exit(-1);
     }
@@ -313,7 +313,7 @@ void onPut(const HeaderOptions &headerOptions, const OCRepresentation &rep, cons
         strcat(temp_string, buf);
         m_ThreadContext.log = temp_string;
         dlog_print(DLOG_INFO, LOG_TAG, " %s", m_ThreadContext.log);
-        ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateCallbackLog,
+        ecore_main_loop_thread_safe_call_sync((void *( *)(void *))updateCallbackLog,
                                               &m_ThreadContext);
 
         putFanRepresentation(curFanResource);
@@ -325,7 +325,7 @@ void onPut(const HeaderOptions &headerOptions, const OCRepresentation &rep, cons
         strcpy(temp_string, buf);
         m_ThreadContext.log = temp_string;
         dlog_print(DLOG_INFO, LOG_TAG, " %s", m_ThreadContext.log);
-        ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateCallbackLog,
+        ecore_main_loop_thread_safe_call_sync((void *( *)(void *))updateCallbackLog,
                                               &m_ThreadContext);
         std::exit(-1);
     }
@@ -379,7 +379,7 @@ void onFanGet(const HeaderOptions &headerOptions, const OCRepresentation &rep, c
         strcat(temp_string, buf);
         m_ThreadContext.log = temp_string;
         dlog_print(DLOG_INFO, LOG_TAG, " %s", m_ThreadContext.log);
-        ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateCallbackLog,
+        ecore_main_loop_thread_safe_call_sync((void *( *)(void *))updateCallbackLog,
                                               &m_ThreadContext);
 
         putFanRepresentation(curFanResource);
@@ -391,7 +391,7 @@ void onFanGet(const HeaderOptions &headerOptions, const OCRepresentation &rep, c
         strcpy(temp_string, buf);
         m_ThreadContext.log = temp_string;
         dlog_print(DLOG_INFO, LOG_TAG, " %s", m_ThreadContext.log);
-        ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateCallbackLog,
+        ecore_main_loop_thread_safe_call_sync((void *( *)(void *))updateCallbackLog,
                                               &m_ThreadContext);
         std::exit(-1);
     }
@@ -444,7 +444,7 @@ void foundResourceFan(std::shared_ptr<OCResource> resource)
             // Get the resource types
             std::cout << "\tList of resource types: " << std::endl;
             strcat(temp_string, "List of resource types: <br>");
-            for (auto & resourceTypes : resource->getResourceTypes())
+            for (auto &resourceTypes : resource->getResourceTypes())
             {
                 std::cout << "\t\t" << resourceTypes << std::endl;
                 sprintf(buf, "%s<br>", resourceTypes.c_str());
@@ -453,7 +453,7 @@ void foundResourceFan(std::shared_ptr<OCResource> resource)
 
             // Get the resource interfaces
             std::cout << "\tList of resource interfaces: " << std::endl;
-            for (auto & resourceInterfaces : resource->getResourceInterfaces())
+            for (auto &resourceInterfaces : resource->getResourceInterfaces())
             {
                 std::cout << "\t\t" << resourceInterfaces << std::endl;
                 sprintf(buf, "%s<br>", resourceInterfaces.c_str());
@@ -469,7 +469,7 @@ void foundResourceFan(std::shared_ptr<OCResource> resource)
             }
             m_ThreadContext.log = temp_string;
             dlog_print(DLOG_INFO, LOG_TAG, " %s", m_ThreadContext.log);
-            ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateCallbackLog,
+            ecore_main_loop_thread_safe_call_sync((void *( *)(void *))updateCallbackLog,
                                                   &m_ThreadContext);
         }
         else
@@ -479,7 +479,7 @@ void foundResourceFan(std::shared_ptr<OCResource> resource)
             strcpy(temp_string, "Resource is invalid");
             m_ThreadContext.log = temp_string;
             dlog_print(DLOG_INFO, LOG_TAG, " %s", m_ThreadContext.log);
-            ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateCallbackLog,
+            ecore_main_loop_thread_safe_call_sync((void *( *)(void *))updateCallbackLog,
                                                   &m_ThreadContext);
         }
 
@@ -534,7 +534,7 @@ send_msg_clicked_cb(void *data , Evas_Object *obj , void *event_info)
                 strcat(temp_string, buf);
                 m_ThreadContext.log = temp_string;
                 dlog_print(DLOG_INFO, LOG_TAG, " %s", m_ThreadContext.log);
-                ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateCallbackLog,
+                ecore_main_loop_thread_safe_call_sync((void *( *)(void *))updateCallbackLog,
                                                       &m_ThreadContext);
                 std::cout << "value Name = " << user_plugin[i].getName() << std::endl;
                 std::cout << "value ID = " << user_plugin[i].getID() << std::endl;
@@ -546,7 +546,7 @@ send_msg_clicked_cb(void *data , Evas_Object *obj , void *event_info)
             strcat(temp_string, "fan Plugin is getting started. Please wait...<br>");
             m_ThreadContext.log = temp_string;
             dlog_print(DLOG_INFO, LOG_TAG, " %s", m_ThreadContext.log);
-            ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateCallbackLog,
+            ecore_main_loop_thread_safe_call_sync((void *( *)(void *))updateCallbackLog,
                                                   &m_ThreadContext);
             m_pm->startPlugins("ResourceType", "oic.fan");
             sleep(2);