Event.hpp 932 B

123456789101112131415161718192021222324252627282930313233343536
  1. // File: Event.hpp
  2. // Author: Nathan Serafin (nathan.serafin@jpl.nasa.gov)
  3. // Date: 27 July, 2018
  4. //
  5. // OS-independent wrapper for events.
  6. #ifndef EVENT_HPP
  7. #define EVENT_HPP
  8. #include <FpConfig.hpp>
  9. #include <Os/TaskId.hpp>
  10. namespace Os {
  11. class Event {
  12. public:
  13. enum Timeout {
  14. EV_NO_WAIT = 0,
  15. EV_WAIT_FOREVER = -1,
  16. };
  17. enum Options {
  18. EV_EVENTS_WAIT_ALL = 0x0U,
  19. EV_EVENTS_WAIT_ANY = 0x1U,
  20. EV_EVENTS_RETURN_ALL = 0x2U,
  21. EV_EVENTS_KEEP_UNWANTED = 0x4U,
  22. EV_EVENTS_FETCH = 0x80U,
  23. };
  24. static I32 send(const TaskId& tid, const U32 events);
  25. static I32 receive(const U32 events, const U8 options,
  26. const I32 timeout, U32* eventsReceived);
  27. static I32 clear();
  28. };
  29. }
  30. #endif