EventHandler.cpp 734 B

12345678910111213141516171819202122232425262728293031
  1. /*
  2. * Author: Patrick-Christopher Mattulat
  3. * Company: Lynar Studios
  4. * E-Mail: webmaster@lynarstudios.com
  5. * Created: 2020-11-27
  6. * Changed: 2022-05-12
  7. *
  8. * */
  9. #include <ls_std/event/EventHandler.hpp>
  10. #include <ls_std/core/exception/IllegalArgumentException.hpp>
  11. ls::std::event::EventHandler::EventHandler(const ls::std::core::type::event_id& _id) : ls::std::event::Narrator()
  12. {
  13. this->_assignId(_id);
  14. }
  15. ls::std::core::type::event_id ls::std::event::EventHandler::getId()
  16. {
  17. return this->id;
  18. }
  19. void ls::std::event::EventHandler::_assignId(const ls::std::core::type::event_id &_id)
  20. {
  21. if (_id.empty())
  22. {
  23. throw ls::std::core::IllegalArgumentException{};
  24. }
  25. this->id = _id;
  26. }