Chris@16: #ifndef BOOST_STATECHART_SHALLOW_HISTORY_HPP_INCLUDED Chris@16: #define BOOST_STATECHART_SHALLOW_HISTORY_HPP_INCLUDED Chris@16: ////////////////////////////////////////////////////////////////////////////// Chris@16: // Copyright 2002-2006 Andreas Huber Doenni Chris@16: // Distributed under the Boost Software License, Version 1.0. (See accompany- Chris@16: // ing file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) Chris@16: ////////////////////////////////////////////////////////////////////////////// Chris@16: Chris@16: Chris@16: Chris@16: #include Chris@16: #include Chris@16: Chris@16: Chris@16: Chris@16: namespace boost Chris@16: { Chris@16: namespace statechart Chris@16: { Chris@16: Chris@16: Chris@16: Chris@16: ////////////////////////////////////////////////////////////////////////////// Chris@16: template< class DefaultState > Chris@16: class shallow_history Chris@16: { Chris@16: public: Chris@16: ////////////////////////////////////////////////////////////////////////// Chris@16: // If you receive a Chris@16: // "use of undefined type 'boost::STATIC_ASSERTION_FAILURE'" or similar Chris@16: // compiler error here then you forgot to pass either Chris@16: // statechart::has_deep_history or statechart::has_full_history as the Chris@16: // last parameter of DefaultState's context. Chris@16: BOOST_STATIC_ASSERT( DefaultState::context_type::shallow_history::value ); Chris@16: Chris@16: ////////////////////////////////////////////////////////////////////////// Chris@16: // The following declarations should be private. Chris@16: // They are only public because many compilers lack template friends. Chris@16: ////////////////////////////////////////////////////////////////////////// Chris@16: typedef typename DefaultState::outermost_context_base_type Chris@16: outermost_context_base_type; Chris@16: typedef typename DefaultState::context_type context_type; Chris@16: typedef typename DefaultState::context_ptr_type context_ptr_type; Chris@16: typedef typename DefaultState::context_type_list context_type_list; Chris@16: typedef typename DefaultState::orthogonal_position orthogonal_position; Chris@16: Chris@16: static void deep_construct( Chris@16: const context_ptr_type & pContext, Chris@16: outermost_context_base_type & outermostContextBase ) Chris@16: { Chris@16: outermostContextBase.template construct_with_shallow_history< Chris@16: DefaultState >( pContext ); Chris@16: } Chris@16: }; Chris@16: Chris@16: Chris@16: Chris@16: } // namespace statechart Chris@16: } // namespace boost Chris@16: Chris@16: Chris@16: Chris@16: #endif