EventHandler.cpp 651 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: 2021-05-27
  7. *
  8. * */
  9. #include <ls_std/event/EventHandler.hpp>
  10. #include <ls_std/exception/IllegalArgumentException.hpp>
  11. ls_std::EventHandler::EventHandler(const ls_std::event_id& _id) : ls_std::Narrator()
  12. {
  13. this->_assignId(_id);
  14. }
  15. ls_std::event_id ls_std::EventHandler::getId()
  16. {
  17. return this->id;
  18. }
  19. void ls_std::EventHandler::_assignId(const ls_std::event_id &_id)
  20. {
  21. if (_id.empty())
  22. {
  23. throw ls_std::IllegalArgumentException{};
  24. }
  25. this->id = _id;
  26. }