base_event.hpp 1002 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #ifndef BOOST_FSM_BASE_EVENT_INCLUDED
  2. #define BOOST_FSM_BASE_EVENT_INCLUDED
  3. // Copyright Aleksey Gurtovoy 2002-2004
  4. //
  5. // Distributed under the Boost Software License, Version 1.0.
  6. // (See accompanying file LICENSE_1_0.txt or copy at
  7. // http://www.boost.org/LICENSE_1_0.txt)
  8. //
  9. // See http://www.boost.org/libs/mpl for documentation.
  10. // $Id$
  11. // $Date$
  12. // $Revision$
  13. #include <memory>
  14. #include <boost/config.hpp>
  15. namespace fsm { namespace aux {
  16. // represent an abstract base for FSM events
  17. struct base_event
  18. {
  19. public:
  20. virtual ~base_event() {};
  21. #if defined(BOOST_NO_CXX11_SMART_PTR)
  22. std::auto_ptr<base_event> clone() const
  23. #else
  24. std::unique_ptr<base_event> clone() const
  25. #endif
  26. {
  27. return do_clone();
  28. }
  29. private:
  30. #if defined(BOOST_NO_CXX11_SMART_PTR)
  31. virtual std::auto_ptr<base_event> do_clone() const = 0;
  32. #else
  33. virtual std::unique_ptr<base_event> do_clone() const = 0;
  34. #endif
  35. };
  36. }}
  37. #endif // BOOST_FSM_BASE_EVENT_INCLUDED