FsmAsPtr.hpp 885 B

123456789101112131415161718192021222324252627282930313233343536
  1. // Copyright 2010 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. #ifndef FSM_AS_PTR_H
  11. #define FSM_AS_PTR_H
  12. #include <boost/shared_ptr.hpp>
  13. class player
  14. {
  15. public:
  16. player();
  17. virtual ~player(){}
  18. // public interface
  19. void do_play();
  20. void do_pause();
  21. void do_open_close();
  22. void do_end_pause();
  23. void do_stop();
  24. void do_cd_detected();
  25. private:
  26. // my state machine, hidden
  27. boost::shared_ptr<void> fsm_;
  28. };
  29. #endif //FSM_AS_PTR_H