Event.cpp 966 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-17
  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. Event Event::of(const shared_ptr<Class> &_manager) const
  24. {
  25. NullPointerArgumentEvaluator(_manager).evaluate();
  26. auto event = Event(this->getClassName());
  27. event.setManager(_manager);
  28. return event;
  29. }
  30. void Event::setManager(const shared_ptr<Class> &_manager)
  31. {
  32. NullPointerArgumentEvaluator(_manager).evaluate();
  33. this->manager = _manager;
  34. }