InconsistentHistoryTest4.cpp 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. //////////////////////////////////////////////////////////////////////////////
  2. // Copyright 2005-2006 Andreas Huber Doenni
  3. // Distributed under the Boost Software License, Version 1.0. (See accompany-
  4. // ing file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  5. //////////////////////////////////////////////////////////////////////////////
  6. #include <boost/statechart/state_machine.hpp>
  7. #include <boost/statechart/simple_state.hpp>
  8. #include <boost/statechart/event.hpp>
  9. #include <boost/statechart/deep_history.hpp>
  10. #include <boost/statechart/transition.hpp>
  11. namespace sc = boost::statechart;
  12. struct EvX : sc::event< EvX > {};
  13. struct A;
  14. struct InconsistentHistoryTest : sc::state_machine<
  15. InconsistentHistoryTest, A > {};
  16. struct B;
  17. // A only has shallow history
  18. struct A : sc::simple_state<
  19. A, InconsistentHistoryTest, B, sc::has_shallow_history >
  20. {
  21. typedef sc::transition< EvX, sc::deep_history< B > > reactions;
  22. };
  23. struct B : sc::simple_state< B, A > {};
  24. int main()
  25. {
  26. InconsistentHistoryTest machine;
  27. machine.initiate();
  28. return 0;
  29. }