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_StateMachine
21 /// This file has the CFrameworkunifiedLeafState class definitions. CFrameworkunifiedLeafState is derived from C
22 /// FrameworkunifiedState class.This class implements the additional functionality supported by HSM Leafstate.
23 ///////////////////////////////////////////////////////////////////////////////
26 * @file frameworkunified_sm_leafstate.h
27 * @brief \~english 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.
31 /** @addtogroup BaseSystem
34 /** @addtogroup native_service
38 /** @addtogroup framework_unified
39 * @ingroup native_service
42 /** @addtogroup framework
43 * @ingroup framework_unified
46 /** @addtogroup statemachine
50 #ifndef _FRAMEWORKUNIFIEDLEAFSTATE_H // NOLINT (build/header_guard)
51 #define _FRAMEWORKUNIFIEDLEAFSTATE_H
53 ///////////////////////////////////////////////////////////////////////////////////////////////////
55 ///////////////////////////////////////////////////////////////////////////////////////////////////
57 #include <native_service/frameworkunified_sm_state.h>
59 ///////////////////////////////////////////////////////////////////////////////////////////////////
60 /// This class implements the additional functionality supported by HSM Leafstate.
61 ///////////////////////////////////////////////////////////////////////////////////////////////////
62 class CFrameworkunifiedLeafState : public CFrameworkunifiedState {
65 ///////////////////////////////////////////////////////////////////////////////////////////
66 /// \ingroup CFrameworkunifiedLeafState
67 /// \~english @par Brief
68 /// It is a constructor for CFrameworkunifiedLeafState classes.
69 /// \~english @param [in] f_pName
70 /// std::string - state name
71 /// \~english @retval None
72 /// \~english @par Prerequisite
74 /// \~english @par Change of internal state
75 /// - The internal state is not changed.
76 /// \~english @par Conditions of processing failure
78 /// \~english @par Detail
79 /// Inherits CFrameworkunifiedState, which is a superclass of state machines.\n
80 /// This class is implemented by HSM Leafstate as an additional class of functional support.\n
81 /// It inherits from the CFrameworkunifiedState classes and instantiates the CFrameworkunifiedLeafState.
82 /// \~english @par Immediate
84 /// \~english @par Classification
86 /// \~english @par Type
88 /// \~english @see ~CFrameworkunifiedLeafState
89 ///////////////////////////////////////////////////////////////////////////////////////////
90 /// CFrameworkunifiedState
91 /// Parameterized constructor
92 /// \param [in] f_pName
93 /// string - Name of the state
96 CFrameworkunifiedLeafState(std::string f_pName); // NOLINT (readability/nolint)
98 ///////////////////////////////////////////////////////////////////////////////////////////
99 /// \ingroup CFrameworkunifiedLeafState
100 /// \~english @par Brief
101 /// Destructors for CFrameworkunifiedLeafState classes.
102 /// \~english @retval None
103 /// \~english @par Prerequisite
104 /// - Its own instance (CFrameworkunifiedLeafState) has been created.
105 /// \~english @par Change of internal state
106 /// - The internal state is not changed.
107 /// \~english @par Conditions of processing failure
109 /// \~english @par Detail
110 /// Frees instances of CFrameworkunifiedLeafState classes.
111 /// \~english @par Classification
113 /// \~english @par Type
115 /// \~english @see CFrameworkunifiedLeafState::CFrameworkunifiedLeafState
116 ///////////////////////////////////////////////////////////////////////////////////////////
117 ///////////////////////////////////////////////////////////////////////////////////////////
118 /// ~CFrameworkunifiedState
122 virtual ~CFrameworkunifiedLeafState();
124 ///////////////////////////////////////////////////////////////////////////////////////////
125 /// \ingroup CFrameworkunifiedLeafState
126 /// \~english @par Brief
127 /// Get the active state.
128 /// \~english @retval CFrameworkunifiedState* Pointers to active-state (CFrameworkunifiedState classes) objects
129 /// \~english @par Prerequisite
130 /// - Its own instance (CFrameworkunifiedLeafState) has been created.
131 /// \~english @par Change of internal state
132 /// - The internal state is not changed.
133 /// \~english @par Conditions of processing failure
135 /// \~english @par Detail
136 /// This method overrides and uses CFrameworkunifiedState::FrameworkunifiedGetActiveState, which is pure virtual functions.\n
137 /// Returns the current state (this) as the active state.
138 /// \~english @par Classification
140 /// \~english @par Type
142 /// \~english @see CFrameworkunifiedState::FrameworkunifiedGetActiveState
143 ///////////////////////////////////////////////////////////////////////////////////////////
144 ///////////////////////////////////////////////////////////////////////////////////////////
145 /// FrameworkunifiedGetActiveState
146 /// This interface returns the Active state of the current composite state. In case of
147 /// non-composite state current state is active state
149 /// \return Active state
150 /// CFrameworkunifiedState* - Active state
151 virtual CFrameworkunifiedState *FrameworkunifiedGetActiveState();
153 ///////////////////////////////////////////////////////////////////////////////////////////
154 /// \ingroup CFrameworkunifiedLeafState
155 /// \~english @par Brief
156 /// Save the last active state.
157 /// \~english @retval eFrameworkunifiedStatusOK success
158 /// \~english @par Prerequisite
159 /// - Its own instance (CFrameworkunifiedLeafState) has been created.
160 /// \~english @par Change of internal state
161 /// - The internal state is not changed.
162 /// \~english @par Conditions of processing failure
164 /// \~english @par Detail
165 /// This method overrides CFrameworkunifiedState::UpdateHistory, which is pure virtual functions.Used and saves the last active state.
166 /// \~english @par Classification
168 /// \~english @par Type
170 /// \~english @see CFrameworkunifiedState::UpdateHistory
171 ///////////////////////////////////////////////////////////////////////////////////////////
173 /// This function stores the last active state
175 /// \return EFrameworkunifiedStatus
176 /// EFrameworkunifiedStatus - Returns status of operation
177 EFrameworkunifiedStatus UpdateHistory();
181 ///////////////////////////////////////////////////////////////////////////////////////////
182 /// \ingroup CFrameworkunifiedLeafState
183 /// \~english @par Brief
185 /// \~english @param f_pEventData
186 /// CEventDataPtr - Pointer to the event data class
187 /// \~english @retval eFrameworkunifiedStatusOK success
188 /// \~english @par Prerequisite
189 /// - Its own instance (CFrameworkunifiedLeafState) has been created.
190 /// \~english @par Change of internal state
191 /// - The internal state is not changed.
192 /// \~english @par Conditions of processing failure
194 /// \~english @par Detail
195 /// This method overrides and uses CFrameworkunifiedState::FrameworkunifiedOnEntry, which is pure virtual functions, to initialize state.
196 /// \~english @par Classification
198 /// \~english @par Type
200 /// \~english @see CFrameworkunifiedState::FrameworkunifiedOnEntry, FrameworkunifiedOnExit
201 ///////////////////////////////////////////////////////////////////////////////////////////
202 ///////////////////////////////////////////////////////////////////////////////////////////
203 /// FrameworkunifiedOnEntry
204 /// state initialization can be performed in this function.
206 /// \param [in] f_pEventData
207 /// CEventDataPtr - Event data
209 /// \return EFrameworkunifiedStatus
210 /// EFrameworkunifiedStatus - Returns status of operation
211 virtual EFrameworkunifiedStatus FrameworkunifiedOnEntry(CEventDataPtr f_pEventData);
213 ///////////////////////////////////////////////////////////////////////////////////////////
214 /// \ingroup CFrameworkunifiedLeafState
215 /// \~english @par Brief
217 /// \~english @param f_pEventData
218 /// CEventDataPtr - Pointer to the event data class
219 /// \~english @retval eFrameworkunifiedStatusOK success
220 /// \~english @par Prerequisite
221 /// - Its own instance (CFrameworkunifiedLeafState) has been created.
222 /// \~english @par Change of internal state
223 /// - The internal state is not changed.
224 /// \~english @par Conditions of processing failure
226 /// \~english @par Detail
227 /// This method overrides and uses CFrameworkunifiedState::FrameworkunifiedOnExit, which is pure virtual functions, to clean up state.
228 /// \~english @par Classification
230 /// \~english @par Type
232 /// \~english @see CFrameworkunifiedState::FrameworkunifiedOnExit, FrameworkunifiedOnEntry
233 ///////////////////////////////////////////////////////////////////////////////////////////
234 ///////////////////////////////////////////////////////////////////////////////////////////
235 /// FrameworkunifiedOnExit
236 /// state cleanup can be performed in this function.
238 /// \param [in] f_pEventData
239 /// CEventDataPtr - Event data
241 /// \return EFrameworkunifiedStatus
242 /// EFrameworkunifiedStatus - Returns status of operation
243 virtual EFrameworkunifiedStatus FrameworkunifiedOnExit(CEventDataPtr f_pEventData);
246 #endif // _FRAMEWORKUNIFIEDLEAFSTATE_H // NOLINT (build/header_guard)