Struct SharedPtr<T>
- Namespace
- Misaki.HighPerformance.LowLevel
- Assembly
- Misaki.HighPerformance.LowLevel.dll
Represents a strongly-typed, read-only pointer to an unmanaged value of type T.
public readonly struct SharedPtr<T> : IEquatable<SharedPtr<T>> where T : unmanaged
Type Parameters
TThe unmanaged type to which the pointer refers.
- Implements
-
IEquatable<SharedPtr<T>>
- Inherited Members
Remarks
When a pointer is wrapped in this struct, it indicates that the code does not intend to manage the lifetime of the data being pointed to.
Constructors
SharedPtr(T*)
public SharedPtr(T* value)
Parameters
valueT*
Methods
Equals(SharedPtr<T>)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(SharedPtr<T> other)
Parameters
otherSharedPtr<T>An object to compare with this object.
Returns
Equals(object?)
Indicates whether this instance and a specified object are equal.
public override bool Equals(object? obj)
Parameters
objobjectThe object to compare with the current instance.
Returns
- bool
true if
objand this instance are the same type and represent the same value; otherwise, false.
Get()
public T* Get()
Returns
- T*
GetHashCode()
Returns the hash code for this instance.
public override int GetHashCode()
Returns
- int
A 32-bit signed integer that is the hash code for this instance.
GetRef()
public ref T GetRef()
Returns
- T
Operators
operator ==(SharedPtr<T>, SharedPtr<T>)
public static bool operator ==(SharedPtr<T> left, SharedPtr<T> right)
Parameters
Returns
implicit operator T*(SharedPtr<T>)
public static implicit operator T*(SharedPtr<T> ptr)
Parameters
ptrSharedPtr<T>
Returns
- T*
implicit operator SharedPtr<T>(T*)
public static implicit operator SharedPtr<T>(T* value)
Parameters
valueT*
Returns
- SharedPtr<T>
operator !=(SharedPtr<T>, SharedPtr<T>)
public static bool operator !=(SharedPtr<T> left, SharedPtr<T> right)