StateConnection.hpp 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*
  2. * Author: Patrick-Christopher Mattulat
  3. * Company: Lynar Studios
  4. * E-Mail: webmaster@lynarstudios.com
  5. * Created: 2020-09-10
  6. * Changed: 2021-05-27
  7. *
  8. * */
  9. #ifndef LS_STD_STATE_CONNECTION_HPP
  10. #define LS_STD_STATE_CONNECTION_HPP
  11. #include <memory>
  12. #include <ls_std/base/Class.hpp>
  13. #include "StateMachineTypes.hpp"
  14. namespace ls_std
  15. {
  16. class StateConnection : public ls_std::Class
  17. {
  18. public:
  19. explicit StateConnection(const ls_std::StateConnectionId& _connectionId, const ls_std::StateId& _stateId);
  20. ~StateConnection() override = default;
  21. StateConnectionId getConnectionId();
  22. ls_std::StateId getStateId();
  23. bool isPassable() const;
  24. void setConnectionId(const ls_std::StateConnectionId& _connectionId);
  25. void setStateId(const ls_std::StateId& _stateId);
  26. void updatePassCondition(bool _condition);
  27. private:
  28. bool condition{};
  29. ls_std::StateConnectionId connectionId{};
  30. ls_std::StateId stateId{};
  31. void _assignConnectionId(const ls_std::StateConnectionId& _connectionId);
  32. void _assignStateId(const ls_std::StateId& _stateId);
  33. };
  34. }
  35. #endif