Remove unused directories and files in video_in_hal
[staging/basesystem.git] / service / native / framework_unified / client / NS_FrameworkCore / src / statemachine / frameworkunified_sm_deephistorystate.cpp
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 <<Group Tag>> <<Group Name>>
19 /// \ingroup  tag_NSFramework
20 /// .
21 ///////////////////////////////////////////////////////////////////////////////////////////////////
22
23 ///////////////////////////////////////////////////////////////////////////////////////////////////
24 /// \ingroup  tag_NSFramework
25 /// \brief
26 ///
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.
30 ///
31 ///////////////////////////////////////////////////////////////////////////////////////////////////
32
33 #include <native_service/frameworkunified_sm_deephistorystate.h>
34 #include <native_service/frameworkunified_sm_framework_types.h>
35 #include <string>
36
37 // define static members of class
38 const UI_32 CFrameworkunifiedDeepHistoryState::m_suievDeepHistory = 72;
39
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";
47 }
48
49 ////////////////////////////////////////////////////////////////////////////////////////////////////
50 /// ~CFrameworkunifiedDeepHistoryState
51 /// Class destructor
52 ////////////////////////////////////////////////////////////////////////////////////////////////////
53 CFrameworkunifiedDeepHistoryState::~CFrameworkunifiedDeepHistoryState() {
54   FRAMEWORKUNIFIEDLOG(ZONE_NS_SM_DEV_INFO, __FUNCTION__, "CFrameworkunifiedDeepHistoryState destructor");
55 }
56
57 ////////////////////////////////////////////////////////////////////////////////////////////////////
58 /// UpdateHistory
59 /// This function stores the last active state
60 ////////////////////////////////////////////////////////////////////////////////////////////////////
61 EFrameworkunifiedStatus CFrameworkunifiedDeepHistoryState::UpdateHistory() {
62   EFrameworkunifiedStatus l_eStatus = eFrameworkunifiedStatusOK;
63
64   CFrameworkunifiedState *l_pActiveState = NULL;
65
66   try {
67     CHKNULL(m_pParentState);
68     l_pActiveState = m_pParentState->m_pActiveState;
69
70     while (NULL != l_pActiveState) {
71       m_pLastActiveState = l_pActiveState;
72       l_pActiveState = l_pActiveState->m_pActiveState;
73     }
74   } catch (std::exception &e) {
75     FRAMEWORKUNIFIEDLOG(ZONE_NS_ERR, __FUNCTION__, "Exception %s", e.what());
76     l_eStatus = eFrameworkunifiedStatusNullPointer;
77   }
78   return l_eStatus;
79 }