]> rtime.felk.cvut.cz Git - eurobot/public.git/blob - src/boost/boost/statechart/shallow_history.hpp
Add subset of boost library headers needed for compilation on PowerPC
[eurobot/public.git] / src / boost / boost / statechart / shallow_history.hpp
1 #ifndef BOOST_STATECHART_SHALLOW_HISTORY_HPP_INCLUDED
2 #define BOOST_STATECHART_SHALLOW_HISTORY_HPP_INCLUDED
3 //////////////////////////////////////////////////////////////////////////////
4 // 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)
7 //////////////////////////////////////////////////////////////////////////////
8
9
10
11 #include <boost/mpl/bool.hpp>
12 #include <boost/static_assert.hpp>
13
14
15
16 namespace boost
17 {
18 namespace statechart
19 {
20
21   
22   
23 //////////////////////////////////////////////////////////////////////////////
24 template< class DefaultState >
25 class shallow_history
26 {
27   public:
28     //////////////////////////////////////////////////////////////////////////
29     // If you receive a 
30     // "use of undefined type 'boost::STATIC_ASSERTION_FAILURE<x>'" or similar
31     // compiler error here then you forgot to pass either
32     // statechart::has_deep_history or statechart::has_full_history as the
33     // last parameter of DefaultState's context.
34     BOOST_STATIC_ASSERT( DefaultState::context_type::shallow_history::value );
35
36     //////////////////////////////////////////////////////////////////////////
37     // The following declarations should be private.
38     // They are only public because many compilers lack template friends.
39     //////////////////////////////////////////////////////////////////////////
40     typedef typename DefaultState::outermost_context_base_type
41       outermost_context_base_type;
42     typedef typename DefaultState::context_type context_type;
43     typedef typename DefaultState::context_ptr_type context_ptr_type;
44     typedef typename DefaultState::context_type_list context_type_list;
45     typedef typename DefaultState::orthogonal_position orthogonal_position;
46
47     static void deep_construct(
48       const context_ptr_type & pContext,
49       outermost_context_base_type & outermostContextBase )
50     {
51       outermostContextBase.template construct_with_shallow_history<
52         DefaultState >( pContext );
53     }
54 };
55
56
57
58 } // namespace statechart
59 } // namespace boost
60
61
62
63 #endif