State.hpp 873 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /*
  2. * Author: Patrick-Christopher Mattulat
  3. * Company: Lynar Studios
  4. * E-Mail: webmaster@lynarstudios.com
  5. * Created: 2020-09-05
  6. * Changed: 2020-09-10
  7. *
  8. * */
  9. #ifndef LS_STD_STATE_HPP
  10. #define LS_STD_STATE_HPP
  11. #include <memory>
  12. #include <unordered_map>
  13. #include "../base/Class.hpp"
  14. namespace ls_std {
  15. class State : public Class {
  16. public:
  17. explicit State(std::string _id);
  18. ~State() = default;
  19. bool addStateConnection(const std::string& _connectionId, const std::shared_ptr<State>& _connectedState);
  20. std::unordered_map<std::string, std::shared_ptr<State>> getConnectedStates();
  21. std::string getId();
  22. private:
  23. std::unordered_map<std::string, std::shared_ptr<State>> connectedStates {};
  24. std::string id {};
  25. bool _stateIsConnected(const std::string& _id);
  26. };
  27. }
  28. #endif