Narrator.hpp 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*
  2. * Author: Patrick-Christopher Mattulat
  3. * Company: Lynar Studios
  4. * E-Mail: webmaster@lynarstudios.com
  5. * Created: 2020-11-14
  6. * Changed: 2022-05-16
  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 <list>
  14. #include <memory>
  15. namespace ls
  16. {
  17. namespace std
  18. {
  19. namespace event
  20. {
  21. class Narrator : public ls::std::core::Class
  22. {
  23. public:
  24. Narrator();
  25. ~Narrator() override = default;
  26. bool addListener(const ::std::shared_ptr<ls::std::core::interface::IListener> &_listener);
  27. void clear();
  28. ::std::list<::std::shared_ptr<ls::std::core::interface::IListener>> getListeners();
  29. bool removeListener(const ::std::shared_ptr<ls::std::core::interface::IListener> &_listener);
  30. void tell(const ls::std::core::Class &_info);
  31. private:
  32. ::std::list<::std::shared_ptr<ls::std::core::interface::IListener>> listeners{};
  33. };
  34. }
  35. }
  36. }
  37. #endif