My Project
deferral.hpp
Go to the documentation of this file.
1 #ifndef BOOST_STATECHART_DEFERRAL_HPP_INCLUDED
2 #define BOOST_STATECHART_DEFERRAL_HPP_INCLUDED
3 // Copyright 2002-2006 Andreas Huber Doenni
5 // Distributed under the Boost Software License, Version 1.0. (See accompany-
6 // ing file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
8 
9 
10 
12 
13 
14 
15 namespace boost
16 {
17 namespace statechart
18 {
19 
20 
21 
22 class event_base;
23 
25 template< class Event >
26 class deferral
27 {
28  public:
30  // The following declarations should be private.
31  // They are only public because many compilers lack template friends.
33  template< class State, class EventBase, class IdType >
35  State & stt, const EventBase &, const IdType & eventType )
36  {
37  if ( eventType == Event::static_type() )
38  {
39  return detail::result_utility::get_result( stt.defer_event() );
40  }
41  else
42  {
43  return detail::no_reaction;
44  }
45  }
46 };
47 
48 template<>
50 {
51  public:
53  // The following declarations should be private.
54  // They are only public because many compilers lack template friends.
56  template< class State, class EventBase, class IdType >
58  State & stt, const EventBase &, const IdType & )
59  {
60  return detail::result_utility::get_result( stt.defer_event() );
61  }
62 };
63 
64 
65 
66 } // namespace statechart
67 } // namespace boost
68 
69 
70 
71 #endif
boost::statechart::deferral< event_base >::react
static detail::reaction_result react(State &stt, const EventBase &, const IdType &)
Definition: deferral.hpp:57
boost::statechart::deferral::react
static detail::reaction_result react(State &stt, const EventBase &, const IdType &eventType)
Definition: deferral.hpp:34
boost::statechart::detail::result_utility::get_result
static reaction_result get_result(::boost::statechart::result value)
Definition: result.hpp:108
boost
Definition: asynchronous_state_machine.hpp:20
boost::statechart::detail::reaction_result
reaction_result
Definition: result.hpp:26
boost::statechart::detail::no_reaction
@ no_reaction
Definition: result.hpp:27
boost::statechart::event_base
Definition: event_base.hpp:51
boost::statechart::deferral
Definition: deferral.hpp:27
result.hpp