]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | // Copyright 2008 Christophe Henry |
2 | // henry UNDERSCORE christophe AT hotmail DOT com | |
3 | // This is an extended version of the state machine available in the boost::mpl library | |
4 | // Distributed under the same license as the original. | |
5 | // Copyright for the original version: | |
6 | // Copyright 2005 David Abrahams and Aleksey Gurtovoy. Distributed | |
7 | // under the Boost Software License, Version 1.0. (See accompanying | |
8 | // file LICENSE_1_0.txt or copy at | |
9 | // http://www.boost.org/LICENSE_1_0.txt) | |
10 | ||
11 | #ifndef BOOST_MSM_EVENT_TRAITS_H | |
12 | #define BOOST_MSM_EVENT_TRAITS_H | |
13 | ||
14 | #include <boost/any.hpp> | |
15 | #include <boost/mpl/bool.hpp> | |
16 | ||
17 | namespace boost { namespace msm | |
18 | { | |
19 | ||
20 | template< typename Event > | |
21 | struct is_kleene_event | |
22 | { | |
23 | // default: no event is a kleene event (kleene: matches any event in a transitions) | |
24 | typedef ::boost::mpl::false_ type; | |
25 | }; | |
26 | ||
27 | // add this way in this namespace specializations for events which you want to use as kleene | |
28 | // requirement: a copy-constructor matching the events which will be converted to this kleene | |
29 | template<> | |
30 | struct is_kleene_event< boost::any > | |
31 | { | |
32 | typedef ::boost::mpl::true_ type; | |
33 | }; | |
34 | ||
35 | } } // boost::msm | |
36 | #endif //BOOST_MSM_EVENT_TRAITS_H |