2 * Copyright (c) 2012 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.
18 * @author Zbigniew Kostrzewa (z.kostrzewa@samsung.com)
21 #ifndef _WRT_PLUGINS_COMMON_PLUGIN_API_SUPPORT_DETAIL_TRAITS_H_
22 #define _WRT_PLUGINS_COMMON_PLUGIN_API_SUPPORT_DETAIL_TRAITS_H_
24 namespace WrtPluginsApi {
27 template<size_t, typename RequiredType, typename ... TupleArgTypes>
31 * CurrentArgType is not equal to RequiredType, check next tuple's argument
34 typename RequiredType,
35 typename CurrentArgType,
36 typename ... TupleArgTypes>
37 struct index_of_<n, RequiredType, CurrentArgType, TupleArgTypes ...>
39 static const size_t value = index_of_<n + 1,
41 TupleArgTypes ...>::value;
45 * RequiredType found on tuple's args list
46 * return position on tuple's list
48 template<size_t n, typename RequiredType, typename ... TupleArgTypes>
49 struct index_of_<n, RequiredType, RequiredType, TupleArgTypes ...>
51 static const size_t value = n;
55 * RequiredType found on last position of tuple's args list
56 * return position on tuple's list
58 template<size_t n, typename RequiredType>
59 struct index_of_<n, RequiredType, RequiredType>
61 static const size_t value = n;
65 * RequiredType was not found on tuple args list
67 template<size_t n, typename RequiredType, typename LastArgType>
68 struct index_of_<n, RequiredType, LastArgType>
70 static const size_t value = -1;