2 * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION.
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.
17 ////////////////////////////////////////////////////////////////////////////////
18 /// \ingroup tag_HMI_CWORD77_Controller
21 ////////////////////////////////////////////////////////////////////////////////
24 #ifndef FRAMEWORK_UNIFIED_CLIENT_INCLUDE_NS__CWORD77__TEMPLATE_H_
25 #define FRAMEWORK_UNIFIED_CLIENT_INCLUDE_NS__CWORD77__TEMPLATE_H_
30 /// Template for Map range transformation
31 template< class OCont, class IIter, class MapFn >
32 OCont mapRange(const IIter &begin, const IIter &end, MapFn fn) {
34 std::transform(begin, end, std::inserter(c, c.begin()), fn);
39 /// Template to get Array begining
40 template< class T, UI_32 N >
41 const T *ArrBeg(const T(&arr)[ N ]) {
45 /// Template to get Array ending
46 template< class T, UI_32 N >
47 const T *ArrEnd(const T(&arr)[ N ]) {
51 /// Template to convert structure to Map
52 template< class Cont, class T, class C, class TFn >
53 const Cont GetMap(const T *mapTable, C N, TFn transform) {
54 return mapRange< Cont >(&mapTable[0], &mapTable[0] + N, transform);
57 ServiceResponseTableItem TransformServiceResponseTableIteminMap(const ServiceResponse &uch);
59 #endif // FRAMEWORK_UNIFIED_CLIENT_INCLUDE_NS__CWORD77__TEMPLATE_H_