Narrator.hpp 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*
  2. * Author: Patrick-Christopher Mattulat
  3. * Company: Lynar Studios
  4. * E-Mail: webmaster@lynarstudios.com
  5. * Created: 2020-11-14
  6. * Changed: 2022-07-03
  7. *
  8. * */
  9. #ifndef LS_STD_NARRATOR_HPP
  10. #define LS_STD_NARRATOR_HPP
  11. #include <ls_std/core/Class.hpp>
  12. #include <ls_std/core/interface/IListener.hpp>
  13. #include <ls_std/os/dynamic_goal.hpp>
  14. #include <list>
  15. #include <memory>
  16. namespace ls
  17. {
  18. namespace std
  19. {
  20. namespace event
  21. {
  22. class LS_STD_DYNAMIC_GOAL Narrator : public ls::std::core::Class
  23. {
  24. public:
  25. Narrator();
  26. ~Narrator() override = default;
  27. bool addListener(const ::std::shared_ptr<ls::std::core::interface_type::IListener> &_listener);
  28. void clear();
  29. ::std::list<::std::shared_ptr<ls::std::core::interface_type::IListener>> getListeners();
  30. bool removeListener(const ::std::shared_ptr<ls::std::core::interface_type::IListener> &_listener);
  31. void tell(const ls::std::core::Class &_info);
  32. private:
  33. ::std::list<::std::shared_ptr<ls::std::core::interface_type::IListener>> listeners{};
  34. };
  35. }
  36. }
  37. }
  38. #endif