2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 #ifndef WRTDEVICEAPIS_COMMONS_FUNCTION_DEFINITION_
17 #define WRTDEVICEAPIS_COMMONS_FUNCTION_DEFINITION_
21 #include <Commons/FunctionDeclaration.h>
23 namespace WrtDeviceApis {
27 * Creates an empty device cap list. Additional device-caps may be added by
28 * ACE_CREATE_DEVICE_CAP and ACE_ADD_DEVICE_CAP macros
30 #define ACE_CREATE_DEVICE_CAPS_LIST(device) \
31 WrtDeviceApis::Commons::AceDeviceCaps ace_ ## device
34 * Creates an empty api features list. Additional api features may be added by
35 * ACE_CREATE_FEATURE and ACE_ADD_API_FEATURE macros
37 #define ACE_CREATE_FEATURE_LIST(apifeature) \
38 WrtDeviceApis::Commons::AceFeatures ace_ ## apifeature
41 * Creates a device capability which should be later added to device cap list
43 #define ACE_CREATE_DEVICE_CAP(device_cap_id, cap_id) \
44 WrtDeviceApis::Commons::AceDeviceCapability ace_ ## device_cap_id = \
45 AceDeviceCapability(cap_id, WrtDeviceApis::Commons::AceDeviceCapParams());
48 * Create an api feature which should be later added to api features list
50 #define ACE_CREATE_FEATURE(feature_id, feature_api) \
51 WrtDeviceApis::Commons::AceFeature ace_ ## feature_id = { feature_api };
54 * Adds an existing device-cap created by ACE_CREATE_DEVICE_CAP macro to
57 #define ACE_ADD_DEVICE_CAP(device, device_cap_id) \
58 WrtDeviceApis::Commons::aceAddDeviceCap(ace_ ## device_cap_id, ace_ ## device)
61 * Adds an existing api feature created by ACE_CREATE_FEATURE macro to
64 #define ACE_ADD_API_FEATURE(apifeature, feature_id) \
65 WrtDeviceApis::Commons::aceAddApiFeature(ace_ ## feature_id, \
69 * Creates a function definition with given id that uses provided api feature
70 * and device capability lists
72 #define ACE_CREATE_FUNCTION(function_id, function_name, feature_id, device) \
73 { function_name, ace_ ## feature_id, ace_ ## device }
75 // Support for param:name begin
76 #define ACE_CREATE_PARAM(param_definition, param_name, position) \
77 static WrtDeviceApis::Commons::AceDeviceCapParam ace_param_ ## \
79 { std::string(param_name), position };
81 // Support for param:name end
83 typedef std::map <std::string, AceFunction> FunctionMapping;
85 int aceAddDeviceCap(const AceDeviceCapability& cap,
86 AceDeviceCaps& instance);
87 int aceAddApiFeature(const AceFeature& apiFeature,
88 AceFeatures& instance);
91 } // WrtDeviceApisCommon
93 #endif // WRTDEVICEAPIS_COMMONS_FUNCTION_DEFINITION