Narrator.hpp 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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::std::event
  17. {
  18. class LS_STD_DYNAMIC_GOAL Narrator : public ls::std::core::Class
  19. {
  20. public:
  21. Narrator();
  22. ~Narrator() override = default;
  23. bool addListener(const ::std::shared_ptr<ls::std::core::interface_type::IListener> &_listener);
  24. void clear();
  25. ::std::list<::std::shared_ptr<ls::std::core::interface_type::IListener>> getListeners();
  26. bool removeListener(const ::std::shared_ptr<ls::std::core::interface_type::IListener> &_listener);
  27. void tell(const ls::std::core::Class &_info);
  28. private:
  29. ::std::list<::std::shared_ptr<ls::std::core::interface_type::IListener>> listeners{};
  30. };
  31. }
  32. #endif