StatechartActive.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. #ifndef STATECHARTACTIVE_H_
  2. #define STATECHARTACTIVE_H_
  3. #include "sc_types.h"
  4. #include "StatemachineInterface.h"
  5. /*! \file Header of the state machine 'StatechartActive'.
  6. */
  7. class StatechartActive : public StatemachineInterface
  8. {
  9. public:
  10. StatechartActive();
  11. ~StatechartActive();
  12. /*! Enumeration of all states */
  13. typedef enum
  14. {
  15. r_A,
  16. StatechartActive_last_state
  17. } StatechartActiveStates;
  18. /*
  19. * Functions inherited from StatemachineInterface
  20. */
  21. virtual void init();
  22. virtual void enter();
  23. virtual void exit();
  24. virtual void runCycle();
  25. /*!
  26. * Checks if the state machine is active (until 2.4.1 this method was used for states).
  27. * A state machine is active if it has been entered. It is inactive if it has not been entered at all or if it has been exited.
  28. */
  29. virtual sc_boolean isActive() const;
  30. /*!
  31. * Checks if all active states are final.
  32. * If there are no active states then the state machine is considered being inactive. In this case this method returns false.
  33. */
  34. virtual sc_boolean isFinal() const;
  35. /*! Checks if the specified state is active (until 2.4.1 the used method for states was calles isActive()). */
  36. sc_boolean isStateActive(StatechartActiveStates state) const;
  37. private:
  38. //! the maximum number of orthogonal states defines the dimension of the state configuration vector.
  39. static const sc_integer maxOrthogonalStates = 1;
  40. StatechartActiveStates stateConfVector[maxOrthogonalStates];
  41. sc_ushort stateConfVectorPosition;
  42. // prototypes of all internal functions
  43. void enseq_r_A_default();
  44. void enseq_r_default();
  45. void exseq_r_A();
  46. void exseq_r();
  47. void react_r_A();
  48. void react_r__entry_Default();
  49. void clearInEvents();
  50. void clearOutEvents();
  51. };
  52. #endif /* STATECHARTACTIVE_H_ */