Event.hpp 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*
  2. * Author: Patrick-Christopher Mattulat
  3. * Company: Lynar Studios
  4. * E-Mail: webmaster@lynarstudios.com
  5. * Created: 2020-11-26
  6. * Changed: 2024-05-24
  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. /*
  17. * @class(name: 'Event', package: 'event')
  18. * */
  19. namespace ls::std::event
  20. {
  21. class LS_STD_DYNAMIC_GOAL Event : public ls::std::core::Class
  22. {
  23. public:
  24. explicit Event(const ls::std::core::type::event_id &_id);
  25. ~Event() noexcept override;
  26. // additional functionality
  27. bool addParameter(const ls::std::core::type::event_parameter &_eventParameter); // nodiscard is optional here
  28. void clearParameterList();
  29. [[nodiscard]] ls::std::core::type::event_id getId() const;
  30. [[nodiscard]] ls::std::core::type::event_parameter_list getParameterList() const;
  31. bool removeParameter(const ls::std::core::type::event_parameter_id &_id); // nodiscard is optional here
  32. void setId(const ls::std::core::type::event_id &_id);
  33. private:
  34. ls::std::core::type::event_id id{};
  35. ls::std::core::type::event_parameter_list parameterList{};
  36. void _assignId(const ls::std::core::type::event_id &_id);
  37. [[nodiscard]] bool _hasParameter(const ls::std::core::type::event_id &_id);
  38. };
  39. }
  40. #endif