Chris@16
|
1 #ifndef BOOST_STATECHART_DEEP_HISTORY_HPP_INCLUDED
|
Chris@16
|
2 #define BOOST_STATECHART_DEEP_HISTORY_HPP_INCLUDED
|
Chris@16
|
3 //////////////////////////////////////////////////////////////////////////////
|
Chris@16
|
4 // Copyright 2002-2006 Andreas Huber Doenni
|
Chris@16
|
5 // Distributed under the Boost Software License, Version 1.0. (See accompany-
|
Chris@16
|
6 // ing file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
Chris@16
|
7 //////////////////////////////////////////////////////////////////////////////
|
Chris@16
|
8
|
Chris@16
|
9
|
Chris@16
|
10
|
Chris@16
|
11 #include <boost/mpl/bool.hpp>
|
Chris@16
|
12 #include <boost/static_assert.hpp>
|
Chris@16
|
13
|
Chris@16
|
14
|
Chris@16
|
15
|
Chris@16
|
16 namespace boost
|
Chris@16
|
17 {
|
Chris@16
|
18 namespace statechart
|
Chris@16
|
19 {
|
Chris@16
|
20
|
Chris@16
|
21
|
Chris@16
|
22
|
Chris@16
|
23 //////////////////////////////////////////////////////////////////////////////
|
Chris@16
|
24 template< class DefaultState >
|
Chris@16
|
25 class deep_history
|
Chris@16
|
26 {
|
Chris@16
|
27 public:
|
Chris@16
|
28 //////////////////////////////////////////////////////////////////////////
|
Chris@16
|
29 // If you receive a
|
Chris@16
|
30 // "use of undefined type 'boost::STATIC_ASSERTION_FAILURE<x>'" or similar
|
Chris@16
|
31 // compiler error here then you forgot to pass either
|
Chris@16
|
32 // statechart::has_deep_history or statechart::has_full_history as the
|
Chris@16
|
33 // last parameter of DefaultState's context.
|
Chris@16
|
34 BOOST_STATIC_ASSERT( DefaultState::context_type::deep_history::value );
|
Chris@16
|
35
|
Chris@16
|
36 //////////////////////////////////////////////////////////////////////////
|
Chris@16
|
37 // The following declarations should be private.
|
Chris@16
|
38 // They are only public because many compilers lack template friends.
|
Chris@16
|
39 //////////////////////////////////////////////////////////////////////////
|
Chris@16
|
40 typedef typename DefaultState::outermost_context_base_type
|
Chris@16
|
41 outermost_context_base_type;
|
Chris@16
|
42 typedef typename DefaultState::context_type context_type;
|
Chris@16
|
43 typedef typename DefaultState::context_ptr_type context_ptr_type;
|
Chris@16
|
44 typedef typename DefaultState::context_type_list context_type_list;
|
Chris@16
|
45 typedef typename DefaultState::orthogonal_position orthogonal_position;
|
Chris@16
|
46
|
Chris@16
|
47 static void deep_construct(
|
Chris@16
|
48 const context_ptr_type & pContext,
|
Chris@16
|
49 outermost_context_base_type & outermostContextBase )
|
Chris@16
|
50 {
|
Chris@16
|
51 outermostContextBase.template construct_with_deep_history<
|
Chris@16
|
52 DefaultState >( pContext );
|
Chris@16
|
53 }
|
Chris@16
|
54 };
|
Chris@16
|
55
|
Chris@16
|
56
|
Chris@16
|
57
|
Chris@16
|
58 } // namespace statechart
|
Chris@16
|
59 } // namespace boost
|
Chris@16
|
60
|
Chris@16
|
61
|
Chris@16
|
62
|
Chris@16
|
63 #endif
|