Narrator.hpp 864 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /*
  2. * Author: Patrick-Christopher Mattulat
  3. * Company: Lynar Studios
  4. * E-Mail: webmaster@lynarstudios.com
  5. * Created: 2020-11-14
  6. * Changed: 2020-11-28
  7. *
  8. * */
  9. #ifndef LS_STD_NARRATOR_HPP
  10. #define LS_STD_NARRATOR_HPP
  11. #include <ls_std/base/Class.hpp>
  12. #include "IListener.hpp"
  13. #include <list>
  14. #include <memory>
  15. namespace ls_std {
  16. class Narrator : public Class {
  17. public:
  18. Narrator();
  19. ~Narrator() override = default;
  20. void addListener(const std::shared_ptr<ls_std::IListener>& _listener);
  21. void clear();
  22. std::list<std::shared_ptr<ls_std::IListener>> getListeners();
  23. void removeListener(const std::shared_ptr<ls_std::IListener>& _listener);
  24. void tell(const ls_std::Class& _info);
  25. private:
  26. std::list<std::shared_ptr<ls_std::IListener>> listeners {};
  27. };
  28. }
  29. #endif