Files
eden/src/core/hle/kernel/readable_event.h
T

65 lines
1.5 KiB
C++
Raw Normal View History

// Copyright 2014 Citra Emulator Project
2014-12-16 21:38:14 -08:00
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#pragma once
#include "core/hle/kernel/object.h"
2017-05-29 15:45:30 -07:00
#include "core/hle/kernel/wait_object.h"
union ResultCode;
namespace Kernel {
2018-08-28 12:30:33 -04:00
class KernelCore;
class WritableEvent;
class ReadableEvent final : public WaitObject {
friend class WritableEvent;
2018-08-28 12:30:33 -04:00
2015-01-23 03:11:25 -02:00
public:
~ReadableEvent() override;
2015-01-23 03:11:25 -02:00
2016-09-18 09:38:01 +09:00
std::string GetTypeName() const override {
return "ReadableEvent";
2016-09-18 09:38:01 +09:00
}
std::string GetName() const override {
return name;
}
2015-01-23 03:11:25 -02:00
ResetType GetResetType() const {
return reset_type;
}
static const HandleType HANDLE_TYPE = HandleType::ReadableEvent;
2016-09-18 09:38:01 +09:00
HandleType GetHandleType() const override {
return HANDLE_TYPE;
}
2015-01-23 03:11:25 -02:00
bool ShouldWait(Thread* thread) const override;
void Acquire(Thread* thread) override;
2015-01-23 03:11:25 -02:00
/// Unconditionally clears the readable event's state.
2015-01-23 03:11:25 -02:00
void Clear();
/// Clears the readable event's state if and only if it
/// has already been signaled.
///
/// @pre The event must be in a signaled state. If this event
/// is in an unsignaled state and this function is called,
/// then ERR_INVALID_STATE will be returned.
ResultCode Reset();
2015-01-23 03:11:25 -02:00
private:
explicit ReadableEvent(KernelCore& kernel);
2018-08-06 12:52:21 -04:00
void Signal();
ResetType reset_type;
bool signaled;
2018-08-06 12:52:21 -04:00
std::string name; ///< Name of event (optional)
2015-01-23 03:11:25 -02:00
};
} // namespace Kernel