event.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. // Copyright 2014 Citra Emulator Project
  2. // Licensed under GPLv2 or any later version
  3. // Refer to the license.txt file included.
  4. #pragma once
  5. #include "common/common_types.h"
  6. #include "core/hle/kernel/kernel.h"
  7. #include "core/hle/svc.h"
  8. namespace Kernel {
  9. class Event final : public WaitObject {
  10. public:
  11. /**
  12. * Creates an event
  13. * @param reset_type ResetType describing how to create event
  14. * @param name Optional name of event
  15. */
  16. static SharedPtr<Event> Create(ResetType reset_type, std::string name = "Unknown");
  17. std::string GetTypeName() const override { return "Event"; }
  18. std::string GetName() const override { return name; }
  19. static const HandleType HANDLE_TYPE = HandleType::Event;
  20. HandleType GetHandleType() const override { return HANDLE_TYPE; }
  21. ResetType intitial_reset_type; ///< ResetType specified at Event initialization
  22. ResetType reset_type; ///< Current ResetType
  23. bool signaled; ///< Whether the event has already been signaled
  24. std::string name; ///< Name of event (optional)
  25. bool ShouldWait() override;
  26. void Acquire() override;
  27. void Signal();
  28. void Clear();
  29. private:
  30. Event();
  31. ~Event() override;
  32. };
  33. } // namespace