null_exception_translator.hpp 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #ifndef BOOST_STATECHART_NULL_EXCEPTION_TRANSLATOR_HPP_INCLUDED
  2. #define BOOST_STATECHART_NULL_EXCEPTION_TRANSLATOR_HPP_INCLUDED
  3. //////////////////////////////////////////////////////////////////////////////
  4. // Copyright 2002-2006 Andreas Huber Doenni
  5. // Distributed under the Boost Software License, Version 1.0. (See accompany-
  6. // ing file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  7. //////////////////////////////////////////////////////////////////////////////
  8. #include <boost/statechart/result.hpp>
  9. namespace boost
  10. {
  11. namespace statechart
  12. {
  13. //////////////////////////////////////////////////////////////////////////////
  14. class null_exception_translator
  15. {
  16. public:
  17. //////////////////////////////////////////////////////////////////////////
  18. // The following declarations should be private.
  19. // They are only public because many compilers lack template friends.
  20. //////////////////////////////////////////////////////////////////////////
  21. template< class Action, class ExceptionEventHandler >
  22. result operator()( Action action, ExceptionEventHandler )
  23. {
  24. return action();
  25. }
  26. };
  27. } // namespace statechart
  28. } // namespace boost
  29. #endif