Camera.cpp 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. //////////////////////////////////////////////////////////////////////////////
  2. // Copyright 2002-2006 Andreas Huber Doenni
  3. // Distributed under the Boost Software License, Version 1.0. (See accompany-
  4. // ing file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  5. //////////////////////////////////////////////////////////////////////////////
  6. #include "Precompiled.hpp"
  7. #include "Camera.hpp"
  8. #include "Configuring.hpp"
  9. #include "Shooting.hpp"
  10. //////////////////////////////////////////////////////////////////////////////
  11. NotShooting::NotShooting()
  12. {
  13. std::cout << "Entering NotShooting\n";
  14. }
  15. NotShooting::~NotShooting()
  16. {
  17. std::cout << "Exiting NotShooting\n";
  18. }
  19. sc::result NotShooting::react( const EvShutterHalf & )
  20. {
  21. if ( context< Camera >().IsBatteryLow() )
  22. {
  23. return forward_event();
  24. }
  25. else
  26. {
  27. return transit< Shooting >();
  28. }
  29. }
  30. //////////////////////////////////////////////////////////////////////////////
  31. Idle::Idle()
  32. {
  33. std::cout << "Entering Idle\n";
  34. }
  35. Idle::~Idle()
  36. {
  37. std::cout << "Exiting Idle\n";
  38. }
  39. sc::result Idle::react( const EvConfig & )
  40. {
  41. return transit< Configuring >();
  42. }