File indexing completed on 2025-01-18 09:52:32
0001 #ifndef BOOST_STATECHART_TERMINATION_HPP_INCLUDED
0002 #define BOOST_STATECHART_TERMINATION_HPP_INCLUDED
0003
0004
0005
0006
0007
0008
0009
0010
0011 #include <boost/statechart/result.hpp>
0012
0013
0014
0015 namespace boost
0016 {
0017 namespace statechart
0018 {
0019
0020
0021
0022 class event_base;
0023
0024
0025 template< class Event >
0026 class termination
0027 {
0028 public:
0029
0030
0031
0032
0033 template< class State, class EventBase, class IdType >
0034 static detail::reaction_result react(
0035 State & stt, const EventBase &, const IdType & eventType )
0036 {
0037 if ( eventType == Event::static_type() )
0038 {
0039 return detail::result_utility::get_result( stt.terminate() );
0040 }
0041 else
0042 {
0043 return detail::no_reaction;
0044 }
0045 }
0046 };
0047
0048 template<>
0049 class termination< event_base >
0050 {
0051 public:
0052
0053
0054
0055
0056 template< class State, class EventBase, class IdType >
0057 static detail::reaction_result react(
0058 State & stt, const EventBase &, const IdType & )
0059 {
0060 return detail::result_utility::get_result( stt.terminate() );
0061 }
0062 };
0063
0064
0065
0066 }
0067 }
0068
0069
0070
0071 #endif