• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2008-2010 Gordon Woodhull
2 // Distributed under the Boost Software License, Version 1.0.
3 // (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
4 
5 #ifndef BOOST_MSM_MPL_GRAPH_SEARCH_COLORS_HPP_INCLUDED
6 #define BOOST_MSM_MPL_GRAPH_SEARCH_COLORS_HPP_INCLUDED
7 
8 namespace boost {
9 namespace msm {
10 namespace mpl_graph {
11 
12 namespace search_colors {
13     struct White {};
14     struct Gray {};
15     struct Black {};
16 }
17 
18 struct create_search_color_map : mpl::map<> {};
19 
20 struct search_color_map_ops {
21     template<typename Node, typename Color, typename State>
22     struct set_color :
23         mpl::insert<State, mpl::pair<Node, Color> >
24     {};
25     template<typename Node, typename State>
26     struct get_color :
27         mpl::if_<mpl::has_key<State, Node>,
28                  mpl::at<State, Node>,
29                  search_colors::White>
30     {};
31 };
32 
33 
34 } // namespace mpl_graph
35 } // namespace msm
36 } // namespace boost
37 
38 
39 #endif // BOOST_MSM_MPL_GRAPH_SEARCH_COLORS_HPP_INCLUDED
40