search_colors.hpp 1001 B

123456789101112131415161718192021222324252627282930313233343536373839
  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. #ifndef BOOST_MSM_MPL_GRAPH_SEARCH_COLORS_HPP_INCLUDED
  5. #define BOOST_MSM_MPL_GRAPH_SEARCH_COLORS_HPP_INCLUDED
  6. namespace boost {
  7. namespace msm {
  8. namespace mpl_graph {
  9. namespace search_colors {
  10. struct White {};
  11. struct Gray {};
  12. struct Black {};
  13. }
  14. struct create_search_color_map : mpl::map<> {};
  15. struct search_color_map_ops {
  16. template<typename Node, typename Color, typename State>
  17. struct set_color :
  18. mpl::insert<State, mpl::pair<Node, Color> >
  19. {};
  20. template<typename Node, typename State>
  21. struct get_color :
  22. mpl::if_<mpl::has_key<State, Node>,
  23. mpl::at<State, Node>,
  24. search_colors::White>
  25. {};
  26. };
  27. } // namespace mpl_graph
  28. } // namespace msm
  29. } // namespace boost
  30. #endif // BOOST_MSM_MPL_GRAPH_SEARCH_COLORS_HPP_INCLUDED