Event.hpp 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /*
  2. * Author: Patrick-Christopher Mattulat
  3. * Company: Lynar Studios
  4. * E-Mail: webmaster@lynarstudios.com
  5. * Created: 2020-11-26
  6. * Changed: 2023-02-22
  7. *
  8. * */
  9. #ifndef LS_STD_EVENT_HPP
  10. #define LS_STD_EVENT_HPP
  11. #include <ls-std/core/Class.hpp>
  12. #include <ls-std/core/interface/ISerializable.hpp>
  13. #include <ls-std/core/type/EventTypes.hpp>
  14. #include <ls-std/os/dynamic-goal.hpp>
  15. #include <memory>
  16. namespace ls::std::event
  17. {
  18. class LS_STD_DYNAMIC_GOAL Event : public ls::std::core::Class
  19. {
  20. public:
  21. explicit Event(const ls::std::core::type::event_id &_id);
  22. ~Event() noexcept override;
  23. // additional functionality
  24. bool addParameter(const ls::std::core::type::event_parameter &_eventParameter); // nodiscard is optional here
  25. void clearParameterList();
  26. [[nodiscard]] ls::std::core::type::event_id getId();
  27. [[nodiscard]] ls::std::core::type::event_parameter_list getParameterList();
  28. bool removeParameter(const ls::std::core::type::event_parameter_id &_id); // nodiscard is optional here
  29. void setId(const ls::std::core::type::event_id &_id);
  30. private:
  31. ls::std::core::type::event_id id{};
  32. ls::std::core::type::event_parameter_list parameterList{};
  33. void _assignId(const ls::std::core::type::event_id &_id);
  34. [[nodiscard]] bool _hasParameter(const ls::std::core::type::event_id &_id);
  35. };
  36. }
  37. #endif