merge with master
[platform/framework/web/wrt-plugins-common.git] / src / Commons / FunctionDeclaration.h
index 23d3322..ee0588e 100644 (file)
 #include <Commons/plugin_initializer_def.h>
 
 #define ACE_DECLARE_FUNCTION(function_definition) \
-    extern WrtDeviceApis::Commons::AceFunction ace_ ## function_definition
+    extern WrtDeviceApis::Commons::AceFunction ace_##function_definition
 
 #define ACE_DECLARE_PARAM(param_definition) \
-    extern WrtDeviceApis::Commons::AceDeviceCapParam ace_param_ ## \
+    extern WrtDeviceApis::Commons::AceDeviceCapParam ace_param_## \
     param_definition
 
 class DevCapFinder
 {
   public:
     explicit DevCapFinder(const std::string& devcap) : m_searchFor(devcap)
-    {
-    }
+    {}
     explicit DevCapFinder(const char* devcap) : m_searchFor(devcap)
-    {
-    }
-    bool operator()(const WrtDeviceApis::Commons::AceDeviceCapability& dc) const
+    {}
+    bool operator()(const WrtDeviceApis::Commons::AceDeviceCapability& dc)
+    const
     {
         return m_searchFor == dc.devCapName;
     }
@@ -72,17 +71,21 @@ class DevCapFinder
     } while (0)
 
 /*
- * Macro must be run inside plugin function. Plugin function must follow this declaration:
- * plugin_example_function(JScontextRef cotext, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef *exception);
- * where context, arguments, argumentsCount, exception are fixed and could not be change.
+ * Macro must be run inside plugin function. Plugin function must follow this
+ * declaration:
+ * plugin_example_function(JScontextRef cotext, JSObjectRef function,
+ * JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[],
+ * JSValueRef *exception);
+ * where context, arguments, argumentsCount, exception are fixed and could not
+ * be change.
  * */
 
 #define DECLARE_FUNCTION_GETTER(Plugin_Module)                                 \
-    WrtDeviceApis::Commons::AceFunction get ## Plugin_Module ## FunctionData(     \
+    WrtDeviceApis::Commons::AceFunction get##Plugin_Module##FunctionData(     \
         const std::string & functionId);
 
 #define DEFINE_FUNCTION_GETTER(Plugin_Module, FunctionMap)                     \
-    WrtDeviceApis::Commons::AceFunction get ## Plugin_Module ## FunctionData(     \
+    WrtDeviceApis::Commons::AceFunction get##Plugin_Module##FunctionData(     \
         const std::string & functionId)                                        \
     {                                                                          \
         WrtDeviceApis::Commons::FunctionMapping::const_iterator it =              \
@@ -96,11 +99,11 @@ class DevCapFinder
         return it->second;                                                     \
     }
 
-typedef WrtDeviceApis::Commons::AceFunction (&AceFunctionGetter)(const std::string&);
+typedef WrtDeviceApis::Commons::AceFunction (&AceFunctionGetter)(const std::
+                                                                     string&);
 
 namespace WrtDeviceApis {
 namespace Commons {
-
 enum class AceSecurityStatus
 {
     AccessGranted,
@@ -125,17 +128,16 @@ class DefaultArgsVerifier<>
 {
   public:
     void operator()(AceFunction& /*aceFunction*/) const
-    {
-    }
+    {}
 };
 
 template <typename FunctionGetter,
           typename ArgumentsVerifier,
           typename ... Args>
 AceSecurityStatus aceCheckAccess(
-        const FunctionGetter& f,
-        const char* functionName,
-        Args && ... args)
+    const FunctionGetter& f,
+    const char* functionName,
+    Args && ... args)
 {
     using namespace WrtDeviceApis::Commons;
 
@@ -152,7 +154,6 @@ AceSecurityStatus aceCheckAccess(
 
     return AceSecurityStatus::AccessGranted;
 }
-
 }
 } // WrtDeviceApisCommon