Event.cpp 976 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*
  2. * Author: Patrick-Christopher Mattulat
  3. * Company: Lynar Studios
  4. * E-Mail: webmaster@lynarstudios.com
  5. * Created: 2024-05-16
  6. * Changed: 2024-05-30
  7. *
  8. * */
  9. #include <ls-std/core/evaluator/NullPointerArgumentEvaluator.hpp>
  10. #include <ls-std/event/Event.hpp>
  11. using ls::std::core::Class;
  12. using ls::std::core::NullPointerArgumentEvaluator;
  13. using ls::std::event::Event;
  14. using ::std::shared_ptr;
  15. using ::std::string;
  16. Event::Event(const string &_name) : Class(_name)
  17. {}
  18. Event::~Event() noexcept = default;
  19. shared_ptr<Class> Event::getManager() const
  20. {
  21. return this->manager;
  22. }
  23. void Event::setManager(const shared_ptr<Class> &_manager)
  24. {
  25. NullPointerArgumentEvaluator(_manager).evaluate();
  26. this->manager = _manager;
  27. }
  28. Event Event::supervisedBy(const shared_ptr<Class> &_manager) const
  29. {
  30. NullPointerArgumentEvaluator(_manager).evaluate();
  31. auto event = Event(this->getClassName());
  32. event.setManager(_manager);
  33. return event;
  34. }