Atmosphere/libraries/libstratosphere/source/os/impl/os_interrupt_event_impl.hpp

59 lines
1.6 KiB
C++
Raw Normal View History

2020-04-08 09:21:35 +00:00
/*
* Copyright (c) Atmosphère-NX
2020-04-08 09:21:35 +00:00
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include <stratosphere.hpp>
#if defined(ATMOSPHERE_OS_HORIZON)
#include "os_interrupt_event_target_impl.os.horizon.hpp"
#else
#error "Unknown OS for ams::os::InterruptEventImpl"
#endif
namespace ams::os::impl {
class InterruptEventImpl {
private:
2021-10-10 07:14:06 +00:00
InterruptEventTargetImpl m_impl;
2020-04-08 09:21:35 +00:00
public:
2021-10-10 07:14:06 +00:00
explicit InterruptEventImpl(InterruptName name, EventClearMode clear_mode) : m_impl(name, clear_mode) { /* ... */ }
2020-04-08 09:21:35 +00:00
void Clear() {
2021-10-10 07:14:06 +00:00
return m_impl.Clear();
2020-04-08 09:21:35 +00:00
}
void Wait() {
2021-10-10 07:14:06 +00:00
return m_impl.Wait();
2020-04-08 09:21:35 +00:00
}
bool TryWait() {
2021-10-10 07:14:06 +00:00
return m_impl.TryWait();
2020-04-08 09:21:35 +00:00
}
bool TimedWait(TimeSpan timeout) {
2021-10-10 07:14:06 +00:00
return m_impl.TimedWait(timeout);
2020-04-08 09:21:35 +00:00
}
TriBool IsSignaled() {
2021-10-10 07:14:06 +00:00
return m_impl.IsSignaled();
2020-04-08 09:21:35 +00:00
}
NativeHandle GetHandle() const {
2021-10-10 07:14:06 +00:00
return m_impl.GetHandle();
2020-04-08 09:21:35 +00:00
}
};
}