TaskId.hpp 807 B

123456789101112131415161718192021222324252627282930
  1. // File: TaskId.hpp
  2. // Author: Ben Soudry (benjamin.s.soudry@jpl.nasa.gov)
  3. // Nathan Serafin (nathan.serafin@jpl.nasa.gov)
  4. // Date: 29 June, 2018
  5. //
  6. // Define a type for task IDs. This is useful as POSIX only
  7. // provides an opaque TID with a special pthread_equal() comparison
  8. // function. For higher-level code to not need to be aware of
  9. // POSIX versus VxWorks versus whatever else, we can overload the
  10. // == operator to perform the correct equality check.
  11. #ifndef _TaskId_hpp_
  12. #define _TaskId_hpp_
  13. #include <Os/TaskIdRepr.hpp>
  14. namespace Os {
  15. class TaskId {
  16. public:
  17. TaskId();
  18. ~TaskId();
  19. bool operator==(const TaskId& T) const;
  20. bool operator!=(const TaskId& T) const;
  21. TaskIdRepr getRepr() const;
  22. private:
  23. TaskIdRepr id;
  24. };
  25. }
  26. #endif