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 CFrameworkunifiedReaction class definitions.This class provides the interface
22 /// for defining a reaction for an event
24 ///////////////////////////////////////////////////////////////////////////////
27 * @file frameworkunified_sm_reaction.h
28 * @brief \~english This file has the CFrameworkunifiedReaction class definitions.This class provides the interface
29 * for defining a reaction for an event
32 /** @addtogroup BaseSystem
35 /** @addtogroup native_service
39 /** @addtogroup framework_unified
40 * @ingroup native_service
43 /** @addtogroup framework
44 * @ingroup framework_unified
47 /** @addtogroup statemachine
51 #ifndef _FRAMEWORKUNIFIEDREACTION_H // NOLINT (build/header_guard)
52 #define _FRAMEWORKUNIFIEDREACTION_H
54 ///////////////////////////////////////////////////////////////////////////////////////////////////
56 ///////////////////////////////////////////////////////////////////////////////////////////////////
57 #include <boost/smart_ptr.hpp>
58 #include <native_service/frameworkunified_types.h>
59 #include <native_service/ns_logger_if.h>
62 class CFrameworkunifiedState;
65 typedef boost::shared_ptr<CEventData> CEventDataPtr;
67 ///////////////////////////////////////////////////////////////////////////////////////////////////
68 /// This class provides the interface for defining a reaction for an event
69 ///////////////////////////////////////////////////////////////////////////////////////////////////
70 class CFrameworkunifiedReaction {
72 /////////////////////////////////////////////////////////////////////////////////////
73 /// \ingroup CFrameworkunifiedReaction
74 /// \~english @par Summary
75 /// pure virtual fuction
76 /// \~english @param [in] f_pSourceState
77 /// CFrameworkunifiedState* f_pSourceState - source state
78 /// \~english @param [in] f_pData
79 /// CEventDataPtr f_pData - event data
80 /// \~english @retval None
81 /// \~english @par Preconditions
83 /// \~english @par Change of the internal state
85 /// \~english @par Causes of failures
87 /// \~english @par Classification
89 /// \~english @par Type
91 /// \~english @par Detail
92 /// pure virtual function , implement by child class
94 ////////////////////////////////////////////////////////////////////////////////////
95 ///////////////////////////////////////////////////////////////////////////////////////////
96 /// FrameworkunifiedReaction
97 /// The reaction for the event has to be implemented in this function
99 /// \param [in] f_pSourceState
100 /// CFrameworkunifiedState* - Source state in which reaction is being executed
102 /// \param [in] f_pData
103 /// CEventDataPtr - event data
105 /// \return ActiveState
106 /// CFrameworkunifiedState* - Returns Active state
108 ///////////////////////////////////////////////////////////////////////////////////////////
109 virtual CFrameworkunifiedState *FrameworkunifiedReaction(CFrameworkunifiedState *f_pSourceState, CEventDataPtr f_pData) = 0;
111 /////////////////////////////////////////////////////////////////////////////////////
112 /// \ingroup CFrameworkunifiedReaction
113 /// \~english @par Summary
114 /// CFrameworkunifiedReaction constructor
115 /// \~english @param None
116 /// \~english @retval None
117 /// \~english @par Preconditions
119 /// \~english @par Change of the internal state
120 /// - m_ucRefCount = 0
121 /// \~english @par Causes of failures
123 /// \~english @par Classification
125 /// \~english @par Type
127 /// \~english @par Detail
128 /// CFrameworkunifiedReaction Constructor, for create CFrameworkunifiedReaction object
130 ////////////////////////////////////////////////////////////////////////////////////
131 ///////////////////////////////////////////////////////////////////////////////////////////
132 /// CFrameworkunifiedReaction
139 ///////////////////////////////////////////////////////////////////////////////////////////
140 CFrameworkunifiedReaction() {
144 /////////////////////////////////////////////////////////////////////////////////////
145 /// \ingroup CFrameworkunifiedReaction
146 /// \~english @par Summary
147 /// CFrameworkunifiedReaction destructor
148 /// \~english @param None
149 /// \~english @retval None
150 /// \~english @par Preconditions
152 /// \~english @par Change of the internal state
154 /// \~english @par Causes of failures
156 /// \~english @par Classification
158 /// \~english @par Type
160 /// \~english @par Detail
161 /// CFrameworkunifiedReaction destructor, for destory CFrameworkunifiedReaction object
163 ////////////////////////////////////////////////////////////////////////////////////
164 ///////////////////////////////////////////////////////////////////////////////////////////
165 /// ~CFrameworkunifiedReaction
172 ///////////////////////////////////////////////////////////////////////////////////////////
173 virtual ~CFrameworkunifiedReaction() {}
175 // count to check the number of reference of this reaction in all the states of statemachine
178 #endif // _FRAMEWORKUNIFIEDREACTION_H // NOLINT (build/header_guard)