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 /// \defgroup <<Group Tag>> <<Group Name>>
19 /// \ingroup tag_NSFramework
21 ///////////////////////////////////////////////////////////////////////////////////////////////////
23 ///////////////////////////////////////////////////////////////////////////////////////////////////
24 /// \ingroup tag_NSFramework
27 /// This file has the CFrameworkunifiedDeepHistoryState class definitions. CFrameworkunifiedDeepHistoryState is derived
28 /// from CFrameworkunifiedHistoryState class.This class implements the additional functionality supported by
29 /// HSM DeepHistory state.
31 ///////////////////////////////////////////////////////////////////////////////////////////////////
33 #include <native_service/frameworkunified_sm_deephistorystate.h>
34 #include <native_service/frameworkunified_sm_framework_types.h>
37 // define static members of class
38 const UI_32 CFrameworkunifiedDeepHistoryState::m_suievDeepHistory = 72;
40 ////////////////////////////////////////////////////////////////////////////////////////////////////
41 /// CFrameworkunifiedDeepHistoryState
42 /// Parameterized constructor
43 ////////////////////////////////////////////////////////////////////////////////////////////////////
44 CFrameworkunifiedDeepHistoryState::CFrameworkunifiedDeepHistoryState(std::string f_pName): CFrameworkunifiedHistoryState(f_pName) {
45 m_uiEventId = m_suievDeepHistory;
46 m_cEventName = "evDeepHistory";
49 ////////////////////////////////////////////////////////////////////////////////////////////////////
50 /// ~CFrameworkunifiedDeepHistoryState
52 ////////////////////////////////////////////////////////////////////////////////////////////////////
53 CFrameworkunifiedDeepHistoryState::~CFrameworkunifiedDeepHistoryState() {
54 FRAMEWORKUNIFIEDLOG(ZONE_NS_SM_DEV_INFO, __FUNCTION__, "CFrameworkunifiedDeepHistoryState destructor");
57 ////////////////////////////////////////////////////////////////////////////////////////////////////
59 /// This function stores the last active state
60 ////////////////////////////////////////////////////////////////////////////////////////////////////
61 EFrameworkunifiedStatus CFrameworkunifiedDeepHistoryState::UpdateHistory() {
62 EFrameworkunifiedStatus l_eStatus = eFrameworkunifiedStatusOK;
64 CFrameworkunifiedState *l_pActiveState = NULL;
67 CHKNULL(m_pParentState);
68 l_pActiveState = m_pParentState->m_pActiveState;
70 while (NULL != l_pActiveState) {
71 m_pLastActiveState = l_pActiveState;
72 l_pActiveState = l_pActiveState->m_pActiveState;
74 } catch (std::exception &e) {
75 FRAMEWORKUNIFIEDLOG(ZONE_NS_ERR, __FUNCTION__, "Exception %s", e.what());
76 l_eStatus = eFrameworkunifiedStatusNullPointer;