#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;
}
} 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 = \
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,
{
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;
return AceSecurityStatus::AccessGranted;
}
-
}
} // WrtDeviceApisCommon