Init basesystem source codes.
[staging/basesystem.git] / nsframework / framework_unified / client / NS_FrameworkCore / src / statemachine / frameworkunified_sm_leafstate.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 CFrameworkunifiedLeafState class definitions. CFrameworkunifiedLeafState is derived from C
28 /// FrameworkunifiedState class.This class implements the additional functionality supported by HSM Leafstate.
29 ///////////////////////////////////////////////////////////////////////////////////////////////////
30
31 #include <native_service/frameworkunified_sm_leafstate.h>
32 #include <native_service/frameworkunified_sm_framework_types.h>
33 #include <string>
34
35 ///////////////////////////////////////////////////////////////////////////////////////////
36 /// CFrameworkunifiedState
37 /// Parameterized constructor
38 ///////////////////////////////////////////////////////////////////////////////////////////
39 CFrameworkunifiedLeafState::CFrameworkunifiedLeafState(std::string f_pName): CFrameworkunifiedState(f_pName) {  // LCOV_EXCL_BR_LINE 11:Unexpected branch
40 }
41
42 ///////////////////////////////////////////////////////////////////////////////////////////
43 /// ~CFrameworkunifiedState
44 /// Class destructor
45 ///////////////////////////////////////////////////////////////////////////////////////////
46 CFrameworkunifiedLeafState::~CFrameworkunifiedLeafState() {
47   FRAMEWORKUNIFIEDLOG(ZONE_NS_SM_USR_INFO, __FUNCTION__, "CFrameworkunifiedLeafState destructor");
48 }
49
50 ///////////////////////////////////////////////////////////////////////////////////////////
51 /// FrameworkunifiedOnEntry
52 /// state initialization can be performed in this function.
53 ///////////////////////////////////////////////////////////////////////////////////////////
54 EFrameworkunifiedStatus CFrameworkunifiedLeafState::FrameworkunifiedOnEntry(CEventDataPtr f_pEventData) {
55   FRAMEWORKUNIFIEDLOG(ZONE_NS_SM_USR_INFO, __FUNCTION__, " Entering state %s ", m_strStateName.c_str());
56   return eFrameworkunifiedStatusOK;
57 }
58
59 ///////////////////////////////////////////////////////////////////////////////////////////
60 /// FrameworkunifiedOnExit
61 /// state cleanup can be performed in this function.
62 ///////////////////////////////////////////////////////////////////////////////////////////
63 EFrameworkunifiedStatus CFrameworkunifiedLeafState::FrameworkunifiedOnExit(CEventDataPtr f_pEventData) {
64   FRAMEWORKUNIFIEDLOG(ZONE_NS_SM_USR_INFO, __FUNCTION__, " Leaving state %s ", m_strStateName.c_str());
65   return eFrameworkunifiedStatusOK;
66 }
67
68 CFrameworkunifiedState *CFrameworkunifiedLeafState::FrameworkunifiedGetActiveState() {
69   return this;
70 }
71
72 ////////////////////////////////////////////////////////////////////////////////////////////////////
73 /// UpdateHistory
74 /// This function stores the last active state
75 ////////////////////////////////////////////////////////////////////////////////////////////////////
76 EFrameworkunifiedStatus CFrameworkunifiedLeafState::UpdateHistory() {
77   return eFrameworkunifiedStatusOK;
78 }