Init basesystem source codes.
[staging/basesystem.git] / video_in_hal / nsframework / framework_unified / client / NS__CWORD77__ServiceIf / src / ns__CWORD77__common_internal.h
1 /*
2  * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION.
3  *
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
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16
17 ////////////////////////////////////////////////////////////////////////////////
18 /// @defgroup tag_HMI_CWORD77_Controller HMI _CWORD77_ Controller
19 /// @file  ns__CWORD77__common_internal.h
20 /// @brief
21 ///
22 ////////////////////////////////////////////////////////////////////////////////
23 //@{
24
25 #ifndef NS_NS__CWORD77__SERVICEIF_SRC_NS__CWORD77__COMMON_INTERNAL_H_  // NOLINT  (readability/nolint)
26 #define NS_NS__CWORD77__SERVICEIF_SRC_NS__CWORD77__COMMON_INTERNAL_H_
27
28 #include <native_service/ns__CWORD77__types.h>
29 #include <cstdlib>
30 #include <iostream>
31 #include <string>
32
33 EFrameworkunifiedStatus Set_CWORD77_DataPoolKeyValue(std::string Key, std::string Value);
34 std::string Get_CWORD77_DataPoolKeyValue(std::string Key);
35
36 template <typename T>
37 UI_32 _CWORD77_GetMsgLength(HANDLE hApp) {
38   UI_32 uiLength = FrameworkunifiedGetMsgLength(hApp);
39   return (uiLength / sizeof(T));
40 }
41
42 template <typename T>
43 EFrameworkunifiedStatus _CWORD77_GetMsgData(HANDLE hApp, T *pData) {
44   EFrameworkunifiedStatus  eStatus = eFrameworkunifiedStatusOK;
45   UI_8 *pTemp = reinterpret_cast<UI_8 *>(pData);
46   eStatus = FrameworkunifiedGetMsgDataOfSize(hApp, pTemp, sizeof(T));
47   return eStatus;
48 }
49
50 #endif  // NS_NS__CWORD77__SERVICEIF_SRC_NS__CWORD77__COMMON_INTERNAL_H_  // NOLINT  (readability/nolint)
51 //@}