Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_34_1/libs/statechart/test/InvalidTransitionTest1.cpp @ 29

Last change on this file since 29 was 29, checked in by landauf, 16 years ago

updated boost from 1_33_1 to 1_34_1

File size: 1.2 KB
Line 
1//////////////////////////////////////////////////////////////////////////////
2// Copyright 2004-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
7
8
9#include <boost/statechart/state_machine.hpp>
10#include <boost/statechart/simple_state.hpp>
11#include <boost/statechart/event.hpp>
12#include <boost/statechart/transition.hpp>
13
14#include <boost/mpl/list.hpp>
15
16
17
18namespace sc = boost::statechart;
19namespace mpl = boost::mpl;
20
21
22
23struct EvX : sc::event< EvX > {};
24
25struct Active;
26struct InvalidTransitionTest : sc::state_machine<
27  InvalidTransitionTest, Active > {};
28
29struct Idle0;
30struct Idle1;
31struct Active : sc::simple_state<
32  Active, InvalidTransitionTest, mpl::list< Idle0, Idle1 > > {};
33
34  // Invalid transition between different orthogonal regions.
35  struct Idle0 : sc::simple_state< Idle0, Active::orthogonal< 0 > >
36  {
37    typedef sc::transition< EvX, Idle1 > reactions;
38  };
39
40  struct Idle1 : sc::simple_state< Idle1, Active::orthogonal< 1 > > {};
41
42
43int main()
44{
45  InvalidTransitionTest machine;
46  machine.initiate();
47  return 0;
48}
Note: See TracBrowser for help on using the repository browser.