Port "kernel/event: Make data members private" from yuzu (#4077)

* kernel/event: Make data members private

Instead we can simply provide accessors to the required data instead of
giving external read/write access to the variables directly.

* fix compile error
This commit is contained in:
zhaowenlan1779 2018-08-25 01:43:29 +08:00 committed by Tobias
parent 75927ee462
commit 642f0bd62b
5 changed files with 19 additions and 11 deletions

View file

@ -25,16 +25,18 @@ public:
std::string GetName() const override {
return name;
}
void SetName(const std::string& name) {
this->name = name;
}
static const HandleType HANDLE_TYPE = HandleType::Event;
HandleType GetHandleType() const override {
return HANDLE_TYPE;
}
ResetType reset_type; ///< Current ResetType
bool signaled; ///< Whether the event has already been signaled
std::string name; ///< Name of event (optional)
ResetType GetResetType() const {
return reset_type;
}
bool ShouldWait(Thread* thread) const override;
void Acquire(Thread* thread) override;
@ -47,6 +49,11 @@ public:
private:
Event();
~Event() override;
ResetType reset_type; ///< Current ResetType
bool signaled; ///< Whether the event has already been signaled
std::string name; ///< Name of event (optional)
};
} // namespace Kernel