EventHandler.cpp 806 B

123456789101112131415161718192021222324252627282930313233
  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-07
  7. *
  8. * */
  9. #include <ls-std/core/exception/IllegalArgumentException.hpp>
  10. #include <ls-std/event/EventHandler.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::event::EventHandler::~EventHandler() = default;
  16. ls::std::core::type::event_id ls::std::event::EventHandler::getId()
  17. {
  18. return this->id;
  19. }
  20. void ls::std::event::EventHandler::_assignId(const ls::std::core::type::event_id &_id)
  21. {
  22. if (_id.empty())
  23. {
  24. throw ls::std::core::IllegalArgumentException{"_id is empty"};
  25. }
  26. this->id = _id;
  27. }