mirror of
https://github.com/ryujinx-mirror/ryujinx.git
synced 2024-10-21 15:21:41 +00:00
39 lines
774 B
C#
39 lines
774 B
C#
|
namespace Ryujinx.HLE.HOS.Services.SurfaceFlinger.Types
|
|||
|
{
|
|||
|
class AndroidStrongPointer<T> where T: unmanaged, IFlattenable
|
|||
|
{
|
|||
|
public T Object;
|
|||
|
|
|||
|
private bool _hasObject;
|
|||
|
|
|||
|
public bool IsNull => !_hasObject;
|
|||
|
|
|||
|
public AndroidStrongPointer()
|
|||
|
{
|
|||
|
_hasObject = false;
|
|||
|
}
|
|||
|
|
|||
|
public AndroidStrongPointer(T obj)
|
|||
|
{
|
|||
|
Set(obj);
|
|||
|
}
|
|||
|
|
|||
|
public void Set(AndroidStrongPointer<T> other)
|
|||
|
{
|
|||
|
Object = other.Object;
|
|||
|
_hasObject = other._hasObject;
|
|||
|
}
|
|||
|
|
|||
|
public void Set(T obj)
|
|||
|
{
|
|||
|
Object = obj;
|
|||
|
_hasObject = true;
|
|||
|
}
|
|||
|
|
|||
|
public void Reset()
|
|||
|
{
|
|||
|
_hasObject = false;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|