EventHandler.cpp 816 B

12345678910111213141516171819202122232425262728293031323334
  1. /*
  2. * Author: Patrick-Christopher Mattulat
  3. * Company: Lynar Studios
  4. * E-Mail: webmaster@lynarstudios.com
  5. * Created: 2020-11-27
  6. * Changed: 2023-02-23
  7. *
  8. * */
  9. #include <ls-std/core/evaluator/EmptyStringArgumentEvaluator.hpp>
  10. #include <ls-std/event/EventHandler.hpp>
  11. using ls::std::core::EmptyStringArgumentEvaluator;
  12. using ls::std::core::type::event_id;
  13. using ls::std::event::EventHandler;
  14. using ls::std::event::Narrator;
  15. EventHandler::EventHandler(const event_id &_id) : Narrator()
  16. {
  17. this->_assignId(_id);
  18. }
  19. EventHandler::~EventHandler() noexcept = default;
  20. event_id EventHandler::getId()
  21. {
  22. return this->id;
  23. }
  24. void EventHandler::_assignId(const event_id &_id)
  25. {
  26. EmptyStringArgumentEvaluator{_id, "event manager id is empty!"}.evaluate();
  27. this->id = _id;
  28. }