~ubuntu-branches/debian/sid/boost1.49/sid

« back to all changes in this revision

Viewing changes to boost/statechart/deep_history.hpp

  • Committer: Package Import Robot
  • Author(s): Steve M. Robbins
  • Date: 2012-02-26 00:31:44 UTC
  • Revision ID: package-import@ubuntu.com-20120226003144-eaytp12cbf6ubpms
Tags: upstream-1.49.0
ImportĀ upstreamĀ versionĀ 1.49.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef BOOST_STATECHART_DEEP_HISTORY_HPP_INCLUDED
 
2
#define BOOST_STATECHART_DEEP_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 deep_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::deep_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_deep_history<
 
52
        DefaultState >( pContext );
 
53
    }
 
54
};
 
55
 
 
56
 
 
57
 
 
58
} // namespace statechart
 
59
} // namespace boost
 
60
 
 
61
 
 
62
 
 
63
#endif