mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2026-03-20 14:24:17 +00:00
53 lines
1.3 KiB
C++
53 lines
1.3 KiB
C++
#pragma once
|
|
|
|
class KProcess;
|
|
|
|
#include <mesosphere/core/util.hpp>
|
|
#include <mesosphere/core/Result.hpp>
|
|
#include <mesosphere/core/KAutoObject.hpp>
|
|
#include <mesosphere/interfaces/ISetAllocated.hpp>
|
|
#include <mesosphere/interfaces/ILimitedResource.hpp>
|
|
#include <mesosphere/interfaces/IClientServerParent.hpp>
|
|
#include <mesosphere/processes/KReadableEvent.hpp>
|
|
#include <mesosphere/processes/KWritableEvent.hpp>
|
|
|
|
namespace mesosphere
|
|
{
|
|
|
|
class KEvent final :
|
|
public KAutoObject,
|
|
public IClientServerParent<KEvent, KReadableEvent, KWritableEvent>,
|
|
public ISetAllocated<KEvent>,
|
|
public ILimitedResource<KEvent> {
|
|
public:
|
|
MESOSPHERE_AUTO_OBJECT_TRAITS(AutoObject, Event);
|
|
MESOSPHERE_CLIENT_SERVER_PARENT_TRAITS(ReadableEvent, WritableEvent);
|
|
MESOSPHERE_LIMITED_RESOURCE_TRAITS(1s);
|
|
|
|
virtual ~KEvent();
|
|
|
|
Result Initialize();
|
|
|
|
/* KAutoObject */
|
|
virtual bool IsAlive() const override;
|
|
|
|
/* IClientServerParent */
|
|
void HandleServerDestroyed() { }
|
|
void HandleClientDestroyed() { }
|
|
|
|
private:
|
|
bool isInitialized = false;
|
|
};
|
|
|
|
inline void intrusive_ptr_add_ref(KEvent *obj)
|
|
{
|
|
intrusive_ptr_add_ref((KAutoObject *)obj);
|
|
}
|
|
|
|
inline void intrusive_ptr_release(KEvent *obj)
|
|
{
|
|
intrusive_ptr_release((KAutoObject *)obj);
|
|
}
|
|
|
|
}
|